diff options
author | Sylvain Henry <sylvain@haskus.fr> | 2020-02-27 12:59:02 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-03-02 17:14:38 -0500 |
commit | 2a2f51d79f145e015cc089d97cf71c19dd27bee4 (patch) | |
tree | 24e6859abf947bc2e08072282a27539f0697b2ad | |
parent | 7c0c76fb1a11532076a0342655a9c889a2a12768 (diff) | |
download | haskell-2a2f51d79f145e015cc089d97cf71c19dd27bee4.tar.gz |
Use configure script to detect that we should use in-tree GMP on Windows
-rw-r--r-- | configure.ac | 7 | ||||
-rw-r--r-- | hadrian/src/Rules/Gmp.hs | 6 | ||||
-rw-r--r-- | hadrian/src/Settings/Packages.hs | 7 | ||||
-rw-r--r-- | libraries/integer-gmp/gmp/ghc.mk | 6 |
4 files changed, 11 insertions, 15 deletions
diff --git a/configure.ac b/configure.ac index 7785884296..fcc0a75ca6 100644 --- a/configure.ac +++ b/configure.ac @@ -458,6 +458,12 @@ FP_ICONV FP_GMP FP_CURSES +dnl On Windows we force in-tree GMP build until we support dynamic linking +if test "$HostOS" = "mingw32" +then + GMP_FORCE_INTREE="YES" +fi + XCODE_VERSION() @@ -1453,6 +1459,7 @@ echo "\ Building a cross compiler : $CrossCompiling Unregisterised : $Unregisterised TablesNextToCode : $TablesNextToCode + Build GMP in tree : $GMP_FORCE_INTREE hs-cpp : $HaskellCPPCmd hs-cpp-flags : $HaskellCPPArgs ar : $ArCmd diff --git a/hadrian/src/Rules/Gmp.hs b/hadrian/src/Rules/Gmp.hs index 2bf41d99e2..405c251b8b 100644 --- a/hadrian/src/Rules/Gmp.hs +++ b/hadrian/src/Rules/Gmp.hs @@ -66,14 +66,14 @@ gmpRules = do isInTree <- flag GmpInTree - if windowsHost || isInTree -- TODO: We don't use system GMP on Windows. Fix? + if isInTree then do - putBuild "| No GMP library/framework detected; in tree GMP will be built" + putBuild "| In tree GMP will be built" let intreeHeader = stageP -/- "gmp/gmp.h" need [intreeHeader] copyFile intreeHeader header else do - putBuild "| GMP library/framework detected and will be used" + putBuild "| System GMP library/framework will be used" copyFile (gmpBase -/- "ghc-gmp.h") header -- Build in-tree GMP library for the current stage, prioritised so that it diff --git a/hadrian/src/Settings/Packages.hs b/hadrian/src/Settings/Packages.hs index 02f483cc53..d06d4292dd 100644 --- a/hadrian/src/Settings/Packages.hs +++ b/hadrian/src/Settings/Packages.hs @@ -176,14 +176,9 @@ gmpPackageArgs = do 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 - mconcat [ builder (Cabal Setup) ? mconcat - [ inTree ? arg "--configure-option=--with-intree-gmp" + [ flag GmpInTree ? arg "--configure-option=--with-intree-gmp" , flag GmpFrameworkPref ? arg "--configure-option=--with-gmp-framework-preferred" diff --git a/libraries/integer-gmp/gmp/ghc.mk b/libraries/integer-gmp/gmp/ghc.mk index c9dd69953b..4272e86924 100644 --- a/libraries/integer-gmp/gmp/ghc.mk +++ b/libraries/integer-gmp/gmp/ghc.mk @@ -39,12 +39,6 @@ clean_gmp: $(call removeTrees,libraries/integer-gmp/gmp/gmpbuild) endif -ifeq "$(Windows_Host)" "YES" -# Apparently building on Windows fails when there is a system gmp -# available, so we never try to use the system gmp on Windows -libraries/integer-gmp_CONFIGURE_OPTS += --configure-option=--with-intree-gmp -endif - ifeq "$(GMP_PREFER_FRAMEWORK)" "YES" libraries/integer-gmp_CONFIGURE_OPTS += --with-gmp-framework-preferred endif |