]> git.lizzy.rs Git - zlib.git/commitdiff
Add an --enable-demos option to contrib/minizip/configure.
authorJonathan Nieder <jrnieder@gmail.com>
Sat, 21 Jan 2012 21:55:54 +0000 (15:55 -0600)
committerMark Adler <madler@alumni.caltech.edu>
Sun, 22 Jan 2012 01:15:48 +0000 (17:15 -0800)
This makes build-testing and installing the minizip/miniunzip programs
as simple as "autoreconf -if && ./configure --enable-demos && make &&
make install".  Without --enable-demos, the makefile will only build
and install the library, as before.  Helped by Mike Frysinger.

minizip/miniunzip were not intended to be general-purpose installed
utilities, but they can be useful from time to time as a lightweight
substitute for zip/unzip.  You can also use them to quickly test that
the library installation procedure worked.

contrib/minizip/Makefile.am
contrib/minizip/configure.ac

index b0f39b6c82549852a11454a50bdec8ef9055836f..2ced91367e008b152c570e0a39300699887192aa 100644 (file)
@@ -1,5 +1,9 @@
 lib_LTLIBRARIES = libminizip.la
 
+if COND_DEMOS
+bin_PROGRAMS = miniunzip minizip
+endif
+
 zlib_top_srcdir = $(top_srcdir)/../..
 zlib_top_builddir = $(top_builddir)/../..
 
index 4799cdc7116040b736dd6484fadada2e8b1cb29c..53adbb89b7aaec4f57893cca15e58ae74ea7ba62 100644 (file)
@@ -6,6 +6,16 @@ AC_CONFIG_SRCDIR([minizip.c])
 AM_INIT_AUTOMAKE([foreign])
 LT_INIT
 
+AC_MSG_CHECKING([whether to build example programs])
+AC_ARG_ENABLE([demos], AC_HELP_STRING([--enable-demos], [build example programs]))
+AM_CONDITIONAL([COND_DEMOS], [test "$enable_demos" = yes])
+if test "$enable_demos" = yes
+then
+       AC_MSG_RESULT([yes])
+else
+       AC_MSG_RESULT([no])
+fi
+
 AC_SUBST([HAVE_UNISTD_H], [0])
 AC_CHECK_HEADER([unistd.h], [HAVE_UNISTD_H=1], [])
 AC_CONFIG_FILES([Makefile minizip.pc])