Subject: Re: building current
To: None <hermit@cs.tu-berlin.de>
From: Bill Studenmund <skippy@macro.Stanford.EDU>
List: current-users
Date: 03/12/1999 10:31:01
On Fri, 12 Mar 1999, Bjoern Labitzke wrote:

> On Thu, 11 Mar 1999, Joseph Sarkes wrote:
>=20
> > The only glitch is that I haven't figured out exactly how to
> > use the building in a separate obj directory. I could just try
>=20
> You probably want to set the variable WRKOBJDIR in /etc/mk.conf to an
> existing directory under which you want to find the object hierarchy of
> the build. After that and before doing a build you issue a "make obj" in
> /usr/src and the hierarchy of obj-directories gets build under WRKOBJDIR
> with the corresponding symbolic links in the /usr/src-hierarchy. Each
> following build will use the objectdirectories.

That should be BSDOBJDIR for the source tree. WRKOBJDIR is for the package
system.

Note: your source must be at /usr/src for this to work. I found out the
hard way that if /usr/src is a symlink somewhere else, you'll get obj
directories inside your source tree, not under BSDOBJDIR.

If /usr/src is a symlink, then just define BSDSRCDIR to point to the real
directory holding the source. bsd.obj.mk, the make file which handles obj
dirs, does a pwd to figure out where it is, and looks for BSDSRCDIR in
that name.

So if you have your sources in /y1/mumbojumbo, want your obj's in
/y2/muck, and have /usr/src a symlink to /y1/mumbojumbo, then just define
BSDSRCDIR=3D/y1/mumbojumbo, and BSDOBJDIR=3D/y2/muck.

Also, if you define OBJMACHINE=3D1, then all the obj dir's will be
obj.${MACHINE}, which is great for xcompiling.

> There are two things (beside the "normal" build-problems of current) to
> look after: 1st, you should have issued a "make cleandir" before the "mak=
e
> obj" to be sure, that your source tree is clean of object or other derive=
d
> files. Otherwise you might get failures, because files in the source
> directories will be used for following builds, but can=B4t be updated. An=
d
> 2nd, you should consider the possibility that the latest sup created new
> subdirectories and you might need new object directories in them. I do a
> "make obj" before each build.

This advise is good!

Take care,

Bill