guile-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Guile-commits] 04/04: Ensure autoconf doesn't downgrade us to C99


From: Andy Wingo
Subject: [Guile-commits] 04/04: Ensure autoconf doesn't downgrade us to C99
Date: Sun, 27 Nov 2016 20:11:05 +0000 (UTC)

wingo pushed a commit to branch master
in repository guile.

commit 7b6b86f25564dc67a3a2538d0ee47f25e00e6833
Author: Andy Wingo <address@hidden>
Date:   Sun Nov 27 20:56:59 2016 +0100

    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.
---
 configure.ac |   12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/configure.ac b/configure.ac
index 435bc4e..db0511d 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]