Add TODOs.
[ghc.git] / src / Settings / User.hs
1 module Settings.User (
2 buildRootPath, trackBuildSystem, userArgs, userPackages, userLibraryWays,
3 userRtsWays, userKnownPackages, integerLibrary, buildHaddock, validating,
4 ghciWithDebugger, ghcProfiled, ghcDebugged, dynamicGhcPrograms,
5 verboseCommands, turnWarningsIntoErrors, splitObjects
6 ) where
7
8 import Base
9 import CmdLineFlag
10 import GHC
11 import Expression
12 import Predicates
13 import Settings.Default
14
15 -- | All build artefacts are stored in 'buildRootPath' directory.
16 buildRootPath :: FilePath
17 buildRootPath = "_build"
18
19 -- | Control user-specific command line arguments.
20 userArgs :: Args
21 userArgs = builder Ghc ? remove ["-Wall", "-fwarn-tabs"]
22
23 -- | Control which packages get to be built.
24 userPackages :: Packages
25 userPackages = mempty
26
27 -- | Add new user-defined packages.
28 userKnownPackages :: [Package]
29 userKnownPackages = []
30
31 -- | Choose the integer library: integerGmp or integerSimple.
32 integerLibrary :: Package
33 integerLibrary = integerGmp
34
35 -- | Control which ways library packages are built.
36 -- FIXME: skip dynamic since it's currently broken #4
37 userLibraryWays :: Ways
38 userLibraryWays = remove [dynamic]
39
40 -- | Control which ways the 'rts' package is built.
41 userRtsWays :: Ways
42 userRtsWays = mempty
43
44 -- | User-defined flags. Note the following type semantics:
45 -- * Bool: a plain Boolean flag whose value is known at compile time
46 -- * Action Bool: a flag whose value can depend on the build environment
47 -- * Predicate: a flag depending on the build environment and the current target
48
49 -- | Set this to True if you are making any changes in the build system and want
50 -- appropriate rebuilds to be initiated. Switching this to False speeds things
51 -- up a little (particularly zero builds).
52 -- WARNING: a complete rebuild is required when changing this setting.
53 trackBuildSystem :: Bool
54 trackBuildSystem = True
55
56 -- TODO: This should be set automatically when validating.
57 validating :: Bool
58 validating = False
59
60 -- | Control when split objects are generated. Note, due to the GHC bug #11315
61 -- it is necessary to do a full clean rebuild when changing this option.
62 splitObjects :: Predicate
63 splitObjects = (return cmdSplitObjects) &&^ defaultSplitObjects
64
65 -- | Control when to build documentation.
66 buildHaddock :: Predicate
67 buildHaddock = return cmdBuildHaddock
68
69 -- TODO: Do we need to be able to set these from command line?
70 -- TODO: Turn below into ghcWays?
71 dynamicGhcPrograms :: Bool
72 dynamicGhcPrograms = False
73
74 ghciWithDebugger :: Bool
75 ghciWithDebugger = False
76
77 ghcProfiled :: Bool
78 ghcProfiled = False
79
80 ghcDebugged :: Bool
81 ghcDebugged = False
82
83 -- | Set to True to print full command lines during the build process. Note,
84 -- this is a Predicate, hence you can enable verbose output for a chosen package
85 -- only, e.g.: verboseCommands = package ghcPrim.
86 verboseCommands :: Predicate
87 verboseCommands = return False
88
89 -- TODO: Replace with stage2 ? arg "-Werror"?
90 -- | To enable -Werror in Stage2 set turnWarningsIntoErrors = stage2.
91 turnWarningsIntoErrors :: Predicate
92 turnWarningsIntoErrors = return False