Subject: Re: bmake and bootstrap and own.mk and MKCONF
To: Simon J. Gerraty <sjg@crufty.net>
From: Jeremy C. Reed <reed@reedmedia.net>
List: tech-pkg
Date: 09/17/2005 15:55:44
On Fri, 16 Sep 2005, Simon J. Gerraty wrote:

> Thanks for looking at this btw.

No problem. It is a little confusing for me ... like now I see that 
makefile.boot also runs install-sh and wants mk directory.

> If you look at install-mk you'll see
>
> #       FORCE_BSD_MK:

When I used that a couple days ago I had this problem on on NetBSD:

CC="gcc" MAKEFLAGS= 
MAKESYSPATH=`pwd`/mk:/usr/local/pkgsrc/bootstrap/work/mk-fil
es:/home/reed/pkg/share/mk:/usr/share/mk:/usr/local/share/mk:/opt/share/mk
./bmake.boot -f Makefile
bmake.boot: "/usr/share/mk/bsd.shlib.mk" line 6: Malformed conditional
(${MKDYNAMICROOT} == "no")
...

On NetBSD, it appears that /usr/share/mk/bsd.prog.mk got in the way
and was used to bring in bsd.shlib.mk which failed.

It seems like my /usr/local/pkgsrc/bootstrap/work/bmake/NetBSD/mk/prog.mk
or /usr/local/pkgsrc/bootstrap/work/mk-files/prog.mk should have been
used during this bootstrapping (they are identical). If I use one of 
them instead, then bootstrap continues.

> but I generally think it is a better idea to leave bsd.*.mk alone on
> such systems.  If you have a set of *.mk specific to your project, I'd
> put them in pkgsrc/mk

That sounds like a better idea.

> If want to get fancy you can even have:
>
> pkgsrc/mk/$OS
> and put a generic sys.mk in pkgsrc/mk that works out what the target
> system is and pulls in appropriate guff from $OS if needed.  That way
> the tree works even when shared via NFS on different systems.
> See the Generic.sys.mk for an example.
>
>> What is the correct way on BSD systems that already have bsd.own.mk so
>> they will look at this predefined MAKECONF?
>
> Can't you just set MAKECONF in the environment and have the system
> bsd.own.mk suck it in?

The problem is pkgsrc users using bootstrap assume that it will do the 
right thing without setting MAKECONF. We could change this though.

>> And they are not symlinks and doing diff shows they are different --
>> bsd.own.mk is different from own.mk. This does not seem correct.

I just meant that the current bootstrap is installing different versions 
of both bsd.own.mk and own.mk files on some platforms.

  Jeremy C. Reed

  	  	 	 BSD News, BSD tutorials, BSD links
 	  	 	 http://www.bsdnewsletter.com/