Major refactoring of path settings
[hadrian.git] / src / Settings / Builders / Configure.hs
1 module Settings.Builders.Configure (configureBuilderArgs) where
2
3 import Rules.Gmp
4 import Rules.Libffi
5 import Settings.Builders.Common
6
7 configureBuilderArgs :: Args
8 configureBuilderArgs = do
9 gmpPath <- expr gmpBuildPath
10 libffiPath <- expr libffiBuildPath
11 mconcat [ builder (Configure gmpPath) ? do
12 hostPlatform <- getSetting HostPlatform
13 buildPlatform <- getSetting BuildPlatform
14 pure [ "--enable-shared=no"
15 , "--host=" ++ hostPlatform
16 , "--build=" ++ buildPlatform ]
17
18 , builder (Configure libffiPath) ? do
19 top <- expr topDirectory
20 targetPlatform <- getSetting TargetPlatform
21 pure [ "--prefix=" ++ top -/- libffiPath -/- "inst"
22 , "--libdir=" ++ top -/- libffiPath -/- "inst/lib"
23 , "--enable-static=yes"
24 , "--enable-shared=no" -- TODO: add support for yes
25 , "--host=" ++ targetPlatform ] ]