On 6/4/2012 8:30 AM, Bryan Drewery wrote:
> 
> 
> On 6/3/2012 1:44 PM, Baptiste Daroussin wrote:
>> Hi,
>>
>> The new options framework is now in the port for a week, most of the problems
>> directly concerning the framework seems to have been addressed.
>>
>> regards,
>> Bapt
> 
> A common question I have seen is how to support 0 or 1 in the SINGLE list.
> 
> You can achieve this by adding the SINGLE group to the OPTIONS_DEFINE.
> 
> For example:
> 
> OPTIONS_DEFINE=       DB_OVERRIDE
> OPTIONS_SINGLE= DB_OVERRIDE
> OPTIONS_SINGLE_DB_OVERRIDE=   BDB4 BDB1
> OPTIONS_DEFAULT=      DB_OVERRIDE BDB4
> DB_OVERRIDE_DESC=     Override DB backend instead of default DBM
> BDB1_DESC=    Use Berkeley DB 1
> BDB4_DESC=    Use Berkeley DB >=2
> 
> Here DB_OVERRIDE must be selected to select either of BDB4 or BDB1.
> 
> This gives you 0 or 1 on the BDB4/BDB1.
> 

You can do the same with MULTI as well to achieve 0 or many. This has
been documented in the handbook now.

Another common question is how to check if an option is not set. We all
try !${PORT_OPTIONS:MFOO} to find it does not work.

Use empty():

.if empty(PORT_OPTIONS:MFOO)
CONFIGURE_ARGS+= --disable-foo
.else
CONFIGURE_ARGS+= --enable-foo
.endif

Wiki is updated on this, handbook being updated.

Regards,
Bryan Drewery

_______________________________________________
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "freebsd-ports-unsubscr...@freebsd.org"

Reply via email to