+{-# OPTIONS -fno-warn-missing-fields #-}
-----------------------------------------------------------------------------
--
-- Dynamic flags
import CmdLineParser
import Constants ( mAX_CONTEXT_REDUCTION_DEPTH )
import Panic ( panic, GhcException(..) )
+import UniqFM ( UniqFM )
import Util ( notNull, splitLongestPrefix, normalisePath )
import Maybes ( fromJust, orElse )
import SrcLoc ( SrcSpan )
import Monad ( when )
#ifdef mingw32_TARGET_OS
import Data.List ( isPrefixOf )
+#else
+import Util ( split )
#endif
+
import Char ( isDigit, isUpper )
import Outputable
import System.IO ( hPutStrLn, stderr )
| Opt_AllowIncoherentInstances
| Opt_MonomorphismRestriction
| Opt_MonoPatBinds
+ | Opt_ExtendedDefaultRules -- Use GHC's extended rules for defaulting
| Opt_GlasgowExts
| Opt_FFI
- | Opt_PArr -- syntactic support for parallel arrays
- | Opt_Arrows -- Arrow-notation syntax
+ | Opt_PArr -- Syntactic support for parallel arrays
+ | Opt_Arrows -- Arrow-notation syntax
| Opt_TH
| Opt_ImplicitParams
| Opt_Generics
cmdlineFrameworks :: [String], -- ditto
tmpDir :: String, -- no trailing '/'
+ ghcUsagePath :: FilePath, -- Filled in by SysTools
+ ghciUsagePath :: FilePath, -- ditto
+
-- options for particular phases
opt_L :: [String],
opt_P :: [String],
pgm_a :: (String,[Option]),
pgm_l :: (String,[Option]),
pgm_dll :: (String,[Option]),
+ pgm_T :: String,
+ pgm_sysman :: String,
- -- ** Package flags
+ -- Package flags
extraPkgConfs :: [FilePath],
+ topDir :: FilePath, -- filled in by SysTools
+ systemPackageConfig :: FilePath, -- ditto
-- The -package-conf flags given on the command line, in the order
-- they appeared.
packageFlags :: [PackageFlag],
-- The -package and -hide-package flags from the command-line
- -- ** Package state
+ -- Package state
+ -- NB. do not modify this field, it is calculated by
+ -- Packages.initPackages and Packages.updatePackages.
+ pkgDatabase :: Maybe (UniqFM InstalledPackageInfo),
pkgState :: PackageState,
-- hsc dynamic flags
= ExposePackage String
| HidePackage String
| IgnorePackage String
+ deriving Eq
defaultHscTarget
| cGhcWithNativeCodeGen == "YES" = HscAsm
ctxtStkDepth = mAX_CONTEXT_REDUCTION_DEPTH,
thisPackage = mainPackageId,
-
- wayNames = panic "ways",
- buildTag = panic "buildTag",
- rtsBuildTag = panic "rtsBuildTag",
objectDir = Nothing,
hiDir = Nothing,
opt_dll = [],
opt_dep = [],
- pgm_L = panic "pgm_L",
- pgm_P = panic "pgm_P",
- pgm_F = panic "pgm_F",
- pgm_c = panic "pgm_c",
- pgm_m = panic "pgm_m",
- pgm_s = panic "pgm_s",
- pgm_a = panic "pgm_a",
- pgm_l = panic "pgm_l",
- pgm_dll = panic "pgm_mkdll",
-
extraPkgConfs = [],
packageFlags = [],
- pkgState = panic "pkgState",
+ pkgDatabase = Nothing,
+ pkgState = panic "no package state yet: call GHC.setSessionDynFlags",
flags = [
Opt_RecompChecking,
( "bang-patterns", Opt_BangPatterns ),
( "monomorphism-restriction", Opt_MonomorphismRestriction ),
( "mono-pat-binds", Opt_MonoPatBinds ),
+ ( "extended-default-rules", Opt_ExtendedDefaultRules ),
( "implicit-params", Opt_ImplicitParams ),
( "allow-overlapping-instances", Opt_AllowOverlappingInstances ),
( "allow-undecidable-instances", Opt_AllowUndecidableInstances ),
Opt_GlasgowExts,
Opt_FFI,
Opt_ImplicitParams,
- Opt_ScopedTypeVariables,
- Opt_BangPatterns ]
+ Opt_ScopedTypeVariables ]
isFFlag f = f `elem` (map fst fFlags)
getFFlag f = fromJust (lookup f fFlags)