Subject: bmake link errors running bootstrap-pkgsrc bootstrap twice
To: None <tech-pkg@netbsd.org>
From: Mark Valentine <mark@valentine.me.uk>
List: tech-pkg
Date: 10/04/2003 22:30:19
The bootstrap script first uses makefile.boot to create bmake.boot; this
makefile builds lst*.o in the lst.lib subdirectory, then removes them once
the link is complete.

It then runs bmake -f Makefile install, which builds the lst*.o files in the
main bmake directory, but does not remove them.

If you run the bootstrap script a second time, makefile.boot again builds
objects in the lst.lib sub-directory, but its naive link command just uses
*.o lib/*.o, which picks up both the newly built lst/*.o files and the lst*.o
files left around from last time, and hence fails with multiply defined
symbols.

A workaround is to use make clean:

Index: bootstrap
===================================================================
RCS file: /cvsroot/othersrc/bootstrap-pkgsrc/bootstrap,v
retrieving revision 1.78
diff -u -r1.78 bootstrap
--- bootstrap	2003/10/04 18:58:51	1.78
+++ bootstrap	2003/10/04 21:22:06
@@ -393,7 +393,7 @@
 fi
 
 echo_msg "Installing bmake"
-run_cmd "(cd bmake; $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)"
+run_cmd "(cd bmake; $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 clean)"
 
 # build libnbcompat
 echo_msg "Building libnbcompat"

-- 
"Tigers will do ANYTHING for a tuna fish sandwich."
"We're kind of stupid that way."   *munch* *munch*
  -- <http://www.calvinandhobbes.com>