diff options
author | Haru <haru@dotalux.com> | 2018-08-26 15:03:22 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-26 15:03:22 +0200 |
commit | 42f36d1ee5dcc89e288c6ac128be0ff6ed0985e0 (patch) | |
tree | 4b164ce3b338c216787403e79898facb00834231 /configure.ac | |
parent | 234189f34e5f055c82654b8cd35330822e8aa4d7 (diff) | |
parent | 4da22050a04f9cd45097dbdc678ab20971f5570b (diff) | |
download | hercules-42f36d1ee5dcc89e288c6ac128be0ff6ed0985e0.tar.gz hercules-42f36d1ee5dcc89e288c6ac128be0ff6ed0985e0.tar.bz2 hercules-42f36d1ee5dcc89e288c6ac128be0ff6ed0985e0.tar.xz hercules-42f36d1ee5dcc89e288c6ac128be0ff6ed0985e0.zip |
Merge pull request #2189 from MishimaHaruna/c11
Change the language specification to C11 in the autoconf-based builds
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac index 1bb30b09f..4d5f4bcfd 100644 --- a/configure.ac +++ b/configure.ac @@ -638,7 +638,37 @@ AC_LANG([C]) # -Werror-implicit-function-declaration -Wtrampolines # -Wjump-misses-init -CFLAGS="$CFLAGS -pipe -ffast-math -Wall -Wextra -Wno-sign-compare -std=c99" +AC_MSG_CHECKING([whether $CC supports -std=c11]) +OLD_CFLAGS="$CFLAGS" +CFLAGS="$CFLAGS -std=c11" +AC_COMPILE_IFELSE( + [AC_LANG_SOURCE([int foo;])], + [ + AC_MSG_RESULT([yes]) + ], + [ + AC_MSG_RESULT([no]) + + AC_MSG_CHECKING([whether $CC supports -std=c1x]) + CFLAGS="$OLD_CFLAGS -std=c1x" + AC_COMPILE_IFELSE( + [AC_LANG_SOURCE([int foo;])], + [ + AC_MSG_RESULT([yes]) + ], + [ + AC_MSG_RESULT([no, falling back to -std=c99]) + CFLAGS="$OLD_CFLAGS -std=c99" + ] + ) + ], + [ + AC_MSG_RESULT([guessing no]) + CFLAGS="$OLD_CFLAGS -std=c99" + ] +) + +CFLAGS="$CFLAGS -pipe -ffast-math -Wall -Wextra -Wno-sign-compare" CPPFLAGS="$CPPFLAGS -I../common" LDFLAGS="$LDFLAGS" |