Rewrite ghc-pkg test, using that of ghc

This commit is contained in:
Don Stewart 2005-05-01 04:53:56 +00:00
parent 2757d85394
commit ed349264ce

@ -126,25 +126,23 @@ AC_ARG_ENABLE(debug,
AC_SUBST(DEBUG_OPTS) AC_SUBST(DEBUG_OPTS)
# allow user supplied haskell package manager # Search for ghc-pkg
AC_ARG_WITH(ghc-pkg, AC_MSG_CHECKING([for ghc-pkg])
AC_HELP_STRING([--with-ghc-pkg=<ghc-pkg>],[use a specific ghc-pkg]), ghc_pkg_guess=`echo $GHC | sed 's,ghc\(@<:@^/\\@:>@*\)$,ghc-pkg\1,'`
[ GHCPKG="$withval" if "$ghc_pkg_guess" -l > /dev/null 2>&1; then
if test ! -f "$GHCPKG" ; then matching_ghc_pkg=$ghc_pkg_guess
AC_MSG_ERROR([$GHCPKG not found. You need ghc-pkg]) else
matching_ghc_pkg=no
fi
if test x"$matching_ghc_pkg" = xno; then
AC_CHECK_PROG([GHCPKG], [ghc-pkg])
if test -z "$GHCPKG" ; then
AC_MSG_ERROR([ghc-pkg not found.])
fi fi
], else
[ AC_MSG_CHECKING([for ghc-pkg]) GHCPKG=$matching_ghc_pkg
if ghc-pkg-$GHC_VERSION -V > /dev/null 2>&1 ; then fi
GHCPKG=ghc-pkg-$GHC_VERSION AC_MSG_RESULT([$GHCPKG])
elif test ghc-pkg -V > /dev/null 2>&1 ; then
GHCPKG=ghc-pkg
else
AC_MSG_ERROR(You need ghc-pkg)
fi
AC_MSG_RESULT([$GHCPKG])
]
)
AC_SUBST(GHCPKG) AC_SUBST(GHCPKG)
AC_CHECK_PROG(HADDOCK,haddock,haddock) AC_CHECK_PROG(HADDOCK,haddock,haddock)