From b0dbc4897b12a97bf54477cb9b8f62e299d51261 Mon Sep 17 00:00:00 2001 From: Kornilios Kourtis Date: Mon, 5 Nov 2012 11:43:05 +0100 Subject: [PATCH] update tree to use ghc7.4 --- README | 5 +++-- hake/Main.hs | 24 ++++++++++++++---------- kernel/Hakefile | 24 ++++++++++++------------ tools/fof/IL/Paka/Builders.lhs | 2 +- 4 files changed, 30 insertions(+), 25 deletions(-) diff --git a/README b/README index 5ea44ad..f6e82e2 100644 --- a/README +++ b/README @@ -53,9 +53,10 @@ The following are required to build Barrelfish and its tools: http://www.codesourcery.com/sgpp/lite/arm * GNU binutils (2.19 is known to work) * GNU make - * GHC v6.10 or v6.12.2 and Parsec 2.1 - * earlier versions of GHC are unsupported + * GHC v7.4 and Parsec 3.1 + * older versions of the tree supported v6.10 or v6.12.2 with Parsec 2.1 * GHC v6.12.1 has a known bug and is unable to build our tools + * earlier versions of GHC are unsupported Our build system may not be very portable; if in doubt, try building on a recent Debian or Ubuntu system, as these are what we use. diff --git a/hake/Main.hs b/hake/Main.hs index 465a757..25e52d3 100644 --- a/hake/Main.hs +++ b/hake/Main.hs @@ -19,7 +19,9 @@ import System.Directory import System.Exit import GHC hiding (Target) import GHC.Paths ( libdir ) -import DynFlags ( defaultDynFlags ) +import DynFlags ( defaultLogAction, + xopt_set, + ExtensionFlag (Opt_DeriveDataTypeable) ) import Data.Dynamic import Data.Maybe import Data.List @@ -321,7 +323,7 @@ stripSrcDir s = Path.removePrefix Config.source_dir s hakeModule :: [String] -> [(String,String)] -> String hakeModule allfiles hakefiles = let unqual_imports = ["RuleDefs", "HakeTypes", "Path", "Args"] - qual_imports = ["Config", "List" ] + qual_imports = ["Config", "Data.List" ] relfiles = [ stripSrcDir f | f <- allfiles ] wrap1 n c = wrapLet "build a" ("(buildFunction a) allfiles " ++ (show n) ++ " a") @@ -354,24 +356,26 @@ wrapLet var expr body = evalHakeFiles :: Opts -> [String] -> [(String,String)] -> IO [(String,HRule)] evalHakeFiles o allfiles hakefiles = - let imports = [ "HakeTypes", "Hakefiles"] - all_imports = ["Prelude"] ++ imports + let imports = [ "Hakefiles"] + all_imports = imports moddirs = [ (opt_installdir o) ./. "hake", ".", (opt_bfsourcedir o) ./. "hake" ] in do - defaultErrorHandler defaultDynFlags $ do + defaultErrorHandler defaultLogAction $ do runGhc (Just libdir) $ do dflags <- getSessionDynFlags - setSessionDynFlags dflags { importPaths = moddirs, + let dflags1 = foldl xopt_set dflags [ Opt_DeriveDataTypeable ] + _ <- setSessionDynFlags dflags1{ + importPaths = moddirs, hiDir = Just "./hake", - objectDir = Just "./hake", - flags = Opt_DeriveDataTypeable:(flags dflags) } + objectDir = Just "./hake" + } targets <- mapM (\m -> guessTarget m Nothing) imports setTargets targets load LoadAllTargets modlist <- mapM (\m -> findModule (mkModuleName m) Nothing) all_imports - setContext [] modlist + setContext [IIModule m | m <- modlist] val <- dynCompileExpr "Hakefiles.hf :: [(String, HRule)]" return (fromDyn val [("failed",Error "failed")]) @@ -444,7 +448,7 @@ main = do hPutStrLn stdout ("Source directory: " ++ opt_sourcedir opts) hPutStrLn stdout ("BF Source directory: " ++ opt_bfsourcedir opts) hPutStrLn stdout ("Install directory: " ++ opt_installdir opts) - + hPutStrLn stdout "Reading directory tree..." l <- listFilesR (opt_sourcedir opts) hPutStrLn stdout "Reading Hakefiles..." diff --git a/kernel/Hakefile b/kernel/Hakefile index e0dbd27..bbdc412 100644 --- a/kernel/Hakefile +++ b/kernel/Hakefile @@ -59,18 +59,18 @@ let cpudrivers arglist = let - cafiles = List.nub $ concat [ [ [ arch, cfile ] - | arch <- Args.architectures arg, - cfile <- common_c ++ (Args.cFiles arg) ] - | arg <- arglist ] - safiles = List.nub $ concat [ [ [ arch, sfile ] - | arch <- Args.architectures arg, - sfile <- Args.assemblyFiles arg ] - | arg <- arglist ] - mafiles = List.nub $ concat [ [ [ arch, mfile ] - | arch <- Args.architectures arg, - mfile <- Args.mackerelDevices arg ] - | arg <- arglist ] + cafiles = Data.List.nub $ concat [ [ [ arch, cfile ] + | arch <- Args.architectures arg, + cfile <- common_c ++ (Args.cFiles arg) ] + | arg <- arglist ] + safiles = Data.List.nub $ concat [ [ [ arch, sfile ] + | arch <- Args.architectures arg, + sfile <- Args.assemblyFiles arg ] + | arg <- arglist ] + mafiles = Data.List.nub $ concat [ [ [ arch, mfile ] + | arch <- Args.architectures arg, + mfile <- Args.mackerelDevices arg ] + | arg <- arglist ] in ( [ compileCFile (kernelOptions a) f | [a,f] <- cafiles ] ++ diff --git a/tools/fof/IL/Paka/Builders.lhs b/tools/fof/IL/Paka/Builders.lhs index 963117a..bf3058b 100644 --- a/tools/fof/IL/Paka/Builders.lhs +++ b/tools/fof/IL/Paka/Builders.lhs @@ -13,7 +13,7 @@ > module IL.Paka.Builders where -> import Text.PrettyPrint.HughesPJ +> import Text.PrettyPrint.HughesPJ hiding (first) > import qualified Data.Map as Map > import Debug.Trace -- 1.7.2.5