From 8aa42b826c2037ddc68a32712caf2dfbda9981f8 Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Sun, 29 Jan 2017 00:51:45 +0100 Subject: [PATCH] build: bump to C11 Funnily enough, "gnu11" is gcc's default in 5.x if you don't specify anything, yet there is no "AC_PROG_CC_C11" in autoconf. Signed-off-by: David Lamparter --- configure.ac | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/configure.ac b/configure.ac index a8e820a237..b8cebd8d23 100755 --- a/configure.ac +++ b/configure.ac @@ -82,6 +82,7 @@ AM_PROG_CC_C_O dnl remove autoconf default "-g -O2" CFLAGS="$orig_cflags" AC_PROG_CC_C99 +dnl NB: see C11 below AC_PROG_EGREP PKG_PROG_PKG_CONFIG @@ -119,6 +120,13 @@ dnl ICC won't bail on unknown options without -diag-error 10006 dnl need to do this first so we get useful results for the other options AC_C_FLAG([-diag-error 10006]) +dnl AC_PROG_CC_C99 may change CC to include -std=gnu99 or something +ac_cc="$CC" +CC="${CC% -std=gnu99}" +CC="${CC% -std=c99}" + +AC_C_FLAG([-std=gnu11], [CC="$ac_cc"], [CC="$CC -std=gnu11"]) + dnl if the user specified any CFLAGS, we don't add "-g -Os/-O2" here if test "z$orig_cflags" = "z"; then AC_C_FLAG([-g]) -- 2.39.5