[commit: ghc] wip/angerman/llvmng: Retain build/host/target (e69eb4c)

git at git.haskell.org git at git.haskell.org
Mon Oct 23 09:47:53 UTC 2017


Repository : ssh://git@git.haskell.org/ghc

On branch  : wip/angerman/llvmng
Link       : http://ghc.haskell.org/trac/ghc/changeset/e69eb4cd2c5f2de20acbc5171f08bcef4f492b16/ghc

>---------------------------------------------------------------

commit e69eb4cd2c5f2de20acbc5171f08bcef4f492b16
Author: Moritz Angermann <moritz.angermann at gmail.com>
Date:   Mon Oct 23 17:45:53 2017 +0800

    Retain build/host/target


>---------------------------------------------------------------

e69eb4cd2c5f2de20acbc5171f08bcef4f492b16
 configure.ac            |  4 ++++
 distrib/configure.ac.in | 26 ++++++++++++++++++++------
 2 files changed, 24 insertions(+), 6 deletions(-)

diff --git a/configure.ac b/configure.ac
index d32ede2..98c07b2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -222,6 +222,10 @@ AC_CANONICAL_TARGET
 
 FPTOOLS_SET_PLATFORM_VARS
 
+AC_SUBST([build_alias])
+AC_SUBST([host_alias])
+AC_SUBST([target_alias])
+
 # Verify that the installed (bootstrap) GHC is capable of generating
 # code for the requested build platform.
 if test "$BuildPlatform" != "$bootstrap_target"
diff --git a/distrib/configure.ac.in b/distrib/configure.ac.in
index adecf7c..4e71c92 100644
--- a/distrib/configure.ac.in
+++ b/distrib/configure.ac.in
@@ -33,6 +33,24 @@ FFILibDir=@FFILibDir@
 AC_SUBST(FFILibDir)
 AC_SUBST(FFIIncludeDir)
 
+CrossCompiling=@CrossCompiling@
+CrossCompilePrefix=@CrossCompilePrefix@
+TargetPlatformFull=@TargetPlatformFull@
+
+# when cross compiling, retain the build/host/target values
+# from the initial configure step; while still allowing to set
+# them via `--build/--host/--target` if need be.
+if test "x$CrossCompiling" = "xNO"; then
+   if text -z "$build_alias"; then
+      build_alias=@build_alias@
+   fi
+   if test -z "$host_alias"; then
+      host_alias=@host_alias@
+   fi
+   if text -z "$target_alias"; then
+      target_alias=@target_alias@
+   fi
+fi
 
 # We have to run these unconditionally as FPTOOLS_SET_PLATFORM_VARS wants the
 # values it computes.
@@ -40,13 +58,9 @@ AC_CANONICAL_BUILD
 AC_CANONICAL_HOST
 AC_CANONICAL_TARGET
 
-# FP_FIND_ROOT requires knowledge about $windows; inherit it.
-windows=@windows@
-FP_FIND_ROOT
+FPTOOLS_SET_PLATFORM_VARS
 
-CrossCompiling=@CrossCompiling@
-CrossCompilePrefix=@CrossCompilePrefix@
-TargetPlatformFull=@TargetPlatformFull@
+FP_FIND_ROOT
 
 AC_SUBST(CrossCompiling)
 AC_SUBST(CrossCompilePrefix)



More information about the ghc-commits mailing list