version 1.255.2.3, 2013/06/23 06:26:12 |
version 1.255.2.4, 2014/08/19 23:45:10 |
|
|
exit 1 |
exit 1 |
} |
} |
|
|
|
# Quote args to make them safe in the shell. |
|
# Usage: quotedlist="$(shell_quote args...)" |
|
# |
|
# After building up a quoted list, use it by evaling it inside |
|
# double quotes, like this: |
|
# eval "set -- $quotedlist" |
|
# or like this: |
|
# eval "\$command $quotedlist \$filename" |
|
# |
|
shell_quote() |
|
{( |
|
local result='' |
|
local arg qarg |
|
LC_COLLATE=C ; export LC_COLLATE # so [a-zA-Z0-9] works in ASCII |
|
for arg in "$@" ; do |
|
case "${arg}" in |
|
'') |
|
qarg="''" |
|
;; |
|
*[!-./a-zA-Z0-9]*) |
|
# Convert each embedded ' to '\'', |
|
# then insert ' at the beginning of the first line, |
|
# and append ' at the end of the last line. |
|
# Finally, elide unnecessary '' pairs at the |
|
# beginning and end of the result and as part of |
|
# '\'''\'' sequences that result from multiple |
|
# adjacent quotes in he input. |
|
qarg="$(printf "%s\n" "$arg" | \ |
|
${SED:-sed} -e "s/'/'\\\\''/g" \ |
|
-e "1s/^/'/" -e "\$s/\$/'/" \ |
|
-e "1s/^''//" -e "\$s/''\$//" \ |
|
-e "s/'''/'/g" |
|
)" |
|
;; |
|
*) |
|
# Arg is not the empty string, and does not contain |
|
# any unsafe characters. Leave it unchanged for |
|
# readability. |
|
qarg="${arg}" |
|
;; |
|
esac |
|
result="${result}${result:+ }${qarg}" |
|
done |
|
printf "%s\n" "$result" |
|
)} |
|
|
statusmsg() |
statusmsg() |
{ |
{ |
Line 579 MACHINE=arc MACHINE_ARCH=mips64el ALIAS |
|
Line 624 MACHINE=arc MACHINE_ARCH=mips64el ALIAS |
|
MACHINE=arc MACHINE_ARCH=mipsel DEFAULT |
MACHINE=arc MACHINE_ARCH=mipsel DEFAULT |
MACHINE=atari MACHINE_ARCH=m68k |
MACHINE=atari MACHINE_ARCH=m68k |
MACHINE=bebox MACHINE_ARCH=powerpc |
MACHINE=bebox MACHINE_ARCH=powerpc |
MACHINE=cats MACHINE_ARCH=arm DEFAULT |
MACHINE=cats MACHINE_ARCH=arm ALIAS=ocats |
MACHINE=cats MACHINE_ARCH=earm |
MACHINE=cats MACHINE_ARCH=earmv4 ALIAS=ecats DEFAULT |
MACHINE=cesfic MACHINE_ARCH=m68k |
MACHINE=cesfic MACHINE_ARCH=m68k |
MACHINE=cobalt MACHINE_ARCH=mips64el ALIAS=cobalt64 |
MACHINE=cobalt MACHINE_ARCH=mips64el ALIAS=cobalt64 |
MACHINE=cobalt MACHINE_ARCH=mipsel DEFAULT |
MACHINE=cobalt MACHINE_ARCH=mipsel DEFAULT |
MACHINE=dreamcast MACHINE_ARCH=sh3el |
MACHINE=dreamcast MACHINE_ARCH=sh3el |
MACHINE=emips MACHINE_ARCH=mipseb |
MACHINE=emips MACHINE_ARCH=mipseb |
MACHINE=epoc32 MACHINE_ARCH=arm |
MACHINE=epoc32 MACHINE_ARCH=arm |
MACHINE=evbarm MACHINE_ARCH=arm ALIAS=evbarm-el DEFAULT |
MACHINE=evbarm MACHINE_ARCH=arm ALIAS=evboarm-el |
MACHINE=evbarm MACHINE_ARCH=armeb ALIAS=evbarm-eb |
MACHINE=evbarm MACHINE_ARCH=armeb ALIAS=evboarm-eb |
MACHINE=evbarm MACHINE_ARCH=earm ALIAS=evbearm-el |
MACHINE=evbarm MACHINE_ARCH=earm ALIAS=evbearm-el DEFAULT |
MACHINE=evbarm MACHINE_ARCH=earmeb ALIAS=evbearm-eb |
MACHINE=evbarm MACHINE_ARCH=earmeb ALIAS=evbearm-eb |
MACHINE=evbarm MACHINE_ARCH=earmhf ALIAS=evbearmhf-el |
MACHINE=evbarm MACHINE_ARCH=earmhf ALIAS=evbearmhf-el |
MACHINE=evbarm MACHINE_ARCH=earmhfeb ALIAS=evbearmhf-eb |
MACHINE=evbarm MACHINE_ARCH=earmhfeb ALIAS=evbearmhf-eb |
|
MACHINE=evbarm MACHINE_ARCH=earmv4 ALIAS=evbearmv4-el |
|
MACHINE=evbarm MACHINE_ARCH=earmv4eb ALIAS=evbearmv4-eb |
|
MACHINE=evbarm MACHINE_ARCH=earmv5 ALIAS=evbearmv5-el |
|
MACHINE=evbarm MACHINE_ARCH=earmv5eb ALIAS=evbearmv5-eb |
|
MACHINE=evbarm MACHINE_ARCH=earmv6 ALIAS=evbearmv6-el |
|
MACHINE=evbarm MACHINE_ARCH=earmv6hf ALIAS=evbearmv6hf-el |
|
MACHINE=evbarm MACHINE_ARCH=earmv6eb ALIAS=evbearmv6-eb |
|
MACHINE=evbarm MACHINE_ARCH=earmv6hfeb ALIAS=evbearmv6hf-eb |
|
MACHINE=evbarm MACHINE_ARCH=earmv7 ALIAS=evbearmv7-el |
|
MACHINE=evbarm MACHINE_ARCH=earmv7eb ALIAS=evbearmv7-eb |
|
MACHINE=evbarm MACHINE_ARCH=earmv7hf ALIAS=evbearmv7hf-el |
|
MACHINE=evbarm MACHINE_ARCH=earmv7hfeb ALIAS=evbearmv7hf-eb |
|
MACHINE=evbarm64 MACHINE_ARCH=aarch64 ALIAS=evbarm64-el |
|
MACHINE=evbarm64 MACHINE_ARCH=aarch64eb ALIAS=evbarm64-eb |
|
MACHINE=evbcf MACHINE_ARCH=coldfire |
MACHINE=evbmips MACHINE_ARCH= NO_DEFAULT |
MACHINE=evbmips MACHINE_ARCH= NO_DEFAULT |
MACHINE=evbmips MACHINE_ARCH=mips64eb ALIAS=evbmips64-eb |
MACHINE=evbmips MACHINE_ARCH=mips64eb ALIAS=evbmips64-eb |
MACHINE=evbmips MACHINE_ARCH=mips64el ALIAS=evbmips64-el |
MACHINE=evbmips MACHINE_ARCH=mips64el ALIAS=evbmips64-el |
Line 605 MACHINE=evbsh3 MACHINE_ARCH=sh3eb ALIAS |
|
Line 665 MACHINE=evbsh3 MACHINE_ARCH=sh3eb ALIAS |
|
MACHINE=evbsh3 MACHINE_ARCH=sh3el ALIAS=evbsh3-el |
MACHINE=evbsh3 MACHINE_ARCH=sh3el ALIAS=evbsh3-el |
MACHINE=ews4800mips MACHINE_ARCH=mipseb |
MACHINE=ews4800mips MACHINE_ARCH=mipseb |
MACHINE=hp300 MACHINE_ARCH=m68k |
MACHINE=hp300 MACHINE_ARCH=m68k |
MACHINE=hp700 MACHINE_ARCH=hppa |
MACHINE=hppa MACHINE_ARCH=hppa |
MACHINE=hpcarm MACHINE_ARCH=arm |
MACHINE=hpcarm MACHINE_ARCH=arm ALIAS=hpcoarm |
|
MACHINE=hpcarm MACHINE_ARCH=earmv4 ALIAS=hpcearm DEFAULT |
MACHINE=hpcmips MACHINE_ARCH=mipsel |
MACHINE=hpcmips MACHINE_ARCH=mipsel |
MACHINE=hpcsh MACHINE_ARCH=sh3el |
MACHINE=hpcsh MACHINE_ARCH=sh3el |
MACHINE=i386 MACHINE_ARCH=i386 |
MACHINE=i386 MACHINE_ARCH=i386 |
MACHINE=ia64 MACHINE_ARCH=ia64 |
MACHINE=ia64 MACHINE_ARCH=ia64 |
MACHINE=ibmnws MACHINE_ARCH=powerpc |
MACHINE=ibmnws MACHINE_ARCH=powerpc |
MACHINE=iyonix MACHINE_ARCH=arm DEFAULT |
MACHINE=iyonix MACHINE_ARCH=arm ALIAS=oiyonix |
MACHINE=iyonix MACHINE_ARCH=earm |
MACHINE=iyonix MACHINE_ARCH=earm ALIAS=eiyonix DEFAULT |
MACHINE=landisk MACHINE_ARCH=sh3el |
MACHINE=landisk MACHINE_ARCH=sh3el |
MACHINE=luna68k MACHINE_ARCH=m68k |
MACHINE=luna68k MACHINE_ARCH=m68k |
MACHINE=mac68k MACHINE_ARCH=m68k |
MACHINE=mac68k MACHINE_ARCH=m68k |
Line 623 MACHINE=mipsco MACHINE_ARCH=mipseb |
|
Line 684 MACHINE=mipsco MACHINE_ARCH=mipseb |
|
MACHINE=mmeye MACHINE_ARCH=sh3eb |
MACHINE=mmeye MACHINE_ARCH=sh3eb |
MACHINE=mvme68k MACHINE_ARCH=m68k |
MACHINE=mvme68k MACHINE_ARCH=m68k |
MACHINE=mvmeppc MACHINE_ARCH=powerpc |
MACHINE=mvmeppc MACHINE_ARCH=powerpc |
MACHINE=netwinder MACHINE_ARCH=arm DEFAULT |
MACHINE=netwinder MACHINE_ARCH=arm ALIAS=onetwinder |
MACHINE=netwinder MACHINE_ARCH=earm |
MACHINE=netwinder MACHINE_ARCH=earmv4 ALIAS=enetwinder DEFAULT |
MACHINE=news68k MACHINE_ARCH=m68k |
MACHINE=news68k MACHINE_ARCH=m68k |
MACHINE=newsmips MACHINE_ARCH=mipseb |
MACHINE=newsmips MACHINE_ARCH=mipseb |
MACHINE=next68k MACHINE_ARCH=m68k |
MACHINE=next68k MACHINE_ARCH=m68k |
MACHINE=ofppc MACHINE_ARCH=powerpc DEFAULT |
MACHINE=ofppc MACHINE_ARCH=powerpc DEFAULT |
MACHINE=ofppc MACHINE_ARCH=powerpc64 ALIAS=ofppc64 |
MACHINE=ofppc MACHINE_ARCH=powerpc64 ALIAS=ofppc64 |
|
MACHINE=playstation2 MACHINE_ARCH=mipsel |
MACHINE=pmax MACHINE_ARCH=mips64el ALIAS=pmax64 |
MACHINE=pmax MACHINE_ARCH=mips64el ALIAS=pmax64 |
MACHINE=pmax MACHINE_ARCH=mipsel DEFAULT |
MACHINE=pmax MACHINE_ARCH=mipsel DEFAULT |
MACHINE=prep MACHINE_ARCH=powerpc |
MACHINE=prep MACHINE_ARCH=powerpc |
Line 642 MACHINE=sbmips MACHINE_ARCH=mipseb ALIA |
|
Line 704 MACHINE=sbmips MACHINE_ARCH=mipseb ALIA |
|
MACHINE=sbmips MACHINE_ARCH=mipsel ALIAS=sbmips-el |
MACHINE=sbmips MACHINE_ARCH=mipsel ALIAS=sbmips-el |
MACHINE=sgimips MACHINE_ARCH=mips64eb ALIAS=sgimips64 |
MACHINE=sgimips MACHINE_ARCH=mips64eb ALIAS=sgimips64 |
MACHINE=sgimips MACHINE_ARCH=mipseb DEFAULT |
MACHINE=sgimips MACHINE_ARCH=mipseb DEFAULT |
MACHINE=shark MACHINE_ARCH=arm DEFAULT |
MACHINE=shark MACHINE_ARCH=arm ALIAS=oshark |
MACHINE=shark MACHINE_ARCH=earm |
MACHINE=shark MACHINE_ARCH=earmv4 ALIAS=eshark DEFAULT |
MACHINE=sparc MACHINE_ARCH=sparc |
MACHINE=sparc MACHINE_ARCH=sparc |
MACHINE=sparc64 MACHINE_ARCH=sparc64 |
MACHINE=sparc64 MACHINE_ARCH=sparc64 |
MACHINE=sun2 MACHINE_ARCH=m68000 |
MACHINE=sun2 MACHINE_ARCH=m68000 |
MACHINE=sun3 MACHINE_ARCH=m68k |
MACHINE=sun3 MACHINE_ARCH=m68k |
MACHINE=vax MACHINE_ARCH=vax |
MACHINE=vax MACHINE_ARCH=vax |
MACHINE=x68k MACHINE_ARCH=m68k |
MACHINE=x68k MACHINE_ARCH=m68k |
MACHINE=zaurus MACHINE_ARCH=arm DEFAULT |
MACHINE=zaurus MACHINE_ARCH=arm ALIAS=ozaurus |
MACHINE=zaurus MACHINE_ARCH=earm |
MACHINE=zaurus MACHINE_ARCH=earm ALIAS=ezaurus DEFAULT |
' |
' |
|
|
# getarch -- find the default MACHINE_ARCH for a MACHINE, |
# getarch -- find the default MACHINE_ARCH for a MACHINE, |
# or convert an alias to a MACHINE/MACHINE_ARCH pair. |
# or convert an alias to a MACHINE/MACHINE_ARCH pair. |
# |
# |
# Saves MACHINE in makewrappermachine before possibly modifying MACHINE. |
# Saves the original value of MACHINE in makewrappermachine before |
|
# alias processing. |
# |
# |
# Sets MACHINE and MACHINE_ARCH if the input MACHINE value is |
# Sets MACHINE and MACHINE_ARCH if the input MACHINE value is |
# recognised as an alias, or recognised as a machine that has a default |
# recognised as an alias, or recognised as a machine that has a default |
|
|
line="${line%%#*}" # ignore comments |
line="${line%%#*}" # ignore comments |
line="$( IFS=" ${tab}" ; echo $line )" # normalise white space |
line="$( IFS=" ${tab}" ; echo $line )" # normalise white space |
case "${line} " in |
case "${line} " in |
"") |
" ") |
# skip blank lines or comment lines |
# skip blank lines or comment lines |
continue |
continue |
;; |
;; |
|
|
# remember that there was more than one match. |
# remember that there was more than one match. |
case "$found" in |
case "$found" in |
'') found="$line" ;; |
'') found="$line" ;; |
*) found="MULTIPLE_MATCHES" ; break ;; |
*) found="MULTIPLE_MATCHES" ;; |
esac |
esac |
;; |
;; |
esac |
esac |
|
|
line="${line%%#*}" # ignore comments |
line="${line%%#*}" # ignore comments |
line="$( IFS=" ${tab}" ; echo $line )" # normalise white space |
line="$( IFS=" ${tab}" ; echo $line )" # normalise white space |
case "${line} " in |
case "${line} " in |
"") |
" ") |
# skip blank lines or comment lines |
# skip blank lines or comment lines |
continue |
continue |
;; |
;; |
|
|
esac |
esac |
} |
} |
|
|
|
# listarch -- list valid MACHINE/MACHINE_ARCH/ALIAS values, |
|
# optionally restricted to those where the MACHINE and/or MACHINE_ARCH |
|
# match specifed glob patterns. |
|
# |
|
listarch() |
|
{ |
|
local machglob="$1" archglob="$2" |
|
local IFS |
|
local wildcard="*" |
|
local line xline frag |
|
local line_matches_machine line_matches_arch |
|
local found=false |
|
|
|
# Empty machglob or archglob should match anything |
|
: "${machglob:=${wildcard}}" |
|
: "${archglob:=${wildcard}}" |
|
|
|
IFS="${nl}" |
|
for line in ${valid_MACHINE_ARCH}; do |
|
line="${line%%#*}" # ignore comments |
|
xline="$( IFS=" ${tab}" ; echo $line )" # normalise white space |
|
[ -z "${xline}" ] && continue # skip blank or comment lines |
|
|
|
line_matches_machine=false |
|
line_matches_arch=false |
|
|
|
IFS=" " |
|
for frag in ${xline}; do |
|
case "${frag}" in |
|
MACHINE=${machglob}) |
|
line_matches_machine=true ;; |
|
ALIAS=${machglob}) |
|
line_matches_machine=true ;; |
|
MACHINE_ARCH=${archglob}) |
|
line_matches_arch=true ;; |
|
esac |
|
done |
|
|
|
if $line_matches_machine && $line_matches_arch; then |
|
found=true |
|
echo "$line" |
|
fi |
|
done |
|
if ! $found; then |
|
echo >&2 "No match for" \ |
|
"MACHINE=${machglob} MACHINE_ARCH=${archglob}" |
|
return 1 |
|
fi |
|
return 0 |
|
} |
|
|
# nobomb_getmakevar -- |
# nobomb_getmakevar -- |
# Given the name of a make variable in $1, print make's idea of the |
# Given the name of a make variable in $1, print make's idea of the |
# value of that variable, or return 1 if there's an error. |
# value of that variable, or return 1 if there's an error. |
Line 907 Usage: ${progname} [-EhnorUuxy] [-a arch |
|
Line 1021 Usage: ${progname} [-EhnorUuxy] [-a arch |
|
install=idir Run "make installworld" to \`idir' to install all sets |
install=idir Run "make installworld" to \`idir' to install all sets |
except \`etc'. Useful after "distribution" or "release" |
except \`etc'. Useful after "distribution" or "release" |
kernel=conf Build kernel with config file \`conf' |
kernel=conf Build kernel with config file \`conf' |
|
kernel.gdb=conf Build kernel (including netbsd.gdb) with config |
|
file \`conf' |
releasekernel=conf Install kernel built by kernel=conf to RELEASEDIR. |
releasekernel=conf Install kernel built by kernel=conf to RELEASEDIR. |
installmodules=idir Run "make installmodules" to \`idir' to install all |
installmodules=idir Run "make installmodules" to \`idir' to install all |
kernel modules. |
kernel modules. |
Line 927 Usage: ${progname} [-EhnorUuxy] [-a arch |
|
Line 1043 Usage: ${progname} [-EhnorUuxy] [-a arch |
|
disk-image=target Creae bootable disk image in |
disk-image=target Creae bootable disk image in |
RELEASEDIR/RELEASEMACHINEDIR/binary/gzimg/target.img.gz. |
RELEASEDIR/RELEASEMACHINEDIR/binary/gzimg/target.img.gz. |
params Display various make(1) parameters. |
params Display various make(1) parameters. |
|
list-arch Display a list of valid MACHINE/MACHINE_ARCH values, |
|
and exit. The list may be narrowed by passing glob |
|
patterns or exact values in MACHINE or MACHINE_ARCH. |
|
|
Options: |
Options: |
-a arch Set MACHINE_ARCH to arch. [Default: deduced from MACHINE] |
-a arch Set MACHINE_ARCH to arch. [Default: deduced from MACHINE] |
Line 939 Usage: ${progname} [-EhnorUuxy] [-a arch |
|
Line 1058 Usage: ${progname} [-EhnorUuxy] [-a arch |
|
-j njob Run up to njob jobs in parallel; see make(1) -j. |
-j njob Run up to njob jobs in parallel; see make(1) -j. |
-M obj Set obj root directory to obj; sets MAKEOBJDIRPREFIX. |
-M obj Set obj root directory to obj; sets MAKEOBJDIRPREFIX. |
Unsets MAKEOBJDIR. |
Unsets MAKEOBJDIR. |
-m mach Set MACHINE to mach; not required if NetBSD native. |
-m mach Set MACHINE to mach. Some mach values are actually |
|
aliases that set MACHINE/MACHINE_ARCH pairs. |
|
[Default: deduced from the host system if the host |
|
OS is NetBSD] |
-N noisy Set the noisyness (MAKEVERBOSE) level of the build: |
-N noisy Set the noisyness (MAKEVERBOSE) level of the build: |
0 Minimal output ("quiet") |
0 Minimal output ("quiet") |
1 Describe what is occurring |
1 Describe what is occurring |
|
|
parseoptions() |
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:oR:rS:T:UuV:w:X:xY:yZ:' |
opt_a=no |
opt_a=false |
|
|
if type getopts >/dev/null 2>&1; then |
if type getopts >/dev/null 2>&1; then |
# Use POSIX getopts. |
# Use POSIX getopts. |
|
|
-a) |
-a) |
eval ${optargcmd} |
eval ${optargcmd} |
MACHINE_ARCH=${OPTARG} |
MACHINE_ARCH=${OPTARG} |
opt_a=yes |
opt_a=true |
;; |
;; |
|
|
-B) |
-B) |
|
|
-m) |
-m) |
eval ${optargcmd} |
eval ${optargcmd} |
MACHINE="${OPTARG}" |
MACHINE="${OPTARG}" |
[ "${opt_a}" != "yes" ] && getarch |
|
;; |
;; |
|
|
-N) |
-N) |
|
|
usage |
usage |
;; |
;; |
|
|
|
list-arch) |
|
listarch "${MACHINE}" "${MACHINE_ARCH}" |
|
exit $? |
|
;; |
|
|
makewrapper|cleandir|obj|tools|build|distribution|release|sets|sourcesets|syspkgs|params) |
makewrapper|cleandir|obj|tools|build|distribution|release|sets|sourcesets|syspkgs|params) |
;; |
;; |
|
|
|
|
op=install_image # used as part of a variable name |
op=install_image # used as part of a variable name |
;; |
;; |
|
|
kernel=*|releasekernel=*) |
kernel=*|releasekernel=*|kernel.gdb=*) |
arg=${op#*=} |
arg=${op#*=} |
op=${op%%=*} |
op=${op%%=*} |
[ -n "${arg}" ] || |
[ -n "${arg}" ] || |
|
|
|
|
# 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. |
# |
# |
|
# MACHINE_ARCH from the environment may be overridden by getarch |
|
# (based on the MACHINE), but MACHINE_ARCH from the -a option should |
|
# not be overridden. |
|
# |
if [ -z "${MACHINE}" ]; then |
if [ -z "${MACHINE}" ]; then |
[ "${uname_s}" = "NetBSD" ] || |
[ "${uname_s}" = "NetBSD" ] || |
bomb "MACHINE must be set, or -m must be used, for cross builds." |
bomb "MACHINE must be set, or -m must be used, for cross builds." |
MACHINE=${uname_m} |
MACHINE=${uname_m} |
fi |
fi |
[ -n "${MACHINE_ARCH}" ] || getarch |
$opt_a || getarch |
validatearch |
validatearch |
|
|
# Set up default make(1) environment. |
# Set up default make(1) environment. |
# |
# |
makeenv="${makeenv} TOOLDIR MACHINE MACHINE_ARCH MAKEFLAGS" |
makeenv="${makeenv} TOOLDIR MACHINE MACHINE_ARCH MAKEFLAGS" |
[ -z "${BUILDID}" ] || makeenv="${makeenv} BUILDID" |
[ -z "${BUILDID}" ] || makeenv="${makeenv} BUILDID" |
|
[ -z "${BUILDINFO}" ] || makeenv="${makeenv} BUILDINFO" |
MAKEFLAGS="-de -m ${TOP}/share/mk ${MAKEFLAGS}" |
MAKEFLAGS="-de -m ${TOP}/share/mk ${MAKEFLAGS}" |
MAKEFLAGS="${MAKEFLAGS} MKOBJDIRS=${MKOBJDIRS-yes}" |
MAKEFLAGS="${MAKEFLAGS} MKOBJDIRS=${MKOBJDIRS-yes}" |
export MAKEFLAGS MACHINE MACHINE_ARCH |
export MAKEFLAGS MACHINE MACHINE_ARCH |
|
setmakeenv USETOOLS "yes" |
|
setmakeenv MAKEWRAPPERMACHINE "${makewrappermachine:-${MACHINE}}" |
} |
} |
|
|
# sanitycheck -- |
# sanitycheck -- |
|
|
# |
# |
sanitycheck() |
sanitycheck() |
{ |
{ |
# Non-root should always use either the -U or -E flag. |
|
# |
|
if ! ${do_expertmode} && \ |
|
[ "$id_u" -ne 0 ] && \ |
|
[ "${MKUNPRIVED}" = "no" ] ; then |
|
bomb "-U or -E must be set for build as an unprivileged user." |
|
fi |
|
|
|
# Install as non-root is a bad idea. |
# Install as non-root is a bad idea. |
# |
# |
if ${do_install} && [ "$id_u" -ne 0 ] ; then |
if ${do_install} && [ "$id_u" -ne 0 ] ; then |
Line 1501 validatemakeparams() |
|
Line 1626 validatemakeparams() |
|
statusmsg2 "MAKECONF file:" "${MAKECONF} (File not found)" |
statusmsg2 "MAKECONF file:" "${MAKECONF} (File not found)" |
fi |
fi |
|
|
|
# Normalise MKOBJDIRS, MKUNPRIVED, and MKUPDATE. |
|
# These may be set as build.sh options or in "mk.conf". |
|
# Don't export them as they're only used for tests in build.sh. |
|
# |
|
MKOBJDIRS=$(getmakevar MKOBJDIRS) |
|
MKUNPRIVED=$(getmakevar MKUNPRIVED) |
|
MKUPDATE=$(getmakevar MKUPDATE) |
|
|
|
# Non-root should always use either the -U or -E flag. |
|
# |
|
if ! ${do_expertmode} && \ |
|
[ "$id_u" -ne 0 ] && \ |
|
[ "${MKUNPRIVED}" = "no" ] ; then |
|
bomb "-U or -E must be set for build as an unprivileged user." |
|
fi |
|
|
if [ "${runcmd}" = "echo" ]; then |
if [ "${runcmd}" = "echo" ]; then |
TOOLCHAIN_MISSING=no |
TOOLCHAIN_MISSING=no |
EXTERNAL_TOOLCHAIN="" |
EXTERNAL_TOOLCHAIN="" |
Line 1522 validatemakeparams() |
|
Line 1663 validatemakeparams() |
|
exit 1 |
exit 1 |
fi |
fi |
|
|
# Normalise MKOBJDIRS, MKUNPRIVED, and MKUPDATE |
|
# These may be set as build.sh options or in "mk.conf". |
|
# Don't export them as they're only used for tests in build.sh. |
|
# |
|
MKOBJDIRS=$(getmakevar MKOBJDIRS) |
|
MKUNPRIVED=$(getmakevar MKUNPRIVED) |
|
MKUPDATE=$(getmakevar MKUPDATE) |
|
|
|
if [ "${MKOBJDIRS}" != "no" ]; then |
if [ "${MKOBJDIRS}" != "no" ]; then |
# Create the top-level object directory. |
# Create the top-level object directory. |
# |
# |
Line 1737 createmakewrapper() |
|
Line 1870 createmakewrapper() |
|
|
|
EOF |
EOF |
{ |
{ |
for f in ${makeenv}; do |
sorted_vars="$(for var in ${makeenv}; do echo "${var}" ; done \ |
if eval "[ -z \"\${$f}\" -a \"\${${f}-X}\" = \"X\" ]"; then |
| sort -u )" |
eval echo "unset ${f}" |
for var in ${sorted_vars}; do |
|
eval val=\"\${${var}}\" |
|
eval is_set=\"\${${var}+set}\" |
|
if [ -z "${is_set}" ]; then |
|
echo "unset ${var}" |
else |
else |
eval echo "${f}=\'\$$(echo ${f})\'\;\ export\ ${f}" |
qval="$(shell_quote "${val}")" |
|
echo "${var}=${qval}; export ${var}" |
fi |
fi |
done |
done |
|
|
eval cat <<EOF |
cat <<EOF |
MAKEWRAPPERMACHINE=${makewrappermachine:-${MACHINE}}; export MAKEWRAPPERMACHINE |
|
USETOOLS=yes; export USETOOLS |
|
EOF |
|
} | eval sort -u "${makewrapout}" |
|
eval cat <<EOF "${makewrapout}" |
|
|
|
exec "\${TOOLDIR}/bin/${toolprefix}make" \${1+"\$@"} |
exec "\${TOOLDIR}/bin/${toolprefix}make" \${1+"\$@"} |
EOF |
EOF |
|
} | eval cat "${makewrapout}" |
[ "${runcmd}" = "echo" ] && echo EOF |
[ "${runcmd}" = "echo" ] && echo EOF |
${runcmd} chmod +x "${makewrapper}" |
${runcmd} chmod +x "${makewrapper}" |
statusmsg2 "Updated makewrapper:" "${makewrapper}" |
statusmsg2 "Updated makewrapper:" "${makewrapper}" |
|
|
[ -x "${TOOLDIR}/bin/${toolprefix}config" ] \ |
[ -x "${TOOLDIR}/bin/${toolprefix}config" ] \ |
|| bomb "${TOOLDIR}/bin/${toolprefix}config does not exist. You need to \"$0 tools\" first." |
|| bomb "${TOOLDIR}/bin/${toolprefix}config does not exist. You need to \"$0 tools\" first." |
${runcmd} "${TOOLDIR}/bin/${toolprefix}config" -b "${kernelbuildpath}" \ |
${runcmd} "${TOOLDIR}/bin/${toolprefix}config" -b "${kernelbuildpath}" \ |
-s "${TOP}/sys" "${kernelconfpath}" || |
${ksymopts} -s "${TOP}/sys" "${kernelconfpath}" || |
bomb "${toolprefix}config failed for ${kernelconf}" |
bomb "${toolprefix}config failed for ${kernelconf}" |
make_in_dir "${kernelbuildpath}" depend |
make_in_dir "${kernelbuildpath}" depend |
make_in_dir "${kernelbuildpath}" all |
make_in_dir "${kernelbuildpath}" all |
|
|
[ "${1}" != "rumptest" ] && bomb 'build.sh rump not yet functional. ' \ |
[ "${1}" != "rumptest" ] && bomb 'build.sh rump not yet functional. ' \ |
'did you mean "rumptest"?' |
'did you mean "rumptest"?' |
|
|
export RUMPTEST_BUILDSH=1 |
export RUMPKERN_ONLY=1 |
# create obj and distrib dirs |
# create obj and distrib dirs |
if [ "${MKOBJDIRS}" != "no" ]; then |
if [ "${MKOBJDIRS}" != "no" ]; then |
make_in_dir "${NETBSDSRCDIR}/etc/mtree" obj |
make_in_dir "${NETBSDSRCDIR}/etc/mtree" obj |
|
|
statusmsg2 "MACHINE_ARCH:" "${MACHINE_ARCH}" |
statusmsg2 "MACHINE_ARCH:" "${MACHINE_ARCH}" |
statusmsg2 "Build platform:" "${uname_s} ${uname_r} ${uname_m}" |
statusmsg2 "Build platform:" "${uname_s} ${uname_r} ${uname_m}" |
statusmsg2 "HOST_SH:" "${HOST_SH}" |
statusmsg2 "HOST_SH:" "${HOST_SH}" |
|
if [ -n "${BUILDID}" ]; then |
|
statusmsg2 "BUILDID:" "${BUILDID}" |
|
fi |
|
if [ -n "${BUILDINFO}" ]; then |
|
printf "%b\n" "${BUILDINFO}" | \ |
|
while read -r line ; do |
|
[ -s "${line}" ] && continue |
|
statusmsg2 "BUILDINFO:" "${line}" |
|
done |
|
fi |
|
|
rebuildmake |
rebuildmake |
validatemakeparams |
validatemakeparams |
|
|
arg=${op#*=} |
arg=${op#*=} |
buildkernel "${arg}" |
buildkernel "${arg}" |
;; |
;; |
|
kernel.gdb=*) |
|
arg=${op#*=} |
|
ksymopts="-D DEBUG=-g" |
|
buildkernel "${arg}" |
|
;; |
releasekernel=*) |
releasekernel=*) |
arg=${op#*=} |
arg=${op#*=} |
releasekernel "${arg}" |
releasekernel "${arg}" |