Commit e34e7e28 authored by Andrey Mokhov's avatar Andrey Mokhov
Browse files

Keep up with recent GHC changes, see #215.

parent 1099f623
......@@ -70,6 +70,8 @@ ghc-major-version = @GhcMajVersion@
ghc-minor-version = @GhcMinVersion@
ghc-patch-level = @GhcPatchLevel@
supports-this-unit-id = @SUPPORTS_THIS_UNIT_ID@
project-name = @ProjectName@
project-version = @ProjectVersion@
project-version-int = @ProjectVersionInt@
......
......@@ -118,7 +118,7 @@ executable ghc-shake
, ScopedTypeVariables
build-depends: base >= 4.8 && < 5
, ansi-terminal == 0.6.*
, Cabal == 1.22.*
, Cabal == 1.22.* || == 1.24.*
, containers == 0.5.*
, directory == 1.2.*
, extra == 1.4.*
......
......@@ -18,6 +18,7 @@ data Flag = ArSupportsAtFile
| LeadingUnderscore
| SolarisBrokenShld
| SplitObjectsBroken
| SupportsThisUnitId
| WithLibdw
| UseSystemFfi
......@@ -34,6 +35,7 @@ flag f = do
LeadingUnderscore -> "leading-underscore"
SolarisBrokenShld -> "solaris-broken-shld"
SplitObjectsBroken -> "split-objects-broken"
SupportsThisUnitId -> "supports-this-unit-id"
WithLibdw -> "with-libdw"
UseSystemFfi -> "use-system-ffi"
value <- askConfigWithDefault key . putError
......
......@@ -5,6 +5,7 @@ module Settings.Builders.Ghc (
import Base
import Expression
import GHC
import Oracles.Config.Flag
import Oracles.Config.Setting
import Oracles.PackageData
import Predicates hiding (way, stage)
......@@ -114,11 +115,16 @@ packageGhcArgs = do
lift . when (isLibrary pkg) $ do
conf <- pkgConfFile context
need [conf]
-- FIXME: Get rid of to-be-deprecated -this-package-key.
thisArg <- do
not0 <- notStage0
unit <- getFlag SupportsThisUnitId
return $ if not0 || unit then "-this-unit-id " else "-this-package-key "
mconcat
[ arg "-hide-all-packages"
, arg "-no-user-package-db"
, bootPackageDbArgs
, isLibrary pkg ? (arg $ "-this-package-key " ++ compId)
, isLibrary pkg ? (arg $ thisArg ++ compId)
, append $ map ("-package-id " ++) pkgDepIds ]
-- TODO: Improve handling of "cabal_macros.h"
......
......@@ -2,7 +2,8 @@ module Settings.Packages.GhcCabal (ghcCabalPackageArgs) where
import Base
import Expression
import GHC (ghcCabal)
import GHC
import Oracles.Config.Setting
import Predicates (builderGhc, package, stage0)
import Settings
......@@ -19,8 +20,13 @@ ghcCabalBootArgs = stage0 ? do
path <- getBuildPath
let cabalMacros = path -/- "autogen/cabal_macros.h"
cabalMacrosBoot = pkgPath ghcCabal -/- "cabal_macros_boot.h"
cabalDeps <- fromDiffExpr $ mconcat
[ append [ array, base, bytestring, containers, deepseq, directory
, pretty, process, time ]
, notM windowsHost ? append [unix]
, windowsHost ? append [win32] ]
mconcat
[ remove ["-hide-all-packages"]
[ append [ "-package " ++ pkgNameString pkg | pkg <- cabalDeps ]
, removePair "-optP-include" $ "-optP" ++ cabalMacros
, arg "--make"
, arg "-j"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment