summaryrefslogtreecommitdiff
path: root/hadrian
diff options
context:
space:
mode:
authorSylvain Henry <sylvain@haskus.fr>2021-11-09 16:41:05 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-11-10 18:20:17 -0500
commit8c0aec38c129ca58c270f687e009a1c457fd0a10 (patch)
treea0b0b19583e8dd262ef2e6e05795aefd1a543ba9 /hadrian
parent1540f556a4501056056eec7d45d3c9246e8213d9 (diff)
downloadhaskell-8c0aec38c129ca58c270f687e009a1c457fd0a10.tar.gz
Hadrian: fix building/registering of .dll libraries
Diffstat (limited to 'hadrian')
-rw-r--r--hadrian/src/Rules/Library.hs29
1 files changed, 15 insertions, 14 deletions
diff --git a/hadrian/src/Rules/Library.hs b/hadrian/src/Rules/Library.hs
index c67346f5d6..bb502f9875 100644
--- a/hadrian/src/Rules/Library.hs
+++ b/hadrian/src/Rules/Library.hs
@@ -21,12 +21,14 @@ import Utilities
libraryRules :: Rules ()
libraryRules = do
root <- buildRootRules
- root -/- "**/libHS*-*.dylib" %> buildDynamicLibUnix root "dylib"
- root -/- "**/libHS*-*.so" %> buildDynamicLibUnix root "so"
- root -/- "**/*.a" %> buildStaticLib root
+ root -/- "**/libHS*-*.dylib" %> buildDynamicLib root "dylib"
+ root -/- "**/libHS*-*.so" %> buildDynamicLib root "so"
+ root -/- "**/libHS*-*.dll" %> buildDynamicLib root "dll"
+ root -/- "**/*.a" %> buildStaticLib root
priority 2 $ do
- root -/- "stage*/lib/**/libHS*-*.dylib" %> registerDynamicLibUnix root "dylib"
- root -/- "stage*/lib/**/libHS*-*.so" %> registerDynamicLibUnix root "so"
+ root -/- "stage*/lib/**/libHS*-*.dylib" %> registerDynamicLib root "dylib"
+ root -/- "stage*/lib/**/libHS*-*.so" %> registerDynamicLib root "so"
+ root -/- "stage*/lib/**/libHS*-*.dll" %> registerDynamicLib root "dll"
root -/- "stage*/lib/**/*.a" %> registerStaticLib root
root -/- "**/HS*-*.o" %> buildGhciLibO root
root -/- "**/HS*-*.p_o" %> buildGhciLibO root
@@ -64,11 +66,10 @@ buildStaticLib root archivePath = do
archivePath synopsis
-- | Register (with ghc-pkg) a dynamic library ('LibDyn') under the given build
--- root, with the given suffix (@.so@ or @.dylib@, @.dll@ in the future), where
--- the complete path of the registered dynamic library is given as the third
--- argument.
-registerDynamicLibUnix :: FilePath -> String -> FilePath -> Action ()
-registerDynamicLibUnix root suffix dynlibpath = do
+-- root, with the given suffix (@.so@ or @.dylib@, @.dll@), where the complete
+-- path of the registered dynamic library is given as the third argument.
+registerDynamicLib :: FilePath -> String -> FilePath -> Action ()
+registerDynamicLib root suffix dynlibpath = do
-- Simply need the ghc-pkg database .conf file.
(GhcPkgPath _ stage _ (LibDyn name version _ _))
<- parsePath (parseGhcPkgLibDyn root suffix)
@@ -79,10 +80,10 @@ registerDynamicLibUnix root suffix dynlibpath = do
]
-- | Build a dynamic library ('LibDyn') under the given build root, with the
--- given suffix (@.so@ or @.dylib@, @.dll@ in the future), where the complete
--- path of the archive to build is given as the third argument.
-buildDynamicLibUnix :: FilePath -> String -> FilePath -> Action ()
-buildDynamicLibUnix root suffix dynlibpath = do
+-- 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
dynlib <- parsePath (parseBuildLibDyn root suffix) "<dyn lib parser>" dynlibpath
let context = libDynContext dynlib
deps <- contextDependencies context