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