From 22bf34222e75f1ce12962ede4667f3cafdca833a Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Mon, 2 Jan 2023 08:20:04 +0100 Subject: [PATCH] C99 compatibility fixes for configure scripts Define _GNU_SOURCE in the math tests so that exp10 can be found. Include for the puts function in the __progname check. --- acinclude.m4 | 1 + gb.httpd/configure.ac | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/acinclude.m4 b/acinclude.m4 index 1b1e512e9..9c20202d5 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -566,6 +566,7 @@ AC_DEFUN([GB_CHECK_MATH_FUNC], [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #define _ISOC9X_SOURCE 1 #define _ISOC99_SOURCE 1 + #define _GNU_SOURCE 1 #define __USE_ISOC99 1 #define __USE_ISOC9X 1 #include diff --git a/gb.httpd/configure.ac b/gb.httpd/configure.ac index 9e2145df7..07282dbd2 100644 --- a/gb.httpd/configure.ac +++ b/gb.httpd/configure.ac @@ -28,7 +28,7 @@ dnl AC_MSG_CHECKING(how to link static binaries) AC_CACHE_VAL(ac_cv_lbl_static_flag, ac_cv_lbl_static_flag=unknown - echo 'main() {}' > conftest.c + echo 'int main() {}' > conftest.c if test "$GCC" != yes ; then trial_flag="-Bstatic" test=`$CC $trial_flag -o conftest conftest.c 2>&1` @@ -53,7 +53,8 @@ fi AC_MSG_CHECKING(for __progname) AC_CACHE_VAL(ac_cv_extern__progname, - AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[extern char *__progname; + AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], + [[extern char *__progname; puts(__progname)]])],[ac_cv_extern__progname=yes],[ac_cv_extern__progname=no])) if test $ac_cv_extern__progname = yes ; then AC_DEFINE([HAVE__PROGNAME], [], [have __progname])