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.311 retrieving revision 1.312 diff -u -p -r1.311 -r1.312 --- src/build.sh 2016/11/13 14:47:46 1.311 +++ src/build.sh 2016/12/18 02:20:30 1.312 @@ -1,5 +1,5 @@ #! /usr/bin/env sh -# $NetBSD: build.sh,v 1.311 2016/11/13 14:47:46 ast Exp $ +# $NetBSD: build.sh,v 1.312 2016/12/18 02:20:30 christos Exp $ # # Copyright (c) 2001-2011 The NetBSD Foundation, Inc. # All rights reserved. @@ -1003,7 +1003,7 @@ usage() fi cat <<_usage_ -Usage: ${progname} [-EhnorUuxy] [-a arch] [-B buildid] [-C cdextras] +Usage: ${progname} [-EhnoPRrUuxy] [-a arch] [-B buildid] [-C cdextras] [-D dest] [-j njob] [-M obj] [-m mach] [-N noisy] [-O obj] [-R release] [-S seed] [-T tools] [-V var=[value]] [-w wrapper] [-X x11src] [-Y extsrcsrc] @@ -1078,6 +1078,8 @@ Usage: ${progname} [-EhnorUuxy] [-a arch -O obj Set obj root directory to obj; sets a MAKEOBJDIR pattern. Unsets MAKEOBJDIRPREFIX. -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 Remove contents of TOOLDIR and DESTDIR before building. -S seed Set BUILDSEED to seed. [Default: NetBSD-majorversion] @@ -1103,7 +1105,7 @@ _usage_ parseoptions() { - opts='a:B:C:D:Ehj:M:m:N:nO:oR:rS:T:UuV:w:X:xY:yZ:' + opts='a:B:C:D:Ehj:M:m:N:nO:oPR:rS:T:UuV:w:X:xY:yZ:' opt_a=false opt_m=false @@ -1219,6 +1221,10 @@ parseoptions() MKOBJDIRS=no ;; + -P) + MKREPRO=yes + ;; + -R) eval ${optargcmd}; resolvepath OPTARG setmakeenv RELEASEDIR "${OPTARG}" @@ -1435,38 +1441,20 @@ sanitycheck() ;; esac } - # 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() +# ${TOOLDIR}/bin/${toolprefix}program +print_tooldir_program() { local possible_TOP_OBJ local possible_TOOLDIR - local possible_make - local tooldir_make + local possible_program + local tooldir_program + local program=${1} if [ -n "${TOOLDIR}" ]; then - echo "${TOOLDIR}/bin/${toolprefix}make" - return 0 + echo "${TOOLDIR}/bin/${toolprefix}${program}" + return fi # Set host_ostype to something like "NetBSD-4.5.6-i386". This @@ -1479,8 +1467,8 @@ print_tooldir_make() )" # Look in a few potential locations for - # ${possible_TOOLDIR}/bin/${toolprefix}make. - # If we find it, then set possible_make. + # ${possible_TOOLDIR}/bin/${toolprefix}${program}. + # If we find it, then set possible_program. # # In the usual case (without interference from environment # variables or /etc/mk.conf), should set TOOLDIR to @@ -1501,14 +1489,42 @@ print_tooldir_make() do [ -n "${possible_TOP_OBJ}" ] || continue possible_TOOLDIR="${possible_TOP_OBJ}/tooldir.${host_ostype}" - possible_make="${possible_TOOLDIR}/bin/${toolprefix}make" + possible_program="${possible_TOOLDIR}/bin/${toolprefix}${program}" if [ -x "${possible_make}" ]; then - break - else - unset possible_make + echo ${possible_program} + return; fi 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 # ${toolprefix}make, nbmake, bmake, or make. # @@ -1876,7 +1892,7 @@ createmakewrapper() eval cat <