Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 08 Jun 2012 07:50:57 -0500
From:      Bryan Drewery <bryan@shatow.net>
To:        ports@FreeBSD.org
Cc:        Baptiste Daroussin <bapt@FreeBSD.org>
Subject:   Re: [HEADSUP] Please convert your ports to new options framework
Message-ID:  <4FD1F531.2030609@shatow.net>
In-Reply-To: <4FCCB88B.6030007@shatow.net>
References:  <20120603184448.GI92976@ithaqua.etoilebsd.net> <4FCCB88B.6030007@shatow.net>

next in thread | previous in thread | raw e-mail | index | archive | help


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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4FD1F531.2030609>