Skip to content

Commit 7b3560d

Browse files
committed
Require C99 when compiling
1 parent d9f6e8d commit 7b3560d

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

config.m4

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@ PHP_ARG_ENABLE([mongodb],
55
[Enable MongoDB support])])
66

77
if test "$PHP_MONGODB" != "no"; then
8+
dnl Enable C99 (required for libmongoc 1.24+)
9+
AC_PROG_CC_C99
10+
11+
if test "$ac_cv_prog_cc_c99" = no; then
12+
AC_MSG_ERROR([Compiler does not support C99])
13+
fi
14+
815
dnl Check PHP version is compatible with this extension
916
AC_MSG_CHECKING([PHP version])
1017

@@ -308,8 +315,7 @@ if test "$PHP_MONGODB" != "no"; then
308315

309316
if test "$PHP_MONGODB_SYSTEM_LIBS" = "no"; then
310317
PHP_MONGODB_BUNDLED_CFLAGS="$STD_CFLAGS -DBSON_COMPILATION -DMONGOC_COMPILATION"
311-
dnl TODO: MONGOCRYPT-219 makes the -std argument obsolete
312-
PHP_MONGODB_LIBMONGOCRYPT_CFLAGS="-DKMS_MSG_STATIC -DMLIB_USER -std=gnu99"
318+
PHP_MONGODB_LIBMONGOCRYPT_CFLAGS="-DKMS_MSG_STATIC -DMLIB_USER"
313319
PHP_MONGODB_ZLIB_CFLAGS=""
314320

315321
dnl M4 doesn't know if we're building statically or as a shared module, so
@@ -537,6 +543,7 @@ if test "$PHP_MONGODB" != "no"; then
537543
mongodb was configured with the following options:
538544
539545
Build configuration:
546+
CC : $CC
540547
CFLAGS : $CFLAGS
541548
Extra CFLAGS : $STD_CFLAGS $EXTRA_CFLAGS
542549
Developers flags (slow) : $MAINTAINER_CFLAGS

scripts/autotools/CheckCompiler.m4

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ fi
1111
AC_PROG_CC
1212
AC_PROG_CXX
1313

14+
dnl AC_PROG_CC_C99 is previously called in config.m4, but AC_PROG_CC resets CC
15+
dnl so call it once more to ensure C99 remains enabled
16+
AC_PROG_CC_C99
17+
1418
# Check that an appropriate C compiler is available.
1519
c_compiler="unknown"
1620
AC_LANG_PUSH([C])

0 commit comments

Comments
 (0)