autoconf-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Patch to integrate AC_PROG_CC_STDC into AC_PROG_CC


From: Peter Eisentraut
Subject: Patch to integrate AC_PROG_CC_STDC into AC_PROG_CC
Date: Thu, 28 Mar 2002 19:05:47 -0500 (EST)

After the discussion on address@hidden I would like to offer the
following patch to integrate the functionality of AC_PROG_CC_STDC into
AC_PROG_CC.  Please comment.


Index: ChangeLog
===================================================================
RCS file: /cvsroot/autoconf/autoconf/ChangeLog,v
retrieving revision 1.1890
diff -u -r1.1890 ChangeLog
--- ChangeLog   27 Mar 2002 22:45:23 -0000      1.1890
+++ ChangeLog   28 Mar 2002 23:54:30 -0000
@@ -1,3 +1,16 @@
+2002-03-28  Peter Eisentraut  <address@hidden>
+
+       Integrate AC_PROG_CC_STDC into AC_PROG_CC.
+
+       * lib/autoconf/c.m4 (AC_PROG_CC_STDC): Rename to _AC_PROG_CC_STDC.
+       AU_DEFUN old name.  Use _AC_COMPILE_IFELSE.
+       (AC_PROG_CC): Call _AC_PROG_CC_STDC.
+       (AC_C_INLINE): Do not require AC_PROG_CC_STDC.
+       (AC_C_CONST): Same.
+       (AC_C_INLINE): Same.
+       (AC_C_PROTOTYPES): Same.  Require AC_PROG_CC instead.
+       * doc/autoconf.texi, NEWS: Document.
+
 2002-03-28  Kevin Ryde  <address@hidden>

        * lib/autoconf/c.m4 (AC_C_INLINE): Test with a typedef return value,
Index: NEWS
===================================================================
RCS file: /cvsroot/autoconf/autoconf/NEWS,v
retrieving revision 1.225
diff -u -r1.225 NEWS
--- NEWS        14 Mar 2002 17:25:13 -0000      1.225
+++ NEWS        28 Mar 2002 23:54:31 -0000
@@ -4,6 +4,10 @@

 - autoreconf is adjusted to GNU Gettext 0.11.

+** Macros
+
+- AC_PROG_CC_STDC is integrated into AC_PROG_CC.
+

 * Major changes in Autoconf 2.53

Index: doc/autoconf.texi
===================================================================
RCS file: /cvsroot/autoconf/autoconf/doc/autoconf.texi,v
retrieving revision 1.605
diff -u -r1.605 autoconf.texi
--- doc/autoconf.texi   26 Mar 2002 09:32:30 -0000      1.605
+++ doc/autoconf.texi   28 Mar 2002 23:54:34 -0000
@@ -4770,6 +4770,19 @@
 AC_PROG_CC(cl egcs gcc cc)
 @end example

+If the C compiler is not in @sc{ansi} C mode by default, try to add an
+option to output variable @code{CC} to make it so.  This macro tries
+various options that select @sc{ansi} C on some system or another.  It
+considers the compiler to be in @sc{ansi} C mode if it handles function
+prototypes correctly.
+
+After calling this macro you can check whether the C compiler has been
+set to accept @sc{ansi} C; if not, the shell variable
address@hidden is set to @samp{no}.  If you wrote your source
+code in @sc{ansi} C, you can make an address@hidden copy of it by
+using the program @code{ansi2knr}, which comes with Automake.  See also
+under @code{AC_C_PROTOTYPES} below.
+
 If using the @sc{gnu} C compiler, set shell variable @code{GCC} to
 @samp{yes}.  If output variable @code{CFLAGS} was not already set, set
 it to @option{-g -O2} for the @sc{gnu} C compiler (@option{-O2} on systems
@@ -4787,22 +4800,6 @@
 rule.
 @end defmac

address@hidden AC_PROG_CC_STDC
address@hidden PROG_CC_STDC
address@hidden CC
-If the C compiler is not in @sc{ansi} C mode by default, try to add an
-option to output variable @code{CC} to make it so.  This macro tries
-various options that select @sc{ansi} C on some system or another.  It
-considers the compiler to be in @sc{ansi} C mode if it handles function
-prototypes correctly.
-
-If you use this macro, you should check after calling it whether the C
-compiler has been set to accept @sc{ansi} C; if not, the shell variable
address@hidden is set to @samp{no}.  If you wrote your source
-code in @sc{ansi} C, you can make an address@hidden copy of it by
-using the program @code{ansi2knr}, which comes with Automake.
address@hidden defmac
-

 @defmac AC_PROG_CPP
 @acindex PROG_CPP
@@ -4941,8 +4938,8 @@
 @cvindex PROTOTYPES
 @cvindex __PROTOTYPES
 @cvindex PARAMS
-Check to see if function prototypes are understood by the compiler.  If
-so, define @code{PROTOTYPES} and @code{__PROTOTYPES}.
+If function prototypes are understood by the compiler (as determined by
address@hidden), define @code{PROTOTYPES} and @code{__PROTOTYPES}.
 In the case the compiler does not handle
 prototypes, you should use @code{ansi2knr}, which comes with the
 Automake distribution, to unprotoize function definitions.  For
@@ -11817,6 +11814,11 @@
 @defmac AC_PREFIX
 @acindex PREFIX
 @code{AC_PREFIX_PROGRAM}
address@hidden defmac
+
address@hidden AC_PROG_CC_STDC
address@hidden PROG_CC_STDC
+This macro has been integrated into @code{AC_PROG_CC_STDC}.
 @end defmac

 @defmac AC_PROGRAMS_CHECK
Index: lib/autoconf/c.m4
===================================================================
RCS file: /cvsroot/autoconf/autoconf/lib/autoconf/c.m4,v
retrieving revision 1.161
diff -u -r1.161 c.m4
--- lib/autoconf/c.m4   27 Mar 2002 22:43:45 -0000      1.161
+++ lib/autoconf/c.m4   28 Mar 2002 23:54:34 -0000
@@ -432,6 +432,7 @@
 _AC_LANG_COMPILER_GNU
 GCC=`test $ac_compiler_gnu = yes && echo yes`
 _AC_PROG_CC_G
+_AC_PROG_CC_STDC
 # Some people use a C++ compiler to compile C.  Since we use `exit',
 # in C++ we need to declare it.  In case someone uses the same compiler
 # for both compiling C and C++ we need to have the C++ compiler decide
@@ -723,24 +724,15 @@
 # 4b. C compiler characteristics.  #
 # -------------------------------- #

-# AC_PROG_CC_STDC
-# ---------------
+# _AC_PROG_CC_STDC
+# ----------------
 # If the C compiler in not in ANSI C mode by default, try to add an
 # option to output variable @code{CC} to make it so.  This macro tries
 # various options that select ANSI C on some system or another.  It
 # considers the compiler to be in ANSI C mode if it handles function
 # prototypes correctly.
-AC_DEFUN([AC_PROG_CC_STDC],
-[AC_REQUIRE([AC_PROG_CC])dnl
-AC_BEFORE([$0], [AC_C_INLINE])dnl
-AC_BEFORE([$0], [AC_C_CONST])dnl
-dnl Force this before AC_PROG_CPP.  Some cpp's, eg on HPUX, require
-dnl a magic option to avoid problems with ANSI preprocessor commands
-dnl like #elif.
-dnl FIXME: can't do this because then AC_AIX won't work due to a
-dnl circular dependency.
-dnl AC_BEFORE([$0], [AC_PROG_CPP])
-AC_MSG_CHECKING([for $CC option to accept ANSI C])
+AC_DEFUN([_AC_PROG_CC_STDC],
+[AC_MSG_CHECKING([for $CC option to accept ANSI C])
 AC_CACHE_VAL(ac_cv_prog_cc_stdc,
 [ac_cv_prog_cc_stdc=no
 ac_save_CC=$CC
@@ -784,8 +776,8 @@
 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc 
-D__EXTENSIONS__"
 do
   CC="$ac_save_CC $ac_arg"
-  AC_COMPILE_IFELSE([],
-                    [ac_cv_prog_cc_stdc=$ac_arg
+  _AC_COMPILE_IFELSE([],
+                     [ac_cv_prog_cc_stdc=$ac_arg
 break])
 done
 rm -f conftest.$ac_ext conftest.$ac_objext
@@ -798,7 +790,13 @@
     AC_MSG_RESULT([$ac_cv_prog_cc_stdc])
     CC="$CC $ac_cv_prog_cc_stdc" ;;
 esac
-])# AC_PROG_CC_STDC
+])# _AC_PROG_CC_STDC
+
+
+# AC_PROG_CC_STDC
+# ---------------
+# Has been merged into AC_PROG_CC.
+AU_DEFUN([AC_PROG_CC_STDC], [])


 # AC_C_CROSS
@@ -927,8 +925,7 @@
 # inline function, only builtin types.
 #
 AC_DEFUN([AC_C_INLINE],
-[AC_REQUIRE([AC_PROG_CC_STDC])dnl
-AC_CACHE_CHECK([for inline], ac_cv_c_inline,
+[AC_CACHE_CHECK([for inline], ac_cv_c_inline,
 [ac_cv_c_inline=no
 for ac_kw in inline __inline__ __inline; do
   AC_COMPILE_IFELSE([AC_LANG_SOURCE(
@@ -954,8 +951,7 @@
 # AC_C_CONST
 # ----------
 AC_DEFUN([AC_C_CONST],
-[AC_REQUIRE([AC_PROG_CC_STDC])dnl
-AC_CACHE_CHECK([for an ANSI C-conforming const], ac_cv_c_const,
+[AC_CACHE_CHECK([for an ANSI C-conforming const], ac_cv_c_const,
 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],
 [[/* FIXME: Include the comments suggested by Paul. */
 #ifndef __cplusplus
@@ -1022,8 +1018,7 @@
 # volatile away unless it is really necessary to allow the user's code
 # to compile cleanly.  Benign compiler failures should be tolerated.
 AC_DEFUN([AC_C_VOLATILE],
-[AC_REQUIRE([AC_PROG_CC_STDC])dnl
-AC_CACHE_CHECK([for working volatile], ac_cv_c_volatile,
+[AC_CACHE_CHECK([for working volatile], ac_cv_c_volatile,
 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [
 volatile int x;
 int * volatile y;])],
@@ -1063,7 +1058,7 @@
 # Check if the C compiler supports prototypes, included if it needs
 # options.
 AC_DEFUN([AC_C_PROTOTYPES],
-[AC_REQUIRE([AC_PROG_CC_STDC])dnl
+[AC_REQUIRE([AC_PROG_CC])dnl
 AC_MSG_CHECKING([for function prototypes])
 if test "$ac_cv_prog_cc_stdc" != no; then
   AC_MSG_RESULT([yes])

-- 
Peter Eisentraut   address@hidden




reply via email to

[Prev in Thread] Current Thread [Next in Thread]