Subject: Re: setting compiler flags globally?
To: Georg Schwarz <>
From: Julio M. Merino Vidal <>
List: tech-pkg
Date: 04/03/2005 15:02:56
On Sun, 2005-04-03 at 14:19 +0200, Georg Schwarz wrote:
> > 
> > Is there a variable for mk.conf that allows setting compiler flags for 
> no, I don't think so.
> > (really) all pkgs? I understand that CFLAGS etc. are often overridden by 
> > individual pkgs' Makefiles, so something acting on the wrapper layer would 
> > probably be useful. Maybe a PKGSRC_CFLAGS?
> the problem is not having no such variable, the problem is many packages,
> as you already say, not  paying attention to such setting.
> So I don't think adding another variable will solve anything.
> The best, IMO, would be to have more packages pay attention to
> CFLAGS, LDFLAGS, CPPFLAGS, CXXFLAGS set by pkgsrc. This for many
> packages does require some tweaking. I don't think adding another variable
> would make the job any easier.

This is something I have wanted to propose for quite some time now.
There are many packages out there that simply don't follow the
conventions and either override or don't use any of the "standard"
variables you mention.  Fixing these packages is usually a PITA,
specially during later updates of the package.

Given that the wrapper framework is used to override the compilers, it
could also be used to pass the correct flags to each tool, regardless
what the original program's makefile did.

Julio M. Merino Vidal <>
The NetBSD Project -