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
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