[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.76 and 1.77

version 1.76, 2002/12/09 12:49:55 version 1.77, 2002/12/25 00:42:50
Line 20  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"
   
   uname_s=$(uname -s 2>/dev/null)
   uname_m=$(uname -m 2>/dev/null)
   
 # If $PWD is a valid name of the current directory, POSIX mandates that 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.  # 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.  # Unsetting PWD is simpler than changing every occurrence of pwd to use -P.
 #  #
 # XXX Except that doesn't work on Solaris.  # XXX Except that doesn't work on Solaris.
 unset PWD  unset PWD
 if [ "x`uname -s`" = "xSunOS" ]; then  if [ "${uname_s}" = "SunOS" ]; then
         TOP=`pwd -P`          TOP=`pwd -P`
 else  else
         TOP=`pwd`          TOP=`pwd`
Line 104  resolvepath () {
Line 107  resolvepath () {
 usage () {  usage () {
         cat <<_usage_          cat <<_usage_
 Usage:  Usage:
 `basename $0` [-bdEnortUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-k kernel]  `basename $0` [-bdEnortUu] [-a arch] [-B buildid] [-D dest] [-i idir] [-j njob]
            [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-w wrapper]      [-k kernel] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-w wrapper]
   
     -a arch     set MACHINE_ARCH to arch (otherwise deduced from MACHINE)      -a arch     set MACHINE_ARCH to arch (otherwise deduced from MACHINE)
     -B buildid  set BUILDID to buildid      -B buildid  set BUILDID to buildid
Line 113  Usage:
Line 116  Usage:
     -D dest     set DESTDIR to dest      -D dest     set DESTDIR to dest
     -d          build a full distribution into DESTDIR (including etc files)      -d          build a full distribution into DESTDIR (including etc files)
     -E          set "expert" mode; disables some DESTDIR checks      -E          set "expert" mode; disables some DESTDIR checks
       -i idir     installworld from DESTDIR to idir
     -j njob     run up to njob jobs in parallel; see make(1)      -j njob     run up to njob jobs in parallel; see make(1)
     -k kernel   build a kernel using the named configuration file      -k kernel   build a kernel using the named configuration file
     -M obj      set obj root directory to obj (sets MAKEOBJDIRPREFIX)      -M obj      set obj root directory to obj (sets MAKEOBJDIRPREFIX)
Line 146  do_removedirs=false
Line 150  do_removedirs=false
 expert_mode=false  expert_mode=false
 makeenv=  makeenv=
 makewrapper=  makewrapper=
   installworlddir=
 opt_a=no  opt_a=no
 opts='a:B:bD:dEhj:k:M:m:nO:oR:rT:tUuw:'  opts='a:B:bD:dEhi:j:k:M:m:nO:oR:rT:tUuw:'
 runcmd=  runcmd=
   
 if type getopts >/dev/null 2>&1; then  if type getopts >/dev/null 2>&1; then
Line 184  while eval $getoptcmd; do case $opt in
Line 189  while eval $getoptcmd; do case $opt in
   
         -E)     expert_mode=true;;          -E)     expert_mode=true;;
   
           -i)     eval $optargcmd
                   installworlddir=$OPTARG;;
   
         -j)     eval $optargcmd          -j)     eval $optargcmd
                 parallel="-j $OPTARG";;                  parallel="-j $OPTARG";;
   
Line 236  esac; done
Line 244  esac; done
   
 # Set up MACHINE*.  On a NetBSD host, these are allowed to be unset.  # Set up MACHINE*.  On a NetBSD host, these are allowed to be unset.
 if [ -z "$MACHINE" ]; then  if [ -z "$MACHINE" ]; then
         if [ "`uname -s 2>/dev/null`" != "NetBSD" ]; then          if [ "${uname_s}" != "NetBSD" ]; then
                 echo "MACHINE must be set, or -m must be used, for cross builds."                  echo "MACHINE must be set, or -m must be used, for cross builds."
                 echo ""; usage                  echo ""; usage
         fi          fi
         MACHINE=`uname -m`          MACHINE=${uname_m}
 fi  fi
 [ -n "$MACHINE_ARCH" ] || getarch  [ -n "$MACHINE_ARCH" ] || getarch
 validatearch  validatearch
Line 362  removedirs="$TOOLDIR"
Line 370  removedirs="$TOOLDIR"
 if [ -z "$DESTDIR" ] || [ "$DESTDIR" = "/" ]; then  if [ -z "$DESTDIR" ] || [ "$DESTDIR" = "/" ]; then
         if $do_buildsystem; then          if $do_buildsystem; then
                 if [ "$buildtarget" != "build" ] || \                  if [ "$buildtarget" != "build" ] || \
                    [ "`uname -s 2>/dev/null`" != "NetBSD" ] || \                     [ "${uname_s}" != "NetBSD" ] || \
                    [ "`uname -m`" != "$MACHINE" ]; then                     [ "${uname_m}" != "$MACHINE" ]; then
                         bomb "DESTDIR must be set to a non-root path for cross builds or -d or -R."                          bomb "DESTDIR must be set to a non-root path for cross builds or -d or -R."
                 fi                  fi
                 if ! $expert_mode; then                  if ! $expert_mode; then
Line 379  else
Line 387  else
         removedirs="$removedirs $DESTDIR"          removedirs="$removedirs $DESTDIR"
 fi  fi
   
   if [ "$installworlddir" = "/" ]; then
           if [ "${uname_s}" != "NetBSD" ] || \
              [ "${uname_m}" != "$MACHINE" ]; then
                   bomb "-i installworlddir must be set to a non-root path for cross builds."
           fi
   fi
   
 # Remove the target directories.  # Remove the target directories.
 if $do_removedirs; then  if $do_removedirs; then
         for f in $removedirs; do          for f in $removedirs; do
Line 521  else
Line 536  else
                 $runcmd echo "===> New kernel should be in ${kernbuilddir}"                  $runcmd echo "===> New kernel should be in ${kernbuilddir}"
         fi          fi
 fi  fi
   
   if [ -n "$installworlddir" ]; then
           ${runcmd-exec} "$makewrapper" INSTALLWORLDDIR=${installworlddir} \
                   installworld || bomb "failed to make installworld"
   fi

Legend:
Removed from v.1.76  
changed lines
  Added in v.1.77

CVSweb <webmaster@jp.NetBSD.org>