From: simonmar Date: Mon, 11 Oct 2004 14:25:46 +0000 (+0000) Subject: [project @ 2004-10-11 14:25:44 by simonmar] X-Git-Tag: Initial_conversion_from_CVS_complete~1509 X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=commitdiff_plain;h=bc3291f1614a559dba09d5360e48211ed334321a [project @ 2004-10-11 14:25:44 by simonmar] Detect whether $(GHC) supports the readline package. --- diff --git a/aclocal.m4 b/aclocal.m4 index eac0625..d660017 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -694,6 +694,19 @@ 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 81ac4fc..491e596 100644 --- a/configure.ac +++ b/configure.ac @@ -864,6 +864,9 @@ 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/mk/config.mk.in b/mk/config.mk.in index 0b54097..e0b3295 100644 --- a/mk/config.mk.in +++ b/mk/config.mk.in @@ -729,6 +729,9 @@ else GhcCanonVersion = $(GhcMajVersion)$(GhcMinVersion) endif +# Set to YES if $(GHC) has the readline package installed +GhcHasReadline = @GhcHasReadline@ + HBC = @HBC@ NHC = @NHC@