Commit 0d7891b4 authored by Andrey Mokhov's avatar Andrey Mokhov
Browse files

Drop redundant 'build' component in build paths, rename contextPath to buildPath.

parent d8a249b4
......@@ -44,9 +44,9 @@ findGenerator Context {..} file = do
-- | Find all Haskell source files for a given 'Context'.
haskellSources :: Context -> Action [FilePath]
haskellSources context = do
let autogen = contextPath context -/- "build/autogen"
-- Generated source files live in build/ and have extension "hs", except
-- that GHC/Prim.hs lives in build/autogen/. TODO: fix the inconsistency?
let autogen = buildPath context -/- "autogen"
-- Generated source files live in buildPath and have extension "hs", except
-- for GHC/Prim.hs that lives in autogen. TODO: fix the inconsistency?
let modFile ("GHC.Prim", _) = autogen -/- "GHC/Prim.hs"
modFile (m, Nothing ) = generatedFile context m
modFile (m, Just file )
......@@ -56,12 +56,11 @@ haskellSources context = do
generatedFile :: Context -> String -> FilePath
generatedFile context moduleName =
contextPath context -/- "build" -/- replaceEq '.' '/' moduleName <.> "hs"
buildPath context -/- replaceEq '.' '/' moduleName <.> "hs"
contextFiles :: Context -> Action [(String, Maybe FilePath)]
contextFiles context@Context {..} = do
let path = contextPath context
modules <- fmap sort . pkgDataList $ Modules path
modules <- fmap sort . pkgDataList . Modules $ buildPath context
zip modules <$> askOracle (ModuleFilesKey (stage, package))
-- | This is an important oracle whose role is to find and cache module source
......@@ -78,11 +77,10 @@ contextFiles context@Context {..} = do
moduleFilesOracle :: Rules ()
moduleFilesOracle = void $ do
void $ addOracle $ \(ModuleFilesKey (stage, package)) -> do
let path = contextPath $ vanillaContext stage package
autogen = path -/- "build/autogen"
let path = buildPath $ vanillaContext stage package
srcDirs <- pkgDataList $ SrcDirs path
modules <- fmap sort . pkgDataList $ Modules path
let dirs = autogen : map (pkgPath package -/-) srcDirs
let dirs = (path -/- "autogen") : map (pkgPath package -/-) srcDirs
modDirFiles = groupSort $ map decodeModule modules
result <- fmap concat . forM dirs $ \dir -> do
todo <- filterM (doesDirectoryExist . (dir -/-) . fst) modDirFiles
......
......@@ -10,27 +10,27 @@ import Target
compilePackage :: [(Resource, Int)] -> Context -> Rules ()
compilePackage rs context@Context {..} = do
let buildPath = contextPath context -/- "build"
let path = buildPath context
buildPath <//> "*" <.> hisuf way %> \hi ->
path <//> "*" <.> hisuf way %> \hi ->
if compileInterfaceFilesSeparately
then do
(src, deps) <- dependencies buildPath $ hi -<.> osuf way
(src, deps) <- dependencies path $ hi -<.> osuf way
need $ src : deps
buildWithResources rs $ Target context (Ghc stage) [src] [hi]
else need [ hi -<.> osuf way ]
buildPath <//> "*" <.> hibootsuf way %> \hiboot ->
path <//> "*" <.> hibootsuf way %> \hiboot ->
if compileInterfaceFilesSeparately
then do
(src, deps) <- dependencies buildPath $ hiboot -<.> obootsuf way
(src, deps) <- dependencies path $ hiboot -<.> obootsuf way
need $ src : deps
buildWithResources rs $ Target context (Ghc stage) [src] [hiboot]
else need [ hiboot -<.> obootsuf way ]
-- TODO: add dependencies for #include of .h and .hs-incl files (gcc -MM?)
buildPath <//> "*" <.> osuf way %> \obj -> do
(src, deps) <- dependencies buildPath obj
path <//> "*" <.> osuf way %> \obj -> do
(src, deps) <- dependencies path obj
if ("//*.c" ?== src)
then do
need $ src : deps
......@@ -42,8 +42,8 @@ compilePackage rs context@Context {..} = do
buildWithResources rs $ Target context (Ghc stage) [src] [obj]
-- TODO: get rid of these special cases
buildPath <//> "*" <.> obootsuf way %> \obj -> do
(src, deps) <- dependencies buildPath obj
path <//> "*" <.> obootsuf way %> \obj -> do
(src, deps) <- dependencies path obj
if compileInterfaceFilesSeparately
then need $ (obj -<.> hibootsuf way) : src : deps
else need $ src : deps
......
......@@ -45,12 +45,12 @@ buildPackageData context@Context {..} = do
-- TODO: get rid of this, see #113
liftIO $ IO.copyFile inTreeMk dataFile
autogenFiles <- getDirectoryFiles oldPath ["build/autogen/*"]
createDirectory $ contextPath context -/- "build/autogen"
autogenFiles <- getDirectoryFiles (oldPath -/- "build") ["autogen/*"]
createDirectory $ buildPath context -/- "autogen"
forM_ autogenFiles $ \file -> do
copyFile (oldPath -/- file) (contextPath context -/- file)
copyFile (oldPath -/- "build" -/- file) (buildPath context -/- file)
let haddockPrologue = "haddock-prologue.txt"
copyFile (oldPath -/- haddockPrologue) (contextPath context -/- haddockPrologue)
copyFile (oldPath -/- haddockPrologue) (buildPath context -/- haddockPrologue)
postProcessPackageData context dataFile
......@@ -59,7 +59,7 @@ buildPackageData context@Context {..} = do
when (package == hp2ps) $ dataFile %> \mk -> do
orderOnly $ generatedDependencies stage package
includes <- interpretInContext context $ fromDiffExpr includesArgs
let prefix = fixKey (contextPath context) ++ "_"
let prefix = fixKey (buildPath context) ++ "_"
cSrcs = [ "AreaBelow.c", "Curves.c", "Error.c", "Main.c"
, "Reorder.c", "TopTwenty.c", "AuxFile.c"
, "Deviation.c", "HpFile.c", "Marks.c", "Scale.c"
......@@ -75,7 +75,7 @@ buildPackageData context@Context {..} = do
when (package == unlit) $ dataFile %> \mk -> do
orderOnly $ generatedDependencies stage package
let prefix = fixKey (contextPath context) ++ "_"
let prefix = fixKey (buildPath context) ++ "_"
contents = unlines $ map (prefix++)
[ "PROGNAME = unlit"
, "C_SRCS = unlit.c"
......@@ -85,7 +85,7 @@ buildPackageData context@Context {..} = do
when (package == touchy) $ dataFile %> \mk -> do
orderOnly $ generatedDependencies stage package
let prefix = fixKey (contextPath context) ++ "_"
let prefix = fixKey (buildPath context) ++ "_"
contents = unlines $ map (prefix++)
[ "PROGNAME = touchy"
, "C_SRCS = touchy.c" ]
......@@ -97,7 +97,7 @@ buildPackageData context@Context {..} = do
-- by running by running `ghcCabal`, because it has not yet been built.
when (package == ghcCabal && stage == Stage0) $ dataFile %> \mk -> do
orderOnly $ generatedDependencies stage package
let prefix = fixKey (contextPath context) ++ "_"
let prefix = fixKey (buildPath context) ++ "_"
contents = unlines $ map (prefix++)
[ "PROGNAME = ghc-cabal"
, "MODULES = Main"
......@@ -110,7 +110,7 @@ buildPackageData context@Context {..} = do
dataFile %> \mk -> do
orderOnly $ generatedDependencies stage package
windows <- windowsHost
let prefix = fixKey (contextPath context) ++ "_"
let prefix = fixKey (buildPath context) ++ "_"
dirs = [ ".", "hooks", "sm", "eventlog" ]
++ [ "posix" | not windows ]
++ [ "win32" | windows ]
......
......@@ -14,16 +14,15 @@ import Target
-- TODO: simplify handling of AutoApply.cmm
buildPackageDependencies :: [(Resource, Int)] -> Context -> Rules ()
buildPackageDependencies rs context@Context {..} =
let path = contextPath context
buildPath = path -/- "build"
dropBuild = (pkgPath package ++) . drop (length buildPath)
hDepFile = buildPath -/- ".hs-dependencies"
let path = buildPath context
dropPath = (pkgPath package ++) . drop (length path)
hDepFile = path -/- ".hs-dependencies"
in do
fmap (buildPath ++)
fmap (path ++)
[ "//*.c.deps", "//*.cmm.deps", "//*.S.deps" ] |%> \out -> do
let srcFile = if "//AutoApply.*" ?== out
then dropExtension out
else dropBuild . dropExtension $ out
else dropPath . dropExtension $ out
need [srcFile]
build $ Target context (GccM stage) [srcFile] [out]
......@@ -36,9 +35,9 @@ buildPackageDependencies rs context@Context {..} =
removeFileIfExists $ out <.> "bak"
-- TODO: don't accumulate *.deps into .dependencies
buildPath -/- ".dependencies" %> \out -> do
path -/- ".dependencies" %> \out -> do
cSrcs <- pkgDataList $ CSrcs path
let cDepFiles = [ buildPath -/- src <.> "deps" | src <- cSrcs
let cDepFiles = [ path -/- src <.> "deps" | src <- cSrcs
, not ("//AutoApply.cmm" ?== src) ]
++ [ src <.> "deps" | src <- cSrcs, "//AutoApply.cmm" ?== src ]
......
......@@ -34,12 +34,10 @@ primopsSource :: FilePath
primopsSource = "compiler/prelude/primops.txt.pp"
primopsTxt :: Stage -> FilePath
primopsTxt stage =
contextPath (vanillaContext stage compiler) -/- "build/primops.txt"
primopsTxt stage = buildPath (vanillaContext stage compiler) -/- "primops.txt"
platformH :: Stage -> FilePath
platformH stage =
contextPath (vanillaContext stage compiler) -/- "ghc_boot_platform.h"
platformH stage = buildPath (vanillaContext stage compiler) -/- "ghc_boot_platform.h"
-- TODO: move generated files to buildRootPath, see #113
includesDependencies :: [FilePath]
......@@ -49,8 +47,7 @@ includesDependencies = ("includes" -/-) <$>
, "ghcversion.h" ]
ghcPrimDependencies :: Stage -> [FilePath]
ghcPrimDependencies stage =
((contextPath (vanillaContext stage ghcPrim) -/- "build") -/-) <$>
ghcPrimDependencies stage = (buildPath (vanillaContext stage ghcPrim) -/-) <$>
[ "autogen/GHC/Prim.hs"
, "GHC/PrimopWrappers.hs" ]
......@@ -71,7 +68,7 @@ compilerDependencies stage =
++ [ gmpLibraryH | stage > Stage0 ]
++ filter (const $ stage > Stage0) libffiDependencies
++ derivedConstantsDependencies
++ fmap ((contextPath (vanillaContext stage compiler) -/- "build") -/-)
++ fmap (buildPath (vanillaContext stage compiler) -/-)
[ "primop-can-fail.hs-incl"
, "primop-code-size.hs-incl"
, "primop-commutable.hs-incl"
......@@ -106,8 +103,8 @@ generate file context expr = do
generatePackageCode :: Context -> Rules ()
generatePackageCode context@(Context stage pkg _) =
let buildPath = contextPath context -/- "build"
generated f = (buildPath ++ "//*.hs") ?== f && not ("//autogen/*" ?== f)
let path = buildPath context
generated f = (path ++ "//*.hs") ?== f && not ("//autogen/*" ?== f)
file <~ gen = generate file context gen
in do
generated ?> \file -> do
......@@ -127,7 +124,7 @@ generatePackageCode context@(Context stage pkg _) =
build $ Target context HsCpp [primopsSource] [file]
-- TODO: why different folders for generated files?
fmap (buildPath -/-)
fmap (path -/-)
[ "autogen/GHC/Prim.hs"
, "GHC/PrimopWrappers.hs"
, "*.hs-incl" ] |%> \file -> do
......@@ -135,31 +132,31 @@ generatePackageCode context@(Context stage pkg _) =
build $ Target context GenPrimopCode [primopsTxt stage] [file]
-- TODO: this is temporary hack, get rid of this (#113)
let oldPath = pkgPath pkg -/- contextDirectory context -/- "build"
newFile = oldPath ++ (drop (length buildPath) file)
newFile = oldPath ++ (drop (length path) file)
createDirectory $ takeDirectory newFile
liftIO $ IO.copyFile file newFile
putSuccess $ "| Duplicate file " ++ file ++ " -> " ++ newFile
when (pkg == rts) $ buildPath -/- "AutoApply.cmm" %> \file -> do
when (pkg == rts) $ path -/- "AutoApply.cmm" %> \file -> do
build $ Target context GenApply [] [file]
priority 2.0 $ do
-- TODO: this is temporary hack, get rid of this (#113)
let oldPath = pkgPath pkg -/- contextDirectory context
olden f = oldPath ++ (drop (length (contextPath context)) f)
olden f = oldPath ++ (drop (length (buildPath context)) f)
when (pkg == compiler) $ buildPath -/- "Config.hs" %> \file -> do
when (pkg == compiler) $ path -/- "Config.hs" %> \file -> do
file <~ generateConfigHs
olden file <~ generateConfigHs -- TODO: get rid of this (#113)
when (pkg == compiler) $ platformH stage %> \file -> do
file <~ generateGhcBootPlatformH
when (pkg == ghcPkg) $ buildPath -/- "Version.hs" %> \file -> do
when (pkg == ghcPkg) $ path -/- "Version.hs" %> \file -> do
file <~ generateVersionHs
olden file <~ generateVersionHs -- TODO: get rid of this (#113)
when (pkg == runGhc) $ buildPath -/- "Main.hs" %> \file -> do
when (pkg == runGhc) $ path -/- "Main.hs" %> \file -> do
copyFileChanged (pkgPath pkg -/- "runghc.hs") file
putSuccess $ "| Successfully generated '" ++ file ++ "'."
......
......@@ -15,7 +15,7 @@ import Target
-- TODO: this should be moved elsewhere
rtsBuildPath :: FilePath
rtsBuildPath = contextPath rtsContext -/- "build"
rtsBuildPath = buildPath rtsContext
-- TODO: Why copy these include files into rts? Keep in libffi!
libffiDependencies :: [FilePath]
......
......@@ -17,8 +17,8 @@ import Target
buildPackageLibrary :: Context -> Rules ()
buildPackageLibrary context@Context {..} = do
let buildPath = contextPath context -/- "build"
libPrefix = buildPath -/- "libHS" ++ pkgNameString package
let path = buildPath context
libPrefix = path -/- "libHS" ++ pkgNameString package
-- TODO: handle dynamic libraries
matchVersionedFilePath libPrefix (waySuffix way <.> "a") ?> \a -> do
......@@ -27,10 +27,10 @@ buildPackageLibrary context@Context {..} = do
hSrcs <- hSources context
-- TODO: simplify handling of AutoApply.cmm, eliminate differences below
let cObjs = [ buildPath -/- src -<.> osuf way | src <- cSrcs
let cObjs = [ path -/- src -<.> osuf way | src <- cSrcs
, not ("//AutoApply.cmm" ?== src) ]
++ [ src -<.> osuf way | src <- cSrcs, "//AutoApply.cmm" ?== src ]
hObjs = [ buildPath -/- src <.> osuf way | src <- hSrcs ]
hObjs = [ path -/- src <.> osuf way | src <- hSrcs ]
-- This will create split objects if required (we don't track them
-- explicitly as this would needlessly bloat the Shake database).
......@@ -39,7 +39,7 @@ buildPackageLibrary context@Context {..} = do
split <- interpretInContext context splitObjects
splitObjs <- if not split then return hObjs else -- TODO: make clearer!
fmap concat $ forM hSrcs $ \src -> do
let splitPath = buildPath -/- src ++ "_" ++ osuf way ++ "_split"
let splitPath = path -/- src ++ "_" ++ osuf way ++ "_split"
contents <- liftIO $ IO.getDirectoryContents splitPath
return . map (splitPath -/-)
. filter (not . all (== '.')) $ contents
......@@ -61,17 +61,17 @@ buildPackageLibrary context@Context {..} = do
buildPackageGhciLibrary :: Context -> Rules ()
buildPackageGhciLibrary context@Context {..} = priority 2 $ do
let buildPath = contextPath context -/- "build"
libPrefix = buildPath -/- "HS" ++ pkgNameString package
let path = buildPath context
libPrefix = path -/- "HS" ++ pkgNameString package
-- TODO: simplify handling of AutoApply.cmm
matchVersionedFilePath libPrefix (waySuffix way <.> "o") ?> \obj -> do
cSrcs <- cSources context
hSrcs <- hSources context
let cObjs = [ buildPath -/- src -<.> "o" | src <- cSrcs
let cObjs = [ path -/- src -<.> "o" | src <- cSrcs
, not ("//AutoApply.cmm" ?== src) ]
++ [ src -<.> "o" | src <- cSrcs, "//AutoApply.cmm" ?== src ]
hObjs = [ buildPath -/- src <.> "o" | src <- hSrcs ]
hObjs = [ path -/- src <.> "o" | src <- hSrcs ]
need $ cObjs ++ hObjs
build $ Target context Ld (cObjs ++ hObjs) [obj]
......
......@@ -71,13 +71,13 @@ buildWrapper context@Context {..} wrapper wrapperPath binPath = do
-- TODO: Do we need to consider other ways when building programs?
buildBinary :: [(Resource, Int)] -> Context -> FilePath -> Action ()
buildBinary rs context@(Context stage package _) bin = do
let buildPath = contextPath context -/- "build"
let path = buildPath context
cSrcs <- cSources context -- TODO: remove code duplication (Library.hs)
hSrcs <- hSources context
let cObjs = [ buildPath -/- src -<.> osuf vanilla | src <- cSrcs ]
hObjs = [ buildPath -/- src <.> osuf vanilla | src <- hSrcs ]
++ [ buildPath -/- "Paths_hsc2hs.o" | package == hsc2hs ]
++ [ buildPath -/- "Paths_haddock.o" | package == haddock ]
let cObjs = [ path -/- src -<.> osuf vanilla | src <- cSrcs ]
hObjs = [ path -/- src <.> osuf vanilla | src <- hSrcs ]
++ [ path -/- "Paths_hsc2hs.o" | package == hsc2hs ]
++ [ path -/- "Paths_haddock.o" | package == haddock ]
objs = cObjs ++ hObjs
ways <- interpretInContext context getLibraryWays
depNames <- interpretInContext context $ getPkgDataList TransitiveDepNames
......
......@@ -21,12 +21,13 @@ registerPackage rs context@Context {..} = do
need [pkgDataFile context]
-- Post-process inplace-pkg-config. TODO: remove, see #113, #148
let pkgConfig = oldPath -/- "inplace-pkg-config"
fixPkgConf = unlines
. map (replace oldPath (contextPath context)
. replace (replaceSeparators '\\' $ oldPath)
(contextPath context) )
. lines
let pkgConfig = oldPath -/- "inplace-pkg-config"
oldBuildPath = oldPath -/- "build"
fixPkgConf = unlines
. map (replace oldBuildPath (buildPath context)
. replace (replaceSeparators '\\' $ oldBuildPath)
(buildPath context) )
. lines
fixFile pkgConfig fixPkgConf
......
......@@ -4,7 +4,7 @@ module Settings (
module Settings.User,
module Settings.Ways,
getPkgData, getPkgDataList, getTopDirectory, isLibrary,
getPackagePath, getContextDirectory, getContextPath
getPackagePath, getContextDirectory, getBuildPath
) where
import Base
......@@ -22,14 +22,14 @@ getPackagePath = pkgPath <$> getPackage
getContextDirectory :: Expr FilePath
getContextDirectory = contextDirectory <$> getContext
getContextPath :: Expr FilePath
getContextPath = contextPath <$> getContext
getBuildPath :: Expr FilePath
getBuildPath = buildPath <$> getContext
getPkgData :: (FilePath -> PackageData) -> Expr String
getPkgData key = lift . pkgData . key =<< getContextPath
getPkgData key = lift . pkgData . key =<< getBuildPath
getPkgDataList :: (FilePath -> PackageDataList) -> Expr [String]
getPkgDataList key = lift . pkgDataList . key =<< getContextPath
getPkgDataList key = lift . pkgDataList . key =<< getBuildPath
getTopDirectory :: Expr FilePath
getTopDirectory = lift topDirectory
......@@ -18,13 +18,12 @@ includesArgs = append $ map ("-I" ++) includes
cIncludeArgs :: Args
cIncludeArgs = do
context <- getContext
pkg <- getPackage
path <- getBuildPath
incDirs <- getPkgDataList IncludeDirs
depDirs <- getPkgDataList DepIncludeDirs
let buildPath = contextPath context -/- "build"
mconcat [ arg $ "-I" ++ buildPath
, arg $ "-I" ++ buildPath -/- "autogen"
mconcat [ arg $ "-I" ++ path
, arg $ "-I" ++ path -/- "autogen"
, append [ "-I" ++ pkgPath pkg -/- dir | dir <- incDirs ]
, append [ "-I" ++ dir | dir <- depDirs ] ]
......
......@@ -74,10 +74,9 @@ ghcMBuilderArgs = stagedBuilder GhcM ? do
commonGhcArgs :: Args
commonGhcArgs = do
way <- getWay
path <- getContextPath
path <- getBuildPath
hsArgs <- getPkgDataList HsArgs
cppArgs <- getPkgDataList CppArgs
let buildPath = path -/- "build"
mconcat [ arg "-hisuf", arg $ hisuf way
, arg "-osuf" , arg $ osuf way
, arg "-hcsuf", arg $ hcsuf way
......@@ -86,9 +85,9 @@ commonGhcArgs = do
, includeGhcArgs
, append hsArgs
, append $ map ("-optP" ++) cppArgs
, arg "-odir" , arg buildPath
, arg "-hidir" , arg buildPath
, arg "-stubdir" , arg buildPath
, arg "-odir" , arg path
, arg "-hidir" , arg path
, arg "-stubdir" , arg path
, arg "-rtsopts" ] -- TODO: ifeq "$(HC_VERSION_GE_6_13)" "YES"
-- TODO: do '-ticky' in all debug ways?
......@@ -126,17 +125,15 @@ packageGhcArgs = do
includeGhcArgs :: Args
includeGhcArgs = do
pkg <- getPackage
path <- getContextPath
path <- getBuildPath
srcDirs <- getPkgDataList SrcDirs
let buildPath = path -/- "build"
autogenPath = buildPath -/- "autogen"
mconcat [ arg "-i"
, arg $ "-i" ++ buildPath
, arg $ "-i" ++ autogenPath
, arg $ "-i" ++ path
, arg $ "-i" ++ path -/- "autogen"
, append [ "-i" ++ pkgPath pkg -/- dir | dir <- srcDirs ]
, cIncludeArgs
, arg "-optP-include"
, arg $ "-optP" ++ autogenPath -/- "cabal_macros.h" ]
, arg $ "-optP" ++ path -/- "autogen/cabal_macros.h" ]
-- # Options for passing to plain ld
-- $1_$2_$3_ALL_LD_OPTS = \
......
......@@ -14,13 +14,13 @@ haddockBuilderArgs :: Args
haddockBuilderArgs = builder Haddock ? do
output <- getOutput
pkg <- getPackage
path <- getContextPath
path <- getBuildPath
version <- getPkgData Version
synopsis <- getPkgData Synopsis
hidden <- getPkgDataList HiddenModules
deps <- getPkgDataList Deps
depNames <- getPkgDataList DepNames
hVersion <- lift . pkgData . Version $ contextPath (vanillaContext Stage2 haddock)
hVersion <- lift . pkgData . Version $ buildPath (vanillaContext Stage2 haddock)
ghcOpts <- fromDiffExpr commonGhcArgs
mconcat
[ arg $ "--odir=" ++ takeDirectory output
......
......@@ -13,7 +13,7 @@ hsCppBuilderArgs = builder HsCpp ? do
mconcat [ append =<< getSettingList HsCppArgs
, arg "-P"
, cppArgs
, arg $ "-I" ++ contextPath (vanillaContext stage compiler)
, arg $ "-I" ++ buildPath (vanillaContext stage compiler)
, arg "-x"
, arg "c"
, arg =<< getInput ]
......@@ -50,7 +50,7 @@ hsc2hsBuilderArgs = builder Hsc2Hs ? do
getCFlags :: Expr [String]
getCFlags = fromDiffExpr $ do
path <- getContextPath
path <- getBuildPath
cppArgs <- getPkgDataList CppArgs
depCcArgs <- getPkgDataList DepCcArgs
mconcat [ cArgs
......@@ -61,7 +61,7 @@ getCFlags = fromDiffExpr $ do
, append cppArgs
, append depCcArgs
, cWarnings
, arg "-include", arg $ path -/- "build/autogen/cabal_macros.h" ]
, arg "-include", arg $ path -/- "autogen/cabal_macros.h" ]
getLFlags :: Expr [String]
getLFlags = fromDiffExpr $ do
......
......@@ -12,7 +12,7 @@ compilerPackageArgs :: Args
compilerPackageArgs = package compiler ? do
stage <- getStage
rtsWays <- getRtsWays
path <- getContextPath
path <- getBuildPath
mconcat [ builder Alex ? arg "--latin1"
, builderGhc ? arg ("-I" ++ path)
......
......@@ -10,7 +10,7 @@ ghcPackageArgs :: Args
ghcPackageArgs = package ghc ? do
stage <- getStage
mconcat [ builderGhc ? mconcat
[ arg $ "-I" ++ contextPath (vanillaContext stage compiler)
[ arg $ "-I" ++ buildPath (vanillaContext stage compiler)
, arg "-no-hs-main" ]
, builder GhcCabal ?
......
......@@ -16,8 +16,8 @@ ghcCabalPackageArgs = package ghcCabal ? mconcat
-- TODO: do we need -DCABAL_VERSION=$(CABAL_VERSION)?
ghcCabalBootArgs :: Args
ghcCabalBootArgs = stage0 ? do
path <- getContextPath
let cabalMacros = path -/- "build/autogen/cabal_macros.h"
path <- getBuildPath
let cabalMacros = path -/- "autogen/cabal_macros.h"
cabalMacrosBoot = pkgPath ghcCabal -/- "cabal_macros_boot.h"
mconcat
[ remove ["-hide-all-packages"]
......
......@@ -8,7 +8,7 @@ import Settings
hp2psPackageArgs :: Args
hp2psPackageArgs = package hp2ps ? do
path <- getContextPath
path <- getBuildPath
let cabalMacros = path -/- "build/autogen/cabal_macros.h"
mconcat [ builderGhc ?
mconcat [ arg "-no-hs-main"
......
......@@ -46,7 +46,7 @@ rtsPackageArgs = package rts ? do
ghcUnreg <- yesNo $ flag GhcUnregisterised
ghcEnableTNC <- yesNo ghcEnableTablesNextToCode
way <- getWay
path <- getContextPath
path <- getBuildPath
top <- getTopDirectory
libffiName <- lift $ rtsLibffiLibraryName
ffiIncludeDir <- getSetting FfiIncludeDir
......@@ -54,7 +54,7 @@ rtsPackageArgs = package rts ? do
mconcat
[ builderGcc ? mconcat
[ arg "-Irts"
, arg $ "-I" ++ path -/- "build"
, arg $ "-I" ++ path
, arg $ "-DRtsWay=\"rts_" ++ show way ++ "\""
-- rts **must** be compiled with optimizations. The INLINE_HEADER macro,
-- requires that functions are inlined to work as expected. Inlining
......
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