Move gmp build results to buildRootPath.
[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.User
8
9 -- TODO: move elsewhere
10 gmpBuildPath :: FilePath
11 gmpBuildPath = buildRootPath -/- "stage0/gmp"
12
13 -- TODO: move build artefacts to buildRootPath, see #113
14 -- TODO: Is this needed?
15 -- ifeq "$(GMP_PREFER_FRAMEWORK)" "YES"
16 -- libraries/integer-gmp_CONFIGURE_OPTS += --with-gmp-framework-preferred
17 -- endif
18 integerGmpPackageArgs :: Args
19 integerGmpPackageArgs = package integerGmp ? do
20 let includeGmp = "-I" ++ gmpBuildPath -/- "include"
21 mconcat [ builder GhcCabal ? mconcat
22 [ arg "--configure-option=--with-intree-gmp"
23 , appendSub "--configure-option=CFLAGS" [includeGmp]
24 , appendSub "--gcc-options" [includeGmp] ]
25
26 , builderGcc ? arg includeGmp ]
27 where
28