summaryrefslogtreecommitdiff
path: root/hadrian
diff options
context:
space:
mode:
Diffstat (limited to 'hadrian')
-rw-r--r--hadrian/cfg/system.config.in2
-rw-r--r--hadrian/src/Oracles/Flag.hs2
-rw-r--r--hadrian/src/Rules/Generate.hs3
3 files changed, 7 insertions, 0 deletions
diff --git a/hadrian/cfg/system.config.in b/hadrian/cfg/system.config.in
index 7fba53f43e..3fa53330e1 100644
--- a/hadrian/cfg/system.config.in
+++ b/hadrian/cfg/system.config.in
@@ -92,6 +92,8 @@ project-patch-level1 = @ProjectPatchLevel1@
project-patch-level2 = @ProjectPatchLevel2@
project-git-commit-id = @ProjectGitCommitId@
+system-use-distro-mingw = @SettingsUseDistroMINGW@
+
# Compilation and linking flags:
#===============================
diff --git a/hadrian/src/Oracles/Flag.hs b/hadrian/src/Oracles/Flag.hs
index 4f88af6432..960036fa89 100644
--- a/hadrian/src/Oracles/Flag.hs
+++ b/hadrian/src/Oracles/Flag.hs
@@ -25,6 +25,7 @@ data Flag = ArSupportsAtFile
| HaveLibMingwEx
| UseSystemFfi
| BootstrapThreadedRts
+ | SystemDistroMINGW
-- Note, if a flag is set to empty string we treat it as set to NO. This seems
-- fragile, but some flags do behave like this.
@@ -45,6 +46,7 @@ flag f = do
HaveLibMingwEx -> "have-lib-mingw-ex"
UseSystemFfi -> "use-system-ffi"
BootstrapThreadedRts -> "bootstrap-threaded-rts"
+ SystemDistroMINGW -> "system-use-distro-mingw"
value <- lookupValueOrError configFile key
when (value `notElem` ["YES", "NO", ""]) . error $ "Configuration flag "
++ quote (key ++ " = " ++ value) ++ " cannot be parsed."
diff --git a/hadrian/src/Rules/Generate.hs b/hadrian/src/Rules/Generate.hs
index e584907a9b..99a1a9e42f 100644
--- a/hadrian/src/Rules/Generate.hs
+++ b/hadrian/src/Rules/Generate.hs
@@ -245,6 +245,7 @@ generateGhcPlatformH = do
hostOs <- chooseSetting HostOs TargetOs
hostVendor <- chooseSetting HostVendor TargetVendor
ghcUnreg <- getFlag GhcUnregisterised
+ inplaceTools <- getFlag SystemDistroMINGW
return . unlines $
[ "#if !defined(__GHCPLATFORM_H__)"
, "#define __GHCPLATFORM_H__"
@@ -274,6 +275,8 @@ generateGhcPlatformH = do
, ""
]
++
+ [ "#define USE_INPLACE_MINGW_TOOLCHAIN 1" | inplaceTools ]
+ ++
[ "#define UnregisterisedCompiler 1" | ghcUnreg ]
++
[ ""