Subject: Re: Failed to build 3.99.8 (installation floppy is too big)
To: Robert Elz <kre@munnari.OZ.AU>
From: segv <segv@netctl.net>
List: current-users
Date: 09/03/2005 14:09:50
On Sat, 03 Sep 2005 19:22:43 +0700
Robert Elz <kre@munnari.OZ.AU> wrote:

>     Date:        Sat, 3 Sep 2005 00:32:10 +0100
>     From:        segv <segv@netctl.net>
>     Message-ID:  <20050903003210.64387705.segv@netctl.net>
> 
>   | The way to avoid it is to set
>   | 
>   | COPTS+=-Os
>   | 
>   | in your mk.conf file, when you're building netbsd release.
> 
> I have no mk.conf when I'm building NetBSD, and I don't want one, I want
> to get exactly the same result everyone else (who isn't making a special
> tailored version for themselves) gets.
> 
> If that's what's supposed to be done, then it should be in the standard Makefiles.
> 
> kre

I think you'll find everyone else is using mk.conf. Besides by default gcc
produces plain i386 code, if you have a Pentium 3 for example, the following
mk.conf will set gcc to produce much more efficient code:

$ cat mk.i386.conf
_ACCEPTABLE=yes
DEPENDS_TARGET=package

# When doing 'build.sh release' it's safer to use -Os optimisation
# With -O2 and higher, executables may not fit inside ramdisk image, etc
KERNEL_CPUFLAGS=-march=pentium3 -mmmx -msse -mfpmath=sse
KERNEL_CFLAGS=-Os -pipe

PKGSRC_CPUFLAGS=-march=pentium3 -mmmx -msse -mfpmath=sse
PKGSRC_CFLAGS=-O2 -pipe

#The first default Sourceforge site seems to be painfully slow. Avoid it.
MASTER_SITE_SOURCEFORGE+=http://easynews.dl.sourceforge.net/sourceforge/

.ifdef BSD_PKG_MK
COPTS+=${PKGSRC_CFLAGS} ${PKGSRC_CPUFLAGS}
CFLAGS+=${PKGSRC_CFLAGS} ${PKGSRC_CPUFLAGS}
CXXFLAGS+=${PKGSRC_CFLAGS} ${PKGSRC_CPUFLAGS}
.else
COPTS+=${KERNEL_CFLAGS}
CPUFLAGS+=${KERNEL_CPUFLAGS}
.endif