summaryrefslogtreecommitdiff
path: root/config.m4
diff options
context:
space:
mode:
authorBen Fuhrmannek2016-03-04 21:39:12 +0100
committerBen Fuhrmannek2016-03-04 21:45:03 +0100
commitf2788a5543f72cdbe5fafd95ea7b37fab06745e3 (patch)
tree3787f58b7142b7074e6d1fa65d7d2f43b83beea4 /config.m4
parent59a3c91e3ceb1834bdc857a1588a87973efd444f (diff)
use C11 if available, otherwise try C99 (closes #7)
Diffstat (limited to 'config.m4')
-rw-r--r--config.m418
1 files changed, 17 insertions, 1 deletions
diff --git a/config.m4 b/config.m4
index f73dfe8..9cb8969 100644
--- a/config.m4
+++ b/config.m4
@@ -27,4 +27,20 @@ if test "$PHP_SUHOSIN7_DEBUG" != "no"; then
27 AC_DEFINE(SUHOSIN7_DEBUG, 1, [Whether to enable suhosin7 debugging]) 27 AC_DEFINE(SUHOSIN7_DEBUG, 1, [Whether to enable suhosin7 debugging])
28fi 28fi
29 29
30CFLAGS="$CFLAGS -std=c11" 30AC_MSG_CHECKING([for C11 support with -std=c11])
31old_CFLAGS="$CFLAGS"
32CFLAGS+=" -std=c11"
33AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],[AC_MSG_RESULT([yes])],[
34 AC_MSG_RESULT([no])
35 CFLAGS="$old_CFLAGS"
36 echo "===== WARNING ============================================"
37 echo " Suhosin7 is written in C11, but your compiler lacks C11"
38 echo " support. Trying C99 instead, but compiling may fail."
39 echo "=========================================================="
40 AC_MSG_CHECKING([for C99 support with -std=c99])
41 CFLAGS+=" -std=c99"
42 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],[AC_MSG_RESULT([yes])],[
43 AC_MSG_RESULT([no])
44 CFLAGS="$old_CFLAGS"
45 ])
46])