Subject: marrying BUILDID and cpuflags
To: None <tech-pkg@netbsd.org, port-sparc@netbsd.org>
From: Andreas_Hallmann <hallmann@hallhard.darktech.org>
List: port-sparc
Date: 01/08/2004 18:02:47
Hi folks,

cpuflags now cooperates very well with most parts of pkgsrc.

To make BUILDID benefit of this ongoing development,
you can make BUILDID use the knowledge build into cpuflags.

As cpuflags.mk only calculate $CPU_FLAGS, if its not set in the environment,
setting CPU_FLAGS by BUILDID works (great).

Put the following at the begining of /etc/mk.conf

Than you are free to set BUILDID in the "profile" of your machine, and get anything 
compiled as you want it.

It is useful for me, may be you like it too.

AHA
---
#
# This peace combines the benefits of cpuflags and buildid in mk.conf (AHA)
#
#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 ${MACHINE_ARCH} == "sparc"
.if defined(BUILDID)

.if ${BUILDID} == "v8"
CPU_FLAGS=-pipe -mcpu=v8 -mtune=supersparc
.elif ${BUILDID} == "v7"
CPU_FLAGS=-pipe -mcpu=v7 -mtune=cypress
.endif

.endif # defined BUILDID
.endif # sparc arch

# include cpuflags.mk which reuses CPU_FLAGS if set by other means
# so we keep pace with cpuflags

.sinclude "/usr/pkg/share/mk/cpuflags.mk"

---
-- 
NetBSD: If you happen to have any problem with your uptime.