Subject: Re: which to use of COPTS, CFLAGS, ..
To: Martin Husemann <martin@duskware.de>
From: Jason R Thorpe <thorpej@wasabisystems.com>
List: netbsd-users
Date: 06/12/2002 09:45:12
On Wed, Jun 12, 2002 at 12:17:51PM +0200, Martin Husemann wrote:

 > > performance on sun4m systems, and after a few iterations i
 > > ended up with "COPTS+=-O2 -mcpu=supersparc" in /etc/mk.conf
 > 
 > I use this:
 > 
 > .if ${CFLAGS:N-pipe}
 > CFLAGS += -pipe
 > .endif
 > .if ${MACHINE_ARCH} == "sparc"
 > .if ${CFLAGS:N-mcpu}
 > CFLAGS += -mcpu=v8 -mtune=supersparc
 > .endif
 > .endif
 > 11~
 > Martin

Note, if you use the BUILDID stuff I added to the build system a while
ago, you can make this even more fine-grained.  For example, if you have
both SPARC v7 and SPARC v8 machines, you can set the BUILDID when you
build the tree:

	./build.sh -m sparc -B v8 ...

creating separate obj dirs, and then test like:

.if defined(BUILDID)

.if ${BUILDID} == "v8"
COPTS+=	-mcpu=v8 -mtune=supersparc
.endif

# ...more build IDs here...

.endif

-- 
        -- Jason R. Thorpe <thorpej@wasabisystems.com>
	...at USENIX...