Commit fee02d9c authored by Andrey Mokhov's avatar Andrey Mokhov
Browse files

Build touchy, fix #125.

parent 2d333d5f
......@@ -6,7 +6,7 @@ module GHC (
haddock, haskeline, hsc2hs, hoopl, hp2ps, hpc, hpcBin, integerGmp,
integerSimple, iservBin, libffi, mkUserGuidePart, parallel, pretty,
primitive, process, rts, runGhc, stm, templateHaskell, terminfo, time,
transformers, unix, win32, xhtml,
touchy, transformers, unix, win32, xhtml,
defaultKnownPackages, defaultTargetDirectory, defaultProgramPath
) where
......@@ -28,7 +28,7 @@ defaultKnownPackages =
, ghcTags, haddock, haskeline, hsc2hs, hoopl, hp2ps, hpc, hpcBin, integerGmp
, integerSimple, iservBin, libffi, mkUserGuidePart, parallel, pretty
, primitive, process, rts, runGhc, stm, templateHaskell, terminfo, time
, transformers, unix, win32, xhtml ]
, touchy, transformers, unix, win32, xhtml ]
-- Package definitions (see Package.hs)
array, base, binary, bytestring, cabal, compiler, containers, compareSizes,
......@@ -37,7 +37,7 @@ array, base, binary, bytestring, cabal, compiler, containers, compareSizes,
haddock, haskeline, hsc2hs, hoopl, hp2ps, hpc, hpcBin, integerGmp,
integerSimple, iservBin, libffi, mkUserGuidePart, parallel, pretty,
primitive, process, rts, runGhc, stm, templateHaskell, terminfo, time,
transformers, unix, win32, xhtml :: Package
touchy, transformers, unix, win32, xhtml :: Package
array = library "array"
base = library "base"
......@@ -83,6 +83,7 @@ stm = library "stm"
templateHaskell = library "template-haskell"
terminfo = library "terminfo"
time = library "time"
touchy = utility "touchy"
transformers = library "transformers"
unix = library "unix"
win32 = library "Win32"
......@@ -92,7 +93,7 @@ xhtml = library "xhtml"
-- TODO: The following utils are not included into the build system because
-- they seem to be unused or unrelated to the build process: checkUniques,
-- completion, count_lines, coverity, debugNGC, describe-unexpected, genargs,
-- lndir, mkdirhier, testremove, touchy, vagrant
-- lndir, mkdirhier, testremove, vagrant
-- GHC build results will be placed into target directories with the following
-- typical structure:
......@@ -102,7 +103,7 @@ xhtml = library "xhtml"
defaultTargetDirectory :: Stage -> Package -> FilePath
defaultTargetDirectory stage _ = stageString stage
-- TODO: simplify
-- TODO: simplify, add programInplaceLibPath
-- | Returns a relative path to the program executable
defaultProgramPath :: Stage -> Package -> Maybe FilePath
defaultProgramPath stage pkg
......@@ -110,6 +111,9 @@ defaultProgramPath stage pkg
| pkg == haddock || pkg == ghcTags = case stage of
Stage2 -> Just . inplaceProgram $ pkgNameString pkg
_ -> Nothing
| pkg == touchy = case stage of
Stage0 -> Just $ "inplace/lib/bin" -/- pkgNameString pkg <.> exe
_ -> Nothing
| isProgram pkg = case stage of
Stage0 -> Just . inplaceProgram $ pkgNameString pkg
_ -> Just . installProgram $ pkgNameString pkg
......
......@@ -67,6 +67,14 @@ buildPackageData rs target @ (PartialTarget stage pkg) = do
writeFileChanged mk contents
putSuccess $ "| Successfully generated '" ++ mk ++ "'."
when (pkg == touchy) $ dataFile %> \mk -> do
let prefix = "utils_touchy_" ++ stageString stage ++ "_"
contents = unlines $ map (prefix++)
[ "PROGNAME = touchy"
, "C_SRCS = touchy.c" ]
writeFileChanged mk contents
putSuccess $ "| Successfully generated '" ++ mk ++ "'."
-- Bootstrapping `ghcCabal`: although `ghcCabal` is a proper cabal
-- package, we cannot generate the corresponding `package-data.mk` file
-- by running by running `ghcCabal`, because it has not yet been built.
......
......@@ -30,6 +30,7 @@ import Settings.Packages.IntegerGmp
import Settings.Packages.IservBin
import Settings.Packages.Rts
import Settings.Packages.RunGhc
import Settings.Packages.Touchy
import Settings.User
getArgs :: Expr [String]
......@@ -75,4 +76,5 @@ defaultPackageArgs = mconcat
, integerGmpPackageArgs
, iservBinPackageArgs
, rtsPackageArgs
, runGhcPackageArgs ]
, runGhcPackageArgs
, touchyPackageArgs ]
......@@ -24,7 +24,8 @@ packagesStage0 = mconcat
[ append [ binary, cabal, compiler, ghc, ghcBoot, ghcCabal, ghcPkg
, hsc2hs, hoopl, hpc, templateHaskell, transformers ]
-- the stage0 predicate makes sure these packages are built only in Stage0
, stage0 ? append [deriveConstants, dllSplit, genapply, genprimopcode, hp2ps]
, stage0 ? append [ deriveConstants, dllSplit, genapply, genprimopcode
, hp2ps, touchy ]
, notM windowsHost ? notM (anyHostOs ["ios"]) ? append [terminfo] ]
packagesStage1 :: Packages
......
module Settings.Packages.Touchy (touchyPackageArgs) where
import Base
import Expression
import GHC (touchy)
import Predicates (builderGhc, package)
import Settings
touchyPackageArgs :: Args
touchyPackageArgs = package touchy ? do
path <- getTargetPath
let cabalMacros = path -/- "build/autogen/cabal_macros.h"
mconcat [ builderGhc ?
mconcat [ arg "-no-hs-main"
, remove ["-hide-all-packages"]
, removePair "-optP-include" $ "-optP" ++ cabalMacros ] ]
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