From: Richard Kettlewell Date: Sun, 27 Apr 2008 19:07:42 +0000 (+0100) Subject: Ask for -std=gnu99 if necessary to get full . X-Git-Tag: 4.0~87 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/disorder/commitdiff_plain/e84ca2905e0e8d75dbeb53d0001b414ba956a8a6?ds=sidebyside Ask for -std=gnu99 if necessary to get full . --- 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"