diff options
author | Andy Wingo <wingo@pobox.com> | 2016-11-27 20:56:59 +0100 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2016-11-27 20:56:59 +0100 |
commit | 7b6b86f25564dc67a3a2538d0ee47f25e00e6833 (patch) | |
tree | 1917ad4a4c2444bfead54879f826548affd2a9dd | |
parent | 668153dbb61040dc0f2d44e6653d4f7ed6e7c407 (diff) | |
download | guile-7b6b86f25564dc67a3a2538d0ee47f25e00e6833.tar.gz |
Ensure autoconf doesn't downgrade us to C99
* configure.ac: Add -std=gnu11 if the compiler is GCC (or clang). This
prevents AC_PROG_CC_C99 from downgrading us by adding -std=gnu99.
Fixes regression whereby we were always using the fallback
implementation of atomics.
-rw-r--r-- | configure.ac | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index 435bc4e28..db0511d9d 100644 --- a/configure.ac +++ b/configure.ac @@ -66,6 +66,18 @@ AC_LIBTOOL_WIN32_DLL AC_PROG_INSTALL AC_PROG_CC + +# Sadly, there is no released version of Autoconf with a nice +# C11-ensuring macro. This should work for gcc/clang within the last 5 +# years though. +AC_MSG_CHECKING([how to enable C11 support]) +if test "$GCC" = yes; then + AC_MSG_RESULT([-std=gnu11]) + CC="$CC -std=gnu11" +else + AC_MSG_RESULT([assuming $CC supports C11 by default]) +fi + gl_EARLY AC_PROG_CPP AC_PROG_SED |