d6a016bb1d0933503a752b39cb24b469092fa3e1
[hadrian.git] / src / Settings / Packages / Compiler.hs
1 module Settings.Packages.Compiler (compilerPackageArgs) where
2
3 import Base
4 import GHC
5 import Oracles.Config.Flag
6 import Oracles.Config.Setting
7 import Predicate
8 import Settings
9
10 compilerPackageArgs :: Args
11 compilerPackageArgs = package compiler ? do
12 stage <- getStage
13 rtsWays <- getRtsWays
14 path <- getBuildPath
15 mconcat [ builder Alex ? arg "--latin1"
16
17 , builder Ghc ? arg ("-I" ++ path)
18
19 , builder GhcCabal ? mconcat
20 [ arg $ "--ghc-option=-DSTAGE=" ++ show (fromEnum stage + 1)
21 , arg "--disable-library-for-ghci"
22 , anyTargetOs ["openbsd"] ? arg "--ld-options=-E"
23 , flag GhcUnregisterised ? arg "--ghc-option=-DNO_REGS"
24 , notM ghcWithSMP ? arg "--ghc-option=-DNOSMP"
25 , notM ghcWithSMP ? arg "--ghc-option=-optc-DNOSMP"
26 , (threaded `elem` rtsWays) ?
27 notStage0 ? arg "--ghc-option=-optc-DTHREADED_RTS"
28 , ghcWithNativeCodeGen ? arg "--flags=ncg"
29 , ghcWithInterpreter ?
30 notStage0 ? arg "--flags=ghci"
31 , ghcWithInterpreter ?
32 ghcEnableTablesNextToCode ?
33 notM (flag GhcUnregisterised) ?
34 notStage0 ? arg "--ghc-option=-DGHCI_TABLES_NEXT_TO_CODE"
35 , ghcWithInterpreter ?
36 ghciWithDebugger ?
37 notStage0 ? arg "--ghc-option=-DDEBUGGER"
38 , ghcProfiled ?
39 notStage0 ? arg "--ghc-pkg-option=--force" ]
40
41 , builder Haddock ? arg ("--optghc=-I" ++ path) ]