Clean up code, add comments.
[hadrian.git] / src / Settings / User.hs
1 module Settings.User (
2 userArgs, userPackages, userWays, userRtsWays, userTargetDirectory,
3 userKnownPackages, integerLibrary,
4 trackBuildSystem, buildHaddock, validating, ghciWithDebugger, ghcProfiled,
5 dynamicGhcPrograms, laxDependencies
6 ) where
7
8 import Expression
9 import Predicates
10
11 -- No user-specific settings by default
12 -- TODO: rename to userArgs
13 userArgs :: Args
14 userArgs = mempty
15
16 -- Control which packages get to be built
17 userPackages :: Packages
18 userPackages = mempty
19
20 -- Add new user-defined packages
21 userKnownPackages :: [Package]
22 userKnownPackages = []
23
24 -- Control which ways are built
25 userWays :: Ways
26 userWays = mempty
27
28 userRtsWays :: Ways
29 userRtsWays = mempty
30
31 -- Control where build results go (see Settings.Default for an example)
32 userTargetDirectory :: Stage -> Package -> FilePath
33 userTargetDirectory = defaultTargetDirectory
34
35 -- Choose integer library: integerGmp, integerGmp2 or integerSimple
36 integerLibrary :: Package
37 integerLibrary = integerGmp
38
39 -- User-defined flags. Note the following type semantics:
40 -- * Bool: a plain Boolean flag whose value is known at compile time
41 -- * Action Bool: a flag whose value can depend on the build environment
42 -- * Predicate: a flag depending on the build environment and the current target
43
44 -- Set this to True if you are making any changes in the build system and want
45 -- appropriate rebuilds to be initiated. Switching this to False speeds things
46 -- up a little (particularly zero builds).
47 -- WARNING: a complete rebuild is required when changing this setting.
48 trackBuildSystem :: Bool
49 trackBuildSystem = True
50
51 validating :: Bool
52 validating = False
53
54 dynamicGhcPrograms :: Bool
55 dynamicGhcPrograms = False
56
57 ghciWithDebugger :: Bool
58 ghciWithDebugger = False
59
60 ghcProfiled :: Bool
61 ghcProfiled = False
62
63 -- When laxDependencies flag is set to True, dependencies on the GHC executable
64 -- are turned into order-only dependencies to avoid needless recompilation when
65 -- making changes to GHC's sources. In certain situations this can lead to build
66 -- failures, in which case you should reset the flag (at least temporarily).
67 laxDependencies :: Bool
68 laxDependencies = False
69
70 buildHaddock :: Predicate
71 buildHaddock = return True