Refactor GHC/user packages, move builder-specific functions into Builder
[hadrian.git] / src / UserSettings.hs
1 -- If you want to customise your build you should copy this file from
2 -- hadrian/src/UserSettings.hs to hadrian/UserSettings.hs and edit your copy.
3 -- If you don't copy the file your changes will be tracked by git and you can
4 -- accidentally commit them.
5 module UserSettings (
6 userBuildRoot, userFlavours, userPackages, verboseCommands,
7 buildProgressColour, successColour, defaultStage1Only
8 ) where
9
10 import Hadrian.Utilities
11 import System.Console.ANSI
12
13 import Flavour
14 import Expression
15
16 -- See doc/user-settings.md for instructions.
17
18 -- | All build results are put into the 'buildRoot' directory.
19 userBuildRoot :: BuildRoot
20 userBuildRoot = BuildRoot "_build"
21
22 -- | User defined build flavours. See 'defaultFlavour' as an example.
23 userFlavours :: [Flavour]
24 userFlavours = []
25
26 -- | Add user defined packages. Note, this only lets Hadrian know about the
27 -- existence of a new package; to actually build it you need to create a new
28 -- build flavour, modifying the list of packages that are built by default.
29 userPackages :: [Package]
30 userPackages = []
31
32 -- | Set to 'True' to print full command lines during the build process. Note:
33 -- this is a 'Predicate', hence you can enable verbose output only for certain
34 -- targets, e.g.: @verboseCommands = package ghcPrim@.
35 verboseCommands :: Predicate
36 verboseCommands = do
37 verbosity <- expr getVerbosity
38 return $ verbosity >= Loud
39
40 -- | Set colour for build progress messages (e.g. executing a build command).
41 buildProgressColour :: BuildProgressColour
42 buildProgressColour = BuildProgressColour (Dull, Magenta)
43
44 -- | Set colour for success messages (e.g. a package is built successfully).
45 successColour :: SuccessColour
46 successColour = SuccessColour (Dull, Green)
47
48 {-
49 Stage1Only=YES means:
50 - don't build ghc-stage2 (the executable)
51 - don't build utils that rely on ghc-stage2
52 See Note [No stage2 packages when CrossCompiling or Stage1Only] in
53 ./ghc.mk.
54 - install ghc-stage1 instead of ghc-stage2
55 - install the ghc-pkg that was built with the stage0 compiler
56 - (*do* still build compiler/stage2 (i.e. the ghc library))
57 - (*do* still build all other libraries)
58 -}
59 -- | Stage1Only flag, default off
60 defaultStage1Only :: Bool
61 defaultStage1Only = False