Skip to content

Commit dcd5421

Browse files
committed
Check if the macro AC_PROG_CC_C99 actually made the compiler accept C99 code.
1 parent 68c2343 commit dcd5421

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
@@ -141,6 +141,17 @@ else
141141
BUILD_CC=$CC
142142
fi
143143

144+
dnl The macro AC_PROG_CC_C99 sets the shell variable ac_cv_prog_cc_c99 to 'no'
145+
dnl if the compiler does not support C99.i.e. does not support any of _Bool,
146+
dnl flexible arrays, inline, long long int, mixed code and declarations,
147+
dnl named initialization of structs, restrict, varargs macros, variable
148+
dnl declarations in for loops and variable length arrays.
149+
dnl
150+
dnl https://www.gnu.org/software/autoconf/manual/autoconf-2.60/html_node/C-Compiler.html
151+
if test "$ac_cv_prog_cc_c99" = no; then
152+
AC_MSG_ERROR([C compiler would not accept C99 code])
153+
fi
154+
144155
dnl Support systems with system libraries in e.g. /usr/lib64.
145156
PHP_ARG_WITH([libdir],
146157
[for system library directory],

0 commit comments

Comments
 (0)