From efc0f420bad7df729c0f0222641d820ca0cfaa2a Mon Sep 17 00:00:00 2001 From: Simon Marlow Date: Thu, 20 Aug 2009 13:42:34 +0000 Subject: [PATCH] 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. --- configure.ac | 71 +++++++++++++++++++++++++++++----------------------------- 1 file changed, 35 insertions(+), 36 deletions(-) diff --git a/configure.ac b/configure.ac index 331e3b99..14d8710 100644 --- a/configure.ac +++ b/configure.ac @@ -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 -- 1.7.10.4