[BACK]Return to build.sh CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src

Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.

Diff for /src/build.sh between version 1.58.2.4 and 1.58.2.5

version 1.58.2.4, 2002/11/03 16:28:36 version 1.58.2.5, 2002/11/03 16:36:06
Line 1 
Line 1 
 #! /bin/sh  #! /usr/bin/env sh
 #  $NetBSD$  #  $NetBSD$
 #  #
 # Top level build wrapper, for a system containing no tools.  # Top level build wrapper, for a system containing no tools.
Line 6 
Line 6 
 # This script should run on any POSIX-compliant shell.  For systems  # This script should run on any POSIX-compliant shell.  For systems
 # with a strange /bin/sh, "ksh" or "bash" may be an ample alternative.  # 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 () {  bomb () {
         echo ""          echo ""
Line 16  bomb () {
Line 20  bomb () {
 [ -d usr.bin/make ] || bomb "build.sh must be run from the top source level"  [ -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"  [ -f share/mk/bsd.own.mk ] || bomb "src/share/mk is missing; please re-fetch the source tree"
   
 TOP=`pwd`  # 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
   
 getarch () {  getarch () {
         # Translate a MACHINE into a default MACHINE_ARCH.          # Translate a MACHINE into a default MACHINE_ARCH.
Line 76  EOF
Line 90  EOF
 resolvepath () {  resolvepath () {
         case $OPTARG in          case $OPTARG in
         /*)     ;;          /*)     ;;
         *)      OPTARG="$cwd/$OPTARG";;          *)      OPTARG="$TOP/$OPTARG";;
         esac          esac
 }  }
   
Line 112  usage () {
Line 126  usage () {
 # Set defaults.  # Set defaults.
 MAKEFLAGS=  MAKEFLAGS=
 buildtarget=build  buildtarget=build
 cwd=`pwd`  
 do_buildsystem=true  do_buildsystem=true
 do_buildonlytools=false  do_buildonlytools=false
 do_rebuildmake=false  do_rebuildmake=false
Line 185  while eval $getoptcmd; do case $opt in
Line 198  while eval $getoptcmd; do case $opt in
                 makeenv="$makeenv MAKEOBJDIRPREFIX";;                  makeenv="$makeenv MAKEOBJDIRPREFIX";;
   
         -O)     eval $optargcmd; resolvepath          -O)     eval $optargcmd; resolvepath
                 MAKEOBJDIR="\${.CURDIR:C,^$cwd,$OPTARG,}"; export MAKEOBJDIR                  MAKEOBJDIR="\${.CURDIR:C,^$TOP,$OPTARG,}"; export MAKEOBJDIR
                 makeobjdir=$OPTARG                  makeobjdir=$OPTARG
                 makeenv="$makeenv MAKEOBJDIR";;                  makeenv="$makeenv MAKEOBJDIR";;
   
Line 217  makeenv="$makeenv TOOLDIR MACHINE MACHIN
Line 230  makeenv="$makeenv TOOLDIR MACHINE MACHIN
 if [ ! -z "$BUILDID" ]; then  if [ ! -z "$BUILDID" ]; then
         makeenv="$makeenv BUILDID"          makeenv="$makeenv BUILDID"
 fi  fi
 MAKEFLAGS="-m $cwd/share/mk $MAKEFLAGS MKOBJDIRS=${MKOBJDIRS-yes}"  MAKEFLAGS="-m $TOP/share/mk $MAKEFLAGS MKOBJDIRS=${MKOBJDIRS-yes}"
 export MAKEFLAGS MACHINE MACHINE_ARCH  export MAKEFLAGS MACHINE MACHINE_ARCH
   
 # Test make source file timestamps against installed nbmake binary,  # Test make source file timestamps against installed nbmake binary,
Line 251  if $do_rebuildmake; then
Line 264  if $do_rebuildmake; then
         $runcmd cd "$tmpdir"          $runcmd cd "$tmpdir"
   
         $runcmd env CC="${HOST_CC-cc}" CPPFLAGS="${HOST_CPPFLAGS}" CFLAGS="${HOST_CFLAGS--O}" LDFLAGS="${HOST_LDFLAGS}" \          $runcmd env CC="${HOST_CC-cc}" CPPFLAGS="${HOST_CPPFLAGS}" CFLAGS="${HOST_CFLAGS--O}" LDFLAGS="${HOST_LDFLAGS}" \
                 "$cwd/tools/make/configure" || bomb "configure of nbmake failed"                  "$TOP/tools/make/configure" || bomb "configure of nbmake failed"
         $runcmd sh buildmake.sh || bomb "build of nbmake failed"          $runcmd sh buildmake.sh || bomb "build of nbmake failed"
   
         make="$tmpdir/nbmake"          make="$tmpdir/nbmake"
         $runcmd cd "$cwd"          $runcmd cd "$TOP"
         $runcmd rm -f usr.bin/make/*.o usr.bin/make/lst.lib/*.o          $runcmd rm -f usr.bin/make/*.o usr.bin/make/lst.lib/*.o
 fi  fi
   

Legend:
Removed from v.1.58.2.4  
changed lines
  Added in v.1.58.2.5

CVSweb <webmaster@jp.NetBSD.org>