Re: Properly controlling CFLAGS/CXXFLAGS



Garrett Cooper wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello,
Coming from Gentoo we were taught how to 'rice' our machines.
Based on my experience though with FreeBSD, this is an improper
methodology for one to use.
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.
So, I was wondering what the best course of action for setting
variables in /etc/make.conf would be? Is this proper given what I'm
trying to accomplish:

/etc/make.conf snippet:

CFLAGS= -O2 -pipe
CXXFLAGS= ${CFLAGS}
COPTFLAGS= ${CFLAGS} -msse -msse2 -mfpmath=sse,387

NO_CPU_CFLAGS="YES"
NO_CPU_COPTFLAGS="YES"

CPUTYPE?=pentium4

TIA!
- -Garrett

sysutils/portconf might allow you to do what you want. I just use the following construct in make.conf though, and it seems to work.

.if ${.CURDIR:M*/category/port}
or
.if ${.CURDIR:M*/category/port*}
put port specific defines here
.endif

BTW, questions like this probably are best served on questions@ instead of hackers@.

HTH,
Micah
_______________________________________________
freebsd-hackers@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@xxxxxxxxxxx"



Relevant Pages

  • FreeBSD Status Report Second Quarter 2006
    ... April-June 2006 Status Report ... With the release of FreeBSD 5.5 and FreeBSD 6.1, ... consider the "Open Tasks lists" provided with some reports. ... Improving Ports Collection ...
    (freebsd-current)
  • FreeBSD Status Report Second Quarter 2006
    ... April-June 2006 Status Report ... With the release of FreeBSD 5.5 and FreeBSD 6.1, ... consider the "Open Tasks lists" provided with some reports. ... Improving Ports Collection ...
    (freebsd-hackers)
  • FreeBSD Quarterly Status Report, First Quarter of 2007
    ... This report covers FreeBSD related projects between January and March ... Building Linux Device Drivers on FreeBSD ... Ports Collection ... Initially the project focused on USB webcams, ...
    (freebsd-current)
  • FreeBSD Quarterly Status Report, First Quarter of 2007
    ... This report covers FreeBSD related projects between January and March ... Building Linux Device Drivers on FreeBSD ... Ports Collection ... Initially the project focused on USB webcams, ...
    (freebsd-hackers)
  • FreeBSD Quarterly Status Report, First Quarter of 2007
    ... This report covers FreeBSD related projects between January and March ... Building Linux Device Drivers on FreeBSD ... Ports Collection ... Initially the project focused on USB webcams, ...
    (freebsd-stable)