From 1b005039cbe27964800c147f224360054683a129 Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Tue, 3 Mar 2026 17:23:15 +0100 Subject: [PATCH] configure: Fix zlib detection The configure script failed to detect zlib. Even when the required libraries and development files are installed, the configure outputted the following: > checking for zlib package... no This issue occurs when using gcc-14, which treats some warnings as errors. Below is the relevant part of the config.log preceding this patch: > configure:5472: checking for zlib package > configure:5500: gcc -E conftest.c > configure:5500: $? = 0 > configure:5537: gcc -o conftest -g -O2 conftest.c -lz -lcrypt >&5 > conftest.c: In function 'main': > conftest.c:90:1: error: implicit declaration of function 'inflate' [-Wimplicit-function-declaration] > 90 | inflate() > | ^~~~~~~ > configure:5537: $? = 1 --- support/configure | 14 ++++++++++++-- support/configure.in | 2 +- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/support/configure b/support/configure index a6a58ded..c375a6b7 100755 --- a/support/configure +++ b/support/configure @@ -5526,10 +5526,20 @@ 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. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char inflate(void); int -main () +main (void) { -inflate() +return inflate(); ; return 0; } diff --git a/support/configure.in b/support/configure.in index a90ccd20..053d2065 100644 --- a/support/configure.in +++ b/support/configure.in @@ -82,7 +82,7 @@ irc_zlib_include=],[for irc_dir in "$irc_zlib_include" \ ]) irc_save_LIBS="$LIBS" LIBS="-lz $LIBS" -AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[inflate()]])],[no_zlib_library= +AC_LINK_IFELSE([AC_LANG_CALL([], [inflate])],[no_zlib_library= irc_zlib_library= LIBS="$irc_save_LIBS"],[LIBS="$irc_save_LIBS" for irc_dir in "$irc_zlib_library" \