Commit 7053d0ca authored by Andrey Mokhov's avatar Andrey Mokhov
Browse files

Minor revision

parent 13b80f77
......@@ -7,18 +7,19 @@ import Settings
configureBuilderArgs :: Args
configureBuilderArgs = mconcat
[ builder (Configure libffiBuildPath) ? do
top <- getTopDirectory
targetPlatform <- getSetting TargetPlatform
mconcat [ arg $ "--prefix=" ++ top -/- libffiBuildPath -/- "inst"
, arg $ "--libdir=" ++ top -/- libffiBuildPath -/- "inst/lib"
, arg $ "--enable-static=yes"
, arg $ "--enable-shared=no" -- TODO: add support for yes
, arg $ "--host=" ++ targetPlatform ]
, builder (Configure gmpBuildPath) ? do
[ builder (Configure gmpBuildPath) ? do
hostPlatform <- getSetting HostPlatform
buildPlatform <- getSetting BuildPlatform
mconcat [ arg $ "--enable-shared=no"
, arg $ "--host=" ++ hostPlatform
, arg $ "--build=" ++ buildPlatform ] ]
append [ "--enable-shared=no"
, "--host=" ++ hostPlatform
, "--build=" ++ buildPlatform ]
, builder (Configure libffiBuildPath) ? do
top <- getTopDirectory
targetPlatform <- getSetting TargetPlatform
append [ "--prefix=" ++ top -/- libffiBuildPath -/- "inst"
, "--libdir=" ++ top -/- libffiBuildPath -/- "inst/lib"
, "--enable-static=yes"
, "--enable-shared=no" -- TODO: add support for yes
, "--host=" ++ targetPlatform ]
]
......@@ -9,7 +9,7 @@ import Settings.Builders.Common
-- TODO: do we need to support `includes_CC_OPTS += -DDYNAMIC_BY_DEFAULT`?
deriveConstantsBuilderArgs :: Args
deriveConstantsBuilderArgs = builder DeriveConstants ? do
cFlags <- fromDiffExpr includeCcArgs
cFlags <- fromDiffExpr includeCcArgs
[outputFile, tempDir] <- getOutputs
mconcat
[ output "//DerivedConstants.h" ? arg "--gen-header"
......@@ -29,12 +29,11 @@ deriveConstantsBuilderArgs = builder DeriveConstants ? do
includeCcArgs :: Args
includeCcArgs = do
confCcArgs <- getSettingList $ ConfCcArgs Stage1
mconcat
[ cArgs
, cWarnings
, append confCcArgs
, flag GhcUnregisterised ? arg "-DUSE_MINIINTERPRETER"
, includesArgs
, arg "-Irts"
, notM ghcWithSMP ? arg "-DNOSMP"
, arg "-fcommon" ]
mconcat [ cArgs
, cWarnings
, append confCcArgs
, flag GhcUnregisterised ? arg "-DUSE_MINIINTERPRETER"
, includesArgs
, arg "-Irts"
, notM ghcWithSMP ? arg "-DNOSMP"
, arg "-fcommon" ]
......@@ -5,7 +5,7 @@ import GHC
import Oracles.Config.Flag
import Oracles.Config.Setting
import Oracles.PackageData
import Predicate hiding (way, stage)
import Predicate
import Settings
import Settings.Builders.Common
import Settings.Builders.GhcCabal
......@@ -120,12 +120,11 @@ packageGhcArgs = do
not0 <- notStage0
unit <- getFlag SupportsThisUnitId
return $ if not0 || unit then "-this-unit-id " else "-this-package-key "
mconcat
[ arg "-hide-all-packages"
, arg "-no-user-package-db"
, bootPackageDbArgs
, isLibrary pkg ? (arg $ thisArg ++ compId)
, append $ map ("-package-id " ++) pkgDepIds ]
mconcat [ arg "-hide-all-packages"
, arg "-no-user-package-db"
, bootPackageDbArgs
, isLibrary pkg ? (arg $ thisArg ++ compId)
, append $ map ("-package-id " ++) pkgDepIds ]
-- TODO: Improve handling of "cabal_macros.h"
includeGhcArgs :: Args
......
......@@ -5,11 +5,10 @@ module Settings.Builders.GhcCabal (
) where
import Base
import Builder
import GHC
import Oracles.Config.Flag
import Oracles.Config.Setting
import Predicate hiding (stage)
import Predicate
import Settings
import Settings.Builders.Common
......@@ -38,9 +37,7 @@ ghcCabalHsColourBuilderArgs :: Args
ghcCabalHsColourBuilderArgs = builder GhcCabalHsColour ? do
path <- getPackagePath
dir <- getContextDirectory
mconcat [ arg "hscolour"
, arg path
, arg dir ]
append [ "hscolour", path, dir ]
-- TODO: Isn't vanilla always built? If yes, some conditions are redundant.
-- TODO: Need compiler_stage1_CONFIGURE_OPTS += --disable-library-for-ghci?
......
module Settings.Builders.GhcPkg (ghcPkgBuilderArgs) where
import Base
import Builder
import Predicate
import Settings
import Settings.Builders.GhcCabal
......@@ -13,9 +12,7 @@ initPredicate :: Predicate
initPredicate = orM $ map (output . packageDbDirectory) [Stage0 ..]
initArgs :: Args
initArgs = initPredicate ? do
mconcat [ arg "init"
, arg =<< getOutput ]
initArgs = initPredicate ? mconcat [ arg "init", arg =<< getOutput ]
-- TODO: move inplace-pkg-config to buildRootPath, see #113.
updateArgs :: Args
......
......@@ -3,7 +3,6 @@ module Settings.Builders.Haddock (haddockBuilderArgs) where
import Base
import GHC
import Oracles.PackageData
import Package
import Predicate
import Settings
import Settings.Builders.Ghc
......
......@@ -38,7 +38,7 @@ hsc2hsBuilderArgs = builder Hsc2Hs ? do
, stage0 ? arg ("--cflag=-D" ++ hOs ++ "_HOST_OS=1" )
, notStage0 ? arg ("--cflag=-D" ++ tArch ++ "_HOST_ARCH=1")
, notStage0 ? arg ("--cflag=-D" ++ tOs ++ "_HOST_OS=1" )
, arg ("--cflag=-D__GLASGOW_HASKELL__=" ++ version)
, arg $ "--cflag=-D__GLASGOW_HASKELL__=" ++ version
, arg $ "--template=" ++ top -/- templateHsc
, arg $ "-I" ++ top -/- "inplace/lib/include/"
, arg =<< getInput
......
......@@ -5,6 +5,6 @@ import Settings
makeBuilderArgs :: Args
makeBuilderArgs = mconcat
[ builder (Make "testsuite/tests") ? arg "fast"
, builder (Make gmpBuildPath ) ? arg "MAKEFLAGS="
, builder (Make libffiBuildPath ) ? append ["MAKEFLAGS=", "install"] ]
[ builder (Make gmpBuildPath ) ? arg "MAKEFLAGS="
, builder (Make libffiBuildPath ) ? append ["MAKEFLAGS=", "install"]
, builder (Make "testsuite/tests") ? arg "fast" ]
module Settings.Builders.Tar (tarBuilderArgs) where
import Base
import Predicate
tarBuilderArgs :: Args
tarBuilderArgs = builder Tar ? do
input <- getInput
mconcat [ arg "-xf"
, ("*.gz" ?== input) ? arg "--gzip"
, ("*.bz2" ?== input) ? arg "--bzip2"
, arg input
, input "*.gz" ? arg "--gzip"
, input "*.bz2" ? arg "--bzip2"
, arg =<< getInput
, arg "-C", arg =<< getOutput ]
......@@ -36,6 +36,8 @@ compilerPackageArgs = package compiler ? do
ghciWithDebugger ?
notStage0 ? arg "--ghc-option=-DDEBUGGER"
, ghcProfiled ?
notStage0 ? arg "--ghc-pkg-option=--force" ]
notStage0 ? arg "--ghc-pkg-option=--force"
]
, builder Haddock ? arg ("--optghc=-I" ++ path) ]
, builder Haddock ? arg ("--optghc=-I" ++ path)
]
......@@ -13,4 +13,5 @@ ghcPackageArgs = package ghc ? do
, arg "-no-hs-main" ]
, builder GhcCabal ?
ghcWithInterpreter ? notStage0 ? arg "--flags=ghci" ]
ghcWithInterpreter ? notStage0 ? arg "--flags=ghci"
]
......@@ -7,18 +7,14 @@ import Predicate
import Settings
ghcCabalPackageArgs :: Args
ghcCabalPackageArgs = package ghcCabal ? mconcat
[ builder Ghc ?
mconcat [ ghcCabalBootArgs
, remove ["-no-auto-link-packages"] ] ]
ghcCabalPackageArgs = package ghcCabal ?
builder Ghc ? mconcat [ ghcCabalBootArgs
, remove ["-no-auto-link-packages"] ]
-- Boostrapping ghcCabal
-- TODO: do we need -DCABAL_VERSION=$(CABAL_VERSION)?
ghcCabalBootArgs :: Args
ghcCabalBootArgs = stage0 ? do
path <- getBuildPath
let cabalMacros = path -/- "autogen/cabal_macros.h"
cabalMacrosBoot = pkgPath ghcCabal -/- "cabal_macros_boot.h"
-- Note: We could have computed 'cabalDeps' instead of hard-coding it
-- but this doesn't worth the effort, since we plan to drop ghc-cabal
-- altogether at some point. See #18.
......@@ -27,16 +23,17 @@ ghcCabalBootArgs = stage0 ? do
, pretty, process, time ]
, notM windowsHost ? append [unix]
, windowsHost ? append [win32] ]
path <- getBuildPath
mconcat
[ append [ "-package " ++ pkgNameString pkg | pkg <- cabalDeps ]
, removePair "-optP-include" $ "-optP" ++ cabalMacros
, arg "--make"
, arg "-j"
, arg "-DBOOTSTRAPPING"
, arg "-DMIN_VERSION_binary_0_8_0"
, arg "-DGENERICS"
, removePair "-optP-include" $ "-optP" ++ path -/- "autogen/cabal_macros.h"
, arg "-optP-include"
, arg $ "-optP" ++ cabalMacrosBoot
, arg $ "-optP" ++ pkgPath ghcCabal -/- "cabal_macros_boot.h"
, arg "-ilibraries/Cabal/Cabal"
, arg "-ilibraries/binary/src"
, arg "-ilibraries/filepath"
......
......@@ -9,7 +9,6 @@ hp2psPackageArgs :: Args
hp2psPackageArgs = package hp2ps ? do
path <- getBuildPath
let cabalMacros = path -/- "build/autogen/cabal_macros.h"
mconcat [ builder Ghc ?
mconcat [ arg "-no-hs-main"
, remove ["-hide-all-packages"]
, removePair "-optP-include" $ "-optP" ++ cabalMacros ] ]
builder Ghc ? mconcat [ arg "-no-hs-main"
, remove ["-hide-all-packages"]
, removePair "-optP-include" $ "-optP" ++ cabalMacros ]
......@@ -17,10 +17,12 @@ integerGmpPackageArgs = package integerGmp ? do
gmpIncludeDir <- getSetting GmpIncludeDir
gmpLibDir <- getSetting GmpLibDir
mconcat [ builder GhcCabal ? mconcat
mconcat [ builder Cc ? arg includeGmp
, builder GhcCabal ? mconcat
[ (null gmpIncludeDir && null gmpLibDir) ?
arg "--configure-option=--with-intree-gmp"
, appendSub "--configure-option=CFLAGS" [includeGmp]
, appendSub "--gcc-options" [includeGmp] ]
, builder Cc ? arg includeGmp ]
, appendSub "--gcc-options" [includeGmp]
]
]
......@@ -89,7 +89,8 @@ rtsPackageArgs = package rts ? do
, input "//Evac_thr.c" ? arg "-funroll-loops"
, input "//Evac_thr.c" ? append [ "-DPARALLEL_GC", "-Irts/sm" ]
, input "//Scav_thr.c" ? append [ "-DPARALLEL_GC", "-Irts/sm" ] ]
, input "//Scav_thr.c" ? append [ "-DPARALLEL_GC", "-Irts/sm" ]
]
, builder Ghc ? (arg "-Irts" <> includesArgs)
......@@ -101,7 +102,8 @@ rtsPackageArgs = package rts ? do
[ "-DTOP=" ++ show top
, "-DFFI_INCLUDE_DIR=" ++ show ffiIncludeDir
, "-DFFI_LIB_DIR=" ++ show ffiLibraryDir
, "-DFFI_LIB=" ++ show libffiName ] ]
, "-DFFI_LIB=" ++ show libffiName ]
]
-- # If we're compiling on windows, enforce that we only support XP+
......
......@@ -7,6 +7,5 @@ import Predicate
runGhcPackageArgs :: Args
runGhcPackageArgs = package runGhc ? do
version <- getSetting ProjectVersion
mconcat [ builder Ghc ?
input "//Main.hs" ?
append ["-cpp", "-DVERSION=" ++ show version] ]
builder Ghc ? input "//Main.hs" ?
append ["-cpp", "-DVERSION=" ++ show version]
......@@ -9,7 +9,6 @@ touchyPackageArgs :: Args
touchyPackageArgs = package touchy ? do
path <- getBuildPath
let cabalMacros = path -/- "autogen/cabal_macros.h"
mconcat [ builder Ghc ?
mconcat [ arg "-no-hs-main"
, remove ["-hide-all-packages"]
, removePair "-optP-include" $ "-optP" ++ cabalMacros ] ]
builder Ghc ? mconcat [ arg "-no-hs-main"
, remove ["-hide-all-packages"]
, removePair "-optP-include" $ "-optP" ++ cabalMacros ]
......@@ -9,7 +9,6 @@ unlitPackageArgs :: Args
unlitPackageArgs = package unlit ? do
path <- getBuildPath
let cabalMacros = path -/- "autogen/cabal_macros.h"
mconcat [ builder Ghc ?
mconcat [ arg "-no-hs-main"
, remove ["-hide-all-packages"]
, removePair "-optP-include" $ "-optP" ++ cabalMacros ] ]
builder Ghc ? mconcat [ arg "-no-hs-main"
, remove ["-hide-all-packages"]
, removePair "-optP-include" $ "-optP" ++ cabalMacros ]
Supports Markdown
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