darcs patch: #221: specific include and library searc... (and 1
more)
Pepe Iborra
mnislaih at gmail.com
Mon Mar 17 16:32:05 EDT 2008
Mon Mar 17 19:12:03 CET 2008 Pepe Iborra <mnislaih at gmail.com>
* #221: specific include and library search paths options
This patch adds two new command line options to configure,
--extra-include-dirs and extra-lib-dirs.
These have effect over all the buildables in a project.
What is missing now is support for reading these from the .cabal/config file.
That will be done as part of ticket #223.
Mon Mar 17 21:30:15 CET 2008 Pepe Iborra <mnislaih at gmail.com>
* #223 part 1: Extend Distribution.Command.Simple.Option
so that it really represents an option and not just a flag.
It's been renamed to OptionField as it models a field in a flags-like data structure.
data OptionField a = OptionField {
optionName :: Name,
optionDescr :: [OptDescr a] }
data OptDescr a = ReqArg Description OptFlags ArgDescr (ReadE (a->a)) (a -> [String])
| OptArg Description OptFlags ArgDescr (ReadE (a->a)) (a->a) (a -> [Maybe String])
| ChoiceOpt [(Description, OptFlags, a->a, a -> Bool)]
| BoolOpt Description OptFlags{-True-} OptFlags{-False-} (Bool -> a -> a) (a -> Bool)
An option field can expand to several command line options, which are all defined together.
For example, the compiler flag is defined as follows.
option [] ["compiler"] "compiler"
configHcFlavor (\v flags -> flags { configHcFlavor = v })
(choiceOpt [ (Flag GHC, ("g", ["ghc"]), "compile with GHC")
, (Flag NHC, ([] , ["nhc98"]), "compile with NHC")
, (Flag JHC, ([] , ["jhc"]), "compile with JHC")
, (Flag Hugs,([] , ["hugs"]), "compile with Hugs")])
We can need to use several kinds of OptDescr for the same option, as in the
optimization Option (really a extreme case):
,multiOption "optimization"
configOptimization (\v flags -> flags { configOptimization = v })
[optArg' "n" (Flag . flagToOptimisationLevel)
....
....
"Build with optimization (n is 0--2, default is 1)",
noArg (Flag NoOptimisation) []
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: text/x-darcs-patch
Size: 110260 bytes
Desc: A darcs patch for your repository!
Url : http://www.haskell.org/pipermail/cabal-devel/attachments/20080317/6bcd7107/attachment-0001.bin
More information about the cabal-devel
mailing list