Subject: Re: Questions: /etc/mk.conf
To: Conrad T. Pino <Conrad@Pino.com>
From: Frederick Bruckman <fredb@immanent.net>
List: netbsd-help
Date: 12/27/2002 11:52:33
On Fri, 27 Dec 2002, Conrad T. Pino wrote:

> Base on my reading, I've created this mk.conf:
>
> $ cat /etc/mk.conf
> DISTDIR=/usr/pkgsrc.dist.files
> OBJMACHINE=yes
> MKOBJDIRS=yes
> RELEASEDIR=/usr/src.rels
> TOOLDIR=/usr/tools
> DESTDIR=/usr/src.dest
> $
>
> I've concluded that "MKOBJDIRS=yes" is a good
> idea in all cases to keep object files out of
> the source tree.

Isn't that the default?

> I think "OBJMACHINE=yes" is useful when doing
> cross platform builds i.e. compile "sparc64"
> on an "i386" development box.

Instead of those last two, you could simply

  export MAKEOBJDIRPREFIX=/usr/obj.$(uname -p)

into your environment. The beauty of that, is that then
there are no symlinks polluting the source tree.

> I want to compile for multiple machines but they are
> all "i386" platforms.  Given the development box and
> the target boxes are all "i386", do I really need to
> have "OBJMACHINE=yes"?

I use it at sites that don't have the mac68k's, just so I
can share configs, but if everything of yours is an i386,
there'd be no benefit.

> Do I need to set "TOOLDIR" when the build platform
> and the target platform are both "i386"?

You don't need to set TOOLDIR at all. If you fail to set
TOOLDIR, the build system will construct a default location
under your object directory, which may not, however, be
convenient for you. Also, in order for "build.sh -u" to work
properly, TOOLDIR needs to be set in you environment, rather
than in ${MAKECONF} (or the automatic default).

> Does the rest of my "/etc/mk.conf" look reasonable?

DESTDIR affects package building (with pkgsrc). If you don't
want that, make the setting conditional on BSD_PKG_MK. For
example:

  .ifndef BSD_PKG_MK
  #Snapshot settings

  DESTDIR=...

  .else
  # pkgsrc settings

  WRKOBJDIR=yes

  .endif

Also, actually building a release with build.sh requires
an argument to "-R", (i.e. "-R ${RELEASEDIR}"), so there's
not much point in setting RELEASEDIR in ${MAKECONF}.


Frederick