Subject: Re: best way to add -O if no optimization is already defined?
To: Jeremy C. Reed <reed@reedmedia.net>
From: Juan RP <juan@xtraeme.nopcode.org>
List: tech-pkg
Date: 02/10/2005 17:42:45
--Signature=_Thu__10_Feb_2005_17_42_45_+0100_1r.Gfmb78pWtib65
Content-Type: text/plain; charset=US-ASCII
Content-Disposition: inline
Content-Transfer-Encoding: 7bit
On Wed, 9 Feb 2005 20:00:17 -0800 (PST)
"Jeremy C. Reed" <reed@reedmedia.net> wrote:
> What is the correct nbmake or pkgsrc way to add -O to CFLAGS only if no
> optimization (like -O2) is not defined?
>
> I guess CCOPTS, CPPFLAGS and CFLAGS would need to be checked and then if
> not set then add -O to CFLAGS.
>
> (I need this for libdv which requires at least -O. No problem on NetBSD
> because of /usr/share/mk/sys.mk.)
Something like:
.if empty(CFLAGS:M-O*)
CFLAGS+= -O
.endif
is enough?
--Signature=_Thu__10_Feb_2005_17_42_45_+0100_1r.Gfmb78pWtib65
Content-Type: application/pgp-signature
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (NetBSD)
iD8DBQFCC48IypkLYVDran0RAoGLAJsH1QDiB6M2m5CUAaz7zDY/Hi1xRACcChYf
VEkW2q2ZaOckKKTI3KSEUco=
=nA/1
-----END PGP SIGNATURE-----
--Signature=_Thu__10_Feb_2005_17_42_45_+0100_1r.Gfmb78pWtib65--