Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 12 Feb 2004 18:17:03 -0600 (CST)
From:      "Paul Seniura" <pdseniura@techie.com>
To:        freebsd-questions@freebsd.org, freebsd-hackers@freebsd.org
Cc:        Paul Seniura <pdseniura@techie.com>
Subject:   need help on CFLAGS in /etc/make.conf please
Message-ID:  <20040213001703.616C75C3B@techpc04.okladot.state.ok.us>

next in thread | raw e-mail | index | archive | help

Hi y'all,

I'm trying to find a way to do a CFLAGS+='-O' if and only if such a
parm was not already provided before 'make' actually runs.

I had this coded with the single = sign, i.e. without ?= or +=, but
the process still acts as if += was coded anyway, thus tacking on
my -O *after* the port's own CFLAGS.

GCC33 docs say the _last_ -O# is the one that will be used.

I've seen other discussion on using -O2 but the point seems to be the
ports that set -O2 explicitly are likely to work correctly.

And so, in many ports esp. KDE, it will add my -O *after* the port's
own -O2, and KDE et al will not be compiled with the intended
settings, which may be causing some of its slowness.

Since TPTB here could only find a spare slow@$$ Pentium2 for this
project, I'm trying to optimize other ports with at least -O in an
automatic fashion.  That leaves out /etc/pkgtools.conf due to the
sheer manual labor it would take to code this up for each port.

The idea of having a test in /etc/make.conf struck me as the way to
go, since it is effectively 'sourced'-in and could contain some simple
shell logic operations.

I hope I'm explaining this correctly.  ;)

I'd love to hear feedback on this.
I'll continue working on it tomorrow.

Thank you,

  --  Paul Seniura
      System Specialist
      State of Okla. D.O.T.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040213001703.616C75C3B>