]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Fix detection of libz on windows compile with static option.
authorW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Wed, 29 Jun 2022 09:41:20 +0000 (11:41 +0200)
committerW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Wed, 29 Jun 2022 09:41:20 +0000 (11:41 +0200)
configure
configure.ac
doc/Changelog

index 99a9b816eb6a669b3e568385e3b608b7b1ba24cd..8a4bc01e134139fc7f7bd8db6f7c8a0db8501292 100755 (executable)
--- a/configure
+++ b/configure
@@ -19968,7 +19968,46 @@ if test x_$enable_static_exe = x_yes; then
                else
                        LIBS="$LIBS -lgdi32"
                fi
-               LIBS="$LIBS -lz"
+               { $as_echo "$as_me:${as_lineno-$LINENO}: checking for compress in -lz" >&5
+$as_echo_n "checking for compress in -lz... " >&6; }
+if ${ac_cv_lib_z_compress+:} 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 compress ();
+int
+main ()
+{
+return compress ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_z_compress=yes
+else
+  ac_cv_lib_z_compress=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_compress" >&5
+$as_echo "$ac_cv_lib_z_compress" >&6; }
+if test "x$ac_cv_lib_z_compress" = xyes; then :
+   LIBS="$LIBS -lz"
+fi
+
                LIBS="$LIBS -l:libssp.a"
        fi
 fi
@@ -19988,7 +20027,46 @@ if test x_$enable_fully_static = x_yes; then
                else
                        LIBS="$LIBS -lgdi32"
                fi
-               LIBS="$LIBS -lz"
+               { $as_echo "$as_me:${as_lineno-$LINENO}: checking for compress in -lz" >&5
+$as_echo_n "checking for compress in -lz... " >&6; }
+if ${ac_cv_lib_z_compress+:} 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 compress ();
+int
+main ()
+{
+return compress ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_z_compress=yes
+else
+  ac_cv_lib_z_compress=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_compress" >&5
+$as_echo "$ac_cv_lib_z_compress" >&6; }
+if test "x$ac_cv_lib_z_compress" = xyes; then :
+   LIBS="$LIBS -lz"
+fi
+
                LIBS="$LIBS -l:libssp.a"
        fi
 fi
index dd47842c77505b4b65d089c93b626585e6f7846d..2752749f847f9330563a8b75c6dd6dbbff2c8cf8 100644 (file)
@@ -1500,7 +1500,7 @@ if test x_$enable_static_exe = x_yes; then
                else
                        LIBS="$LIBS -lgdi32"
                fi
-               LIBS="$LIBS -lz"
+               AC_CHECK_LIB([z], [compress], [ LIBS="$LIBS -lz" ])
                LIBS="$LIBS -l:libssp.a"
        fi
 fi
@@ -1517,7 +1517,7 @@ if test x_$enable_fully_static = x_yes; then
                else
                        LIBS="$LIBS -lgdi32"
                fi
-               LIBS="$LIBS -lz"
+               AC_CHECK_LIB([z], [compress], [ LIBS="$LIBS -lz" ])
                LIBS="$LIBS -l:libssp.a"
        fi
 fi
index 60909ddedfb9ca78500a18e0d196ce1ee4a5cdbe..ac8fd20347b8f9422d034d19bbf1698eedf29487 100644 (file)
@@ -1,5 +1,6 @@
 29 June 2022: Wouter
        - iana portlist update.
+       - Fix detection of libz on windows compile with static option.
 
 29 June 2022: George
        - Add debug option to the mini_tdir.sh test code.