summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorTamar Christina <tamar@zhox.com>2016-08-13 16:27:30 +0100
committerTamar Christina <tamar@zhox.com>2016-08-14 18:40:05 +0100
commit18f06878ed5d8cb0cf366a876f2bfea29647e5f0 (patch)
tree844fc82ad11a1cd1c5dcb9b504b57751752ba192 /configure.ac
parent7ad3b49161587f937facd1852742cc3fbaf1ffce (diff)
downloadhaskell-18f06878ed5d8cb0cf366a876f2bfea29647e5f0.tar.gz
Fix configure detection.
Summary: GHC's configure script seems to normalize the values returned from config.guess. So for Windows it turns x86_64-pc-mingw64 into x86_64-unknown-mingw32. These mangled names are stored in the values $BuildPlatform, $HostPlatform and $TargetPlatform. However further down the file when the comparison is done between the stage0 compiler and the host the normalized versions are not used. So when normalization actually changes the triple this check will fail. Not sure why it's worked for all this time.. Nor if this is the right fix? Does it still work for cross compiling correctly? Test Plan: ./configure Reviewers: hvr, austin, thomie, bgamari, erikd Reviewed By: erikd Subscribers: erikd, #ghc_windows_task_force Differential Revision: https://phabricator.haskell.org/D2452 GHC Trac Issues: #12487
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac12
1 files changed, 6 insertions, 6 deletions
diff --git a/configure.ac b/configure.ac
index e9569e93d8..acd33cf22c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -410,20 +410,20 @@ dnl ** Building a cross compiler?
dnl --------------------------------------------------------------
CrossCompiling=NO
# If 'host' and 'target' differ, then this means we are building a cross-compiler.
-if test "$target" != "$host" ; then
+if test "$TargetPlatform" != "$HostPlatform" ; then
CrossCompiling=YES
cross_compiling=yes # This tells configure that it can accept just 'target',
# otherwise you get
# configure: error: cannot run C compiled programs.
# If you meant to cross compile, use `--host'.
fi
-if test "$build" != "$host" ; then
+if test "$BuildPlatform" != "$host" ; then
AC_MSG_ERROR([
You've selected:
- BUILD: $build (the architecture we're building on)
- HOST: $host (the architecture the compiler we're building will execute on)
- TARGET: $target (the architecture the compiler we're building will produce code for)
+ BUILD: $BuildPlatform (the architecture we're building on)
+ HOST: $HostPlatform (the architecture the compiler we're building will execute on)
+ TARGET: $TargetPlatform (the architecture the compiler we're building will produce code for)
BUILD must equal HOST; that is, we do not support building GHC itself
with a cross-compiler. To cross-compile GHC itself, set TARGET: stage
@@ -437,7 +437,7 @@ then
else
CrossCompilePrefix=""
fi
-TargetPlatformFull="${target}"
+TargetPlatformFull="${TargetPlatform}"
AC_SUBST(CrossCompiling)
AC_SUBST(CrossCompilePrefix)
AC_SUBST(TargetPlatformFull)