Re: Properly controlling CFLAGS/CXXFLAGS
- From: Oliver Fromme <olli@xxxxxxxxxxxxxxxxx>
- Date: Fri, 22 Dec 2006 09:50:13 +0100 (CET)
Garrett Cooper wrote:
I was wondering (looking at the make.conf manpage), what's the
best way to control one's CFLAGS/CXXFLAGS. I'd prefer if only a few
ports would have optimized compiler flags, while the rest of the system
used a safe set of compiler flags.
The simplest way is to use conditionals in /etc/make.conf
depending on the ports directory:
.if ${.CURDIR:M*/somecategory/someport}
CFLAGS= -O3 -pipe
CFLAGS+= -DSOMETHING
.endif
CFLAGS= -O2 -pipe
Using -O2 without -fno-strict-aliasing will break certain
programs. The default is -O2 -fno-strict-aliasing -pipe
and it is _not_ recommended to override it globally, or
otherwise you're guaranteed to shoot yourself in the foot,
sooner or later.
COPTFLAGS= ${CFLAGS} -msse -msse2 -mfpmath=sse,387
That will break kernel compiles. Again, you should not
override COPTFLAGS, unless you know exactly what you're
doing.
Best regards
Oliver
--
Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing
Dienstleistungen mit Schwerpunkt FreeBSD: http://www.secnetix.de/bsd
Any opinions expressed in this message may be personal to the author
and may not necessarily reflect the opinions of secnetix in any way.
Passwords are like underwear. You don't share them,
you don't hang them on your monitor or under your keyboard,
you don't email them, or put them on a web site,
and you must change them very often.
_______________________________________________
freebsd-hackers@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@xxxxxxxxxxx"
- Follow-Ups:
- Re: Properly controlling CFLAGS/CXXFLAGS
- From: Garrett Cooper
- Re: Properly controlling CFLAGS/CXXFLAGS
- References:
- Properly controlling CFLAGS/CXXFLAGS
- From: Garrett Cooper
- Properly controlling CFLAGS/CXXFLAGS
- Prev by Date: Re: Properly controlling CFLAGS/CXXFLAGS
- Next by Date: Re: Locking fundamentals
- Previous by thread: Re: Properly controlling CFLAGS/CXXFLAGS
- Next by thread: Re: Properly controlling CFLAGS/CXXFLAGS
- Index(es):
Relevant Pages
|
|