Subject: Re: Cross-build question.
To: Greywolf <greywolf@starwolf.com>
From: Simon J. Gerraty <sjg@crufty.net>
List: current-users
Date: 02/04/2003 14:15:54
There seem to be two questions here...

>I wish to cross-build, e.g., sparc on i386.  build.sh usually works well
>for this sort of thing, but when building, it wants to rebuild nbmake
>and the nbmake wrapper.

I use build.sh to build sparc on i386 - works nicely.
If you don't want the tools re-built - set MKTOOLS=no
as I've mentioned previously I use a wrapper around build.sh to
set all the goop I always want.  I use:

TOOLDIR=/NetBSD/tools/$branch/`uname -s`-`uname -r`-`uname -p`

and if my wrapper does not see a -t option for build.sh it sets
MKTOOLS=no

>The problem I see here is that I cannot in any way, shape or form,
>find which *CFLAGS variable I can use such that host-built host tools
>can be passed any of the requisite args for the host, simultaneously
>being able to pass something suitable for crossbuilding to the target
>build tools.  I.e. specifically, I wish to enable "-O3 -mv8
>-mcpu=supersparc" to the target compiler running on the host.

I put:

.if ${MACHINE_ARCH} == "sparc"
DEFCOPTS=-O2 -msupersparc
.endif

in /etc/mk.conf and it does the right thing - for kernel builds 
at least.  The same trick should work for other bits of the build.

Hope that's what you're after.
--sjg