Cabal-1.22.4.0: A framework for packaging Haskell software

Safe Haskell | None
Language | Haskell98

Distribution.Simple.Program.GHC

Synopsis

- data GhcOptions = GhcOptions {
  - ghcOptMode :: Flag GhcMode
  - ghcOptExtra :: NubListR String
  - ghcOptExtraDefault :: NubListR String
  - ghcOptInputFiles :: NubListR FilePath
  - ghcOptInputModules :: NubListR ModuleName
  - ghcOptOutputFile :: Flag FilePath
  - ghcOptOutputDynFile :: Flag FilePath
  - ghcOptSourcePathClear :: Flag Bool
  - ghcOptSourcePath :: NubListR FilePath
  - ghcOptPackageKey :: Flag PackageKey
  - ghcOptPackageDBs :: PackageDBStack
  - ghcOptPackages :: NubListR (InstalledPackageId, PackageId, ModuleRenaming)
  - ghcOptHideAllPackages :: Flag Bool
  - ghcOptNoAutoLinkPackages :: Flag Bool
  - ghcOptSigOf :: [(ModuleName, (PackageKey, ModuleName))]
  - ghcOptLinkLibs :: NubListR FilePath
  - ghcOptLinkLibPath :: NubListR FilePath
  - ghcOptLinkOptions :: NubListR String
  - ghcOptLinkFrameworks :: NubListR String
  - ghcOptNoLink :: Flag Bool
  - ghcOptLinkNoHsMain :: Flag Bool
  - ghcOptCcOptions :: NubListR String
  - ghcOptCppOptions :: NubListR String
  - ghcOptCppIncludePath :: NubListR FilePath
  - ghcOptCppIncludes :: NubListR FilePath
  - ghcOptFfiIncludes :: NubListR FilePath
  - ghcOptLanguage :: Flag Language
  - ghcOptExtensions :: NubListR Extension
  - ghcOptExtensionMap :: Map Extension String
  - ghcOptOptimisation :: Flag GhcOptimisation
  - ghcOptDebugInfo :: Flag Bool
  - ghcOptProfilingMode :: Flag Bool
  - ghcOptSplitObjs :: Flag Bool
  - ghcOptNumJobs :: Flag (Maybe Int)
  - ghcOptHPCDir :: Flag FilePath
  - ghcOptGHCiScripts :: NubListR FilePath
  - ghcOptHiSuffix :: Flag String
  - ghcOptObjSuffix :: Flag String
  - ghcOptDynHiSuffix :: Flag String
  - ghcOptDynObjSuffix :: Flag String
  - ghcOptHiDir :: Flag FilePath
  - ghcOptObjDir :: Flag FilePath
  - ghcOptOutputDir :: Flag FilePath
  - ghcOptStubDir :: Flag FilePath
  - ghcOptDynLinkMode :: Flag GhcDynLinkMode
  - ghcOptShared :: Flag Bool
  - ghcOptFPic :: Flag Bool
  - ghcOptDylibName :: Flag String
  - ghcOptRPaths :: NubListR FilePath
  - ghcOptVerbosity :: Flag Verbosity
  - ghcOptCabal :: Flag Bool
  }
- data GhcMode
  - = GhcModeCompile
  - | GhcModeLink
  - | GhcModeMake
  - | GhcModeInteractive
  - | GhcModeAbiHash
- data GhcOptimisation
  - = GhcNoOptimisation
  - | GhcNormalOptimisation
  - | GhcMaximumOptimisation
  - | GhcSpecialOptimisation String
- data GhcDynLinkMode
  - = GhcStaticOnly
  - | GhcDynamicOnly
  - | GhcStaticAndDynamic
- ghcInvocation :: ConfiguredProgram -> Compiler -> GhcOptions -> ProgramInvocation
- renderGhcOptions :: Compiler -> GhcOptions -> [String]
- runGHC :: Verbosity -> ConfiguredProgram -> Compiler -> GhcOptions -> IO ()

# Documentation

data GhcOptions Source

A structured set of GHC options/flags

Constructors

GhcOptions |
Fields ghcOptMode :: Flag GhcMode The major mode for the ghc invocation. ghcOptExtra :: NubListR String Any extra options to pass directly to ghc. These go at the end and hence override other stuff. ghcOptExtraDefault :: NubListR String Extra default flags to pass directly to ghc. These go at the beginning and so can be overridden by other stuff. ghcOptInputFiles :: NubListR FilePath The main input files; could be .hs, .hi, .c, .o, depending on mode. ghcOptInputModules :: NubListR ModuleName The names of input Haskell modules, mainly for `--make` mode. ghcOptOutputFile :: Flag FilePath Location for output file; the `ghc -o` flag. ghcOptOutputDynFile :: Flag FilePath Location for dynamic output file in `GhcStaticAndDynamic` mode; the `ghc -dyno` flag. ghcOptSourcePathClear :: Flag Bool Start with an empty search path for Haskell source files; the `ghc -i` flag (`-i` on it's own with no path argument). ghcOptSourcePath :: NubListR FilePath Search path for Haskell source files; the `ghc -i` flag. ghcOptPackageKey :: Flag PackageKey The package key the modules will belong to; the `ghc -this-package-key` flag. ghcOptPackageDBs :: PackageDBStack GHC package databases to use, the `ghc -package-conf` flag. ghcOptPackages :: NubListR (InstalledPackageId, PackageId, ModuleRenaming) The GHC packages to use. For compatability with old and new ghc, this requires both the short and long form of the package id; the `ghc -package` or `ghc -package-id` flags. ghcOptHideAllPackages :: Flag Bool Start with a clean package set; the `ghc -hide-all-packages` flag ghcOptNoAutoLinkPackages :: Flag Bool Don't automatically link in Haskell98 etc; the `ghc -no-auto-link-packages` flag. ghcOptSigOf :: [(ModuleName, (PackageKey, ModuleName))] What packages are implementing the signatures ghcOptLinkLibs :: NubListR FilePath Names of libraries to link in; the `ghc -l` flag. ghcOptLinkLibPath :: NubListR FilePath Search path for libraries to link in; the `ghc -L` flag. ghcOptLinkOptions :: NubListR String Options to pass through to the linker; the `ghc -optl` flag. ghcOptLinkFrameworks :: NubListR String OSX only: frameworks to link in; the `ghc -framework` flag. ghcOptNoLink :: Flag Bool Don't do the link step, useful in make mode; the `ghc -no-link` flag. ghcOptLinkNoHsMain :: Flag Bool Don't link in the normal RTS `main` entry point; the `ghc -no-hs-main` flag. ghcOptCcOptions :: NubListR String Options to pass through to the C compiler; the `ghc -optc` flag. ghcOptCppOptions :: NubListR String Options to pass through to CPP; the `ghc -optP` flag. ghcOptCppIncludePath :: NubListR FilePath Search path for CPP includes like header files; the `ghc -I` flag. ghcOptCppIncludes :: NubListR FilePath Extra header files to include at CPP stage; the `ghc -optP-include` flag. ghcOptFfiIncludes :: NubListR FilePath Extra header files to include for old-style FFI; the `ghc -#include` flag. ghcOptLanguage :: Flag Language The base language; the `ghc -XHaskell98` or `-XHaskell2010` flag. ghcOptExtensions :: NubListR Extension The language extensions; the `ghc -X` flag. ghcOptExtensionMap :: Map Extension String A GHC version-dependent mapping of extensions to flags. This must be set to be able to make use of the `ghcOptExtensions`. ghcOptOptimisation :: Flag GhcOptimisation What optimisation level to use; the `ghc -O` flag. ghcOptDebugInfo :: Flag Bool Emit debug info; the `ghc -g` flag. ghcOptProfilingMode :: Flag Bool Compile in profiling mode; the `ghc -prof` flag. ghcOptSplitObjs :: Flag Bool Use the "split object files" feature; the `ghc -split-objs` flag. ghcOptNumJobs :: Flag (Maybe Int) Run N jobs simultaneously (if possible). ghcOptHPCDir :: Flag FilePath Enable coverage analysis; the `ghc -fhpc -hpcdir` flags. ghcOptGHCiScripts :: NubListR FilePath Extra GHCi startup scripts; the `-ghci-script` flag ghcOptHiSuffix :: Flag String ghcOptObjSuffix :: Flag String ghcOptDynHiSuffix :: Flag String only in `GhcStaticAndDynamic` mode ghcOptDynObjSuffix :: Flag String only in `GhcStaticAndDynamic` mode ghcOptHiDir :: Flag FilePath ghcOptObjDir :: Flag FilePath ghcOptOutputDir :: Flag FilePath ghcOptStubDir :: Flag FilePath ghcOptDynLinkMode :: Flag GhcDynLinkMode ghcOptShared :: Flag Bool ghcOptFPic :: Flag Bool ghcOptDylibName :: Flag String ghcOptRPaths :: NubListR FilePath ghcOptVerbosity :: Flag Verbosity Get GHC to be quiet or verbose with what it's doing; the `ghc -v` flag. ghcOptCabal :: Flag Bool Let GHC know that it is Cabal that's calling it. Modifies some of the GHC error messages.

Instances

Show GhcOptions |
Monoid GhcOptions |

data GhcMode Source

Constructors

GhcModeCompile |
    ghc -c
GhcModeLink |
    ghc
GhcModeMake |
    ghc --make
GhcModeInteractive | `ghci` / `ghc --interactive`
GhcModeAbiHash | `ghc --abi-hash` | GhcModeDepAnalysis -- ^ `ghc -M` | GhcModeEvaluate -- ^ `ghc -e`

Instances

Eq GhcMode |
Show GhcMode |

data GhcOptimisation Source

Constructors

GhcNoOptimisation |
    -O0
GhcNormalOptimisation |
    -O
GhcMaximumOptimisation |
    -O2
GhcSpecialOptimisation String | e.g. `-Odph`

Instances

Eq GhcOptimisation |
Show GhcOptimisation |

data GhcDynLinkMode Source

Constructors

GhcStaticOnly |
    -static
GhcDynamicOnly |
    -dynamic
GhcStaticAndDynamic |
    -static -dynamic-too

Instances

Eq GhcDynLinkMode |
Show GhcDynLinkMode |

ghcInvocation :: ConfiguredProgram -> Compiler -> GhcOptions -> ProgramInvocation Source

renderGhcOptions :: Compiler -> GhcOptions -> [String] Source

runGHC :: Verbosity -> ConfiguredProgram -> Compiler -> GhcOptions -> IO () Source