summaryrefslogtreecommitdiff
path: root/hadrian
diff options
context:
space:
mode:
authorAlp Mestanogullari <alpmestan@gmail.com>2019-05-06 18:49:33 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2019-06-11 18:40:37 -0400
commit39f50bff3ea913a7f4b1d915660bcf77b9327e2e (patch)
tree333057c89bb94838cd12cf03deb7e7a5dda83339 /hadrian
parentfe7e7e4a950a77326cc16f4ade30a67d20d7cdd5 (diff)
downloadhaskell-39f50bff3ea913a7f4b1d915660bcf77b9327e2e.tar.gz
Refine the GHCI macro into HAVE[_{INTERNAL, EXTERNAL}]_INTERPRETER
As discussed in #16331, the GHCI macro, defined through 'ghci' flags in ghc.cabal.in, ghc-bin.cabal.in and ghci.cabal.in, is supposed to indicate whether GHC is built with support for an internal interpreter, that runs in the same process. It is however overloaded in a few places to mean "there is an interpreter available", regardless of whether it's an internal or external interpreter. For the sake of clarity and with the hope of more easily being able to build stage 1 GHCs with external interpreter support, this patch splits the previous GHCI macro into 3 different ones: - HAVE_INTERNAL_INTERPRETER: GHC is built with an internal interpreter - HAVE_EXTERNAL_INTERPRETER: GHC is built with support for external interpreters - HAVE_INTERPRETER: HAVE_INTERNAL_INTERPRETER || HAVE_EXTERNAL_INTERPRETER
Diffstat (limited to 'hadrian')
-rw-r--r--hadrian/src/Settings/Packages.hs6
1 files changed, 6 insertions, 0 deletions
diff --git a/hadrian/src/Settings/Packages.hs b/hadrian/src/Settings/Packages.hs
index 517c36ebaf..70bec0ecdc 100644
--- a/hadrian/src/Settings/Packages.hs
+++ b/hadrian/src/Settings/Packages.hs
@@ -17,6 +17,8 @@ packageArgs = do
intLib <- getIntegerPackage
compilerPath <- expr $ buildPath (vanillaContext stage compiler)
gmpBuildPath <- expr gmpBuildPath
+ win <- expr windowsHost
+ cross <- expr (flag CrossCompiling)
let includeGmp = "-I" ++ gmpBuildPath -/- "include"
mconcat
@@ -70,6 +72,7 @@ packageArgs = do
, builder (Cabal Flags) ? mconcat
[ ghcWithNativeCodeGen ? arg "ncg"
, ghcWithInterpreter ? notStage0 ? arg "ghci"
+ , notStage0 ? (not win && not cross) ? arg "ext-interp"
, flag CrossCompiling ? arg "-terminfo"
, notStage0 ? intLib == integerGmp ?
arg "integer-gmp"
@@ -84,6 +87,7 @@ packageArgs = do
, builder (Cabal Flags) ? mconcat
[ ghcWithInterpreter ? notStage0 ? arg "ghci"
+ , notStage0 ? (not win && not cross) ? arg "ext-interp"
, flag CrossCompiling ? arg "-terminfo"
-- the 'threaded' flag is True by default, but
-- let's record explicitly that we link all ghc
@@ -117,6 +121,8 @@ packageArgs = do
-- behind the @-fghci@ flag.
, package ghci ? mconcat
[ notStage0 ? builder (Cabal Flags) ? arg "ghci"
+ , notStage0 ? builder (Cabal Flags) ? (not win && not cross)
+ ? arg "ext-interp"
, flag CrossCompiling ? stage0 ? builder (Cabal Flags) ? arg "ghci" ]
-------------------------------- haddock -------------------------------