Cabal- A framework for packaging Haskell software

Safe HaskellNone



This deals with the configure phase. It provides the configure action which is given the package description and configure flags. It then tries to: configure the compiler; resolves any conditionals in the package description; resolve the package dependencies; check if all the extensions used by this package are supported by the compiler; check that all the build tools are available (including version checks if appropriate); checks for any required pkg-config packages (updating the BuildInfo with the results)

Then based on all this it saves the info in the LocalBuildInfo and writes it out to the dist/setup-config file. It also displays various details to the user, the amount of information displayed depending on the verbosity level.



configure :: (GenericPackageDescription, HookedBuildInfo) -> ConfigFlags -> IO LocalBuildInfoSource

Perform the "./setup configure" action. Returns the .setup-config file.

writePersistBuildConfig :: FilePath -> LocalBuildInfo -> IO ()Source

After running configure, output the LocalBuildInfo to the localBuildInfoFile.

getPersistBuildConfig :: FilePath -> IO LocalBuildInfoSource

Read the localBuildInfoFile. Error if it doesn't exist. Also fail if the file containing LocalBuildInfo is older than the .cabal file, indicating that a re-configure is required.

checkPersistBuildConfigOutdated :: FilePath -> FilePath -> IO BoolSource

Check that localBuildInfoFile is up-to-date with respect to the .cabal file.

configCompilerAux :: ConfigFlags -> IO (Compiler, ProgramConfiguration)Source

Deprecated: configCompilerAux is deprecated. Use configCompilerAuxEx instead.

ccLdOptionsBuildInfo :: [String] -> [String] -> BuildInfoSource

Makes a BuildInfo from C compiler and linker flags.

This can be used with the output from configuration programs like pkg-config and similar package-specific programs like mysql-config, freealut-config etc. For example:

 ccflags <- rawSystemProgramStdoutConf verbosity prog conf ["--cflags"]
 ldflags <- rawSystemProgramStdoutConf verbosity prog conf ["--libs"]
 return (ccldOptionsBuildInfo (words ccflags) (words ldflags))

interpretPackageDbFlags :: Bool -> [Maybe PackageDB] -> PackageDBStackSource

The user interface specifies the package dbs to use with a combination of --global, --user and --package-db=global|user|clear|$file. This function combines the global/user flag and interprets the package-db flag into a single package db stack.