Skip to content
Snippets Groups Projects
Commit ca0b4b50 authored by Cheng Shao's avatar Cheng Shao :beach:
Browse files

hadrian: so-mutex

(cherry picked from commit c35281f9)
parent 928929db
No related branches found
No related tags found
No related merge requests found
......@@ -24,10 +24,11 @@ import Oracles.Flag
libraryRules :: Rules ()
libraryRules = do
soMutex <- newResource "so-mutex" 1
root <- buildRootRules
root -/- "**/libHS*-*.dylib" %> buildDynamicLib root "dylib"
root -/- "**/libHS*-*.so" %> buildDynamicLib root "so"
root -/- "**/libHS*-*.dll" %> buildDynamicLib root "dll"
root -/- "**/libHS*-*.dylib" %> buildDynamicLib [(soMutex, 1)] root "dylib"
root -/- "**/libHS*-*.so" %> buildDynamicLib [(soMutex, 1)] root "so"
root -/- "**/libHS*-*.dll" %> buildDynamicLib [(soMutex, 1)] root "dll"
root -/- "**/*.a" %> buildStaticLib root
root -/- "**/stamp-*" %> buildPackage root
priority 2 $ do
......@@ -85,14 +86,14 @@ registerDynamicLib root suffix dynlibpath = do
-- | Build a dynamic library ('LibDyn') under the given build root, with the
-- given suffix (@.so@ or @.dylib@, @.dll@), where the complete path of the
-- archive to build is given as the third argument.
buildDynamicLib :: FilePath -> String -> FilePath -> Action ()
buildDynamicLib root suffix dynlibpath = do
buildDynamicLib :: [(Resource, Int)] -> FilePath -> String -> FilePath -> Action ()
buildDynamicLib rs root suffix dynlibpath = do
dynlib <- parsePath (parseBuildLibDyn root suffix) "<dyn lib parser>" dynlibpath
let context = libDynContext dynlib
deps <- contextDependencies context
registerPackages deps
objs <- libraryObjects context
build $ target context (Ghc LinkHs $ Context.stage context) objs [dynlibpath]
buildWithResources rs $ target context (Ghc LinkHs $ Context.stage context) objs [dynlibpath]
-- | Build a "GHCi library" ('LibGhci') under the given build root, with the
-- complete path of the file to build is given as the second argument.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment