[project @ 2003-07-21 15:14:18 by ross]
[ghc-hetmet.git] / ghc / compiler / main / DriverState.hs
index acd5e49..c24e569 100644 (file)
@@ -1,5 +1,5 @@
 -----------------------------------------------------------------------------
--- $Id: DriverState.hs,v 1.88 2002/12/18 16:29:28 simonmar Exp $
+-- $Id: DriverState.hs,v 1.94 2003/06/25 08:20:21 simonpj Exp $
 --
 -- Settings for the driver
 --
@@ -95,6 +95,8 @@ GLOBAL_VAR(v_Scale_sizes_by,          1.0,            Double)
 GLOBAL_VAR(v_Static,                   True,           Bool)
 GLOBAL_VAR(v_NoLink,                   False,          Bool)
 GLOBAL_VAR(v_NoHsMain,                         False,          Bool)
+GLOBAL_VAR(v_MainModIs,                        Nothing,        Maybe String)
+GLOBAL_VAR(v_MainFunIs,                        Nothing,        Maybe String)
 GLOBAL_VAR(v_Recomp,                   True,           Bool)
 GLOBAL_VAR(v_Collect_ghc_timing,       False,          Bool)
 GLOBAL_VAR(v_Do_asm_mangling,          True,           Bool)
@@ -191,7 +193,6 @@ setOptLevel n = do
 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_CSE,                      True,  Bool)
 GLOBAL_VAR(v_RuleCheck,                Nothing,  Maybe String)
@@ -212,7 +213,6 @@ hsc_minusNoO_flags =
 hsc_minusO_flags =
   [ 
        "-fignore-asserts",
-       "-ffoldr-build-on",
         "-fdo-eta-reduction",
        "-fdo-lambda-eta-expansion",
        "-fcase-merge",
@@ -230,7 +230,6 @@ buildCoreToDo :: IO [CoreToDo]
 buildCoreToDo = do
    opt_level  <- readIORef v_OptLevel
    max_iter   <- readIORef v_MaxSimplifierIterations
-   usageSP    <- readIORef v_UsageSPInf
    strictness <- readIORef v_Strictness
    cse        <- readIORef v_CSE
    rule_check <- readIORef v_RuleCheck
@@ -278,10 +277,6 @@ buildCoreToDo = do
        ],
        case rule_check of { Just pat -> CoreDoRuleCheck 2 pat; Nothing -> CoreDoNothing },
 
-       -- infer usage information here in case we need it later.
-        -- (add more of these where you need them --KSW 1999-04)
-        if usageSP then CoreDoUSPInf else CoreDoNothing,
-
        CoreDoSimplify (SimplPhase 1) [
                -- Need inline-phase2 here so that build/augment get 
                -- inlined.  I found that spectral/hartel/genfft lost some useful
@@ -484,7 +479,12 @@ mungePackagePaths top_dir ps = map munge_pkg ps
 -- earlier packages may depend on later ones, but not vice versa
 GLOBAL_VAR(v_ExplicitPackages, initPackageList, [PackageName])
 
-initPackageList = [rtsPackage]
+initPackageList = [basePackage, rtsPackage]
+       -- basePackage is part of this list entirely because of 
+       -- wired-in names in GHCi.  See the notes on wired-in names in
+       -- Linker.linkExpr.  By putting the base backage in initPackageList
+       -- we make sure that it'll always by linked.
+
 
 -- add a package requested from the command-line
 addPackage :: String -> IO ()
@@ -598,7 +598,7 @@ getPackageExtraCcOpts pkgs = do
 
 #ifdef darwin_TARGET_OS
 getPackageFrameworkPath  :: [PackageName] -> IO [String]
-getPackageFrameworkPath = do
+getPackageFrameworkPath pkgs = do
   ps <- getExplicitPackagesAnd pkgs
   return (nub (filter notNull (concatMap framework_dirs ps)))
 
@@ -779,7 +779,9 @@ way_details =
     (WaySMP, Way  "s" "SMP"
        [ "-fsmp"
        , "-optc-pthread"
+#ifndef freebsd_TARGET_OS
        , "-optl-pthread"
+#endif
        , "-optc-DSMP"
        , "-fvia-C" ]),