Passing arguments through to configure

Duncan Coutts duncan.coutts at
Fri Dec 28 08:34:39 EST 2007

On Thu, 2007-12-27 at 21:30 -0800, Bryan O'Sullivan wrote:
> I'm writing bindings for LLVM at the moment, and I'm using autoconf to
> ensure that LLVM is really installed, and that the necessary version is
> present.
> Unfortunately, I can't find any pre-existing examples of how to pass
> arguments from Setup configure through to configure.  This is something
> I need so that I can build against an SVN build of LLVM, instead of
> installing it to /usr/local where it would indeed get found.

> What I'd like to be able to do is augment the arguments accepted by
> Setup configure to include e.g. --with-llvm=/PREFIX and then pass that
> through to ./configure.  After reading the Cabal source for a while, I
> eventually noticed --configure-option, but I was hoping to do something
> a little more integrated, along the lines of adding a --with-llvm
> option.  Is this realistic?  The code doesn't currently seem to be set
> up to permit that kind of extensibility.

There is a way to add extra options via Setup.hs. The parseConfigureArgs
takes extra custom flags. However I'm not sure sure it's a very good
idea since it's nearly impossible for cabal-install to support those
options, since it has to parse its command line before calling Setup.hs.

That said, we do need a better method than --configure-option= since we
don't expect people to have to use autoconf to be able to customise


More information about the cabal-devel mailing list