What is the right way to make OPTIONS_DEFAULT depend on

Mathieu Arnold mat at FreeBSD.org
Mon Sep 4 22:02:15 UTC 2017


Le 03/09/2017 à 16:51, Matthew Seaman a écrit :
> On 03/09/2017 05:57, Yuri wrote:
>> This doesn't work:
>>
>>> .include <bsd.port.options.mk>
>>>
>>> .if ${OPSYS} == FreeBSD && ${OSVERSION} < 1100000
>>> OPTIONS_DEFAULT+= MYOPT
>>> .endif
>> MYOPT isn't picked up
>>
>>
>> I tried with a regular expressions, witout .include:
>>> SYSVERSION=    ${OPSYS}${OSVERSION}
>>> OPTIONS_DEFAULT=HELP
>>> ${SYSVERSION:C/^FreeBSD1[1-9][0-9]{5}$/MYOPT/:MMYOPT}
>> MYOPT isn't picked up again.
>>
> If you're referring to $OPSYS or $OSVERSION then you'll want to
> put that section of code after
>
> .include <bsd.port.pre.mk>
>
> and obviously change the last line in your Makefile to
>
> .include <bsd.port.post.mk>


But you cannot define any OPTIONS_* variables after including
bsd.port.options.mk (which happen about in the middle of what
bsd.port.pre.mk does.)


The thing that people who want to do something like this usually do is
an ugly:


OPTIONS_DEFAULT= FOO BAR ${OPTIONS_DEFAULT_${OPSYS}_${OSREL:R}}
OPTIONS_DEFAULT_FreeBSD_10= BAZ


It is usually a bad idea, why are you trying to do this ?


-- 
Mathieu Arnold


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 949 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freebsd.org/pipermail/freebsd-ports/attachments/20170905/24af823f/attachment.sig>


More information about the freebsd-ports mailing list