From 054725a03aca2cbfc062985f201bb11d9eb8d632 Mon Sep 17 00:00:00 2001 From: panne Date: Sat, 20 Nov 2004 15:12:30 +0000 Subject: [PATCH] [project @ 2004-11-20 15:12:26 by panne] Pushed "ghc has readline" check down to ghc subdir --- aclocal.m4 | 13 ------------- configure.ac | 3 --- ghc/aclocal.m4 | 34 ++++++++++++++++++++++++++++++++++ ghc/configure.ac | 5 ++++- ghc/mk/{config.mk => config.mk.in} | 4 +++- 5 files changed, 41 insertions(+), 18 deletions(-) rename ghc/mk/{config.mk => config.mk.in} (88%) diff --git a/aclocal.m4 b/aclocal.m4 index a280ecb..3b40d70 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -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. diff --git a/configure.ac b/configure.ac index 1e2ad95..5d1023d 100644 --- a/configure.ac +++ b/configure.ac @@ -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]])], diff --git a/ghc/aclocal.m4 b/ghc/aclocal.m4 index ed54156..aa3ebf9 100644 --- a/ghc/aclocal.m4 +++ b/ghc/aclocal.m4 @@ -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 diff --git a/ghc/configure.ac b/ghc/configure.ac index 9e4d6cd..266e9f5 100644 --- a/ghc/configure.ac +++ b/ghc/configure.ac @@ -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 diff --git a/ghc/mk/config.mk b/ghc/mk/config.mk.in similarity index 88% rename from ghc/mk/config.mk rename to ghc/mk/config.mk.in index 6391f87..711c90b 100644 --- a/ghc/mk/config.mk +++ b/ghc/mk/config.mk.in @@ -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 -- 1.7.10.4