[commit: ghc] wip/nfs-locking: do not pass --with-intree-gmp to configure when system gmp is used (dc8dbcc)

git at git.haskell.org git at git.haskell.org
Fri Oct 27 00:12:42 UTC 2017


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

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

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

commit dc8dbcc5a9c621a3eb4fb99b0e7d24b2e1a5a967
Author: Karel Gardas <karel.gardas at centrum.cz>
Date:   Tue Jan 19 21:42:08 2016 +0100

    do not pass --with-intree-gmp to configure when system gmp is used


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

dc8dbcc5a9c621a3eb4fb99b0e7d24b2e1a5a967
 src/Settings/Packages/IntegerGmp.hs | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)

diff --git a/src/Settings/Packages/IntegerGmp.hs b/src/Settings/Packages/IntegerGmp.hs
index 7122457..fbb7101 100644
--- a/src/Settings/Packages/IntegerGmp.hs
+++ b/src/Settings/Packages/IntegerGmp.hs
@@ -4,7 +4,9 @@ import Base
 import Expression
 import GHC (integerGmp)
 import Predicates (builder, builderGcc, package)
+import Settings.Builders.Common
 import Settings.Paths
+import Oracles.Config.Setting
 
 -- TODO: move build artefacts to buildRootPath, see #113
 -- TODO: Is this needed?
@@ -14,11 +16,17 @@ import Settings.Paths
 integerGmpPackageArgs :: Args
 integerGmpPackageArgs = package integerGmp ? do
     let includeGmp = "-I" ++ gmpBuildPath -/- "include"
+    gmp_includedir <- getSetting GmpIncludeDir
+    gmp_libdir <- getSetting GmpLibDir
+    let gmp_args = if (gmp_includedir == "" && gmp_libdir == "")
+                   then
+                   [ arg "--configure-option=--with-intree-gmp" ]
+                   else
+                   []
+
     mconcat [ builder GhcCabal ? mconcat
-              [ arg "--configure-option=--with-intree-gmp"
-              , appendSub "--configure-option=CFLAGS" [includeGmp]
-              , appendSub "--gcc-options"             [includeGmp] ]
+              (gmp_args ++
+               [ appendSub "--configure-option=CFLAGS" [includeGmp]
+               , appendSub "--gcc-options"             [includeGmp] ] )
 
             , builderGcc ? arg includeGmp ]
-  where
-



More information about the ghc-commits mailing list