[commit: ghc] wip/nfs-locking: Add basic support for -0 libraries. (3e82d46)
git at git.haskell.org
git at git.haskell.org
Thu Oct 26 23:23:19 UTC 2017
Repository : ssh://git@git.haskell.org/ghc
On branch : wip/nfs-locking
Link : http://ghc.haskell.org/trac/ghc/changeset/3e82d460ba762334e7d52be121a1fa698dda42e4/ghc
>---------------------------------------------------------------
commit 3e82d460ba762334e7d52be121a1fa698dda42e4
Author: Andrey Mokhov <andrey.mokhov at gmail.com>
Date: Wed Dec 9 01:58:53 2015 +0000
Add basic support for -0 libraries.
>---------------------------------------------------------------
3e82d460ba762334e7d52be121a1fa698dda42e4
src/Rules.hs | 8 ++++++--
src/Rules/Library.hs | 5 ++++-
2 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/src/Rules.hs b/src/Rules.hs
index e615c64..2e2963f 100644
--- a/src/Rules.hs
+++ b/src/Rules.hs
@@ -5,6 +5,7 @@ import Oracles
import Rules.Package
import Rules.Resources
import Settings
+import Settings.Builders.GhcCabal
-- generateTargets needs top-level build targets
generateTargets :: Rules ()
@@ -21,9 +22,12 @@ generateTargets = action $ do
ways <- interpretPartial target getWays
let ghciLib = buildPath -/- "HS" ++ libName <.> "o"
haddock = pkgHaddockFile pkg
- libs <- forM ways $ \way -> do
+ libs <- fmap concat . forM ways $ \way -> do
extension <- libsuf way
- return $ buildPath -/- "libHS" ++ libName <.> extension
+ let name = buildPath -/- "libHS" ++ libName
+ dll0 <- needDll0 stage pkg
+ return $ [ name <.> extension ]
+ ++ [ name ++ "-0" <.> extension | dll0 ]
return $ [ ghciLib | needGhciLib == "YES" && stage == Stage1 ]
++ [ haddock | needHaddock && stage == Stage1 ]
diff --git a/src/Rules/Library.hs b/src/Rules/Library.hs
index d51e2ad..9e4f7d5 100644
--- a/src/Rules/Library.hs
+++ b/src/Rules/Library.hs
@@ -15,6 +15,7 @@ buildPackageLibrary _ target @ (PartialTarget stage pkg) = do
-- TODO: handle dynamic libraries
matchBuildResult buildPath "a" ?> \a -> do
+
removeFileIfExists a
cSrcs <- cSources target
hSrcs <- hSources target
@@ -35,7 +36,9 @@ buildPackageLibrary _ target @ (PartialTarget stage pkg) = do
return . map (splitPath -/-)
. filter (not . all (== '.')) $ contents
- build $ fullTarget target Ar (cObjs ++ splitObjs) [a]
+ if "//*-0.*" ?== a
+ then build $ fullTarget target Ar [] [a]
+ else build $ fullTarget target Ar (cObjs ++ splitObjs) [a]
synopsis <- interpretPartial target $ getPkgData Synopsis
putSuccess $ "/--------\n| Successfully built package library '"
More information about the ghc-commits
mailing list