Commit 2a2f51d7 authored by Sylvain Henry's avatar Sylvain Henry Committed by Marge Bot
Browse files

Use configure script to detect that we should use in-tree GMP on Windows

parent 7c0c76fb
......@@ -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
......
......@@ -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
......
......@@ -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"
......
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment