Skip to content

Commit 9b3af7a

Browse files
committed
Check if the macro AC_PROG_CC_C99 actually made the compiler accept C99 code.
1 parent 150ebfd commit 9b3af7a

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
@@ -133,6 +133,17 @@ AC_PROG_CPP
133133
AC_USE_SYSTEM_EXTENSIONS
134134
AC_PROG_LN_S
135135

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

0 commit comments

Comments
 (0)