Subject: RE: Questions: /etc/mk.conf
To: 'Frederick Bruckman' <fredb@immanent.net>
From: Conrad T. Pino <Conrad@Pino.com>
List: netbsd-help
Date: 12/27/2002 11:12:23
> -----Original Message-----
> From: netbsd-help-owner@netbsd.org
> [mailto:netbsd-help-owner@netbsd.org]On Behalf Of Frederick Bruckman
> Sent: Friday, December 27, 2002 09:53
> To: Conrad T. Pino
> Cc: NetBSD Help (E-mail)
> Subject: Re: Questions: /etc/mk.conf
>
> 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?
Not according to "/usr/share/mk/bsd.README" which I quote:
MKOBJDIRS If "no", don't create objdirs during a "make build".
"no" by default.
$ cd /usr/share/mk
$ grep -n MKOBJDIRS *.mk
bsd.own.mk:408:MKOBJDIRS:= no
$
> > 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.
Thank you. I'll remove "OBJMACHINE" from "/etc/mk.conf".
> > 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).
Thank you. I'll remove TOOLDIR from "/etc/mk.conf".
> > 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
Thank you. I'll definately implement this.
> 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}.
Thank you. I'll remove RELEASEDIR from "/etc/mk.conf".
> Frederick
Conrad