From 6e2d3a705fa04245e7b5385e34253b24dc75382e Mon Sep 17 00:00:00 2001
From: simonm <unknown>
Date: Thu, 16 Oct 1997 10:54:49 +0000
Subject: [PATCH] [project @ 1997-10-16 10:54:49 by simonm] make the RAWCPP
 test a little more sensible.

---
 aclocal.m4 | 34 ++++++++++++++++------------------
 1 file changed, 16 insertions(+), 18 deletions(-)

diff --git a/aclocal.m4 b/aclocal.m4
index 620ec35ffe95..91b1fc662c5d 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -260,26 +260,24 @@ AC_SUBST(HaveGcc)
 # Substitutes: GNUCPP and RAWCPP (latter is 'GNUCPP -traditional')
 #
 AC_DEFUN(AC_PROG_GNUCPP,
-[AC_CACHE_CHECK([how to invoke cpp directly], ac_cv_gnu_cpp,
-[if echo $CPP | grep gcc >/dev/null 2>&1; then
-    echo > conftest.c
-    gcc -v -E conftest.c >/dev/null 2>conftest.out
-    echo '/(\S+(\/|\\\\)cpp)/ && print "[$]1";' > conftest.pl
-    # GNUCPP: used in jmake.c (GnuCppCmd) and in mkdependC
-    # (where we could do with the usual pre-#defines)
-    ac_cv_gnu_cpp="`eval $PerlCmd -n conftest.pl conftest.out`"
-    rm -fr conftest*
-else
-    # It is likely that this will go terribly wrong..
-    ac_cv_gnu_cpp='cc -E'
-fi
+[AC_CACHE_CHECK([how to invoke GNU cpp directly], ac_cv_gnu_cpp,
+[if test "$HaveGcc" = "YES"; then
+	echo > conftest.c
+	gcc -v -E conftest.c >/dev/null 2>conftest.out
+	echo '/(\S+(\/|\\\\)cpp)/ && print "[$]1";' > conftest.pl
+	ac_cv_gnu_cpp="`eval $PerlCmd -n conftest.pl conftest.out`"
+	rm -fr conftest*
+ else
+	# We need to be able to invoke CPP directly, preferably
+	# with input from stdin (mkdependHS and hscpp depend on
+	# this at the moment).
+	# Take a guess at what to use, this probably won't work.
+	echo Warning: GNU cpp not found, using $CPP
+	ac_cv_gnu_cpp =	$CPP
+ fi
 ])
 GNUCPP=$ac_cv_gnu_cpp
-if test "$GNUCPP" = "cc -E"; then
-   RAWCPP="$GNUCPP"
-else
-   RAWCPP="$GNUCPP -traditional"
-fi
+RAWCPP="$GNUCPP -traditional"
 AC_SUBST(GNUCPP)
 AC_SUBST(RAWCPP)
 ])
-- 
GitLab