Subject: Re: CFLAGS in mk.conf
To: Georg Schwarz <georg.schwarz@freenet.de>
From: Idar Tollefsen <idart@performancedesign.no>
List: tech-pkg
Date: 05/30/2005 01:49:20
Georg Schwarz wrote:
>>The package's Makefile includes bsd.prefs.mk with
>>.include "../../mk/bsd.prefs.mk"
>>and then adds to CFLAGS with
>>CFLAGS+=
> 
> this means that every package manipulating CFLAGS or some similar
> variable must include ../../mk/bsd.prefs.mk in its Makefile?

Yep. Otherwise, you end up "ignoring" the user's settings.

Now, I'm fairly new to pkgsrc, so if someone know this not
to be true, feel free to jump in. This is how I've seen it
done however, and I'm pretty sure I've got this right.

>>The scenario you describe would occur if the package
>>set CFLAGS _before_ importing bsd.prefs.mk.
> 
> yes
> 
>>Especially since CFLAGS in mk.conf is usually set
>>with "=", not "+=".
> 
> that was my initial point, that one runs into conflict when doing so.

Hence the need to include bsd.prefs.mk before
manipulating variables.


- IT