pkgsrc-WIP-discuss archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: options handling when there are LOTS of options



On Wed, 20 Jan 2010 17:03:50 -0600
"Larson, Timothy E." <TELarson%west.com@localhost> wrote:

> Is there a way to make package options take a value, rather than simple 
> binary (present/nonpresent) switches?  I've got a package with over 40 
> possible drivers. I think it would be a lot easier to take a comma-delimited 
> string and pass it straight to configure since that's the kind of format it's 
> expecting, than to construct such a string from bunches of individual 
> options.  Especially since its configure already supports "all,!driver" 
> syntax.

I think in this case you need to roll your own configuration variable
and not use the options framework at all. I suggest something like this:

.include "../../mk/bsd.prefs.mk"
PKGNAME_ENABLED_DRIVERS?=foo,bar,baz

BUILD_DEFS+=    PKGNAME_ENABLED_DRIVERS

CONFIGURE_ARGS+=        --enable-drivers=${PKGNAME_ENABLED_DRIVERS}

At build time it will generate a message like this:

==========================================================================
The following variables will affect the build process of this package,
pkgname-0.1.  Their current value is shown below:

        * PKGNAME_ENABLED_DRIVERS = foo,bar,baz

You may want to abort the process now with CTRL-C and change their value
before continuing.  Be sure to run `/usr/bin/make clean' after
the changes.
==========================================================================

------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
pkgsrc-wip-discuss mailing list
pkgsrc-wip-discuss%lists.sourceforge.net@localhost
https://lists.sourceforge.net/lists/listinfo/pkgsrc-wip-discuss


Home | Main Index | Thread Index | Old Index