hadrian: Disable -Wno-undef in files which include ffi.h (#459)
[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, verboseCommand,
7 buildProgressColour, successColour, stage1Only
8 ) where
9
10 import Hadrian.Utilities
11 import System.Console.ANSI
12
13 import Flavour
14 import Expression
15 import {-# SOURCE #-} Settings.Default
16
17 -- See doc/user-settings.md for instructions.
18 -- Please update doc/user-settings.md when committing changes to this file.
19
20 -- | All build results are put into the 'buildRoot' directory.
21 userBuildRoot :: BuildRoot
22 userBuildRoot = BuildRoot "_build"
23
24 -- | User-defined build flavours. See 'userFlavour' as an example.
25 userFlavours :: [Flavour]
26 userFlavours = [userFlavour] -- Add more build flavours if need be.
27
28 -- | This is an example user-defined build flavour. Feel free to modify it and
29 -- use by passing @--flavour=user@ from the command line.
30 userFlavour :: Flavour
31 userFlavour = defaultFlavour { name = "user" } -- Modify other settings here.
32
33 -- | Add user-defined packages. Note, this only lets Hadrian know about the
34 -- existence of a new package; to actually build it you need to create a new
35 -- build flavour, modifying the list of packages that are built by default.
36 userPackages :: [Package]
37 userPackages = []
38
39 -- | Set to 'True' to print full command lines during the build process. Note:
40 -- this is a 'Predicate', hence you can enable verbose output only for certain
41 -- targets, e.g.: @verboseCommand = package ghcPrim@.
42 verboseCommand :: Predicate
43 verboseCommand = do
44 verbosity <- expr getVerbosity
45 return $ verbosity >= Loud
46
47 -- | Set colour for build progress messages (e.g. executing a build command).
48 buildProgressColour :: BuildProgressColour
49 buildProgressColour = BuildProgressColour (Dull, Magenta)
50
51 -- | Set colour for success messages (e.g. a package is built successfully).
52 successColour :: SuccessColour
53 successColour = SuccessColour (Dull, Green)
54
55 -- TODO: Set this flag from the command line.
56 -- | Set this flag to 'True' to disable building Stage2 GHC (i.e. the @ghc-stage2@
57 -- executable) and Stage2 utilities (such as @haddock@). Note that all Stage0
58 -- and Stage1 libraries (including 'compiler') will still be built. Enabling
59 -- this flag during installation leads to installing @ghc-stage1@ instead of
60 -- @ghc-stage2@, and @ghc-pkg@ that was build with the Stage0 compiler.
61 -- Also see Note [No stage2 packages when CrossCompiling or Stage1Only] in the
62 -- top-level @ghc.mk@.
63 stage1Only :: Bool
64 stage1Only = False