Subject: Re: bmake and bootstrap and and MKCONF
To: Jeremy C. Reed <>
From: Simon J. Gerraty <>
List: tech-pkg
Date: 09/22/2005 20:31:59
On Thu, 22 Sep 2005 17:24:12 -0700 (PDT), "Jeremy C. Reed" writes:
>My next problem is that I didn't have any created. I need it. The 
>system's native /usr/share/mk/ defines X11BASE early so it doesn't 
>get set later:

>X11BASE         ?=      /usr/X11R6

Yes, this was a long standing bug in freebsd, was included
by so all the ?= might as well have been = since there is no
opportunity to pre-define.

>So this is what I have in bootstrap script:

I'm curious why simply running install-mk doesn't work for you?
Especially if you DTRT with

>if [ ! -f $prefix/share/mk/ ]; then
>   ln -s $prefix/share/mk/
>I create the symlink above because my $ does not exist.

Don't you want to always use
and put an OS specific in a $OS subdir?  That way your tree
"just works" when mounted via NFS on multiple systems.

>But for some reason my /usr/share/mk/ is still being used. I assume 
>the following is the order:
>pkgbox# strings `which bmake` | grep /mk:

If you have a in /usr/pkg/share/mk then you should be ok.
What is being found in /usr/share/mk that is causing you problems?

Setting up the environment correctly/consistently is better than
hacking make.

>See my problem here in the pkgsrc/x11/xorg-libs directory (X11_TYPE is 
>pkgbox# mv /usr/share/mk/ /usr/share/mk/
>pkgbox# bmake show-var VARNAME=unix
>We run DragonFly.
>pkgbox# bmake show-var VARNAME=X11BASE
>pkgbox# mv /usr/share/mk/ /usr/share/mk/
>pkgbox# bmake show-var VARNAME=X11BASE

If /usr/pkg/share/mk contains and everything else you need
anything else in the pre-compiled sys-path shouldn't matter.

The only way you have a hope of pkgsrc behaving consistently is if you
have a fully defined set of *.mk in pkg/share/mk or pkgsrc/mk and run bmake
with suitable -m args (or use a shell wrapper to set MAKESYSPATH).

Since pkgsrc is just one project and /usr/pkg/bin/bmake should be
useful for more, pkgsrc should run bmake with -m (or via a wrapper)
otherwise /usr/pkg/share/mk and pkgsrc/mk need to be the same which
may not be what everyone wants.