Commit 4758a21d authored by Ben Gamari's avatar Ben Gamari 🐢
Browse files

LIB_NAME, PACKAGE_KEY are now COMPONENT_ID

Since GHC commit 6338a1cc.
parent 73b46052
......@@ -45,12 +45,12 @@ ar-supports-at-file = @ArSupportsAtFile@
# Build options:
#===============
supports-package-key = @SUPPORTS_PACKAGE_KEY@
solaris-broken-shld = @SOLARIS_BROKEN_SHLD@
split-objects-broken = @SplitObjsBroken@
ghc-unregisterised = @Unregisterised@
ghc-source-path = @hardtop@
leading-underscore = @LeadingUnderscore@
supports-component-id = @SUPPORTS_COMPONENT_ID@
solaris-broken-shld = @SOLARIS_BROKEN_SHLD@
split-objects-broken = @SplitObjsBroken@
ghc-unregisterised = @Unregisterised@
ghc-source-path = @hardtop@
leading-underscore = @LeadingUnderscore@
# Information about build, host and target systems:
#==================================================
......
......@@ -16,7 +16,7 @@ data Flag = ArSupportsAtFile
| LeadingUnderscore
| SolarisBrokenShld
| SplitObjectsBroken
| SupportsPackageKey
| SupportsComponentId
-- Note, if a flag is set to empty string we treat it as set to NO. This seems
-- fragile, but some flags do behave like this, e.g. GccIsClang.
......@@ -31,7 +31,7 @@ flag f = do
LeadingUnderscore -> "leading-underscore"
SolarisBrokenShld -> "solaris-broken-shld"
SplitObjectsBroken -> "split-objects-broken"
SupportsPackageKey -> "supports-package-key"
SupportsComponentId -> "supports-component-id"
value <- askConfigWithDefault key . putError
$ "\nFlag '" ++ key ++ "' not set in configuration files."
unless (value == "YES" || value == "NO" || value == "") . putError
......
......@@ -16,8 +16,7 @@ import qualified Data.HashMap.Strict as Map
-- such as 'path_MODULES = Data.Array Data.Array.Base ...'.
-- pkgListData Modules therefore returns ["Data.Array", "Data.Array.Base", ...]
data PackageData = BuildGhciLib FilePath
| LibName FilePath
| PackageKey FilePath
| ComponentId FilePath
| Synopsis FilePath
| Version FilePath
......@@ -55,8 +54,7 @@ askPackageData path key = do
pkgData :: PackageData -> Action String
pkgData packageData = case packageData of
BuildGhciLib path -> askPackageData path "BUILD_GHCI_LIB"
LibName path -> askPackageData path "LIB_NAME"
PackageKey path -> askPackageData path "PACKAGE_KEY"
ComponentId path -> askPackageData path "COMPONENT_ID"
Synopsis path -> askPackageData path "SYNOPSIS"
Version path -> askPackageData path "VERSION"
......
......@@ -16,15 +16,15 @@ generateTargets = action $ do
libTargets <- fmap concat . forM libPkgs $ \pkg -> do
let target = PartialTarget stage pkg
buildPath = targetPath stage pkg -/- "build"
libName <- interpretPartial target $ getPkgData LibName
compId <- interpretPartial target $ getPkgData ComponentId
needGhciLib <- interpretPartial target $ getPkgData BuildGhciLib
needHaddock <- interpretPartial target buildHaddock
ways <- interpretPartial target getWays
let ghciLib = buildPath -/- "HS" ++ libName <.> "o"
let ghciLib = buildPath -/- "HS" ++ compId <.> "o"
haddock = pkgHaddockFile pkg
libs <- fmap concat . forM ways $ \way -> do
extension <- libsuf way
let name = buildPath -/- "libHS" ++ libName
let name = buildPath -/- "libHS" ++ compId
dll0 <- needDll0 stage pkg
return $ [ name <.> extension ]
++ [ name ++ "-0" <.> extension | dll0 ]
......
......@@ -91,11 +91,11 @@ wayGhcArgs = do
-- TODO: Improve handling of "-hide-all-packages"
packageGhcArgs :: Args
packageGhcArgs = do
stage <- getStage
pkg <- getPackage
supportsPackageKey <- getFlag SupportsPackageKey
pkgKey <- getPkgData PackageKey
pkgDepIds <- getPkgDataList DepIds
stage <- getStage
pkg <- getPackage
supportsComponentId <- getFlag SupportsComponentId
compId <- getPkgData ComponentId
pkgDepIds <- getPkgDataList DepIds
mconcat
[ not (pkg == deriveConstants || pkg == genapply
|| pkg == genprimopcode || pkg == hp2ps) ?
......@@ -103,9 +103,9 @@ packageGhcArgs = do
, arg "-no-user-package-db"
, stage0 ? arg "-package-db libraries/bootstrapping.conf"
, isLibrary pkg ?
if supportsPackageKey || stage /= Stage0
then arg $ "-this-package-key " ++ pkgKey
else arg $ "-package-name " ++ pkgKey
if supportsComponentId || stage /= Stage0
then arg $ "-this-package-key " ++ compId
else arg $ "-package-name " ++ compId
, append $ map ("-package-id " ++) pkgDepIds ]
-- TODO: Improve handling of "cabal_macros.h"
......
Supports Markdown
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