Commit cc3113db authored by Andrey Mokhov's avatar Andrey Mokhov
Browse files

Add getLibWays to capture context-less ways.

parent 28e3a26c
module Settings.User ( module Settings.User (
userArgs, userPackages, userWays, userRtsWays, userTargetDirectory, userArgs, userPackages, userLibWays, userRtsWays, userTargetDirectory,
userKnownPackages, integerLibrary, userKnownPackages, integerLibrary,
trackBuildSystem, buildHaddock, validating, ghciWithDebugger, ghcProfiled, trackBuildSystem, buildHaddock, validating, ghciWithDebugger, ghcProfiled,
dynamicGhcPrograms, laxDependencies ghcDebugged, dynamicGhcPrograms, laxDependencies
) where ) where
import Expression import Expression
...@@ -21,9 +21,9 @@ userPackages = mempty ...@@ -21,9 +21,9 @@ userPackages = mempty
userKnownPackages :: [Package] userKnownPackages :: [Package]
userKnownPackages = [] userKnownPackages = []
-- Control which ways are built -- Control which ways libraries and rts are built
userWays :: Ways userLibWays :: Ways
userWays = mempty userLibWays = mempty
userRtsWays :: Ways userRtsWays :: Ways
userRtsWays = mempty userRtsWays = mempty
...@@ -60,6 +60,10 @@ ghciWithDebugger = False ...@@ -60,6 +60,10 @@ ghciWithDebugger = False
ghcProfiled :: Bool ghcProfiled :: Bool
ghcProfiled = False ghcProfiled = False
-- TODO: do we need to be able to set this from command line?
ghcDebugged :: Bool
ghcDebugged = False
-- When laxDependencies flag is set to True, dependencies on the GHC executable -- When laxDependencies flag is set to True, dependencies on the GHC executable
-- are turned into order-only dependencies to avoid needless recompilation when -- are turned into order-only dependencies to avoid needless recompilation when
-- making changes to GHC's sources. In certain situations this can lead to build -- making changes to GHC's sources. In certain situations this can lead to build
......
module Settings.Ways (getWays, getRtsWays) where module Settings.Ways (getWays, getLibWays, getRtsWays) where
import Expression import Expression
import Predicates import Predicates
import Settings.User import Settings.User
-- Combining default ways with user modifications -- Combining default ways with user modifications
getLibWays :: Expr [Way]
getLibWays = fromDiffExpr $ defaultLibWays <> userLibWays
-- In Stage0 we only build vanilla
getWays :: Expr [Way] getWays :: Expr [Way]
getWays = fromDiffExpr $ defaultWays <> userWays getWays = mconcat [ stage0 ? return [vanilla], notStage0 ? getLibWays ]
getRtsWays :: Expr [Way] getRtsWays :: Expr [Way]
getRtsWays = fromDiffExpr $ defaultRtsWays <> userRtsWays getRtsWays = fromDiffExpr $ defaultRtsWays <> userRtsWays
-- These are default ways -- These are default ways
defaultWays :: Ways defaultLibWays :: Ways
defaultWays = mconcat defaultLibWays = mconcat
[ append [vanilla] -- always build vanilla [ append [vanilla, profiling]
, notStage0 ? append [profiling]
, platformSupportsSharedLibs ? append [dynamic] ] , platformSupportsSharedLibs ? append [dynamic] ]
defaultRtsWays :: Ways defaultRtsWays :: Ways
defaultRtsWays = do defaultRtsWays = do
ways <- getWays ways <- getLibWays
mconcat mconcat
[ append [ logging, debug, threaded, threadedDebug, threadedLogging ] [ append [ logging, debug, threaded, threadedDebug, threadedLogging ]
, (profiling `elem` ways) ? append [threadedProfiling] , (profiling `elem` ways) ? append [threadedProfiling]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment