From e84ca2905e0e8d75dbeb53d0001b414ba956a8a6 Mon Sep 17 00:00:00 2001 Message-Id: From: Mark Wooding Date: Sun, 27 Apr 2008 20:07:42 +0100 Subject: [PATCH] Ask for -std=gnu99 if necessary to get full . Organization: Straylight/Edgeware From: Richard Kettlewell --- configure.ac | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/configure.ac b/configure.ac index 7346b9c..1dabfe5 100644 --- a/configure.ac +++ b/configure.ac @@ -461,6 +461,28 @@ if test $want_gtk = yes; then fi if test "x$GCC" = xyes; then + # We need LLONG_MAX and annoyingly GCC doesn't always give it to us + # by default. + AC_CACHE_CHECK([what C version to ask for],[rjk_cv_cstd],[ + AC_TRY_COMPILE([#include ],[ + long long n = LLONG_MAX; + ],[rjk_cv_cstd=default],[ + old_CC="$CC" + CC="${CC} -std=gnu99" + AC_TRY_COMPILE([#include ],[ + long long n = LLONG_MAX; + ],[rjk_cv_cstd=gnu99],[rjk_cv_cstd=unknown]) + CC="$old_CC" + ]) + ]) + case $rjk_cv_cstd in + default | unknown ) + ;; + * ) + CC="${CC} -std=${rjk_cv_cstd}" + ;; + esac + # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29478 AC_CACHE_CHECK([checking for GCC bug 29478],[rjk_cv_pr29478],[ old_CC="$CC" -- [mdw]