src.conf(5) seems to affect ports build

Florent Thoumie flz at FreeBSD.org
Tue Oct 24 04:38:15 PDT 2006


On Sun, 2006-10-22 at 17:34 +0200, Jeremie Le Hen wrote:
> Ruslan,
> 
> On Sat, Oct 21, 2006 at 09:25:33PM +0400, Ruslan Ermilov wrote:
> > > Also, your patch avoids performing the WITH(OUT)_* stuff for ports in
> > > order to prevent from polluting the namespace.  If there is to be
> > > some WITH(OUT)_* knobs which leads to CFLAGS modification in the future
> > > (I'm thinking about ProPolice with the upcoming GCC 4.1), wouldn't it
> > > be worth benefiting this framework for ports ?
> >
> > It avoids only /etc/src.conf stuff when running bsd.port.mk; if you put
> > WITH(OUT)_* in /etc/make.conf it will still be picked up.
> 
> Yes indeed, but MK_FOO won't be set and this would require to either
> duplicate the code that modifies CFLAGS, or at least test for MK_FOO
> or WITH_FOO at the same time.
> 
> Let me show you an example.
> 
> I have an additional <bsd.ssp.mk> that is included from both bsd.sys.mk
> and bsd.port.mk:
> 
> % .if ${MK_SSP} != "no"
> % SSP_CFLAGS      ?=      -fstack-protector
> % CFLAGS          +=      ${SSP_CFLAGS}
> % . if defined(WARNS) && ${WARNS} >= 7 && !empty(SSP_CFLAGS)
> % CWARNFLAGS      +=      -Wstack-protector
> % . endif
> % .endif
> 
> Currently it is thus quite useful to use MK_SSP when this file is
> included from bsd.ports.mk.  With your whole patch I would have to
> either duplicate these bits in bsd.ports.mk or turn the condition to
> something like:
> 
> % .if (defined(MK_SSP) && ${MK_SSP} != "no") || defined(WITH_SSP)
> 
> What do you advice me to do ?

Duplicate it in make.conf at the moment. When prime time comes, send a
patch against bsd.port.mk to set CFLAGS accordingly when WITH_SSP is
set.

I don't know if this will be accepted, but it certainly is better than
having src.conf influence bsd.port.mk.

-- 
Florent Thoumie
flz at FreeBSD.org
FreeBSD Committer
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: This is a digitally signed message part
Url : http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20061024/a997b1ca/attachment.pgp


More information about the freebsd-hackers mailing list