7cf9997de975c6bb5fbefbb8819a44b368eb8512
[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 -- See doc/user-settings.md for instructions.
16
17 -- | All build results are put into 'buildRootPath' directory.
18 buildRootPath :: FilePath
19 buildRootPath = "_build"
20
21 -- | Modify default build command line arguments.
22 userArgs :: Args
23 userArgs = builder Ghc ? remove ["-Wall", "-fwarn-tabs"]
24
25 -- | Modify the set of packages that are built by default in each stage.
26 userPackages :: Packages
27 userPackages = mempty
28
29 -- | Add user defined packages. Don't forget to add them to 'userPackages' too.
30 userKnownPackages :: [Package]
31 userKnownPackages = []
32
33 -- | Choose the integer library: 'integerGmp' or 'integerSimple'.
34 integerLibrary :: Package
35 integerLibrary = integerGmp
36
37 -- FIXME: We skip 'dynamic' since it's currently broken #4.
38 -- | Modify the set of ways in which library packages are built.
39 userLibraryWays :: Ways
40 userLibraryWays = remove [dynamic]
41
42 -- | Modify the set of ways in which the 'rts' package is built.
43 userRtsWays :: Ways
44 userRtsWays = mempty
45
46 -- | User defined flags. Note the following type semantics:
47 -- * @Bool@: a plain Boolean flag whose value is known at compile time.
48 -- * @Action Bool@: a flag whose value can depend on the build environment.
49 -- * @Predicate@: a flag whose value can depend on the build environment and
50 -- on the current build target.
51
52 -- TODO: Drop 'trackBuildSystem' as it brings negligible gains.
53 -- | Set this to True if you are making any changes in the build system and want
54 -- appropriate rebuilds to be initiated. Switching this to False speeds things
55 -- up a little (particularly zero builds).
56 -- WARNING: a complete rebuild is required when changing this setting.
57 trackBuildSystem :: Bool
58 trackBuildSystem = True
59
60 -- TODO: This should be set automatically when validating.
61 validating :: Bool
62 validating = False
63
64 -- | Control when split objects are generated. Note, due to the GHC bug #11315
65 -- it is necessary to do a full clean rebuild when changing this option.
66 splitObjects :: Predicate
67 splitObjects = (return cmdSplitObjects) &&^ defaultSplitObjects
68
69 -- | Control when to build Haddock documentation.
70 buildHaddock :: Predicate
71 buildHaddock = return cmdBuildHaddock
72
73 -- TODO: Do we need to be able to set these from command line?
74 -- TODO: Turn the flags below into a simple list @ghcWays :: [Way]@?
75 dynamicGhcPrograms :: Bool
76 dynamicGhcPrograms = False
77
78 ghciWithDebugger :: Bool
79 ghciWithDebugger = False
80
81 ghcProfiled :: Bool
82 ghcProfiled = False
83
84 ghcDebugged :: Bool
85 ghcDebugged = False
86
87 -- | Set to True to print full command lines during the build process. Note,
88 -- this is a Predicate, hence you can enable verbose output only for certain
89 -- targets, e.g.: @verboseCommands = package ghcPrim@.
90 verboseCommands :: Predicate
91 verboseCommands = return False
92
93 -- TODO: Replace with stage2 ? arg "-Werror"? Also see #251.
94 -- | To enable -Werror in Stage2 set turnWarningsIntoErrors = stage2.
95 turnWarningsIntoErrors :: Predicate
96 turnWarningsIntoErrors = return False