diff options
author | John Ericson <John.Ericson@Obsidian.Systems> | 2021-10-22 00:05:54 +0000 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2023-01-18 22:24:10 -0500 |
commit | eb5a6b91e02b48f9171217743e3417cb33eb92e3 (patch) | |
tree | c071a5cffa3d9b6a8d09495fc72e1295fdea71a9 /hadrian/src/Rules/Generate.hs | |
parent | ab0d5cdaa5505e5b774b04b9f68dcbbc7ce1071e (diff) | |
download | haskell-eb5a6b91e02b48f9171217743e3417cb33eb92e3.tar.gz |
Give the RTS it's own configure script
Currently it doesn't do much anything, we are just trying to introduce
it without breaking the build. Later, we will move functionality from
the top-level configure script over to it.
We need to bump Cabal for https://github.com/haskell/cabal/pull/8649; to
facilitate and existing hack of skipping some configure checks for the
RTS we now need to skip just *part* not *all* of the "post configure"
hook, as running the configure script (which we definitely want to do)
is also implemented as part of the "post configure" hook. But doing this
requires exposing functionality that wasn't exposed before.
Diffstat (limited to 'hadrian/src/Rules/Generate.hs')
-rw-r--r-- | hadrian/src/Rules/Generate.hs | 23 |
1 files changed, 2 insertions, 21 deletions
diff --git a/hadrian/src/Rules/Generate.hs b/hadrian/src/Rules/Generate.hs index 2c02407d31..b156c9dfdf 100644 --- a/hadrian/src/Rules/Generate.hs +++ b/hadrian/src/Rules/Generate.hs @@ -147,7 +147,8 @@ generatePackageCode context@(Context stage pkg _ _) = do root -/- "**" -/- dir -/- "cmm/AutoApply.cmm" %> \file -> build $ target context GenApply [] [file] let go gen file = generate file (semiEmptyTarget stage) gen - root -/- "**" -/- dir -/- "include/ghcautoconf.h" %> go generateGhcAutoconfH + root -/- "**" -/- dir -/- "include/ghcautoconf.h" %> \_ -> + need . pure =<< pkgSetupConfigFile context root -/- "**" -/- dir -/- "include/ghcplatform.h" %> go generateGhcPlatformH root -/- "**" -/- dir -/- "include/DerivedConstants.h" %> genPlatformConstantsHeader context root -/- "**" -/- dir -/- "include/rts/EventLogConstants.h" %> genEventTypes "--event-types-defines" @@ -486,26 +487,6 @@ generateConfigHs = do stageString (Stage0 GlobalLibs) = error "stageString: StageBoot" --- | Generate @ghcautoconf.h@ header. -generateGhcAutoconfH :: Expr String -generateGhcAutoconfH = do - trackGenerateHs - configHContents <- expr $ mapMaybe undefinePackage <$> readFileLines configH - return . unlines $ - [ "#if !defined(__GHCAUTOCONF_H__)" - , "#define __GHCAUTOCONF_H__" ] - ++ configHContents ++ - [ "#endif /* __GHCAUTOCONF_H__ */" ] - where - undefinePackage s - | "#define PACKAGE_" `isPrefixOf` s - = Just $ "/* #undef " ++ takeWhile (/=' ') (drop 8 s) ++ " */" - | "#define __GLASGOW_HASKELL" `isPrefixOf` s - = Nothing - | "/* REMOVE ME */" == s - = Nothing - | otherwise = Just s - -- | Generate @Version.hs@ files. generateVersionHs :: Expr String generateVersionHs = do |