From: David Lamparter Date: Thu, 11 Nov 2021 11:18:44 +0000 (+0100) Subject: build: adjust compiler/C11 bits for autoconf 2.70+ X-Git-Tag: base_8.2~217^2~9 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=5b2184597185d015bc4db168079510266840c022;p=mirror%2Ffrr.git build: adjust compiler/C11 bits for autoconf 2.70+ `autoconf` finally arrived in the 2010s and tries to do ISO C11. Signed-off-by: David Lamparter --- diff --git a/configure.ac b/configure.ac index 92a60ce818..b1c6cdc126 100644 --- a/configure.ac +++ b/configure.ac @@ -180,8 +180,6 @@ AM_PROG_CC_C_O dnl remove autoconf default "-g -O2" CFLAGS="$orig_cflags" CXXFLAGS="$orig_cxxflags" -AC_PROG_CC_C99 -dnl NB: see C11 below dnl Some special handling for ICC later on if test "$CC" = "icc"; then @@ -254,12 +252,24 @@ if test "$cc_is_icc" = "yes"; then AC_C_FLAG([-diag-error 10006]) fi -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}" +dnl autoconf 2.69 AC_PROG_CC_C99 is "state of the art" +dnl autoconf 2.70 AC_PROG_CC_C99 is deprecated and AC_PROC_CC tries to do C11 +m4_if(m4_version_compare(m4_defn([AC_AUTOCONF_VERSION]), [2.70]), [-1], [dnl + dnl autoconf < 2.70 + AC_PROG_CC_C99 -AC_C_FLAG([-std=gnu11], [CC="$ac_cc"], [CC="$CC -std=gnu11"]) + 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 autoconf >= 2.70 + if test "$ac_cv_prog_cc_c11" = "no"; then + AC_MSG_ERROR([ISO C11 compiler support (with GNU extensions) is required.]) + fi +]) dnl if the user has specified any CFLAGS, override our settings if test "$enable_gcov" = "yes"; then