Re: AW: A question about options

Rikka Göring <[email protected]>
Newsgroups gmane.os.freebsd.devel.ports
Message-ID <DU2P189MB179715566AD21789CB4A89A497E0A@DU2P189MB1797.EURP189.PROD.OUTLOOK.COM>
Hi Thierry,

You’re absolutely right, OPSYS and OSREL aren’t available before bsd.options.mk (or bsd.port.pre.mk), so the .if logic I mentioned can’t influence OPTIONS_DEFAULT early enough.

In that case, maybe the cleanest current workaround would indeed be to rely on OPTIONS_EXCLUDE_FreeBSD_16= PREVASSET and let the other option (GCC) become the implicit default in the RADIO group. That at least ensures the correct behavior on 16+.

Otherwise, this seems like a real framework gap — maybe worth extending bsd.options.mk with support for OPTIONS_DEFAULT_${OPSYS}_${OSREL:R}, mirroring how the OPTIONS_EXCLUDE_* macros work today. That would make conditional defaults possible in a clean, declarative way.

Best regards,
Rikka

P.S.: Resending to list — my earlier reply went off-list by mistake.

Am 07.10.2025 00:17 schrieb Rikka Göring <[email protected]>:

Hi Thierry,

You’re absolutely right, OPSYS and OSREL aren’t available before
bsd.options.mk (or bsd.port.pre.mk), so the .if logic I mentioned can’t influence
OPTIONS_DEFAULT early enough.

In that case, maybe the cleanest current workaround would indeed be to rely on
OPTIONS_EXCLUDE_FreeBSD_16= PREVASSET and let the other option (GCC) become the implicit default in the
RADIO group. That at least ensures the correct behavior on 16+.

Otherwise, this seems like a real framework gap — maybe worth extending bsd.options.mk with support for
OPTIONS_DEFAULT_${OPSYS}_${OSREL:R}, mirroring how the OPTIONS_EXCLUDE_* macros work today. That would make conditional defaults possible in a clean, declarative way.

Best regards,

Rikka

----------

Von: Thierry Thomas

Gesendet: Montag, 06. Oktober 2025 10:03

Bis: Rikka Göring

Betreff: Re: A question about options

Le lun. 6 oct. 25 à 3:39:56 +0200, Rikka Göring <[email protected]>

écrivait :

> Hi Thierry,

Hello Rikka,

> I think there isn't currently a macro like

> OPTIONS_DEFAULT_${OPSYS}_${OSREL:R}, only the OPTIONS_EXCLUDE_*

> variants, so defaults can't be dynamically adjusted per release using

> existing helpers.

> A possible workaround might be to set defaults programmatically in a

> .if block, e.g.:

> .if ${OPSYS} == FreeBSD && ${OSREL:R} >= 16

> OPTIONS_DEFAULT= GCC

> .else

> OPTIONS_DEFAULT= PREVASSET

> .endif

> That would avoid having to globally change the default while still

> staying within the framework.

> (Unless I missed a more elegant way, but I don't think the framework

> currently exposes one.)

Thanks for your answer, but actually you cannot check OPSYS and OSREL

before bsd.options.mk (or bsd.port.pre.mk), and it’s impossible to set

an option after them…

Best regards,

--

Th. Thomas.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.