Re: src.conf(5) to specify multiple flavours of a port

From: Enji Cooper <yaneurabeya_at_gmail.com>
Date: Tue, 22 Aug 2023 16:40:31 UTC
> On Aug 21, 2023, at 10:01 PM, Bakul Shah <bakul@iitbombay.org> wrote:
> 
> On Aug 21, 2023, at 9:24 PM, Graham Perrin <grahamperrin@gmail.com> wrote:
>> 
>> In a thread elsewhere, as an example that did not involve src.conf, Mark Johnston wrote:
>> 
>>> $ cd /usr/ports/graphics/gpu-firmware-intel-kmod
>>> $ sudo make reinstall FLAVOR=kabylake
>> 
>> How might I use /etc/src.conf to achieve much the same, with a different port?
> 
> Since /etc/src.conf is included from make, may be you can use some make feature
> for conditional define?

I think there’s some confusion… /etc/make.conf is always included by bmake; /etc/src.conf is only included when building the base system.
FreeBSD ports doesn’t have a special systemwide config file like the base system for toggling build/install behavior, but it does have "${PORTSDIR}/Mk/bsd.local.mk” .
-Enji

$ grep -r /etc/src.conf share/mk/
share/mk/src.opts.mk:# Users define WITH_FOO and WITHOUT_FOO on the command line or in /etc/src.conf
share/mk/src.opts.mk:# to set via WITH_*/WITHOUT_* in /etc/src.conf and override in the
share/mk/bsd.port.mk:# Needed to keep bsd.own.mk from reading in /etc/src.conf
share/mk/bsd.opts.mk:# Users define WITH_FOO and WITHOUT_FOO on the command line or in /etc/src.conf
share/mk/bsd.opts.mk:# to set via WITH_*/WITHOUT_* in /etc/src.conf and override in the
share/mk/src.sys.mk:SRCCONF?=   /etc/src.conf
share/mk/src.sys.mk:    (exists(${SRCCONF}) || ${SRCCONF} != "/etc/src.conf") && \