[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.310.2.3 and 1.311

version 1.310.2.3, 2017/04/26 02:52:13 version 1.311, 2016/11/13 14:47:46
Line 458  initdefaults()
Line 458  initdefaults()
   
         [ -d usr.bin/make ] || cd "$(dirname $0)"          [ -d usr.bin/make ] || cd "$(dirname $0)"
         [ -d usr.bin/make ] ||          [ -d usr.bin/make ] ||
             bomb "usr.bin/make not found; build.sh must be run from the top \              bomb "build.sh must be run from the top source level"
 level of source directory"  
         [ -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"
   
Line 1004  usage()
Line 1003  usage()
         fi          fi
         cat <<_usage_          cat <<_usage_
   
 Usage: ${progname} [-EhnoPRrUuxy] [-a arch] [-B buildid] [-C cdextras]  Usage: ${progname} [-EhnorUuxy] [-a arch] [-B buildid] [-C cdextras]
                 [-D dest] [-j njob] [-M obj] [-m mach] [-N noisy]                  [-D dest] [-j njob] [-M obj] [-m mach] [-N noisy]
                 [-O obj] [-R release] [-S seed] [-T tools]                  [-O obj] [-R release] [-S seed] [-T tools]
                 [-V var=[value]] [-w wrapper] [-X x11src] [-Y extsrcsrc]                  [-V var=[value]] [-w wrapper] [-X x11src] [-Y extsrcsrc]
Line 1079  Usage: ${progname} [-EhnoPRrUuxy] [-a ar
Line 1078  Usage: ${progname} [-EhnoPRrUuxy] [-a ar
     -O obj         Set obj root directory to obj; sets a MAKEOBJDIR pattern.      -O obj         Set obj root directory to obj; sets a MAKEOBJDIR pattern.
                    Unsets MAKEOBJDIRPREFIX.                     Unsets MAKEOBJDIRPREFIX.
     -o             Set MKOBJDIRS=no; do not create objdirs at start of build.      -o             Set MKOBJDIRS=no; do not create objdirs at start of build.
     -P             Set MKREPRO and MKREPRO_TIMESTAMP to the latest source  
                    CVS timestamp for reproducible builds.  
     -R release     Set RELEASEDIR to release.  [Default: releasedir]      -R release     Set RELEASEDIR to release.  [Default: releasedir]
     -r             Remove contents of TOOLDIR and DESTDIR before building.      -r             Remove contents of TOOLDIR and DESTDIR before building.
     -S seed        Set BUILDSEED to seed.  [Default: NetBSD-majorversion]      -S seed        Set BUILDSEED to seed.  [Default: NetBSD-majorversion]
Line 1106  _usage_
Line 1103  _usage_
   
 parseoptions()  parseoptions()
 {  {
         opts='a:B:C:D:Ehj:M:m:N:nO:oPR:rS:T:UuV:w:X:xY:yZ:'          opts='a:B:C:D:Ehj:M:m:N:nO:oR:rS:T:UuV:w:X:xY:yZ:'
         opt_a=false          opt_a=false
         opt_m=false          opt_m=false
   
Line 1222  parseoptions()
Line 1219  parseoptions()
                         MKOBJDIRS=no                          MKOBJDIRS=no
                         ;;                          ;;
   
                 -P)  
                         MKREPRO=yes  
                         ;;  
   
                 -R)                  -R)
                         eval ${optargcmd}; resolvepath OPTARG                          eval ${optargcmd}; resolvepath OPTARG
                         setmakeenv RELEASEDIR "${OPTARG}"                          setmakeenv RELEASEDIR "${OPTARG}"
Line 1442  sanitycheck()
Line 1435  sanitycheck()
                 ;;                  ;;
         esac          esac
 }  }
   
 # print_tooldir_make --  # print_tooldir_make --
 # Try to find and print a path to an existing  # Try to find and print a path to an existing
 # ${TOOLDIR}/bin/${toolprefix}program  # ${TOOLDIR}/bin/${toolprefix}make, for use by rebuildmake() before a
 print_tooldir_program()  # new version of ${toolprefix}make has been built.
   #
   # * If TOOLDIR was set in the environment or on the command line, use
   #   that value.
   # * Otherwise try to guess what TOOLDIR would be if not overridden by
   #   /etc/mk.conf, and check whether the resulting directory contains
   #   a copy of ${toolprefix}make (this should work for everybody who
   #   doesn't override TOOLDIR via /etc/mk.conf);
   # * Failing that, search for ${toolprefix}make, nbmake, bmake, or make,
   #   in the PATH (this might accidentally find a version of make that
   #   does not understand the syntax used by NetBSD make, and that will
   #   lead to failure in the next step);
   # * If a copy of make was found above, try to use it with
   #   nobomb_getmakevar to find the correct value for TOOLDIR, and believe the
   #   result only if it's a directory that already exists;
   # * If a value of TOOLDIR was found above, and if
   #   ${TOOLDIR}/bin/${toolprefix}make exists, print that value.
   #
   print_tooldir_make()
 {  {
         local possible_TOP_OBJ          local possible_TOP_OBJ
         local possible_TOOLDIR          local possible_TOOLDIR
         local possible_program          local possible_make
         local tooldir_program          local tooldir_make
         local program=${1}  
   
         if [ -n "${TOOLDIR}" ]; then          if [ -n "${TOOLDIR}" ]; then
                 echo "${TOOLDIR}/bin/${toolprefix}${program}"                  echo "${TOOLDIR}/bin/${toolprefix}make"
                 return                  return 0
         fi          fi
   
         # Set host_ostype to something like "NetBSD-4.5.6-i386".  This          # Set host_ostype to something like "NetBSD-4.5.6-i386".  This
Line 1468  print_tooldir_program()
Line 1479  print_tooldir_program()
                 )"                  )"
   
         # Look in a few potential locations for          # Look in a few potential locations for
         # ${possible_TOOLDIR}/bin/${toolprefix}${program}.          # ${possible_TOOLDIR}/bin/${toolprefix}make.
         # If we find it, then set possible_program.          # If we find it, then set possible_make.
         #          #
         # In the usual case (without interference from environment          # In the usual case (without interference from environment
         # variables or /etc/mk.conf), <bsd.own.mk> should set TOOLDIR to          # variables or /etc/mk.conf), <bsd.own.mk> should set TOOLDIR to
Line 1490  print_tooldir_program()
Line 1501  print_tooldir_program()
         do          do
                 [ -n "${possible_TOP_OBJ}" ] || continue                  [ -n "${possible_TOP_OBJ}" ] || continue
                 possible_TOOLDIR="${possible_TOP_OBJ}/tooldir.${host_ostype}"                  possible_TOOLDIR="${possible_TOP_OBJ}/tooldir.${host_ostype}"
                 possible_program="${possible_TOOLDIR}/bin/${toolprefix}${program}"                  possible_make="${possible_TOOLDIR}/bin/${toolprefix}make"
                 if [ -x "${possible_make}" ]; then                  if [ -x "${possible_make}" ]; then
                         echo ${possible_program}                          break
                         return;                  else
                           unset possible_make
                 fi                  fi
         done          done
         echo ""  
 }  
 # print_tooldir_make --  
 # Try to find and print a path to an existing  
 # ${TOOLDIR}/bin/${toolprefix}make, for use by rebuildmake() before a  
 # new version of ${toolprefix}make has been built.  
 #  
 # * If TOOLDIR was set in the environment or on the command line, use  
 #   that value.  
 # * Otherwise try to guess what TOOLDIR would be if not overridden by  
 #   /etc/mk.conf, and check whether the resulting directory contains  
 #   a copy of ${toolprefix}make (this should work for everybody who  
 #   doesn't override TOOLDIR via /etc/mk.conf);  
 # * Failing that, search for ${toolprefix}make, nbmake, bmake, or make,  
 #   in the PATH (this might accidentally find a version of make that  
 #   does not understand the syntax used by NetBSD make, and that will  
 #   lead to failure in the next step);  
 # * If a copy of make was found above, try to use it with  
 #   nobomb_getmakevar to find the correct value for TOOLDIR, and believe the  
 #   result only if it's a directory that already exists;  
 # * If a value of TOOLDIR was found above, and if  
 #   ${TOOLDIR}/bin/${toolprefix}make exists, print that value.  
 #  
 print_tooldir_make()  
 {  
         local possible_make  
         local possible_TOOLDIR  
         local tooldir_make  
   
         possible_make=$(print_tooldir_program make)  
         # If the above didn't work, search the PATH for a suitable          # If the above didn't work, search the PATH for a suitable
         # ${toolprefix}make, nbmake, bmake, or make.          # ${toolprefix}make, nbmake, bmake, or make.
         #          #
Line 1924  EOF
Line 1907  EOF
   
 make_in_dir()  make_in_dir()
 {  {
         local dir="$1"          dir="$1"
         local op="$2"          op="$2"
         ${runcmd} cd "${dir}" ||          ${runcmd} cd "${dir}" ||
             bomb "Failed to cd to \"${dir}\""              bomb "Failed to cd to \"${dir}\""
         ${runcmd} "${makewrapper}" ${parallel} ${op} ||          ${runcmd} "${makewrapper}" ${parallel} ${op} ||
Line 2189  dorump()
Line 2172  dorump()
         statusmsg "Rump build&link tests successful"          statusmsg "Rump build&link tests successful"
 }  }
   
 setup_mkrepro()  
 {  
         if [ ${MKREPRO-no} != "yes" ]; then  
                 return  
         fi  
         local dirs=${NETBSDSRCDIR-/usr/src}/  
         if [ ${MKX11-no} = "yes" ]; then  
                 dirs="$dirs ${X11SRCDIR-/usr/xsrc}/"  
         fi  
         local cvslatest=$(print_tooldir_program cvslatest)  
         if [ ! -x "${cvslatest}" ]; then  
                 buildtools  
         fi  
         MKREPRO_TIMESTAMP=$("${cvslatest}" ${dirs})  
         [ -n "${MKREPRO_TIMESTAMP}" ] || bomb "Failed to compute timestamp"  
         statusmsg2 "MKREPRO_TIMESTAMP" "$(TZ=UTC date -r ${MKREPRO_TIMESTAMP})"  
         export MKREPRO MKREPRO_TIMESTAMP  
 }  
   
 main()  main()
 {  {
         initdefaults          initdefaults
Line 2238  main()
Line 2202  main()
         rebuildmake          rebuildmake
         validatemakeparams          validatemakeparams
         createmakewrapper          createmakewrapper
         setup_mkrepro  
   
         # Perform the operations.          # Perform the operations.
         #          #
Line 2261  main()
Line 2224  main()
                         statusmsg "Built sets to ${setdir}"                          statusmsg "Built sets to ${setdir}"
                         ;;                          ;;
   
                 build|distribution|release)                  cleandir|obj|build|distribution|release|sourcesets|syspkgs|params)
                         ${runcmd} "${makewrapper}" ${parallel} ${op} ||  
                             bomb "Failed to make ${op}"  
                         statusmsg "Successful make ${op}"  
                         ;;  
   
                 cleandir|obj|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}"

Legend:
Removed from v.1.310.2.3  
changed lines
  Added in v.1.311

CVSweb <webmaster@jp.NetBSD.org>