[project @ 2003-05-17 14:49:45 by reid]
authorreid <unknown>
Sat, 17 May 2003 14:51:28 +0000 (14:51 +0000)
committerreid <unknown>
Sat, 17 May 2003 14:51:28 +0000 (14:51 +0000)
Add checks for ghc-pkg and green-card 3.00 (used in x11 lib)

aclocal.m4
configure.in
mk/config.mk.in

index 5d759ed..86ec141 100644 (file)
@@ -1,4 +1,4 @@
-dnl $Id: aclocal.m4,v 1.115 2003/03/26 12:33:11 simonmar Exp $
+dnl $Id: aclocal.m4,v 1.116 2003/05/17 14:49:45 reid Exp $
 dnl 
 dnl Extra autoconf macros for the Glasgow fptools
 dnl
 dnl 
 dnl Extra autoconf macros for the Glasgow fptools
 dnl
@@ -188,6 +188,28 @@ fi
 
 
 dnl
 
 
 dnl
+dnl Check for Greencard and version.
+dnl
+AC_DEFUN(FPTOOLS_GREENCARD,
+[
+AC_PATH_PROG(GreencardCmd,green-card)
+AC_CACHE_CHECK([for version of green-card], fptools_cv_greencard_version,
+changequote(, )dnl
+[if test x"$GreencardCmd" != x; then
+   fptools_cv_greencard_version="`$GreencardCmd --version |
+                         grep 'version' | sed -e 's/green-card. version \([^ ]*\).*/\1/g'`"
+else
+   fptools_cv_greencard_version=""
+fi
+changequote([, ])dnl
+])
+FPTOOLS_PROG_CHECK_VERSION([$fptools_cv_greencard_version],-lt,$1,
+  [AC_MSG_ERROR([green-card version $1 or later is required (found '$fptools_cv_greencard_version')])])dnl
+GreencardVersion=$fptools_cv_greencard_version
+AC_SUBST(GreencardVersion)
+])
+
+dnl
 dnl Check for Happy and version.  If we're building GHC, then we need
 dnl at least Happy version 1.13.  If there's no installed Happy, we look
 dnl for a happy source tree and point the build system at that instead.
 dnl Check for Happy and version.  If we're building GHC, then we need
 dnl at least Happy version 1.13.  If there's no installed Happy, we look
 dnl for a happy source tree and point the build system at that instead.
index ccaa828..6e8d6c1 100644 (file)
@@ -670,6 +670,19 @@ fi
 AC_SUBST(CompressCmd)
 AC_SUBST(CompressSuffix)
 
 AC_SUBST(CompressCmd)
 AC_SUBST(CompressSuffix)
 
+dnl ** check for ghc-pkg command
+AC_PATH_PROG(GhcPkgCmd,ghc-pkg)
+
+AC_ARG_WITH(greencard,
+[  --with-greencard=<greencard compiler>
+        Use a command different from 'green-card' to compile GreenCard files
+],
+[
+GreencardCmd=$withval;
+FPTOOLS_GREENCARD(3.00)
+]
+)
+
 AC_ARG_ENABLE(src-tree-happy,
 [  --enable-src-tree-happy
         Build and use source tree (fptools/happy) version of happy.
 AC_ARG_ENABLE(src-tree-happy,
 [  --enable-src-tree-happy
         Build and use source tree (fptools/happy) version of happy.
index 5d339ad..045dafe 100644 (file)
@@ -830,7 +830,6 @@ VERBATIM            = $(VERBATIM_PREFIX)verbatim
 SGMLVERB               = $(SGMLVERB_PREFIX)sgmlverb
 RUNTEST                        = $(RUNTEST_PREFIX)runstdtest
 LX                     = @LxCmd@
 SGMLVERB               = $(SGMLVERB_PREFIX)sgmlverb
 RUNTEST                        = $(RUNTEST_PREFIX)runstdtest
 LX                     = @LxCmd@
-GREENCARD              = $(FPTOOLS_TOP)/green-card/src/green-card
 
 BLD_DLL                        = dllwrap
 
 
 BLD_DLL                        = dllwrap
 
@@ -841,6 +840,17 @@ ILX2IL                  = ilx2il
 ILASM                   = ilasm
 
 #
 ILASM                   = ilasm
 
 #
+# ghc-pkg
+#
+GHC_PKG                        = @GhcPkgCmd@
+
+#
+# Greencard
+#
+GREENCARD              = @GreencardCmd@
+GREENCARD_VERSION      = @GreencardVersion@            
+
+#
 # Happy
 #
 HAPPY                  = @HappyCmd@
 # Happy
 #
 HAPPY                  = @HappyCmd@