From 7363193debb128e302c194c863eb71073e69da0d Mon Sep 17 00:00:00 2001 From: panne Date: Sat, 28 Aug 2004 16:20:36 +0000 Subject: [PATCH] [project @ 2004-08-28 16:20:35 by panne] Beautified test for ghc-pkg --- aclocal.m4 | 20 ++++++++++++++++++++ configure.ac | 10 +--------- 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/aclocal.m4 b/aclocal.m4 index d767552..2b37051 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -954,6 +954,26 @@ fi ])# FP_PROG_FO_PROCESSOR +# 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_CHECK_WIN32 # -------------- # If Windows is the target platform (e.g. MinGW/MSYS or Cygwin with diff --git a/configure.ac b/configure.ac index 586d33c..de601b7 100644 --- a/configure.ac +++ b/configure.ac @@ -860,15 +860,7 @@ FP_DIR_DOCBOOK_XSL([/usr/share/xml/docbook/stylesheet/nwalsh/current /usr/share/ FP_PROG_FO_PROCESSOR dnl ** check for ghc-pkg command -changequote(, )dnl -ghc_pkg_guess=`echo $WithGhc | sed 's@ghc\([^/\\]*\)$@ghc-pkg\1@'` -changequote([, ])dnl -if $ghc_pkg_guess -l >/dev/null 2>/dev/null; then - GhcPkgCmd=$ghc_pkg_guess - AC_MSG_NOTICE([using $ghc_pkg_guess for ghc-pkg]) -else - AC_PATH_PROG(GhcPkgCmd,ghc-pkg) -fi +FP_PROG_GHC_PKG AC_ARG_WITH(greencard, [AC_HELP_STRING([--with-greencard=ARG], -- 1.7.10.4