diff options
author | Ben Gamari <ben@smart-cactus.org> | 2020-02-17 16:55:59 -0500 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2020-02-27 13:45:59 -0500 |
commit | 439d459c96aaeff16eb31ea469b0218f2d1aa992 (patch) | |
tree | f871e2bd5a6cd52cae4a417e9a1e009e6c7f7378 | |
parent | 8114d4dc00b537b71c274ac8ede32a8221ebe7b5 (diff) | |
download | haskell-439d459c96aaeff16eb31ea469b0218f2d1aa992.tar.gz |
hadrian: Tell Cabal about integer-gmp library location
(cherry picked from commit 09b8838422d5dde32af7b09c8adcb4dff4cd00fb)
-rw-r--r-- | hadrian/src/Settings/Packages.hs | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/hadrian/src/Settings/Packages.hs b/hadrian/src/Settings/Packages.hs index bbd5217cf9..aafd8714ff 100644 --- a/hadrian/src/Settings/Packages.hs +++ b/hadrian/src/Settings/Packages.hs @@ -171,14 +171,27 @@ packageArgs = do gmpPackageArgs :: Args gmpPackageArgs = do + -- These are only used for non-in-tree builds. + librariesGmp <- getSetting GmpLibDir + includesGmp <- getSetting GmpIncludeDir + + -- Windows is always built with inplace GMP until we have dynamic + -- linking working. + inTreeFlag <- getFlag GmpInTree + let inTree = inTreeFlag || windowsHost + package integerGmp ? mconcat [ builder (Cabal Setup) ? mconcat - [ flag GmpInTree ? arg "--configure-option=--with-intree-gmp" - -- Windows is always built with inplace GMP until we have dynamic - -- linking working. - , windowsHost ? arg "--configure-option=--with-intree-gmp" + [ inTree ? arg "--configure-option=--with-intree-gmp" , flag GmpFrameworkPref ? arg "--configure-option=--with-gmp-framework-preferred" + + -- Ensure that the integer-gmp package registration includes + -- knowledge of the system gmp's library and include directories. + , notM (flag GmpInTree) ? mconcat + [ if not (null librariesGmp) then arg ("--extra-lib-dirs=" ++ librariesGmp) else mempty + , if not (null includesGmp) then arg ("--extra-include-dirs=" ++ includesGmp) else mempty + ] ] ] |