cc4868495780889ff28c9961fee8c2ba23255fde
[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 validating :: Bool
57 validating = False
58
59 -- | Control when split objects are generated. Note, due to the GHC bug #11315
60 -- it is necessary to do a full clean rebuild when changing this option.
61 splitObjects :: Predicate
62 splitObjects = (return cmdSplitObjects) &&^ defaultSplitObjects
63
64 dynamicGhcPrograms :: Bool
65 dynamicGhcPrograms = False
66
67 ghciWithDebugger :: Bool
68 ghciWithDebugger = False
69
70 ghcProfiled :: Bool
71 ghcProfiled = False
72
73 -- TODO: do we need to be able to set this from command line?
74 ghcDebugged :: Bool
75 ghcDebugged = False
76
77 buildHaddock :: Predicate
78 buildHaddock = return cmdBuildHaddock
79
80 -- | Set to True to print full command lines during the build process. Note,
81 -- this is a Predicate, hence you can enable verbose output for a chosen package
82 -- only, e.g.: verboseCommands = package ghcPrim.
83 verboseCommands :: Predicate
84 verboseCommands = return False
85
86 -- TODO: Replace with stage2 ? arg "-Werror"?
87 -- | To enable -Werror in Stage2 set turnWarningsIntoErrors = stage2.
88 turnWarningsIntoErrors :: Predicate
89 turnWarningsIntoErrors = return False