Configure.hs 1.47 KB
Newer Older
1
2
module Rules.Configure (configureRules) where

3
import qualified System.Info as System
4
5
6

import Base
import Builder
7
import CmdLineFlag
8
import Context
9
import GHC
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import Rules.Actions
import Rules.Generators.GhcAutoconfH
import Stage
import Target

configureRules :: Rules ()
configureRules = do
    [configFile, "settings", configH] &%> \outs -> do
        if cmdSkipConfigure
        then unlessM (doesFileExist configFile) $
            putError $ "Configuration file " ++ configFile ++ " is missing."
                ++ "\nRun the configure script manually or do not use the "
                ++ "--skip-configure flag."
        else do
            -- 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
29
30
31
32
33
34
35
36
37
38
39
40
            let srcs    = map (<.> "in") outs
                context = vanillaContext Stage0 compiler
            need srcs
            build $ Target context (Configure ".") srcs outs

    ["configure", configH <.> "in"] &%> \_ -> do
        if cmdSkipConfigure
        then unlessM (doesFileExist "configure") $
            putError $ "The configure script is missing.\nRun the boot script"
                ++ " manually or do not use the --skip-configure flag."
        else do
            need ["configure.ac"]
            putBuild "| Running boot..."
41
            quietly $ cmd "perl boot"