Commit efc0f420 authored by Simon Marlow's avatar Simon Marlow

Restore the GHC version check

I'm not sure what happened here, but the ordering of tests was messed
up, with the result that the GHC version check was being omitted.
parent ff29c975
......@@ -89,6 +89,22 @@ AC_ARG_WITH([ghc],
fi
WithGhc="$GHC"])
dnl ** Booting from .hc files?
dnl --------------------------------------------------------------
AC_ARG_ENABLE(hc-boot,
[AC_HELP_STRING([--enable-hc-boot],
[Boot the Glasgow Haskell Compiler from intermediate .hc files.
(This option is mostly of interest to porters.) [default=no]])],
[ if test x"$enableval" = x"yes"; then
BootingFromHc=YES
else
BootingFromHc=NO
fi
],
[BootingFromHc=NO]
)
AC_SUBST(BootingFromHc)
dnl ** Booting from unregisterised .hc files?
dnl --------------------------------------------------------------
AC_ARG_ENABLE(hc-boot-unregisterised,
......@@ -112,26 +128,6 @@ AC_MSG_ERROR([--enable-hc-boot-unregisterised requires --enable-hc-boot.])
fi;
fi;
dnl ** Must have GHC to build GHC, unless --enable-hc-boot is on
if test "$BootingFromHc" = "NO" -a -d "$srcdir/compiler"; then
if test "$WithGhc" = ""; then
AC_MSG_ERROR([GHC is required unless bootstrapping from .hc files.])
fi
FP_COMPARE_VERSIONS([$GhcVersion],[-lt],[6.8],
[AC_MSG_ERROR([GHC version 6.8 or later is required to compile GHC.])])dnl
if test `expr $GhcMinVersion % 2` = "1"; then
echo $EnableBootstrapWithDevelSnaphost
if test "$EnableBootstrapWithDevelSnaphost" = "NO"; then
AC_MSG_ERROR([
$WithGhc is a development snapshot of GHC, version $GhcVersion.
Bootstrapping using this version of GHC is not supported, and may not
work. Use --enable-bootstrap-with-devel-snapshot to try it anyway,
or --with-ghc to specify a different GHC to use.])
fi
fi
fi;
AC_ARG_ENABLE(bootstrap-with-devel-snapshot,
[AC_HELP_STRING([--enable-bootstrap-with-devel-snapshot],
[Allow bootstrapping using a development snapshot of GHC. This is not guaranteed to work.])],
......@@ -156,6 +152,25 @@ if test "$WithGhc" != ""; then
AC_SUBST(ghc_ge_609)dnl
fi
dnl ** Must have GHC to build GHC, unless --enable-hc-boot is on
if test "$BootingFromHc" = "NO" -a -d "$srcdir/compiler"; then
if test "$WithGhc" = ""; then
AC_MSG_ERROR([GHC is required unless bootstrapping from .hc files.])
fi
FP_COMPARE_VERSIONS([$GhcVersion],[-lt],[6.8],
[AC_MSG_ERROR([GHC version 6.8 or later is required to compile GHC.])])dnl
if test `expr $GhcMinVersion % 2` = "1"; then
if test "$EnableBootstrapWithDevelSnaphost" = "NO"; then
AC_MSG_ERROR([
$WithGhc is a development snapshot of GHC, version $GhcVersion.
Bootstrapping using this version of GHC is not supported, and may not
work. Use --enable-bootstrap-with-devel-snapshot to try it anyway,
or --with-ghc to specify a different GHC to use.])
fi
fi
fi;
# GHC is passed to Cabal, so we need a native path
if test "${WithGhc}" != ""
then
......@@ -400,22 +415,6 @@ AC_ARG_WITH(ld,
[FP_PROG_LD()]
)
dnl ** Booting from .hc files?
dnl --------------------------------------------------------------
AC_ARG_ENABLE(hc-boot,
[AC_HELP_STRING([--enable-hc-boot],
[Boot the Glasgow Haskell Compiler from intermediate .hc files.
(This option is mostly of interest to porters.) [default=no]])],
[ if test x"$enableval" = x"yes"; then
BootingFromHc=YES
else
BootingFromHc=NO
fi
],
[BootingFromHc=NO]
)
AC_SUBST(BootingFromHc)
# This uses GHC, so put it after the "GHC is required" check above:
FP_FIND_ROOT
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment