[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: AC_PROG_CC_STDC and ac_cv_prog_cc_stdc
From: |
Ralf Wildenhues |
Subject: |
Re: AC_PROG_CC_STDC and ac_cv_prog_cc_stdc |
Date: |
Sun, 7 May 2006 22:35:59 +0200 |
User-agent: |
Mutt/1.5.11+cvs20060403 |
Hi Paul,
* Paul Eggert wrote on Sat, May 06, 2006 at 07:54:37PM CEST:
> Ralf Wildenhues <address@hidden> writes:
>
> > Some Automake testsuite tests currently use
> > ./configure ac_cv_prog_cc_stdc=no
> >
> > to force use of ansi2knr. I know the topic is becoming more and more
> > obsolete,
>
> It's not "more and more obsolete". It's obsolete, period. Nobody
> uses K&R compilers any more for real work, and this has been true for
> several years.
Yes. We're in violent agreement here. With "more and more obsolete", I
tried to allude to the progress from "it's obsolete in practice" to "its
traces from Autoconf vanish" to "its traces from Automake vanish".
> That being said, the Autoconf patch looks OK to me, if only to cater
> to Automake; except the NEWS item is a bit cryptic. How about this
> news item instead?
Yep, that's definitely better. I installed the patch with that change.
So for Automake I now propose this remaining patch.
Cheers, and thanks for the review!
Ralf
* tests/ansi10.test: Use AC_PROG_CC_STDC. Fix test that
ac_cv_prog_cc_stdc isn't just used by Automake code in
`configure'.
* tests/ansi6.test, tests/ansi7.test: Likewise.
* tests/ansi9.test: Likewise. Do not override by setting
$U and $(ANSI2KNR) at `make' time; that will be fragile.
* tests/libobj8.test: Use AC_PROG_CC_STDC.
* tests/subobj3.test: Likewise. Use `set -e'.
Index: tests/ansi10.test
===================================================================
RCS file: /cvs/automake/automake/tests/ansi10.test,v
retrieving revision 1.4
diff -u -r1.4 ansi10.test
--- tests/ansi10.test 14 May 2005 20:28:54 -0000 1.4
+++ tests/ansi10.test 7 May 2006 20:33:44 -0000
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 2002 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2006 Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
@@ -27,6 +27,7 @@
cat >> configure.in << 'END'
AC_PROG_CC
+AC_PROG_CC_STDC
AM_C_PROTOTYPES
AC_PROG_RANLIB
AC_LIBOBJ([hello])
@@ -62,7 +63,7 @@
$AUTOMAKE -a
# Sanity check: make sure it's ok to set ac_cv_prog_cc_stdc as we do.
-grep ac_cv_prog_cc_stdc configure
+test `grep -c ac_cv_prog_cc_stdc configure` -gt 1
./configure ac_cv_prog_cc_stdc=no
$MAKE
Index: tests/ansi6.test
===================================================================
RCS file: /cvs/automake/automake/tests/ansi6.test,v
retrieving revision 1.7
diff -u -r1.7 ansi6.test
--- tests/ansi6.test 14 May 2005 20:28:54 -0000 1.7
+++ tests/ansi6.test 7 May 2006 20:33:44 -0000
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 2002 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2006 Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
@@ -28,6 +28,7 @@
AC_INIT(ansi6, 1.0)
AM_INIT_AUTOMAKE
AC_PROG_CC
+AC_PROG_CC_STDC
AM_C_PROTOTYPES
AC_EXEEXT
AC_OBJEXT
@@ -70,7 +71,7 @@
$AUTOMAKE -a
# Sanity check: make sure it's ok to set ac_cv_prog_cc_stdc as we do.
-grep ac_cv_prog_cc_stdc configure
+test `grep -c ac_cv_prog_cc_stdc configure` -gt 1
./configure ac_cv_prog_cc_stdc=no
$MAKE
Index: tests/ansi7.test
===================================================================
RCS file: /cvs/automake/automake/tests/ansi7.test,v
retrieving revision 1.6
diff -u -r1.6 ansi7.test
--- tests/ansi7.test 14 May 2005 20:28:54 -0000 1.6
+++ tests/ansi7.test 7 May 2006 20:33:44 -0000
@@ -29,6 +29,7 @@
AC_INIT(ansi6, 1.0)
AM_INIT_AUTOMAKE
AC_PROG_CC
+AC_PROG_CC_STDC
AM_PROG_CC_C_O
AM_C_PROTOTYPES
AC_EXEEXT
@@ -72,7 +73,7 @@
$AUTOMAKE -a
# Sanity check: make sure it's ok to set ac_cv_prog_cc_stdc as we do.
-grep ac_cv_prog_cc_stdc configure
+test `grep -c ac_cv_prog_cc_stdc configure` -gt 1
./configure ac_cv_prog_cc_stdc=no
$MAKE
Index: tests/ansi9.test
===================================================================
RCS file: /cvs/automake/automake/tests/ansi9.test,v
retrieving revision 1.4
diff -u -r1.4 ansi9.test
--- tests/ansi9.test 14 May 2005 20:28:54 -0000 1.4
+++ tests/ansi9.test 7 May 2006 20:33:44 -0000
@@ -40,9 +40,6 @@
loadavg_SOURCES = loadavg.c
loadavg_CFLAGS = -DTEST
sub_sub_SOURCES = sub/sub.c
-# Force ansi2knr's use, regardless of the compiler.
-U=_
-ANSI2KNR=./ansi2knr
END
cat > loadavg.c << 'END'
@@ -61,8 +58,9 @@
$AUTOMAKE --add-missing -Wno-override
$FGREP 'loadavg-loadavg$U.o: loadavg$U.c' Makefile.in
-# The following rule should not exists, because the
+# The following rule should not exist, because the
# default .o.c: inference rule is enough.
$FGREP 'sub/sub$U.o: sub/sub$U.c' Makefile.in && exit 1
-./configure
+# Force ansi2knr's use, regardless of the compiler.
+./configure ac_cv_prog_cc_stdc=no
$MAKE sub/sub_.c
Index: tests/libobj8.test
===================================================================
RCS file: /cvs/automake/automake/tests/libobj8.test,v
retrieving revision 1.10
diff -u -r1.10 libobj8.test
--- tests/libobj8.test 14 May 2005 20:28:55 -0000 1.10
+++ tests/libobj8.test 7 May 2006 20:33:44 -0000
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 1998, 2000, 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 1998, 2000, 2001, 2002, 2006 Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
@@ -27,6 +27,7 @@
AC_INIT
AM_INIT_AUTOMAKE(nonesuch, nonesuch)
AC_PROG_CC
+AC_PROG_CC_STDC
AC_PROG_RANLIB
AC_REPLACE_FUNCS(basename dirname strsignal)
AM_C_PROTOTYPES
Index: tests/subobj3.test
===================================================================
RCS file: /cvs/automake/automake/tests/subobj3.test,v
retrieving revision 1.17
diff -u -r1.17 subobj3.test
--- tests/subobj3.test 14 May 2005 20:28:56 -0000 1.17
+++ tests/subobj3.test 7 May 2006 20:33:44 -0000
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 Free Software
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2006 Free Software
# Foundation, Inc.
#
# This file is part of GNU Automake.
@@ -24,12 +24,15 @@
required=gcc
. ./defs || exit 1
+set -e
+
cat > configure.in << 'END'
AC_INIT(sub/hello.c)
dnl Prevent automake from looking in .. and ../..
AC_CONFIG_AUX_DIR(.)
AM_INIT_AUTOMAKE(hello,0.23)
AC_PROG_CC
+AC_PROG_CC_STDC
AM_PROG_CC_C_O
AM_C_PROTOTYPES
AC_OUTPUT(Makefile)
@@ -58,9 +61,9 @@
# We use gcc and not gcc -traditional as the latter fails on some
# Linux boxes (Red Hat 5.1 in particular).
-$ACLOCAL \
- && $AUTOCONF \
- && $AUTOMAKE -a \
- && ./configure \
- && ANSI2KNR=./ansi2knr U=_ $MAKE -e \
- && ./hello
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE -a
+./configure
+ANSI2KNR=./ansi2knr U=_ $MAKE -e
+./hello