Subject: Re: two more bugs perry doesn't want to admit exists
To: Dieter Baron <dillo@danbala.ifoer.tuwien.ac.at>
From: James Chacon <jchacon@genuity.net>
List: tech-toolchain
Date: 11/25/2001 04:04:34
>  The problem occurs if obj root directory (build.sh -O option)
>doesn't exist prior to starting build.sh, because $_SRC_TOP_OBJ_ is
>set in bsd.own.mk before running objdir (thus before it would be
>created) via ${PRINTOBJDIR} in $_SRC_TOP_ (the top of the source
>tree).  The value thus set is retained throughout the build.
>
>  I see three solutions:
>
>  1) The requirement that the top of the obj root directory (build.sh
>-O option) exists prior to running build.sh should be documented,
>  2) build.sh ensures it's existance, or
>
>  3) the logic in bsd.own.mk is changed.

Did this option. Kinda gross but basically force the top level source dir
to run a make obj before testing it's objdir value. Since on a top level
make bsd.own.mk gets included before anything else happsn this is pretty
much the only place you can bootstrap this.. For non obj dir builds this
will do nothing, and for the others it'll just create the top level obj dir.
This only runs once per top level make invocation so it's not a hit 
performance wise either.

This picks up the correct value for things as build.sh runs make with all
the right vars exported and anyone else running without build.sh will get
the same results (since they'd have to have MAKEOBJDIRPREFIX set in mk.conf
or their env to use it which was the problem case here anyways).

James