Subject: Re: Problem in new toolchain builds (need comments)
To: Simon J. Gerraty <>
From: James Chacon <>
List: tech-toolchain
Date: 10/23/2001 19:22:44
>>1. Put a complete set of's in place in the tree that eventually
>>all recurse back to /usr/src/ Put all the USE_NEW_TOOLCHAIN and
>>USETOOLS checks in there.
>I was in favour of this a while back.  An alternative is to have a reliable
>means of knowing where the top of the src tree is.  Which btw a top-level
> gives you:  SRCTOP=${.PARSEDIR}.
>Now, I use a wrapper script for make that searches up the src tree until it
>find a .sandbox-env file, and the directory where it find that is set as SB.
>The SRCTOP is typically $SB/src - unless .sandbox-env says different.
>With that availble it becomes pretty easy to set a whole raft of variables
>that give you absolute and relative paths to top of src tree, top of obj tree
>etc.  Including ${SRCTOP}/ also becomes pretty simple and cheap
>to.  The wrapper is only involved in the kicking off of the build, so the
>overhead is not too great - and of course you get the right result regardless
>of where within the tree you start.

The only real concern I have there is teaching people to type something
different than "make" when they cd into part of the srcdir and work on it.
It quite honestly is pretty hardwired into most developer types by this 
point. Unless you wanna wrapper the main make binary to check this...(ok thats
getting sick)

>But if you don't want to go that route, then the's is the
>best bet.  Note that you need to watchout for existing places in the tree
>that have .include "../../" as the addition of new's
>can change what gets .included (a bitch to debug btw).

The only problem I'm still having here is maintaince. Say you add a new 
program to usr.bin that's structured like xlint:


Up until 2 days ago it didn't have a (needed it for different
reasons). With the thing anyone importing new code will have
to remember to sprinkle them across new tree's or they won't get the right
toolchains when they build. One could make a foo2netbsd that did this, but
is really feels like a hack in a lot of ways.

I'm thinking my last idea might be the best. Have use a != rule
to recurse back and set a var based on whether it finds a top level The biggest concern there would be overhead but the maintaince
nightmares go away.