Show output of boot and configure.
[ghc.git] / src / Rules / Configure.hs
1 module Rules.Configure (configureRules) where
2
3 import qualified System.Info as System
4
5 import Base
6 import Builder
7 import CmdLineFlag (cmdSkipConfigure)
8 import Context
9 import GHC (compiler)
10 import Rules.Actions
11 import Rules.Generators.GhcAutoconfH
12 import Stage
13 import Target
14
15 configureRules :: Rules ()
16 configureRules = do
17 [configFile, "settings", configH] &%> \outs -> do
18 if cmdSkipConfigure
19 then unlessM (doesFileExist configFile) $
20 putError $ "Configuration file " ++ configFile ++ " is missing."
21 ++ "\nRun the configure script manually or do not use the "
22 ++ "--skip-configure flag."
23 else do
24 -- We cannot use windowsHost here due to a cyclic dependency.
25 when (System.os == "mingw32") $ do
26 putBuild "| Checking for Windows tarballs..."
27 quietly $ cmd ["bash mk/get-win32-tarballs.sh download", System.arch]
28 let srcs = map (<.> "in") outs
29 context = vanillaContext Stage0 compiler
30 need srcs
31 build $ Target context (Configure ".") srcs outs
32
33 ["configure", configH <.> "in"] &%> \_ -> do
34 if cmdSkipConfigure
35 then unlessM (doesFileExist "configure") $
36 putError $ "The configure script is missing.\nRun the boot script"
37 ++ " manually or do not use the --skip-configure flag."
38 else do
39 need ["configure.ac"]
40 putBuild "| Running boot..."
41 quietly $ cmd "perl boot"