Subject: Re: HOST_OSTYPE not set right in bsd.own.mk?
To: Greywolf <greywolf@starwolf.com>
From: Andrew Brown <atatat@atatdot.net>
List: current-users
Date: 02/06/2002 00:46:00
>#  > I'm doing a cross-compile for a SPARC, yet all the objdirs which are
>#  > created are obj.NetBSD-1.5ZA-i386.
>#  >
>#  > Shouldn't they be made into obj.NetBSD-1.5ZA-sparc?
>#  >
>#  > I think HOST_OSTYPE is not being properly manipulated by the cross-
>#  > build scripts.
>#
># For host tools, the objdir also reflects the host architecture.
>
>1.  This isn't just for host tools -- it's for other things inside the
>source tree (i.e.  /usr/games/boggle, where the dictionary thing blew up,
>which led me to discover the misnamed obj.* dir).

the boggle thing actually involves host tools, since it needs to do
work targeted at the target machine, not the host machine.

>2.  Even if it were for host tools, wouldn't that also cause problems
>with building for multiple architectures at the same time?

you have paths like this, i presume?

tools/obj.algor/tools.NetBSD-1.5ZA-i386
tools/obj.alpha/tools.NetBSD-1.5ZA-i386
tools/obj.amigappc/tools.NetBSD-1.5ZA-i386
tools/obj.arc/tools.NetBSD-1.5ZA-i386
tools/obj.arm26/tools.NetBSD-1.5ZA-i386
tools/obj.atari/tools.NetBSD-1.5ZA-i386
tools/obj.bebox/tools.NetBSD-1.5ZA-i386
tools/obj.cesfic/tools.NetBSD-1.5ZA-i386
tools/obj.cobalt/tools.NetBSD-1.5ZA-i386
tools/obj.dnard/tools.NetBSD-1.5ZA-i386
...

which is

tools/obj.${MACHINE}/tools.${_HOST_OSNAME}-${_HOST_OSREL}-${_HOST_ARCH}

so that the obj.foo bit will change depending on your target, but the
tools.bar piece will change depending on where you're building.  you
can, thus, use the same source tree on 17 different (host) ${MACHINE}s
to cross-compile to each one of the aforementioned 17 ${MACHINES}s,
and end up with 169 non-conflicting tool directories.

>Either way, I posit it is a bug.  Shall I submit it as such?

i'd say no.  it kinda irks me that each time my (host) netbsd kernel
version gets bumped, i need to build new tools, but i can deal with
that.

-- 
|-----< "CODE WARRIOR" >-----|
codewarrior@daemon.org             * "ah!  i see you have the internet
twofsonet@graffiti.com (Andrew Brown)                that goes *ping*!"
andrew@crossbar.com       * "information is power -- share the wealth."