Move GMP build to Stage1.
[hadrian.git] / src / Settings / Packages / IntegerGmp.hs
1 module Settings.Packages.IntegerGmp (integerGmpPackageArgs, gmpBuildPath) where
2
3 import Base
4 import Expression
5 import GHC (integerGmp)
6 import Predicates (builder, builderGcc, package)
7 import Settings.Paths
8 import Oracles.Config.Setting
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 , builderGcc ? arg includeGmp ]