automake-patches
[Top][All Lists]
Advanced

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

AC_PROG_CPP


From: Akim Demaille
Subject: AC_PROG_CPP
Date: 02 Oct 2002 12:27:20 +0200
User-agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Honest Recruiter)

I was annoyed by Automake AC_REQUIRE AC_PROG_CPP.  That was good for
when Autoconf had broken AC_REQUIRE, but it is no longer the case.  As
a matter of fact, any such AC_REQUIRE is certainly an Autoconf bug: it
is not normal for user macros to require for a compiler when using
AC_CHECK_HEADERS etc.: that's handled by Autoconf itself.

And I fell onto these macros which should be adjusted to current
Autoconves.  I removed depacl which failed because by accident it used
these macros to test aclocal.  But instead of using another macro as
an aclocal test case, I thinking removing the test makes more sense:
this test is now useless.  I would remove depacl2.test, but I leave
this to you.

OK to install?  Where?

Index: ChangeLog
from  Akim Demaille  <address@hidden>

        * m4/ccstdc.m4 (AM_PROG_CC_STDC): Its definition is now empty:
        the content of this macro was merged in AC_PROG_CC.
        * m4/protos.m4 (AM_C_PROTOTYPES): Adjust to AC_C_PROTOTYPES.
        * tests/depacl.test: Remove, it exercize aclocal in a way that was
        exercized by all the other tests since the test suite really uses
        aclocal.

Index: m4/ccstdc.m4
===================================================================
RCS file: /cvs/automake/automake/m4/ccstdc.m4,v
retrieving revision 1.11
diff -u -u -r1.11 ccstdc.m4
--- m4/ccstdc.m4 19 Jul 2002 20:17:58 -0000 1.11
+++ m4/ccstdc.m4 2 Oct 2002 10:22:07 -0000
@@ -1,4 +1,4 @@
-## ----------------------------------------- ##
+## ----------------------------------------- ##                     -*- 
Autoconf -*-
 ## ANSIfy the C compiler whenever possible.  ##
 ## From Franc,ois Pinard                     ##
 ## ----------------------------------------- ##
@@ -20,92 +20,9 @@
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 # 02111-1307, USA.
 
-# serial 2
+# serial 3
 
-# @defmac AC_PROG_CC_STDC
-# @maindex PROG_CC_STDC
-# @ovindex CC
-# 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.
-#
-# If you use this macro, you should check after calling it whether the C
-# compiler has been set to accept ANSI C; if not, the shell variable
-# @code{am_cv_prog_cc_stdc} is set to @samp{no}.  If you wrote your source
-# code in ANSI C, you can make an un-ANSIfied copy of it by using the
-# program @code{ansi2knr}, which comes with Ghostscript.
-# @end defmac
-
-AC_DEFUN([AM_PROG_CC_STDC],
-[AC_REQUIRE([AC_PROG_CC])
-AC_BEFORE([$0], [AC_C_INLINE])
-AC_BEFORE([$0], [AC_C_CONST])
-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-cc} option to accept ANSI C])
-AC_CACHE_VAL(am_cv_prog_cc_stdc,
-[am_cv_prog_cc_stdc=no
-ac_save_CC="$CC"
-# Don't try gcc -ansi; that turns off useful extensions and
-# breaks some systems' header files.
-# AIX                  -qlanglvl=ansi
-# Ultrix and OSF/1     -std1
-# HP-UX 10.20 and later        -Ae
-# HP-UX older versions -Aa -D_HPUX_SOURCE
-# SVR4                 -Xc -D__EXTENSIONS__
-for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc 
-D__EXTENSIONS__"
-do
-  CC="$ac_save_CC $ac_arg"
-  AC_TRY_COMPILE(
-[#include <stdarg.h>
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
-struct buf { int x; };
-FILE * (*rcsopen) (struct buf *, struct stat *, int);
-static char *e (p, i)
-     char **p;
-     int i;
-{
-  return p[i];
-}
-static char *f (char * (*g) (char **, int), char **p, ...)
-{
-  char *s;
-  va_list v;
-  va_start (v,p);
-  s = g (p, va_arg (v,int));
-  va_end (v);
-  return s;
-}
-int test (int i, double x);
-struct s1 {int (*f) (int a);};
-struct s2 {int (*f) (double a);};
-int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, 
int);
-int argc;
-char **argv;
-], [
-return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
-],
-[am_cv_prog_cc_stdc="$ac_arg"; break])
-done
-CC="$ac_save_CC"
-])
-if test -z "$am_cv_prog_cc_stdc"; then
-  AC_MSG_RESULT([none needed])
-else
-  AC_MSG_RESULT([$am_cv_prog_cc_stdc])
-fi
-case "x$am_cv_prog_cc_stdc" in
-  x|xno) ;;
-  *) CC="$CC $am_cv_prog_cc_stdc" ;;
-esac
-])
+# This was merged into AC_PROG_CC in Autoconf.
 
-AU_DEFUN([fp_PROG_CC_STDC], [AM_PROG_CC_STDC])
+AU_DEFUN([AM_PROG_CC_STDC])
+AU_DEFUN([fp_PROG_CC_STDC])
Index: m4/protos.m4
===================================================================
RCS file: /cvs/automake/automake/m4/protos.m4,v
retrieving revision 1.8
diff -u -u -r1.8 protos.m4
--- m4/protos.m4 19 Jul 2002 20:17:58 -0000 1.8
+++ m4/protos.m4 2 Oct 2002 10:22:07 -0000
@@ -1,4 +1,4 @@
-## ------------------------------- ##
+## ------------------------------- ##                               -*- 
Autoconf -*-
 ## Check for function prototypes.  ##
 ## From Franc,ois Pinard           ##
 ## ------------------------------- ##
@@ -23,19 +23,15 @@
 # serial 2
 
 AC_DEFUN([AM_C_PROTOTYPES],
-[AC_REQUIRE([AM_PROG_CC_STDC])
-AC_REQUIRE([AC_PROG_CPP])
+[AC_REQUIRE([AC_C_PROTOTYPES])
 AC_MSG_CHECKING([for function prototypes])
-if test "$am_cv_prog_cc_stdc" != no; then
-  AC_MSG_RESULT(yes)
-  AC_DEFINE(PROTOTYPES,1,[Define if compiler has function prototypes])
+if test "$ac_cv_prog_cc_stdc" != no; then
   U= ANSI2KNR=
 else
-  AC_MSG_RESULT(no)
   U=_ ANSI2KNR=./ansi2knr
 fi
 # Ensure some checks needed by ansi2knr itself.
-AC_HEADER_STDC
+AC_REQUIRE([AC_HEADER_STDC])
 AC_CHECK_HEADERS(string.h)
 AC_SUBST(U)dnl
 AC_SUBST(ANSI2KNR)dnl
Index: tests/Makefile.am
===================================================================
RCS file: /cvs/automake/automake/tests/Makefile.am,v
retrieving revision 1.446
diff -u -u -r1.446 Makefile.am
--- tests/Makefile.am 30 Sep 2002 18:08:07 -0000 1.446
+++ tests/Makefile.am 2 Oct 2002 10:22:09 -0000
@@ -126,7 +126,6 @@
 defun2.test \
 dejagnu.test \
 dejagnu2.test \
-depacl.test \
 depacl2.test \
 depcomp.test \
 depcomp2.test \
Index: tests/depacl.test
===================================================================
RCS file: tests/depacl.test
diff -N tests/depacl.test
--- tests/depacl.test 8 Sep 2002 13:07:55 -0000 1.3
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,31 +0,0 @@
-#! /bin/sh
-# Copyright (C) 1996, 2000, 2001, 2002  Free Software Foundation, Inc.
-#
-# This file is part of GNU Automake.
-#
-# GNU Automake is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# GNU Automake is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with autoconf; see the file COPYING.  If not, write to
-# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-# Boston, MA 02111-1307, USA.
-
-# Test to make sure dependency tracking works.
-
-. ./defs || exit 1
-
-cat > configure.in << 'END'
-AM_C_PROTOTYPES
-END
-
-$ACLOCAL || exit 1
-
-grep '^AC_DEFUN.*AM_PROG_CC_STDC' aclocal.m4




reply via email to

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