diff options
author | John Ericson <git@JohnEricson.me> | 2019-09-12 23:35:48 -0400 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2019-10-04 21:44:29 -0400 |
commit | 75a5dd8e614e6056edf846218c08ddfff9384e04 (patch) | |
tree | b825c16755c11aa363a3cfab7d28bb0544577939 /hadrian | |
parent | 05419e55cab272ed39790695f448b311f22669f7 (diff) | |
download | haskell-75a5dd8e614e6056edf846218c08ddfff9384e04.tar.gz |
Remove {Build,Host}Platform_NAME from header
They are only used in a file we construct directly, so just skip CPP.
Diffstat (limited to 'hadrian')
-rw-r--r-- | hadrian/src/Rules/Generate.hs | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/hadrian/src/Rules/Generate.hs b/hadrian/src/Rules/Generate.hs index c2c3c14372..f20f815da4 100644 --- a/hadrian/src/Rules/Generate.hs +++ b/hadrian/src/Rules/Generate.hs @@ -238,9 +238,6 @@ generateGhcPlatformH = do [ "#if !defined(__GHCPLATFORM_H__)" , "#define __GHCPLATFORM_H__" , "" - , "#define BuildPlatform_NAME " ++ show buildPlatform - , "#define HostPlatform_NAME " ++ show hostPlatform - , "" , "#define BuildPlatform_TYPE " ++ cppify buildPlatform , "#define HostPlatform_TYPE " ++ cppify hostPlatform , "" @@ -336,6 +333,10 @@ generateSettings = do -- | Generate @Config.hs@ files. generateConfigHs :: Expr String generateConfigHs = do + stage <- getStage + let chooseSetting x y = getSetting $ if stage == Stage0 then x else y + buildPlatform <- chooseSetting BuildPlatform HostPlatform + hostPlatform <- chooseSetting HostPlatform TargetPlatform trackGenerateHs cProjectName <- getSetting ProjectName cBooterVersion <- getSetting GhcVersion @@ -354,13 +355,11 @@ generateConfigHs = do , "" , "import GHC.Version" , "" - , "#include \"ghcplatform.h\"" - , "" , "cBuildPlatformString :: String" - , "cBuildPlatformString = BuildPlatform_NAME" + , "cBuildPlatformString = " ++ show buildPlatform , "" , "cHostPlatformString :: String" - , "cHostPlatformString = HostPlatform_NAME" + , "cHostPlatformString = " ++ show hostPlatform , "" , "cProjectName :: String" , "cProjectName = " ++ show cProjectName |