Minor revision
[hadrian.git] / src / Settings / Packages / GhcCabal.hs
1 module Settings.Packages.GhcCabal (ghcCabalPackageArgs) where
2
3 import Base
4 import GHC
5 import Oracles.Config.Setting
6 import Predicate
7 import Settings
8
9 ghcCabalPackageArgs :: Args
10 ghcCabalPackageArgs = package ghcCabal ?
11 builder Ghc ? mconcat [ ghcCabalBootArgs
12 , remove ["-no-auto-link-packages"] ]
13
14 -- Boostrapping ghcCabal
15 -- TODO: do we need -DCABAL_VERSION=$(CABAL_VERSION)?
16 ghcCabalBootArgs :: Args
17 ghcCabalBootArgs = stage0 ? do
18 -- Note: We could have computed 'cabalDeps' instead of hard-coding it
19 -- but this doesn't worth the effort, since we plan to drop ghc-cabal
20 -- altogether at some point. See #18.
21 cabalDeps <- fromDiffExpr $ mconcat
22 [ append [ array, base, bytestring, containers, deepseq, directory
23 , pretty, process, time ]
24 , notM windowsHost ? append [unix]
25 , windowsHost ? append [win32] ]
26 path <- getBuildPath
27 mconcat
28 [ append [ "-package " ++ pkgNameString pkg | pkg <- cabalDeps ]
29 , arg "--make"
30 , arg "-j"
31 , arg "-DBOOTSTRAPPING"
32 , arg "-DMIN_VERSION_binary_0_8_0"
33 , arg "-DGENERICS"
34 , removePair "-optP-include" $ "-optP" ++ path -/- "autogen/cabal_macros.h"
35 , arg "-optP-include"
36 , arg $ "-optP" ++ pkgPath ghcCabal -/- "cabal_macros_boot.h"
37 , arg "-ilibraries/Cabal/Cabal"
38 , arg "-ilibraries/binary/src"
39 , arg "-ilibraries/filepath"
40 , arg "-ilibraries/hpc" ]