[commit: ghc] wip/nfs-locking: Don't use system GMP on Windows. (ff0194b)

git at git.haskell.org git at git.haskell.org
Fri Oct 27 00:39:43 UTC 2017


Repository : ssh://git@git.haskell.org/ghc

On branch  : wip/nfs-locking
Link       : http://ghc.haskell.org/trac/ghc/changeset/ff0194b7a49cd554065fc68e209e1188be133bff/ghc

>---------------------------------------------------------------

commit ff0194b7a49cd554065fc68e209e1188be133bff
Author: Andrey Mokhov <andrey.mokhov at gmail.com>
Date:   Thu Jan 14 13:22:16 2016 +0000

    Don't use system GMP on Windows.
    
    See #168.


>---------------------------------------------------------------

ff0194b7a49cd554065fc68e209e1188be133bff
 src/Rules/Gmp.hs     | 6 ++++--
 src/Rules/Library.hs | 1 +
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/Rules/Gmp.hs b/src/Rules/Gmp.hs
index c788ed2..069dd28 100644
--- a/src/Rules/Gmp.hs
+++ b/src/Rules/Gmp.hs
@@ -117,9 +117,11 @@ gmpRules = do
         runConfigure (pkgPath integerGmp) envs intGmpArgs
 
         createDirectory $ takeDirectory gmpLibraryH
-        -- check whether we need to build in tree gmp
+        -- We don't use system GMP on Windows. TODO: fix?
+        windows  <- windowsHost
         configMk <- liftIO . readFile $ gmpBase -/- "config.mk"
-        if any (`isInfixOf` configMk) ["HaveFrameworkGMP = YES", "HaveLibGmp = YES"]
+        if not windows && any (`isInfixOf` configMk) [ "HaveFrameworkGMP = YES"
+                                                     , "HaveLibGmp = YES" ]
         then do
             putBuild "| GMP library/framework detected and will be used"
             copyFile gmpLibraryFakeH gmpLibraryH
diff --git a/src/Rules/Library.hs b/src/Rules/Library.hs
index 0ffaf3f..b53c472 100644
--- a/src/Rules/Library.hs
+++ b/src/Rules/Library.hs
@@ -84,6 +84,7 @@ extraObjects :: PartialTarget -> Action [FilePath]
 extraObjects (PartialTarget _ pkg)
     | pkg == integerGmp = do
         orderOnly [gmpLibraryH] -- TODO: move this dependency elsewhere, #113?
+        -- FIXME: simplify after Shake's getDirectoryFiles bug is fixed, #168
         exists <- doesDirectoryExist gmpObjects
         if exists
         then getDirectoryFiles "" [gmpObjects -/- "*.o"]



More information about the ghc-commits mailing list