diff options
author | Haru <haru@dotalux.com> | 2018-08-25 16:50:52 +0200 |
---|---|---|
committer | Haru <haru@dotalux.com> | 2018-08-25 17:52:21 +0200 |
commit | 919f004106a705947a52ead1b6b23238cbe10218 (patch) | |
tree | 40040c86649ae45319c31f34db18692d955f8f03 /configure | |
parent | 234189f34e5f055c82654b8cd35330822e8aa4d7 (diff) | |
download | hercules-919f004106a705947a52ead1b6b23238cbe10218.tar.gz hercules-919f004106a705947a52ead1b6b23238cbe10218.tar.bz2 hercules-919f004106a705947a52ead1b6b23238cbe10218.tar.xz hercules-919f004106a705947a52ead1b6b23238cbe10218.zip |
Change language specification to c11 in the autoconf builds
Fixes an issue with certain glibc versions using the emulated
`_Static_assert` (allowing only one assertion per scope) despite the
compiler having built-in support for the c11 version.
Fixes builds in Debian stretch and other distributions.
Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 47 |
1 files changed, 45 insertions, 2 deletions
@@ -1,5 +1,5 @@ #! /bin/sh -# From configure.ac 515eed8ee. +# From configure.ac 234189f34. # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69. # @@ -4776,7 +4776,50 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu # -Werror-implicit-function-declaration -Wtrampolines # -Wjump-misses-init -CFLAGS="$CFLAGS -pipe -ffast-math -Wall -Wextra -Wno-sign-compare -std=c99" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -std=c11" >&5 +$as_echo_n "checking whether $CC supports -std=c11... " >&6; } +OLD_CFLAGS="$CFLAGS" +CFLAGS="$CFLAGS -std=c11" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int foo; +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -std=c1x" >&5 +$as_echo_n "checking whether $CC supports -std=c1x... " >&6; } + CFLAGS="$OLD_CFLAGS -std=c1x" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int foo; +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, falling back to -std=c99" >&5 +$as_echo "no, falling back to -std=c99" >&6; } + CFLAGS="$OLD_CFLAGS -std=c99" + + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +CFLAGS="$CFLAGS -pipe -ffast-math -Wall -Wextra -Wno-sign-compare" CPPFLAGS="$CPPFLAGS -I../common" LDFLAGS="$LDFLAGS" |