Commit 6f2b78bb authored by Andrey Mokhov's avatar Andrey Mokhov
Browse files

Build genprimopcode utility.

parent e99bd28a
module GHC (
array, base, binPackageDb, binary, bytestring, cabal, compiler, containers,
compareSizes, deepseq, deriveConstants, directory, dllSplit, filepath,
genapply, ghc, ghcCabal, ghcPkg, ghcPrim,
genapply, genprimopcode, ghc, ghcCabal, ghcPkg, ghcPrim,
ghcPwd, ghcTags, haddock, haskeline, hsc2hs, hoopl, hpc, hpcBin, integerGmp, integerSimple,
mkUserGuidePart, parallel, pretty,
primitive, process, runghc, stm, templateHaskell, terminfo, time, transformers,
......@@ -23,7 +23,7 @@ defaultKnownPackages :: [Package]
defaultKnownPackages =
[ array, base, binPackageDb, binary, bytestring, cabal, compiler
, containers, compareSizes, deepseq, deriveConstants, directory, dllSplit
, filepath, genapply, ghc, ghcCabal, ghcPkg, ghcPrim
, filepath, genapply, genprimopcode, ghc, ghcCabal, ghcPkg, ghcPrim
, ghcPwd, ghcTags, haddock, haskeline, hsc2hs, hoopl, hpc, hpcBin, integerGmp, integerSimple
, mkUserGuidePart, parallel, pretty, primitive, process, runghc, stm, templateHaskell, terminfo
, time, transformers, unix, win32, xhtml ]
......@@ -31,7 +31,7 @@ defaultKnownPackages =
-- Package definitions
array, base, binPackageDb, binary, bytestring, cabal, compiler, containers,
compareSizes, deepseq, deriveConstants, directory, dllSplit, filepath,
genapply, ghc, ghcCabal, ghcPkg, ghcPrim, ghcPwd,
genapply, genprimopcode, ghc, ghcCabal, ghcPkg, ghcPrim, ghcPwd,
ghcTags, haddock, haskeline, hsc2hs, hoopl, hpc, hpcBin, integerGmp, integerSimple,
mkUserGuidePart, parallel, pretty,
primitive, process, runghc, stm, templateHaskell, terminfo, time, transformers,
......@@ -52,6 +52,7 @@ directory = library "directory"
dllSplit = utility "dll-split"
filepath = library "filepath"
genapply = utility "genapply"
genprimopcode = utility "genprimopcode"
ghc = topLevel "ghc-bin" `setPath` "ghc"
ghcCabal = utility "ghc-cabal"
ghcPkg = utility "ghc-pkg"
......@@ -81,7 +82,7 @@ unix = library "unix"
win32 = library "Win32"
xhtml = library "xhtml"
-- TODO: genprimocode, hp2ps
-- TODO: hp2ps
-- TODO: The following utils are not included into the build system because
-- they seem to be unused or unrelated to the build process: chechUniques,
......@@ -110,6 +111,7 @@ defaultProgramPath stage pkg
| pkg == deriveConstants = program $ pkgName pkg
| pkg == dllSplit = program $ pkgName pkg
| pkg == genapply = program $ pkgName pkg
| pkg == genprimopcode = program $ pkgName pkg
| pkg == ghc = program $ "ghc-stage" ++ show (fromEnum stage + 1)
| pkg == ghcCabal = program $ pkgName pkg
| pkg == ghcPkg = program $ pkgName pkg
......
module Rules.Data (buildPackageData) where
import Expression
import GHC (deriveConstants, genapply)
import GHC (deriveConstants, genapply, genprimopcode)
import Oracles
import Predicates (registerPackage)
import Rules.Actions
......@@ -70,6 +70,16 @@ buildPackageData rs target @ (PartialTarget stage pkg) = do
, "utils_genapply_dist-boot_HC_OPTS = " ++ hcOpts ]
writeFileChanged mk contents
priority 2.0 $
when (pkg == genprimopcode) $ path -/- "package-data.mk" %> \mk -> do
let contents = unlines
[ "utils_genprimopcode_dist-boot_MODULES = Lexer Main ParserM Parser Syntax"
, "utils_genprimopcode_dist-boot_PROGNAME = genprimopcode"
, "utils_genprimopcode_dist-boot_HS_SRC_DIRS = ."
, "utils_genprimopcode_dist-boot_INSTALL_INPLACE = YES"
, "utils_genprimopcode_dist-boot_HC_OPTS = -package array" ]
writeFileChanged mk contents
-- Prepare a given 'packaga-data.mk' file for parsing by readConfigFile:
-- 1) Drop lines containing '$'
-- For example, get rid of
......
......@@ -96,7 +96,7 @@ packageGhcArgs = do
pkgKey <- getPkgData PackageKey
pkgDepIds <- getPkgDataList DepIds
mconcat
[ not (pkg == deriveConstants || pkg == genapply) ?
[ not (pkg == deriveConstants || pkg == genapply || pkg == genprimopcode) ?
arg "-hide-all-packages"
, arg "-no-user-package-db"
, stage0 ? arg "-package-db libraries/bootstrapping.conf"
......@@ -122,7 +122,7 @@ includeGhcArgs = do
, arg $ "-I" ++ autogenPath
, append [ "-i" ++ pkgPath pkg -/- dir | dir <- srcDirs ]
, append [ "-I" ++ pkgPath pkg -/- dir | dir <- incDirs ]
, not (pkg == deriveConstants || pkg == genapply) ?
, not (pkg == deriveConstants || pkg == genapply || pkg == genprimopcode) ?
append [ "-optP-include"
, "-optP" ++ autogenPath -/- "cabal_macros.h" ] ]
......
......@@ -9,6 +9,7 @@ getPackages :: Expr [Package]
getPackages = fromDiffExpr $ defaultPackages <> userPackages
-- These are the packages we build by default
-- TODO: simplify
defaultPackages :: Packages
defaultPackages = mconcat
[ stage0 ? packagesStage0
......@@ -19,7 +20,7 @@ packagesStage0 :: Packages
packagesStage0 = mconcat
[ append [ binPackageDb, binary, cabal, compiler, ghc, ghcCabal, ghcPkg
, hsc2hs, hoopl, hpc, templateHaskell, transformers ]
, stage0 ? append [deriveConstants, genapply] -- TODO: simplify
, stage0 ? append [deriveConstants, genapply, genprimopcode]
, notM windowsHost ? notM (anyHostOs ["ios"]) ? append [terminfo] ]
-- TODO: what do we do with parallel, stm, random, primitive, vector and dph?
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment