-----------------------------------------------------------------------------
--- $Id: DriverState.hs,v 1.9 2000/10/27 14:56:00 sewardj Exp $
+-- $Id: DriverState.hs,v 1.13 2000/11/14 16:28:38 simonmar Exp $
--
-- Settings for the driver
--
import DriverUtil
import Util
import Config
-
import Exception
import IOExts
+#ifdef mingw32_TARGET_OS
+import TmpFiles ( newTempName )
+import Directory ( removeFile )
+#endif
import System
import IO
#else
GLOBAL_VAR(v_Static, False, Bool)
#endif
+GLOBAL_VAR(v_NoHsMain, False, Bool)
GLOBAL_VAR(v_Recomp, True, Bool)
GLOBAL_VAR(v_Collect_ghc_timing, False, Bool)
GLOBAL_VAR(v_Do_asm_mangling, True, Bool)
-----------------------------------------------------------------------------
-- Compiler output options
-GLOBAL_VAR(v_Hsc_Lang, if cGhcWithNativeCodeGen == "YES" &&
- (prefixMatch "i386" cTARGETPLATFORM ||
- prefixMatch "sparc" cTARGETPLATFORM)
- then HscAsm
- else HscC,
- HscLang)
+defaultHscLang
+ | cGhcWithNativeCodeGen == "YES" &&
+ (prefixMatch "i386" cTARGETPLATFORM ||
+ prefixMatch "sparc" cTARGETPLATFORM) = HscAsm
+ | otherwise = HscC
GLOBAL_VAR(v_Output_dir, Nothing, Maybe String)
-GLOBAL_VAR(v_Output_suf, Nothing, Maybe String)
+GLOBAL_VAR(v_Object_suf, Nothing, Maybe String)
GLOBAL_VAR(v_Output_file, Nothing, Maybe String)
GLOBAL_VAR(v_Output_hi, Nothing, Maybe String)
osuf_ify :: String -> IO String
osuf_ify f = do
- osuf_opt <- readIORef v_Output_suf
+ osuf_opt <- readIORef v_Object_suf
case osuf_opt of
Nothing -> return f
Just s -> return (newsuf s f)
GLOBAL_VAR(v_OptLevel, 0, Int)
setOptLevel :: String -> IO ()
-setOptLevel "" = do { writeIORef v_OptLevel 1; go_via_C }
+setOptLevel "" = do { writeIORef v_OptLevel 1 }
setOptLevel "not" = writeIORef v_OptLevel 0
setOptLevel [c] | isDigit c = do
let level = ord c - ord '0'
writeIORef v_OptLevel level
- when (level >= 1) go_via_C
setOptLevel s = unknownFlagErr ("-O"++s)
-go_via_C = do
- l <- readIORef v_Hsc_Lang
- case l of { HscAsm -> writeIORef v_Hsc_Lang HscC;
- _other -> return () }
-
-GLOBAL_VAR(v_minus_o2_for_C, False, Bool)
-
-GLOBAL_VAR(v_MaxSimplifierIterations, 4, Int)
-GLOBAL_VAR(v_StgStats, False, Bool)
+GLOBAL_VAR(v_minus_o2_for_C, False, Bool)
+GLOBAL_VAR(v_MaxSimplifierIterations, 4, Int)
+GLOBAL_VAR(v_StgStats, False, Bool)
GLOBAL_VAR(v_UsageSPInf, False, Bool) -- Off by default
GLOBAL_VAR(v_Strictness, True, Bool)
GLOBAL_VAR(v_CPR, True, Bool)