Skip to content

Commit

Permalink
Require C99 when compiling
Browse files Browse the repository at this point in the history
  • Loading branch information
jmikola committed Nov 29, 2022
1 parent d9f6e8d commit da55719
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions config.m4
Expand Up @@ -5,6 +5,13 @@ PHP_ARG_ENABLE([mongodb],
[Enable MongoDB support])])

if test "$PHP_MONGODB" != "no"; then
dnl Enable C99 (required for libmongoc 1.24+)
AC_PROG_CC_C99

if test "$ac_cv_prog_cc_c99" = no; then
AC_MSG_ERROR([Compiler does not support C99])
fi

dnl Check PHP version is compatible with this extension
AC_MSG_CHECKING([PHP version])

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

if test "$PHP_MONGODB_SYSTEM_LIBS" = "no"; then
PHP_MONGODB_BUNDLED_CFLAGS="$STD_CFLAGS -DBSON_COMPILATION -DMONGOC_COMPILATION"
dnl TODO: MONGOCRYPT-219 makes the -std argument obsolete
PHP_MONGODB_LIBMONGOCRYPT_CFLAGS="-DKMS_MSG_STATIC -DMLIB_USER -std=gnu99"
PHP_MONGODB_LIBMONGOCRYPT_CFLAGS="-DKMS_MSG_STATIC -DMLIB_USER"
PHP_MONGODB_ZLIB_CFLAGS=""

dnl M4 doesn't know if we're building statically or as a shared module, so
Expand Down

0 comments on commit da55719

Please sign in to comment.