]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
* tests/compile.at (AC_PROG_CPP via CC): New.
authorAkim Demaille <akim@epita.fr>
Thu, 10 May 2001 15:41:16 +0000 (15:41 +0000)
committerAkim Demaille <akim@epita.fr>
Thu, 10 May 2001 15:41:16 +0000 (15:41 +0000)
From Daniel Carroll.

ChangeLog
THANKS
tests/compile.at

index 4ea4d46a23c7d80d92e834aeb76db78b9dffb172..21e7eee3ee1287308773877d34bb96dc534df58c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2001-05-10  Akim Demaille  <akim@epita.fr>
+
+       * tests/compile.at (AC_PROG_CPP via CC): New.
+       From Daniel Carroll.
+
 2001-04-27  Akim Demaille  <akim@epita.fr>
 
        If AC_PROG_CC is invoked but not AC_PROG_CPP, then CPPFLAGS is not
diff --git a/THANKS b/THANKS
index 131061467fd93dc752f35f139e1321ead873ad18..3f4bdc01644f2afd2708f36869ea14636b24c8d7 100644 (file)
--- a/THANKS
+++ b/THANKS
@@ -28,6 +28,7 @@ Christian Krone             krischan@sql.de
 Christopher Lee             chrislee@ri.cmu.edu
 Chris Torek                 torek@bsdi.com
 Cort Dougan                 cort@cs.nmt.edu
+Daniel Carroll             dan@mesastate.edu
 Daniele Arena               daniele@ripe.net
 Dave Adams                  adams@hpesdwa.fc.hp.com
 Dave Love                   fx@gnu.org
index d6c02c92b547aaabfb383fd17902e43abe56e900..234f78f9ba470c73902b7374d3950c3743d5966e 100644 (file)
@@ -168,6 +168,9 @@ AT_CLEANUP
 
 AT_SETUP([AC_PROG_CPP without warnings])
 
+# Ignore if /lib/cpp doesn't work
+AT_CHECK([/lib/cpp </dev/null || exit 77], [], [ignore], [ignore])
+
 AT_DATA([mycpp],
 [[#! /bin/sh
 /lib/cpp ${1+"$@"}
@@ -177,11 +180,7 @@ exit 0
 chmod +x mycpp
 
 _AT_CHECK_AC_MACRO(
-[[# Ignore if /lib/cpp doesn't work
-if AC_TRY_COMMAND([/lib/cpp </dev/null >&2]); then :; else
-  AC_MSG_ERROR([preprocessor doesn't work], 77)
-fi
-CPP=./mycpp
+[[CPP=./mycpp
 AC_PROG_CPP
 test "x$ac_c_preproc_warn_flag" != xyes &&
   AC_MSG_ERROR([failed to detect preprocessor warning option])
@@ -196,6 +195,57 @@ AT_CLEANUP
 
 
 
+## -------------------- ##
+## AC_PROG_CPP via CC.  ##
+## -------------------- ##
+
+
+# It's Ok for strict preprocessors to produce warnings.
+
+AT_SETUP([AC_PROG_CPP via CC])
+
+# Ignore if /lib/cpp doesn't work
+AT_CHECK([/lib/cpp </dev/null || exit 77], [], [ignore], [ignore])
+
+AT_DATA([mycc],
+[[#! /bin/sh
+echo "Annoying copyright message" >&2
+if test "$1" != "-E"; then
+  exec cc $*
+else
+  if test "$2" = "-traditional-cpp"; then
+    exec cc $*
+  else
+    exec /lib/cpp ${1+"$@"}
+  fi
+fi
+]])
+
+chmod +x mycc
+
+_AT_CHECK_AC_MACRO(
+[[# We go through the following contortions, in order to
+#   have the configure script go down the same codepaths
+#   as it would during a normal CPP selection check.  If
+#   we explicitly set CPP, it goes down a different codepath.
+CC=mycc
+AC_PROG_CPP
+# The test $CC compiler should have been selected.
+test "$CPP" != "mycc -E" &&
+  AC_MSG_ERROR([error messages on stderr cause the preprocessor selection to fail])
+# If the preprocessor is not strict, just ignore
+test "x$ac_c_preproc_warn_flag" = xyes &&
+  AC_MSG_ERROR([preprocessor has no warning option], 77)
+AC_CHECK_HEADERS(stdio.h autoconf_io.h)]])
+
+AT_CHECK_DEFINES(
+[/* #undef HAVE_AUTOCONF_IO_H */
+#define HAVE_STDIO_H 1
+])
+
+AT_CLEANUP
+
+
 ## ------------------ ##
 ## AC_TRY_LINK_FUNC.  ##
 ## ------------------ ##