xref: /aosp_15_r20/external/libconfig/aux-build/config.guess (revision 2e9d491483b805f09ea864149eadd5680efcc72a)
1*2e9d4914SAndroid Build Coastguard Worker#! /bin/sh
2*2e9d4914SAndroid Build Coastguard Worker# Attempt to guess a canonical system name.
3*2e9d4914SAndroid Build Coastguard Worker#   Copyright 1992-2013 Free Software Foundation, Inc.
4*2e9d4914SAndroid Build Coastguard Worker
5*2e9d4914SAndroid Build Coastguard Workertimestamp='2013-11-29'
6*2e9d4914SAndroid Build Coastguard Worker
7*2e9d4914SAndroid Build Coastguard Worker# This file is free software; you can redistribute it and/or modify it
8*2e9d4914SAndroid Build Coastguard Worker# under the terms of the GNU General Public License as published by
9*2e9d4914SAndroid Build Coastguard Worker# the Free Software Foundation; either version 3 of the License, or
10*2e9d4914SAndroid Build Coastguard Worker# (at your option) any later version.
11*2e9d4914SAndroid Build Coastguard Worker#
12*2e9d4914SAndroid Build Coastguard Worker# This program is distributed in the hope that it will be useful, but
13*2e9d4914SAndroid Build Coastguard Worker# WITHOUT ANY WARRANTY; without even the implied warranty of
14*2e9d4914SAndroid Build Coastguard Worker# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15*2e9d4914SAndroid Build Coastguard Worker# General Public License for more details.
16*2e9d4914SAndroid Build Coastguard Worker#
17*2e9d4914SAndroid Build Coastguard Worker# You should have received a copy of the GNU General Public License
18*2e9d4914SAndroid Build Coastguard Worker# along with this program; if not, see <http://www.gnu.org/licenses/>.
19*2e9d4914SAndroid Build Coastguard Worker#
20*2e9d4914SAndroid Build Coastguard Worker# As a special exception to the GNU General Public License, if you
21*2e9d4914SAndroid Build Coastguard Worker# distribute this file as part of a program that contains a
22*2e9d4914SAndroid Build Coastguard Worker# configuration script generated by Autoconf, you may include it under
23*2e9d4914SAndroid Build Coastguard Worker# the same distribution terms that you use for the rest of that
24*2e9d4914SAndroid Build Coastguard Worker# program.  This Exception is an additional permission under section 7
25*2e9d4914SAndroid Build Coastguard Worker# of the GNU General Public License, version 3 ("GPLv3").
26*2e9d4914SAndroid Build Coastguard Worker#
27*2e9d4914SAndroid Build Coastguard Worker# Originally written by Per Bothner.
28*2e9d4914SAndroid Build Coastguard Worker#
29*2e9d4914SAndroid Build Coastguard Worker# You can get the latest version of this script from:
30*2e9d4914SAndroid Build Coastguard Worker# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
31*2e9d4914SAndroid Build Coastguard Worker#
32*2e9d4914SAndroid Build Coastguard Worker# Please send patches with a ChangeLog entry to [email protected].
33*2e9d4914SAndroid Build Coastguard Worker
34*2e9d4914SAndroid Build Coastguard Worker
35*2e9d4914SAndroid Build Coastguard Workerme=`echo "$0" | sed -e 's,.*/,,'`
36*2e9d4914SAndroid Build Coastguard Worker
37*2e9d4914SAndroid Build Coastguard Workerusage="\
38*2e9d4914SAndroid Build Coastguard WorkerUsage: $0 [OPTION]
39*2e9d4914SAndroid Build Coastguard Worker
40*2e9d4914SAndroid Build Coastguard WorkerOutput the configuration name of the system \`$me' is run on.
41*2e9d4914SAndroid Build Coastguard Worker
42*2e9d4914SAndroid Build Coastguard WorkerOperation modes:
43*2e9d4914SAndroid Build Coastguard Worker  -h, --help         print this help, then exit
44*2e9d4914SAndroid Build Coastguard Worker  -t, --time-stamp   print date of last modification, then exit
45*2e9d4914SAndroid Build Coastguard Worker  -v, --version      print version number, then exit
46*2e9d4914SAndroid Build Coastguard Worker
47*2e9d4914SAndroid Build Coastguard WorkerReport bugs and patches to <[email protected]>."
48*2e9d4914SAndroid Build Coastguard Worker
49*2e9d4914SAndroid Build Coastguard Workerversion="\
50*2e9d4914SAndroid Build Coastguard WorkerGNU config.guess ($timestamp)
51*2e9d4914SAndroid Build Coastguard Worker
52*2e9d4914SAndroid Build Coastguard WorkerOriginally written by Per Bothner.
53*2e9d4914SAndroid Build Coastguard WorkerCopyright 1992-2013 Free Software Foundation, Inc.
54*2e9d4914SAndroid Build Coastguard Worker
55*2e9d4914SAndroid Build Coastguard WorkerThis is free software; see the source for copying conditions.  There is NO
56*2e9d4914SAndroid Build Coastguard Workerwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
57*2e9d4914SAndroid Build Coastguard Worker
58*2e9d4914SAndroid Build Coastguard Workerhelp="
59*2e9d4914SAndroid Build Coastguard WorkerTry \`$me --help' for more information."
60*2e9d4914SAndroid Build Coastguard Worker
61*2e9d4914SAndroid Build Coastguard Worker# Parse command line
62*2e9d4914SAndroid Build Coastguard Workerwhile test $# -gt 0 ; do
63*2e9d4914SAndroid Build Coastguard Worker  case $1 in
64*2e9d4914SAndroid Build Coastguard Worker    --time-stamp | --time* | -t )
65*2e9d4914SAndroid Build Coastguard Worker       echo "$timestamp" ; exit ;;
66*2e9d4914SAndroid Build Coastguard Worker    --version | -v )
67*2e9d4914SAndroid Build Coastguard Worker       echo "$version" ; exit ;;
68*2e9d4914SAndroid Build Coastguard Worker    --help | --h* | -h )
69*2e9d4914SAndroid Build Coastguard Worker       echo "$usage"; exit ;;
70*2e9d4914SAndroid Build Coastguard Worker    -- )     # Stop option processing
71*2e9d4914SAndroid Build Coastguard Worker       shift; break ;;
72*2e9d4914SAndroid Build Coastguard Worker    - )	# Use stdin as input.
73*2e9d4914SAndroid Build Coastguard Worker       break ;;
74*2e9d4914SAndroid Build Coastguard Worker    -* )
75*2e9d4914SAndroid Build Coastguard Worker       echo "$me: invalid option $1$help" >&2
76*2e9d4914SAndroid Build Coastguard Worker       exit 1 ;;
77*2e9d4914SAndroid Build Coastguard Worker    * )
78*2e9d4914SAndroid Build Coastguard Worker       break ;;
79*2e9d4914SAndroid Build Coastguard Worker  esac
80*2e9d4914SAndroid Build Coastguard Workerdone
81*2e9d4914SAndroid Build Coastguard Worker
82*2e9d4914SAndroid Build Coastguard Workerif test $# != 0; then
83*2e9d4914SAndroid Build Coastguard Worker  echo "$me: too many arguments$help" >&2
84*2e9d4914SAndroid Build Coastguard Worker  exit 1
85*2e9d4914SAndroid Build Coastguard Workerfi
86*2e9d4914SAndroid Build Coastguard Worker
87*2e9d4914SAndroid Build Coastguard Workertrap 'exit 1' 1 2 15
88*2e9d4914SAndroid Build Coastguard Worker
89*2e9d4914SAndroid Build Coastguard Worker# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
90*2e9d4914SAndroid Build Coastguard Worker# compiler to aid in system detection is discouraged as it requires
91*2e9d4914SAndroid Build Coastguard Worker# temporary files to be created and, as you can see below, it is a
92*2e9d4914SAndroid Build Coastguard Worker# headache to deal with in a portable fashion.
93*2e9d4914SAndroid Build Coastguard Worker
94*2e9d4914SAndroid Build Coastguard Worker# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
95*2e9d4914SAndroid Build Coastguard Worker# use `HOST_CC' if defined, but it is deprecated.
96*2e9d4914SAndroid Build Coastguard Worker
97*2e9d4914SAndroid Build Coastguard Worker# Portable tmp directory creation inspired by the Autoconf team.
98*2e9d4914SAndroid Build Coastguard Worker
99*2e9d4914SAndroid Build Coastguard Workerset_cc_for_build='
100*2e9d4914SAndroid Build Coastguard Workertrap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
101*2e9d4914SAndroid Build Coastguard Workertrap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
102*2e9d4914SAndroid Build Coastguard Worker: ${TMPDIR=/tmp} ;
103*2e9d4914SAndroid Build Coastguard Worker { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
104*2e9d4914SAndroid Build Coastguard Worker { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
105*2e9d4914SAndroid Build Coastguard Worker { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
106*2e9d4914SAndroid Build Coastguard Worker { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
107*2e9d4914SAndroid Build Coastguard Workerdummy=$tmp/dummy ;
108*2e9d4914SAndroid Build Coastguard Workertmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
109*2e9d4914SAndroid Build Coastguard Workercase $CC_FOR_BUILD,$HOST_CC,$CC in
110*2e9d4914SAndroid Build Coastguard Worker ,,)    echo "int x;" > $dummy.c ;
111*2e9d4914SAndroid Build Coastguard Worker	for c in cc gcc c89 c99 ; do
112*2e9d4914SAndroid Build Coastguard Worker	  if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
113*2e9d4914SAndroid Build Coastguard Worker	     CC_FOR_BUILD="$c"; break ;
114*2e9d4914SAndroid Build Coastguard Worker	  fi ;
115*2e9d4914SAndroid Build Coastguard Worker	done ;
116*2e9d4914SAndroid Build Coastguard Worker	if test x"$CC_FOR_BUILD" = x ; then
117*2e9d4914SAndroid Build Coastguard Worker	  CC_FOR_BUILD=no_compiler_found ;
118*2e9d4914SAndroid Build Coastguard Worker	fi
119*2e9d4914SAndroid Build Coastguard Worker	;;
120*2e9d4914SAndroid Build Coastguard Worker ,,*)   CC_FOR_BUILD=$CC ;;
121*2e9d4914SAndroid Build Coastguard Worker ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
122*2e9d4914SAndroid Build Coastguard Workeresac ; set_cc_for_build= ;'
123*2e9d4914SAndroid Build Coastguard Worker
124*2e9d4914SAndroid Build Coastguard Worker# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
125*2e9d4914SAndroid Build Coastguard Worker# ([email protected] 1994-08-24)
126*2e9d4914SAndroid Build Coastguard Workerif (test -f /.attbin/uname) >/dev/null 2>&1 ; then
127*2e9d4914SAndroid Build Coastguard Worker	PATH=$PATH:/.attbin ; export PATH
128*2e9d4914SAndroid Build Coastguard Workerfi
129*2e9d4914SAndroid Build Coastguard Worker
130*2e9d4914SAndroid Build Coastguard WorkerUNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
131*2e9d4914SAndroid Build Coastguard WorkerUNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
132*2e9d4914SAndroid Build Coastguard WorkerUNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
133*2e9d4914SAndroid Build Coastguard WorkerUNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
134*2e9d4914SAndroid Build Coastguard Worker
135*2e9d4914SAndroid Build Coastguard Workercase "${UNAME_SYSTEM}" in
136*2e9d4914SAndroid Build Coastguard WorkerLinux|GNU|GNU/*)
137*2e9d4914SAndroid Build Coastguard Worker	# If the system lacks a compiler, then just pick glibc.
138*2e9d4914SAndroid Build Coastguard Worker	# We could probably try harder.
139*2e9d4914SAndroid Build Coastguard Worker	LIBC=gnu
140*2e9d4914SAndroid Build Coastguard Worker
141*2e9d4914SAndroid Build Coastguard Worker	eval $set_cc_for_build
142*2e9d4914SAndroid Build Coastguard Worker	cat <<-EOF > $dummy.c
143*2e9d4914SAndroid Build Coastguard Worker	#include <features.h>
144*2e9d4914SAndroid Build Coastguard Worker	#if defined(__UCLIBC__)
145*2e9d4914SAndroid Build Coastguard Worker	LIBC=uclibc
146*2e9d4914SAndroid Build Coastguard Worker	#elif defined(__dietlibc__)
147*2e9d4914SAndroid Build Coastguard Worker	LIBC=dietlibc
148*2e9d4914SAndroid Build Coastguard Worker	#else
149*2e9d4914SAndroid Build Coastguard Worker	LIBC=gnu
150*2e9d4914SAndroid Build Coastguard Worker	#endif
151*2e9d4914SAndroid Build Coastguard Worker	EOF
152*2e9d4914SAndroid Build Coastguard Worker	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
153*2e9d4914SAndroid Build Coastguard Worker	;;
154*2e9d4914SAndroid Build Coastguard Workeresac
155*2e9d4914SAndroid Build Coastguard Worker
156*2e9d4914SAndroid Build Coastguard Worker# Note: order is significant - the case branches are not exclusive.
157*2e9d4914SAndroid Build Coastguard Worker
158*2e9d4914SAndroid Build Coastguard Workercase "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
159*2e9d4914SAndroid Build Coastguard Worker    *:NetBSD:*:*)
160*2e9d4914SAndroid Build Coastguard Worker	# NetBSD (nbsd) targets should (where applicable) match one or
161*2e9d4914SAndroid Build Coastguard Worker	# more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
162*2e9d4914SAndroid Build Coastguard Worker	# *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
163*2e9d4914SAndroid Build Coastguard Worker	# switched to ELF, *-*-netbsd* would select the old
164*2e9d4914SAndroid Build Coastguard Worker	# object file format.  This provides both forward
165*2e9d4914SAndroid Build Coastguard Worker	# compatibility and a consistent mechanism for selecting the
166*2e9d4914SAndroid Build Coastguard Worker	# object file format.
167*2e9d4914SAndroid Build Coastguard Worker	#
168*2e9d4914SAndroid Build Coastguard Worker	# Note: NetBSD doesn't particularly care about the vendor
169*2e9d4914SAndroid Build Coastguard Worker	# portion of the name.  We always set it to "unknown".
170*2e9d4914SAndroid Build Coastguard Worker	sysctl="sysctl -n hw.machine_arch"
171*2e9d4914SAndroid Build Coastguard Worker	UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
172*2e9d4914SAndroid Build Coastguard Worker	    /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
173*2e9d4914SAndroid Build Coastguard Worker	case "${UNAME_MACHINE_ARCH}" in
174*2e9d4914SAndroid Build Coastguard Worker	    armeb) machine=armeb-unknown ;;
175*2e9d4914SAndroid Build Coastguard Worker	    arm*) machine=arm-unknown ;;
176*2e9d4914SAndroid Build Coastguard Worker	    sh3el) machine=shl-unknown ;;
177*2e9d4914SAndroid Build Coastguard Worker	    sh3eb) machine=sh-unknown ;;
178*2e9d4914SAndroid Build Coastguard Worker	    sh5el) machine=sh5le-unknown ;;
179*2e9d4914SAndroid Build Coastguard Worker	    *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
180*2e9d4914SAndroid Build Coastguard Worker	esac
181*2e9d4914SAndroid Build Coastguard Worker	# The Operating System including object format, if it has switched
182*2e9d4914SAndroid Build Coastguard Worker	# to ELF recently, or will in the future.
183*2e9d4914SAndroid Build Coastguard Worker	case "${UNAME_MACHINE_ARCH}" in
184*2e9d4914SAndroid Build Coastguard Worker	    arm*|i386|m68k|ns32k|sh3*|sparc|vax)
185*2e9d4914SAndroid Build Coastguard Worker		eval $set_cc_for_build
186*2e9d4914SAndroid Build Coastguard Worker		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
187*2e9d4914SAndroid Build Coastguard Worker			| grep -q __ELF__
188*2e9d4914SAndroid Build Coastguard Worker		then
189*2e9d4914SAndroid Build Coastguard Worker		    # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
190*2e9d4914SAndroid Build Coastguard Worker		    # Return netbsd for either.  FIX?
191*2e9d4914SAndroid Build Coastguard Worker		    os=netbsd
192*2e9d4914SAndroid Build Coastguard Worker		else
193*2e9d4914SAndroid Build Coastguard Worker		    os=netbsdelf
194*2e9d4914SAndroid Build Coastguard Worker		fi
195*2e9d4914SAndroid Build Coastguard Worker		;;
196*2e9d4914SAndroid Build Coastguard Worker	    *)
197*2e9d4914SAndroid Build Coastguard Worker		os=netbsd
198*2e9d4914SAndroid Build Coastguard Worker		;;
199*2e9d4914SAndroid Build Coastguard Worker	esac
200*2e9d4914SAndroid Build Coastguard Worker	# The OS release
201*2e9d4914SAndroid Build Coastguard Worker	# Debian GNU/NetBSD machines have a different userland, and
202*2e9d4914SAndroid Build Coastguard Worker	# thus, need a distinct triplet. However, they do not need
203*2e9d4914SAndroid Build Coastguard Worker	# kernel version information, so it can be replaced with a
204*2e9d4914SAndroid Build Coastguard Worker	# suitable tag, in the style of linux-gnu.
205*2e9d4914SAndroid Build Coastguard Worker	case "${UNAME_VERSION}" in
206*2e9d4914SAndroid Build Coastguard Worker	    Debian*)
207*2e9d4914SAndroid Build Coastguard Worker		release='-gnu'
208*2e9d4914SAndroid Build Coastguard Worker		;;
209*2e9d4914SAndroid Build Coastguard Worker	    *)
210*2e9d4914SAndroid Build Coastguard Worker		release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
211*2e9d4914SAndroid Build Coastguard Worker		;;
212*2e9d4914SAndroid Build Coastguard Worker	esac
213*2e9d4914SAndroid Build Coastguard Worker	# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
214*2e9d4914SAndroid Build Coastguard Worker	# contains redundant information, the shorter form:
215*2e9d4914SAndroid Build Coastguard Worker	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
216*2e9d4914SAndroid Build Coastguard Worker	echo "${machine}-${os}${release}"
217*2e9d4914SAndroid Build Coastguard Worker	exit ;;
218*2e9d4914SAndroid Build Coastguard Worker    *:Bitrig:*:*)
219*2e9d4914SAndroid Build Coastguard Worker	UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
220*2e9d4914SAndroid Build Coastguard Worker	echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE}
221*2e9d4914SAndroid Build Coastguard Worker	exit ;;
222*2e9d4914SAndroid Build Coastguard Worker    *:OpenBSD:*:*)
223*2e9d4914SAndroid Build Coastguard Worker	UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
224*2e9d4914SAndroid Build Coastguard Worker	echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
225*2e9d4914SAndroid Build Coastguard Worker	exit ;;
226*2e9d4914SAndroid Build Coastguard Worker    *:ekkoBSD:*:*)
227*2e9d4914SAndroid Build Coastguard Worker	echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
228*2e9d4914SAndroid Build Coastguard Worker	exit ;;
229*2e9d4914SAndroid Build Coastguard Worker    *:SolidBSD:*:*)
230*2e9d4914SAndroid Build Coastguard Worker	echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
231*2e9d4914SAndroid Build Coastguard Worker	exit ;;
232*2e9d4914SAndroid Build Coastguard Worker    macppc:MirBSD:*:*)
233*2e9d4914SAndroid Build Coastguard Worker	echo powerpc-unknown-mirbsd${UNAME_RELEASE}
234*2e9d4914SAndroid Build Coastguard Worker	exit ;;
235*2e9d4914SAndroid Build Coastguard Worker    *:MirBSD:*:*)
236*2e9d4914SAndroid Build Coastguard Worker	echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
237*2e9d4914SAndroid Build Coastguard Worker	exit ;;
238*2e9d4914SAndroid Build Coastguard Worker    alpha:OSF1:*:*)
239*2e9d4914SAndroid Build Coastguard Worker	case $UNAME_RELEASE in
240*2e9d4914SAndroid Build Coastguard Worker	*4.0)
241*2e9d4914SAndroid Build Coastguard Worker		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
242*2e9d4914SAndroid Build Coastguard Worker		;;
243*2e9d4914SAndroid Build Coastguard Worker	*5.*)
244*2e9d4914SAndroid Build Coastguard Worker		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
245*2e9d4914SAndroid Build Coastguard Worker		;;
246*2e9d4914SAndroid Build Coastguard Worker	esac
247*2e9d4914SAndroid Build Coastguard Worker	# According to Compaq, /usr/sbin/psrinfo has been available on
248*2e9d4914SAndroid Build Coastguard Worker	# OSF/1 and Tru64 systems produced since 1995.  I hope that
249*2e9d4914SAndroid Build Coastguard Worker	# covers most systems running today.  This code pipes the CPU
250*2e9d4914SAndroid Build Coastguard Worker	# types through head -n 1, so we only detect the type of CPU 0.
251*2e9d4914SAndroid Build Coastguard Worker	ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\) processor.*$/\1/p' | head -n 1`
252*2e9d4914SAndroid Build Coastguard Worker	case "$ALPHA_CPU_TYPE" in
253*2e9d4914SAndroid Build Coastguard Worker	    "EV4 (21064)")
254*2e9d4914SAndroid Build Coastguard Worker		UNAME_MACHINE="alpha" ;;
255*2e9d4914SAndroid Build Coastguard Worker	    "EV4.5 (21064)")
256*2e9d4914SAndroid Build Coastguard Worker		UNAME_MACHINE="alpha" ;;
257*2e9d4914SAndroid Build Coastguard Worker	    "LCA4 (21066/21068)")
258*2e9d4914SAndroid Build Coastguard Worker		UNAME_MACHINE="alpha" ;;
259*2e9d4914SAndroid Build Coastguard Worker	    "EV5 (21164)")
260*2e9d4914SAndroid Build Coastguard Worker		UNAME_MACHINE="alphaev5" ;;
261*2e9d4914SAndroid Build Coastguard Worker	    "EV5.6 (21164A)")
262*2e9d4914SAndroid Build Coastguard Worker		UNAME_MACHINE="alphaev56" ;;
263*2e9d4914SAndroid Build Coastguard Worker	    "EV5.6 (21164PC)")
264*2e9d4914SAndroid Build Coastguard Worker		UNAME_MACHINE="alphapca56" ;;
265*2e9d4914SAndroid Build Coastguard Worker	    "EV5.7 (21164PC)")
266*2e9d4914SAndroid Build Coastguard Worker		UNAME_MACHINE="alphapca57" ;;
267*2e9d4914SAndroid Build Coastguard Worker	    "EV6 (21264)")
268*2e9d4914SAndroid Build Coastguard Worker		UNAME_MACHINE="alphaev6" ;;
269*2e9d4914SAndroid Build Coastguard Worker	    "EV6.7 (21264A)")
270*2e9d4914SAndroid Build Coastguard Worker		UNAME_MACHINE="alphaev67" ;;
271*2e9d4914SAndroid Build Coastguard Worker	    "EV6.8CB (21264C)")
272*2e9d4914SAndroid Build Coastguard Worker		UNAME_MACHINE="alphaev68" ;;
273*2e9d4914SAndroid Build Coastguard Worker	    "EV6.8AL (21264B)")
274*2e9d4914SAndroid Build Coastguard Worker		UNAME_MACHINE="alphaev68" ;;
275*2e9d4914SAndroid Build Coastguard Worker	    "EV6.8CX (21264D)")
276*2e9d4914SAndroid Build Coastguard Worker		UNAME_MACHINE="alphaev68" ;;
277*2e9d4914SAndroid Build Coastguard Worker	    "EV6.9A (21264/EV69A)")
278*2e9d4914SAndroid Build Coastguard Worker		UNAME_MACHINE="alphaev69" ;;
279*2e9d4914SAndroid Build Coastguard Worker	    "EV7 (21364)")
280*2e9d4914SAndroid Build Coastguard Worker		UNAME_MACHINE="alphaev7" ;;
281*2e9d4914SAndroid Build Coastguard Worker	    "EV7.9 (21364A)")
282*2e9d4914SAndroid Build Coastguard Worker		UNAME_MACHINE="alphaev79" ;;
283*2e9d4914SAndroid Build Coastguard Worker	esac
284*2e9d4914SAndroid Build Coastguard Worker	# A Pn.n version is a patched version.
285*2e9d4914SAndroid Build Coastguard Worker	# A Vn.n version is a released version.
286*2e9d4914SAndroid Build Coastguard Worker	# A Tn.n version is a released field test version.
287*2e9d4914SAndroid Build Coastguard Worker	# A Xn.n version is an unreleased experimental baselevel.
288*2e9d4914SAndroid Build Coastguard Worker	# 1.2 uses "1.2" for uname -r.
289*2e9d4914SAndroid Build Coastguard Worker	echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
290*2e9d4914SAndroid Build Coastguard Worker	# Reset EXIT trap before exiting to avoid spurious non-zero exit code.
291*2e9d4914SAndroid Build Coastguard Worker	exitcode=$?
292*2e9d4914SAndroid Build Coastguard Worker	trap '' 0
293*2e9d4914SAndroid Build Coastguard Worker	exit $exitcode ;;
294*2e9d4914SAndroid Build Coastguard Worker    Alpha\ *:Windows_NT*:*)
295*2e9d4914SAndroid Build Coastguard Worker	# How do we know it's Interix rather than the generic POSIX subsystem?
296*2e9d4914SAndroid Build Coastguard Worker	# Should we change UNAME_MACHINE based on the output of uname instead
297*2e9d4914SAndroid Build Coastguard Worker	# of the specific Alpha model?
298*2e9d4914SAndroid Build Coastguard Worker	echo alpha-pc-interix
299*2e9d4914SAndroid Build Coastguard Worker	exit ;;
300*2e9d4914SAndroid Build Coastguard Worker    21064:Windows_NT:50:3)
301*2e9d4914SAndroid Build Coastguard Worker	echo alpha-dec-winnt3.5
302*2e9d4914SAndroid Build Coastguard Worker	exit ;;
303*2e9d4914SAndroid Build Coastguard Worker    Amiga*:UNIX_System_V:4.0:*)
304*2e9d4914SAndroid Build Coastguard Worker	echo m68k-unknown-sysv4
305*2e9d4914SAndroid Build Coastguard Worker	exit ;;
306*2e9d4914SAndroid Build Coastguard Worker    *:[Aa]miga[Oo][Ss]:*:*)
307*2e9d4914SAndroid Build Coastguard Worker	echo ${UNAME_MACHINE}-unknown-amigaos
308*2e9d4914SAndroid Build Coastguard Worker	exit ;;
309*2e9d4914SAndroid Build Coastguard Worker    *:[Mm]orph[Oo][Ss]:*:*)
310*2e9d4914SAndroid Build Coastguard Worker	echo ${UNAME_MACHINE}-unknown-morphos
311*2e9d4914SAndroid Build Coastguard Worker	exit ;;
312*2e9d4914SAndroid Build Coastguard Worker    *:OS/390:*:*)
313*2e9d4914SAndroid Build Coastguard Worker	echo i370-ibm-openedition
314*2e9d4914SAndroid Build Coastguard Worker	exit ;;
315*2e9d4914SAndroid Build Coastguard Worker    *:z/VM:*:*)
316*2e9d4914SAndroid Build Coastguard Worker	echo s390-ibm-zvmoe
317*2e9d4914SAndroid Build Coastguard Worker	exit ;;
318*2e9d4914SAndroid Build Coastguard Worker    *:OS400:*:*)
319*2e9d4914SAndroid Build Coastguard Worker	echo powerpc-ibm-os400
320*2e9d4914SAndroid Build Coastguard Worker	exit ;;
321*2e9d4914SAndroid Build Coastguard Worker    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
322*2e9d4914SAndroid Build Coastguard Worker	echo arm-acorn-riscix${UNAME_RELEASE}
323*2e9d4914SAndroid Build Coastguard Worker	exit ;;
324*2e9d4914SAndroid Build Coastguard Worker    arm*:riscos:*:*|arm*:RISCOS:*:*)
325*2e9d4914SAndroid Build Coastguard Worker	echo arm-unknown-riscos
326*2e9d4914SAndroid Build Coastguard Worker	exit ;;
327*2e9d4914SAndroid Build Coastguard Worker    SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
328*2e9d4914SAndroid Build Coastguard Worker	echo hppa1.1-hitachi-hiuxmpp
329*2e9d4914SAndroid Build Coastguard Worker	exit ;;
330*2e9d4914SAndroid Build Coastguard Worker    Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
331*2e9d4914SAndroid Build Coastguard Worker	# [email protected] (Earle F. Ake) contributed MIS and NILE.
332*2e9d4914SAndroid Build Coastguard Worker	if test "`(/bin/universe) 2>/dev/null`" = att ; then
333*2e9d4914SAndroid Build Coastguard Worker		echo pyramid-pyramid-sysv3
334*2e9d4914SAndroid Build Coastguard Worker	else
335*2e9d4914SAndroid Build Coastguard Worker		echo pyramid-pyramid-bsd
336*2e9d4914SAndroid Build Coastguard Worker	fi
337*2e9d4914SAndroid Build Coastguard Worker	exit ;;
338*2e9d4914SAndroid Build Coastguard Worker    NILE*:*:*:dcosx)
339*2e9d4914SAndroid Build Coastguard Worker	echo pyramid-pyramid-svr4
340*2e9d4914SAndroid Build Coastguard Worker	exit ;;
341*2e9d4914SAndroid Build Coastguard Worker    DRS?6000:unix:4.0:6*)
342*2e9d4914SAndroid Build Coastguard Worker	echo sparc-icl-nx6
343*2e9d4914SAndroid Build Coastguard Worker	exit ;;
344*2e9d4914SAndroid Build Coastguard Worker    DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
345*2e9d4914SAndroid Build Coastguard Worker	case `/usr/bin/uname -p` in
346*2e9d4914SAndroid Build Coastguard Worker	    sparc) echo sparc-icl-nx7; exit ;;
347*2e9d4914SAndroid Build Coastguard Worker	esac ;;
348*2e9d4914SAndroid Build Coastguard Worker    s390x:SunOS:*:*)
349*2e9d4914SAndroid Build Coastguard Worker	echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
350*2e9d4914SAndroid Build Coastguard Worker	exit ;;
351*2e9d4914SAndroid Build Coastguard Worker    sun4H:SunOS:5.*:*)
352*2e9d4914SAndroid Build Coastguard Worker	echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
353*2e9d4914SAndroid Build Coastguard Worker	exit ;;
354*2e9d4914SAndroid Build Coastguard Worker    sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
355*2e9d4914SAndroid Build Coastguard Worker	echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
356*2e9d4914SAndroid Build Coastguard Worker	exit ;;
357*2e9d4914SAndroid Build Coastguard Worker    i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
358*2e9d4914SAndroid Build Coastguard Worker	echo i386-pc-auroraux${UNAME_RELEASE}
359*2e9d4914SAndroid Build Coastguard Worker	exit ;;
360*2e9d4914SAndroid Build Coastguard Worker    i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
361*2e9d4914SAndroid Build Coastguard Worker	eval $set_cc_for_build
362*2e9d4914SAndroid Build Coastguard Worker	SUN_ARCH="i386"
363*2e9d4914SAndroid Build Coastguard Worker	# If there is a compiler, see if it is configured for 64-bit objects.
364*2e9d4914SAndroid Build Coastguard Worker	# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
365*2e9d4914SAndroid Build Coastguard Worker	# This test works for both compilers.
366*2e9d4914SAndroid Build Coastguard Worker	if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
367*2e9d4914SAndroid Build Coastguard Worker	    if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
368*2e9d4914SAndroid Build Coastguard Worker		(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
369*2e9d4914SAndroid Build Coastguard Worker		grep IS_64BIT_ARCH >/dev/null
370*2e9d4914SAndroid Build Coastguard Worker	    then
371*2e9d4914SAndroid Build Coastguard Worker		SUN_ARCH="x86_64"
372*2e9d4914SAndroid Build Coastguard Worker	    fi
373*2e9d4914SAndroid Build Coastguard Worker	fi
374*2e9d4914SAndroid Build Coastguard Worker	echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
375*2e9d4914SAndroid Build Coastguard Worker	exit ;;
376*2e9d4914SAndroid Build Coastguard Worker    sun4*:SunOS:6*:*)
377*2e9d4914SAndroid Build Coastguard Worker	# According to config.sub, this is the proper way to canonicalize
378*2e9d4914SAndroid Build Coastguard Worker	# SunOS6.  Hard to guess exactly what SunOS6 will be like, but
379*2e9d4914SAndroid Build Coastguard Worker	# it's likely to be more like Solaris than SunOS4.
380*2e9d4914SAndroid Build Coastguard Worker	echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
381*2e9d4914SAndroid Build Coastguard Worker	exit ;;
382*2e9d4914SAndroid Build Coastguard Worker    sun4*:SunOS:*:*)
383*2e9d4914SAndroid Build Coastguard Worker	case "`/usr/bin/arch -k`" in
384*2e9d4914SAndroid Build Coastguard Worker	    Series*|S4*)
385*2e9d4914SAndroid Build Coastguard Worker		UNAME_RELEASE=`uname -v`
386*2e9d4914SAndroid Build Coastguard Worker		;;
387*2e9d4914SAndroid Build Coastguard Worker	esac
388*2e9d4914SAndroid Build Coastguard Worker	# Japanese Language versions have a version number like `4.1.3-JL'.
389*2e9d4914SAndroid Build Coastguard Worker	echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
390*2e9d4914SAndroid Build Coastguard Worker	exit ;;
391*2e9d4914SAndroid Build Coastguard Worker    sun3*:SunOS:*:*)
392*2e9d4914SAndroid Build Coastguard Worker	echo m68k-sun-sunos${UNAME_RELEASE}
393*2e9d4914SAndroid Build Coastguard Worker	exit ;;
394*2e9d4914SAndroid Build Coastguard Worker    sun*:*:4.2BSD:*)
395*2e9d4914SAndroid Build Coastguard Worker	UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
396*2e9d4914SAndroid Build Coastguard Worker	test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
397*2e9d4914SAndroid Build Coastguard Worker	case "`/bin/arch`" in
398*2e9d4914SAndroid Build Coastguard Worker	    sun3)
399*2e9d4914SAndroid Build Coastguard Worker		echo m68k-sun-sunos${UNAME_RELEASE}
400*2e9d4914SAndroid Build Coastguard Worker		;;
401*2e9d4914SAndroid Build Coastguard Worker	    sun4)
402*2e9d4914SAndroid Build Coastguard Worker		echo sparc-sun-sunos${UNAME_RELEASE}
403*2e9d4914SAndroid Build Coastguard Worker		;;
404*2e9d4914SAndroid Build Coastguard Worker	esac
405*2e9d4914SAndroid Build Coastguard Worker	exit ;;
406*2e9d4914SAndroid Build Coastguard Worker    aushp:SunOS:*:*)
407*2e9d4914SAndroid Build Coastguard Worker	echo sparc-auspex-sunos${UNAME_RELEASE}
408*2e9d4914SAndroid Build Coastguard Worker	exit ;;
409*2e9d4914SAndroid Build Coastguard Worker    # The situation for MiNT is a little confusing.  The machine name
410*2e9d4914SAndroid Build Coastguard Worker    # can be virtually everything (everything which is not
411*2e9d4914SAndroid Build Coastguard Worker    # "atarist" or "atariste" at least should have a processor
412*2e9d4914SAndroid Build Coastguard Worker    # > m68000).  The system name ranges from "MiNT" over "FreeMiNT"
413*2e9d4914SAndroid Build Coastguard Worker    # to the lowercase version "mint" (or "freemint").  Finally
414*2e9d4914SAndroid Build Coastguard Worker    # the system name "TOS" denotes a system which is actually not
415*2e9d4914SAndroid Build Coastguard Worker    # MiNT.  But MiNT is downward compatible to TOS, so this should
416*2e9d4914SAndroid Build Coastguard Worker    # be no problem.
417*2e9d4914SAndroid Build Coastguard Worker    atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
418*2e9d4914SAndroid Build Coastguard Worker	echo m68k-atari-mint${UNAME_RELEASE}
419*2e9d4914SAndroid Build Coastguard Worker	exit ;;
420*2e9d4914SAndroid Build Coastguard Worker    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
421*2e9d4914SAndroid Build Coastguard Worker	echo m68k-atari-mint${UNAME_RELEASE}
422*2e9d4914SAndroid Build Coastguard Worker	exit ;;
423*2e9d4914SAndroid Build Coastguard Worker    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
424*2e9d4914SAndroid Build Coastguard Worker	echo m68k-atari-mint${UNAME_RELEASE}
425*2e9d4914SAndroid Build Coastguard Worker	exit ;;
426*2e9d4914SAndroid Build Coastguard Worker    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
427*2e9d4914SAndroid Build Coastguard Worker	echo m68k-milan-mint${UNAME_RELEASE}
428*2e9d4914SAndroid Build Coastguard Worker	exit ;;
429*2e9d4914SAndroid Build Coastguard Worker    hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
430*2e9d4914SAndroid Build Coastguard Worker	echo m68k-hades-mint${UNAME_RELEASE}
431*2e9d4914SAndroid Build Coastguard Worker	exit ;;
432*2e9d4914SAndroid Build Coastguard Worker    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
433*2e9d4914SAndroid Build Coastguard Worker	echo m68k-unknown-mint${UNAME_RELEASE}
434*2e9d4914SAndroid Build Coastguard Worker	exit ;;
435*2e9d4914SAndroid Build Coastguard Worker    m68k:machten:*:*)
436*2e9d4914SAndroid Build Coastguard Worker	echo m68k-apple-machten${UNAME_RELEASE}
437*2e9d4914SAndroid Build Coastguard Worker	exit ;;
438*2e9d4914SAndroid Build Coastguard Worker    powerpc:machten:*:*)
439*2e9d4914SAndroid Build Coastguard Worker	echo powerpc-apple-machten${UNAME_RELEASE}
440*2e9d4914SAndroid Build Coastguard Worker	exit ;;
441*2e9d4914SAndroid Build Coastguard Worker    RISC*:Mach:*:*)
442*2e9d4914SAndroid Build Coastguard Worker	echo mips-dec-mach_bsd4.3
443*2e9d4914SAndroid Build Coastguard Worker	exit ;;
444*2e9d4914SAndroid Build Coastguard Worker    RISC*:ULTRIX:*:*)
445*2e9d4914SAndroid Build Coastguard Worker	echo mips-dec-ultrix${UNAME_RELEASE}
446*2e9d4914SAndroid Build Coastguard Worker	exit ;;
447*2e9d4914SAndroid Build Coastguard Worker    VAX*:ULTRIX*:*:*)
448*2e9d4914SAndroid Build Coastguard Worker	echo vax-dec-ultrix${UNAME_RELEASE}
449*2e9d4914SAndroid Build Coastguard Worker	exit ;;
450*2e9d4914SAndroid Build Coastguard Worker    2020:CLIX:*:* | 2430:CLIX:*:*)
451*2e9d4914SAndroid Build Coastguard Worker	echo clipper-intergraph-clix${UNAME_RELEASE}
452*2e9d4914SAndroid Build Coastguard Worker	exit ;;
453*2e9d4914SAndroid Build Coastguard Worker    mips:*:*:UMIPS | mips:*:*:RISCos)
454*2e9d4914SAndroid Build Coastguard Worker	eval $set_cc_for_build
455*2e9d4914SAndroid Build Coastguard Worker	sed 's/^	//' << EOF >$dummy.c
456*2e9d4914SAndroid Build Coastguard Worker#ifdef __cplusplus
457*2e9d4914SAndroid Build Coastguard Worker#include <stdio.h>  /* for printf() prototype */
458*2e9d4914SAndroid Build Coastguard Worker	int main (int argc, char *argv[]) {
459*2e9d4914SAndroid Build Coastguard Worker#else
460*2e9d4914SAndroid Build Coastguard Worker	int main (argc, argv) int argc; char *argv[]; {
461*2e9d4914SAndroid Build Coastguard Worker#endif
462*2e9d4914SAndroid Build Coastguard Worker	#if defined (host_mips) && defined (MIPSEB)
463*2e9d4914SAndroid Build Coastguard Worker	#if defined (SYSTYPE_SYSV)
464*2e9d4914SAndroid Build Coastguard Worker	  printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
465*2e9d4914SAndroid Build Coastguard Worker	#endif
466*2e9d4914SAndroid Build Coastguard Worker	#if defined (SYSTYPE_SVR4)
467*2e9d4914SAndroid Build Coastguard Worker	  printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
468*2e9d4914SAndroid Build Coastguard Worker	#endif
469*2e9d4914SAndroid Build Coastguard Worker	#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
470*2e9d4914SAndroid Build Coastguard Worker	  printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
471*2e9d4914SAndroid Build Coastguard Worker	#endif
472*2e9d4914SAndroid Build Coastguard Worker	#endif
473*2e9d4914SAndroid Build Coastguard Worker	  exit (-1);
474*2e9d4914SAndroid Build Coastguard Worker	}
475*2e9d4914SAndroid Build Coastguard WorkerEOF
476*2e9d4914SAndroid Build Coastguard Worker	$CC_FOR_BUILD -o $dummy $dummy.c &&
477*2e9d4914SAndroid Build Coastguard Worker	  dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
478*2e9d4914SAndroid Build Coastguard Worker	  SYSTEM_NAME=`$dummy $dummyarg` &&
479*2e9d4914SAndroid Build Coastguard Worker	    { echo "$SYSTEM_NAME"; exit; }
480*2e9d4914SAndroid Build Coastguard Worker	echo mips-mips-riscos${UNAME_RELEASE}
481*2e9d4914SAndroid Build Coastguard Worker	exit ;;
482*2e9d4914SAndroid Build Coastguard Worker    Motorola:PowerMAX_OS:*:*)
483*2e9d4914SAndroid Build Coastguard Worker	echo powerpc-motorola-powermax
484*2e9d4914SAndroid Build Coastguard Worker	exit ;;
485*2e9d4914SAndroid Build Coastguard Worker    Motorola:*:4.3:PL8-*)
486*2e9d4914SAndroid Build Coastguard Worker	echo powerpc-harris-powermax
487*2e9d4914SAndroid Build Coastguard Worker	exit ;;
488*2e9d4914SAndroid Build Coastguard Worker    Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
489*2e9d4914SAndroid Build Coastguard Worker	echo powerpc-harris-powermax
490*2e9d4914SAndroid Build Coastguard Worker	exit ;;
491*2e9d4914SAndroid Build Coastguard Worker    Night_Hawk:Power_UNIX:*:*)
492*2e9d4914SAndroid Build Coastguard Worker	echo powerpc-harris-powerunix
493*2e9d4914SAndroid Build Coastguard Worker	exit ;;
494*2e9d4914SAndroid Build Coastguard Worker    m88k:CX/UX:7*:*)
495*2e9d4914SAndroid Build Coastguard Worker	echo m88k-harris-cxux7
496*2e9d4914SAndroid Build Coastguard Worker	exit ;;
497*2e9d4914SAndroid Build Coastguard Worker    m88k:*:4*:R4*)
498*2e9d4914SAndroid Build Coastguard Worker	echo m88k-motorola-sysv4
499*2e9d4914SAndroid Build Coastguard Worker	exit ;;
500*2e9d4914SAndroid Build Coastguard Worker    m88k:*:3*:R3*)
501*2e9d4914SAndroid Build Coastguard Worker	echo m88k-motorola-sysv3
502*2e9d4914SAndroid Build Coastguard Worker	exit ;;
503*2e9d4914SAndroid Build Coastguard Worker    AViiON:dgux:*:*)
504*2e9d4914SAndroid Build Coastguard Worker	# DG/UX returns AViiON for all architectures
505*2e9d4914SAndroid Build Coastguard Worker	UNAME_PROCESSOR=`/usr/bin/uname -p`
506*2e9d4914SAndroid Build Coastguard Worker	if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
507*2e9d4914SAndroid Build Coastguard Worker	then
508*2e9d4914SAndroid Build Coastguard Worker	    if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
509*2e9d4914SAndroid Build Coastguard Worker	       [ ${TARGET_BINARY_INTERFACE}x = x ]
510*2e9d4914SAndroid Build Coastguard Worker	    then
511*2e9d4914SAndroid Build Coastguard Worker		echo m88k-dg-dgux${UNAME_RELEASE}
512*2e9d4914SAndroid Build Coastguard Worker	    else
513*2e9d4914SAndroid Build Coastguard Worker		echo m88k-dg-dguxbcs${UNAME_RELEASE}
514*2e9d4914SAndroid Build Coastguard Worker	    fi
515*2e9d4914SAndroid Build Coastguard Worker	else
516*2e9d4914SAndroid Build Coastguard Worker	    echo i586-dg-dgux${UNAME_RELEASE}
517*2e9d4914SAndroid Build Coastguard Worker	fi
518*2e9d4914SAndroid Build Coastguard Worker	exit ;;
519*2e9d4914SAndroid Build Coastguard Worker    M88*:DolphinOS:*:*)	# DolphinOS (SVR3)
520*2e9d4914SAndroid Build Coastguard Worker	echo m88k-dolphin-sysv3
521*2e9d4914SAndroid Build Coastguard Worker	exit ;;
522*2e9d4914SAndroid Build Coastguard Worker    M88*:*:R3*:*)
523*2e9d4914SAndroid Build Coastguard Worker	# Delta 88k system running SVR3
524*2e9d4914SAndroid Build Coastguard Worker	echo m88k-motorola-sysv3
525*2e9d4914SAndroid Build Coastguard Worker	exit ;;
526*2e9d4914SAndroid Build Coastguard Worker    XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
527*2e9d4914SAndroid Build Coastguard Worker	echo m88k-tektronix-sysv3
528*2e9d4914SAndroid Build Coastguard Worker	exit ;;
529*2e9d4914SAndroid Build Coastguard Worker    Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
530*2e9d4914SAndroid Build Coastguard Worker	echo m68k-tektronix-bsd
531*2e9d4914SAndroid Build Coastguard Worker	exit ;;
532*2e9d4914SAndroid Build Coastguard Worker    *:IRIX*:*:*)
533*2e9d4914SAndroid Build Coastguard Worker	echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
534*2e9d4914SAndroid Build Coastguard Worker	exit ;;
535*2e9d4914SAndroid Build Coastguard Worker    ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
536*2e9d4914SAndroid Build Coastguard Worker	echo romp-ibm-aix     # uname -m gives an 8 hex-code CPU id
537*2e9d4914SAndroid Build Coastguard Worker	exit ;;               # Note that: echo "'`uname -s`'" gives 'AIX '
538*2e9d4914SAndroid Build Coastguard Worker    i*86:AIX:*:*)
539*2e9d4914SAndroid Build Coastguard Worker	echo i386-ibm-aix
540*2e9d4914SAndroid Build Coastguard Worker	exit ;;
541*2e9d4914SAndroid Build Coastguard Worker    ia64:AIX:*:*)
542*2e9d4914SAndroid Build Coastguard Worker	if [ -x /usr/bin/oslevel ] ; then
543*2e9d4914SAndroid Build Coastguard Worker		IBM_REV=`/usr/bin/oslevel`
544*2e9d4914SAndroid Build Coastguard Worker	else
545*2e9d4914SAndroid Build Coastguard Worker		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
546*2e9d4914SAndroid Build Coastguard Worker	fi
547*2e9d4914SAndroid Build Coastguard Worker	echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
548*2e9d4914SAndroid Build Coastguard Worker	exit ;;
549*2e9d4914SAndroid Build Coastguard Worker    *:AIX:2:3)
550*2e9d4914SAndroid Build Coastguard Worker	if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
551*2e9d4914SAndroid Build Coastguard Worker		eval $set_cc_for_build
552*2e9d4914SAndroid Build Coastguard Worker		sed 's/^		//' << EOF >$dummy.c
553*2e9d4914SAndroid Build Coastguard Worker		#include <sys/systemcfg.h>
554*2e9d4914SAndroid Build Coastguard Worker
555*2e9d4914SAndroid Build Coastguard Worker		main()
556*2e9d4914SAndroid Build Coastguard Worker			{
557*2e9d4914SAndroid Build Coastguard Worker			if (!__power_pc())
558*2e9d4914SAndroid Build Coastguard Worker				exit(1);
559*2e9d4914SAndroid Build Coastguard Worker			puts("powerpc-ibm-aix3.2.5");
560*2e9d4914SAndroid Build Coastguard Worker			exit(0);
561*2e9d4914SAndroid Build Coastguard Worker			}
562*2e9d4914SAndroid Build Coastguard WorkerEOF
563*2e9d4914SAndroid Build Coastguard Worker		if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
564*2e9d4914SAndroid Build Coastguard Worker		then
565*2e9d4914SAndroid Build Coastguard Worker			echo "$SYSTEM_NAME"
566*2e9d4914SAndroid Build Coastguard Worker		else
567*2e9d4914SAndroid Build Coastguard Worker			echo rs6000-ibm-aix3.2.5
568*2e9d4914SAndroid Build Coastguard Worker		fi
569*2e9d4914SAndroid Build Coastguard Worker	elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
570*2e9d4914SAndroid Build Coastguard Worker		echo rs6000-ibm-aix3.2.4
571*2e9d4914SAndroid Build Coastguard Worker	else
572*2e9d4914SAndroid Build Coastguard Worker		echo rs6000-ibm-aix3.2
573*2e9d4914SAndroid Build Coastguard Worker	fi
574*2e9d4914SAndroid Build Coastguard Worker	exit ;;
575*2e9d4914SAndroid Build Coastguard Worker    *:AIX:*:[4567])
576*2e9d4914SAndroid Build Coastguard Worker	IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
577*2e9d4914SAndroid Build Coastguard Worker	if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
578*2e9d4914SAndroid Build Coastguard Worker		IBM_ARCH=rs6000
579*2e9d4914SAndroid Build Coastguard Worker	else
580*2e9d4914SAndroid Build Coastguard Worker		IBM_ARCH=powerpc
581*2e9d4914SAndroid Build Coastguard Worker	fi
582*2e9d4914SAndroid Build Coastguard Worker	if [ -x /usr/bin/oslevel ] ; then
583*2e9d4914SAndroid Build Coastguard Worker		IBM_REV=`/usr/bin/oslevel`
584*2e9d4914SAndroid Build Coastguard Worker	else
585*2e9d4914SAndroid Build Coastguard Worker		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
586*2e9d4914SAndroid Build Coastguard Worker	fi
587*2e9d4914SAndroid Build Coastguard Worker	echo ${IBM_ARCH}-ibm-aix${IBM_REV}
588*2e9d4914SAndroid Build Coastguard Worker	exit ;;
589*2e9d4914SAndroid Build Coastguard Worker    *:AIX:*:*)
590*2e9d4914SAndroid Build Coastguard Worker	echo rs6000-ibm-aix
591*2e9d4914SAndroid Build Coastguard Worker	exit ;;
592*2e9d4914SAndroid Build Coastguard Worker    ibmrt:4.4BSD:*|romp-ibm:BSD:*)
593*2e9d4914SAndroid Build Coastguard Worker	echo romp-ibm-bsd4.4
594*2e9d4914SAndroid Build Coastguard Worker	exit ;;
595*2e9d4914SAndroid Build Coastguard Worker    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
596*2e9d4914SAndroid Build Coastguard Worker	echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
597*2e9d4914SAndroid Build Coastguard Worker	exit ;;                             # report: romp-ibm BSD 4.3
598*2e9d4914SAndroid Build Coastguard Worker    *:BOSX:*:*)
599*2e9d4914SAndroid Build Coastguard Worker	echo rs6000-bull-bosx
600*2e9d4914SAndroid Build Coastguard Worker	exit ;;
601*2e9d4914SAndroid Build Coastguard Worker    DPX/2?00:B.O.S.:*:*)
602*2e9d4914SAndroid Build Coastguard Worker	echo m68k-bull-sysv3
603*2e9d4914SAndroid Build Coastguard Worker	exit ;;
604*2e9d4914SAndroid Build Coastguard Worker    9000/[34]??:4.3bsd:1.*:*)
605*2e9d4914SAndroid Build Coastguard Worker	echo m68k-hp-bsd
606*2e9d4914SAndroid Build Coastguard Worker	exit ;;
607*2e9d4914SAndroid Build Coastguard Worker    hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
608*2e9d4914SAndroid Build Coastguard Worker	echo m68k-hp-bsd4.4
609*2e9d4914SAndroid Build Coastguard Worker	exit ;;
610*2e9d4914SAndroid Build Coastguard Worker    9000/[34678]??:HP-UX:*:*)
611*2e9d4914SAndroid Build Coastguard Worker	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
612*2e9d4914SAndroid Build Coastguard Worker	case "${UNAME_MACHINE}" in
613*2e9d4914SAndroid Build Coastguard Worker	    9000/31? )            HP_ARCH=m68000 ;;
614*2e9d4914SAndroid Build Coastguard Worker	    9000/[34]?? )         HP_ARCH=m68k ;;
615*2e9d4914SAndroid Build Coastguard Worker	    9000/[678][0-9][0-9])
616*2e9d4914SAndroid Build Coastguard Worker		if [ -x /usr/bin/getconf ]; then
617*2e9d4914SAndroid Build Coastguard Worker		    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
618*2e9d4914SAndroid Build Coastguard Worker		    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
619*2e9d4914SAndroid Build Coastguard Worker		    case "${sc_cpu_version}" in
620*2e9d4914SAndroid Build Coastguard Worker		      523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
621*2e9d4914SAndroid Build Coastguard Worker		      528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
622*2e9d4914SAndroid Build Coastguard Worker		      532)                      # CPU_PA_RISC2_0
623*2e9d4914SAndroid Build Coastguard Worker			case "${sc_kernel_bits}" in
624*2e9d4914SAndroid Build Coastguard Worker			  32) HP_ARCH="hppa2.0n" ;;
625*2e9d4914SAndroid Build Coastguard Worker			  64) HP_ARCH="hppa2.0w" ;;
626*2e9d4914SAndroid Build Coastguard Worker			  '') HP_ARCH="hppa2.0" ;;   # HP-UX 10.20
627*2e9d4914SAndroid Build Coastguard Worker			esac ;;
628*2e9d4914SAndroid Build Coastguard Worker		    esac
629*2e9d4914SAndroid Build Coastguard Worker		fi
630*2e9d4914SAndroid Build Coastguard Worker		if [ "${HP_ARCH}" = "" ]; then
631*2e9d4914SAndroid Build Coastguard Worker		    eval $set_cc_for_build
632*2e9d4914SAndroid Build Coastguard Worker		    sed 's/^		//' << EOF >$dummy.c
633*2e9d4914SAndroid Build Coastguard Worker
634*2e9d4914SAndroid Build Coastguard Worker		#define _HPUX_SOURCE
635*2e9d4914SAndroid Build Coastguard Worker		#include <stdlib.h>
636*2e9d4914SAndroid Build Coastguard Worker		#include <unistd.h>
637*2e9d4914SAndroid Build Coastguard Worker
638*2e9d4914SAndroid Build Coastguard Worker		int main ()
639*2e9d4914SAndroid Build Coastguard Worker		{
640*2e9d4914SAndroid Build Coastguard Worker		#if defined(_SC_KERNEL_BITS)
641*2e9d4914SAndroid Build Coastguard Worker		    long bits = sysconf(_SC_KERNEL_BITS);
642*2e9d4914SAndroid Build Coastguard Worker		#endif
643*2e9d4914SAndroid Build Coastguard Worker		    long cpu  = sysconf (_SC_CPU_VERSION);
644*2e9d4914SAndroid Build Coastguard Worker
645*2e9d4914SAndroid Build Coastguard Worker		    switch (cpu)
646*2e9d4914SAndroid Build Coastguard Worker			{
647*2e9d4914SAndroid Build Coastguard Worker			case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
648*2e9d4914SAndroid Build Coastguard Worker			case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
649*2e9d4914SAndroid Build Coastguard Worker			case CPU_PA_RISC2_0:
650*2e9d4914SAndroid Build Coastguard Worker		#if defined(_SC_KERNEL_BITS)
651*2e9d4914SAndroid Build Coastguard Worker			    switch (bits)
652*2e9d4914SAndroid Build Coastguard Worker				{
653*2e9d4914SAndroid Build Coastguard Worker				case 64: puts ("hppa2.0w"); break;
654*2e9d4914SAndroid Build Coastguard Worker				case 32: puts ("hppa2.0n"); break;
655*2e9d4914SAndroid Build Coastguard Worker				default: puts ("hppa2.0"); break;
656*2e9d4914SAndroid Build Coastguard Worker				} break;
657*2e9d4914SAndroid Build Coastguard Worker		#else  /* !defined(_SC_KERNEL_BITS) */
658*2e9d4914SAndroid Build Coastguard Worker			    puts ("hppa2.0"); break;
659*2e9d4914SAndroid Build Coastguard Worker		#endif
660*2e9d4914SAndroid Build Coastguard Worker			default: puts ("hppa1.0"); break;
661*2e9d4914SAndroid Build Coastguard Worker			}
662*2e9d4914SAndroid Build Coastguard Worker		    exit (0);
663*2e9d4914SAndroid Build Coastguard Worker		}
664*2e9d4914SAndroid Build Coastguard WorkerEOF
665*2e9d4914SAndroid Build Coastguard Worker		    (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
666*2e9d4914SAndroid Build Coastguard Worker		    test -z "$HP_ARCH" && HP_ARCH=hppa
667*2e9d4914SAndroid Build Coastguard Worker		fi ;;
668*2e9d4914SAndroid Build Coastguard Worker	esac
669*2e9d4914SAndroid Build Coastguard Worker	if [ ${HP_ARCH} = "hppa2.0w" ]
670*2e9d4914SAndroid Build Coastguard Worker	then
671*2e9d4914SAndroid Build Coastguard Worker	    eval $set_cc_for_build
672*2e9d4914SAndroid Build Coastguard Worker
673*2e9d4914SAndroid Build Coastguard Worker	    # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
674*2e9d4914SAndroid Build Coastguard Worker	    # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler
675*2e9d4914SAndroid Build Coastguard Worker	    # generating 64-bit code.  GNU and HP use different nomenclature:
676*2e9d4914SAndroid Build Coastguard Worker	    #
677*2e9d4914SAndroid Build Coastguard Worker	    # $ CC_FOR_BUILD=cc ./config.guess
678*2e9d4914SAndroid Build Coastguard Worker	    # => hppa2.0w-hp-hpux11.23
679*2e9d4914SAndroid Build Coastguard Worker	    # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
680*2e9d4914SAndroid Build Coastguard Worker	    # => hppa64-hp-hpux11.23
681*2e9d4914SAndroid Build Coastguard Worker
682*2e9d4914SAndroid Build Coastguard Worker	    if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
683*2e9d4914SAndroid Build Coastguard Worker		grep -q __LP64__
684*2e9d4914SAndroid Build Coastguard Worker	    then
685*2e9d4914SAndroid Build Coastguard Worker		HP_ARCH="hppa2.0w"
686*2e9d4914SAndroid Build Coastguard Worker	    else
687*2e9d4914SAndroid Build Coastguard Worker		HP_ARCH="hppa64"
688*2e9d4914SAndroid Build Coastguard Worker	    fi
689*2e9d4914SAndroid Build Coastguard Worker	fi
690*2e9d4914SAndroid Build Coastguard Worker	echo ${HP_ARCH}-hp-hpux${HPUX_REV}
691*2e9d4914SAndroid Build Coastguard Worker	exit ;;
692*2e9d4914SAndroid Build Coastguard Worker    ia64:HP-UX:*:*)
693*2e9d4914SAndroid Build Coastguard Worker	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
694*2e9d4914SAndroid Build Coastguard Worker	echo ia64-hp-hpux${HPUX_REV}
695*2e9d4914SAndroid Build Coastguard Worker	exit ;;
696*2e9d4914SAndroid Build Coastguard Worker    3050*:HI-UX:*:*)
697*2e9d4914SAndroid Build Coastguard Worker	eval $set_cc_for_build
698*2e9d4914SAndroid Build Coastguard Worker	sed 's/^	//' << EOF >$dummy.c
699*2e9d4914SAndroid Build Coastguard Worker	#include <unistd.h>
700*2e9d4914SAndroid Build Coastguard Worker	int
701*2e9d4914SAndroid Build Coastguard Worker	main ()
702*2e9d4914SAndroid Build Coastguard Worker	{
703*2e9d4914SAndroid Build Coastguard Worker	  long cpu = sysconf (_SC_CPU_VERSION);
704*2e9d4914SAndroid Build Coastguard Worker	  /* The order matters, because CPU_IS_HP_MC68K erroneously returns
705*2e9d4914SAndroid Build Coastguard Worker	     true for CPU_PA_RISC1_0.  CPU_IS_PA_RISC returns correct
706*2e9d4914SAndroid Build Coastguard Worker	     results, however.  */
707*2e9d4914SAndroid Build Coastguard Worker	  if (CPU_IS_PA_RISC (cpu))
708*2e9d4914SAndroid Build Coastguard Worker	    {
709*2e9d4914SAndroid Build Coastguard Worker	      switch (cpu)
710*2e9d4914SAndroid Build Coastguard Worker		{
711*2e9d4914SAndroid Build Coastguard Worker		  case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
712*2e9d4914SAndroid Build Coastguard Worker		  case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
713*2e9d4914SAndroid Build Coastguard Worker		  case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
714*2e9d4914SAndroid Build Coastguard Worker		  default: puts ("hppa-hitachi-hiuxwe2"); break;
715*2e9d4914SAndroid Build Coastguard Worker		}
716*2e9d4914SAndroid Build Coastguard Worker	    }
717*2e9d4914SAndroid Build Coastguard Worker	  else if (CPU_IS_HP_MC68K (cpu))
718*2e9d4914SAndroid Build Coastguard Worker	    puts ("m68k-hitachi-hiuxwe2");
719*2e9d4914SAndroid Build Coastguard Worker	  else puts ("unknown-hitachi-hiuxwe2");
720*2e9d4914SAndroid Build Coastguard Worker	  exit (0);
721*2e9d4914SAndroid Build Coastguard Worker	}
722*2e9d4914SAndroid Build Coastguard WorkerEOF
723*2e9d4914SAndroid Build Coastguard Worker	$CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
724*2e9d4914SAndroid Build Coastguard Worker		{ echo "$SYSTEM_NAME"; exit; }
725*2e9d4914SAndroid Build Coastguard Worker	echo unknown-hitachi-hiuxwe2
726*2e9d4914SAndroid Build Coastguard Worker	exit ;;
727*2e9d4914SAndroid Build Coastguard Worker    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
728*2e9d4914SAndroid Build Coastguard Worker	echo hppa1.1-hp-bsd
729*2e9d4914SAndroid Build Coastguard Worker	exit ;;
730*2e9d4914SAndroid Build Coastguard Worker    9000/8??:4.3bsd:*:*)
731*2e9d4914SAndroid Build Coastguard Worker	echo hppa1.0-hp-bsd
732*2e9d4914SAndroid Build Coastguard Worker	exit ;;
733*2e9d4914SAndroid Build Coastguard Worker    *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
734*2e9d4914SAndroid Build Coastguard Worker	echo hppa1.0-hp-mpeix
735*2e9d4914SAndroid Build Coastguard Worker	exit ;;
736*2e9d4914SAndroid Build Coastguard Worker    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
737*2e9d4914SAndroid Build Coastguard Worker	echo hppa1.1-hp-osf
738*2e9d4914SAndroid Build Coastguard Worker	exit ;;
739*2e9d4914SAndroid Build Coastguard Worker    hp8??:OSF1:*:*)
740*2e9d4914SAndroid Build Coastguard Worker	echo hppa1.0-hp-osf
741*2e9d4914SAndroid Build Coastguard Worker	exit ;;
742*2e9d4914SAndroid Build Coastguard Worker    i*86:OSF1:*:*)
743*2e9d4914SAndroid Build Coastguard Worker	if [ -x /usr/sbin/sysversion ] ; then
744*2e9d4914SAndroid Build Coastguard Worker	    echo ${UNAME_MACHINE}-unknown-osf1mk
745*2e9d4914SAndroid Build Coastguard Worker	else
746*2e9d4914SAndroid Build Coastguard Worker	    echo ${UNAME_MACHINE}-unknown-osf1
747*2e9d4914SAndroid Build Coastguard Worker	fi
748*2e9d4914SAndroid Build Coastguard Worker	exit ;;
749*2e9d4914SAndroid Build Coastguard Worker    parisc*:Lites*:*:*)
750*2e9d4914SAndroid Build Coastguard Worker	echo hppa1.1-hp-lites
751*2e9d4914SAndroid Build Coastguard Worker	exit ;;
752*2e9d4914SAndroid Build Coastguard Worker    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
753*2e9d4914SAndroid Build Coastguard Worker	echo c1-convex-bsd
754*2e9d4914SAndroid Build Coastguard Worker	exit ;;
755*2e9d4914SAndroid Build Coastguard Worker    C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
756*2e9d4914SAndroid Build Coastguard Worker	if getsysinfo -f scalar_acc
757*2e9d4914SAndroid Build Coastguard Worker	then echo c32-convex-bsd
758*2e9d4914SAndroid Build Coastguard Worker	else echo c2-convex-bsd
759*2e9d4914SAndroid Build Coastguard Worker	fi
760*2e9d4914SAndroid Build Coastguard Worker	exit ;;
761*2e9d4914SAndroid Build Coastguard Worker    C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
762*2e9d4914SAndroid Build Coastguard Worker	echo c34-convex-bsd
763*2e9d4914SAndroid Build Coastguard Worker	exit ;;
764*2e9d4914SAndroid Build Coastguard Worker    C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
765*2e9d4914SAndroid Build Coastguard Worker	echo c38-convex-bsd
766*2e9d4914SAndroid Build Coastguard Worker	exit ;;
767*2e9d4914SAndroid Build Coastguard Worker    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
768*2e9d4914SAndroid Build Coastguard Worker	echo c4-convex-bsd
769*2e9d4914SAndroid Build Coastguard Worker	exit ;;
770*2e9d4914SAndroid Build Coastguard Worker    CRAY*Y-MP:*:*:*)
771*2e9d4914SAndroid Build Coastguard Worker	echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
772*2e9d4914SAndroid Build Coastguard Worker	exit ;;
773*2e9d4914SAndroid Build Coastguard Worker    CRAY*[A-Z]90:*:*:*)
774*2e9d4914SAndroid Build Coastguard Worker	echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
775*2e9d4914SAndroid Build Coastguard Worker	| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
776*2e9d4914SAndroid Build Coastguard Worker	      -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
777*2e9d4914SAndroid Build Coastguard Worker	      -e 's/\.[^.]*$/.X/'
778*2e9d4914SAndroid Build Coastguard Worker	exit ;;
779*2e9d4914SAndroid Build Coastguard Worker    CRAY*TS:*:*:*)
780*2e9d4914SAndroid Build Coastguard Worker	echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
781*2e9d4914SAndroid Build Coastguard Worker	exit ;;
782*2e9d4914SAndroid Build Coastguard Worker    CRAY*T3E:*:*:*)
783*2e9d4914SAndroid Build Coastguard Worker	echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
784*2e9d4914SAndroid Build Coastguard Worker	exit ;;
785*2e9d4914SAndroid Build Coastguard Worker    CRAY*SV1:*:*:*)
786*2e9d4914SAndroid Build Coastguard Worker	echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
787*2e9d4914SAndroid Build Coastguard Worker	exit ;;
788*2e9d4914SAndroid Build Coastguard Worker    *:UNICOS/mp:*:*)
789*2e9d4914SAndroid Build Coastguard Worker	echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
790*2e9d4914SAndroid Build Coastguard Worker	exit ;;
791*2e9d4914SAndroid Build Coastguard Worker    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
792*2e9d4914SAndroid Build Coastguard Worker	FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
793*2e9d4914SAndroid Build Coastguard Worker	FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
794*2e9d4914SAndroid Build Coastguard Worker	FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
795*2e9d4914SAndroid Build Coastguard Worker	echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
796*2e9d4914SAndroid Build Coastguard Worker	exit ;;
797*2e9d4914SAndroid Build Coastguard Worker    5000:UNIX_System_V:4.*:*)
798*2e9d4914SAndroid Build Coastguard Worker	FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
799*2e9d4914SAndroid Build Coastguard Worker	FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
800*2e9d4914SAndroid Build Coastguard Worker	echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
801*2e9d4914SAndroid Build Coastguard Worker	exit ;;
802*2e9d4914SAndroid Build Coastguard Worker    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
803*2e9d4914SAndroid Build Coastguard Worker	echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
804*2e9d4914SAndroid Build Coastguard Worker	exit ;;
805*2e9d4914SAndroid Build Coastguard Worker    sparc*:BSD/OS:*:*)
806*2e9d4914SAndroid Build Coastguard Worker	echo sparc-unknown-bsdi${UNAME_RELEASE}
807*2e9d4914SAndroid Build Coastguard Worker	exit ;;
808*2e9d4914SAndroid Build Coastguard Worker    *:BSD/OS:*:*)
809*2e9d4914SAndroid Build Coastguard Worker	echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
810*2e9d4914SAndroid Build Coastguard Worker	exit ;;
811*2e9d4914SAndroid Build Coastguard Worker    *:FreeBSD:*:*)
812*2e9d4914SAndroid Build Coastguard Worker	UNAME_PROCESSOR=`/usr/bin/uname -p`
813*2e9d4914SAndroid Build Coastguard Worker	case ${UNAME_PROCESSOR} in
814*2e9d4914SAndroid Build Coastguard Worker	    amd64)
815*2e9d4914SAndroid Build Coastguard Worker		echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
816*2e9d4914SAndroid Build Coastguard Worker	    *)
817*2e9d4914SAndroid Build Coastguard Worker		echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
818*2e9d4914SAndroid Build Coastguard Worker	esac
819*2e9d4914SAndroid Build Coastguard Worker	exit ;;
820*2e9d4914SAndroid Build Coastguard Worker    i*:CYGWIN*:*)
821*2e9d4914SAndroid Build Coastguard Worker	echo ${UNAME_MACHINE}-pc-cygwin
822*2e9d4914SAndroid Build Coastguard Worker	exit ;;
823*2e9d4914SAndroid Build Coastguard Worker    *:MINGW64*:*)
824*2e9d4914SAndroid Build Coastguard Worker	echo ${UNAME_MACHINE}-pc-mingw64
825*2e9d4914SAndroid Build Coastguard Worker	exit ;;
826*2e9d4914SAndroid Build Coastguard Worker    *:MINGW*:*)
827*2e9d4914SAndroid Build Coastguard Worker	echo ${UNAME_MACHINE}-pc-mingw32
828*2e9d4914SAndroid Build Coastguard Worker	exit ;;
829*2e9d4914SAndroid Build Coastguard Worker    i*:MSYS*:*)
830*2e9d4914SAndroid Build Coastguard Worker	echo ${UNAME_MACHINE}-pc-msys
831*2e9d4914SAndroid Build Coastguard Worker	exit ;;
832*2e9d4914SAndroid Build Coastguard Worker    i*:windows32*:*)
833*2e9d4914SAndroid Build Coastguard Worker	# uname -m includes "-pc" on this system.
834*2e9d4914SAndroid Build Coastguard Worker	echo ${UNAME_MACHINE}-mingw32
835*2e9d4914SAndroid Build Coastguard Worker	exit ;;
836*2e9d4914SAndroid Build Coastguard Worker    i*:PW*:*)
837*2e9d4914SAndroid Build Coastguard Worker	echo ${UNAME_MACHINE}-pc-pw32
838*2e9d4914SAndroid Build Coastguard Worker	exit ;;
839*2e9d4914SAndroid Build Coastguard Worker    *:Interix*:*)
840*2e9d4914SAndroid Build Coastguard Worker	case ${UNAME_MACHINE} in
841*2e9d4914SAndroid Build Coastguard Worker	    x86)
842*2e9d4914SAndroid Build Coastguard Worker		echo i586-pc-interix${UNAME_RELEASE}
843*2e9d4914SAndroid Build Coastguard Worker		exit ;;
844*2e9d4914SAndroid Build Coastguard Worker	    authenticamd | genuineintel | EM64T)
845*2e9d4914SAndroid Build Coastguard Worker		echo x86_64-unknown-interix${UNAME_RELEASE}
846*2e9d4914SAndroid Build Coastguard Worker		exit ;;
847*2e9d4914SAndroid Build Coastguard Worker	    IA64)
848*2e9d4914SAndroid Build Coastguard Worker		echo ia64-unknown-interix${UNAME_RELEASE}
849*2e9d4914SAndroid Build Coastguard Worker		exit ;;
850*2e9d4914SAndroid Build Coastguard Worker	esac ;;
851*2e9d4914SAndroid Build Coastguard Worker    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
852*2e9d4914SAndroid Build Coastguard Worker	echo i${UNAME_MACHINE}-pc-mks
853*2e9d4914SAndroid Build Coastguard Worker	exit ;;
854*2e9d4914SAndroid Build Coastguard Worker    8664:Windows_NT:*)
855*2e9d4914SAndroid Build Coastguard Worker	echo x86_64-pc-mks
856*2e9d4914SAndroid Build Coastguard Worker	exit ;;
857*2e9d4914SAndroid Build Coastguard Worker    i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
858*2e9d4914SAndroid Build Coastguard Worker	# How do we know it's Interix rather than the generic POSIX subsystem?
859*2e9d4914SAndroid Build Coastguard Worker	# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
860*2e9d4914SAndroid Build Coastguard Worker	# UNAME_MACHINE based on the output of uname instead of i386?
861*2e9d4914SAndroid Build Coastguard Worker	echo i586-pc-interix
862*2e9d4914SAndroid Build Coastguard Worker	exit ;;
863*2e9d4914SAndroid Build Coastguard Worker    i*:UWIN*:*)
864*2e9d4914SAndroid Build Coastguard Worker	echo ${UNAME_MACHINE}-pc-uwin
865*2e9d4914SAndroid Build Coastguard Worker	exit ;;
866*2e9d4914SAndroid Build Coastguard Worker    amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
867*2e9d4914SAndroid Build Coastguard Worker	echo x86_64-unknown-cygwin
868*2e9d4914SAndroid Build Coastguard Worker	exit ;;
869*2e9d4914SAndroid Build Coastguard Worker    p*:CYGWIN*:*)
870*2e9d4914SAndroid Build Coastguard Worker	echo powerpcle-unknown-cygwin
871*2e9d4914SAndroid Build Coastguard Worker	exit ;;
872*2e9d4914SAndroid Build Coastguard Worker    prep*:SunOS:5.*:*)
873*2e9d4914SAndroid Build Coastguard Worker	echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
874*2e9d4914SAndroid Build Coastguard Worker	exit ;;
875*2e9d4914SAndroid Build Coastguard Worker    *:GNU:*:*)
876*2e9d4914SAndroid Build Coastguard Worker	# the GNU system
877*2e9d4914SAndroid Build Coastguard Worker	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
878*2e9d4914SAndroid Build Coastguard Worker	exit ;;
879*2e9d4914SAndroid Build Coastguard Worker    *:GNU/*:*:*)
880*2e9d4914SAndroid Build Coastguard Worker	# other systems with GNU libc and userland
881*2e9d4914SAndroid Build Coastguard Worker	echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
882*2e9d4914SAndroid Build Coastguard Worker	exit ;;
883*2e9d4914SAndroid Build Coastguard Worker    i*86:Minix:*:*)
884*2e9d4914SAndroid Build Coastguard Worker	echo ${UNAME_MACHINE}-pc-minix
885*2e9d4914SAndroid Build Coastguard Worker	exit ;;
886*2e9d4914SAndroid Build Coastguard Worker    aarch64:Linux:*:*)
887*2e9d4914SAndroid Build Coastguard Worker	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
888*2e9d4914SAndroid Build Coastguard Worker	exit ;;
889*2e9d4914SAndroid Build Coastguard Worker    aarch64_be:Linux:*:*)
890*2e9d4914SAndroid Build Coastguard Worker	UNAME_MACHINE=aarch64_be
891*2e9d4914SAndroid Build Coastguard Worker	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
892*2e9d4914SAndroid Build Coastguard Worker	exit ;;
893*2e9d4914SAndroid Build Coastguard Worker    alpha:Linux:*:*)
894*2e9d4914SAndroid Build Coastguard Worker	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
895*2e9d4914SAndroid Build Coastguard Worker	  EV5)   UNAME_MACHINE=alphaev5 ;;
896*2e9d4914SAndroid Build Coastguard Worker	  EV56)  UNAME_MACHINE=alphaev56 ;;
897*2e9d4914SAndroid Build Coastguard Worker	  PCA56) UNAME_MACHINE=alphapca56 ;;
898*2e9d4914SAndroid Build Coastguard Worker	  PCA57) UNAME_MACHINE=alphapca56 ;;
899*2e9d4914SAndroid Build Coastguard Worker	  EV6)   UNAME_MACHINE=alphaev6 ;;
900*2e9d4914SAndroid Build Coastguard Worker	  EV67)  UNAME_MACHINE=alphaev67 ;;
901*2e9d4914SAndroid Build Coastguard Worker	  EV68*) UNAME_MACHINE=alphaev68 ;;
902*2e9d4914SAndroid Build Coastguard Worker	esac
903*2e9d4914SAndroid Build Coastguard Worker	objdump --private-headers /bin/sh | grep -q ld.so.1
904*2e9d4914SAndroid Build Coastguard Worker	if test "$?" = 0 ; then LIBC="gnulibc1" ; fi
905*2e9d4914SAndroid Build Coastguard Worker	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
906*2e9d4914SAndroid Build Coastguard Worker	exit ;;
907*2e9d4914SAndroid Build Coastguard Worker    arc:Linux:*:* | arceb:Linux:*:*)
908*2e9d4914SAndroid Build Coastguard Worker	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
909*2e9d4914SAndroid Build Coastguard Worker	exit ;;
910*2e9d4914SAndroid Build Coastguard Worker    arm*:Linux:*:*)
911*2e9d4914SAndroid Build Coastguard Worker	eval $set_cc_for_build
912*2e9d4914SAndroid Build Coastguard Worker	if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
913*2e9d4914SAndroid Build Coastguard Worker	    | grep -q __ARM_EABI__
914*2e9d4914SAndroid Build Coastguard Worker	then
915*2e9d4914SAndroid Build Coastguard Worker	    echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
916*2e9d4914SAndroid Build Coastguard Worker	else
917*2e9d4914SAndroid Build Coastguard Worker	    if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
918*2e9d4914SAndroid Build Coastguard Worker		| grep -q __ARM_PCS_VFP
919*2e9d4914SAndroid Build Coastguard Worker	    then
920*2e9d4914SAndroid Build Coastguard Worker		echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
921*2e9d4914SAndroid Build Coastguard Worker	    else
922*2e9d4914SAndroid Build Coastguard Worker		echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf
923*2e9d4914SAndroid Build Coastguard Worker	    fi
924*2e9d4914SAndroid Build Coastguard Worker	fi
925*2e9d4914SAndroid Build Coastguard Worker	exit ;;
926*2e9d4914SAndroid Build Coastguard Worker    avr32*:Linux:*:*)
927*2e9d4914SAndroid Build Coastguard Worker	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
928*2e9d4914SAndroid Build Coastguard Worker	exit ;;
929*2e9d4914SAndroid Build Coastguard Worker    cris:Linux:*:*)
930*2e9d4914SAndroid Build Coastguard Worker	echo ${UNAME_MACHINE}-axis-linux-${LIBC}
931*2e9d4914SAndroid Build Coastguard Worker	exit ;;
932*2e9d4914SAndroid Build Coastguard Worker    crisv32:Linux:*:*)
933*2e9d4914SAndroid Build Coastguard Worker	echo ${UNAME_MACHINE}-axis-linux-${LIBC}
934*2e9d4914SAndroid Build Coastguard Worker	exit ;;
935*2e9d4914SAndroid Build Coastguard Worker    frv:Linux:*:*)
936*2e9d4914SAndroid Build Coastguard Worker	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
937*2e9d4914SAndroid Build Coastguard Worker	exit ;;
938*2e9d4914SAndroid Build Coastguard Worker    hexagon:Linux:*:*)
939*2e9d4914SAndroid Build Coastguard Worker	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
940*2e9d4914SAndroid Build Coastguard Worker	exit ;;
941*2e9d4914SAndroid Build Coastguard Worker    i*86:Linux:*:*)
942*2e9d4914SAndroid Build Coastguard Worker	echo ${UNAME_MACHINE}-pc-linux-${LIBC}
943*2e9d4914SAndroid Build Coastguard Worker	exit ;;
944*2e9d4914SAndroid Build Coastguard Worker    ia64:Linux:*:*)
945*2e9d4914SAndroid Build Coastguard Worker	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
946*2e9d4914SAndroid Build Coastguard Worker	exit ;;
947*2e9d4914SAndroid Build Coastguard Worker    m32r*:Linux:*:*)
948*2e9d4914SAndroid Build Coastguard Worker	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
949*2e9d4914SAndroid Build Coastguard Worker	exit ;;
950*2e9d4914SAndroid Build Coastguard Worker    m68*:Linux:*:*)
951*2e9d4914SAndroid Build Coastguard Worker	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
952*2e9d4914SAndroid Build Coastguard Worker	exit ;;
953*2e9d4914SAndroid Build Coastguard Worker    mips:Linux:*:* | mips64:Linux:*:*)
954*2e9d4914SAndroid Build Coastguard Worker	eval $set_cc_for_build
955*2e9d4914SAndroid Build Coastguard Worker	sed 's/^	//' << EOF >$dummy.c
956*2e9d4914SAndroid Build Coastguard Worker	#undef CPU
957*2e9d4914SAndroid Build Coastguard Worker	#undef ${UNAME_MACHINE}
958*2e9d4914SAndroid Build Coastguard Worker	#undef ${UNAME_MACHINE}el
959*2e9d4914SAndroid Build Coastguard Worker	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
960*2e9d4914SAndroid Build Coastguard Worker	CPU=${UNAME_MACHINE}el
961*2e9d4914SAndroid Build Coastguard Worker	#else
962*2e9d4914SAndroid Build Coastguard Worker	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
963*2e9d4914SAndroid Build Coastguard Worker	CPU=${UNAME_MACHINE}
964*2e9d4914SAndroid Build Coastguard Worker	#else
965*2e9d4914SAndroid Build Coastguard Worker	CPU=
966*2e9d4914SAndroid Build Coastguard Worker	#endif
967*2e9d4914SAndroid Build Coastguard Worker	#endif
968*2e9d4914SAndroid Build Coastguard WorkerEOF
969*2e9d4914SAndroid Build Coastguard Worker	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
970*2e9d4914SAndroid Build Coastguard Worker	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
971*2e9d4914SAndroid Build Coastguard Worker	;;
972*2e9d4914SAndroid Build Coastguard Worker    or1k:Linux:*:*)
973*2e9d4914SAndroid Build Coastguard Worker	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
974*2e9d4914SAndroid Build Coastguard Worker	exit ;;
975*2e9d4914SAndroid Build Coastguard Worker    or32:Linux:*:*)
976*2e9d4914SAndroid Build Coastguard Worker	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
977*2e9d4914SAndroid Build Coastguard Worker	exit ;;
978*2e9d4914SAndroid Build Coastguard Worker    padre:Linux:*:*)
979*2e9d4914SAndroid Build Coastguard Worker	echo sparc-unknown-linux-${LIBC}
980*2e9d4914SAndroid Build Coastguard Worker	exit ;;
981*2e9d4914SAndroid Build Coastguard Worker    parisc64:Linux:*:* | hppa64:Linux:*:*)
982*2e9d4914SAndroid Build Coastguard Worker	echo hppa64-unknown-linux-${LIBC}
983*2e9d4914SAndroid Build Coastguard Worker	exit ;;
984*2e9d4914SAndroid Build Coastguard Worker    parisc:Linux:*:* | hppa:Linux:*:*)
985*2e9d4914SAndroid Build Coastguard Worker	# Look for CPU level
986*2e9d4914SAndroid Build Coastguard Worker	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
987*2e9d4914SAndroid Build Coastguard Worker	  PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
988*2e9d4914SAndroid Build Coastguard Worker	  PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
989*2e9d4914SAndroid Build Coastguard Worker	  *)    echo hppa-unknown-linux-${LIBC} ;;
990*2e9d4914SAndroid Build Coastguard Worker	esac
991*2e9d4914SAndroid Build Coastguard Worker	exit ;;
992*2e9d4914SAndroid Build Coastguard Worker    ppc64:Linux:*:*)
993*2e9d4914SAndroid Build Coastguard Worker	echo powerpc64-unknown-linux-${LIBC}
994*2e9d4914SAndroid Build Coastguard Worker	exit ;;
995*2e9d4914SAndroid Build Coastguard Worker    ppc:Linux:*:*)
996*2e9d4914SAndroid Build Coastguard Worker	echo powerpc-unknown-linux-${LIBC}
997*2e9d4914SAndroid Build Coastguard Worker	exit ;;
998*2e9d4914SAndroid Build Coastguard Worker    ppc64le:Linux:*:*)
999*2e9d4914SAndroid Build Coastguard Worker	echo powerpc64le-unknown-linux-${LIBC}
1000*2e9d4914SAndroid Build Coastguard Worker	exit ;;
1001*2e9d4914SAndroid Build Coastguard Worker    ppcle:Linux:*:*)
1002*2e9d4914SAndroid Build Coastguard Worker	echo powerpcle-unknown-linux-${LIBC}
1003*2e9d4914SAndroid Build Coastguard Worker	exit ;;
1004*2e9d4914SAndroid Build Coastguard Worker    s390:Linux:*:* | s390x:Linux:*:*)
1005*2e9d4914SAndroid Build Coastguard Worker	echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
1006*2e9d4914SAndroid Build Coastguard Worker	exit ;;
1007*2e9d4914SAndroid Build Coastguard Worker    sh64*:Linux:*:*)
1008*2e9d4914SAndroid Build Coastguard Worker	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
1009*2e9d4914SAndroid Build Coastguard Worker	exit ;;
1010*2e9d4914SAndroid Build Coastguard Worker    sh*:Linux:*:*)
1011*2e9d4914SAndroid Build Coastguard Worker	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
1012*2e9d4914SAndroid Build Coastguard Worker	exit ;;
1013*2e9d4914SAndroid Build Coastguard Worker    sparc:Linux:*:* | sparc64:Linux:*:*)
1014*2e9d4914SAndroid Build Coastguard Worker	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
1015*2e9d4914SAndroid Build Coastguard Worker	exit ;;
1016*2e9d4914SAndroid Build Coastguard Worker    tile*:Linux:*:*)
1017*2e9d4914SAndroid Build Coastguard Worker	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
1018*2e9d4914SAndroid Build Coastguard Worker	exit ;;
1019*2e9d4914SAndroid Build Coastguard Worker    vax:Linux:*:*)
1020*2e9d4914SAndroid Build Coastguard Worker	echo ${UNAME_MACHINE}-dec-linux-${LIBC}
1021*2e9d4914SAndroid Build Coastguard Worker	exit ;;
1022*2e9d4914SAndroid Build Coastguard Worker    x86_64:Linux:*:*)
1023*2e9d4914SAndroid Build Coastguard Worker	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
1024*2e9d4914SAndroid Build Coastguard Worker	exit ;;
1025*2e9d4914SAndroid Build Coastguard Worker    xtensa*:Linux:*:*)
1026*2e9d4914SAndroid Build Coastguard Worker	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
1027*2e9d4914SAndroid Build Coastguard Worker	exit ;;
1028*2e9d4914SAndroid Build Coastguard Worker    i*86:DYNIX/ptx:4*:*)
1029*2e9d4914SAndroid Build Coastguard Worker	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
1030*2e9d4914SAndroid Build Coastguard Worker	# earlier versions are messed up and put the nodename in both
1031*2e9d4914SAndroid Build Coastguard Worker	# sysname and nodename.
1032*2e9d4914SAndroid Build Coastguard Worker	echo i386-sequent-sysv4
1033*2e9d4914SAndroid Build Coastguard Worker	exit ;;
1034*2e9d4914SAndroid Build Coastguard Worker    i*86:UNIX_SV:4.2MP:2.*)
1035*2e9d4914SAndroid Build Coastguard Worker	# Unixware is an offshoot of SVR4, but it has its own version
1036*2e9d4914SAndroid Build Coastguard Worker	# number series starting with 2...
1037*2e9d4914SAndroid Build Coastguard Worker	# I am not positive that other SVR4 systems won't match this,
1038*2e9d4914SAndroid Build Coastguard Worker	# I just have to hope.  -- rms.
1039*2e9d4914SAndroid Build Coastguard Worker	# Use sysv4.2uw... so that sysv4* matches it.
1040*2e9d4914SAndroid Build Coastguard Worker	echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
1041*2e9d4914SAndroid Build Coastguard Worker	exit ;;
1042*2e9d4914SAndroid Build Coastguard Worker    i*86:OS/2:*:*)
1043*2e9d4914SAndroid Build Coastguard Worker	# If we were able to find `uname', then EMX Unix compatibility
1044*2e9d4914SAndroid Build Coastguard Worker	# is probably installed.
1045*2e9d4914SAndroid Build Coastguard Worker	echo ${UNAME_MACHINE}-pc-os2-emx
1046*2e9d4914SAndroid Build Coastguard Worker	exit ;;
1047*2e9d4914SAndroid Build Coastguard Worker    i*86:XTS-300:*:STOP)
1048*2e9d4914SAndroid Build Coastguard Worker	echo ${UNAME_MACHINE}-unknown-stop
1049*2e9d4914SAndroid Build Coastguard Worker	exit ;;
1050*2e9d4914SAndroid Build Coastguard Worker    i*86:atheos:*:*)
1051*2e9d4914SAndroid Build Coastguard Worker	echo ${UNAME_MACHINE}-unknown-atheos
1052*2e9d4914SAndroid Build Coastguard Worker	exit ;;
1053*2e9d4914SAndroid Build Coastguard Worker    i*86:syllable:*:*)
1054*2e9d4914SAndroid Build Coastguard Worker	echo ${UNAME_MACHINE}-pc-syllable
1055*2e9d4914SAndroid Build Coastguard Worker	exit ;;
1056*2e9d4914SAndroid Build Coastguard Worker    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
1057*2e9d4914SAndroid Build Coastguard Worker	echo i386-unknown-lynxos${UNAME_RELEASE}
1058*2e9d4914SAndroid Build Coastguard Worker	exit ;;
1059*2e9d4914SAndroid Build Coastguard Worker    i*86:*DOS:*:*)
1060*2e9d4914SAndroid Build Coastguard Worker	echo ${UNAME_MACHINE}-pc-msdosdjgpp
1061*2e9d4914SAndroid Build Coastguard Worker	exit ;;
1062*2e9d4914SAndroid Build Coastguard Worker    i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
1063*2e9d4914SAndroid Build Coastguard Worker	UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
1064*2e9d4914SAndroid Build Coastguard Worker	if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
1065*2e9d4914SAndroid Build Coastguard Worker		echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
1066*2e9d4914SAndroid Build Coastguard Worker	else
1067*2e9d4914SAndroid Build Coastguard Worker		echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
1068*2e9d4914SAndroid Build Coastguard Worker	fi
1069*2e9d4914SAndroid Build Coastguard Worker	exit ;;
1070*2e9d4914SAndroid Build Coastguard Worker    i*86:*:5:[678]*)
1071*2e9d4914SAndroid Build Coastguard Worker	# UnixWare 7.x, OpenUNIX and OpenServer 6.
1072*2e9d4914SAndroid Build Coastguard Worker	case `/bin/uname -X | grep "^Machine"` in
1073*2e9d4914SAndroid Build Coastguard Worker	    *486*)	     UNAME_MACHINE=i486 ;;
1074*2e9d4914SAndroid Build Coastguard Worker	    *Pentium)	     UNAME_MACHINE=i586 ;;
1075*2e9d4914SAndroid Build Coastguard Worker	    *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
1076*2e9d4914SAndroid Build Coastguard Worker	esac
1077*2e9d4914SAndroid Build Coastguard Worker	echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
1078*2e9d4914SAndroid Build Coastguard Worker	exit ;;
1079*2e9d4914SAndroid Build Coastguard Worker    i*86:*:3.2:*)
1080*2e9d4914SAndroid Build Coastguard Worker	if test -f /usr/options/cb.name; then
1081*2e9d4914SAndroid Build Coastguard Worker		UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
1082*2e9d4914SAndroid Build Coastguard Worker		echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
1083*2e9d4914SAndroid Build Coastguard Worker	elif /bin/uname -X 2>/dev/null >/dev/null ; then
1084*2e9d4914SAndroid Build Coastguard Worker		UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
1085*2e9d4914SAndroid Build Coastguard Worker		(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
1086*2e9d4914SAndroid Build Coastguard Worker		(/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
1087*2e9d4914SAndroid Build Coastguard Worker			&& UNAME_MACHINE=i586
1088*2e9d4914SAndroid Build Coastguard Worker		(/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
1089*2e9d4914SAndroid Build Coastguard Worker			&& UNAME_MACHINE=i686
1090*2e9d4914SAndroid Build Coastguard Worker		(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
1091*2e9d4914SAndroid Build Coastguard Worker			&& UNAME_MACHINE=i686
1092*2e9d4914SAndroid Build Coastguard Worker		echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
1093*2e9d4914SAndroid Build Coastguard Worker	else
1094*2e9d4914SAndroid Build Coastguard Worker		echo ${UNAME_MACHINE}-pc-sysv32
1095*2e9d4914SAndroid Build Coastguard Worker	fi
1096*2e9d4914SAndroid Build Coastguard Worker	exit ;;
1097*2e9d4914SAndroid Build Coastguard Worker    pc:*:*:*)
1098*2e9d4914SAndroid Build Coastguard Worker	# Left here for compatibility:
1099*2e9d4914SAndroid Build Coastguard Worker	# uname -m prints for DJGPP always 'pc', but it prints nothing about
1100*2e9d4914SAndroid Build Coastguard Worker	# the processor, so we play safe by assuming i586.
1101*2e9d4914SAndroid Build Coastguard Worker	# Note: whatever this is, it MUST be the same as what config.sub
1102*2e9d4914SAndroid Build Coastguard Worker	# prints for the "djgpp" host, or else GDB configury will decide that
1103*2e9d4914SAndroid Build Coastguard Worker	# this is a cross-build.
1104*2e9d4914SAndroid Build Coastguard Worker	echo i586-pc-msdosdjgpp
1105*2e9d4914SAndroid Build Coastguard Worker	exit ;;
1106*2e9d4914SAndroid Build Coastguard Worker    Intel:Mach:3*:*)
1107*2e9d4914SAndroid Build Coastguard Worker	echo i386-pc-mach3
1108*2e9d4914SAndroid Build Coastguard Worker	exit ;;
1109*2e9d4914SAndroid Build Coastguard Worker    paragon:*:*:*)
1110*2e9d4914SAndroid Build Coastguard Worker	echo i860-intel-osf1
1111*2e9d4914SAndroid Build Coastguard Worker	exit ;;
1112*2e9d4914SAndroid Build Coastguard Worker    i860:*:4.*:*) # i860-SVR4
1113*2e9d4914SAndroid Build Coastguard Worker	if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
1114*2e9d4914SAndroid Build Coastguard Worker	  echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
1115*2e9d4914SAndroid Build Coastguard Worker	else # Add other i860-SVR4 vendors below as they are discovered.
1116*2e9d4914SAndroid Build Coastguard Worker	  echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
1117*2e9d4914SAndroid Build Coastguard Worker	fi
1118*2e9d4914SAndroid Build Coastguard Worker	exit ;;
1119*2e9d4914SAndroid Build Coastguard Worker    mini*:CTIX:SYS*5:*)
1120*2e9d4914SAndroid Build Coastguard Worker	# "miniframe"
1121*2e9d4914SAndroid Build Coastguard Worker	echo m68010-convergent-sysv
1122*2e9d4914SAndroid Build Coastguard Worker	exit ;;
1123*2e9d4914SAndroid Build Coastguard Worker    mc68k:UNIX:SYSTEM5:3.51m)
1124*2e9d4914SAndroid Build Coastguard Worker	echo m68k-convergent-sysv
1125*2e9d4914SAndroid Build Coastguard Worker	exit ;;
1126*2e9d4914SAndroid Build Coastguard Worker    M680?0:D-NIX:5.3:*)
1127*2e9d4914SAndroid Build Coastguard Worker	echo m68k-diab-dnix
1128*2e9d4914SAndroid Build Coastguard Worker	exit ;;
1129*2e9d4914SAndroid Build Coastguard Worker    M68*:*:R3V[5678]*:*)
1130*2e9d4914SAndroid Build Coastguard Worker	test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
1131*2e9d4914SAndroid Build Coastguard Worker    3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
1132*2e9d4914SAndroid Build Coastguard Worker	OS_REL=''
1133*2e9d4914SAndroid Build Coastguard Worker	test -r /etc/.relid \
1134*2e9d4914SAndroid Build Coastguard Worker	&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
1135*2e9d4914SAndroid Build Coastguard Worker	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1136*2e9d4914SAndroid Build Coastguard Worker	  && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
1137*2e9d4914SAndroid Build Coastguard Worker	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
1138*2e9d4914SAndroid Build Coastguard Worker	  && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
1139*2e9d4914SAndroid Build Coastguard Worker    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
1140*2e9d4914SAndroid Build Coastguard Worker	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1141*2e9d4914SAndroid Build Coastguard Worker	  && { echo i486-ncr-sysv4; exit; } ;;
1142*2e9d4914SAndroid Build Coastguard Worker    NCR*:*:4.2:* | MPRAS*:*:4.2:*)
1143*2e9d4914SAndroid Build Coastguard Worker	OS_REL='.3'
1144*2e9d4914SAndroid Build Coastguard Worker	test -r /etc/.relid \
1145*2e9d4914SAndroid Build Coastguard Worker	    && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
1146*2e9d4914SAndroid Build Coastguard Worker	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1147*2e9d4914SAndroid Build Coastguard Worker	    && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
1148*2e9d4914SAndroid Build Coastguard Worker	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
1149*2e9d4914SAndroid Build Coastguard Worker	    && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
1150*2e9d4914SAndroid Build Coastguard Worker	/bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
1151*2e9d4914SAndroid Build Coastguard Worker	    && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
1152*2e9d4914SAndroid Build Coastguard Worker    m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
1153*2e9d4914SAndroid Build Coastguard Worker	echo m68k-unknown-lynxos${UNAME_RELEASE}
1154*2e9d4914SAndroid Build Coastguard Worker	exit ;;
1155*2e9d4914SAndroid Build Coastguard Worker    mc68030:UNIX_System_V:4.*:*)
1156*2e9d4914SAndroid Build Coastguard Worker	echo m68k-atari-sysv4
1157*2e9d4914SAndroid Build Coastguard Worker	exit ;;
1158*2e9d4914SAndroid Build Coastguard Worker    TSUNAMI:LynxOS:2.*:*)
1159*2e9d4914SAndroid Build Coastguard Worker	echo sparc-unknown-lynxos${UNAME_RELEASE}
1160*2e9d4914SAndroid Build Coastguard Worker	exit ;;
1161*2e9d4914SAndroid Build Coastguard Worker    rs6000:LynxOS:2.*:*)
1162*2e9d4914SAndroid Build Coastguard Worker	echo rs6000-unknown-lynxos${UNAME_RELEASE}
1163*2e9d4914SAndroid Build Coastguard Worker	exit ;;
1164*2e9d4914SAndroid Build Coastguard Worker    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
1165*2e9d4914SAndroid Build Coastguard Worker	echo powerpc-unknown-lynxos${UNAME_RELEASE}
1166*2e9d4914SAndroid Build Coastguard Worker	exit ;;
1167*2e9d4914SAndroid Build Coastguard Worker    SM[BE]S:UNIX_SV:*:*)
1168*2e9d4914SAndroid Build Coastguard Worker	echo mips-dde-sysv${UNAME_RELEASE}
1169*2e9d4914SAndroid Build Coastguard Worker	exit ;;
1170*2e9d4914SAndroid Build Coastguard Worker    RM*:ReliantUNIX-*:*:*)
1171*2e9d4914SAndroid Build Coastguard Worker	echo mips-sni-sysv4
1172*2e9d4914SAndroid Build Coastguard Worker	exit ;;
1173*2e9d4914SAndroid Build Coastguard Worker    RM*:SINIX-*:*:*)
1174*2e9d4914SAndroid Build Coastguard Worker	echo mips-sni-sysv4
1175*2e9d4914SAndroid Build Coastguard Worker	exit ;;
1176*2e9d4914SAndroid Build Coastguard Worker    *:SINIX-*:*:*)
1177*2e9d4914SAndroid Build Coastguard Worker	if uname -p 2>/dev/null >/dev/null ; then
1178*2e9d4914SAndroid Build Coastguard Worker		UNAME_MACHINE=`(uname -p) 2>/dev/null`
1179*2e9d4914SAndroid Build Coastguard Worker		echo ${UNAME_MACHINE}-sni-sysv4
1180*2e9d4914SAndroid Build Coastguard Worker	else
1181*2e9d4914SAndroid Build Coastguard Worker		echo ns32k-sni-sysv
1182*2e9d4914SAndroid Build Coastguard Worker	fi
1183*2e9d4914SAndroid Build Coastguard Worker	exit ;;
1184*2e9d4914SAndroid Build Coastguard Worker    PENTIUM:*:4.0*:*)	# Unisys `ClearPath HMP IX 4000' SVR4/MP effort
1185*2e9d4914SAndroid Build Coastguard Worker			# says <[email protected]>
1186*2e9d4914SAndroid Build Coastguard Worker	echo i586-unisys-sysv4
1187*2e9d4914SAndroid Build Coastguard Worker	exit ;;
1188*2e9d4914SAndroid Build Coastguard Worker    *:UNIX_System_V:4*:FTX*)
1189*2e9d4914SAndroid Build Coastguard Worker	# From Gerald Hewes <[email protected]>.
1190*2e9d4914SAndroid Build Coastguard Worker	# How about differentiating between stratus architectures? -djm
1191*2e9d4914SAndroid Build Coastguard Worker	echo hppa1.1-stratus-sysv4
1192*2e9d4914SAndroid Build Coastguard Worker	exit ;;
1193*2e9d4914SAndroid Build Coastguard Worker    *:*:*:FTX*)
1194*2e9d4914SAndroid Build Coastguard Worker	# From [email protected].
1195*2e9d4914SAndroid Build Coastguard Worker	echo i860-stratus-sysv4
1196*2e9d4914SAndroid Build Coastguard Worker	exit ;;
1197*2e9d4914SAndroid Build Coastguard Worker    i*86:VOS:*:*)
1198*2e9d4914SAndroid Build Coastguard Worker	# From [email protected].
1199*2e9d4914SAndroid Build Coastguard Worker	echo ${UNAME_MACHINE}-stratus-vos
1200*2e9d4914SAndroid Build Coastguard Worker	exit ;;
1201*2e9d4914SAndroid Build Coastguard Worker    *:VOS:*:*)
1202*2e9d4914SAndroid Build Coastguard Worker	# From [email protected].
1203*2e9d4914SAndroid Build Coastguard Worker	echo hppa1.1-stratus-vos
1204*2e9d4914SAndroid Build Coastguard Worker	exit ;;
1205*2e9d4914SAndroid Build Coastguard Worker    mc68*:A/UX:*:*)
1206*2e9d4914SAndroid Build Coastguard Worker	echo m68k-apple-aux${UNAME_RELEASE}
1207*2e9d4914SAndroid Build Coastguard Worker	exit ;;
1208*2e9d4914SAndroid Build Coastguard Worker    news*:NEWS-OS:6*:*)
1209*2e9d4914SAndroid Build Coastguard Worker	echo mips-sony-newsos6
1210*2e9d4914SAndroid Build Coastguard Worker	exit ;;
1211*2e9d4914SAndroid Build Coastguard Worker    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
1212*2e9d4914SAndroid Build Coastguard Worker	if [ -d /usr/nec ]; then
1213*2e9d4914SAndroid Build Coastguard Worker		echo mips-nec-sysv${UNAME_RELEASE}
1214*2e9d4914SAndroid Build Coastguard Worker	else
1215*2e9d4914SAndroid Build Coastguard Worker		echo mips-unknown-sysv${UNAME_RELEASE}
1216*2e9d4914SAndroid Build Coastguard Worker	fi
1217*2e9d4914SAndroid Build Coastguard Worker	exit ;;
1218*2e9d4914SAndroid Build Coastguard Worker    BeBox:BeOS:*:*)	# BeOS running on hardware made by Be, PPC only.
1219*2e9d4914SAndroid Build Coastguard Worker	echo powerpc-be-beos
1220*2e9d4914SAndroid Build Coastguard Worker	exit ;;
1221*2e9d4914SAndroid Build Coastguard Worker    BeMac:BeOS:*:*)	# BeOS running on Mac or Mac clone, PPC only.
1222*2e9d4914SAndroid Build Coastguard Worker	echo powerpc-apple-beos
1223*2e9d4914SAndroid Build Coastguard Worker	exit ;;
1224*2e9d4914SAndroid Build Coastguard Worker    BePC:BeOS:*:*)	# BeOS running on Intel PC compatible.
1225*2e9d4914SAndroid Build Coastguard Worker	echo i586-pc-beos
1226*2e9d4914SAndroid Build Coastguard Worker	exit ;;
1227*2e9d4914SAndroid Build Coastguard Worker    BePC:Haiku:*:*)	# Haiku running on Intel PC compatible.
1228*2e9d4914SAndroid Build Coastguard Worker	echo i586-pc-haiku
1229*2e9d4914SAndroid Build Coastguard Worker	exit ;;
1230*2e9d4914SAndroid Build Coastguard Worker    x86_64:Haiku:*:*)
1231*2e9d4914SAndroid Build Coastguard Worker	echo x86_64-unknown-haiku
1232*2e9d4914SAndroid Build Coastguard Worker	exit ;;
1233*2e9d4914SAndroid Build Coastguard Worker    SX-4:SUPER-UX:*:*)
1234*2e9d4914SAndroid Build Coastguard Worker	echo sx4-nec-superux${UNAME_RELEASE}
1235*2e9d4914SAndroid Build Coastguard Worker	exit ;;
1236*2e9d4914SAndroid Build Coastguard Worker    SX-5:SUPER-UX:*:*)
1237*2e9d4914SAndroid Build Coastguard Worker	echo sx5-nec-superux${UNAME_RELEASE}
1238*2e9d4914SAndroid Build Coastguard Worker	exit ;;
1239*2e9d4914SAndroid Build Coastguard Worker    SX-6:SUPER-UX:*:*)
1240*2e9d4914SAndroid Build Coastguard Worker	echo sx6-nec-superux${UNAME_RELEASE}
1241*2e9d4914SAndroid Build Coastguard Worker	exit ;;
1242*2e9d4914SAndroid Build Coastguard Worker    SX-7:SUPER-UX:*:*)
1243*2e9d4914SAndroid Build Coastguard Worker	echo sx7-nec-superux${UNAME_RELEASE}
1244*2e9d4914SAndroid Build Coastguard Worker	exit ;;
1245*2e9d4914SAndroid Build Coastguard Worker    SX-8:SUPER-UX:*:*)
1246*2e9d4914SAndroid Build Coastguard Worker	echo sx8-nec-superux${UNAME_RELEASE}
1247*2e9d4914SAndroid Build Coastguard Worker	exit ;;
1248*2e9d4914SAndroid Build Coastguard Worker    SX-8R:SUPER-UX:*:*)
1249*2e9d4914SAndroid Build Coastguard Worker	echo sx8r-nec-superux${UNAME_RELEASE}
1250*2e9d4914SAndroid Build Coastguard Worker	exit ;;
1251*2e9d4914SAndroid Build Coastguard Worker    Power*:Rhapsody:*:*)
1252*2e9d4914SAndroid Build Coastguard Worker	echo powerpc-apple-rhapsody${UNAME_RELEASE}
1253*2e9d4914SAndroid Build Coastguard Worker	exit ;;
1254*2e9d4914SAndroid Build Coastguard Worker    *:Rhapsody:*:*)
1255*2e9d4914SAndroid Build Coastguard Worker	echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
1256*2e9d4914SAndroid Build Coastguard Worker	exit ;;
1257*2e9d4914SAndroid Build Coastguard Worker    *:Darwin:*:*)
1258*2e9d4914SAndroid Build Coastguard Worker	UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
1259*2e9d4914SAndroid Build Coastguard Worker	eval $set_cc_for_build
1260*2e9d4914SAndroid Build Coastguard Worker	if test "$UNAME_PROCESSOR" = unknown ; then
1261*2e9d4914SAndroid Build Coastguard Worker	    UNAME_PROCESSOR=powerpc
1262*2e9d4914SAndroid Build Coastguard Worker	fi
1263*2e9d4914SAndroid Build Coastguard Worker	if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then
1264*2e9d4914SAndroid Build Coastguard Worker	    if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
1265*2e9d4914SAndroid Build Coastguard Worker		if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
1266*2e9d4914SAndroid Build Coastguard Worker		    (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
1267*2e9d4914SAndroid Build Coastguard Worker		    grep IS_64BIT_ARCH >/dev/null
1268*2e9d4914SAndroid Build Coastguard Worker		then
1269*2e9d4914SAndroid Build Coastguard Worker		    case $UNAME_PROCESSOR in
1270*2e9d4914SAndroid Build Coastguard Worker			i386) UNAME_PROCESSOR=x86_64 ;;
1271*2e9d4914SAndroid Build Coastguard Worker			powerpc) UNAME_PROCESSOR=powerpc64 ;;
1272*2e9d4914SAndroid Build Coastguard Worker		    esac
1273*2e9d4914SAndroid Build Coastguard Worker		fi
1274*2e9d4914SAndroid Build Coastguard Worker	    fi
1275*2e9d4914SAndroid Build Coastguard Worker	elif test "$UNAME_PROCESSOR" = i386 ; then
1276*2e9d4914SAndroid Build Coastguard Worker	    # Avoid executing cc on OS X 10.9, as it ships with a stub
1277*2e9d4914SAndroid Build Coastguard Worker	    # that puts up a graphical alert prompting to install
1278*2e9d4914SAndroid Build Coastguard Worker	    # developer tools.  Any system running Mac OS X 10.7 or
1279*2e9d4914SAndroid Build Coastguard Worker	    # later (Darwin 11 and later) is required to have a 64-bit
1280*2e9d4914SAndroid Build Coastguard Worker	    # processor. This is not true of the ARM version of Darwin
1281*2e9d4914SAndroid Build Coastguard Worker	    # that Apple uses in portable devices.
1282*2e9d4914SAndroid Build Coastguard Worker	    UNAME_PROCESSOR=x86_64
1283*2e9d4914SAndroid Build Coastguard Worker	fi
1284*2e9d4914SAndroid Build Coastguard Worker	echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
1285*2e9d4914SAndroid Build Coastguard Worker	exit ;;
1286*2e9d4914SAndroid Build Coastguard Worker    *:procnto*:*:* | *:QNX:[0123456789]*:*)
1287*2e9d4914SAndroid Build Coastguard Worker	UNAME_PROCESSOR=`uname -p`
1288*2e9d4914SAndroid Build Coastguard Worker	if test "$UNAME_PROCESSOR" = "x86"; then
1289*2e9d4914SAndroid Build Coastguard Worker		UNAME_PROCESSOR=i386
1290*2e9d4914SAndroid Build Coastguard Worker		UNAME_MACHINE=pc
1291*2e9d4914SAndroid Build Coastguard Worker	fi
1292*2e9d4914SAndroid Build Coastguard Worker	echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
1293*2e9d4914SAndroid Build Coastguard Worker	exit ;;
1294*2e9d4914SAndroid Build Coastguard Worker    *:QNX:*:4*)
1295*2e9d4914SAndroid Build Coastguard Worker	echo i386-pc-qnx
1296*2e9d4914SAndroid Build Coastguard Worker	exit ;;
1297*2e9d4914SAndroid Build Coastguard Worker    NEO-?:NONSTOP_KERNEL:*:*)
1298*2e9d4914SAndroid Build Coastguard Worker	echo neo-tandem-nsk${UNAME_RELEASE}
1299*2e9d4914SAndroid Build Coastguard Worker	exit ;;
1300*2e9d4914SAndroid Build Coastguard Worker    NSE-*:NONSTOP_KERNEL:*:*)
1301*2e9d4914SAndroid Build Coastguard Worker	echo nse-tandem-nsk${UNAME_RELEASE}
1302*2e9d4914SAndroid Build Coastguard Worker	exit ;;
1303*2e9d4914SAndroid Build Coastguard Worker    NSR-?:NONSTOP_KERNEL:*:*)
1304*2e9d4914SAndroid Build Coastguard Worker	echo nsr-tandem-nsk${UNAME_RELEASE}
1305*2e9d4914SAndroid Build Coastguard Worker	exit ;;
1306*2e9d4914SAndroid Build Coastguard Worker    *:NonStop-UX:*:*)
1307*2e9d4914SAndroid Build Coastguard Worker	echo mips-compaq-nonstopux
1308*2e9d4914SAndroid Build Coastguard Worker	exit ;;
1309*2e9d4914SAndroid Build Coastguard Worker    BS2000:POSIX*:*:*)
1310*2e9d4914SAndroid Build Coastguard Worker	echo bs2000-siemens-sysv
1311*2e9d4914SAndroid Build Coastguard Worker	exit ;;
1312*2e9d4914SAndroid Build Coastguard Worker    DS/*:UNIX_System_V:*:*)
1313*2e9d4914SAndroid Build Coastguard Worker	echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
1314*2e9d4914SAndroid Build Coastguard Worker	exit ;;
1315*2e9d4914SAndroid Build Coastguard Worker    *:Plan9:*:*)
1316*2e9d4914SAndroid Build Coastguard Worker	# "uname -m" is not consistent, so use $cputype instead. 386
1317*2e9d4914SAndroid Build Coastguard Worker	# is converted to i386 for consistency with other x86
1318*2e9d4914SAndroid Build Coastguard Worker	# operating systems.
1319*2e9d4914SAndroid Build Coastguard Worker	if test "$cputype" = "386"; then
1320*2e9d4914SAndroid Build Coastguard Worker	    UNAME_MACHINE=i386
1321*2e9d4914SAndroid Build Coastguard Worker	else
1322*2e9d4914SAndroid Build Coastguard Worker	    UNAME_MACHINE="$cputype"
1323*2e9d4914SAndroid Build Coastguard Worker	fi
1324*2e9d4914SAndroid Build Coastguard Worker	echo ${UNAME_MACHINE}-unknown-plan9
1325*2e9d4914SAndroid Build Coastguard Worker	exit ;;
1326*2e9d4914SAndroid Build Coastguard Worker    *:TOPS-10:*:*)
1327*2e9d4914SAndroid Build Coastguard Worker	echo pdp10-unknown-tops10
1328*2e9d4914SAndroid Build Coastguard Worker	exit ;;
1329*2e9d4914SAndroid Build Coastguard Worker    *:TENEX:*:*)
1330*2e9d4914SAndroid Build Coastguard Worker	echo pdp10-unknown-tenex
1331*2e9d4914SAndroid Build Coastguard Worker	exit ;;
1332*2e9d4914SAndroid Build Coastguard Worker    KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
1333*2e9d4914SAndroid Build Coastguard Worker	echo pdp10-dec-tops20
1334*2e9d4914SAndroid Build Coastguard Worker	exit ;;
1335*2e9d4914SAndroid Build Coastguard Worker    XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
1336*2e9d4914SAndroid Build Coastguard Worker	echo pdp10-xkl-tops20
1337*2e9d4914SAndroid Build Coastguard Worker	exit ;;
1338*2e9d4914SAndroid Build Coastguard Worker    *:TOPS-20:*:*)
1339*2e9d4914SAndroid Build Coastguard Worker	echo pdp10-unknown-tops20
1340*2e9d4914SAndroid Build Coastguard Worker	exit ;;
1341*2e9d4914SAndroid Build Coastguard Worker    *:ITS:*:*)
1342*2e9d4914SAndroid Build Coastguard Worker	echo pdp10-unknown-its
1343*2e9d4914SAndroid Build Coastguard Worker	exit ;;
1344*2e9d4914SAndroid Build Coastguard Worker    SEI:*:*:SEIUX)
1345*2e9d4914SAndroid Build Coastguard Worker	echo mips-sei-seiux${UNAME_RELEASE}
1346*2e9d4914SAndroid Build Coastguard Worker	exit ;;
1347*2e9d4914SAndroid Build Coastguard Worker    *:DragonFly:*:*)
1348*2e9d4914SAndroid Build Coastguard Worker	echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
1349*2e9d4914SAndroid Build Coastguard Worker	exit ;;
1350*2e9d4914SAndroid Build Coastguard Worker    *:*VMS:*:*)
1351*2e9d4914SAndroid Build Coastguard Worker	UNAME_MACHINE=`(uname -p) 2>/dev/null`
1352*2e9d4914SAndroid Build Coastguard Worker	case "${UNAME_MACHINE}" in
1353*2e9d4914SAndroid Build Coastguard Worker	    A*) echo alpha-dec-vms ; exit ;;
1354*2e9d4914SAndroid Build Coastguard Worker	    I*) echo ia64-dec-vms ; exit ;;
1355*2e9d4914SAndroid Build Coastguard Worker	    V*) echo vax-dec-vms ; exit ;;
1356*2e9d4914SAndroid Build Coastguard Worker	esac ;;
1357*2e9d4914SAndroid Build Coastguard Worker    *:XENIX:*:SysV)
1358*2e9d4914SAndroid Build Coastguard Worker	echo i386-pc-xenix
1359*2e9d4914SAndroid Build Coastguard Worker	exit ;;
1360*2e9d4914SAndroid Build Coastguard Worker    i*86:skyos:*:*)
1361*2e9d4914SAndroid Build Coastguard Worker	echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
1362*2e9d4914SAndroid Build Coastguard Worker	exit ;;
1363*2e9d4914SAndroid Build Coastguard Worker    i*86:rdos:*:*)
1364*2e9d4914SAndroid Build Coastguard Worker	echo ${UNAME_MACHINE}-pc-rdos
1365*2e9d4914SAndroid Build Coastguard Worker	exit ;;
1366*2e9d4914SAndroid Build Coastguard Worker    i*86:AROS:*:*)
1367*2e9d4914SAndroid Build Coastguard Worker	echo ${UNAME_MACHINE}-pc-aros
1368*2e9d4914SAndroid Build Coastguard Worker	exit ;;
1369*2e9d4914SAndroid Build Coastguard Worker    x86_64:VMkernel:*:*)
1370*2e9d4914SAndroid Build Coastguard Worker	echo ${UNAME_MACHINE}-unknown-esx
1371*2e9d4914SAndroid Build Coastguard Worker	exit ;;
1372*2e9d4914SAndroid Build Coastguard Workeresac
1373*2e9d4914SAndroid Build Coastguard Worker
1374*2e9d4914SAndroid Build Coastguard Workereval $set_cc_for_build
1375*2e9d4914SAndroid Build Coastguard Workercat >$dummy.c <<EOF
1376*2e9d4914SAndroid Build Coastguard Worker#ifdef _SEQUENT_
1377*2e9d4914SAndroid Build Coastguard Worker# include <sys/types.h>
1378*2e9d4914SAndroid Build Coastguard Worker# include <sys/utsname.h>
1379*2e9d4914SAndroid Build Coastguard Worker#endif
1380*2e9d4914SAndroid Build Coastguard Workermain ()
1381*2e9d4914SAndroid Build Coastguard Worker{
1382*2e9d4914SAndroid Build Coastguard Worker#if defined (sony)
1383*2e9d4914SAndroid Build Coastguard Worker#if defined (MIPSEB)
1384*2e9d4914SAndroid Build Coastguard Worker  /* BFD wants "bsd" instead of "newsos".  Perhaps BFD should be changed,
1385*2e9d4914SAndroid Build Coastguard Worker     I don't know....  */
1386*2e9d4914SAndroid Build Coastguard Worker  printf ("mips-sony-bsd\n"); exit (0);
1387*2e9d4914SAndroid Build Coastguard Worker#else
1388*2e9d4914SAndroid Build Coastguard Worker#include <sys/param.h>
1389*2e9d4914SAndroid Build Coastguard Worker  printf ("m68k-sony-newsos%s\n",
1390*2e9d4914SAndroid Build Coastguard Worker#ifdef NEWSOS4
1391*2e9d4914SAndroid Build Coastguard Worker	"4"
1392*2e9d4914SAndroid Build Coastguard Worker#else
1393*2e9d4914SAndroid Build Coastguard Worker	""
1394*2e9d4914SAndroid Build Coastguard Worker#endif
1395*2e9d4914SAndroid Build Coastguard Worker	); exit (0);
1396*2e9d4914SAndroid Build Coastguard Worker#endif
1397*2e9d4914SAndroid Build Coastguard Worker#endif
1398*2e9d4914SAndroid Build Coastguard Worker
1399*2e9d4914SAndroid Build Coastguard Worker#if defined (__arm) && defined (__acorn) && defined (__unix)
1400*2e9d4914SAndroid Build Coastguard Worker  printf ("arm-acorn-riscix\n"); exit (0);
1401*2e9d4914SAndroid Build Coastguard Worker#endif
1402*2e9d4914SAndroid Build Coastguard Worker
1403*2e9d4914SAndroid Build Coastguard Worker#if defined (hp300) && !defined (hpux)
1404*2e9d4914SAndroid Build Coastguard Worker  printf ("m68k-hp-bsd\n"); exit (0);
1405*2e9d4914SAndroid Build Coastguard Worker#endif
1406*2e9d4914SAndroid Build Coastguard Worker
1407*2e9d4914SAndroid Build Coastguard Worker#if defined (NeXT)
1408*2e9d4914SAndroid Build Coastguard Worker#if !defined (__ARCHITECTURE__)
1409*2e9d4914SAndroid Build Coastguard Worker#define __ARCHITECTURE__ "m68k"
1410*2e9d4914SAndroid Build Coastguard Worker#endif
1411*2e9d4914SAndroid Build Coastguard Worker  int version;
1412*2e9d4914SAndroid Build Coastguard Worker  version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
1413*2e9d4914SAndroid Build Coastguard Worker  if (version < 4)
1414*2e9d4914SAndroid Build Coastguard Worker    printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
1415*2e9d4914SAndroid Build Coastguard Worker  else
1416*2e9d4914SAndroid Build Coastguard Worker    printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
1417*2e9d4914SAndroid Build Coastguard Worker  exit (0);
1418*2e9d4914SAndroid Build Coastguard Worker#endif
1419*2e9d4914SAndroid Build Coastguard Worker
1420*2e9d4914SAndroid Build Coastguard Worker#if defined (MULTIMAX) || defined (n16)
1421*2e9d4914SAndroid Build Coastguard Worker#if defined (UMAXV)
1422*2e9d4914SAndroid Build Coastguard Worker  printf ("ns32k-encore-sysv\n"); exit (0);
1423*2e9d4914SAndroid Build Coastguard Worker#else
1424*2e9d4914SAndroid Build Coastguard Worker#if defined (CMU)
1425*2e9d4914SAndroid Build Coastguard Worker  printf ("ns32k-encore-mach\n"); exit (0);
1426*2e9d4914SAndroid Build Coastguard Worker#else
1427*2e9d4914SAndroid Build Coastguard Worker  printf ("ns32k-encore-bsd\n"); exit (0);
1428*2e9d4914SAndroid Build Coastguard Worker#endif
1429*2e9d4914SAndroid Build Coastguard Worker#endif
1430*2e9d4914SAndroid Build Coastguard Worker#endif
1431*2e9d4914SAndroid Build Coastguard Worker
1432*2e9d4914SAndroid Build Coastguard Worker#if defined (__386BSD__)
1433*2e9d4914SAndroid Build Coastguard Worker  printf ("i386-pc-bsd\n"); exit (0);
1434*2e9d4914SAndroid Build Coastguard Worker#endif
1435*2e9d4914SAndroid Build Coastguard Worker
1436*2e9d4914SAndroid Build Coastguard Worker#if defined (sequent)
1437*2e9d4914SAndroid Build Coastguard Worker#if defined (i386)
1438*2e9d4914SAndroid Build Coastguard Worker  printf ("i386-sequent-dynix\n"); exit (0);
1439*2e9d4914SAndroid Build Coastguard Worker#endif
1440*2e9d4914SAndroid Build Coastguard Worker#if defined (ns32000)
1441*2e9d4914SAndroid Build Coastguard Worker  printf ("ns32k-sequent-dynix\n"); exit (0);
1442*2e9d4914SAndroid Build Coastguard Worker#endif
1443*2e9d4914SAndroid Build Coastguard Worker#endif
1444*2e9d4914SAndroid Build Coastguard Worker
1445*2e9d4914SAndroid Build Coastguard Worker#if defined (_SEQUENT_)
1446*2e9d4914SAndroid Build Coastguard Worker    struct utsname un;
1447*2e9d4914SAndroid Build Coastguard Worker
1448*2e9d4914SAndroid Build Coastguard Worker    uname(&un);
1449*2e9d4914SAndroid Build Coastguard Worker
1450*2e9d4914SAndroid Build Coastguard Worker    if (strncmp(un.version, "V2", 2) == 0) {
1451*2e9d4914SAndroid Build Coastguard Worker	printf ("i386-sequent-ptx2\n"); exit (0);
1452*2e9d4914SAndroid Build Coastguard Worker    }
1453*2e9d4914SAndroid Build Coastguard Worker    if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
1454*2e9d4914SAndroid Build Coastguard Worker	printf ("i386-sequent-ptx1\n"); exit (0);
1455*2e9d4914SAndroid Build Coastguard Worker    }
1456*2e9d4914SAndroid Build Coastguard Worker    printf ("i386-sequent-ptx\n"); exit (0);
1457*2e9d4914SAndroid Build Coastguard Worker
1458*2e9d4914SAndroid Build Coastguard Worker#endif
1459*2e9d4914SAndroid Build Coastguard Worker
1460*2e9d4914SAndroid Build Coastguard Worker#if defined (vax)
1461*2e9d4914SAndroid Build Coastguard Worker# if !defined (ultrix)
1462*2e9d4914SAndroid Build Coastguard Worker#  include <sys/param.h>
1463*2e9d4914SAndroid Build Coastguard Worker#  if defined (BSD)
1464*2e9d4914SAndroid Build Coastguard Worker#   if BSD == 43
1465*2e9d4914SAndroid Build Coastguard Worker      printf ("vax-dec-bsd4.3\n"); exit (0);
1466*2e9d4914SAndroid Build Coastguard Worker#   else
1467*2e9d4914SAndroid Build Coastguard Worker#    if BSD == 199006
1468*2e9d4914SAndroid Build Coastguard Worker      printf ("vax-dec-bsd4.3reno\n"); exit (0);
1469*2e9d4914SAndroid Build Coastguard Worker#    else
1470*2e9d4914SAndroid Build Coastguard Worker      printf ("vax-dec-bsd\n"); exit (0);
1471*2e9d4914SAndroid Build Coastguard Worker#    endif
1472*2e9d4914SAndroid Build Coastguard Worker#   endif
1473*2e9d4914SAndroid Build Coastguard Worker#  else
1474*2e9d4914SAndroid Build Coastguard Worker    printf ("vax-dec-bsd\n"); exit (0);
1475*2e9d4914SAndroid Build Coastguard Worker#  endif
1476*2e9d4914SAndroid Build Coastguard Worker# else
1477*2e9d4914SAndroid Build Coastguard Worker    printf ("vax-dec-ultrix\n"); exit (0);
1478*2e9d4914SAndroid Build Coastguard Worker# endif
1479*2e9d4914SAndroid Build Coastguard Worker#endif
1480*2e9d4914SAndroid Build Coastguard Worker
1481*2e9d4914SAndroid Build Coastguard Worker#if defined (alliant) && defined (i860)
1482*2e9d4914SAndroid Build Coastguard Worker  printf ("i860-alliant-bsd\n"); exit (0);
1483*2e9d4914SAndroid Build Coastguard Worker#endif
1484*2e9d4914SAndroid Build Coastguard Worker
1485*2e9d4914SAndroid Build Coastguard Worker  exit (1);
1486*2e9d4914SAndroid Build Coastguard Worker}
1487*2e9d4914SAndroid Build Coastguard WorkerEOF
1488*2e9d4914SAndroid Build Coastguard Worker
1489*2e9d4914SAndroid Build Coastguard Worker$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
1490*2e9d4914SAndroid Build Coastguard Worker	{ echo "$SYSTEM_NAME"; exit; }
1491*2e9d4914SAndroid Build Coastguard Worker
1492*2e9d4914SAndroid Build Coastguard Worker# Apollos put the system type in the environment.
1493*2e9d4914SAndroid Build Coastguard Worker
1494*2e9d4914SAndroid Build Coastguard Workertest -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
1495*2e9d4914SAndroid Build Coastguard Worker
1496*2e9d4914SAndroid Build Coastguard Worker# Convex versions that predate uname can use getsysinfo(1)
1497*2e9d4914SAndroid Build Coastguard Worker
1498*2e9d4914SAndroid Build Coastguard Workerif [ -x /usr/convex/getsysinfo ]
1499*2e9d4914SAndroid Build Coastguard Workerthen
1500*2e9d4914SAndroid Build Coastguard Worker    case `getsysinfo -f cpu_type` in
1501*2e9d4914SAndroid Build Coastguard Worker    c1*)
1502*2e9d4914SAndroid Build Coastguard Worker	echo c1-convex-bsd
1503*2e9d4914SAndroid Build Coastguard Worker	exit ;;
1504*2e9d4914SAndroid Build Coastguard Worker    c2*)
1505*2e9d4914SAndroid Build Coastguard Worker	if getsysinfo -f scalar_acc
1506*2e9d4914SAndroid Build Coastguard Worker	then echo c32-convex-bsd
1507*2e9d4914SAndroid Build Coastguard Worker	else echo c2-convex-bsd
1508*2e9d4914SAndroid Build Coastguard Worker	fi
1509*2e9d4914SAndroid Build Coastguard Worker	exit ;;
1510*2e9d4914SAndroid Build Coastguard Worker    c34*)
1511*2e9d4914SAndroid Build Coastguard Worker	echo c34-convex-bsd
1512*2e9d4914SAndroid Build Coastguard Worker	exit ;;
1513*2e9d4914SAndroid Build Coastguard Worker    c38*)
1514*2e9d4914SAndroid Build Coastguard Worker	echo c38-convex-bsd
1515*2e9d4914SAndroid Build Coastguard Worker	exit ;;
1516*2e9d4914SAndroid Build Coastguard Worker    c4*)
1517*2e9d4914SAndroid Build Coastguard Worker	echo c4-convex-bsd
1518*2e9d4914SAndroid Build Coastguard Worker	exit ;;
1519*2e9d4914SAndroid Build Coastguard Worker    esac
1520*2e9d4914SAndroid Build Coastguard Workerfi
1521*2e9d4914SAndroid Build Coastguard Worker
1522*2e9d4914SAndroid Build Coastguard Workercat >&2 <<EOF
1523*2e9d4914SAndroid Build Coastguard Worker$0: unable to guess system type
1524*2e9d4914SAndroid Build Coastguard Worker
1525*2e9d4914SAndroid Build Coastguard WorkerThis script, last modified $timestamp, has failed to recognize
1526*2e9d4914SAndroid Build Coastguard Workerthe operating system you are using. It is advised that you
1527*2e9d4914SAndroid Build Coastguard Workerdownload the most up to date version of the config scripts from
1528*2e9d4914SAndroid Build Coastguard Worker
1529*2e9d4914SAndroid Build Coastguard Worker  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
1530*2e9d4914SAndroid Build Coastguard Workerand
1531*2e9d4914SAndroid Build Coastguard Worker  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
1532*2e9d4914SAndroid Build Coastguard Worker
1533*2e9d4914SAndroid Build Coastguard WorkerIf the version you run ($0) is already up to date, please
1534*2e9d4914SAndroid Build Coastguard Workersend the following data and any information you think might be
1535*2e9d4914SAndroid Build Coastguard Workerpertinent to <[email protected]> in order to provide the needed
1536*2e9d4914SAndroid Build Coastguard Workerinformation to handle your system.
1537*2e9d4914SAndroid Build Coastguard Worker
1538*2e9d4914SAndroid Build Coastguard Workerconfig.guess timestamp = $timestamp
1539*2e9d4914SAndroid Build Coastguard Worker
1540*2e9d4914SAndroid Build Coastguard Workeruname -m = `(uname -m) 2>/dev/null || echo unknown`
1541*2e9d4914SAndroid Build Coastguard Workeruname -r = `(uname -r) 2>/dev/null || echo unknown`
1542*2e9d4914SAndroid Build Coastguard Workeruname -s = `(uname -s) 2>/dev/null || echo unknown`
1543*2e9d4914SAndroid Build Coastguard Workeruname -v = `(uname -v) 2>/dev/null || echo unknown`
1544*2e9d4914SAndroid Build Coastguard Worker
1545*2e9d4914SAndroid Build Coastguard Worker/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
1546*2e9d4914SAndroid Build Coastguard Worker/bin/uname -X     = `(/bin/uname -X) 2>/dev/null`
1547*2e9d4914SAndroid Build Coastguard Worker
1548*2e9d4914SAndroid Build Coastguard Workerhostinfo               = `(hostinfo) 2>/dev/null`
1549*2e9d4914SAndroid Build Coastguard Worker/bin/universe          = `(/bin/universe) 2>/dev/null`
1550*2e9d4914SAndroid Build Coastguard Worker/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null`
1551*2e9d4914SAndroid Build Coastguard Worker/bin/arch              = `(/bin/arch) 2>/dev/null`
1552*2e9d4914SAndroid Build Coastguard Worker/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`
1553*2e9d4914SAndroid Build Coastguard Worker/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
1554*2e9d4914SAndroid Build Coastguard Worker
1555*2e9d4914SAndroid Build Coastguard WorkerUNAME_MACHINE = ${UNAME_MACHINE}
1556*2e9d4914SAndroid Build Coastguard WorkerUNAME_RELEASE = ${UNAME_RELEASE}
1557*2e9d4914SAndroid Build Coastguard WorkerUNAME_SYSTEM  = ${UNAME_SYSTEM}
1558*2e9d4914SAndroid Build Coastguard WorkerUNAME_VERSION = ${UNAME_VERSION}
1559*2e9d4914SAndroid Build Coastguard WorkerEOF
1560*2e9d4914SAndroid Build Coastguard Worker
1561*2e9d4914SAndroid Build Coastguard Workerexit 1
1562*2e9d4914SAndroid Build Coastguard Worker
1563*2e9d4914SAndroid Build Coastguard Worker# Local variables:
1564*2e9d4914SAndroid Build Coastguard Worker# eval: (add-hook 'write-file-hooks 'time-stamp)
1565*2e9d4914SAndroid Build Coastguard Worker# time-stamp-start: "timestamp='"
1566*2e9d4914SAndroid Build Coastguard Worker# time-stamp-format: "%:y-%02m-%02d"
1567*2e9d4914SAndroid Build Coastguard Worker# time-stamp-end: "'"
1568*2e9d4914SAndroid Build Coastguard Worker# End:
1569