The follow patch will allow binds to a static zlib, but it's not entirely portable.
I'm wondering which ac/libtool guru might point me at:
1. a way to ADD to the objs list of just THIS module, instead of having
to second-guess the name of the mod_deflate object.
2. the portable 'shared library type', as opposed to my test -f libz.s? below
3. the way to modify APR_ADDTO(LIBS, [-lz]) where it -lz would be added
only to the list given to the mod_deflate link, instead of all objects (even
the core httpsd and support modules, before rbb's patch yesterday!.)
TIA
Bill
> --- modules/filters/config.m4 2002/09/15 00:00:47 1.8
> +++ modules/filters/config.m4 2002/10/16 19:05:02
> @@ -8,9 +8,12 @@
>
> APR_ADDTO(LT_LDFLAGS,-export-dynamic)
>
> -APACHE_MODULE(deflate, Deflate transfer encoding support, , , no, [
> - AC_ARG_WITH(z, APACHE_HELP_STRING(--with-z=DIR,use a specific zlib library),
> - [
> +deflate_objs="mod_deflate.lo"
> +
> +AC_DEFUN(APACHE_CHECK_ZLIB,[
> + AC_MSG_CHECKING(for zlib support)
> + ap_zlib_base=""
> + AC_ARG_WITH(z, APACHE_HELP_STRING(--with-z=DIR,use a specific zlib library), [
> if test "x$withval" != "xyes" && test "x$withval" != "x"; then
> ap_zlib_base="$withval"
> fi
> @@ -42,12 +45,18 @@
> APR_ADDTO(INCLUDES, [-I${ap_zlib_base}/include])
> dnl put in CPPFLAGS temporarily so that AC_TRY_LINK below will work
> CPPFLAGS="$CPPFLAGS -I${ap_zlib_base}/include"
> - APR_ADDTO(LDFLAGS, [-L${ap_zlib_base}/lib])
> - if test "x$ap_platform_runtime_link_flag" != "x"; then
> - APR_ADDTO(LDFLAGS, [$ap_platform_runtime_link_flag${ap_zlib_base}/lib])
> + fi
> + if test -f $ap_zlib_base/lib/libz.s?; then
> + if test "$ap_zlib_base" != "/usr"; then
> + APR_ADDTO(LDFLAGS, [-L${ap_zlib_base}/lib])
> + if test "x$ap_platform_runtime_link_flag" != "x"; then
> + APR_ADDTO(LDFLAGS,[$ap_platform_runtime_link_flag${ap_zlib_base}/lib])
> + fi
> fi
> + APR_ADDTO(LIBS, [-lz])
> + else
> + deflate_objs="$deflate_objs $ap_zlib_base/lib/libz.a"
> fi
> - APR_ADDTO(LIBS, [-lz])
> AC_MSG_CHECKING([for zlib library])
> AC_TRY_LINK([#include <zlib.h>], [int i = Z_OK;],
> [AC_MSG_RESULT(found)
> @@ -61,4 +70,7 @@
> fi
> ])
>
> +APACHE_MODULE(deflate, Deflate transfer encoding support, $deflate_objs, , no, [
> + APACHE_CHECK_ZLIB
> +])
> APACHE_MODPATH_FINISH
>
>
>