GhcCabal.hs 1.11 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
module Settings.Packages.GhcCabal (ghcCabalPackageArgs) where

import Base
import Expression
import GHC (ghcCabal)
import Predicates (builderGhc, package, stage0)
import Settings

ghcCabalPackageArgs :: Args
ghcCabalPackageArgs = package ghcCabal ? mconcat
    [ builderGhc ?
      mconcat [ ghcCabalBootArgs
              , remove ["-no-auto-link-packages"] ] ]

-- Boostrapping ghcCabal
-- TODO: do we need -DCABAL_VERSION=$(CABAL_VERSION)?
ghcCabalBootArgs :: Args
ghcCabalBootArgs = stage0 ? do
19
20
    path <- getBuildPath
    let cabalMacros     = path -/- "autogen/cabal_macros.h"
21
22
23
24
25
        cabalMacrosBoot = pkgPath ghcCabal -/- "cabal_macros_boot.h"
    mconcat
        [ remove ["-hide-all-packages"]
        , removePair "-optP-include" $ "-optP" ++ cabalMacros
        , arg "--make"
26
        , arg "-j"
27
28
29
30
31
32
33
34
35
        , arg "-DBOOTSTRAPPING"
        , arg "-DMIN_VERSION_binary_0_8_0"
        , arg "-DGENERICS"
        , arg "-optP-include"
        , arg $ "-optP" ++ cabalMacrosBoot
        , arg "-ilibraries/Cabal/Cabal"
        , arg "-ilibraries/binary/src"
        , arg "-ilibraries/filepath"
        , arg "-ilibraries/hpc" ]