Commit 2d24ed4a authored by Andrey Mokhov's avatar Andrey Mokhov
Browse files

Add base and integer-gmp2 to the list of targets.

parent 8a860e62
......@@ -125,7 +125,9 @@ packageArgs stage pathDist = do
includeGccArgs :: FilePath -> FilePath -> Args
includeGccArgs path dist =
let pathDist = path </> dist
in args [ pathArgs "-I" path $ IncludeDirs pathDist
autogen = pathDist </> "build/autogen"
in args [ arg $ "-I" ++ unifyPath autogen
, pathArgs "-I" path $ IncludeDirs pathDist
, pathArgs "-I" path $ DepIncludeDirs pathDist ]
includeGhcArgs :: FilePath -> FilePath -> Args
......
......@@ -29,10 +29,11 @@ ghcArgs (Package _ path _ _) (stage, dist, _) way srcs result =
, args ["-o", result] ]
gccArgs :: Package -> TodoItem -> [FilePath] -> FilePath -> Args
gccArgs (Package _ path _ _) (_, dist, _) srcs result =
gccArgs (Package _ path _ _) (_, dist, settings) srcs result =
let pathDist = path </> dist
in args [ args $ CcArgs pathDist
, commonCcArgs
, customCcArgs settings
, commonCcWarninigArgs
, includeGccArgs path dist
, args ("-c":srcs)
......
......@@ -26,8 +26,8 @@ configureArgs stage settings =
unless (null s) $ arg $ "--configure-option=" ++ key ++ "=" ++ s
cflags = [ commonCcArgs `filterOut` "-Werror"
, args $ ConfCcArgs stage
, customCcArgs settings
, commonCcWarninigArgs ]
-- , customCcArgs settings -- TODO: fix
, commonCcWarninigArgs ] -- TODO: check if cflags are glued
ldflags = [ commonLdArgs
, args $ ConfGccLinkerArgs stage
, customLdArgs settings ]
......
......@@ -43,13 +43,14 @@ ghcArgs (Package name path _ _) (stage, dist, settings) =
-- TODO: handle custom $1_$2_MKDEPENDC_OPTS and
gccArgs :: FilePath -> Package -> TodoItem -> Args
gccArgs sourceFile (Package _ path _ _) (stage, dist, _) =
gccArgs sourceFile (Package _ path _ _) (stage, dist, settings) =
let pathDist = path </> dist
buildDir = pathDist </> "build"
depFile = buildDir </> takeFileName sourceFile <.> "deps"
in args [ args ["-MM", "-E"] -- TODO: add a Cpp Builder instead
in args [ args ["-E", "-MM"] -- TODO: add a Cpp Builder instead
, args $ CcArgs pathDist
, commonCcArgs
, customCcArgs settings
, commonCcWarninigArgs
, includeGccArgs path dist
, args ["-MF", unifyPath depFile]
......
......@@ -18,6 +18,9 @@ instance Show IntegerLibrary where
integerLibrary :: IntegerLibrary
integerLibrary = IntegerGmp2
integerLibraryName :: String
integerLibraryName = show integerLibrary
buildHaddock :: Bool
buildHaddock = True
......@@ -26,42 +29,42 @@ buildHaddock = True
-- target, i.e. GHC (and perhaps, something else)
targetPackages :: [Package]
targetPackages =
[ standardLibrary "array" [ Stage1]
--, customLibrary "base" [ Stage1] baseConfArgs
, standardLibrary "bin-package-db" [Stage0, Stage1]
, standardLibrary "binary" [Stage0, Stage1]
, standardLibrary "bytestring" [ Stage1]
-- see Note [Cabal package weirdness]
, customNameLibrary "Cabal/Cabal" [Stage0, Stage1] cabalTraits
, standardLibrary "containers" [ Stage1]
, standardLibrary "deepseq" [ Stage1]
, standardLibrary "directory" [ Stage1]
, standardLibrary "filepath" [ Stage1]
, customLibrary "ghc-prim" [ Stage1] ghcPrimConfArgs
, standardLibrary "haskeline" [ Stage1]
, standardLibrary "hoopl" [Stage0, Stage1]
, standardLibrary "hpc" [Stage0, Stage1]
, customNameLibrary (show integerLibrary) [ Stage1] integerLibTraits
, standardLibrary "parallel" [ Stage1]
, standardLibrary "pretty" [ Stage1]
, standardLibrary "primitive" [ Stage1]
, standardLibrary "process" [ Stage1]
, standardLibrary "stm" [ Stage1]
, standardLibrary "template-haskell" [ Stage1]
, customLibrary "terminfo" [Stage0, Stage1] whenTerminfo
, standardLibrary "time" [ Stage1]
, standardLibrary "transformers" [Stage0, Stage1]
, customLibrary "unix" [ Stage1] whenUnix
, customLibrary "Win32" [ Stage1] whenWin32
, customLibrary "xhtml" [ Stage1] whenXhtml
[ standardLibrary "array" [ Stage1]
, customLibrary "base" [ Stage1] baseConfArgs
, standardLibrary "bin-package-db" [Stage0, Stage1]
, standardLibrary "binary" [Stage0, Stage1]
, standardLibrary "bytestring" [ Stage1]
, customNameLibrary "Cabal/Cabal" [Stage0, Stage1] cabalTraits
, standardLibrary "containers" [ Stage1]
, standardLibrary "deepseq" [ Stage1]
, standardLibrary "directory" [ Stage1]
, standardLibrary "filepath" [ Stage1]
, customLibrary "ghc-prim" [ Stage1] ghcPrimConfArgs
, standardLibrary "haskeline" [ Stage1]
, standardLibrary "hoopl" [Stage0, Stage1]
, standardLibrary "hpc" [Stage0, Stage1]
, customNameLibrary integerLibraryName [ Stage1] integerLibTraits
, standardLibrary "parallel" [ Stage1]
, standardLibrary "pretty" [ Stage1]
, standardLibrary "primitive" [ Stage1]
, standardLibrary "process" [ Stage1]
, standardLibrary "stm" [ Stage1]
, standardLibrary "template-haskell" [ Stage1]
, customLibrary "terminfo" [Stage0, Stage1] whenTerminfo
, standardLibrary "time" [ Stage1]
, standardLibrary "transformers" [Stage0, Stage1]
, customLibrary "unix" [ Stage1] whenUnix
, customLibrary "Win32" [ Stage1] whenWin32
, customLibrary "xhtml" [ Stage1] whenXhtml
]
baseConfArgs :: Settings -> Settings
baseConfArgs settings =
settings { customConfArgs = arg $ "--flags=" ++ show integerLibrary }
-- see Note [Cabal package weirdness]
cabalTraits :: (String, Settings -> Settings)
cabalTraits = ("Cabal", id) -- change cabalName, keep the other settings intact
cabalTraits = ("Cabal", id) -- change cabalName, keep other settings intact
ghcPrimConfArgs :: Settings -> Settings
ghcPrimConfArgs settings =
......@@ -76,7 +79,9 @@ integerLibTraits = (cabalName, traits)
IntegerSimple -> "integer-simple"
traits settings = settings
{
customCcArgs = arg "-Ilibraries/integer-gmp2/gmp"
customConfArgs = when windowsHost $
arg "--configure-option=--with-intree-gmp",
customCcArgs = arg "-Ilibraries/integer-gmp2/gmp"
}
whenTerminfo :: Settings -> Settings
......
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