diff options
Diffstat (limited to 'compiler/main/SysTools.hs')
-rw-r--r-- | compiler/main/SysTools.hs | 47 |
1 files changed, 42 insertions, 5 deletions
diff --git a/compiler/main/SysTools.hs b/compiler/main/SysTools.hs index 50cc6d58e5..b3dc60654e 100644 --- a/compiler/main/SysTools.hs +++ b/compiler/main/SysTools.hs @@ -259,6 +259,29 @@ initSysTools top_dir platformIsCrossCompiling = crossCompiling } + integerLibrary <- getSetting "integer library" + integerLibraryType <- case integerLibrary of + "integer-gmp" -> pure IntegerGMP + "integer-simple" -> pure IntegerSimple + _ -> pgmError $ unwords + [ "Entry for" + , show "integer library" + , "must be one of" + , show "integer-gmp" + , "or" + , show "integer-simple" + ] + + ghcWithInterpreter <- getBooleanSetting "Use interpreter" + ghcWithNativeCodeGen <- getBooleanSetting "Use native code generator" + ghcWithSMP <- getBooleanSetting "Support SMP" + ghcRTSWays <- getSetting "RTS ways" + leadingUnderscore <- getBooleanSetting "Leading underscore" + useLibFFI <- getBooleanSetting "Use LibFFI" + ghcThreaded <- getBooleanSetting "Use Threads" + ghcDebugged <- getBooleanSetting "Use Debugging" + ghcRtsWithLibdw <- getBooleanSetting "RTS expects libdw" + return $ Settings { sTargetPlatform = platform, sTmpDir = normalise tmpdir, @@ -306,8 +329,20 @@ initSysTools top_dir sOpt_lc = [], sOpt_i = [], sPlatformConstants = platformConstants, + sTargetPlatformString = targetPlatformString, - sTablesNextToCode = tablesNextToCode + sIntegerLibrary = integerLibrary, + sIntegerLibraryType = integerLibraryType, + sGhcWithInterpreter = ghcWithInterpreter, + sGhcWithNativeCodeGen = ghcWithNativeCodeGen, + sGhcWithSMP = ghcWithSMP, + sGhcRTSWays = ghcRTSWays, + sTablesNextToCode = tablesNextToCode, + sLeadingUnderscore = leadingUnderscore, + sLibFFI = useLibFFI, + sGhcThreaded = ghcThreaded, + sGhcDebugged = ghcDebugged, + sGhcRtsWithLibdw = ghcRtsWithLibdw } @@ -383,10 +418,12 @@ linkDynLib dflags0 o_files dep_packages -- against libHSrts, then both end up getting loaded, -- and things go wrong. We therefore link the libraries -- with the same RTS flags that we link GHC with. - dflags1 = if cGhcThreaded then addWay' WayThreaded dflags0 - else dflags0 - dflags2 = if cGhcDebugged then addWay' WayDebug dflags1 - else dflags1 + dflags1 = if sGhcThreaded $ settings dflags0 + then addWay' WayThreaded dflags0 + else dflags0 + dflags2 = if sGhcDebugged $ settings dflags1 + then addWay' WayDebug dflags1 + else dflags1 dflags = updateWays dflags2 verbFlags = getVerbFlags dflags |