Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 5 Sep 2017 00:02:10 +0200
From:      Mathieu Arnold <mat@FreeBSD.org>
To:        freebsd-ports@freebsd.org
Subject:   Re: What is the right way to make OPTIONS_DEFAULT depend on
Message-ID:  <4e6f084f-45b6-aafd-0a37-0c9511d82632@FreeBSD.org>
In-Reply-To: <c9c271c1-25a6-1cdf-7790-b4e16a03812f@FreeBSD.org>
References:  <26464750-b401-1b14-9b3f-cd9b7b83bd4f@rawbw.com> <c9c271c1-25a6-1cdf-7790-b4e16a03812f@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--tD16JVx07ViB1o3tNeqX67nBFPai7ormx
Content-Type: multipart/mixed; boundary="r13FPVsoUIb9MEKxTwwR2N566EovvGjpf";
 protected-headers="v1"
From: Mathieu Arnold <mat@FreeBSD.org>
To: freebsd-ports@freebsd.org
Message-ID: <4e6f084f-45b6-aafd-0a37-0c9511d82632@FreeBSD.org>
Subject: Re: What is the right way to make OPTIONS_DEFAULT depend on
References: <26464750-b401-1b14-9b3f-cd9b7b83bd4f@rawbw.com>
 <c9c271c1-25a6-1cdf-7790-b4e16a03812f@FreeBSD.org>
In-Reply-To: <c9c271c1-25a6-1cdf-7790-b4e16a03812f@FreeBSD.org>

--r13FPVsoUIb9MEKxTwwR2N566EovvGjpf
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Content-Language: fr

Le 03/09/2017 =C3=A0 16:51, Matthew Seaman a =C3=A9crit=C2=A0:
> On 03/09/2017 05:57, Yuri wrote:
>> This doesn't work:
>>
>>> .include <bsd.port.options.mk>
>>>
>>> .if ${OPSYS} =3D=3D FreeBSD && ${OSVERSION} < 1100000
>>> OPTIONS_DEFAULT+=3D MYOPT
>>> .endif
>> MYOPT isn't picked up
>>
>>
>> I tried with a regular expressions, witout .include:
>>> SYSVERSION=3D=C2=A0=C2=A0=C2=A0 ${OPSYS}${OSVERSION}
>>> OPTIONS_DEFAULT=3DHELP
>>> ${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=3D FOO BAR ${OPTIONS_DEFAULT_${OPSYS}_${OSREL:R}}
OPTIONS_DEFAULT_FreeBSD_10=3D BAZ


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


--=20
Mathieu Arnold



--r13FPVsoUIb9MEKxTwwR2N566EovvGjpf--

--tD16JVx07ViB1o3tNeqX67nBFPai7ormx
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQJ8BAEBCgBmBQJZrc1jXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w
ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQzQUI2OTc4OUQyRUQxMjEwNjQ0MEJBNUIz
QTQ1MTZGMzUxODNDRTQ4AAoJEDpFFvNRg85Ics0P/0doPVwKCH/fwbDFUlmZJ+iB
ctaT7oO6Nz8Y+LBcxviSauAwNh1eL6pdOpCydNfrc33fCLqcAifhRv/YjGyBc8Fo
W4LQcEEuZlvejtYAOMxCA/Qw11voMGHKrkcODgPrfH8cpSdkj1uIyEiPEeUaLtbv
Dobk6MNHIWnWLmzBKNOlzKl5EV3k19EjZgYqBZGEIFy4hz8snTYF81r04fgE2D3+
9cESWyIOLTdQNQwZCc8U4UtlAm5oAJVNO3VWW0tqfEI4t459yQqDxTFuLT+/fCn8
SBoMd5MiFpaAVEVscGFrM9BWoKWb/HwtgebjG6wIm1oTzMdg7rT/+QUT5kFjZiv3
QtozSa2bCOMCaP1b502/39grVms5oC2U72XDvAyrw8/b7F+DK8fChq4PhmqqJ2xt
Zd5o4O2r58oyGLh8dYzRVmAZ2p4lgXt+gvgW0PuZGSBkMivOlbl6JgLVcEtew8Yt
30Oeb2Ngt0h99+yQIBrZwC2UbGWMM8fjB/1yZ56yLYMwxAGDr/TVRHTbSGqLK3YT
RTRq3ql6Ubqeffrv3E0OfyVewiwjeTXBEIIR1akvOjRmahpHn0f2wgRnQxMCkZ1R
/KQDHdPiVjKSXFRt8VCbmrPElp/N3iL6ppWVprxpdMjpuhCrPNUbT9bSrQZ6sP/r
xa0Tn/A6oD8AhUcHowZv
=MbFO
-----END PGP SIGNATURE-----

--tD16JVx07ViB1o3tNeqX67nBFPai7ormx--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4e6f084f-45b6-aafd-0a37-0c9511d82632>