GhcCabal.hs 907 Bytes
Newer Older
1 2
module Settings.Packages.GhcCabal (ghcCabalPackageArgs) where

3
import Hadrian.Haskell.Cabal
4

5
import Base
6
import Expression
7
import GHC
8
import Utilities
9 10

ghcCabalPackageArgs :: Args
Andrey Mokhov's avatar
Andrey Mokhov committed
11
ghcCabalPackageArgs = stage0 ? package ghcCabal ? builder Ghc ? do
12
    cabalDeps <- expr $ pkgDependencies cabal
13
    (_, cabalVersion) <- expr $ cabalNameVersion (pkgCabalFile cabal)
14
    mconcat
Andrey Mokhov's avatar
Andrey Mokhov committed
15
        [ pure [ "-package " ++ pkgNameString pkg | pkg <- cabalDeps ]
16
        , arg "--make"
17
        , arg "-j"
18
        , arg ("-DCABAL_VERSION=" ++ replace "." "," cabalVersion)
19 20 21 22
        , arg "-DBOOTSTRAPPING"
        , arg "-DMIN_VERSION_binary_0_8_0"
        , arg "-DGENERICS"
        , arg "-optP-include"
Andrey Mokhov's avatar
Andrey Mokhov committed
23
        , arg $ "-optP" ++ pkgPath ghcCabal -/- "cabal_macros_boot.h"
24 25 26 27
        , arg "-ilibraries/Cabal/Cabal"
        , arg "-ilibraries/binary/src"
        , arg "-ilibraries/filepath"
        , arg "-ilibraries/hpc" ]