diff --git a/BUILDING b/BUILDING index 993d1e373106..99c0bf38b7a2 100644 --- a/BUILDING +++ b/BUILDING @@ -130,6 +130,14 @@ CONFIGURATION configuration file in order to set additional build parame- ters, such as compiler flags. + BUILDSEED GCC uses random numbers when compiling C++ code. This vari- + able seeds the gcc random number generator using the -fran- + dom-seed flag with this value. By default, it is set to + NetBSD-(majorversion). Using a fixed value causes C++ bina- + ries to be the same when built from the same sources. Addi- + tional information is available in the GCC documentation of + -frandom-seed. + DESTDIR Directory to contain the built NetBSD system. If set, spe- cial options are passed to the compilation tools to prevent their default use of the host system's /usr/include, @@ -752,6 +760,9 @@ BUILDING (provides a clean starting point). This will skip deleting DESTDIR if building on a native system to the root directory. + -S seed Change the value of BUILDSEED to seed. This should rarely be + necessary. + -T tools Set the value of TOOLDIR to tools. If a relative path is spec- ified, it will be converted to an absolute path before being used. If set, the bootstrap ``make'' will only be rebuilt if diff --git a/build.sh b/build.sh index e283b9b228ed..ea369d0bc7d0 100755 --- a/build.sh +++ b/build.sh @@ -1,5 +1,5 @@ #! /usr/bin/env sh -# $NetBSD: build.sh,v 1.189 2008/06/27 21:38:36 dyoung Exp $ +# $NetBSD: build.sh,v 1.190 2008/08/05 19:43:33 perry Exp $ # # Copyright (c) 2001-2005 The NetBSD Foundation, Inc. # All rights reserved. @@ -241,6 +241,10 @@ initdefaults() # DISTRIBVER="$(${HOST_SH} ${TOP}/sys/conf/osrelease.sh)" + # Set the BUILDSEED to NetBSD-"N" + # + setmakeenv BUILDSEED "NetBSD-$(${HOST_SH} ${TOP}/sys/conf/osrelease.sh -m)" + # Set various environment variables to known defaults, # to minimize (cross-)build problems observed "in the field". # @@ -509,9 +513,10 @@ usage() fi cat <<_usage_ -Usage: ${progname} [-EnorUux] [-a arch] [-B buildid] [-C cdextras] [-D dest] - [-j njob] [-M obj] [-m mach] [-N noisy] [-O obj] [-R release] - [-T tools] [-V var=[value]] [-w wrapper] [-X x11src] [-Z var] +Usage: ${progname} [-EnorUux] [-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] [-Z var] operation [...] Build operations (all imply "obj" and "tools"): @@ -562,6 +567,7 @@ Usage: ${progname} [-EnorUux] [-a arch] [-B buildid] [-C cdextras] [-D dest] -o Set MKOBJDIRS=no; do not create objdirs at start of build. -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] -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, ${toolprefix}make will be (re)built unconditionally. -U Set MKUNPRIVED=yes; build without requiring root privileges, @@ -581,7 +587,7 @@ _usage_ parseoptions() { - opts='a:B:bC:D: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:rS:T:tUuV:w:xX:Z:' opt_a=no if type getopts >/dev/null 2>&1; then @@ -707,6 +713,11 @@ parseoptions() do_rebuildmake=true ;; + -S) + eval ${optargcmd} + setmakeenv BUILDSEED "${OPTARG}" + ;; + -T) eval ${optargcmd}; resolvepath TOOLDIR="${OPTARG}" @@ -1141,7 +1152,7 @@ createmakewrapper() eval cat <