diff --git a/Makefile.in b/Makefile.in index 9e51f65c..f8757683 100644 --- a/Makefile.in +++ b/Makefile.in @@ -65,7 +65,8 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acx_pthread.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/mbedtls.m4 \ $(top_srcdir)/m4/openssl.m4 $(top_srcdir)/m4/polarssl.m4 \ - $(top_srcdir)/libev/libev.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/zlib.m4 $(top_srcdir)/libev/libev.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ diff --git a/aclocal.m4 b/aclocal.m4 index fd53e841..ceaf07fe 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1173,3 +1173,4 @@ m4_include([m4/lt~obsolete.m4]) m4_include([m4/mbedtls.m4]) m4_include([m4/openssl.m4]) m4_include([m4/polarssl.m4]) +m4_include([m4/zlib.m4]) diff --git a/config.h.in b/config.h.in index 04437463..693761c8 100644 --- a/config.h.in +++ b/config.h.in @@ -245,6 +245,12 @@ /* Define to 1 if you have the header file. */ #undef HAVE_WS2TCPIP_H +/* have zlib compression support */ +#undef HAVE_ZLIB + +/* Define to 1 if you have the header file. */ +#undef HAVE_ZLIB_H + /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #undef LT_OBJDIR diff --git a/configure b/configure index b784d016..545b20b4 100755 --- a/configure +++ b/configure @@ -777,6 +777,10 @@ with_gnu_ld with_sysroot enable_libtool_lock with_crypto_library +enable_zlib +with_zlib +with_zlib_include +with_zlib_lib with_openssl with_openssl_include with_openssl_lib @@ -1429,6 +1433,7 @@ Optional Features: --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) + --disable-zlib disable zlib compression support --enable-applecc enable Apple CommonCrypto API support --disable-assert turn off assertions --disable-largefile omit support for large files @@ -1444,6 +1449,9 @@ Optional Packages: --with-crypto-library=library build with the given crypto library, TYPE=openssl|polarssl|mbedtls [default=openssl] + --with-zlib=DIR zlib base directory, or: + --with-zlib-include=DIR zlib headers directory + --with-zlib-lib=DIR zlib library directory --with-openssl=DIR OpenSSL base directory, or: --with-openssl-include=DIR OpenSSL headers directory (without trailing @@ -12916,6 +12924,163 @@ fi case "${with_crypto_library}" in openssl) + # Check whether --enable-zlib was given. +if test "${enable_zlib+set}" = set; then : + enableval=$enable_zlib; +fi + + if test "x$enable_zlib" != "xno"; then : + + +$as_echo "#define HAVE_ZLIB 1" >>confdefs.h + + +# Check whether --with-zlib was given. +if test "${with_zlib+set}" = set; then : + withval=$with_zlib; zlib="$withval" + CPPFLAGS="$CPPFLAGS -I$withval/include" + LDFLAGS="$LDFLAGS -L$withval/lib" + +fi + + + +# Check whether --with-zlib-include was given. +if test "${with_zlib_include+set}" = set; then : + withval=$with_zlib_include; zlib_include="$withval" + CPPFLAGS="$CPPFLAGS -I$withval" + +fi + + + +# Check whether --with-zlib-lib was given. +if test "${with_zlib_lib+set}" = set; then : + withval=$with_zlib_lib; zlib_lib="$withval" + LDFLAGS="$LDFLAGS -L$withval" + +fi + + + for ac_header in zlib.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default" +if test "x$ac_cv_header_zlib_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_ZLIB_H 1 +_ACEOF + +else + as_fn_error $? "\"zlib header files not found.\"" "$LINENO" 5; break + +fi + +done + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for compress2 in -lz" >&5 +$as_echo_n "checking for compress2 in -lz... " >&6; } +if ${ac_cv_lib_z_compress2+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lz $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char compress2 (); +int +main () +{ +return compress2 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_z_compress2=yes +else + ac_cv_lib_z_compress2=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_compress2" >&5 +$as_echo "$ac_cv_lib_z_compress2" >&6; } +if test "x$ac_cv_lib_z_compress2" = xyes; then : + LIBS="$LIBS -lz" +else + as_fn_error $? "\"zlib libraries not found.\"" "$LINENO" 5 + +fi + + +fi + + + case $host_os in + *mingw*) + ;; + *) + ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" +if test "x$ac_cv_func_dlopen" = xyes; then : + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } +if ${ac_cv_lib_dl_dlopen+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dl_dlopen=yes +else + ac_cv_lib_dl_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = xyes; then : + LIBS="$LIBS -ldl" +else + as_fn_error $? "OpenSSL depends on libdl." "$LINENO" 5; break + +fi + + +fi + + ;; + esac # Check whether --with-openssl was given. diff --git a/configure.ac b/configure.ac index 17860729..702a0db0 100755 --- a/configure.ac +++ b/configure.ac @@ -59,6 +59,7 @@ AX_TLS([:], [:]) dnl Checks for crypto library case "${with_crypto_library}" in openssl) + ss_ZLIB ss_OPENSSL AC_DEFINE([USE_CRYPTO_OPENSSL], [1], [Use OpenSSL library]) ;; diff --git a/libcork/Makefile.in b/libcork/Makefile.in index 570931d0..d3f3a269 100644 --- a/libcork/Makefile.in +++ b/libcork/Makefile.in @@ -78,7 +78,8 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acx_pthread.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/mbedtls.m4 \ $(top_srcdir)/m4/openssl.m4 $(top_srcdir)/m4/polarssl.m4 \ - $(top_srcdir)/libev/libev.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/zlib.m4 $(top_srcdir)/libev/libev.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d diff --git a/libev/Makefile.in b/libev/Makefile.in index 2b3118a1..eddb6b37 100644 --- a/libev/Makefile.in +++ b/libev/Makefile.in @@ -62,7 +62,8 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acx_pthread.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/mbedtls.m4 \ $(top_srcdir)/m4/openssl.m4 $(top_srcdir)/m4/polarssl.m4 \ - $(top_srcdir)/libev/libev.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/zlib.m4 $(top_srcdir)/libev/libev.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d diff --git a/libipset/Makefile.in b/libipset/Makefile.in index de289583..29aeb3d4 100644 --- a/libipset/Makefile.in +++ b/libipset/Makefile.in @@ -78,7 +78,8 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acx_pthread.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/mbedtls.m4 \ $(top_srcdir)/m4/openssl.m4 $(top_srcdir)/m4/polarssl.m4 \ - $(top_srcdir)/libev/libev.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/zlib.m4 $(top_srcdir)/libev/libev.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d diff --git a/libudns/Makefile.in b/libudns/Makefile.in index 24517277..7753b318 100644 --- a/libudns/Makefile.in +++ b/libudns/Makefile.in @@ -78,7 +78,8 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acx_pthread.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/mbedtls.m4 \ $(top_srcdir)/m4/openssl.m4 $(top_srcdir)/m4/polarssl.m4 \ - $(top_srcdir)/libev/libev.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/zlib.m4 $(top_srcdir)/libev/libev.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d diff --git a/m4/openssl.m4 b/m4/openssl.m4 index 2cfd34ad..c47e94b0 100644 --- a/m4/openssl.m4 +++ b/m4/openssl.m4 @@ -2,6 +2,19 @@ dnl Check to find the OpenSSL headers/libraries AC_DEFUN([ss_OPENSSL], [ + case $host_os in + *mingw*) + ;; + *) + AC_CHECK_FUNC(dlopen, + [], + [AC_CHECK_LIB(dl, dlopen, + [LIBS="$LIBS -ldl"], + [AC_MSG_ERROR([OpenSSL depends on libdl.]); break] + )] + ) + ;; + esac AC_ARG_WITH(openssl, AS_HELP_STRING([--with-openssl=DIR], [OpenSSL base directory, or:]), diff --git a/m4/zlib.m4 b/m4/zlib.m4 new file mode 100644 index 00000000..13082862 --- /dev/null +++ b/m4/zlib.m4 @@ -0,0 +1,38 @@ +dnl Check to find the zlib headers/libraries + +AC_DEFUN([ss_ZLIB], +[ + AC_ARG_ENABLE([zlib], + AS_HELP_STRING([--disable-zlib], [disable zlib compression support])) + AS_IF([test "x$enable_zlib" != "xno"], [ + AC_DEFINE(HAVE_ZLIB, 1, [have zlib compression support]) + AC_ARG_WITH(zlib, + AS_HELP_STRING([--with-zlib=DIR], [zlib base directory, or:]), + [zlib="$withval" + CPPFLAGS="$CPPFLAGS -I$withval/include" + LDFLAGS="$LDFLAGS -L$withval/lib"] + ) + + AC_ARG_WITH(zlib-include, + AS_HELP_STRING([--with-zlib-include=DIR], [zlib headers directory]), + [zlib_include="$withval" + CPPFLAGS="$CPPFLAGS -I$withval"] + ) + + AC_ARG_WITH(zlib-lib, + AS_HELP_STRING([--with-zlib-lib=DIR], [zlib library directory]), + [zlib_lib="$withval" + LDFLAGS="$LDFLAGS -L$withval"] + ) + + AC_CHECK_HEADERS(zlib.h, + [], + [AC_MSG_ERROR("zlib header files not found."); break] + ) + + AC_CHECK_LIB(z, compress2, + [LIBS="$LIBS -lz"], + [AC_MSG_ERROR("zlib libraries not found.")] + ) + ]) +]) diff --git a/src/Makefile.in b/src/Makefile.in index 94af3db0..cf9fdab2 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -69,7 +69,8 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acx_pthread.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/mbedtls.m4 \ $(top_srcdir)/m4/openssl.m4 $(top_srcdir)/m4/polarssl.m4 \ - $(top_srcdir)/libev/libev.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/zlib.m4 $(top_srcdir)/libev/libev.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d