[project @ 1998-02-04 20:49:58 by sof]
[ghc-hetmet.git] / aclocal.m4
index 91b1fc6..08f6931 100644 (file)
@@ -102,6 +102,11 @@ changequote([, ])dnl
 else
    ac_cv_happy_version="";
 fi;
+if expr "$ac_cv_happy_version" "<" 1.4 > /dev/null 2>&1; then
+   echo
+   echo "Happy version 1.4 or later is required to compile GHC."
+   exit 1;
+fi;
 ])
 HappyVersion=$ac_cv_happy_version;
 AC_SUBST(HappyVersion)
@@ -239,7 +244,7 @@ AC_DEFUN(AC_HAVE_GCC,
     ac_cv_have_gcc='no'
 else
 changequote(, )dnl
-    cmd_string="`$CC -v 2>&1 | grep 'version ' | sed -e 's/.*version \([0-9][0-9]*\)\.\([0-9][0-9]*\).*/expr 20 \\\< \1 \\\* 10 + \2/g' `"
+    cmd_string="`$CC -v 2>&1 | grep 'version ' | sed -e 's/.*version [^0-9]*\([0-9][0-9]*\)\.\([0-9][0-9]*\).*/expr 20 \\\< \1 \\\* 10 + \2/g' `"
 changequote([, ])dnl
     if test `eval $cmd_string 2>/dev/null` != "1"; then
        echo ''
@@ -264,8 +269,8 @@ AC_DEFUN(AC_PROG_GNUCPP,
 [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`"
+       echo '/(\S+(\/|\\)cpp)/ && print "[$]1";' > conftest.pl
+       ac_cv_gnu_cpp="`eval $PerlCmd -n conftest.pl conftest.out | tr '\\\' / `"
        rm -fr conftest*
  else
        # We need to be able to invoke CPP directly, preferably