1 diff --git a/configure b/configure
2 index c22d3de..75210f0 100755
5 @@ -11777,13 +11789,13 @@ Use --without-readline to disable readline support." "$LINENO" 5
8 if test "$with_zlib" = yes; then
9 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inflate in -lz" >&5
10 -$as_echo_n "checking for inflate in -lz... " >&6; }
11 -if ${ac_cv_lib_z_inflate+:} false; then :
12 + if test "$enable_debug" = yes; then
13 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing inflate" >&5
14 +$as_echo_n "checking for library containing inflate... " >&6; }
15 +if ${ac_cv_search_inflate+:} false; then :
16 $as_echo_n "(cached) " >&6
18 - ac_check_lib_save_LIBS=$LIBS
20 + ac_func_search_save_LIBS=$LIBS
21 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
24 @@ -11802,23 +11814,101 @@ return inflate ();
28 -if ac_fn_c_try_link "$LINENO"; then :
29 - ac_cv_lib_z_inflate=yes
31 - ac_cv_lib_z_inflate=no
32 +for ac_lib in '' zd zlibd zlib1d z zlib zlib1; do
33 + if test -z "$ac_lib"; then
34 + ac_res="none required"
37 + LIBS="-l$ac_lib $ac_func_search_save_LIBS"
39 + if ac_fn_c_try_link "$LINENO"; then :
40 + ac_cv_search_inflate=$ac_res
42 rm -f core conftest.err conftest.$ac_objext \
43 - conftest$ac_exeext conftest.$ac_ext
44 -LIBS=$ac_check_lib_save_LIBS
46 + if ${ac_cv_search_inflate+:} false; then :
49 -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_inflate" >&5
50 -$as_echo "$ac_cv_lib_z_inflate" >&6; }
51 -if test "x$ac_cv_lib_z_inflate" = xyes; then :
52 - cat >>confdefs.h <<_ACEOF
55 +if ${ac_cv_search_inflate+:} false; then :
58 + ac_cv_search_inflate=no
61 +LIBS=$ac_func_search_save_LIBS
63 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_inflate" >&5
64 +$as_echo "$ac_cv_search_inflate" >&6; }
65 +ac_res=$ac_cv_search_inflate
66 +if test "$ac_res" != no; then :
67 + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
69 +$as_echo "#define HAVE_LIBZ 1" >>confdefs.h
72 + as_fn_error $? "zlib library not found
73 +If you have zlib already installed, see config.log for details on the
74 +failure. It is possible the compiler isn't looking in the proper directory.
75 +Use --without-zlib to disable zlib support." "$LINENO" 5
79 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing inflate" >&5
80 +$as_echo_n "checking for library containing inflate... " >&6; }
81 +if ${ac_cv_search_inflate+:} false; then :
82 + $as_echo_n "(cached) " >&6
84 + ac_func_search_save_LIBS=$LIBS
85 +cat confdefs.h - <<_ACEOF >conftest.$ac_ext
86 +/* end confdefs.h. */
88 +/* Override any GCC internal prototype to avoid an error.
89 + Use char because int might match the return type of a GCC
90 + builtin and then its argument prototype would still apply. */
103 +for ac_lib in '' z zlib zlib1; do
104 + if test -z "$ac_lib"; then
105 + ac_res="none required"
108 + LIBS="-l$ac_lib $ac_func_search_save_LIBS"
110 + if ac_fn_c_try_link "$LINENO"; then :
111 + ac_cv_search_inflate=$ac_res
113 +rm -f core conftest.err conftest.$ac_objext \
115 + if ${ac_cv_search_inflate+:} false; then :
119 +if ${ac_cv_search_inflate+:} false; then :
123 + ac_cv_search_inflate=no
126 +LIBS=$ac_func_search_save_LIBS
128 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_inflate" >&5
129 +$as_echo "$ac_cv_search_inflate" >&6; }
130 +ac_res=$ac_cv_search_inflate
131 +if test "$ac_res" != no; then :
132 + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
134 +$as_echo "#define HAVE_LIBZ 1" >>confdefs.h
137 as_fn_error $? "zlib library not found
138 @@ -11827,6 +11917,7 @@ failure. It is possible the compiler isn't looking in the proper directory.
139 Use --without-zlib to disable zlib support." "$LINENO" 5
145 if test "$enable_spinlocks" = yes; then
146 diff --git a/configure.in b/configure.in
147 index 976f90d..e3cd80b 100644
150 @@ -1170,11 +1170,21 @@ Use --without-readline to disable readline support.])
153 if test "$with_zlib" = yes; then
154 - AC_CHECK_LIB(z, inflate, [],
155 - [AC_MSG_ERROR([zlib library not found
156 + if test "$enable_debug" = yes; then
157 + AC_SEARCH_LIBS(inflate, [zd zlibd zlib1d z zlib zlib1],
158 + [AC_DEFINE([HAVE_LIBZ], [1], [Define to 1 if you have the `z' library.])],
159 + [AC_MSG_ERROR([zlib library not found
160 If you have zlib already installed, see config.log for details on the
161 failure. It is possible the compiler isn't looking in the proper directory.
162 Use --without-zlib to disable zlib support.])])
164 + AC_SEARCH_LIBS(inflate, [z zlib zlib1],
165 + [AC_DEFINE([HAVE_LIBZ], [1], [Define to 1 if you have the `z' library.])],
166 + [AC_MSG_ERROR([zlib library not found
167 +If you have zlib already installed, see config.log for details on the
168 +failure. It is possible the compiler isn't looking in the proper directory.
169 +Use --without-zlib to disable zlib support.])])
173 if test "$enable_spinlocks" = yes; then
174 diff --git a/src/include/pg_config.h.in b/src/include/pg_config.h.in
175 index 244886a..29dd35b 100644
176 --- a/src/include/pg_config.h.in
177 +++ b/src/include/pg_config.h.in
179 /* Define to 1 if you have the `xslt' library (-lxslt). */
182 -/* Define to 1 if you have the `z' library (-lz). */
183 +/* Define to 1 if you have the `z' library. */
186 /* Define to 1 if the system has the type `locale_t'. */