[project @ 2004-11-20 15:12:26 by panne]
authorpanne <unknown>
Sat, 20 Nov 2004 15:12:30 +0000 (15:12 +0000)
committerpanne <unknown>
Sat, 20 Nov 2004 15:12:30 +0000 (15:12 +0000)
Pushed "ghc has readline" check down to ghc subdir

aclocal.m4
configure.ac
ghc/aclocal.m4
ghc/configure.ac
ghc/mk/config.mk.in [moved from ghc/mk/config.mk with 88% similarity]

index a280ecb..3b40d70 100644 (file)
@@ -657,19 +657,6 @@ ifelse($#, [1], [dnl
 ])dnl
 
 
-AC_DEFUN(FPTOOLS_GHC_HAS_READLINE,
-[AC_CACHE_CHECK([whether ghc has readline package], [fptools_ghc_has_readline],
-[if "${GhcPkgCmd-ghc-pkg}" --show-package readline >/dev/null 2>&1; then
-    fptools_ghc_has_readline='yes';
-    GhcHasReadline='YES';
- else
-    fptools_ghc_has_readline='no';
-    GhcHasReadline='NO';
- fi
- AC_SUBST(GhcHasReadline)
-])
-])
-
 dnl ** Map an arithmetic C type to a Haskell type.
 dnl    Based on autconf's AC_CHECK_SIZEOF.
 
index 1e2ad95..5d1023d 100644 (file)
@@ -874,9 +874,6 @@ FP_PROG_FO_PROCESSOR
 dnl ** check for ghc-pkg command
 FP_PROG_GHC_PKG
 
-dnl Check whether this GHC has readline installed
-FPTOOLS_GHC_HAS_READLINE
-
 AC_ARG_WITH(greencard,
 [AC_HELP_STRING([--with-greencard=ARG],
         [Use ARG as the path to greencard  [default=autodetct]])],
index ed54156..aa3ebf9 100644 (file)
@@ -24,3 +24,37 @@ AC_SUBST([ProjectVersionInt])
 test -z "$ProjectPatchLevel" && ProjectPatchLevel=0
 AC_SUBST([ProjectPatchLevel])
 ])# FP_SETUP_PROJECT_INFO
+
+
+# FP_PROG_GHC_PKG
+# ----------------
+# Try to find a ghc-pkg matching the ghc mentioned in the environment variable
+# WithGhc. If the latter is unset or no matching ghc-pkg can be found, try to
+# find a plain ghc-pkg. Sets the output variable GhcPkgCmd.
+AC_DEFUN([FP_PROG_GHC_PKG],
+[AC_CACHE_CHECK([for ghc-pkg matching $WithGhc], fp_cv_matching_ghc_pkg,
+[fp_ghc_pkg_guess=`echo $WithGhc | sed 's,ghc\(@<:@^/\\@:>@*\)$,ghc-pkg\1,'`
+if "$fp_ghc_pkg_guess" -l > /dev/null 2>&1; then
+  fp_cv_matching_ghc_pkg=$fp_ghc_pkg_guess
+else
+  fp_cv_matching_ghc_pkg=no
+fi])
+if test x"$fp_cv_matching_ghc_pkg" = xno; then
+  AC_PATH_PROG([GhcPkgCmd], [ghc-pkg])
+else
+  GhcPkgCmd=$fp_cv_matching_ghc_pkg
+fi])# FP_PROG_GHC_PKG
+
+
+# FP_GHC_HAS_READLINE
+# -------------------
+AC_DEFUN(FP_GHC_HAS_READLINE,
+[AC_REQUIRE([FP_PROG_GHC_PKG])
+AC_CACHE_CHECK([whether ghc has readline package], [fp_cv_ghc_has_readline],
+[if "${GhcPkgCmd-ghc-pkg}" --show-package readline >/dev/null 2>&1; then
+  fp_cv_ghc_has_readline=yes
+else
+  fp_cv_ghc_has_readline=no
+ fi])
+AC_SUBST([GhcHasReadline], [`echo $fp_cv_ghc_has_readline | sed 'y/yesno/YESNO/'`])
+])# FP_GHC_HAS_READLINE
index 9e4d6cd..266e9f5 100644 (file)
@@ -7,6 +7,9 @@ FP_SETUP_PROJECT_INFO
 # Hmmm, we fix the RPM release number to 1 here... Is this convenient?
 AC_SUBST([release], [1])
 
+# Check whether this GHC has readline installed
+FP_GHC_HAS_READLINE
+
 # Write the results...
-AC_CONFIG_FILES([ghc.spec VERSION docs/users_guide/ug-book.xml mk/version.mk])
+AC_CONFIG_FILES([ghc.spec VERSION docs/users_guide/ug-book.xml mk/config.mk mk/version.mk])
 AC_OUTPUT
similarity index 88%
rename from ghc/mk/config.mk
rename to ghc/mk/config.mk.in
index 6391f87..711c90b 100644 (file)
@@ -1,5 +1,4 @@
 # -----------------------------------------------------------------------------
-# $Id: config.mk,v 1.20 2003/05/19 13:01:23 simonmar Exp $
 #
 # GHC project configuration
 #
@@ -22,4 +21,7 @@ GhcBinDistLibPrlScripts = ghc-asm ghc-split
 GhcBinDistBins = hp2ps ghcprof
 GhcBinDistLinks = ghc ghci ghc-pkg
 
+# Set to YES if $(GHC) has the readline package installed
+GhcHasReadline = @GhcHasReadline@
+
 include $(GhcMainDir)/mk/version.mk