From 247d9c0b5c2315bc5fb9826fbcd168ad3bda63de Mon Sep 17 00:00:00 2001 From: Diego 'Flameeyes' Pettenò Date: Thu, 7 Aug 2008 13:54:41 +0200 Subject: Use AC_PROG_CC_C99 to discover C99-compliant compiler. Instead of just checking if the compiler supports -std=gnu99 option, make use of the autoconf macro for discovering C99. This way other non-GCC compiler could be used in C99 mode too. If the compiler does not support gnu99 it falls back to c99, giving more chances that it would work than leaving it to default. --- configure.ac | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index b97467a..cb475e0 100644 --- a/configure.ac +++ b/configure.ac @@ -39,6 +39,7 @@ fi # Checks for programs. AC_PROG_CC +AC_PROG_CC_C99 dnl This enable gnu99 if present AC_USE_SYSTEM_EXTENSIONS AC_PROG_CXX AC_PROG_MAKE_SET @@ -54,9 +55,7 @@ test_gcc_flag() { # If using GCC specify some additional parameters if test "x$GCC" = "xyes" ; then - # We use gnu99 instead of c99 because many have interpreted the standard - # in a way that int64_t isn't defined on non-64 bit platforms. - DESIRED_FLAGS="-std=gnu99 -Wall -W -Wextra -pedantic -pipe -Wformat -Wold-style-definition -Wdeclaration-after-statement -Wfloat-equal -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls -Wmissing-noreturn -Wshadow -Wendif-labels -Wpointer-arith -Wcast-align -Wwrite-strings -Winline -Wno-unused-parameter -ffast-math" + DESIRED_FLAGS="-Wall -W -Wextra -pedantic -pipe -Wformat -Wold-style-definition -Wdeclaration-after-statement -Wfloat-equal -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls -Wmissing-noreturn -Wshadow -Wendif-labels -Wpointer-arith -Wcast-align -Wwrite-strings -Winline -Wno-unused-parameter -ffast-math" for flag in $DESIRED_FLAGS ; do AC_MSG_CHECKING([whether $CC accepts $flag]) -- cgit