From 0d6bdee31aa4bf7739e4c7877eccdcf16acd8ce8 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Tue, 7 Nov 2006 04:37:34 +0000 Subject: [PATCH] use -std=gnu99 in CPPFLAGS if compiler supports it SVN revision: 26996 --- configure.in | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/configure.in b/configure.in index 7e92c3a..78ee479 100644 --- a/configure.in +++ b/configure.in @@ -39,6 +39,15 @@ m4_defun([AC_PROG_F77],[]) AM_PROG_LIBTOOL +dnl See if the compiler supports -std=gnu99 since some math +dnl functions need it (aka round()) +AC_MSG_CHECKING(whether $CC accepts -std=gnu99) +cc_supports_gnu99="yes" +save_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="$CPPFLAGS -std=gnu99" +AC_TRY_COMPILE(,,,[cc_supports_gnu99="no";CPPFLAGS="$save_CPPFLAGS"]) +AC_MSG_RESULT($cc_supports_gnu99) + if test "x${bindir}" = 'x${exec_prefix}/bin'; then if test "x${exec_prefix}" = "xNONE"; then if test "x${prefix}" = "xNONE"; then