Skip to content

Commit 17d4002

Browse files
authored
Check if the macro AC_PROG_CC_C99 actually made the compiler accept C99 code. (#6317)
1 parent 2a086e4 commit 17d4002

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

configure.ac

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,17 @@ AS_VAR_IF([cross_compiling], [yes],
128128
AC_MSG_RESULT([$BUILD_CC])],
129129
[BUILD_CC=$CC])
130130

131+
dnl The macro AC_PROG_CC_C99 sets the shell variable ac_cv_prog_cc_c99 to 'no'
132+
dnl if the compiler does not support C99.i.e. does not support any of _Bool,
133+
dnl flexible arrays, inline, long long int, mixed code and declarations,
134+
dnl named initialization of structs, restrict, varargs macros, variable
135+
dnl declarations in for loops and variable length arrays.
136+
dnl
137+
dnl https://www.gnu.org/software/autoconf/manual/autoconf-2.60/html_node/C-Compiler.html
138+
if test "$ac_cv_prog_cc_c99" = no; then
139+
AC_MSG_ERROR([C compiler would not accept C99 code])
140+
fi
141+
131142
dnl Support systems with system libraries in e.g. /usr/lib64.
132143
PHP_ARG_WITH([libdir],
133144
[for system library directory],

0 commit comments

Comments
 (0)