From b8c25820084a46b1239ad7d87bee6391dd5c1017 Mon Sep 17 00:00:00 2001 From: Ian Lynagh Date: Sat, 23 Apr 2011 20:40:43 +0100 Subject: [PATCH] Get CC_STAGE0 from the bootstrapping compiler Rather than using the compiler that configure detects, we use the "GCC command" field from the --info output of the bootstrapping compiler (provided it is >= 7.1). --- aclocal.m4 | 15 +++++++++++++++ configure.ac | 2 ++ mk/config.mk.in | 2 +- 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/aclocal.m4 b/aclocal.m4 index c7002b1..4b750ef 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1494,6 +1494,21 @@ case "$1" in esac ]) +# BOOTSTRAPPING_GHC_INFO_FIELD +# -------------------------------- +# If the bootstrapping compiler is >= 7.1, then set the variable +# $1 to the value of the ghc --info field $2. Otherwise, set it to +# $3. +AC_DEFUN([BOOTSTRAPPING_GHC_INFO_FIELD],[ +if test $GhcCanonVersion -ge 701 +then + $1=`"$WithGhc" --info | grep "^ ,(\"$2\"," | sed -e 's/.*","//' -e 's/")$//'` +else + $1=$3 +fi +AC_SUBST($1) +]) + # LIBRARY_VERSION(lib) # -------------------------------- # Gets the version number of a library. diff --git a/configure.ac b/configure.ac index 3eccc08..b126d1e 100644 --- a/configure.ac +++ b/configure.ac @@ -132,6 +132,8 @@ if test "$WithGhc" != ""; then GhcCanonVersion="$GhcMajVersion$GhcMinVersion2" if test $GhcCanonVersion -ge 613; then ghc_ge_613=YES; else ghc_ge_613=NO; fi AC_SUBST(ghc_ge_613)dnl + + BOOTSTRAPPING_GHC_INFO_FIELD([CC_STAGE0],[GCC command],['$(CC)']) fi dnl ** Must have GHC to build GHC, unless --enable-hc-boot is on diff --git a/mk/config.mk.in b/mk/config.mk.in index 01019b8..f96302b 100644 --- a/mk/config.mk.in +++ b/mk/config.mk.in @@ -544,7 +544,7 @@ WhatGccIsCalled = @WhatGccIsCalled@ GccVersion = @GccVersion@ GccLT34 = @GccLT34@ CC = $(WhatGccIsCalled) -CC_STAGE0 = $(CC) +CC_STAGE0 = @CC_STAGE0@ CC_STAGE1 = $(CC) CC_STAGE2 = $(CC) CC_STAGE3 = $(CC) -- 1.7.10.4