Read build.mk from files at build time
This commit is contained in:
parent
8c72bf697e
commit
c54dc05d92
29
lib/GHCup.hs
29
lib/GHCup.hs
@ -65,9 +65,10 @@ import Data.Time.Format.ISO8601
|
|||||||
import Data.Versions
|
import Data.Versions
|
||||||
import GHC.IO.Exception
|
import GHC.IO.Exception
|
||||||
import Haskus.Utils.Variant.Excepts
|
import Haskus.Utils.Variant.Excepts
|
||||||
|
import Language.Haskell.TH
|
||||||
|
import Language.Haskell.TH.Syntax ( Quasi(qAddDependentFile) )
|
||||||
import Optics
|
import Optics
|
||||||
import Prelude hiding ( abs
|
import Prelude hiding ( abs
|
||||||
, readFile
|
|
||||||
, writeFile
|
, writeFile
|
||||||
)
|
)
|
||||||
import Safe hiding ( at )
|
import Safe hiding ( at )
|
||||||
@ -1922,26 +1923,12 @@ compileGHC targetGhc ov bstrap jobs mbuildConfig patchdir aargs buildFlavour had
|
|||||||
pure tver
|
pure tver
|
||||||
|
|
||||||
where
|
where
|
||||||
defaultConf = case targetGhc of
|
defaultConf =
|
||||||
Left (GHCTargetVersion (Just _) _) -> [s|
|
let cross_mk = $(LitE . StringL <$> (qAddDependentFile "data/build_mk/cross" >> runIO (readFile "data/build_mk/default")))
|
||||||
V=0
|
default_mk = $(LitE . StringL <$> (qAddDependentFile "data/build_mk/default" >> runIO (readFile "data/build_mk/default")))
|
||||||
BUILD_MAN = NO
|
in case targetGhc of
|
||||||
BUILD_SPHINX_HTML = NO
|
Left (GHCTargetVersion (Just _) _) -> cross_mk
|
||||||
BUILD_SPHINX_PDF = NO
|
_ -> default_mk
|
||||||
HADDOCK_DOCS = NO
|
|
||||||
ifneq "$(BuildFlavour)" ""
|
|
||||||
include mk/flavours/$(BuildFlavour).mk
|
|
||||||
endif
|
|
||||||
Stage1Only = YES|]
|
|
||||||
_ -> [s|
|
|
||||||
V=0
|
|
||||||
BUILD_MAN = NO
|
|
||||||
BUILD_SPHINX_HTML = NO
|
|
||||||
BUILD_SPHINX_PDF = NO
|
|
||||||
HADDOCK_DOCS = YES
|
|
||||||
ifneq "$(BuildFlavour)" ""
|
|
||||||
include mk/flavours/$(BuildFlavour).mk
|
|
||||||
endif|]
|
|
||||||
|
|
||||||
compileHadrianBindist :: ( MonadReader env m
|
compileHadrianBindist :: ( MonadReader env m
|
||||||
, HasDirs env
|
, HasDirs env
|
||||||
|
Loading…
Reference in New Issue
Block a user