Be smarter about finding ghc-pkg

This commit is contained in:
Don Stewart 2005-05-01 03:16:44 +00:00
parent ec81261ec1
commit c7f31cbd7a
2 changed files with 10 additions and 6 deletions

View File

@ -33,7 +33,7 @@ GLASGOW_HASKELL = @GLASGOW_HASKELL@
GHC_EXTRA_OPTS = @SYMS@ @DEBUG_OPTS@
GHC_LD_OPTS =
GHC_PKG = @GHCPKG@-@GHC_VERSION@
GHC_PKG = @GHCPKG@
LD = @LD@
LD_X = @LD@ -x

View File

@ -133,13 +133,17 @@ AC_ARG_WITH(ghc-pkg,
AC_MSG_ERROR([$GHCPKG not found. You need ghc-pkg])
fi
],
[ AC_CHECK_PROG(GHCPKG,ghc-pkg,ghc-pkg)
if test -z "$GHCPKG" ; then
AC_MSG_ERROR([You need ghc-pkg])
[ AC_MSG_CHECKING([for ghc-pkg])
if ghc-pkg-$GHC_VERSION -V > /dev/null ; then
GHCPKG=ghc-pkg-$GHC_VERSION
elif test ghc-pkg -V > /dev/null ; then
GHCPKG=ghc-pkg
else
AC_MSG_ERROR(You need ghc-pkg)
fi
AC_MSG_RESULT([$GHCPKG])
]
)
AC_SUBST(GHCPKG)
AC_CHECK_PROG(HADDOCK,haddock,haddock)