7469f3e748c8cfe5a86c032f85cf8c6761b9d878
[ghc.git] / src / Settings / Packages / IntegerGmp.hs
1 module Settings.Packages.IntegerGmp (integerGmpPackageArgs, gmpBuildPath) where
2
3 import Base
4 import Expression
5 import GHC
6 import Oracles.Config.Setting
7 import Predicates
8 import Settings.Paths
9
10 -- TODO: move build artefacts to buildRootPath, see #113
11 -- TODO: Is this needed?
12 -- ifeq "$(GMP_PREFER_FRAMEWORK)" "YES"
13 -- libraries/integer-gmp_CONFIGURE_OPTS += --with-gmp-framework-preferred
14 -- endif
15 integerGmpPackageArgs :: Args
16 integerGmpPackageArgs = package integerGmp ? do
17 let includeGmp = "-I" ++ gmpBuildPath -/- "include"
18 gmpIncludeDir <- getSetting GmpIncludeDir
19 gmpLibDir <- getSetting GmpLibDir
20
21 mconcat [ builder GhcCabal ? mconcat
22 [ (null gmpIncludeDir && null gmpLibDir) ?
23 arg "--configure-option=--with-intree-gmp"
24 , appendSub "--configure-option=CFLAGS" [includeGmp]
25 , appendSub "--gcc-options" [includeGmp] ]
26
27 , builder Cc ? arg includeGmp ]