Cabal-1.16.0: A framework for packaging Haskell software

Safe Haskell | None

Distribution.Simple.Program.GHC

Synopsis

- data GhcOptions = GhcOptions {
  - ghcOptMode :: Flag GhcMode
  - ghcOptExtra :: [String]
  - ghcOptExtraDefault :: [String]
  - ghcOptInputFiles :: [FilePath]
  - ghcOptInputModules :: [ModuleName]
  - ghcOptOutputFile :: Flag FilePath
  - ghcOptSourcePathClear :: Flag Bool
  - ghcOptSourcePath :: [FilePath]
  - ghcOptPackageName :: Flag PackageId
  - ghcOptPackageDBs :: PackageDBStack
  - ghcOptPackages :: [(InstalledPackageId, PackageId)]
  - ghcOptHideAllPackages :: Flag Bool
  - ghcOptNoAutoLinkPackages :: Flag Bool
  - ghcOptLinkLibs :: [FilePath]
  - ghcOptLinkLibPath :: [FilePath]
  - ghcOptLinkOptions :: [String]
  - ghcOptLinkFrameworks :: [String]
  - ghcOptNoLink :: Flag Bool
  - ghcOptCcOptions :: [String]
  - ghcOptCppOptions :: [String]
  - ghcOptCppIncludePath :: [FilePath]
  - ghcOptCppIncludes :: [FilePath]
  - ghcOptFfiIncludes :: [FilePath]
  - ghcOptLanguage :: Flag Language
  - ghcOptExtensions :: [Extension]
  - ghcOptExtensionMap :: [(Extension, String)]
  - ghcOptOptimisation :: Flag GhcOptimisation
  - ghcOptProfilingMode :: Flag Bool
  - ghcOptSplitObjs :: Flag Bool
  - ghcOptGHCiScripts :: [FilePath]
  - ghcOptHiSuffix :: Flag String
  - ghcOptObjSuffix :: Flag String
  - ghcOptHiDir :: Flag FilePath
  - ghcOptObjDir :: Flag FilePath
  - ghcOptStubDir :: Flag FilePath
  - ghcOptDynamic :: Flag Bool
  - ghcOptShared :: Flag Bool
  - ghcOptFPic :: Flag Bool
  - ghcOptDylibName :: Flag String
  - ghcOptVerbosity :: Flag Verbosity
  - ghcOptCabal :: Flag Bool
  }
- data GhcMode
  - = GhcModeCompile
  - | GhcModeLink
  - | GhcModeMake
  - | GhcModeInteractive
  - | GhcModeAbiHash
- data GhcOptimisation
  - = GhcNoOptimisation
  - | GhcNormalOptimisation
  - | GhcMaximumOptimisation
  - | GhcSpecialOptimisation String
- ghcInvocation :: ConfiguredProgram -> GhcOptions -> ProgramInvocation
- renderGhcOptions :: Version -> GhcOptions -> [String]
- runGHC :: Verbosity -> ConfiguredProgram -> GhcOptions -> IO ()

# Documentation

data GhcOptions

A structured set of GHC options/flags

Constructors

GhcOptions |
Fields ghcOptMode :: Flag GhcMode The major mode for the ghc invocation. ghcOptExtra :: [String] Any extra options to pass directly to ghc. These go at the end and hence override other stuff. ghcOptExtraDefault :: [String] Extra default flags to pass directly to ghc. These go at the beginning and so can be overridden by other stuff. ghcOptInputFiles :: [FilePath] The main input files; could be .hs, .hi, .c, .o, depending on mode. ghcOptInputModules :: [ModuleName] The names of input Haskell modules, mainly for `--make` mode. ghcOptOutputFile :: Flag FilePath Location for output file; the `ghc -o` 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 :: [FilePath] Search path for Haskell source files; the `ghc -i` flag. ghcOptPackageName :: Flag PackageId The package name the modules will belong to; the `ghc -package-name` flag ghcOptPackageDBs :: PackageDBStack GHC package databases to use, the `ghc -package-conf` flag ghcOptPackages :: [(InstalledPackageId, PackageId)] 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. ghcOptLinkLibs :: [FilePath] Names of libraries to link in; the `ghc -l` flag. ghcOptLinkLibPath :: [FilePath] Search path for libraries to link in; the `ghc -L` flag. ghcOptLinkOptions :: [String] Options to pass through to the linker; the `ghc -optl` flag. ghcOptLinkFrameworks :: [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. ghcOptCcOptions :: [String] Options to pass through to the C compiler; the `ghc -optc` flag. ghcOptCppOptions :: [String] Options to pass through to CPP; the `ghc -optP` flag. ghcOptCppIncludePath :: [FilePath] Search path for CPP includes like header files; the `ghc -I` flag. ghcOptCppIncludes :: [FilePath] Extra header files to include at CPP stage; the `ghc -optP-include` flag. ghcOptFfiIncludes :: [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 :: [Extension] The language extensions; the `ghc -X` flag. ghcOptExtensionMap :: [(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. 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. ghcOptGHCiScripts :: [FilePath] Extra GHCi startup scripts; the `-ghci-script` flag ghcOptHiSuffix :: Flag String ghcOptObjSuffix :: Flag String ghcOptHiDir :: Flag FilePath ghcOptObjDir :: Flag FilePath ghcOptStubDir :: Flag FilePath ghcOptDynamic :: Flag Bool ghcOptShared :: Flag Bool ghcOptFPic :: Flag Bool ghcOptDylibName :: Flag String 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

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

Constructors

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

Instances

Eq GhcOptimisation |
Show GhcOptimisation |

ghcInvocation :: ConfiguredProgram -> GhcOptions -> ProgramInvocation

renderGhcOptions :: Version -> GhcOptions -> [String]

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