Commit c57e70c1 authored by duncan.coutts@worc.ox.ac.uk's avatar duncan.coutts@worc.ox.ac.uk
Browse files

This usePackages stuff is haddock-specific so name it as such

parent 81e4537c
......@@ -139,7 +139,7 @@ data ConfigFlags = ConfigFlags {
configUser :: Bool, -- ^ the --user flag?
configGHCiLib :: Bool, -- ^Enable compiling library for GHCi
configSplitObjs :: Bool, -- ^Enable -split-objs with GHC
configUsePackages :: Bool -- ^ auto-gen haddock --use-package
configHaddockUsePackages :: Bool -- ^ auto-gen haddock --use-package
}
deriving Show
......@@ -173,7 +173,7 @@ emptyConfigFlags progConf = ConfigFlags {
configUser = False,
configGHCiLib = True,
configSplitObjs = False, -- takes longer, so turn off by default
configUsePackages = True
configHaddockUsePackages = True
}
-- | Flags to @copy@: (destdir, copy-prefix (backwards compat), verbose)
......@@ -270,7 +270,7 @@ data Flag a = GhcFlag | NhcFlag | HugsFlag | JhcFlag
| LibExecDir FilePath
| DataDir FilePath
| DataSubDir FilePath
| WithUsePackages | WithoutUsePackages
| WithHaddockUsePackages | WithoutHaddockUsePackages
| ProgramArgs String String -- program name, arguments
| WithProgram String FilePath -- program name, location
......@@ -497,9 +497,9 @@ configureCmd progConf = Cmd {
"allow dependencies to be satisfied from the user package database. also implies install --user",
Option "" ["global"] (NoArg GlobalFlag)
"(default) dependencies must be satisfied from the global package database",
Option "" ["enable-use-packages"] (NoArg WithUsePackages)
"Automatically pass --use-library flags to haddock. Instead, you might use --haddock-args with --read-interface to get web links to your dependent library docs.",
Option "" ["disable-use-packages"] (NoArg WithoutUsePackages)
Option "" ["enable-haddock-use-packages"] (NoArg WithHaddockUsePackages)
"Automatically pass --use-library flags to haddock.",
Option "" ["disable-haddock-use-packages"] (NoArg WithoutHaddockUsePackages)
"Don't automatically pass --use-library flags to haddock. Instead, you might use --haddock-args with --read-interface to get web links to your dependent library docs."
]
{-
......@@ -576,8 +576,8 @@ parseConfigureArgs progConf = parseArgs (configureCmd progConf) updateCfg
updateCfg t GlobalFlag = t { configUser = False }
updateCfg t WithSplitObjs = t { configSplitObjs = True }
updateCfg t WithoutSplitObjs = t { configSplitObjs = False }
updateCfg t WithUsePackages = t { configUsePackages = True }
updateCfg t WithoutUsePackages = t { configUsePackages = False }
updateCfg t WithHaddockUsePackages = t { configHaddockUsePackages = True }
updateCfg t WithoutHaddockUsePackages = t { configHaddockUsePackages = False }
updateCfg t (Lift _) = t
updateCfg _ _ = error $ "Unexpected flag!"
......
......@@ -424,7 +424,7 @@ haddock pkg_descr lbi hooks (HaddockFlags hoogle verbose) = do
"--package=" ++ showPkg,
"--dump-interface=" ++ haddockFile,
"--prologue=" ++ prologName]
++ if usePackages lbi then
++ if haddockUsePackages lbi then
map ("--use-package=" ++) showDepPkgs
else []
++ programArgs confHaddock
......@@ -446,7 +446,7 @@ haddock pkg_descr lbi hooks (HaddockFlags hoogle verbose) = do
([outputFlag,
"--odir=" ++ exeTargetDir,
"--title=" ++ exeName exe]
++ if usePackages lbi then
++ if haddockUsePackages lbi then
map ("--use-package=" ++) showDepPkgs
else []
++ programArgs confHaddock
......
......@@ -239,7 +239,7 @@ configure pkg_descr cfg
withGHCiLib=configGHCiLib cfg,
splitObjs=split_objs,
userConf=configUser cfg,
usePackages=configUsePackages cfg
haddockUsePackages=configHaddockUsePackages cfg
}
-- FIXME: maybe this should only be printed when verbose?
......
......@@ -116,7 +116,7 @@ data LocalBuildInfo = LocalBuildInfo {
withOptimization :: Bool, -- ^Whether to build with optimization (if available).
withGHCiLib :: Bool, -- ^Whether to build libs suitable for use with GHCi.
splitObjs :: Bool, -- ^Use -split-objs with GHC, if available
usePackages :: Bool -- ^Auto-gen --use-package for haddock
haddockUsePackages :: Bool -- ^Auto-gen --use-package for haddock
} deriving (Read, Show)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment