Subject: Re: mk.conf & compiler flags
To: Dunric <>
From: Juan RP <>
List: netbsd-users
Date: 02/03/2005 04:31:28
Content-Type: text/plain; charset=US-ASCII
Content-Disposition: inline
Content-Transfer-Encoding: 7bit

On Thu, 03 Feb 2005 03:18:27 +0100
"Dunric" <> wrote:

> It had to be zillion-times asked but no reliable information in NetBSD guide
> even in mailing lists found :(
> Are there some rules how C/C++ compiler flags has to be properly set in
> /etc/mk.conf ?

Yes, for kernel/userland use COPTS/CPUFLAGS, for pkgsrc use CFLAGS.

Don't forget to append the options to the vars, e.g:
COPTS+=blah or CFLAGS+= blah...

> NetBSD's kernel + userland are using COPTS, both CFLAGS and CXXFLAGS applies
> too. NetBSD's X11 on the other hand ignores COPTS completely - a bit
> confusing.
> Pkgsrc ports are ignoring COPTS too, again CFLAGS & CXXFLAGS are used. There
> is another problem, because some ports define in CFLAGS some important
> options(defines,paths) without them compilation fails so I cann't replace it
> with my own :( When I add my options(+=), some builds are compiled in some
> cases with wild collision flags like "-mcpu=i386" ...
> I just wish to rebuild whole system including packages with "-O2 -pipe
> -march=pentium3" in proper way.

Read above.
> Besides I still found NetBSD to be an _incredible good_ system, best I've ever
> met and used (Linux 4 years, FreeBSD 3/4 of year).


Content-Type: application/pgp-signature

Version: GnuPG v1.4.0 (NetBSD)