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