From 17d4002977c6c101b46d760129fa24369c9ff7d1 Mon Sep 17 00:00:00 2001 From: Danack Date: Sun, 31 Aug 2025 07:42:55 +0100 Subject: [PATCH] Check if the macro AC_PROG_CC_C99 actually made the compiler accept C99 code. (#6317) --- configure.ac | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/configure.ac b/configure.ac index 2bd6ae26ce6..633244962d8 100644 --- a/configure.ac +++ b/configure.ac @@ -128,6 +128,17 @@ AS_VAR_IF([cross_compiling], [yes], AC_MSG_RESULT([$BUILD_CC])], [BUILD_CC=$CC]) +dnl The macro AC_PROG_CC_C99 sets the shell variable ac_cv_prog_cc_c99 to 'no' +dnl if the compiler does not support C99.i.e. does not support any of _Bool, +dnl flexible arrays, inline, long long int, mixed code and declarations, +dnl named initialization of structs, restrict, varargs macros, variable +dnl declarations in for loops and variable length arrays. +dnl +dnl https://www.gnu.org/software/autoconf/manual/autoconf-2.60/html_node/C-Compiler.html +if test "$ac_cv_prog_cc_c99" = no; then + AC_MSG_ERROR([C compiler would not accept C99 code]) +fi + dnl Support systems with system libraries in e.g. /usr/lib64. PHP_ARG_WITH([libdir], [for system library directory],