1301ea0f4Smrg#! /bin/sh
2301ea0f4Smrg# Attempt to guess a canonical system name.
3d94624a0Smrg#   Copyright 1992-2015 Free Software Foundation, Inc.
4301ea0f4Smrg
5d94624a0Smrgtimestamp='2015-08-20'
6301ea0f4Smrg
7301ea0f4Smrg# This file is free software; you can redistribute it and/or modify it
8301ea0f4Smrg# under the terms of the GNU General Public License as published by
918552c8aSmrg# the Free Software Foundation; either version 3 of the License, or
10301ea0f4Smrg# (at your option) any later version.
11301ea0f4Smrg#
12301ea0f4Smrg# This program is distributed in the hope that it will be useful, but
13301ea0f4Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
14301ea0f4Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15301ea0f4Smrg# General Public License for more details.
16301ea0f4Smrg#
17301ea0f4Smrg# You should have received a copy of the GNU General Public License
1818552c8aSmrg# along with this program; if not, see <http://www.gnu.org/licenses/>.
19301ea0f4Smrg#
20301ea0f4Smrg# As a special exception to the GNU General Public License, if you
21301ea0f4Smrg# distribute this file as part of a program that contains a
22301ea0f4Smrg# configuration script generated by Autoconf, you may include it under
2318552c8aSmrg# the same distribution terms that you use for the rest of that
2418552c8aSmrg# program.  This Exception is an additional permission under section 7
2518552c8aSmrg# of the GNU General Public License, version 3 ("GPLv3").
26301ea0f4Smrg#
2797ee6427Smrg# Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
28301ea0f4Smrg#
29213fdd94Smrg# You can get the latest version of this script from:
30d94624a0Smrg# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
3118552c8aSmrg#
3297ee6427Smrg# Please send patches to <config-patches@gnu.org>.
3318552c8aSmrg
34301ea0f4Smrg
35301ea0f4Smrgme=`echo "$0" | sed -e 's,.*/,,'`
36301ea0f4Smrg
37301ea0f4Smrgusage="\
38301ea0f4SmrgUsage: $0 [OPTION]
39301ea0f4Smrg
40301ea0f4SmrgOutput the configuration name of the system \`$me' is run on.
41301ea0f4Smrg
42301ea0f4SmrgOperation modes:
43301ea0f4Smrg  -h, --help         print this help, then exit
44301ea0f4Smrg  -t, --time-stamp   print date of last modification, then exit
45301ea0f4Smrg  -v, --version      print version number, then exit
46301ea0f4Smrg
47301ea0f4SmrgReport bugs and patches to <config-patches@gnu.org>."
48301ea0f4Smrg
49301ea0f4Smrgversion="\
50301ea0f4SmrgGNU config.guess ($timestamp)
51301ea0f4Smrg
52301ea0f4SmrgOriginally written by Per Bothner.
53d94624a0SmrgCopyright 1992-2015 Free Software Foundation, Inc.
54301ea0f4Smrg
55301ea0f4SmrgThis is free software; see the source for copying conditions.  There is NO
56301ea0f4Smrgwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
57301ea0f4Smrg
58301ea0f4Smrghelp="
59301ea0f4SmrgTry \`$me --help' for more information."
60301ea0f4Smrg
61301ea0f4Smrg# Parse command line
62301ea0f4Smrgwhile test $# -gt 0 ; do
63301ea0f4Smrg  case $1 in
64301ea0f4Smrg    --time-stamp | --time* | -t )
650cc67336Smrg       echo "$timestamp" ; exit ;;
66301ea0f4Smrg    --version | -v )
670cc67336Smrg       echo "$version" ; exit ;;
68301ea0f4Smrg    --help | --h* | -h )
690cc67336Smrg       echo "$usage"; exit ;;
70301ea0f4Smrg    -- )     # Stop option processing
71301ea0f4Smrg       shift; break ;;
72301ea0f4Smrg    - )	# Use stdin as input.
73301ea0f4Smrg       break ;;
74301ea0f4Smrg    -* )
75301ea0f4Smrg       echo "$me: invalid option $1$help" >&2
76301ea0f4Smrg       exit 1 ;;
77301ea0f4Smrg    * )
78301ea0f4Smrg       break ;;
79301ea0f4Smrg  esac
80301ea0f4Smrgdone
81301ea0f4Smrg
82301ea0f4Smrgif test $# != 0; then
83301ea0f4Smrg  echo "$me: too many arguments$help" >&2
84301ea0f4Smrg  exit 1
85301ea0f4Smrgfi
86301ea0f4Smrg
87301ea0f4Smrgtrap 'exit 1' 1 2 15
88301ea0f4Smrg
89301ea0f4Smrg# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
90301ea0f4Smrg# compiler to aid in system detection is discouraged as it requires
91301ea0f4Smrg# temporary files to be created and, as you can see below, it is a
92301ea0f4Smrg# headache to deal with in a portable fashion.
93301ea0f4Smrg
94301ea0f4Smrg# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
95301ea0f4Smrg# use `HOST_CC' if defined, but it is deprecated.
96301ea0f4Smrg
97301ea0f4Smrg# Portable tmp directory creation inspired by the Autoconf team.
98301ea0f4Smrg
99301ea0f4Smrgset_cc_for_build='
100301ea0f4Smrgtrap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
101301ea0f4Smrgtrap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
102301ea0f4Smrg: ${TMPDIR=/tmp} ;
1030cc67336Smrg { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
104301ea0f4Smrg { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
105301ea0f4Smrg { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
106301ea0f4Smrg { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
107301ea0f4Smrgdummy=$tmp/dummy ;
108301ea0f4Smrgtmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
109301ea0f4Smrgcase $CC_FOR_BUILD,$HOST_CC,$CC in
110301ea0f4Smrg ,,)    echo "int x;" > $dummy.c ;
111301ea0f4Smrg	for c in cc gcc c89 c99 ; do
112301ea0f4Smrg	  if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
113301ea0f4Smrg	     CC_FOR_BUILD="$c"; break ;
114301ea0f4Smrg	  fi ;
115301ea0f4Smrg	done ;
116301ea0f4Smrg	if test x"$CC_FOR_BUILD" = x ; then
117301ea0f4Smrg	  CC_FOR_BUILD=no_compiler_found ;
118301ea0f4Smrg	fi
119301ea0f4Smrg	;;
120301ea0f4Smrg ,,*)   CC_FOR_BUILD=$CC ;;
121301ea0f4Smrg ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
1220cc67336Smrgesac ; set_cc_for_build= ;'
123301ea0f4Smrg
124301ea0f4Smrg# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
125301ea0f4Smrg# (ghazi@noc.rutgers.edu 1994-08-24)
126301ea0f4Smrgif (test -f /.attbin/uname) >/dev/null 2>&1 ; then
127301ea0f4Smrg	PATH=$PATH:/.attbin ; export PATH
128301ea0f4Smrgfi
129301ea0f4Smrg
130301ea0f4SmrgUNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
131301ea0f4SmrgUNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
132301ea0f4SmrgUNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
133301ea0f4SmrgUNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
134301ea0f4Smrg
13518552c8aSmrgcase "${UNAME_SYSTEM}" in
13618552c8aSmrgLinux|GNU|GNU/*)
13718552c8aSmrg	# If the system lacks a compiler, then just pick glibc.
13818552c8aSmrg	# We could probably try harder.
13918552c8aSmrg	LIBC=gnu
14018552c8aSmrg
14118552c8aSmrg	eval $set_cc_for_build
14218552c8aSmrg	cat <<-EOF > $dummy.c
14318552c8aSmrg	#include <features.h>
14418552c8aSmrg	#if defined(__UCLIBC__)
14518552c8aSmrg	LIBC=uclibc
14618552c8aSmrg	#elif defined(__dietlibc__)
14718552c8aSmrg	LIBC=dietlibc
14818552c8aSmrg	#else
14918552c8aSmrg	LIBC=gnu
15018552c8aSmrg	#endif
15118552c8aSmrg	EOF
15218552c8aSmrg	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`
15318552c8aSmrg	;;
15418552c8aSmrgesac
15518552c8aSmrg
156301ea0f4Smrg# Note: order is significant - the case branches are not exclusive.
157301ea0f4Smrg
158301ea0f4Smrgcase "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
159301ea0f4Smrg    *:NetBSD:*:*)
160301ea0f4Smrg	# NetBSD (nbsd) targets should (where applicable) match one or
161213fdd94Smrg	# more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
162301ea0f4Smrg	# *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
163301ea0f4Smrg	# switched to ELF, *-*-netbsd* would select the old
164301ea0f4Smrg	# object file format.  This provides both forward
165301ea0f4Smrg	# compatibility and a consistent mechanism for selecting the
166301ea0f4Smrg	# object file format.
167301ea0f4Smrg	#
168301ea0f4Smrg	# Note: NetBSD doesn't particularly care about the vendor
169301ea0f4Smrg	# portion of the name.  We always set it to "unknown".
170301ea0f4Smrg	sysctl="sysctl -n hw.machine_arch"
17197ee6427Smrg	UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \
17297ee6427Smrg	    /sbin/$sysctl 2>/dev/null || \
17397ee6427Smrg	    /usr/sbin/$sysctl 2>/dev/null || \
17497ee6427Smrg	    echo unknown)`
175301ea0f4Smrg	case "${UNAME_MACHINE_ARCH}" in
176301ea0f4Smrg	    armeb) machine=armeb-unknown ;;
177301ea0f4Smrg	    arm*) machine=arm-unknown ;;
178301ea0f4Smrg	    sh3el) machine=shl-unknown ;;
179301ea0f4Smrg	    sh3eb) machine=sh-unknown ;;
1800cc67336Smrg	    sh5el) machine=sh5le-unknown ;;
18197ee6427Smrg	    earmv*)
18297ee6427Smrg		arch=`echo ${UNAME_MACHINE_ARCH} | sed -e 's,^e\(armv[0-9]\).*$,\1,'`
18397ee6427Smrg		endian=`echo ${UNAME_MACHINE_ARCH} | sed -ne 's,^.*\(eb\)$,\1,p'`
18497ee6427Smrg		machine=${arch}${endian}-unknown
18597ee6427Smrg		;;
186301ea0f4Smrg	    *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
187301ea0f4Smrg	esac
188301ea0f4Smrg	# The Operating System including object format, if it has switched
189301ea0f4Smrg	# to ELF recently, or will in the future.
190301ea0f4Smrg	case "${UNAME_MACHINE_ARCH}" in
19197ee6427Smrg	    arm*|earm*|i386|m68k|ns32k|sh3*|sparc|vax)
192301ea0f4Smrg		eval $set_cc_for_build
193301ea0f4Smrg		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
194213fdd94Smrg			| grep -q __ELF__
195301ea0f4Smrg		then
196301ea0f4Smrg		    # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
197301ea0f4Smrg		    # Return netbsd for either.  FIX?
198301ea0f4Smrg		    os=netbsd
199301ea0f4Smrg		else
200301ea0f4Smrg		    os=netbsdelf
201301ea0f4Smrg		fi
202301ea0f4Smrg		;;
203301ea0f4Smrg	    *)
204213fdd94Smrg		os=netbsd
205301ea0f4Smrg		;;
206301ea0f4Smrg	esac
20797ee6427Smrg	# Determine ABI tags.
20897ee6427Smrg	case "${UNAME_MACHINE_ARCH}" in
20997ee6427Smrg	    earm*)
21097ee6427Smrg		expr='s/^earmv[0-9]/-eabi/;s/eb$//'
21197ee6427Smrg		abi=`echo ${UNAME_MACHINE_ARCH} | sed -e "$expr"`
21297ee6427Smrg		;;
21397ee6427Smrg	esac
214301ea0f4Smrg	# The OS release
215301ea0f4Smrg	# Debian GNU/NetBSD machines have a different userland, and
216301ea0f4Smrg	# thus, need a distinct triplet. However, they do not need
217301ea0f4Smrg	# kernel version information, so it can be replaced with a
218301ea0f4Smrg	# suitable tag, in the style of linux-gnu.
219301ea0f4Smrg	case "${UNAME_VERSION}" in
220301ea0f4Smrg	    Debian*)
221301ea0f4Smrg		release='-gnu'
222301ea0f4Smrg		;;
223301ea0f4Smrg	    *)
22497ee6427Smrg		release=`echo ${UNAME_RELEASE} | sed -e 's/[-_].*//' | cut -d. -f1,2`
225301ea0f4Smrg		;;
226301ea0f4Smrg	esac
227301ea0f4Smrg	# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
228301ea0f4Smrg	# contains redundant information, the shorter form:
229301ea0f4Smrg	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
23097ee6427Smrg	echo "${machine}-${os}${release}${abi}"
2310cc67336Smrg	exit ;;
23218552c8aSmrg    *:Bitrig:*:*)
23318552c8aSmrg	UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
23418552c8aSmrg	echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE}
23518552c8aSmrg	exit ;;
236301ea0f4Smrg    *:OpenBSD:*:*)
2370cc67336Smrg	UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
2380cc67336Smrg	echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
2390cc67336Smrg	exit ;;
2400cc67336Smrg    *:ekkoBSD:*:*)
2410cc67336Smrg	echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
2420cc67336Smrg	exit ;;
2430cc67336Smrg    *:SolidBSD:*:*)
2440cc67336Smrg	echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
2450cc67336Smrg	exit ;;
2460cc67336Smrg    macppc:MirBSD:*:*)
2470cc67336Smrg	echo powerpc-unknown-mirbsd${UNAME_RELEASE}
2480cc67336Smrg	exit ;;
2490cc67336Smrg    *:MirBSD:*:*)
2500cc67336Smrg	echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
2510cc67336Smrg	exit ;;
25297ee6427Smrg    *:Sortix:*:*)
25397ee6427Smrg	echo ${UNAME_MACHINE}-unknown-sortix
25497ee6427Smrg	exit ;;
255301ea0f4Smrg    alpha:OSF1:*:*)
2560cc67336Smrg	case $UNAME_RELEASE in
2570cc67336Smrg	*4.0)
258301ea0f4Smrg		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
2590cc67336Smrg		;;
2600cc67336Smrg	*5.*)
261213fdd94Smrg		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
2620cc67336Smrg		;;
2630cc67336Smrg	esac
264301ea0f4Smrg	# According to Compaq, /usr/sbin/psrinfo has been available on
265301ea0f4Smrg	# OSF/1 and Tru64 systems produced since 1995.  I hope that
266301ea0f4Smrg	# covers most systems running today.  This code pipes the CPU
267301ea0f4Smrg	# types through head -n 1, so we only detect the type of CPU 0.
268301ea0f4Smrg	ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\) processor.*$/\1/p' | head -n 1`
269301ea0f4Smrg	case "$ALPHA_CPU_TYPE" in
270301ea0f4Smrg	    "EV4 (21064)")
271d94624a0Smrg		UNAME_MACHINE="alpha" ;;
272301ea0f4Smrg	    "EV4.5 (21064)")
273d94624a0Smrg		UNAME_MACHINE="alpha" ;;
274301ea0f4Smrg	    "LCA4 (21066/21068)")
275d94624a0Smrg		UNAME_MACHINE="alpha" ;;
276301ea0f4Smrg	    "EV5 (21164)")
277d94624a0Smrg		UNAME_MACHINE="alphaev5" ;;
278301ea0f4Smrg	    "EV5.6 (21164A)")
279d94624a0Smrg		UNAME_MACHINE="alphaev56" ;;
280301ea0f4Smrg	    "EV5.6 (21164PC)")
281d94624a0Smrg		UNAME_MACHINE="alphapca56" ;;
282301ea0f4Smrg	    "EV5.7 (21164PC)")
283d94624a0Smrg		UNAME_MACHINE="alphapca57" ;;
284301ea0f4Smrg	    "EV6 (21264)")
285d94624a0Smrg		UNAME_MACHINE="alphaev6" ;;
286301ea0f4Smrg	    "EV6.7 (21264A)")
287d94624a0Smrg		UNAME_MACHINE="alphaev67" ;;
288301ea0f4Smrg	    "EV6.8CB (21264C)")
289d94624a0Smrg		UNAME_MACHINE="alphaev68" ;;
290301ea0f4Smrg	    "EV6.8AL (21264B)")
291d94624a0Smrg		UNAME_MACHINE="alphaev68" ;;
292301ea0f4Smrg	    "EV6.8CX (21264D)")
293d94624a0Smrg		UNAME_MACHINE="alphaev68" ;;
294301ea0f4Smrg	    "EV6.9A (21264/EV69A)")
295d94624a0Smrg		UNAME_MACHINE="alphaev69" ;;
296301ea0f4Smrg	    "EV7 (21364)")
297d94624a0Smrg		UNAME_MACHINE="alphaev7" ;;
298301ea0f4Smrg	    "EV7.9 (21364A)")
299d94624a0Smrg		UNAME_MACHINE="alphaev79" ;;
300301ea0f4Smrg	esac
3010cc67336Smrg	# A Pn.n version is a patched version.
302301ea0f4Smrg	# A Vn.n version is a released version.
303301ea0f4Smrg	# A Tn.n version is a released field test version.
304301ea0f4Smrg	# A Xn.n version is an unreleased experimental baselevel.
305301ea0f4Smrg	# 1.2 uses "1.2" for uname -r.
306d94624a0Smrg	echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
307213fdd94Smrg	# Reset EXIT trap before exiting to avoid spurious non-zero exit code.
308213fdd94Smrg	exitcode=$?
309213fdd94Smrg	trap '' 0
310213fdd94Smrg	exit $exitcode ;;
311301ea0f4Smrg    Alpha\ *:Windows_NT*:*)
312301ea0f4Smrg	# How do we know it's Interix rather than the generic POSIX subsystem?
313301ea0f4Smrg	# Should we change UNAME_MACHINE based on the output of uname instead
314301ea0f4Smrg	# of the specific Alpha model?
315301ea0f4Smrg	echo alpha-pc-interix
3160cc67336Smrg	exit ;;
317301ea0f4Smrg    21064:Windows_NT:50:3)
318301ea0f4Smrg	echo alpha-dec-winnt3.5
3190cc67336Smrg	exit ;;
320301ea0f4Smrg    Amiga*:UNIX_System_V:4.0:*)
321301ea0f4Smrg	echo m68k-unknown-sysv4
3220cc67336Smrg	exit ;;
323301ea0f4Smrg    *:[Aa]miga[Oo][Ss]:*:*)
324301ea0f4Smrg	echo ${UNAME_MACHINE}-unknown-amigaos
3250cc67336Smrg	exit ;;
326301ea0f4Smrg    *:[Mm]orph[Oo][Ss]:*:*)
327301ea0f4Smrg	echo ${UNAME_MACHINE}-unknown-morphos
3280cc67336Smrg	exit ;;
329301ea0f4Smrg    *:OS/390:*:*)
330301ea0f4Smrg	echo i370-ibm-openedition
3310cc67336Smrg	exit ;;
3320cc67336Smrg    *:z/VM:*:*)
3330cc67336Smrg	echo s390-ibm-zvmoe
3340cc67336Smrg	exit ;;
3350cc67336Smrg    *:OS400:*:*)
336213fdd94Smrg	echo powerpc-ibm-os400
3370cc67336Smrg	exit ;;
338301ea0f4Smrg    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
339301ea0f4Smrg	echo arm-acorn-riscix${UNAME_RELEASE}
3400cc67336Smrg	exit ;;
34118552c8aSmrg    arm*:riscos:*:*|arm*:RISCOS:*:*)
3420cc67336Smrg	echo arm-unknown-riscos
3430cc67336Smrg	exit ;;
344301ea0f4Smrg    SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
345301ea0f4Smrg	echo hppa1.1-hitachi-hiuxmpp
3460cc67336Smrg	exit ;;
347301ea0f4Smrg    Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
348301ea0f4Smrg	# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
349301ea0f4Smrg	if test "`(/bin/universe) 2>/dev/null`" = att ; then
350301ea0f4Smrg		echo pyramid-pyramid-sysv3
351301ea0f4Smrg	else
352301ea0f4Smrg		echo pyramid-pyramid-bsd
353301ea0f4Smrg	fi
3540cc67336Smrg	exit ;;
355301ea0f4Smrg    NILE*:*:*:dcosx)
356301ea0f4Smrg	echo pyramid-pyramid-svr4
3570cc67336Smrg	exit ;;
358301ea0f4Smrg    DRS?6000:unix:4.0:6*)
359301ea0f4Smrg	echo sparc-icl-nx6
3600cc67336Smrg	exit ;;
3610cc67336Smrg    DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
362301ea0f4Smrg	case `/usr/bin/uname -p` in
3630cc67336Smrg	    sparc) echo sparc-icl-nx7; exit ;;
364301ea0f4Smrg	esac ;;
365213fdd94Smrg    s390x:SunOS:*:*)
366213fdd94Smrg	echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
367213fdd94Smrg	exit ;;
368301ea0f4Smrg    sun4H:SunOS:5.*:*)
369301ea0f4Smrg	echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
3700cc67336Smrg	exit ;;
371301ea0f4Smrg    sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
372301ea0f4Smrg	echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
3730cc67336Smrg	exit ;;
374213fdd94Smrg    i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
375213fdd94Smrg	echo i386-pc-auroraux${UNAME_RELEASE}
376213fdd94Smrg	exit ;;
3770cc67336Smrg    i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
378213fdd94Smrg	eval $set_cc_for_build
379d94624a0Smrg	SUN_ARCH="i386"
380213fdd94Smrg	# If there is a compiler, see if it is configured for 64-bit objects.
381213fdd94Smrg	# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
382213fdd94Smrg	# This test works for both compilers.
383d94624a0Smrg	if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
384213fdd94Smrg	    if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
385d94624a0Smrg		(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
386213fdd94Smrg		grep IS_64BIT_ARCH >/dev/null
387213fdd94Smrg	    then
388d94624a0Smrg		SUN_ARCH="x86_64"
389213fdd94Smrg	    fi
390213fdd94Smrg	fi
391213fdd94Smrg	echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
3920cc67336Smrg	exit ;;
393301ea0f4Smrg    sun4*:SunOS:6*:*)
394301ea0f4Smrg	# According to config.sub, this is the proper way to canonicalize
395301ea0f4Smrg	# SunOS6.  Hard to guess exactly what SunOS6 will be like, but
396301ea0f4Smrg	# it's likely to be more like Solaris than SunOS4.
397301ea0f4Smrg	echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
3980cc67336Smrg	exit ;;
399301ea0f4Smrg    sun4*:SunOS:*:*)
400301ea0f4Smrg	case "`/usr/bin/arch -k`" in
401301ea0f4Smrg	    Series*|S4*)
402301ea0f4Smrg		UNAME_RELEASE=`uname -v`
403301ea0f4Smrg		;;
404301ea0f4Smrg	esac
405301ea0f4Smrg	# Japanese Language versions have a version number like `4.1.3-JL'.
406301ea0f4Smrg	echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
4070cc67336Smrg	exit ;;
408301ea0f4Smrg    sun3*:SunOS:*:*)
409301ea0f4Smrg	echo m68k-sun-sunos${UNAME_RELEASE}
4100cc67336Smrg	exit ;;
411301ea0f4Smrg    sun*:*:4.2BSD:*)
412301ea0f4Smrg	UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
413d94624a0Smrg	test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
414301ea0f4Smrg	case "`/bin/arch`" in
415301ea0f4Smrg	    sun3)
416301ea0f4Smrg		echo m68k-sun-sunos${UNAME_RELEASE}
417301ea0f4Smrg		;;
418301ea0f4Smrg	    sun4)
419301ea0f4Smrg		echo sparc-sun-sunos${UNAME_RELEASE}
420301ea0f4Smrg		;;
421301ea0f4Smrg	esac
4220cc67336Smrg	exit ;;
423301ea0f4Smrg    aushp:SunOS:*:*)
424301ea0f4Smrg	echo sparc-auspex-sunos${UNAME_RELEASE}
4250cc67336Smrg	exit ;;
426301ea0f4Smrg    # The situation for MiNT is a little confusing.  The machine name
427301ea0f4Smrg    # can be virtually everything (everything which is not
428301ea0f4Smrg    # "atarist" or "atariste" at least should have a processor
429301ea0f4Smrg    # > m68000).  The system name ranges from "MiNT" over "FreeMiNT"
430301ea0f4Smrg    # to the lowercase version "mint" (or "freemint").  Finally
431301ea0f4Smrg    # the system name "TOS" denotes a system which is actually not
432301ea0f4Smrg    # MiNT.  But MiNT is downward compatible to TOS, so this should
433301ea0f4Smrg    # be no problem.
434301ea0f4Smrg    atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
435213fdd94Smrg	echo m68k-atari-mint${UNAME_RELEASE}
4360cc67336Smrg	exit ;;
437301ea0f4Smrg    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
438301ea0f4Smrg	echo m68k-atari-mint${UNAME_RELEASE}
439213fdd94Smrg	exit ;;
440301ea0f4Smrg    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
441213fdd94Smrg	echo m68k-atari-mint${UNAME_RELEASE}
4420cc67336Smrg	exit ;;
443301ea0f4Smrg    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
444213fdd94Smrg	echo m68k-milan-mint${UNAME_RELEASE}
445213fdd94Smrg	exit ;;
446301ea0f4Smrg    hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
447213fdd94Smrg	echo m68k-hades-mint${UNAME_RELEASE}
448213fdd94Smrg	exit ;;
449301ea0f4Smrg    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
450213fdd94Smrg	echo m68k-unknown-mint${UNAME_RELEASE}
451213fdd94Smrg	exit ;;
4520cc67336Smrg    m68k:machten:*:*)
4530cc67336Smrg	echo m68k-apple-machten${UNAME_RELEASE}
4540cc67336Smrg	exit ;;
455301ea0f4Smrg    powerpc:machten:*:*)
456301ea0f4Smrg	echo powerpc-apple-machten${UNAME_RELEASE}
4570cc67336Smrg	exit ;;
458301ea0f4Smrg    RISC*:Mach:*:*)
459301ea0f4Smrg	echo mips-dec-mach_bsd4.3
4600cc67336Smrg	exit ;;
461301ea0f4Smrg    RISC*:ULTRIX:*:*)
462301ea0f4Smrg	echo mips-dec-ultrix${UNAME_RELEASE}
4630cc67336Smrg	exit ;;
464301ea0f4Smrg    VAX*:ULTRIX*:*:*)
465301ea0f4Smrg	echo vax-dec-ultrix${UNAME_RELEASE}
4660cc67336Smrg	exit ;;
467301ea0f4Smrg    2020:CLIX:*:* | 2430:CLIX:*:*)
468301ea0f4Smrg	echo clipper-intergraph-clix${UNAME_RELEASE}
4690cc67336Smrg	exit ;;
470301ea0f4Smrg    mips:*:*:UMIPS | mips:*:*:RISCos)
471301ea0f4Smrg	eval $set_cc_for_build
472301ea0f4Smrg	sed 's/^	//' << EOF >$dummy.c
473301ea0f4Smrg#ifdef __cplusplus
474301ea0f4Smrg#include <stdio.h>  /* for printf() prototype */
475301ea0f4Smrg	int main (int argc, char *argv[]) {
476301ea0f4Smrg#else
477301ea0f4Smrg	int main (argc, argv) int argc; char *argv[]; {
478301ea0f4Smrg#endif
479301ea0f4Smrg	#if defined (host_mips) && defined (MIPSEB)
480301ea0f4Smrg	#if defined (SYSTYPE_SYSV)
481301ea0f4Smrg	  printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
482301ea0f4Smrg	#endif
483301ea0f4Smrg	#if defined (SYSTYPE_SVR4)
484301ea0f4Smrg	  printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
485301ea0f4Smrg	#endif
486301ea0f4Smrg	#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
487301ea0f4Smrg	  printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
488301ea0f4Smrg	#endif
489301ea0f4Smrg	#endif
490301ea0f4Smrg	  exit (-1);
491301ea0f4Smrg	}
492301ea0f4SmrgEOF
4930cc67336Smrg	$CC_FOR_BUILD -o $dummy $dummy.c &&
4940cc67336Smrg	  dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
4950cc67336Smrg	  SYSTEM_NAME=`$dummy $dummyarg` &&
4960cc67336Smrg	    { echo "$SYSTEM_NAME"; exit; }
497301ea0f4Smrg	echo mips-mips-riscos${UNAME_RELEASE}
4980cc67336Smrg	exit ;;
499301ea0f4Smrg    Motorola:PowerMAX_OS:*:*)
500301ea0f4Smrg	echo powerpc-motorola-powermax
5010cc67336Smrg	exit ;;
502301ea0f4Smrg    Motorola:*:4.3:PL8-*)
503301ea0f4Smrg	echo powerpc-harris-powermax
5040cc67336Smrg	exit ;;
505301ea0f4Smrg    Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
506301ea0f4Smrg	echo powerpc-harris-powermax
5070cc67336Smrg	exit ;;
508301ea0f4Smrg    Night_Hawk:Power_UNIX:*:*)
509301ea0f4Smrg	echo powerpc-harris-powerunix
5100cc67336Smrg	exit ;;
511301ea0f4Smrg    m88k:CX/UX:7*:*)
512301ea0f4Smrg	echo m88k-harris-cxux7
5130cc67336Smrg	exit ;;
514301ea0f4Smrg    m88k:*:4*:R4*)
515301ea0f4Smrg	echo m88k-motorola-sysv4
5160cc67336Smrg	exit ;;
517301ea0f4Smrg    m88k:*:3*:R3*)
518301ea0f4Smrg	echo m88k-motorola-sysv3
5190cc67336Smrg	exit ;;
520301ea0f4Smrg    AViiON:dgux:*:*)
521213fdd94Smrg	# DG/UX returns AViiON for all architectures
522213fdd94Smrg	UNAME_PROCESSOR=`/usr/bin/uname -p`
523301ea0f4Smrg	if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
524301ea0f4Smrg	then
525301ea0f4Smrg	    if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
526301ea0f4Smrg	       [ ${TARGET_BINARY_INTERFACE}x = x ]
527301ea0f4Smrg	    then
528301ea0f4Smrg		echo m88k-dg-dgux${UNAME_RELEASE}
529301ea0f4Smrg	    else
530301ea0f4Smrg		echo m88k-dg-dguxbcs${UNAME_RELEASE}
531301ea0f4Smrg	    fi
532301ea0f4Smrg	else
533301ea0f4Smrg	    echo i586-dg-dgux${UNAME_RELEASE}
534301ea0f4Smrg	fi
535213fdd94Smrg	exit ;;
536301ea0f4Smrg    M88*:DolphinOS:*:*)	# DolphinOS (SVR3)
537301ea0f4Smrg	echo m88k-dolphin-sysv3
5380cc67336Smrg	exit ;;
539301ea0f4Smrg    M88*:*:R3*:*)
540301ea0f4Smrg	# Delta 88k system running SVR3
541301ea0f4Smrg	echo m88k-motorola-sysv3
5420cc67336Smrg	exit ;;
543301ea0f4Smrg    XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
544301ea0f4Smrg	echo m88k-tektronix-sysv3
5450cc67336Smrg	exit ;;
546301ea0f4Smrg    Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
547301ea0f4Smrg	echo m68k-tektronix-bsd
5480cc67336Smrg	exit ;;
549301ea0f4Smrg    *:IRIX*:*:*)
550301ea0f4Smrg	echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
5510cc67336Smrg	exit ;;
552301ea0f4Smrg    ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
5530cc67336Smrg	echo romp-ibm-aix     # uname -m gives an 8 hex-code CPU id
5540cc67336Smrg	exit ;;               # Note that: echo "'`uname -s`'" gives 'AIX '
555301ea0f4Smrg    i*86:AIX:*:*)
556301ea0f4Smrg	echo i386-ibm-aix
5570cc67336Smrg	exit ;;
558301ea0f4Smrg    ia64:AIX:*:*)
559301ea0f4Smrg	if [ -x /usr/bin/oslevel ] ; then
560301ea0f4Smrg		IBM_REV=`/usr/bin/oslevel`
561301ea0f4Smrg	else
562301ea0f4Smrg		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
563301ea0f4Smrg	fi
564301ea0f4Smrg	echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
5650cc67336Smrg	exit ;;
566301ea0f4Smrg    *:AIX:2:3)
567301ea0f4Smrg	if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
568301ea0f4Smrg		eval $set_cc_for_build
569301ea0f4Smrg		sed 's/^		//' << EOF >$dummy.c
570301ea0f4Smrg		#include <sys/systemcfg.h>
571301ea0f4Smrg
572301ea0f4Smrg		main()
573301ea0f4Smrg			{
574301ea0f4Smrg			if (!__power_pc())
575301ea0f4Smrg				exit(1);
576301ea0f4Smrg			puts("powerpc-ibm-aix3.2.5");
577301ea0f4Smrg			exit(0);
578301ea0f4Smrg			}
579301ea0f4SmrgEOF
5800cc67336Smrg		if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
5810cc67336Smrg		then
5820cc67336Smrg			echo "$SYSTEM_NAME"
5830cc67336Smrg		else
5840cc67336Smrg			echo rs6000-ibm-aix3.2.5
5850cc67336Smrg		fi
586301ea0f4Smrg	elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
587301ea0f4Smrg		echo rs6000-ibm-aix3.2.4
588301ea0f4Smrg	else
589301ea0f4Smrg		echo rs6000-ibm-aix3.2
590301ea0f4Smrg	fi
5910cc67336Smrg	exit ;;
592213fdd94Smrg    *:AIX:*:[4567])
593301ea0f4Smrg	IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
594301ea0f4Smrg	if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
595301ea0f4Smrg		IBM_ARCH=rs6000
596301ea0f4Smrg	else
597301ea0f4Smrg		IBM_ARCH=powerpc
598301ea0f4Smrg	fi
59997ee6427Smrg	if [ -x /usr/bin/lslpp ] ; then
60097ee6427Smrg		IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc |
60197ee6427Smrg			   awk -F: '{ print $3 }' | sed s/[0-9]*$/0/`
602301ea0f4Smrg	else
603301ea0f4Smrg		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
604301ea0f4Smrg	fi
605301ea0f4Smrg	echo ${IBM_ARCH}-ibm-aix${IBM_REV}
6060cc67336Smrg	exit ;;
607301ea0f4Smrg    *:AIX:*:*)
608301ea0f4Smrg	echo rs6000-ibm-aix
6090cc67336Smrg	exit ;;
610301ea0f4Smrg    ibmrt:4.4BSD:*|romp-ibm:BSD:*)
611301ea0f4Smrg	echo romp-ibm-bsd4.4
6120cc67336Smrg	exit ;;
613301ea0f4Smrg    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
614301ea0f4Smrg	echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
6150cc67336Smrg	exit ;;                             # report: romp-ibm BSD 4.3
616301ea0f4Smrg    *:BOSX:*:*)
617301ea0f4Smrg	echo rs6000-bull-bosx
6180cc67336Smrg	exit ;;
619301ea0f4Smrg    DPX/2?00:B.O.S.:*:*)
620301ea0f4Smrg	echo m68k-bull-sysv3
6210cc67336Smrg	exit ;;
622301ea0f4Smrg    9000/[34]??:4.3bsd:1.*:*)
623301ea0f4Smrg	echo m68k-hp-bsd
6240cc67336Smrg	exit ;;
625301ea0f4Smrg    hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
626301ea0f4Smrg	echo m68k-hp-bsd4.4
6270cc67336Smrg	exit ;;
628301ea0f4Smrg    9000/[34678]??:HP-UX:*:*)
629301ea0f4Smrg	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
630301ea0f4Smrg	case "${UNAME_MACHINE}" in
631301ea0f4Smrg	    9000/31? )            HP_ARCH=m68000 ;;
632301ea0f4Smrg	    9000/[34]?? )         HP_ARCH=m68k ;;
633301ea0f4Smrg	    9000/[678][0-9][0-9])
634301ea0f4Smrg		if [ -x /usr/bin/getconf ]; then
635301ea0f4Smrg		    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
636213fdd94Smrg		    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
637213fdd94Smrg		    case "${sc_cpu_version}" in
638d94624a0Smrg		      523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
639d94624a0Smrg		      528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
640213fdd94Smrg		      532)                      # CPU_PA_RISC2_0
641213fdd94Smrg			case "${sc_kernel_bits}" in
642d94624a0Smrg			  32) HP_ARCH="hppa2.0n" ;;
643d94624a0Smrg			  64) HP_ARCH="hppa2.0w" ;;
644d94624a0Smrg			  '') HP_ARCH="hppa2.0" ;;   # HP-UX 10.20
645213fdd94Smrg			esac ;;
646213fdd94Smrg		    esac
647301ea0f4Smrg		fi
648301ea0f4Smrg		if [ "${HP_ARCH}" = "" ]; then
649301ea0f4Smrg		    eval $set_cc_for_build
650213fdd94Smrg		    sed 's/^		//' << EOF >$dummy.c
651301ea0f4Smrg
652213fdd94Smrg		#define _HPUX_SOURCE
653213fdd94Smrg		#include <stdlib.h>
654213fdd94Smrg		#include <unistd.h>
655301ea0f4Smrg
656213fdd94Smrg		int main ()
657213fdd94Smrg		{
658213fdd94Smrg		#if defined(_SC_KERNEL_BITS)
659213fdd94Smrg		    long bits = sysconf(_SC_KERNEL_BITS);
660213fdd94Smrg		#endif
661213fdd94Smrg		    long cpu  = sysconf (_SC_CPU_VERSION);
662301ea0f4Smrg
663213fdd94Smrg		    switch (cpu)
664213fdd94Smrg			{
665213fdd94Smrg			case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
666213fdd94Smrg			case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
667213fdd94Smrg			case CPU_PA_RISC2_0:
668213fdd94Smrg		#if defined(_SC_KERNEL_BITS)
669213fdd94Smrg			    switch (bits)
670213fdd94Smrg				{
671213fdd94Smrg				case 64: puts ("hppa2.0w"); break;
672213fdd94Smrg				case 32: puts ("hppa2.0n"); break;
673213fdd94Smrg				default: puts ("hppa2.0"); break;
674213fdd94Smrg				} break;
675213fdd94Smrg		#else  /* !defined(_SC_KERNEL_BITS) */
676213fdd94Smrg			    puts ("hppa2.0"); break;
677213fdd94Smrg		#endif
678213fdd94Smrg			default: puts ("hppa1.0"); break;
679213fdd94Smrg			}
680213fdd94Smrg		    exit (0);
681213fdd94Smrg		}
682301ea0f4SmrgEOF
683d94624a0Smrg		    (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
684301ea0f4Smrg		    test -z "$HP_ARCH" && HP_ARCH=hppa
685301ea0f4Smrg		fi ;;
686301ea0f4Smrg	esac
687d94624a0Smrg	if [ ${HP_ARCH} = "hppa2.0w" ]
688301ea0f4Smrg	then
6890cc67336Smrg	    eval $set_cc_for_build
6900cc67336Smrg
6910cc67336Smrg	    # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
6920cc67336Smrg	    # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler
6930cc67336Smrg	    # generating 64-bit code.  GNU and HP use different nomenclature:
6940cc67336Smrg	    #
6950cc67336Smrg	    # $ CC_FOR_BUILD=cc ./config.guess
6960cc67336Smrg	    # => hppa2.0w-hp-hpux11.23
6970cc67336Smrg	    # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
6980cc67336Smrg	    # => hppa64-hp-hpux11.23
6990cc67336Smrg
700d94624a0Smrg	    if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
701213fdd94Smrg		grep -q __LP64__
702301ea0f4Smrg	    then
703d94624a0Smrg		HP_ARCH="hppa2.0w"
704301ea0f4Smrg	    else
705d94624a0Smrg		HP_ARCH="hppa64"
706301ea0f4Smrg	    fi
707301ea0f4Smrg	fi
708301ea0f4Smrg	echo ${HP_ARCH}-hp-hpux${HPUX_REV}
7090cc67336Smrg	exit ;;
710301ea0f4Smrg    ia64:HP-UX:*:*)
711301ea0f4Smrg	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
712301ea0f4Smrg	echo ia64-hp-hpux${HPUX_REV}
7130cc67336Smrg	exit ;;
714301ea0f4Smrg    3050*:HI-UX:*:*)
715301ea0f4Smrg	eval $set_cc_for_build
716301ea0f4Smrg	sed 's/^	//' << EOF >$dummy.c
717301ea0f4Smrg	#include <unistd.h>
718301ea0f4Smrg	int
719301ea0f4Smrg	main ()
720301ea0f4Smrg	{
721301ea0f4Smrg	  long cpu = sysconf (_SC_CPU_VERSION);
722301ea0f4Smrg	  /* The order matters, because CPU_IS_HP_MC68K erroneously returns
723301ea0f4Smrg	     true for CPU_PA_RISC1_0.  CPU_IS_PA_RISC returns correct
724301ea0f4Smrg	     results, however.  */
725301ea0f4Smrg	  if (CPU_IS_PA_RISC (cpu))
726301ea0f4Smrg	    {
727301ea0f4Smrg	      switch (cpu)
728301ea0f4Smrg		{
729301ea0f4Smrg		  case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
730301ea0f4Smrg		  case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
731301ea0f4Smrg		  case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
732301ea0f4Smrg		  default: puts ("hppa-hitachi-hiuxwe2"); break;
733301ea0f4Smrg		}
734301ea0f4Smrg	    }
735301ea0f4Smrg	  else if (CPU_IS_HP_MC68K (cpu))
736301ea0f4Smrg	    puts ("m68k-hitachi-hiuxwe2");
737301ea0f4Smrg	  else puts ("unknown-hitachi-hiuxwe2");
738301ea0f4Smrg	  exit (0);
739301ea0f4Smrg	}
740301ea0f4SmrgEOF
7410cc67336Smrg	$CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
7420cc67336Smrg		{ echo "$SYSTEM_NAME"; exit; }
743301ea0f4Smrg	echo unknown-hitachi-hiuxwe2
7440cc67336Smrg	exit ;;
745301ea0f4Smrg    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
746301ea0f4Smrg	echo hppa1.1-hp-bsd
7470cc67336Smrg	exit ;;
748301ea0f4Smrg    9000/8??:4.3bsd:*:*)
749301ea0f4Smrg	echo hppa1.0-hp-bsd
7500cc67336Smrg	exit ;;
751301ea0f4Smrg    *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
752301ea0f4Smrg	echo hppa1.0-hp-mpeix
7530cc67336Smrg	exit ;;
754301ea0f4Smrg    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
755301ea0f4Smrg	echo hppa1.1-hp-osf
7560cc67336Smrg	exit ;;
757301ea0f4Smrg    hp8??:OSF1:*:*)
758301ea0f4Smrg	echo hppa1.0-hp-osf
7590cc67336Smrg	exit ;;
760301ea0f4Smrg    i*86:OSF1:*:*)
761301ea0f4Smrg	if [ -x /usr/sbin/sysversion ] ; then
762301ea0f4Smrg	    echo ${UNAME_MACHINE}-unknown-osf1mk
763301ea0f4Smrg	else
764301ea0f4Smrg	    echo ${UNAME_MACHINE}-unknown-osf1
765301ea0f4Smrg	fi
7660cc67336Smrg	exit ;;
767301ea0f4Smrg    parisc*:Lites*:*:*)
768301ea0f4Smrg	echo hppa1.1-hp-lites
7690cc67336Smrg	exit ;;
770301ea0f4Smrg    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
771301ea0f4Smrg	echo c1-convex-bsd
772213fdd94Smrg	exit ;;
773301ea0f4Smrg    C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
774301ea0f4Smrg	if getsysinfo -f scalar_acc
775301ea0f4Smrg	then echo c32-convex-bsd
776301ea0f4Smrg	else echo c2-convex-bsd
777301ea0f4Smrg	fi
778213fdd94Smrg	exit ;;
779301ea0f4Smrg    C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
780301ea0f4Smrg	echo c34-convex-bsd
781213fdd94Smrg	exit ;;
782301ea0f4Smrg    C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
783301ea0f4Smrg	echo c38-convex-bsd
784213fdd94Smrg	exit ;;
785301ea0f4Smrg    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
786301ea0f4Smrg	echo c4-convex-bsd
787213fdd94Smrg	exit ;;
788301ea0f4Smrg    CRAY*Y-MP:*:*:*)
789301ea0f4Smrg	echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
7900cc67336Smrg	exit ;;
791301ea0f4Smrg    CRAY*[A-Z]90:*:*:*)
792301ea0f4Smrg	echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
793301ea0f4Smrg	| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
794301ea0f4Smrg	      -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
795301ea0f4Smrg	      -e 's/\.[^.]*$/.X/'
7960cc67336Smrg	exit ;;
797301ea0f4Smrg    CRAY*TS:*:*:*)
798301ea0f4Smrg	echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
7990cc67336Smrg	exit ;;
800301ea0f4Smrg    CRAY*T3E:*:*:*)
801301ea0f4Smrg	echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
8020cc67336Smrg	exit ;;
803301ea0f4Smrg    CRAY*SV1:*:*:*)
804301ea0f4Smrg	echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
8050cc67336Smrg	exit ;;
806301ea0f4Smrg    *:UNICOS/mp:*:*)
8070cc67336Smrg	echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
8080cc67336Smrg	exit ;;
809301ea0f4Smrg    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
810d94624a0Smrg	FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
811d94624a0Smrg	FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
812213fdd94Smrg	FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
813213fdd94Smrg	echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
814213fdd94Smrg	exit ;;
8150cc67336Smrg    5000:UNIX_System_V:4.*:*)
816d94624a0Smrg	FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
817d94624a0Smrg	FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
818213fdd94Smrg	echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
8190cc67336Smrg	exit ;;
820301ea0f4Smrg    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
821301ea0f4Smrg	echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
8220cc67336Smrg	exit ;;
823301ea0f4Smrg    sparc*:BSD/OS:*:*)
824301ea0f4Smrg	echo sparc-unknown-bsdi${UNAME_RELEASE}
8250cc67336Smrg	exit ;;
826301ea0f4Smrg    *:BSD/OS:*:*)
827301ea0f4Smrg	echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
8280cc67336Smrg	exit ;;
8290cc67336Smrg    *:FreeBSD:*:*)
830213fdd94Smrg	UNAME_PROCESSOR=`/usr/bin/uname -p`
831213fdd94Smrg	case ${UNAME_PROCESSOR} in
8320cc67336Smrg	    amd64)
8330cc67336Smrg		echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
8340cc67336Smrg	    *)
835213fdd94Smrg		echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
8360cc67336Smrg	esac
8370cc67336Smrg	exit ;;
838301ea0f4Smrg    i*:CYGWIN*:*)
839301ea0f4Smrg	echo ${UNAME_MACHINE}-pc-cygwin
8400cc67336Smrg	exit ;;
84118552c8aSmrg    *:MINGW64*:*)
84218552c8aSmrg	echo ${UNAME_MACHINE}-pc-mingw64
84318552c8aSmrg	exit ;;
8440cc67336Smrg    *:MINGW*:*)
845301ea0f4Smrg	echo ${UNAME_MACHINE}-pc-mingw32
8460cc67336Smrg	exit ;;
84797ee6427Smrg    *:MSYS*:*)
848213fdd94Smrg	echo ${UNAME_MACHINE}-pc-msys
849213fdd94Smrg	exit ;;
8500cc67336Smrg    i*:windows32*:*)
851213fdd94Smrg	# uname -m includes "-pc" on this system.
852213fdd94Smrg	echo ${UNAME_MACHINE}-mingw32
8530cc67336Smrg	exit ;;
854301ea0f4Smrg    i*:PW*:*)
855301ea0f4Smrg	echo ${UNAME_MACHINE}-pc-pw32
8560cc67336Smrg	exit ;;
857213fdd94Smrg    *:Interix*:*)
858213fdd94Smrg	case ${UNAME_MACHINE} in
8590cc67336Smrg	    x86)
8600cc67336Smrg		echo i586-pc-interix${UNAME_RELEASE}
8610cc67336Smrg		exit ;;
862213fdd94Smrg	    authenticamd | genuineintel | EM64T)
8630cc67336Smrg		echo x86_64-unknown-interix${UNAME_RELEASE}
8640cc67336Smrg		exit ;;
8650cc67336Smrg	    IA64)
8660cc67336Smrg		echo ia64-unknown-interix${UNAME_RELEASE}
8670cc67336Smrg		exit ;;
8680cc67336Smrg	esac ;;
869301ea0f4Smrg    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
870301ea0f4Smrg	echo i${UNAME_MACHINE}-pc-mks
8710cc67336Smrg	exit ;;
872213fdd94Smrg    8664:Windows_NT:*)
873213fdd94Smrg	echo x86_64-pc-mks
874213fdd94Smrg	exit ;;
875301ea0f4Smrg    i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
876301ea0f4Smrg	# How do we know it's Interix rather than the generic POSIX subsystem?
877301ea0f4Smrg	# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
878301ea0f4Smrg	# UNAME_MACHINE based on the output of uname instead of i386?
879301ea0f4Smrg	echo i586-pc-interix
8800cc67336Smrg	exit ;;
881301ea0f4Smrg    i*:UWIN*:*)
882301ea0f4Smrg	echo ${UNAME_MACHINE}-pc-uwin
8830cc67336Smrg	exit ;;
8840cc67336Smrg    amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
8850cc67336Smrg	echo x86_64-unknown-cygwin
8860cc67336Smrg	exit ;;
887301ea0f4Smrg    p*:CYGWIN*:*)
888301ea0f4Smrg	echo powerpcle-unknown-cygwin
8890cc67336Smrg	exit ;;
890301ea0f4Smrg    prep*:SunOS:5.*:*)
891301ea0f4Smrg	echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
8920cc67336Smrg	exit ;;
893301ea0f4Smrg    *:GNU:*:*)
8940cc67336Smrg	# the GNU system
89518552c8aSmrg	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
8960cc67336Smrg	exit ;;
8970cc67336Smrg    *:GNU/*:*:*)
8980cc67336Smrg	# other systems with GNU libc and userland
899d94624a0Smrg	echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
9000cc67336Smrg	exit ;;
901301ea0f4Smrg    i*86:Minix:*:*)
902301ea0f4Smrg	echo ${UNAME_MACHINE}-pc-minix
9030cc67336Smrg	exit ;;
90418552c8aSmrg    aarch64:Linux:*:*)
90518552c8aSmrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
90618552c8aSmrg	exit ;;
90718552c8aSmrg    aarch64_be:Linux:*:*)
90818552c8aSmrg	UNAME_MACHINE=aarch64_be
90918552c8aSmrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
91018552c8aSmrg	exit ;;
911213fdd94Smrg    alpha:Linux:*:*)
912213fdd94Smrg	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
913213fdd94Smrg	  EV5)   UNAME_MACHINE=alphaev5 ;;
914213fdd94Smrg	  EV56)  UNAME_MACHINE=alphaev56 ;;
915213fdd94Smrg	  PCA56) UNAME_MACHINE=alphapca56 ;;
916213fdd94Smrg	  PCA57) UNAME_MACHINE=alphapca56 ;;
917213fdd94Smrg	  EV6)   UNAME_MACHINE=alphaev6 ;;
918213fdd94Smrg	  EV67)  UNAME_MACHINE=alphaev67 ;;
919213fdd94Smrg	  EV68*) UNAME_MACHINE=alphaev68 ;;
920213fdd94Smrg	esac
921213fdd94Smrg	objdump --private-headers /bin/sh | grep -q ld.so.1
922d94624a0Smrg	if test "$?" = 0 ; then LIBC="gnulibc1" ; fi
92318552c8aSmrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
92418552c8aSmrg	exit ;;
92518552c8aSmrg    arc:Linux:*:* | arceb:Linux:*:*)
92618552c8aSmrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
927213fdd94Smrg	exit ;;
928301ea0f4Smrg    arm*:Linux:*:*)
9290cc67336Smrg	eval $set_cc_for_build
9300cc67336Smrg	if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
9310cc67336Smrg	    | grep -q __ARM_EABI__
9320cc67336Smrg	then
93318552c8aSmrg	    echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
9340cc67336Smrg	else
935213fdd94Smrg	    if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
936213fdd94Smrg		| grep -q __ARM_PCS_VFP
937213fdd94Smrg	    then
93818552c8aSmrg		echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
939213fdd94Smrg	    else
94018552c8aSmrg		echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf
941213fdd94Smrg	    fi
9420cc67336Smrg	fi
9430cc67336Smrg	exit ;;
9440cc67336Smrg    avr32*:Linux:*:*)
94518552c8aSmrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
9460cc67336Smrg	exit ;;
947301ea0f4Smrg    cris:Linux:*:*)
94818552c8aSmrg	echo ${UNAME_MACHINE}-axis-linux-${LIBC}
9490cc67336Smrg	exit ;;
9500cc67336Smrg    crisv32:Linux:*:*)
95118552c8aSmrg	echo ${UNAME_MACHINE}-axis-linux-${LIBC}
9520cc67336Smrg	exit ;;
95397ee6427Smrg    e2k:Linux:*:*)
95497ee6427Smrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
95597ee6427Smrg	exit ;;
9560cc67336Smrg    frv:Linux:*:*)
95718552c8aSmrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
958213fdd94Smrg	exit ;;
959213fdd94Smrg    hexagon:Linux:*:*)
96018552c8aSmrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
961213fdd94Smrg	exit ;;
962213fdd94Smrg    i*86:Linux:*:*)
96318552c8aSmrg	echo ${UNAME_MACHINE}-pc-linux-${LIBC}
9640cc67336Smrg	exit ;;
965301ea0f4Smrg    ia64:Linux:*:*)
96618552c8aSmrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
9670cc67336Smrg	exit ;;
9680cc67336Smrg    m32r*:Linux:*:*)
96918552c8aSmrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
9700cc67336Smrg	exit ;;
971301ea0f4Smrg    m68*:Linux:*:*)
97218552c8aSmrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
9730cc67336Smrg	exit ;;
974213fdd94Smrg    mips:Linux:*:* | mips64:Linux:*:*)
975301ea0f4Smrg	eval $set_cc_for_build
976301ea0f4Smrg	sed 's/^	//' << EOF >$dummy.c
977301ea0f4Smrg	#undef CPU
978213fdd94Smrg	#undef ${UNAME_MACHINE}
979213fdd94Smrg	#undef ${UNAME_MACHINE}el
980301ea0f4Smrg	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
981213fdd94Smrg	CPU=${UNAME_MACHINE}el
982301ea0f4Smrg	#else
983301ea0f4Smrg	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
984213fdd94Smrg	CPU=${UNAME_MACHINE}
985301ea0f4Smrg	#else
986301ea0f4Smrg	CPU=
987301ea0f4Smrg	#endif
988301ea0f4Smrg	#endif
989301ea0f4SmrgEOF
990213fdd94Smrg	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
99118552c8aSmrg	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
992301ea0f4Smrg	;;
99397ee6427Smrg    openrisc*:Linux:*:*)
99497ee6427Smrg	echo or1k-unknown-linux-${LIBC}
99518552c8aSmrg	exit ;;
99697ee6427Smrg    or32:Linux:*:* | or1k*:Linux:*:*)
99718552c8aSmrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
9980cc67336Smrg	exit ;;
999213fdd94Smrg    padre:Linux:*:*)
100018552c8aSmrg	echo sparc-unknown-linux-${LIBC}
10010cc67336Smrg	exit ;;
1002213fdd94Smrg    parisc64:Linux:*:* | hppa64:Linux:*:*)
100318552c8aSmrg	echo hppa64-unknown-linux-${LIBC}
10040cc67336Smrg	exit ;;
1005301ea0f4Smrg    parisc:Linux:*:* | hppa:Linux:*:*)
1006301ea0f4Smrg	# Look for CPU level
1007301ea0f4Smrg	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
100818552c8aSmrg	  PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
100918552c8aSmrg	  PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
101018552c8aSmrg	  *)    echo hppa-unknown-linux-${LIBC} ;;
1011301ea0f4Smrg	esac
10120cc67336Smrg	exit ;;
1013213fdd94Smrg    ppc64:Linux:*:*)
101418552c8aSmrg	echo powerpc64-unknown-linux-${LIBC}
1015213fdd94Smrg	exit ;;
1016213fdd94Smrg    ppc:Linux:*:*)
101718552c8aSmrg	echo powerpc-unknown-linux-${LIBC}
101818552c8aSmrg	exit ;;
101918552c8aSmrg    ppc64le:Linux:*:*)
102018552c8aSmrg	echo powerpc64le-unknown-linux-${LIBC}
102118552c8aSmrg	exit ;;
102218552c8aSmrg    ppcle:Linux:*:*)
102318552c8aSmrg	echo powerpcle-unknown-linux-${LIBC}
10240cc67336Smrg	exit ;;
1025301ea0f4Smrg    s390:Linux:*:* | s390x:Linux:*:*)
102618552c8aSmrg	echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
10270cc67336Smrg	exit ;;
1028301ea0f4Smrg    sh64*:Linux:*:*)
102918552c8aSmrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
10300cc67336Smrg	exit ;;
1031301ea0f4Smrg    sh*:Linux:*:*)
103218552c8aSmrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
10330cc67336Smrg	exit ;;
1034301ea0f4Smrg    sparc:Linux:*:* | sparc64:Linux:*:*)
103518552c8aSmrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
10360cc67336Smrg	exit ;;
1037213fdd94Smrg    tile*:Linux:*:*)
103818552c8aSmrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
1039213fdd94Smrg	exit ;;
10400cc67336Smrg    vax:Linux:*:*)
104118552c8aSmrg	echo ${UNAME_MACHINE}-dec-linux-${LIBC}
10420cc67336Smrg	exit ;;
1043301ea0f4Smrg    x86_64:Linux:*:*)
1044d94624a0Smrg	echo ${UNAME_MACHINE}-pc-linux-${LIBC}
10450cc67336Smrg	exit ;;
10460cc67336Smrg    xtensa*:Linux:*:*)
104718552c8aSmrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
10480cc67336Smrg	exit ;;
1049301ea0f4Smrg    i*86:DYNIX/ptx:4*:*)
1050301ea0f4Smrg	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
1051301ea0f4Smrg	# earlier versions are messed up and put the nodename in both
1052301ea0f4Smrg	# sysname and nodename.
1053301ea0f4Smrg	echo i386-sequent-sysv4
10540cc67336Smrg	exit ;;
1055301ea0f4Smrg    i*86:UNIX_SV:4.2MP:2.*)
1056213fdd94Smrg	# Unixware is an offshoot of SVR4, but it has its own version
1057213fdd94Smrg	# number series starting with 2...
1058213fdd94Smrg	# I am not positive that other SVR4 systems won't match this,
1059301ea0f4Smrg	# I just have to hope.  -- rms.
1060213fdd94Smrg	# Use sysv4.2uw... so that sysv4* matches it.
1061301ea0f4Smrg	echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
10620cc67336Smrg	exit ;;
1063301ea0f4Smrg    i*86:OS/2:*:*)
1064301ea0f4Smrg	# If we were able to find `uname', then EMX Unix compatibility
1065301ea0f4Smrg	# is probably installed.
1066301ea0f4Smrg	echo ${UNAME_MACHINE}-pc-os2-emx
10670cc67336Smrg	exit ;;
1068301ea0f4Smrg    i*86:XTS-300:*:STOP)
1069301ea0f4Smrg	echo ${UNAME_MACHINE}-unknown-stop
10700cc67336Smrg	exit ;;
1071301ea0f4Smrg    i*86:atheos:*:*)
1072301ea0f4Smrg	echo ${UNAME_MACHINE}-unknown-atheos
10730cc67336Smrg	exit ;;
10740cc67336Smrg    i*86:syllable:*:*)
10750cc67336Smrg	echo ${UNAME_MACHINE}-pc-syllable
10760cc67336Smrg	exit ;;
1077213fdd94Smrg    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
1078301ea0f4Smrg	echo i386-unknown-lynxos${UNAME_RELEASE}
10790cc67336Smrg	exit ;;
1080301ea0f4Smrg    i*86:*DOS:*:*)
1081301ea0f4Smrg	echo ${UNAME_MACHINE}-pc-msdosdjgpp
10820cc67336Smrg	exit ;;
1083301ea0f4Smrg    i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
1084301ea0f4Smrg	UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
1085301ea0f4Smrg	if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
1086301ea0f4Smrg		echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
1087301ea0f4Smrg	else
1088301ea0f4Smrg		echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
1089301ea0f4Smrg	fi
10900cc67336Smrg	exit ;;
10910cc67336Smrg    i*86:*:5:[678]*)
1092213fdd94Smrg	# UnixWare 7.x, OpenUNIX and OpenServer 6.
1093301ea0f4Smrg	case `/bin/uname -X | grep "^Machine"` in
1094301ea0f4Smrg	    *486*)	     UNAME_MACHINE=i486 ;;
1095301ea0f4Smrg	    *Pentium)	     UNAME_MACHINE=i586 ;;
1096301ea0f4Smrg	    *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
1097301ea0f4Smrg	esac
1098301ea0f4Smrg	echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
10990cc67336Smrg	exit ;;
1100301ea0f4Smrg    i*86:*:3.2:*)
1101301ea0f4Smrg	if test -f /usr/options/cb.name; then
1102301ea0f4Smrg		UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
1103301ea0f4Smrg		echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
1104301ea0f4Smrg	elif /bin/uname -X 2>/dev/null >/dev/null ; then
1105301ea0f4Smrg		UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
1106301ea0f4Smrg		(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
1107301ea0f4Smrg		(/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
1108301ea0f4Smrg			&& UNAME_MACHINE=i586
1109301ea0f4Smrg		(/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
1110301ea0f4Smrg			&& UNAME_MACHINE=i686
1111301ea0f4Smrg		(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
1112301ea0f4Smrg			&& UNAME_MACHINE=i686
1113301ea0f4Smrg		echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
1114301ea0f4Smrg	else
1115301ea0f4Smrg		echo ${UNAME_MACHINE}-pc-sysv32
1116301ea0f4Smrg	fi
11170cc67336Smrg	exit ;;
1118301ea0f4Smrg    pc:*:*:*)
1119301ea0f4Smrg	# Left here for compatibility:
1120213fdd94Smrg	# uname -m prints for DJGPP always 'pc', but it prints nothing about
1121213fdd94Smrg	# the processor, so we play safe by assuming i586.
1122213fdd94Smrg	# Note: whatever this is, it MUST be the same as what config.sub
1123d94624a0Smrg	# prints for the "djgpp" host, or else GDB configury will decide that
1124213fdd94Smrg	# this is a cross-build.
1125213fdd94Smrg	echo i586-pc-msdosdjgpp
1126213fdd94Smrg	exit ;;
1127301ea0f4Smrg    Intel:Mach:3*:*)
1128301ea0f4Smrg	echo i386-pc-mach3
11290cc67336Smrg	exit ;;
1130301ea0f4Smrg    paragon:*:*:*)
1131301ea0f4Smrg	echo i860-intel-osf1
11320cc67336Smrg	exit ;;
1133301ea0f4Smrg    i860:*:4.*:*) # i860-SVR4
1134301ea0f4Smrg	if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
1135301ea0f4Smrg	  echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
1136301ea0f4Smrg	else # Add other i860-SVR4 vendors below as they are discovered.
1137301ea0f4Smrg	  echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
1138301ea0f4Smrg	fi
11390cc67336Smrg	exit ;;
1140301ea0f4Smrg    mini*:CTIX:SYS*5:*)
1141301ea0f4Smrg	# "miniframe"
1142301ea0f4Smrg	echo m68010-convergent-sysv
11430cc67336Smrg	exit ;;
1144301ea0f4Smrg    mc68k:UNIX:SYSTEM5:3.51m)
1145301ea0f4Smrg	echo m68k-convergent-sysv
11460cc67336Smrg	exit ;;
1147301ea0f4Smrg    M680?0:D-NIX:5.3:*)
1148301ea0f4Smrg	echo m68k-diab-dnix
11490cc67336Smrg	exit ;;
11500cc67336Smrg    M68*:*:R3V[5678]*:*)
11510cc67336Smrg	test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
11520cc67336Smrg    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)
1153301ea0f4Smrg	OS_REL=''
1154301ea0f4Smrg	test -r /etc/.relid \
1155301ea0f4Smrg	&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
1156301ea0f4Smrg	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
11570cc67336Smrg	  && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
1158301ea0f4Smrg	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
11590cc67336Smrg	  && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
1160301ea0f4Smrg    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
1161213fdd94Smrg	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1162213fdd94Smrg	  && { echo i486-ncr-sysv4; exit; } ;;
1163213fdd94Smrg    NCR*:*:4.2:* | MPRAS*:*:4.2:*)
1164213fdd94Smrg	OS_REL='.3'
1165213fdd94Smrg	test -r /etc/.relid \
1166213fdd94Smrg	    && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
1167213fdd94Smrg	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1168213fdd94Smrg	    && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
1169213fdd94Smrg	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
1170213fdd94Smrg	    && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
1171213fdd94Smrg	/bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
1172213fdd94Smrg	    && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
1173301ea0f4Smrg    m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
1174301ea0f4Smrg	echo m68k-unknown-lynxos${UNAME_RELEASE}
11750cc67336Smrg	exit ;;
1176301ea0f4Smrg    mc68030:UNIX_System_V:4.*:*)
1177301ea0f4Smrg	echo m68k-atari-sysv4
11780cc67336Smrg	exit ;;
1179301ea0f4Smrg    TSUNAMI:LynxOS:2.*:*)
1180301ea0f4Smrg	echo sparc-unknown-lynxos${UNAME_RELEASE}
11810cc67336Smrg	exit ;;
1182301ea0f4Smrg    rs6000:LynxOS:2.*:*)
1183301ea0f4Smrg	echo rs6000-unknown-lynxos${UNAME_RELEASE}
11840cc67336Smrg	exit ;;
1185213fdd94Smrg    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
1186301ea0f4Smrg	echo powerpc-unknown-lynxos${UNAME_RELEASE}
11870cc67336Smrg	exit ;;
1188301ea0f4Smrg    SM[BE]S:UNIX_SV:*:*)
1189301ea0f4Smrg	echo mips-dde-sysv${UNAME_RELEASE}
11900cc67336Smrg	exit ;;
1191301ea0f4Smrg    RM*:ReliantUNIX-*:*:*)
1192301ea0f4Smrg	echo mips-sni-sysv4
11930cc67336Smrg	exit ;;
1194301ea0f4Smrg    RM*:SINIX-*:*:*)
1195301ea0f4Smrg	echo mips-sni-sysv4
11960cc67336Smrg	exit ;;
1197301ea0f4Smrg    *:SINIX-*:*:*)
1198301ea0f4Smrg	if uname -p 2>/dev/null >/dev/null ; then
1199301ea0f4Smrg		UNAME_MACHINE=`(uname -p) 2>/dev/null`
1200301ea0f4Smrg		echo ${UNAME_MACHINE}-sni-sysv4
1201301ea0f4Smrg	else
1202301ea0f4Smrg		echo ns32k-sni-sysv
1203301ea0f4Smrg	fi
12040cc67336Smrg	exit ;;
1205213fdd94Smrg    PENTIUM:*:4.0*:*)	# Unisys `ClearPath HMP IX 4000' SVR4/MP effort
1206213fdd94Smrg			# says <Richard.M.Bartel@ccMail.Census.GOV>
1207213fdd94Smrg	echo i586-unisys-sysv4
1208213fdd94Smrg	exit ;;
1209301ea0f4Smrg    *:UNIX_System_V:4*:FTX*)
1210301ea0f4Smrg	# From Gerald Hewes <hewes@openmarket.com>.
1211301ea0f4Smrg	# How about differentiating between stratus architectures? -djm
1212301ea0f4Smrg	echo hppa1.1-stratus-sysv4
12130cc67336Smrg	exit ;;
1214301ea0f4Smrg    *:*:*:FTX*)
1215301ea0f4Smrg	# From seanf@swdc.stratus.com.
1216301ea0f4Smrg	echo i860-stratus-sysv4
12170cc67336Smrg	exit ;;
12180cc67336Smrg    i*86:VOS:*:*)
12190cc67336Smrg	# From Paul.Green@stratus.com.
12200cc67336Smrg	echo ${UNAME_MACHINE}-stratus-vos
12210cc67336Smrg	exit ;;
1222301ea0f4Smrg    *:VOS:*:*)
1223301ea0f4Smrg	# From Paul.Green@stratus.com.
1224301ea0f4Smrg	echo hppa1.1-stratus-vos
12250cc67336Smrg	exit ;;
1226301ea0f4Smrg    mc68*:A/UX:*:*)
1227301ea0f4Smrg	echo m68k-apple-aux${UNAME_RELEASE}
12280cc67336Smrg	exit ;;
1229301ea0f4Smrg    news*:NEWS-OS:6*:*)
1230301ea0f4Smrg	echo mips-sony-newsos6
12310cc67336Smrg	exit ;;
1232301ea0f4Smrg    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
1233301ea0f4Smrg	if [ -d /usr/nec ]; then
1234213fdd94Smrg		echo mips-nec-sysv${UNAME_RELEASE}
1235301ea0f4Smrg	else
1236213fdd94Smrg		echo mips-unknown-sysv${UNAME_RELEASE}
1237301ea0f4Smrg	fi
1238213fdd94Smrg	exit ;;
1239301ea0f4Smrg    BeBox:BeOS:*:*)	# BeOS running on hardware made by Be, PPC only.
1240301ea0f4Smrg	echo powerpc-be-beos
12410cc67336Smrg	exit ;;
1242301ea0f4Smrg    BeMac:BeOS:*:*)	# BeOS running on Mac or Mac clone, PPC only.
1243301ea0f4Smrg	echo powerpc-apple-beos
12440cc67336Smrg	exit ;;
1245301ea0f4Smrg    BePC:BeOS:*:*)	# BeOS running on Intel PC compatible.
1246301ea0f4Smrg	echo i586-pc-beos
12470cc67336Smrg	exit ;;
1248213fdd94Smrg    BePC:Haiku:*:*)	# Haiku running on Intel PC compatible.
1249213fdd94Smrg	echo i586-pc-haiku
1250213fdd94Smrg	exit ;;
125118552c8aSmrg    x86_64:Haiku:*:*)
125218552c8aSmrg	echo x86_64-unknown-haiku
125318552c8aSmrg	exit ;;
1254301ea0f4Smrg    SX-4:SUPER-UX:*:*)
1255301ea0f4Smrg	echo sx4-nec-superux${UNAME_RELEASE}
12560cc67336Smrg	exit ;;
1257301ea0f4Smrg    SX-5:SUPER-UX:*:*)
1258301ea0f4Smrg	echo sx5-nec-superux${UNAME_RELEASE}
12590cc67336Smrg	exit ;;
1260301ea0f4Smrg    SX-6:SUPER-UX:*:*)
1261301ea0f4Smrg	echo sx6-nec-superux${UNAME_RELEASE}
12620cc67336Smrg	exit ;;
12630cc67336Smrg    SX-7:SUPER-UX:*:*)
12640cc67336Smrg	echo sx7-nec-superux${UNAME_RELEASE}
12650cc67336Smrg	exit ;;
12660cc67336Smrg    SX-8:SUPER-UX:*:*)
12670cc67336Smrg	echo sx8-nec-superux${UNAME_RELEASE}
12680cc67336Smrg	exit ;;
12690cc67336Smrg    SX-8R:SUPER-UX:*:*)
12700cc67336Smrg	echo sx8r-nec-superux${UNAME_RELEASE}
12710cc67336Smrg	exit ;;
1272301ea0f4Smrg    Power*:Rhapsody:*:*)
1273301ea0f4Smrg	echo powerpc-apple-rhapsody${UNAME_RELEASE}
12740cc67336Smrg	exit ;;
1275301ea0f4Smrg    *:Rhapsody:*:*)
1276301ea0f4Smrg	echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
12770cc67336Smrg	exit ;;
1278301ea0f4Smrg    *:Darwin:*:*)
12790cc67336Smrg	UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
128018552c8aSmrg	eval $set_cc_for_build
128118552c8aSmrg	if test "$UNAME_PROCESSOR" = unknown ; then
128218552c8aSmrg	    UNAME_PROCESSOR=powerpc
128318552c8aSmrg	fi
128418552c8aSmrg	if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then
1285d94624a0Smrg	    if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
128618552c8aSmrg		if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
1287d94624a0Smrg		    (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
128818552c8aSmrg		    grep IS_64BIT_ARCH >/dev/null
128918552c8aSmrg		then
129018552c8aSmrg		    case $UNAME_PROCESSOR in
129118552c8aSmrg			i386) UNAME_PROCESSOR=x86_64 ;;
129218552c8aSmrg			powerpc) UNAME_PROCESSOR=powerpc64 ;;
129318552c8aSmrg		    esac
129418552c8aSmrg		fi
129518552c8aSmrg	    fi
129618552c8aSmrg	elif test "$UNAME_PROCESSOR" = i386 ; then
129718552c8aSmrg	    # Avoid executing cc on OS X 10.9, as it ships with a stub
129818552c8aSmrg	    # that puts up a graphical alert prompting to install
129918552c8aSmrg	    # developer tools.  Any system running Mac OS X 10.7 or
130018552c8aSmrg	    # later (Darwin 11 and later) is required to have a 64-bit
130118552c8aSmrg	    # processor. This is not true of the ARM version of Darwin
130218552c8aSmrg	    # that Apple uses in portable devices.
130318552c8aSmrg	    UNAME_PROCESSOR=x86_64
130418552c8aSmrg	fi
1305301ea0f4Smrg	echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
13060cc67336Smrg	exit ;;
1307301ea0f4Smrg    *:procnto*:*:* | *:QNX:[0123456789]*:*)
1308301ea0f4Smrg	UNAME_PROCESSOR=`uname -p`
1309d94624a0Smrg	if test "$UNAME_PROCESSOR" = "x86"; then
1310301ea0f4Smrg		UNAME_PROCESSOR=i386
1311301ea0f4Smrg		UNAME_MACHINE=pc
1312301ea0f4Smrg	fi
1313301ea0f4Smrg	echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
13140cc67336Smrg	exit ;;
1315301ea0f4Smrg    *:QNX:*:4*)
1316301ea0f4Smrg	echo i386-pc-qnx
13170cc67336Smrg	exit ;;
1318213fdd94Smrg    NEO-?:NONSTOP_KERNEL:*:*)
1319213fdd94Smrg	echo neo-tandem-nsk${UNAME_RELEASE}
1320213fdd94Smrg	exit ;;
132118552c8aSmrg    NSE-*:NONSTOP_KERNEL:*:*)
13220cc67336Smrg	echo nse-tandem-nsk${UNAME_RELEASE}
13230cc67336Smrg	exit ;;
13240cc67336Smrg    NSR-?:NONSTOP_KERNEL:*:*)
1325301ea0f4Smrg	echo nsr-tandem-nsk${UNAME_RELEASE}
13260cc67336Smrg	exit ;;
1327301ea0f4Smrg    *:NonStop-UX:*:*)
1328301ea0f4Smrg	echo mips-compaq-nonstopux
13290cc67336Smrg	exit ;;
1330301ea0f4Smrg    BS2000:POSIX*:*:*)
1331301ea0f4Smrg	echo bs2000-siemens-sysv
13320cc67336Smrg	exit ;;
1333301ea0f4Smrg    DS/*:UNIX_System_V:*:*)
1334301ea0f4Smrg	echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
13350cc67336Smrg	exit ;;
1336301ea0f4Smrg    *:Plan9:*:*)
1337301ea0f4Smrg	# "uname -m" is not consistent, so use $cputype instead. 386
1338301ea0f4Smrg	# is converted to i386 for consistency with other x86
1339301ea0f4Smrg	# operating systems.
1340d94624a0Smrg	if test "$cputype" = "386"; then
1341301ea0f4Smrg	    UNAME_MACHINE=i386
1342301ea0f4Smrg	else
1343301ea0f4Smrg	    UNAME_MACHINE="$cputype"
1344301ea0f4Smrg	fi
1345301ea0f4Smrg	echo ${UNAME_MACHINE}-unknown-plan9
13460cc67336Smrg	exit ;;
1347301ea0f4Smrg    *:TOPS-10:*:*)
1348301ea0f4Smrg	echo pdp10-unknown-tops10
13490cc67336Smrg	exit ;;
1350301ea0f4Smrg    *:TENEX:*:*)
1351301ea0f4Smrg	echo pdp10-unknown-tenex
13520cc67336Smrg	exit ;;
1353301ea0f4Smrg    KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
1354301ea0f4Smrg	echo pdp10-dec-tops20
13550cc67336Smrg	exit ;;
1356301ea0f4Smrg    XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
1357301ea0f4Smrg	echo pdp10-xkl-tops20
13580cc67336Smrg	exit ;;
1359301ea0f4Smrg    *:TOPS-20:*:*)
1360301ea0f4Smrg	echo pdp10-unknown-tops20
13610cc67336Smrg	exit ;;
1362301ea0f4Smrg    *:ITS:*:*)
1363301ea0f4Smrg	echo pdp10-unknown-its
13640cc67336Smrg	exit ;;
1365301ea0f4Smrg    SEI:*:*:SEIUX)
1366213fdd94Smrg	echo mips-sei-seiux${UNAME_RELEASE}
13670cc67336Smrg	exit ;;
13680cc67336Smrg    *:DragonFly:*:*)
13690cc67336Smrg	echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
13700cc67336Smrg	exit ;;
13710cc67336Smrg    *:*VMS:*:*)
1372213fdd94Smrg	UNAME_MACHINE=`(uname -p) 2>/dev/null`
13730cc67336Smrg	case "${UNAME_MACHINE}" in
13740cc67336Smrg	    A*) echo alpha-dec-vms ; exit ;;
13750cc67336Smrg	    I*) echo ia64-dec-vms ; exit ;;
13760cc67336Smrg	    V*) echo vax-dec-vms ; exit ;;
13770cc67336Smrg	esac ;;
13780cc67336Smrg    *:XENIX:*:SysV)
13790cc67336Smrg	echo i386-pc-xenix
13800cc67336Smrg	exit ;;
13810cc67336Smrg    i*86:skyos:*:*)
1382d94624a0Smrg	echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
13830cc67336Smrg	exit ;;
13840cc67336Smrg    i*86:rdos:*:*)
13850cc67336Smrg	echo ${UNAME_MACHINE}-pc-rdos
13860cc67336Smrg	exit ;;
1387213fdd94Smrg    i*86:AROS:*:*)
1388213fdd94Smrg	echo ${UNAME_MACHINE}-pc-aros
1389213fdd94Smrg	exit ;;
139018552c8aSmrg    x86_64:VMkernel:*:*)
139118552c8aSmrg	echo ${UNAME_MACHINE}-unknown-esx
13920cc67336Smrg	exit ;;
139318552c8aSmrgesac
1394301ea0f4Smrg
1395301ea0f4Smrgcat >&2 <<EOF
1396301ea0f4Smrg$0: unable to guess system type
1397301ea0f4Smrg
1398301ea0f4SmrgThis script, last modified $timestamp, has failed to recognize
1399301ea0f4Smrgthe operating system you are using. It is advised that you
1400301ea0f4Smrgdownload the most up to date version of the config scripts from
1401301ea0f4Smrg
1402d94624a0Smrg  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
14030cc67336Smrgand
1404d94624a0Smrg  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
1405301ea0f4Smrg
1406301ea0f4SmrgIf the version you run ($0) is already up to date, please
1407301ea0f4Smrgsend the following data and any information you think might be
1408301ea0f4Smrgpertinent to <config-patches@gnu.org> in order to provide the needed
1409301ea0f4Smrginformation to handle your system.
1410301ea0f4Smrg
1411301ea0f4Smrgconfig.guess timestamp = $timestamp
1412301ea0f4Smrg
1413301ea0f4Smrguname -m = `(uname -m) 2>/dev/null || echo unknown`
1414301ea0f4Smrguname -r = `(uname -r) 2>/dev/null || echo unknown`
1415301ea0f4Smrguname -s = `(uname -s) 2>/dev/null || echo unknown`
1416301ea0f4Smrguname -v = `(uname -v) 2>/dev/null || echo unknown`
1417301ea0f4Smrg
1418301ea0f4Smrg/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
1419301ea0f4Smrg/bin/uname -X     = `(/bin/uname -X) 2>/dev/null`
1420301ea0f4Smrg
1421301ea0f4Smrghostinfo               = `(hostinfo) 2>/dev/null`
1422301ea0f4Smrg/bin/universe          = `(/bin/universe) 2>/dev/null`
1423301ea0f4Smrg/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null`
1424301ea0f4Smrg/bin/arch              = `(/bin/arch) 2>/dev/null`
1425301ea0f4Smrg/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`
1426301ea0f4Smrg/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
1427301ea0f4Smrg
1428301ea0f4SmrgUNAME_MACHINE = ${UNAME_MACHINE}
1429301ea0f4SmrgUNAME_RELEASE = ${UNAME_RELEASE}
1430301ea0f4SmrgUNAME_SYSTEM  = ${UNAME_SYSTEM}
1431301ea0f4SmrgUNAME_VERSION = ${UNAME_VERSION}
1432301ea0f4SmrgEOF
1433301ea0f4Smrg
1434301ea0f4Smrgexit 1
1435301ea0f4Smrg
1436301ea0f4Smrg# Local variables:
1437301ea0f4Smrg# eval: (add-hook 'write-file-hooks 'time-stamp)
1438301ea0f4Smrg# time-stamp-start: "timestamp='"
1439301ea0f4Smrg# time-stamp-format: "%:y-%02m-%02d"
1440301ea0f4Smrg# time-stamp-end: "'"
1441301ea0f4Smrg# End:
1442