User.hs 3.47 KB
Newer Older
1
module Settings.User (
Andrey Mokhov's avatar
Andrey Mokhov committed
2
    buildRootPath, trackBuildSystem, compileInterfaceFilesSeparately,
3
    userArgs, userPackages, userLibraryWays, userRtsWays, userKnownPackages,
4
    integerLibrary, buildHaddock, validating, ghciWithDebugger, ghcProfiled,
5
    ghcDebugged, dynamicGhcPrograms, laxDependencies, buildSystemConfigFile,
Andrey Mokhov's avatar
Andrey Mokhov committed
6
    verboseCommands, turnWarningsIntoErrors, splitObjects
Andrey Mokhov's avatar
Andrey Mokhov committed
7 8
    ) where

9 10
import Base
import CmdLineFlag
11
import GHC
Andrey Mokhov's avatar
Andrey Mokhov committed
12
import Expression
13
import Predicates
14
import Settings.Default
Andrey Mokhov's avatar
Andrey Mokhov committed
15

16 17 18 19
-- | All build artefacts are stored in 'buildRootPath' directory.
buildRootPath :: FilePath
buildRootPath = ".build"

20
-- Control user-specific settings
21
userArgs :: Args
22
userArgs = builderGhc ? remove ["-Wall", "-fwarn-tabs"]
23

24
-- Control which packages get to be built
25
userPackages :: Packages
26
userPackages = mempty
27

28 29 30 31
-- Add new user-defined packages
userKnownPackages :: [Package]
userKnownPackages = []

32 33 34 35 36
-- | Control which ways library packages are built
-- FIXME: skip profiling for speed
-- FIXME: skip dynamic since it's currently broken #4
userLibraryWays :: Ways
userLibraryWays = remove [profiling, dynamic]
37

38
-- | Control which ways the 'rts' package is built
39 40 41
userRtsWays :: Ways
userRtsWays = mempty

42
-- | Choose the integer library: integerGmp or integerSimple
43
integerLibrary :: Package
Andrey Mokhov's avatar
Andrey Mokhov committed
44
integerLibrary = integerGmp
45

46
-- | User-defined flags. Note the following type semantics:
47 48 49
-- * Bool: a plain Boolean flag whose value is known at compile time
-- * Action Bool: a flag whose value can depend on the build environment
-- * Predicate: a flag depending on the build environment and the current target
50

51
-- | Set this to True if you are making any changes in the build system and want
52 53
-- appropriate rebuilds to be initiated. Switching this to False speeds things
-- up a little (particularly zero builds).
Andrey Mokhov's avatar
Andrey Mokhov committed
54
-- WARNING: a complete rebuild is required when changing this setting.
55
trackBuildSystem :: Bool
Andrey Mokhov's avatar
Andrey Mokhov committed
56
trackBuildSystem = True
57

58 59 60
validating :: Bool
validating = False

61 62
-- | Control when split objects are generated. Note, due to the GHC bug #11315
-- it is necessary to do a full clean rebuild when changing this option.
63
splitObjects :: Predicate
64
splitObjects = (lift $ cmdSplitObjects) &&^ defaultSplitObjects
65

66 67 68
dynamicGhcPrograms :: Bool
dynamicGhcPrograms = False

69 70 71 72 73 74
ghciWithDebugger :: Bool
ghciWithDebugger = False

ghcProfiled :: Bool
ghcProfiled = False

75 76 77 78
-- TODO: do we need to be able to set this from command line?
ghcDebugged :: Bool
ghcDebugged = False

79
-- | When laxDependencies is set to True, dependencies on the GHC executable
Andrey Mokhov's avatar
Andrey Mokhov committed
80 81 82
-- are turned into order-only dependencies to avoid needless recompilation when
-- making changes to GHC's sources. In certain situations this can lead to build
-- failures, in which case you should reset the flag (at least temporarily).
83 84 85
laxDependencies :: Bool
laxDependencies = False

86
buildHaddock :: Predicate
87
buildHaddock = return False -- FIXME: should be return True, see #98
88 89 90

buildSystemConfigFile :: Bool
buildSystemConfigFile = False
91

92 93
-- | Set to True to print full command lines during the build process. Note,
-- this is a Predicate, hence you can enable verbose output for a chosen package
94 95 96
-- only, e.g.: verboseCommands = package ghcPrim
verboseCommands :: Predicate
verboseCommands = return False
97 98 99 100

-- | To enable -Werror in Stage2 set turnWarningsIntoErrors = stage2.
turnWarningsIntoErrors :: Predicate
turnWarningsIntoErrors = return False
101 102 103

-- | Decouple the compilation of @*.hi@ and @*.o@ files by setting to True.
compileInterfaceFilesSeparately :: Bool
104
compileInterfaceFilesSeparately = False