Remove some hardcoded makefile settings
[ghc-hetmet.git] / configure.ac
index 5bf773b..d116ff1 100644 (file)
@@ -89,6 +89,11 @@ AC_ARG_WITH([ghc],
   fi
   WithGhc="$GHC"])
 
+
+dnl ** Tell the make system which OS we are using
+dnl $OSTYPE is set by the operating system to "msys" or "cygwin" or something 
+AC_SUBST(OSTYPE)
+
 dnl ** Booting from .hc files?
 dnl --------------------------------------------------------------
 AC_ARG_ENABLE(hc-boot,
@@ -346,6 +351,16 @@ checkArch "$TargetArch"
 checkVendor "$TargetVendor"
 checkOS "$TargetOS"
 
+# Verify that the installed (bootstrap) GHC is capable of generating
+# code for the requested build platform.
+if test "$build" != "$bootstrap_target"
+then
+    echo "This GHC (${WithGhc}) does not generate code for the build platform"
+    echo "   GHC target platform    : $bootstrap_target"
+    echo "   Desired build platform : $BuildPlatform"
+    exit 1
+fi
+
 AC_SUBST(BuildPlatform)
 AC_SUBST(HostPlatform)
 AC_SUBST(TargetPlatform)
@@ -389,6 +404,9 @@ then
     LD="$hardtop/inplace/mingw/bin/ld.exe"
     NM="$hardtop/inplace/mingw/bin/nm.exe"
     fp_prog_ar_raw="$hardtop/inplace/mingw/bin/ar.exe"
+
+    # NB. If you update the tarbballs to a new version of gcc, don't
+    # forget to tweak the paths in driver/gcc/gcc.c.
     if ! test -d inplace/mingw ||
          test inplace/mingw -ot ghc-tarballs/mingw/binutils*.tar.lzma  ||
          test inplace/mingw -ot ghc-tarballs/mingw/gcc-core*.tar.lzma  ||