summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2023-01-09 18:36:15 +0800
committerMatthew Pickering <matthewtpickering@gmail.com>2023-01-09 18:36:15 +0800
commit26ed05bc0b299e069590e66459d1d044626944a4 (patch)
treef990e44157c8fb2b3d4beebb34a9090e999f5254
parent90d882b7d0fe05f4b7db74d0966d8ab4675785a6 (diff)
downloadhaskell-wip/darwin-llvm-target.tar.gz
-rw-r--r--configure.ac2
-rw-r--r--distrib/configure.ac.in2
-rw-r--r--m4/ghc_llvm_target.m47
3 files changed, 10 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index 6c4b6b6f53..9b4dc0b650 100644
--- a/configure.ac
+++ b/configure.ac
@@ -667,6 +667,8 @@ GHC_LLVM_TARGET_SET_VAR
# we intend to pass trough --targets to llvm as is.
LLVMTarget_CPP=` echo "$LlvmTarget"`
AC_SUBST(LLVMTarget_CPP)
+# The target is substituted into the distrib/configure.ac file
+AC_SUBST(LlvmTarget)
dnl ** See whether cc supports --target=<triple> and set
dnl CONF_CC_OPTS_STAGE[012] accordingly.
diff --git a/distrib/configure.ac.in b/distrib/configure.ac.in
index 19eb9c9a54..3efadcc177 100644
--- a/distrib/configure.ac.in
+++ b/distrib/configure.ac.in
@@ -18,6 +18,8 @@ dnl--------------------------------------------------------------------
dnl Various things from the source distribution configure
bootstrap_target=@TargetPlatform@
+bootstrap_llvm_target=@LlvmTarget@
+
TargetHasRTSLinker=@TargetHasRTSLinker@
AC_SUBST(TargetHasRTSLinker)
diff --git a/m4/ghc_llvm_target.m4 b/m4/ghc_llvm_target.m4
index abb10d963e..afece520ff 100644
--- a/m4/ghc_llvm_target.m4
+++ b/m4/ghc_llvm_target.m4
@@ -50,5 +50,10 @@ AC_DEFUN([GHC_LLVM_TARGET], [
# require it.
AC_DEFUN([GHC_LLVM_TARGET_SET_VAR], [
AC_REQUIRE([FPTOOLS_SET_PLATFORMS_VARS])
- GHC_LLVM_TARGET([$target],[$target_cpu],[$target_vendor],[$target_os],[LlvmTarget])
+ if test "$bootstrap_llvm_target" != ""
+ then
+ $5=$bootstrap_llvm_target
+ else
+ GHC_LLVM_TARGET([$target],[$TargetArch],[$TargetVendor],[$TargetOS],[LlvmTarget])
+ fi
])