Resending ---------- Forwarded message ---------- From: David Voit <[email protected]> Date: 2011/6/24 Subject: [Patch]: Use systemwide zlib by default To: [email protected]
Hi list, I'm currently playing with the latest released, but still unpacked Version of this great Webserver on my Debian System. Examination showed that cherokee ships its own zlib, which I think is unnecessary on modern Linux systems. Maybe the patch below is helpful to fix this. Greetings, David --- >From 005dfc68dc0cddd86e762e2696b774232db20d0a Mon Sep 17 00:00:00 2001 From: David Voit <[email protected]> Date: Fri, 24 Jun 2011 00:48:46 +0200 Subject: [PATCH] Use systemwide zlib by default If a systemwide zlib is avaible use it, else fallback to bundled one. Same auto-configuration code like the PCRE one. --enable-internal-zlib force bundled zlib. --- cherokee/Makefile.am | 11 +++++++++-- configure.in | 20 ++++++++++++++++++++ 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/cherokee/Makefile.am b/cherokee/Makefile.am index 65209e3..b2c83ae 100644 --- a/cherokee/Makefile.am +++ b/cherokee/Makefile.am @@ -90,6 +90,12 @@ else external_pcre_lib=-lpcre endif +if USE_INTERNAL_ZLIB +internal_zlib_src=$(zlib_src) +else +external_zlib_lib=-lz +endif + # # LDFLAGS for libraries # @@ -1270,7 +1276,8 @@ libcherokee_base_la_LIBADD = \ $(RT_LIBS) \ $(PTHREAD_LIBS) \ $(PTHREAD_CFLAGS) \ -$(external_pcre_lib) +$(external_pcre_lib) \ +$(external_zlib_lib) libcherokee_client_la_LDFLAGS = $(common_ldflags) $(library_soname) libcherokee_client_la_LIBADD = \ @@ -1343,7 +1350,7 @@ endif libcherokee_base_la_SOURCES = \ -$(zlib_src) \ +$(internal_zlib_src) \ $(internal_pcre_src) \ $(internal_getopt_src) \ $(poll_poll_src) \ diff --git a/configure.in b/configure.in index ec406f8..670bb78 100644 --- a/configure.in +++ b/configure.in @@ -1032,6 +1032,25 @@ fi AM_CONDITIONAL(USE_INTERNAL_PCRE, test "x$have_pcre" = "xbuilt-in") dnl +dnl Check for zlib library +dnl +have_zlib="built-in" + +AC_ARG_ENABLE(internal_zlib, + AC_HELP_STRING([--enable-internal-zlib],[Enable internal zlib]), + use_internal_zlib="$enableval", use_internal_zlib="no") + +if test "x$use_internal_zlib" != "xyes"; then + AC_CHECK_LIB(z, gzread, have_zlib_lib=yes, have_zlib_lib=no) + AC_CHECK_HEADER(zlib.h, have_zlib_include=yes, have_zlib_include=no) + if test "$have_zlib_lib $have_zlib_include" = "yes yes"; then + have_zlib="yes" + fi +fi + +AM_CONDITIONAL(USE_INTERNAL_ZLIB, test "x$have_zlib" = "xbuilt-in") + +dnl dnl PAM dnl AC_ARG_ENABLE(pam, AC_HELP_STRING([--disable-pam],[Disable PAM support]), use_pam="$enableval", use_pam="yes") @@ -1668,6 +1687,7 @@ done echo "Threading support $have_pthread" echo "OpenSSL support $have_openssl" echo "PCRE library $have_pcre" +echo "zlib library $have_zlib" echo "Compatible PAM $have_pam" echo "Python $have_python" echo "LDAP $have_ldap" -- 1.7.2.5
_______________________________________________ Cherokee mailing list [email protected] http://lists.octality.com/listinfo/cherokee
