X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2Fmain%2FSysTools.lhs;h=9bc26cfddbceab8e17cdf9bcb2fa7bf0e480ae45;hp=5c64a34650c479b54edd47eb1ac1712439456633;hb=f3a77b2f46ebc27716f45ae426a3b33b853d52f5;hpb=70f79a6c3c40ca95efc1e2371f663c68c3bb5f08 diff --git a/compiler/main/SysTools.lhs b/compiler/main/SysTools.lhs index 5c64a34..9bc26cf 100644 --- a/compiler/main/SysTools.lhs +++ b/compiler/main/SysTools.lhs @@ -26,7 +26,6 @@ module SysTools ( touch, -- String -> String -> IO () copy, copyWithHeader, - getExtraViaCOpts, -- Temporary-file management setTmpDir, @@ -162,6 +161,19 @@ initSysTools mbMinusB dflags0 -- NB: top_dir is assumed to be in standard Unix -- format, '/' separated + ; let settingsFile = top_dir "settings" + ; settingsStr <- readFile settingsFile + ; mySettings <- case maybeReadFuzzy settingsStr of + Just s -> + return s + Nothing -> + pgmError ("Can't parse " ++ show settingsFile) + ; let getSetting key = case lookup key mySettings of + Just xs -> + return xs + Nothing -> pgmError ("No entry for " ++ show key ++ " in " ++ show settingsFile) + ; myExtraGccViaCFlags <- getSetting "GCC extra via C opts" + ; let installed :: FilePath -> FilePath installed file = top_dir file installed_mingw_bin file = top_dir ".." "mingw" "bin" file @@ -229,6 +241,8 @@ initSysTools mbMinusB dflags0 ghcUsagePath = ghc_usage_msg_path, ghciUsagePath = ghci_usage_msg_path, topDir = top_dir, + settings = mySettings, + extraGccViaCFlags = words myExtraGccViaCFlags, systemPackageConfig = pkgconfig_path, pgm_L = unlit_path, pgm_P = cpp_path, @@ -448,11 +462,6 @@ copyWithHeader dflags purpose maybe_header from to = do hClose hout hClose hin -getExtraViaCOpts :: DynFlags -> IO [String] -getExtraViaCOpts dflags = do - f <- readFile (topDir dflags "extra-gcc-opts") - return (words f) - -- | read the contents of the named section in an ELF object as a -- String. readElfSection :: DynFlags -> String -> FilePath -> IO (Maybe String)