Configure.hs 1.02 KB
Newer Older
Andrey Mokhov's avatar
Andrey Mokhov committed
1
module Settings.Builders.Configure (configureBuilderArgs) where
Andrey Mokhov's avatar
Andrey Mokhov committed
2

3
import GHC
4
import Rules.Gmp
5
import Settings.Builders.Common
Andrey Mokhov's avatar
Andrey Mokhov committed
6

Andrey Mokhov's avatar
Andrey Mokhov committed
7
configureBuilderArgs :: Args
8 9 10 11 12 13 14 15 16
configureBuilderArgs = do
    gmpPath    <- expr gmpBuildPath
    libffiPath <- expr libffiBuildPath
    mconcat [ builder (Configure gmpPath) ? do
                hostPlatform  <- getSetting HostPlatform
                buildPlatform <- getSetting BuildPlatform
                pure [ "--enable-shared=no"
                     , "--host=" ++ hostPlatform
                     , "--build=" ++ buildPlatform ]
Andrey Mokhov's avatar
Andrey Mokhov committed
17

18 19 20 21 22 23 24 25
            , builder (Configure libffiPath) ? do
                top            <- expr topDirectory
                targetPlatform <- getSetting TargetPlatform
                pure [ "--prefix=" ++ top -/- libffiPath -/- "inst"
                     , "--libdir=" ++ top -/- libffiPath -/- "inst/lib"
                     , "--enable-static=yes"
                     , "--enable-shared=no" -- TODO: add support for yes
                     , "--host=" ++ targetPlatform ] ]