Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. =================================================================== RCS file: /ftp/cvs/cvsroot/src/build.sh,v rcsdiff: /ftp/cvs/cvsroot/src/build.sh,v: warning: Unknown phrases like `commitid ...;' are present. retrieving revision 1.58.2.9 retrieving revision 1.59 diff -u -p -r1.58.2.9 -r1.59 --- src/build.sh 2005/12/12 11:20:33 1.58.2.9 +++ src/build.sh 2002/05/24 14:43:31 1.59 @@ -1,15 +1,11 @@ -#! /usr/bin/env sh -# $NetBSD: build.sh,v 1.58.2.9 2005/12/12 11:20:33 tron Exp $ +#! /bin/sh +# $NetBSD: build.sh,v 1.59 2002/05/24 14:43:31 msaitoh Exp $ # # Top level build wrapper, for a system containing no tools. # # This script should run on any POSIX-compliant shell. For systems # with a strange /bin/sh, "ksh" or "bash" may be an ample alternative. # -# Note, however, that due to the way the interpreter is invoked above, -# if a POSIX-compliant shell is the first in the PATH, you won't have -# to take any further action. -# bomb () { echo "" @@ -20,17 +16,7 @@ bomb () { [ -d usr.bin/make ] || bomb "build.sh must be run from the top source level" [ -f share/mk/bsd.own.mk ] || bomb "src/share/mk is missing; please re-fetch the source tree" -# If $PWD is a valid name of the current directory, POSIX mandates that pwd -# return it by default which causes problems in the presence of symlinks. -# Unsetting PWD is simpler than changing every occurrence of pwd to use -P. -# -# XXX Except that doesn't work on Solaris. -unset PWD -if [ "x`uname -s`" = "xSunOS" ]; then - TOP=`pwd -P` -else - TOP=`pwd` -fi +TOP=`pwd` getarch () { # Translate a MACHINE into a default MACHINE_ARCH. @@ -90,7 +76,7 @@ EOF resolvepath () { case $OPTARG in /*) ;; - *) OPTARG="$TOP/$OPTARG";; + *) OPTARG="$cwd/$OPTARG";; esac } @@ -126,6 +112,7 @@ usage () { # Set defaults. MAKEFLAGS= buildtarget=build +cwd=`pwd` do_buildsystem=true do_buildonlytools=false do_rebuildmake=false @@ -198,7 +185,7 @@ while eval $getoptcmd; do case $opt in makeenv="$makeenv MAKEOBJDIRPREFIX";; -O) eval $optargcmd; resolvepath - MAKEOBJDIR="\${.CURDIR:C,^$TOP,$OPTARG,}"; export MAKEOBJDIR + MAKEOBJDIR="\${.CURDIR:C,^$cwd,$OPTARG,}"; export MAKEOBJDIR makeobjdir=$OPTARG makeenv="$makeenv MAKEOBJDIR";; @@ -226,12 +213,11 @@ fi validatearch # Set up default make(1) environment. -NETBSDSRCDIR=${TOP} -makeenv="$makeenv TOOLDIR MACHINE MACHINE_ARCH MAKEFLAGS NETBSDSRCDIR" +makeenv="$makeenv TOOLDIR MACHINE MACHINE_ARCH MAKEFLAGS" if [ ! -z "$BUILDID" ]; then makeenv="$makeenv BUILDID" fi -MAKEFLAGS="-m $TOP/share/mk $MAKEFLAGS MKOBJDIRS=${MKOBJDIRS-yes}" +MAKEFLAGS="-m $cwd/share/mk $MAKEFLAGS MKOBJDIRS=${MKOBJDIRS-yes}" export MAKEFLAGS MACHINE MACHINE_ARCH # Test make source file timestamps against installed nbmake binary, @@ -265,11 +251,11 @@ if $do_rebuildmake; then $runcmd cd "$tmpdir" $runcmd env CC="${HOST_CC-cc}" CPPFLAGS="${HOST_CPPFLAGS}" CFLAGS="${HOST_CFLAGS--O}" LDFLAGS="${HOST_LDFLAGS}" \ - sh "$TOP/tools/make/configure" || bomb "configure of nbmake failed" + "$cwd/tools/make/configure" || bomb "configure of nbmake failed" $runcmd sh buildmake.sh || bomb "build of nbmake failed" make="$tmpdir/nbmake" - $runcmd cd "$TOP" + $runcmd cd "$cwd" $runcmd rm -f usr.bin/make/*.o usr.bin/make/lst.lib/*.o fi @@ -323,7 +309,7 @@ else echo "===> DESTDIR path: $DESTDIR" TOOLDIR=`getmakevar TOOLDIR`; - [ $? = 0 ] || bomb "getmakevar TOOLDIR failed"; + [ $? = 0 ] || bomb "getmakevar DESTDIR failed"; echo "===> TOOLDIR path: $TOOLDIR" export DESTDIR TOOLDIR @@ -359,7 +345,6 @@ fi # Recreate $TOOLDIR. $runcmd mkdir -p "$TOOLDIR/bin" || bomb "mkdir of '$TOOLDIR/bin' failed" -build_start=$(date) # Install nbmake if it was built. if $do_rebuildmake; then @@ -388,11 +373,9 @@ fi eval cat < Build started: ${build_start}" -echo "===> Build ended: $(date)" -echo "===> DESTDIR path: $DESTDIR" -echo "===> TOOLDIR path: $TOOLDIR"