From: Tim Kientzle Date: Sun, 7 Dec 2008 11:42:15 +0000 (-0500) Subject: Provide configure options to suppress use of zlib, bzlib, and lzmadec. X-Git-Tag: v2.6.0~22 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2186dc246f1463afa4af5328501f8cf929c63ef7;p=thirdparty%2Flibarchive.git Provide configure options to suppress use of zlib, bzlib, and lzmadec. There are a few issues that should be addressed: The test suites shouldn't rely so heavily on gzip support; zip decoder should have a private CRC calculation so it can read (uncompressed) zip archives without zlib. Submitted by: Diego Petten\242 SVN-Revision: 271 --- diff --git a/configure.ac b/configure.ac index fdda9f004..7e9c36c89 100644 --- a/configure.ac +++ b/configure.ac @@ -162,17 +162,37 @@ AM_CONDITIONAL([STATIC_BSDCPIO], [ test "$static_bsdcpio" = yes ]) AC_HEADER_STDC AC_HEADER_DIRENT AC_HEADER_SYS_WAIT -AC_CHECK_HEADERS([bzlib.h errno.h ext2fs/ext2_fs.h fcntl.h grp.h]) +AC_CHECK_HEADERS([errno.h ext2fs/ext2_fs.h fcntl.h grp.h]) AC_CHECK_HEADERS([inttypes.h langinfo.h limits.h linux/fs.h]) -AC_CHECK_HEADERS([locale.h lzmadec.h paths.h poll.h pwd.h regex.h stdarg.h]) +AC_CHECK_HEADERS([locale.h paths.h poll.h pwd.h regex.h stdarg.h]) AC_CHECK_HEADERS([stdint.h stdlib.h string.h sys/acl.h sys/ioctl.h]) AC_CHECK_HEADERS([sys/param.h sys/poll.h sys/select.h sys/time.h sys/utime.h]) -AC_CHECK_HEADERS([time.h unistd.h utime.h wchar.h zlib.h]) +AC_CHECK_HEADERS([time.h unistd.h utime.h wchar.h]) # Checks for libraries. -AC_CHECK_LIB(bz2,BZ2_bzDecompressInit) -AC_CHECK_LIB(z,inflate) -AC_CHECK_LIB(lzmadec,lzmadec_decode) +AC_ARG_WITH([zlib], + AS_HELP_STRING([--without-zlib], [Don't build support for gzip through zlib])) + +if test "x$with_zlib" != "xno"; then + AC_CHECK_HEADERS([zlib.h]) + AC_CHECK_LIB(z,inflate) +fi + +AC_ARG_WITH([bz2lib], + AS_HELP_STRING([--without-bz2lib], [Don't build support for bzip2 through bz2lib])) + +if test "x$with_bz2lib" != "xno"; then + AC_CHECK_HEADERS([bzlib.h]) + AC_CHECK_LIB(bz2,BZ2_bzDecompressInit) +fi + +AC_ARG_WITH([lzmadec], + AS_HELP_STRING([--without-lzmadec], [Don't build support for lzma through lzmadec])) + +if test "x$with_lzmadec" != "xno"; then + AC_CHECK_HEADERS([lzmadec.h]) + AC_CHECK_LIB(lzmadec,lzmadec_decode) +fi # TODO: Give the user the option of using a pre-existing system # libarchive. This will define HAVE_LIBARCHIVE which will cause