Use nm-classic instead of nm when host is Darwin
[ghc.git] / src / Settings / Builders / Configure.hs
1 module Settings.Builders.Configure (configureBuilderArgs) where
2
3 import qualified System.Info as System
4
5 import Base
6 import Oracles.Config.Setting
7 import Oracles.WindowsPath
8 import Predicate
9 import Settings.Paths
10
11 configureBuilderArgs :: Args
12 configureBuilderArgs = mconcat
13 [ builder (Configure gmpBuildPath) ? do
14 hostPlatform <- getSetting HostPlatform
15 buildPlatform <- getSetting BuildPlatform
16 append [ "--enable-shared=no"
17 , "--host=" ++ hostPlatform
18 , "--build=" ++ buildPlatform ]
19
20 , builder (Configure libffiBuildPath) ? do
21 top <- getTopDirectory
22 targetPlatform <- getSetting TargetPlatform
23 append [ "--prefix=" ++ top -/- libffiBuildPath -/- "inst"
24 , "--libdir=" ++ top -/- libffiBuildPath -/- "inst/lib"
25 , "--enable-static=yes"
26 , "--enable-shared=no" -- TODO: add support for yes
27 , "--host=" ++ targetPlatform ]
28
29 -- On OS X, use "nm-classic" instead of "nm" due to a bug in the later.
30 -- See https://ghc.haskell.org/trac/ghc/ticket/11744
31 , builder (Configure ".") ? System.os == "darwin" ?
32 arg "--with-nm=$(xcrun --find nm-classic)"
33 ]