Rename src/Expression.hs -> src/Expression/Base.hs.
[hadrian.git] / src / Settings.hs
1 {-# LANGUAGE FlexibleInstances #-}
2
3 module Settings (
4 IntegerLibrary (..), integerLibrary, integerLibraryName,
5 buildHaddock
6 ) where
7
8 import Base
9 import Expression
10
11 data IntegerLibrary = IntegerGmp | IntegerGmp2 | IntegerSimple
12
13 integerLibrary :: IntegerLibrary
14 integerLibrary = IntegerGmp2
15
16 integerLibraryName :: String
17 integerLibraryName = case integerLibrary of
18 IntegerGmp -> "integer-gmp"
19 IntegerGmp2 -> "integer-gmp2"
20 IntegerSimple -> "integer-simple"
21
22 buildHaddock :: Bool
23 buildHaddock = True
24
25 supportsPackageKey :: Guard
26 supportsPackageKey = keyYes "supports-package-key"
27
28 whenPackageKey :: Guard
29 whenPackageKey = supportsPackageKey <> notStage Stage0
30
31 depSettings :: Settings
32 depSettings =
33 opts ["-hide-all-packages", "-no-user-package-db", "-include-pkg-deps"]
34 <>
35 stage Stage0 ? opts ["-package-db libraries/bootstrapping.conf"]
36 <>
37 whenPackageKey ?
38 (packageKey "-this-package-key" <> packageDepKeys "-package-key")
39 <>
40 (Not $ whenPackageKey) ?
41 (packageKey "-package-name" <> packageDeps "-package")
42
43 --packageArgs :: Stage -> FilePath -> Args
44 --packageArgs stage pathDist = do
45 -- usePackageKey <- SupportsPackageKey || stage /= Stage0
46 -- args [ arg "-hide-all-packages"
47 -- , arg "-no-user-package-db"
48 -- , arg "-include-pkg-deps"
49 -- , when (stage == Stage0) $
50 -- arg "-package-db libraries/bootstrapping.conf"
51 -- , if usePackageKey
52 -- then productArgs ["-this-package-key"] [arg $ PackageKey pathDist]
53 -- <> productArgs ["-package-key" ] [args $ DepKeys pathDist]
54 -- else productArgs ["-package-name" ] [arg $ PackageKey pathDist]
55 -- <> productArgs ["-package" ] [args $ Deps pathDist]
56 -- ]