[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.153 and 1.153.2.6

version 1.153, 2006/09/29 19:53:54 version 1.153.2.6, 2009/01/15 23:00:31
Line 50 
Line 50 
 progname=${0##*/}  progname=${0##*/}
 toppid=$$  toppid=$$
 results=/dev/null  results=/dev/null
   tab='   '
 trap "exit 1" 1 2 3 15  trap "exit 1" 1 2 3 15
   
 bomb()  bomb()
Line 112  set_HOST_SH()
Line 113  set_HOST_SH()
         # specifying HOST_SH in the environment.          # specifying HOST_SH in the environment.
         #          #
         [ -z "${HOST_SH}" ] && HOST_SH="$(          [ -z "${HOST_SH}" ] && HOST_SH="$(
                 (ps -p $$ -o comm | sed -ne '2s/[ \t]*$//p') 2>/dev/null )"                  (ps -p $$ -o comm | sed -ne "2s/[ ${tab}]*\$//p") 2>/dev/null )"
   
         # If nothing above worked, use "sh".  We will later find the          # If nothing above worked, use "sh".  We will later find the
         # first directory in the PATH that has a "sh" program.          # first directory in the PATH that has a "sh" program.
Line 154  initdefaults()
Line 155  initdefaults()
         [ -f share/mk/bsd.own.mk ] ||          [ -f share/mk/bsd.own.mk ] ||
             bomb "src/share/mk is missing; please re-fetch the source tree"              bomb "src/share/mk is missing; please re-fetch the source tree"
   
           # Find information about the build platform.
           #
         uname_s=$(uname -s 2>/dev/null)          uname_s=$(uname -s 2>/dev/null)
           uname_r=$(uname -r 2>/dev/null)
         uname_m=$(uname -m 2>/dev/null)          uname_m=$(uname -m 2>/dev/null)
   
         # If $PWD is a valid name of the current directory, POSIX mandates          # If $PWD is a valid name of the current directory, POSIX mandates
Line 216  initdefaults()
Line 220  initdefaults()
         do_sourcesets=false          do_sourcesets=false
         do_syspkgs=false          do_syspkgs=false
         do_iso_image=false          do_iso_image=false
           do_iso_image_source=false
         do_params=false          do_params=false
   
         # Create scratch directory          # Create scratch directory
Line 229  initdefaults()
Line 234  initdefaults()
         #          #
         setmakeenv NETBSDSRCDIR "${TOP}"          setmakeenv NETBSDSRCDIR "${TOP}"
   
           # Find the version of NetBSD
           #
           DISTRIBVER="$(${HOST_SH} ${TOP}/sys/conf/osrelease.sh)"
   
         # Set various environment variables to known defaults,          # Set various environment variables to known defaults,
         # to minimize (cross-)build problems observed "in the field".          # to minimize (cross-)build problems observed "in the field".
         #          #
Line 307  getarch()
Line 316  getarch()
                 MACHINE_ARCH=sh3el                  MACHINE_ARCH=sh3el
                 ;;                  ;;
   
         evbsh5)  
                 MACHINE_ARCH=sh5el  
                 ;;  
         amd64)          amd64)
                 MACHINE_ARCH=x86_64                  MACHINE_ARCH=x86_64
                 ;;                  ;;
Line 364  validatearch()
Line 370  validatearch()
                 arches="sh3eb sh3el"                  arches="sh3eb sh3el"
                 ;;                  ;;
   
         evbsh5)  
                 arches="sh5eb sh5el"  
                 ;;  
   
         macppc|evbppc)          macppc|evbppc)
                 arches="powerpc powerpc64"                  arches="powerpc powerpc64"
                 ;;                  ;;
Line 396  validatearch()
Line 398  validatearch()
 raw_getmakevar()  raw_getmakevar()
 {  {
         [ -x "${make}" ] || bomb "raw_getmakevar $1: ${make} is not executable"          [ -x "${make}" ] || bomb "raw_getmakevar $1: ${make} is not executable"
         "${make}" -m ${TOP}/share/mk -s -f- _x_ <<EOF          "${make}" -m ${TOP}/share/mk -s -B -f- _x_ <<EOF
 _x_:  _x_:
         echo \${$1}          echo \${$1}
 .include <bsd.prog.mk>  .include <bsd.prog.mk>
Line 455  usage()
Line 457  usage()
         fi          fi
         cat <<_usage_          cat <<_usage_
   
 Usage: ${progname} [-EnorUux] [-a arch] [-B buildid] [-D dest] [-j njob]  Usage: ${progname} [-EnorUux] [-a arch] [-B buildid] [-C cddir] [-D dest]
                 [-M obj] [-m mach] [-N noisy] [-O obj] [-R release] [-T tools]                  [-j njob] [-M obj] [-m mach] [-N noisy] [-O obj] [-R release]
                 [-V var=[value]] [-w wrapper] [-X x11src] [-Z var]                  [-T tools] [-V var=[value]] [-w wrapper] [-X x11src] [-Z var]
                 operation [...]                  operation [...]
   
  Build operations (all imply "obj" and "tools"):   Build operations (all imply "obj" and "tools"):
Line 479  Usage: ${progname} [-EnorUux] [-a arch] 
Line 481  Usage: ${progname} [-EnorUux] [-a arch] 
                         DESTDIR should be populated beforehand.                          DESTDIR should be populated beforehand.
     sourcesets          Create source sets in RELEASEDIR/source/sets.      sourcesets          Create source sets in RELEASEDIR/source/sets.
     syspkgs             Create syspkgs in RELEASEDIR/MACHINE/binary/syspkgs.      syspkgs             Create syspkgs in RELEASEDIR/MACHINE/binary/syspkgs.
     iso-image           Create CD-ROM image in RELEASEDIR/MACHINE/installation.      iso-image           Create CD-ROM image in RELEASEDIR/iso.
       iso-image-source    Create CD-ROM image with source in RELEASEDIR/iso.
     params              Display various make(1) parameters.      params              Display various make(1) parameters.
   
  Options:   Options:
     -a arch     Set MACHINE_ARCH to arch.  [Default: deduced from MACHINE]      -a arch     Set MACHINE_ARCH to arch.  [Default: deduced from MACHINE]
     -B buildId  Set BUILDID to buildId.      -B buildId  Set BUILDID to buildId.
       -C cddir    Set CDEXTRA to cddir.
     -D dest     Set DESTDIR to dest.  [Default: destdir.MACHINE]      -D dest     Set DESTDIR to dest.  [Default: destdir.MACHINE]
     -E          Set "expert" mode; disables various safety checks.      -E          Set "expert" mode; disables various safety checks.
                 Should not be used without expert knowledge of the build system.                  Should not be used without expert knowledge of the build system.
Line 523  _usage_
Line 527  _usage_
   
 parseoptions()  parseoptions()
 {  {
         opts='a:B:bD:dEhi:j:k:M:m:N:nO:oR:rT:tUuV:w:xX:Z:'          opts='a:B:bC:D:dEhi:j:k:M:m:N:nO:oR:rT:tUuV:w:xX:Z:'
         opt_a=no          opt_a=no
   
         if type getopts >/dev/null 2>&1; then          if type getopts >/dev/null 2>&1; then
Line 567  parseoptions()
Line 571  parseoptions()
                         usage "'-b' has been replaced by 'makewrapper'"                          usage "'-b' has been replaced by 'makewrapper'"
                         ;;                          ;;
   
                   -C)
                           eval ${optargcmd}; resolvepath
                           iso_dir=${OPTARG}
                           ;;
   
                 -D)                  -D)
                         eval ${optargcmd}; resolvepath                          eval ${optargcmd}; resolvepath
                         setmakeenv DESTDIR "${OPTARG}"                          setmakeenv DESTDIR "${OPTARG}"
Line 726  parseoptions()
Line 735  parseoptions()
                         op=iso_image    # used as part of a variable name                          op=iso_image    # used as part of a variable name
                         ;;                          ;;
   
                   iso-image-source)
                           op=iso_image_source   # used as part of a variable name
                           ;;
   
                 kernel=*|releasekernel=*)                  kernel=*|releasekernel=*)
                         arg=${op#*=}                          arg=${op#*=}
                         op=${op%%=*}                          op=${op%%=*}
Line 859  validatemakeparams()
Line 872  validatemakeparams()
                 ${runcmd} cd "${TOP}"                  ${runcmd} cd "${TOP}"
         fi          fi
   
         statusmsg "MACHINE:          ${MACHINE}"  
         statusmsg "MACHINE_ARCH:     ${MACHINE_ARCH}"  
   
         # Find TOOLDIR, DESTDIR, and RELEASEDIR.          # Find TOOLDIR, DESTDIR, and RELEASEDIR.
         #          #
         TOOLDIR=$(getmakevar TOOLDIR)          TOOLDIR=$(getmakevar TOOLDIR)
Line 1116  main()
Line 1126  main()
         build_start=$(date)          build_start=$(date)
         statusmsg "${progname} command: $0 $@"          statusmsg "${progname} command: $0 $@"
         statusmsg "${progname} started: ${build_start}"          statusmsg "${progname} started: ${build_start}"
           statusmsg "NetBSD version:   ${DISTRIBVER}"
           statusmsg "MACHINE:          ${MACHINE}"
           statusmsg "MACHINE_ARCH:     ${MACHINE_ARCH}"
           statusmsg "Build platform:   ${uname_s} ${uname_r} ${uname_m}"
         statusmsg "HOST_SH:          ${HOST_SH}"          statusmsg "HOST_SH:          ${HOST_SH}"
   
         rebuildmake          rebuildmake
Line 1143  main()
Line 1156  main()
                         statusmsg "Successful make ${op}"                          statusmsg "Successful make ${op}"
                         ;;                          ;;
   
                 obj|build|distribution|iso-image|release|sourcesets|syspkgs|params)                  obj|build|distribution|release|sourcesets|syspkgs|params)
                         ${runcmd} "${makewrapper}" ${parallel} ${op} ||                          ${runcmd} "${makewrapper}" ${parallel} ${op} ||
                             bomb "Failed to make ${op}"                              bomb "Failed to make ${op}"
                         statusmsg "Successful make ${op}"                          statusmsg "Successful make ${op}"
                         ;;                          ;;
   
                   iso-image|iso-image-source)
                           ${runcmd} "${makewrapper}" ${parallel} \
                               CDEXTRA=$iso_dir ${op} ||
                               bomb "Failed to make ${op}"
                           statusmsg "Successful make ${op}"
                           ;;
   
                 kernel=*)                  kernel=*)
                         arg=${op#*=}                          arg=${op#*=}
                         buildkernel "${arg}"                          buildkernel "${arg}"
Line 1176  main()
Line 1196  main()
                 esac                  esac
         done          done
   
         statusmsg "${progname} started: ${build_start}"  
         statusmsg "${progname} ended:   $(date)"          statusmsg "${progname} ended:   $(date)"
         if [ -s "${results}" ]; then          if [ -s "${results}" ]; then
                 echo "===> Summary of results:"                  echo "===> Summary of results:"

Legend:
Removed from v.1.153  
changed lines
  Added in v.1.153.2.6

CVSweb <webmaster@jp.NetBSD.org>