From d3cd27c3b6cdb47ef91c4ffba51257ebd46b1250 Mon Sep 17 00:00:00 2001 From: David Shaw Date: Fri, 31 Oct 2003 05:39:41 +0000 Subject: [PATCH] * configure.ac: Locate libbz2 for bzip2 compression support. --- ChangeLog | 4 ++++ configure.ac | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) diff --git a/ChangeLog b/ChangeLog index f11b71aca..1c6b15ea7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2003-10-30 David Shaw + + * configure.ac: Locate libbz2 for bzip2 compression support. + 2003-10-26 David Shaw * NEWS: Note --symmetric --encrypt and the improved config file diff --git a/configure.ac b/configure.ac index 97ae48c33..88cb3501d 100644 --- a/configure.ac +++ b/configure.ac @@ -119,6 +119,7 @@ use_aes=yes use_twofish=yes use_sha256=yes use_sha512=yes +use_bzip2=yes use_exec=yes AC_ARG_ENABLE(minimal, @@ -130,6 +131,7 @@ AC_ARG_ENABLE(minimal, use_twofish=no use_sha256=no use_sha512=no + use_bzip2=no use_exec=no) AC_MSG_CHECKING([whether to enable the IDEA cipher]) @@ -211,6 +213,13 @@ AC_ARG_ENABLE(sha512, use_sha512=$enableval) AC_MSG_RESULT($use_sha512) +dnl BZLIB is defined only after we confirm the library is available later +AC_MSG_CHECKING([whether to enable the BZIP2 compression algorithm]) +AC_ARG_ENABLE(bzip2, + AC_HELP_STRING([--disable-bzip2],[disable the BZIP2 compression algorithm]), + use_bzip2=$enableval) +AC_MSG_RESULT($use_bzip2) + AC_MSG_CHECKING([whether to enable external program execution]) AC_ARG_ENABLE(exec, AC_HELP_STRING([--disable-exec],[disable all external program execution]), @@ -996,6 +1005,34 @@ if test "$use_local_zlib" = yes ; then else AM_CONDITIONAL(ENABLE_LOCAL_ZLIB, false) fi + +if test "$use_bzip2" = yes ; then + _cppflags="${CPPFLAGS}" + _ldflags="${LDFLAGS}" + AC_ARG_WITH(bzip2, + AC_HELP_STRING([--with-bzip2=DIR],[look for bzip2 in DIR]), + [ + if test -d "$withval" ; then + CPPFLAGS="${CPPFLAGS} -I$withval/include" + LDFLAGS="${LDFLAGS} -L$withval/lib" + fi + ],withval="") + + if test "$withval" != no ; then + AC_CHECK_HEADER(bzlib.h, + AC_CHECK_LIB(bz2,BZ2_bzCompressInit, + [ + have_bz2=yes + ZLIBS="$ZLIBS -lbz2" + AC_DEFINE(HAVE_BZIP2,1, + [Defined if the bz2 compression library is available]) + ], + CPPFLAGS=${_cppflags} LDFLAGS=${_ldflags}), + CPPFLAGS=${_cppflags} LDFLAGS=${_ldflags}) + fi +fi + +AM_CONDITIONAL(ENABLE_BZIP2_SUPPORT,test x"$have_bz2" = "xyes") AC_SUBST(ZLIBS)