Subject: Building NetBSD-current from solaris 10b
To: None <current-users@NetBSD.ORG>
From: Chris Ross <cross+netbsd@distal.com>
List: current-users
Date: 06/14/2004 16:05:13
   I have a sparc64 box (SunFire 880) here, running a beta of
Solaris 10.  It happens Solaris 10 seems to have the same
lame /bin/sh that solaris has for quite a while, and it won't
run build.sh.  When I try, it says:

% ./build.sh -m sparc64 release
./build.sh: bad substitution
%

   Now, this is each to work around by invoking ksh, but
without some way to tell build.sh that it needs to be run
under ksh, it will quickly fail as:

% ksh ./build.sh -m sparc64 release
===> build.sh command: ./build.sh -m sparc64 release
===> build.sh started: Mon Jun 14 16:02:16 EDT 2004
===> No nonexistent/bin/nbmake, needs building.
===> Bootstrapping nbmake
checking for sh... /usr/bin/sh
checking for gcc... cc
checking for C compiler default output... configure: error: C compiler 
cannot create executables

ERROR: Configure of nbmake failed
*** BUILD ABORTED ***
%

   Okay, this is a compiler problem.  Also an issue, but
I'll post another email about that.  Fix that, and:

% HOST_CC=gcc ksh ./build.sh -m sparc64 release
===> build.sh command: ./build.sh -m sparc64 release
===> build.sh started: Mon Jun 14 16:03:33 EDT 2004
===> No nonexistent/bin/nbmake, needs building.
===> Bootstrapping nbmake
checking for sh... /usr/bin/sh
checking for gcc... gcc
.
.
gcc  -O -o nbmake *.o
/usr/bin/sh: bad substitution

*** Failed target:  obj
*** Failed command: cd /data/NetBSD/src/tools; here=`/bin/pwd`/; 
subdir=${here#/usr/src/}; if [ "$here" != "$subdir" ]; then if [ ! -d 
/usr/obj ]; then echo "BSDOBJDIR /usr/obj does not exist, bailing..."; 
exit 1; fi; subdir=${subdir%/}; dest=/usr/obj/$subdir; if [ -x 
/data/NetBSD/src/tooldir.SunOS-5.10-sparc/bin/nbstat ] && 
ttarg=`/data/NetBSD/src/tooldir.SunOS-5.10-sparc/bin/nbstat -qf '%Y' 
${here}obj` && [ "$dest" = "$ttarg" ]; then : ; else echo '# ' " objdir 
$dest"; rm -rf obj; ln -s $dest obj; fi; if [ ! -d $dest ]; then mkdir 
-p $dest; else true; fi; else true ; dest=${here}obj ; if [ ! -d obj ] 
|| [ -h obj ]; then echo '# ' " objdir $dest"; rm -f obj; mkdir $dest; 
fi ; fi;
*** Error code 1

Stop.
nbmake: stopped in /data/NetBSD/src/tools

ERROR: Failed to make obj in tools
*** BUILD ABORTED ***
%

   So, it's invoking /usr/bin/sh somewhere, which is failing
to parse the file.

   How do I tell build.sh, and the constructed nbmake, to
use /usr/bin/ksh, instead of /usr/bin/sh, in all cases?

   Thanks...

                         - Chris