X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fmain%2FSysTools.lhs;h=2529dbff48bfb8af923cd97b3bab0150e9911410;hb=5ccf658872ea2304f34eda6b1fb840fc1bfc0ba0;hp=8bbe22774deaa5d03db4920bac5227d343ebd194;hpb=6f9127b3a48638a1230935d94046084db567699e;p=ghc-hetmet.git diff --git a/compiler/main/SysTools.lhs b/compiler/main/SysTools.lhs index 8bbe227..2529dbf 100644 --- a/compiler/main/SysTools.lhs +++ b/compiler/main/SysTools.lhs @@ -46,6 +46,7 @@ import ErrUtils import Panic import Util import DynFlags +import StaticFlags import Exception import Data.IORef @@ -158,6 +159,11 @@ initSysTools mbMinusB -- format, '/' separated ; let settingsFile = top_dir "settings" + installed :: FilePath -> FilePath + installed file = top_dir file + installed_mingw_bin file = top_dir ".." "mingw" "bin" file + installed_perl_bin file = top_dir ".." "perl" file + ; settingsStr <- readFile settingsFile ; mySettings <- case maybeReadFuzzy settingsStr of Just s -> @@ -169,11 +175,16 @@ initSysTools mbMinusB 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 - installed_perl_bin file = top_dir ".." "perl" file + -- On Windows, mingw is distributed with GHC, + -- so we look in TopDir/../mingw/bin + -- It would perhaps be nice to be able to override this + -- with the settings file, but it would be a little fiddly + -- to make that possible, so for now you can't. + ; gcc_prog <- if isWindowsHost then return $ installed_mingw_bin "gcc" + else getSetting "C compiler command" + ; perl_path <- if isWindowsHost + then return $ installed_perl_bin "perl" + else getSetting "perl command" ; let pkgconfig_path = installed "package.conf.d" ghc_usage_msg_path = installed "ghc-usage.txt" @@ -190,15 +201,7 @@ initSysTools mbMinusB ; tmpdir <- getTemporaryDirectory - -- On Windows, mingw is distributed with GHC, - -- so we look in TopDir/../mingw/bin ; let - gcc_prog - | isWindowsHost = installed_mingw_bin "gcc" - | otherwise = cGCC - perl_path - | isWindowsHost = installed_perl_bin cGHC_PERL - | otherwise = cGHC_PERL -- 'touch' is a GHC util for Windows touch_path | isWindowsHost = installed cGHC_TOUCHY_PGM @@ -252,9 +255,22 @@ initSysTools mbMinusB sPgm_sysman = top_dir ++ "/ghc/rts/parallel/SysMan", sPgm_windres = windres_path, sPgm_lo = (lo_prog,[]), - sPgm_lc = (lc_prog,[]) + sPgm_lc = (lc_prog,[]), -- Hans: this isn't right in general, but you can -- elaborate it in the same way as the others + sOpt_L = [], + sOpt_P = (if opt_PIC + then -- this list gets reversed + ["-D__PIC__", "-U __PIC__"] + else []), + sOpt_F = [], + sOpt_c = [], + sOpt_a = [], + sOpt_m = [], + sOpt_l = [], + sOpt_windres = [], + sOpt_lo = [], + sOpt_lc = [] } } \end{code}