X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=aclocal.m4;h=2b37051d438eb57676b3f4aaaf6ead4135273817;hb=0aa75e68bf5ee3f15673e66a5c41704301c863df;hp=0d4bddb37d5b49b1ea3c0a7fc35f7032a0098d09;hpb=a1939730ba7a460d702aca22322c4ec558e8be6d;p=ghc-hetmet.git diff --git a/aclocal.m4 b/aclocal.m4 index 0d4bddb..2b37051 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -431,7 +431,7 @@ esac AC_DEFUN([FP_PROG_AR_IS_GNU], [AC_REQUIRE([FP_PROG_AR]) AC_CACHE_CHECK([whether $fp_prog_ar_raw is GNU ar], [fp_cv_prog_ar_is_gnu], -[if $fp_prog_ar_raw --version | grep "GNU" > /dev/null 2> /dev/null; then +[if $fp_prog_ar_raw --version 2> /dev/null | grep "GNU" > /dev/null 2>&1; then fp_cv_prog_ar_is_gnu=yes else fp_cv_prog_ar_is_gnu=no @@ -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