Wed Mar 18 05:39:06 2009 UTC ()
Pull up following revision(s) (requested by apb in ticket #578):
	build.sh: revision 1.205
	share/mk/bsd.own.mk: revision 1.559
Add "-", "_", and "A-Z" to the set of allowed characters in the
result from `uname -p`.  We already have a platform with an underline
("x86_64"), and the other chars seem harmless.


(snj)
diff -r1.198.2.2 -r1.198.2.3 src/build.sh
diff -r1.542.2.8 -r1.542.2.9 src/share/mk/bsd.own.mk

cvs diff -r1.198.2.2 -r1.198.2.3 src/build.sh (expand / switch to unified diff)

--- src/build.sh 2009/03/18 05:37:59 1.198.2.2
+++ src/build.sh 2009/03/18 05:39:06 1.198.2.3
@@ -1,15 +1,15 @@ @@ -1,15 +1,15 @@
1#! /usr/bin/env sh 1#! /usr/bin/env sh
2# $NetBSD: build.sh,v 1.198.2.2 2009/03/18 05:37:59 snj Exp $ 2# $NetBSD: build.sh,v 1.198.2.3 2009/03/18 05:39:06 snj Exp $
3# 3#
4# Copyright (c) 2001-2008 The NetBSD Foundation, Inc. 4# Copyright (c) 2001-2008 The NetBSD Foundation, Inc.
5# All rights reserved. 5# All rights reserved.
6# 6#
7# This code is derived from software contributed to The NetBSD Foundation 7# This code is derived from software contributed to The NetBSD Foundation
8# by Todd Vierling and Luke Mewburn. 8# by Todd Vierling and Luke Mewburn.
9# 9#
10# Redistribution and use in source and binary forms, with or without 10# Redistribution and use in source and binary forms, with or without
11# modification, are permitted provided that the following conditions 11# modification, are permitted provided that the following conditions
12# are met: 12# are met:
13# 1. Redistributions of source code must retain the above copyright 13# 1. Redistributions of source code must retain the above copyright
14# notice, this list of conditions and the following disclaimer. 14# notice, this list of conditions and the following disclaimer.
15# 2. Redistributions in binary form must reproduce the above copyright 15# 2. Redistributions in binary form must reproduce the above copyright
@@ -168,27 +168,27 @@ initdefaults() @@ -168,27 +168,27 @@ initdefaults()
168 # variables in share/mk/bsd.sys.mk. 168 # variables in share/mk/bsd.sys.mk.
169 # 169 #
170 # Note that "uname -p" is not part of POSIX, but we want uname_p 170 # Note that "uname -p" is not part of POSIX, but we want uname_p
171 # to be set to the host MACHINE_ARCH, if possible. On systems 171 # to be set to the host MACHINE_ARCH, if possible. On systems
172 # where "uname -p" fails, prints "unknown", or prints a string 172 # where "uname -p" fails, prints "unknown", or prints a string
173 # that does not look like an identifier, fall back to using the 173 # that does not look like an identifier, fall back to using the
174 # output from "uname -m" instead. 174 # output from "uname -m" instead.
175 # 175 #
176 uname_s=$(uname -s 2>/dev/null) 176 uname_s=$(uname -s 2>/dev/null)
177 uname_r=$(uname -r 2>/dev/null) 177 uname_r=$(uname -r 2>/dev/null)
178 uname_m=$(uname -m 2>/dev/null) 178 uname_m=$(uname -m 2>/dev/null)
179 uname_p=$(uname -p 2>/dev/null || echo "unknown") 179 uname_p=$(uname -p 2>/dev/null || echo "unknown")
180 case "${uname_p}" in 180 case "${uname_p}" in
181 ''|unknown|*[^a-z0-9]*) uname_p="${uname_m}" ;; 181 ''|unknown|*[^-_A-Za-z0-9]*) uname_p="${uname_m}" ;;
182 esac 182 esac
183 183
184 # If $PWD is a valid name of the current directory, POSIX mandates 184 # If $PWD is a valid name of the current directory, POSIX mandates
185 # that pwd return it by default which causes problems in the 185 # that pwd return it by default which causes problems in the
186 # presence of symlinks. Unsetting PWD is simpler than changing 186 # presence of symlinks. Unsetting PWD is simpler than changing
187 # every occurrence of pwd to use -P. 187 # every occurrence of pwd to use -P.
188 # 188 #
189 # XXX Except that doesn't work on Solaris. Or many Linuces. 189 # XXX Except that doesn't work on Solaris. Or many Linuces.
190 # 190 #
191 unset PWD 191 unset PWD
192 TOP=$(/bin/pwd -P 2>/dev/null || /bin/pwd 2>/dev/null) 192 TOP=$(/bin/pwd -P 2>/dev/null || /bin/pwd 2>/dev/null)
193 193
194 # The user can set HOST_SH in the environment, or we try to 194 # The user can set HOST_SH in the environment, or we try to
@@ -1199,27 +1199,27 @@ createmakewrapper() @@ -1199,27 +1199,27 @@ createmakewrapper()
1199 else 1199 else
1200 makewrapout=">>\${makewrapper}" 1200 makewrapout=">>\${makewrapper}"
1201 fi 1201 fi
1202 1202
1203 case "${KSH_VERSION:-${SH_VERSION}}" in 1203 case "${KSH_VERSION:-${SH_VERSION}}" in
1204 *PD\ KSH*|*MIRBSD\ KSH*) 1204 *PD\ KSH*|*MIRBSD\ KSH*)
1205 set +o braceexpand 1205 set +o braceexpand
1206 ;; 1206 ;;
1207 esac 1207 esac
1208 1208
1209 eval cat <<EOF ${makewrapout} 1209 eval cat <<EOF ${makewrapout}
1210#! ${HOST_SH} 1210#! ${HOST_SH}
1211# Set proper variables to allow easy "make" building of a NetBSD subtree. 1211# Set proper variables to allow easy "make" building of a NetBSD subtree.
1212# Generated from: \$NetBSD: build.sh,v 1.198.2.2 2009/03/18 05:37:59 snj Exp $ 1212# Generated from: \$NetBSD: build.sh,v 1.198.2.3 2009/03/18 05:39:06 snj Exp $
1213# with these arguments: ${_args} 1213# with these arguments: ${_args}
1214# 1214#
1215 1215
1216EOF 1216EOF
1217 { 1217 {
1218 for f in ${makeenv}; do 1218 for f in ${makeenv}; do
1219 if eval "[ -z \"\${$f}\" -a \"\${${f}-X}\" = \"X\" ]"; then 1219 if eval "[ -z \"\${$f}\" -a \"\${${f}-X}\" = \"X\" ]"; then
1220 eval echo "unset ${f}" 1220 eval echo "unset ${f}"
1221 else 1221 else
1222 eval echo "${f}=\'\$$(echo ${f})\'\;\ export\ ${f}" 1222 eval echo "${f}=\'\$$(echo ${f})\'\;\ export\ ${f}"
1223 fi 1223 fi
1224 done 1224 done
1225 1225

cvs diff -r1.542.2.8 -r1.542.2.9 src/share/mk/bsd.own.mk (expand / switch to unified diff)

--- src/share/mk/bsd.own.mk 2009/03/18 05:37:59 1.542.2.8
+++ src/share/mk/bsd.own.mk 2009/03/18 05:39:06 1.542.2.9
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: bsd.own.mk,v 1.542.2.8 2009/03/18 05:37:59 snj Exp $ 1# $NetBSD: bsd.own.mk,v 1.542.2.9 2009/03/18 05:39:06 snj Exp $
2 2
3.if !defined(_BSD_OWN_MK_) 3.if !defined(_BSD_OWN_MK_)
4_BSD_OWN_MK_=1 4_BSD_OWN_MK_=1
5 5
6MAKECONF?= /etc/mk.conf 6MAKECONF?= /etc/mk.conf
7.-include "${MAKECONF}" 7.-include "${MAKECONF}"
8 8
9# 9#
10# CPU model, derived from MACHINE_ARCH 10# CPU model, derived from MACHINE_ARCH
11# 11#
12MACHINE_CPU= ${MACHINE_ARCH:C/mipse[bl]/mips/:C/mips64e[bl]/mips/:C/sh3e[bl]/sh3/:S/m68000/m68k/:S/armeb/arm/} 12MACHINE_CPU= ${MACHINE_ARCH:C/mipse[bl]/mips/:C/mips64e[bl]/mips/:C/sh3e[bl]/sh3/:S/m68000/m68k/:S/armeb/arm/}
13 13
14# 14#
@@ -118,27 +118,27 @@ USETOOLS?= no @@ -118,27 +118,27 @@ USETOOLS?= no
118 @echo "USETOOLS=no, but this component requires a version-specific host toolchain" 118 @echo "USETOOLS=no, but this component requires a version-specific host toolchain"
119 @false 119 @false
120.endif 120.endif
121 121
122# 122#
123# Host platform information; may be overridden 123# Host platform information; may be overridden
124# 124#
125.if !defined(HOST_OSTYPE) 125.if !defined(HOST_OSTYPE)
126_HOST_OSNAME!= uname -s 126_HOST_OSNAME!= uname -s
127_HOST_OSREL!= uname -r 127_HOST_OSREL!= uname -r
128# For _HOST_ARCH, if uname -p fails, or prints "unknown", or prints 128# For _HOST_ARCH, if uname -p fails, or prints "unknown", or prints
129# something that does not look like an identifier, then use uname -m. 129# something that does not look like an identifier, then use uname -m.
130_HOST_ARCH!= uname -p 2>/dev/null 130_HOST_ARCH!= uname -p 2>/dev/null
131_HOST_ARCH:= ${HOST_ARCH:tW:C/.*[^a-z0-9].*//:S/unknown//} 131_HOST_ARCH:= ${HOST_ARCH:tW:C/.*[^-_A-Za-z0-9].*//:S/unknown//}
132.if empty(_HOST_ARCH) 132.if empty(_HOST_ARCH)
133_HOST_ARCH!= uname -m 133_HOST_ARCH!= uname -m
134.endif 134.endif
135HOST_OSTYPE:= ${_HOST_OSNAME}-${_HOST_OSREL:C/\([^\)]*\)//g:[*]:C/ /_/g}-${_HOST_ARCH:C/\([^\)]*\)//g:[*]:C/ /_/g} 135HOST_OSTYPE:= ${_HOST_OSNAME}-${_HOST_OSREL:C/\([^\)]*\)//g:[*]:C/ /_/g}-${_HOST_ARCH:C/\([^\)]*\)//g:[*]:C/ /_/g}
136.MAKEOVERRIDES+= HOST_OSTYPE 136.MAKEOVERRIDES+= HOST_OSTYPE
137.endif # !defined(HOST_OSTYPE) 137.endif # !defined(HOST_OSTYPE)
138 138
139.if ${USETOOLS} == "yes" # { 139.if ${USETOOLS} == "yes" # {
140 140
141# 141#
142# Provide a default for TOOLDIR. 142# Provide a default for TOOLDIR.
143# 143#
144.if !defined(TOOLDIR) 144.if !defined(TOOLDIR)