GhcCabal.hs 1.3 KB
Newer Older
1
2
3
module Settings.Packages.GhcCabal (ghcCabalPackageArgs) where

import Base
4
5
import GHC
import Oracles.Config.Setting
6
import Predicate
7
8

ghcCabalPackageArgs :: Args
Andrey Mokhov's avatar
Andrey Mokhov committed
9
10
11
ghcCabalPackageArgs = package ghcCabal ?
    builder Ghc ? mconcat [ ghcCabalBootArgs
                          , remove ["-no-auto-link-packages"] ]
12
13
14
15

-- TODO: do we need -DCABAL_VERSION=$(CABAL_VERSION)?
ghcCabalBootArgs :: Args
ghcCabalBootArgs = stage0 ? do
Andrey Mokhov's avatar
Andrey Mokhov committed
16
17
18
    -- Note: We could have computed 'cabalDeps' instead of hard-coding it
    -- but this doesn't worth the effort, since we plan to drop ghc-cabal
    -- altogether at some point. See #18.
19
20
21
22
23
    cabalDeps <- fromDiffExpr $ mconcat
        [ append [ array, base, bytestring, containers, deepseq, directory
                 , pretty, process, time ]
        , notM windowsHost ? append [unix]
        , windowsHost ? append [win32] ]
24
    mconcat
25
        [ append [ "-package " ++ pkgNameString pkg | pkg <- cabalDeps ]
26
        , arg "--make"
27
        , arg "-j"
28
29
30
31
        , arg "-DBOOTSTRAPPING"
        , arg "-DMIN_VERSION_binary_0_8_0"
        , arg "-DGENERICS"
        , arg "-optP-include"
Andrey Mokhov's avatar
Andrey Mokhov committed
32
        , arg $ "-optP" ++ pkgPath ghcCabal -/- "cabal_macros_boot.h"
33
34
35
36
        , arg "-ilibraries/Cabal/Cabal"
        , arg "-ilibraries/binary/src"
        , arg "-ilibraries/filepath"
        , arg "-ilibraries/hpc" ]