Subject: bmake in bootstrap and why bootstrap/mods for mk and bmake?
To: None <tech-pkg@NetBSD.org>
From: Jeremy C. Reed <reed@reedmedia.net>
List: tech-pkg
Date: 09/15/2005 22:42:01
Is bootstrap/mods required?

Building devel/bmake doesn't require bsd.lib.mk or bsd.man.mk replace with 
$OPSYS specific versions. Unless I am missing something?

Anyways, I gave modified devel/bmake to have source in devel/bmake/files/
and I modified bootstrap/bootstrap to use it. It appears to work on 
DragonFly.

I will next do mk-files and have bootstrap use it too.

I will test on DragonFly and on Linux.

I plan to commit during the freeze in next day or so. (I was told that 
this would be okay during freeze.) But it will need more testing for sure 
on other platforms.

This is part of what I have (not including devel/bmake). Ignore the first 
change in this file (it was old and I forgot to commit).

diff -b -u -r1.40 bootstrap
--- bootstrap	30 May 2005 19:03:29 -0000	1.40
+++ bootstrap	16 Sep 2005 05:35:22 -0000
@@ -477,7 +477,7 @@


  if [ ! -d ${wrkdir} ]; then
-	if mkdir ${wrkdir}; then
+	if mkdir -p ${wrkdir}; then
  		:
  	else
  		echo "Could not create the working directory \"${wrkdir}\". Try $0 -h.";
@@ -608,7 +608,6 @@

  # bootstrap make and *.mk files
  mkdir_p $prefix/share/mk $prefix/lib
-copy_src bmake bmake

  (cd ${wrkdir}/bmake/mk;
  	if [ -f ${bootstrapdir}/mods/mk/$opsys.sys.mk ]; then
@@ -665,7 +664,10 @@
  fi

  echo_msg "Installing bmake"
-run_cmd "(cd $wrkdir/bmake; env CPPFLAGS='$CPPFLAGS -I../libnbcompat' LDFLAGS='$LDFLAGS -L../libnbcompat' LIBS='-lnbcompat' $shprog ./configure --prefix=$prefix --with-default-sys-path=$prefix/share/mk $configargs && make -f makefile.boot bootstrap && env BINDIR=$prefix/bin MANDIR=$prefix/man $BSTRAP_ENV ./bmake -f Makefile install)"
+copy_src ../devel/bmake/files bmake
+run_cmd "(cd $wrkdir/bmake && ./boot-strap -q -o $opsys --prefix=$prefix --sysconfdir=$sysconfdir --with-default-sys-path="$prefix/share/mk:/usr/share/mk:/usr/local/share/mk:/opt/share/mk")"
+run_cmd "$shprog $wrkdir/install-sh -c -o $user -g $group -m 755 $wrkdir/bmake/$opsys/bmake $prefix/bin/bmake"
+#run_cmd "$shprog $wrkdir/install-sh -c -o $user -g $group -m 644 $wrkdir/bmake/$opsys/bmake.1 $prefix/man/man1/bmake.1"

  # bootstrap tnftp
  case "$DEBIAN" in


The last line for installing bmake.1 is broken on most platforms.

It appears that the logic in devel/bmake for man page is only done for a 
few platforms. Many times in past I noticed that bmake.1 was not put into 
$OPSYS directory. Today I see that DragonFly also doesn't have bmake.1. It 
appears that the Makefile.in only does for a few BSDs but other operating 
systems. (I added DragonFly to Makefile.in, but that doesn't solve it for 
other platforms. I haven't looked to closely yet.) So I will take out that 
line for installing man page until that is fixed too.

  Jeremy C. Reed

p.s. This will fix two problems: get rid of third bmake source which was 
getting out-of-date and out-of-sync and it will fix bmake -- especially 
for DragonFly.