summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCheng Shao <astrohavoc@gmail.com>2022-10-24 08:11:45 +0000
committerMarge Bot <ben+marge-bot@smart-cactus.org>2022-11-11 00:26:55 -0500
commit34b8f61148e8ebd2d03f20ed8120d775dcd1d868 (patch)
tree771bd3ea9aa92a6e3429e82347685c65a08b3b59
parent00a9359f965941b4344e605579531132c11a891b (diff)
downloadhaskell-34b8f61148e8ebd2d03f20ed8120d775dcd1d868.tar.gz
autoconf: set CrossCompiling=YES in cross bindist configure
This patch fixes the bindist autoconf logic to properly set CrossCompiling=YES when it's a cross GHC bindist.
-rw-r--r--distrib/configure.ac.in8
1 files changed, 8 insertions, 0 deletions
diff --git a/distrib/configure.ac.in b/distrib/configure.ac.in
index ea2d9f70a2..6263db351d 100644
--- a/distrib/configure.ac.in
+++ b/distrib/configure.ac.in
@@ -50,6 +50,14 @@ FP_FIND_ROOT
# ToDo: if Stage1Only=YES, should be YES
CrossCompiling=NO
+# If 'host' and 'target' differ, then this means we are building a cross-compiler.
+if test "$target" != "$host" ; 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
CrossCompilePrefix="@CrossCompilePrefix@"
TargetPlatformFull="${target}"
TablesNextToCode="@TablesNextToCode@"