summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJudah Jacobson <judah@users.noreply.github.com>2020-03-02 13:07:28 -0800
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-03-14 05:28:07 -0400
commit8f7dd5710b80906ea7a3e15b7bb56a883a49fed8 (patch)
tree4b9648049f3c290ad9f53951c884ad782cfc5d5c
parent7432b327a3c43c4e2e7c777b41a8e17899b8d0d1 (diff)
downloadhaskell-8f7dd5710b80906ea7a3e15b7bb56a883a49fed8.tar.gz
Allow overriding LD_STAGE0 and AR_STAGE0 in the configure script.
Previously it was possible to override the stage0 C compiler via `CC_STAGE0`, but you couldn't override `ld` or `ar` in stage0. This change allows overriding them by setting `LD_STAGE0` or `AR_STAGE0`, respectively. Our team uses this feature internally to take more control of our GHC build and make it run more hermetically.
-rw-r--r--configure.ac10
1 files changed, 7 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac
index fcc0a75ca6..39daeb5e40 100644
--- a/configure.ac
+++ b/configure.ac
@@ -135,13 +135,17 @@ if test "$WithGhc" != ""; then
GhcMinVersion2=`echo "$GhcMinVersion" | sed 's/^\\(.\\)$/0\\1/'`
GhcCanonVersion="$GhcMajVersion$GhcMinVersion2"
- dnl infer CC_STAGE0 from `ghc --info` unless explicitly set by user
+ dnl infer {CC,LD,AR}_STAGE0 from `ghc --info` unless explicitly set by user
if test -z "$CC_STAGE0"; then
BOOTSTRAPPING_GHC_INFO_FIELD([CC_STAGE0],[C compiler command])
fi
- BOOTSTRAPPING_GHC_INFO_FIELD([LD_STAGE0],[ld command])
- BOOTSTRAPPING_GHC_INFO_FIELD([AR_STAGE0],[ar command])
+ if test -z "$LD_STAGE0"; then
+ BOOTSTRAPPING_GHC_INFO_FIELD([LD_STAGE0],[ld command])
+ fi
+ if test -z "$AR_STAGE0"; then
+ BOOTSTRAPPING_GHC_INFO_FIELD([AR_STAGE0],[ar command])
+ fi
BOOTSTRAPPING_GHC_INFO_FIELD([AR_OPTS_STAGE0],[ar flags])
BOOTSTRAPPING_GHC_INFO_FIELD([ArSupportsAtFile_STAGE0],[ar supports at file])
fi