From 0b0d0514aadfe18b136b0836aed361af7c486ac1 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Fri, 30 Sep 2011 11:54:58 +0200 Subject: [PATCH] Centralize C99 requirement. * m4/gnulib-common.m4 (gl_PROG_CC_C99): New macro. * modules/stdarg (configure.ac-early): Invoke it instead of AC_PROG_CC_STDC. Reported by Gary V. Vaughan and Paul Eggert. --- ChangeLog | 8 ++++++++ m4/gnulib-common.m4 | 25 ++++++++++++++++++++++++- modules/stdarg | 4 ++-- 3 files changed, 34 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index c629f0a45..5bf69f17f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2011-09-30 Bruno Haible + + Centralize C99 requirement. + * m4/gnulib-common.m4 (gl_PROG_CC_C99): New macro. + * modules/stdarg (configure.ac-early): Invoke it instead of + AC_PROG_CC_STDC. + Reported by Gary V. Vaughan and Paul Eggert. + 2011-09-29 Bruno Haible float: Fix LDBL_MAX value on Linux/PowerPC. diff --git a/m4/gnulib-common.m4 b/m4/gnulib-common.m4 index 8fc448fdc..7d8329995 100644 --- a/m4/gnulib-common.m4 +++ b/m4/gnulib-common.m4 @@ -1,4 +1,4 @@ -# gnulib-common.m4 serial 30 +# gnulib-common.m4 serial 31 dnl Copyright (C) 2007-2011 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -211,6 +211,29 @@ m4_ifndef([AS_VAR_IF], [m4_define([AS_VAR_IF], [AS_IF([test x"AS_VAR_GET([$1])" = x""$2], [$3], [$4])])]) +# gl_PROG_CC_C99 +# Modifies the value of the shell variable CC in an attempt to make $CC +# understand ISO C99 source code. +# This is like AC_PROG_CC_C99, except that +# - AC_PROG_CC_C99 did not exist in Autoconf versions < 2.60, +# - AC_PROG_CC_C99 does not mix well with AC_PROG_CC_STDC +# , +# but many more packages use AC_PROG_CC_STDC than AC_PROG_CC_C99 +# . +# Remaining problems: +# - When AC_PROG_CC_STDC is invoked twice, it adds the C99 enabling options +# to CC twice +# . +# - AC_PROG_CC_STDC is likely to change when C1X is an ISO standard. +AC_DEFUN([gl_PROG_CC_C99], +[ + dnl Change that version number to the minimum Autoconf version that supports + dnl mixing AC_PROG_CC_C99 calls with AC_PROG_CC_STDC calls. + m4_version_prereq([9.0], + [AC_REQUIRE([AC_PROG_CC_C99])], + [AC_REQUIRE([AC_PROG_CC_STDC])]) +]) + # gl_PROG_AR_RANLIB # Determines the values for AR, ARFLAGS, RANLIB that fit with the compiler. # The user can set the variables AR, ARFLAGS, RANLIB if he wants to override diff --git a/modules/stdarg b/modules/stdarg index 84d3e7b44..44029cdc8 100644 --- a/modules/stdarg +++ b/modules/stdarg @@ -11,9 +11,9 @@ include_next configure.ac-early: dnl Some compilers (e.g., AIX 5.3 cc) need to be in c99 mode dnl for the builtin va_copy to work. With Autoconf 2.60 or later, -dnl AC_PROG_CC_STDC arranges for this. With older Autoconf AC_PROG_CC_STDC +dnl gl_PROG_CC_C99 arranges for this. With older Autoconf gl_PROG_CC_C99 dnl shouldn't hurt, though installers are on their own to set c99 mode. -AC_REQUIRE([AC_PROG_CC_STDC]) +gl_PROG_CC_C99 configure.ac: gl_STDARG_H -- 2.11.0