conditional (FreeBSD version specific) OPTIONS definition

Shaun Amott shaun at inerd.com
Sun Mar 19 23:53:09 UTC 2006


On Mon, Mar 20, 2006 at 12:08:36AM +0300, Alexander Zhuravlev wrote:
> 
> Why is it declined to define OPTIONS after inclusion of the bsd.port.pre.mk
> file? Is it possible to impement dynamic options definition using other means?
> 

Unfortuately, it's a limitation of the current system. OPTIONS is
processed in bsd.port.pre.mk, so you can't act on the user's choices
before then.

> 
> .if defined(WITH_ZLIB_COMPRESSION) && ${OSVERSION} < 500000
> CONFIGURE_ARGS+=--with-http-zlib-compression=/usr
> .else
> CONFIGURE_ARGS+=--without-http-zlib-compression
> .endif
> 

I think you'd need to at the least warn the user, or possibly use IGNORE
to tell them that particular option isn't unavailable.

Since it doesn't seem to add any dependencies, perhaps you could simply
enable it for OSVERSION > 500000, and disable it otherwise? On supported
systems, you could then allow the user to manually disable with a make
command-line argument.

I suppose you could also manually define OSVERSION before including
bsd.port.pre.mk:

OSVERSION!=		/sbin/sysctl -n kern.osreldate

Whether or not that would be acceptable, I don't know.

-- 
Shaun Amott [ PGP: 0x6B387A9A ]
    Scientia Est Potentia.


More information about the freebsd-ports mailing list