Commit c158014f authored by Zhen Zhang's avatar Zhen Zhang Committed by Andrey Mokhov

Add wrapper for Runhaskell, Fix #304 (#305)

parent 295c7812
......@@ -17,3 +17,6 @@ cabal.sandbox.config
# the user settings
/UserSettings.hs
# Mostly temp file by emacs
*~
......@@ -12,6 +12,7 @@ import Oracles.ModuleFiles
import Oracles.PackageData
import Rules.Wrappers.Ghc
import Rules.Wrappers.GhcPkg
import Rules.Wrappers.Runhaskell
import Settings
import Settings.Path
import Target
......@@ -25,6 +26,7 @@ type Wrapper = FilePath -> Expr String
wrappers :: [(Context, Wrapper)]
wrappers = [ (vanillaContext Stage0 ghc , ghcWrapper )
, (vanillaContext Stage1 ghc , ghcWrapper )
, (vanillaContext Stage1 runGhc, runhaskellWrapper)
, (vanillaContext Stage0 ghcPkg, ghcPkgWrapper) ]
buildProgram :: [(Resource, Int)] -> Context -> Rules ()
......
module Rules.Wrappers.Runhaskell (runhaskellWrapper) where
import Base
import Expression
import Oracles.Path
runhaskellWrapper :: FilePath -> Expr String
runhaskellWrapper program = do
lift $ need [sourcePath -/- "Rules/Wrappers/Runhaskell.hs"]
top <- getTopDirectory
return $ unlines
[ "#!/bin/bash"
, "exec " ++ (top -/- program)
++ " -f" ++ (top -/- "inplace/lib/bin/ghc-stage2") -- HACK
++ " -B" ++ (top -/- "inplace/lib") ++ " ${1+\"$@\"}" ]
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