Comments only
[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 buildRootPath, userFlavours, userKnownPackages, verboseCommands,
7 putBuild, putSuccess, defaultDestDir, defaultStage1Only
8 ) where
9
10 import System.Console.ANSI
11
12 import Base
13 import Flavour
14 import Predicate
15
16 -- See doc/user-settings.md for instructions.
17
18 -- | All build results are put into 'buildRootPath' directory.
19 buildRootPath :: FilePath
20 buildRootPath = "_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 let's 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 userKnownPackages :: [Package]
30 userKnownPackages = []
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 = return False
37
38 -- | Customise build progress messages (e.g. executing a build command).
39 putBuild :: String -> Action ()
40 putBuild = putColoured Dull Magenta
41
42 -- | Customise build success messages (e.g. a package is built successfully).
43 putSuccess :: String -> Action ()
44 putSuccess = putColoured Dull Green
45
46 -- | Path to the GHC install destination. It is empty by default, which
47 -- corresponds to the root of the file system. You can replace it by a specific
48 -- directory. Make sure you use correct absolute path on Windows, e.g. "C:/path".
49 -- The destination directory is used with a @prefix@, commonly @/usr/local@,
50 -- i.e. GHC is installed into "C:/path/usr/local" for the above example.
51 defaultDestDir :: FilePath
52 defaultDestDir = ""
53
54 {-
55 Stage1Only=YES means:
56 - don't build ghc-stage2 (the executable)
57 - don't build utils that rely on ghc-stage2
58 See Note [No stage2 packages when CrossCompiling or Stage1Only] in
59 ./ghc.mk.
60 - install ghc-stage1 instead of ghc-stage2
61 - install the ghc-pkg that was built with the stage0 compiler
62 - (*do* still build compiler/stage2 (i.e. the ghc library))
63 - (*do* still build all other libraries)
64 -}
65 -- | Stage1Only flag, default off
66 defaultStage1Only :: Bool
67 defaultStage1Only = False