Subject: marrying BUILDID and cpuflags
To: None <,>
From: Andreas_Hallmann <>
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 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.

# 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:
#       ./ -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 # defined BUILDID
.endif # sparc arch

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

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

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