config.guess revision 8bf5c682
1de2362d3Smrg#! /bin/sh
2de2362d3Smrg# Attempt to guess a canonical system name.
38bf5c682Smrg#   Copyright 1992-2018 Free Software Foundation, Inc.
4de2362d3Smrg
58bf5c682Smrgtimestamp='2018-02-24'
6de2362d3Smrg
7de2362d3Smrg# This file is free software; you can redistribute it and/or modify it
8de2362d3Smrg# under the terms of the GNU General Public License as published by
918781e08Smrg# the Free Software Foundation; either version 3 of the License, or
10de2362d3Smrg# (at your option) any later version.
11de2362d3Smrg#
12de2362d3Smrg# This program is distributed in the hope that it will be useful, but
13de2362d3Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
14de2362d3Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15de2362d3Smrg# General Public License for more details.
16de2362d3Smrg#
17de2362d3Smrg# You should have received a copy of the GNU General Public License
188bf5c682Smrg# along with this program; if not, see <https://www.gnu.org/licenses/>.
19de2362d3Smrg#
20de2362d3Smrg# As a special exception to the GNU General Public License, if you
21de2362d3Smrg# distribute this file as part of a program that contains a
22de2362d3Smrg# configuration script generated by Autoconf, you may include it under
2318781e08Smrg# the same distribution terms that you use for the rest of that
2418781e08Smrg# program.  This Exception is an additional permission under section 7
2518781e08Smrg# of the GNU General Public License, version 3 ("GPLv3").
26de2362d3Smrg#
2718781e08Smrg# Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
28de2362d3Smrg#
290d16fef4Smrg# You can get the latest version of this script from:
308bf5c682Smrg# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
3118781e08Smrg#
3218781e08Smrg# Please send patches to <config-patches@gnu.org>.
3318781e08Smrg
34de2362d3Smrg
35de2362d3Smrgme=`echo "$0" | sed -e 's,.*/,,'`
36de2362d3Smrg
37de2362d3Smrgusage="\
38de2362d3SmrgUsage: $0 [OPTION]
39de2362d3Smrg
40de2362d3SmrgOutput the configuration name of the system \`$me' is run on.
41de2362d3Smrg
428bf5c682SmrgOptions:
43de2362d3Smrg  -h, --help         print this help, then exit
44de2362d3Smrg  -t, --time-stamp   print date of last modification, then exit
45de2362d3Smrg  -v, --version      print version number, then exit
46de2362d3Smrg
47de2362d3SmrgReport bugs and patches to <config-patches@gnu.org>."
48de2362d3Smrg
49de2362d3Smrgversion="\
50de2362d3SmrgGNU config.guess ($timestamp)
51de2362d3Smrg
52de2362d3SmrgOriginally written by Per Bothner.
538bf5c682SmrgCopyright 1992-2018 Free Software Foundation, Inc.
54de2362d3Smrg
55de2362d3SmrgThis is free software; see the source for copying conditions.  There is NO
56de2362d3Smrgwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
57de2362d3Smrg
58de2362d3Smrghelp="
59de2362d3SmrgTry \`$me --help' for more information."
60de2362d3Smrg
61de2362d3Smrg# Parse command line
62de2362d3Smrgwhile test $# -gt 0 ; do
63de2362d3Smrg  case $1 in
64de2362d3Smrg    --time-stamp | --time* | -t )
65de2362d3Smrg       echo "$timestamp" ; exit ;;
66de2362d3Smrg    --version | -v )
67de2362d3Smrg       echo "$version" ; exit ;;
68de2362d3Smrg    --help | --h* | -h )
69de2362d3Smrg       echo "$usage"; exit ;;
70de2362d3Smrg    -- )     # Stop option processing
71de2362d3Smrg       shift; break ;;
72de2362d3Smrg    - )	# Use stdin as input.
73de2362d3Smrg       break ;;
74de2362d3Smrg    -* )
75de2362d3Smrg       echo "$me: invalid option $1$help" >&2
76de2362d3Smrg       exit 1 ;;
77de2362d3Smrg    * )
78de2362d3Smrg       break ;;
79de2362d3Smrg  esac
80de2362d3Smrgdone
81de2362d3Smrg
82de2362d3Smrgif test $# != 0; then
83de2362d3Smrg  echo "$me: too many arguments$help" >&2
84de2362d3Smrg  exit 1
85de2362d3Smrgfi
86de2362d3Smrg
87de2362d3Smrgtrap 'exit 1' 1 2 15
88de2362d3Smrg
89de2362d3Smrg# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
90de2362d3Smrg# compiler to aid in system detection is discouraged as it requires
91de2362d3Smrg# temporary files to be created and, as you can see below, it is a
92de2362d3Smrg# headache to deal with in a portable fashion.
93de2362d3Smrg
94de2362d3Smrg# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
95de2362d3Smrg# use `HOST_CC' if defined, but it is deprecated.
96de2362d3Smrg
97de2362d3Smrg# Portable tmp directory creation inspired by the Autoconf team.
98de2362d3Smrg
99de2362d3Smrgset_cc_for_build='
100de2362d3Smrgtrap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
101de2362d3Smrgtrap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
102de2362d3Smrg: ${TMPDIR=/tmp} ;
103de2362d3Smrg { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
104de2362d3Smrg { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
105de2362d3Smrg { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
106de2362d3Smrg { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
107de2362d3Smrgdummy=$tmp/dummy ;
108de2362d3Smrgtmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
109de2362d3Smrgcase $CC_FOR_BUILD,$HOST_CC,$CC in
1108bf5c682Smrg ,,)    echo "int x;" > "$dummy.c" ;
111de2362d3Smrg	for c in cc gcc c89 c99 ; do
1128bf5c682Smrg	  if ($c -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then
113de2362d3Smrg	     CC_FOR_BUILD="$c"; break ;
114de2362d3Smrg	  fi ;
115de2362d3Smrg	done ;
116de2362d3Smrg	if test x"$CC_FOR_BUILD" = x ; then
117de2362d3Smrg	  CC_FOR_BUILD=no_compiler_found ;
118de2362d3Smrg	fi
119de2362d3Smrg	;;
120de2362d3Smrg ,,*)   CC_FOR_BUILD=$CC ;;
121de2362d3Smrg ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
122de2362d3Smrgesac ; set_cc_for_build= ;'
123de2362d3Smrg
124de2362d3Smrg# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
125de2362d3Smrg# (ghazi@noc.rutgers.edu 1994-08-24)
126de2362d3Smrgif (test -f /.attbin/uname) >/dev/null 2>&1 ; then
127de2362d3Smrg	PATH=$PATH:/.attbin ; export PATH
128de2362d3Smrgfi
129de2362d3Smrg
130de2362d3SmrgUNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
131de2362d3SmrgUNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
132de2362d3SmrgUNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
133de2362d3SmrgUNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
134de2362d3Smrg
1358bf5c682Smrgcase "$UNAME_SYSTEM" in
13618781e08SmrgLinux|GNU|GNU/*)
13718781e08Smrg	# If the system lacks a compiler, then just pick glibc.
13818781e08Smrg	# We could probably try harder.
13918781e08Smrg	LIBC=gnu
14018781e08Smrg
1418bf5c682Smrg	eval "$set_cc_for_build"
1428bf5c682Smrg	cat <<-EOF > "$dummy.c"
14318781e08Smrg	#include <features.h>
14418781e08Smrg	#if defined(__UCLIBC__)
14518781e08Smrg	LIBC=uclibc
14618781e08Smrg	#elif defined(__dietlibc__)
14718781e08Smrg	LIBC=dietlibc
14818781e08Smrg	#else
14918781e08Smrg	LIBC=gnu
15018781e08Smrg	#endif
15118781e08Smrg	EOF
1528bf5c682Smrg	eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`"
1538bf5c682Smrg
1548bf5c682Smrg	# If ldd exists, use it to detect musl libc.
1558bf5c682Smrg	if command -v ldd >/dev/null && \
1568bf5c682Smrg		ldd --version 2>&1 | grep -q ^musl
1578bf5c682Smrg	then
1588bf5c682Smrg	    LIBC=musl
1598bf5c682Smrg	fi
16018781e08Smrg	;;
16118781e08Smrgesac
16218781e08Smrg
163de2362d3Smrg# Note: order is significant - the case branches are not exclusive.
164de2362d3Smrg
1658bf5c682Smrgcase "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
166de2362d3Smrg    *:NetBSD:*:*)
167de2362d3Smrg	# NetBSD (nbsd) targets should (where applicable) match one or
16818781e08Smrg	# more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
169de2362d3Smrg	# *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
170de2362d3Smrg	# switched to ELF, *-*-netbsd* would select the old
171de2362d3Smrg	# object file format.  This provides both forward
172de2362d3Smrg	# compatibility and a consistent mechanism for selecting the
173de2362d3Smrg	# object file format.
174de2362d3Smrg	#
175de2362d3Smrg	# Note: NetBSD doesn't particularly care about the vendor
176de2362d3Smrg	# portion of the name.  We always set it to "unknown".
177de2362d3Smrg	sysctl="sysctl -n hw.machine_arch"
17818781e08Smrg	UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \
1798bf5c682Smrg	    "/sbin/$sysctl" 2>/dev/null || \
1808bf5c682Smrg	    "/usr/sbin/$sysctl" 2>/dev/null || \
18118781e08Smrg	    echo unknown)`
1828bf5c682Smrg	case "$UNAME_MACHINE_ARCH" in
183de2362d3Smrg	    armeb) machine=armeb-unknown ;;
184de2362d3Smrg	    arm*) machine=arm-unknown ;;
185de2362d3Smrg	    sh3el) machine=shl-unknown ;;
186de2362d3Smrg	    sh3eb) machine=sh-unknown ;;
187de2362d3Smrg	    sh5el) machine=sh5le-unknown ;;
18818781e08Smrg	    earmv*)
1898bf5c682Smrg		arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'`
1908bf5c682Smrg		endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'`
1918bf5c682Smrg		machine="${arch}${endian}"-unknown
19218781e08Smrg		;;
1938bf5c682Smrg	    *) machine="$UNAME_MACHINE_ARCH"-unknown ;;
194de2362d3Smrg	esac
195de2362d3Smrg	# The Operating System including object format, if it has switched
1963ed65abbSmrg	# to ELF recently (or will in the future) and ABI.
1978bf5c682Smrg	case "$UNAME_MACHINE_ARCH" in
1983ed65abbSmrg	    earm*)
1993ed65abbSmrg		os=netbsdelf
2003ed65abbSmrg		;;
2013ed65abbSmrg	    arm*|i386|m68k|ns32k|sh3*|sparc|vax)
2028bf5c682Smrg		eval "$set_cc_for_build"
203de2362d3Smrg		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
2040d16fef4Smrg			| grep -q __ELF__
205de2362d3Smrg		then
206de2362d3Smrg		    # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
207de2362d3Smrg		    # Return netbsd for either.  FIX?
208de2362d3Smrg		    os=netbsd
209de2362d3Smrg		else
210de2362d3Smrg		    os=netbsdelf
211de2362d3Smrg		fi
212de2362d3Smrg		;;
213de2362d3Smrg	    *)
21418781e08Smrg		os=netbsd
21518781e08Smrg		;;
21618781e08Smrg	esac
21718781e08Smrg	# Determine ABI tags.
2188bf5c682Smrg	case "$UNAME_MACHINE_ARCH" in
21918781e08Smrg	    earm*)
22018781e08Smrg		expr='s/^earmv[0-9]/-eabi/;s/eb$//'
2218bf5c682Smrg		abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"`
222de2362d3Smrg		;;
223de2362d3Smrg	esac
224de2362d3Smrg	# The OS release
225de2362d3Smrg	# Debian GNU/NetBSD machines have a different userland, and
226de2362d3Smrg	# thus, need a distinct triplet. However, they do not need
227de2362d3Smrg	# kernel version information, so it can be replaced with a
228de2362d3Smrg	# suitable tag, in the style of linux-gnu.
2298bf5c682Smrg	case "$UNAME_VERSION" in
230de2362d3Smrg	    Debian*)
231de2362d3Smrg		release='-gnu'
232de2362d3Smrg		;;
233de2362d3Smrg	    *)
2348bf5c682Smrg		release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2`
235de2362d3Smrg		;;
236de2362d3Smrg	esac
237de2362d3Smrg	# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
238de2362d3Smrg	# contains redundant information, the shorter form:
239de2362d3Smrg	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
2408bf5c682Smrg	echo "$machine-${os}${release}${abi}"
24118781e08Smrg	exit ;;
24218781e08Smrg    *:Bitrig:*:*)
24318781e08Smrg	UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
2448bf5c682Smrg	echo "$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE"
245de2362d3Smrg	exit ;;
246de2362d3Smrg    *:OpenBSD:*:*)
247de2362d3Smrg	UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
2488bf5c682Smrg	echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE"
249de2362d3Smrg	exit ;;
25018781e08Smrg    *:LibertyBSD:*:*)
25118781e08Smrg	UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'`
2528bf5c682Smrg	echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE"
2538bf5c682Smrg	exit ;;
2548bf5c682Smrg    *:MidnightBSD:*:*)
2558bf5c682Smrg	echo "$UNAME_MACHINE"-unknown-midnightbsd"$UNAME_RELEASE"
25618781e08Smrg	exit ;;
257de2362d3Smrg    *:ekkoBSD:*:*)
2588bf5c682Smrg	echo "$UNAME_MACHINE"-unknown-ekkobsd"$UNAME_RELEASE"
259de2362d3Smrg	exit ;;
260de2362d3Smrg    *:SolidBSD:*:*)
2618bf5c682Smrg	echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE"
262de2362d3Smrg	exit ;;
263de2362d3Smrg    macppc:MirBSD:*:*)
2648bf5c682Smrg	echo powerpc-unknown-mirbsd"$UNAME_RELEASE"
265de2362d3Smrg	exit ;;
266de2362d3Smrg    *:MirBSD:*:*)
2678bf5c682Smrg	echo "$UNAME_MACHINE"-unknown-mirbsd"$UNAME_RELEASE"
268de2362d3Smrg	exit ;;
26918781e08Smrg    *:Sortix:*:*)
2708bf5c682Smrg	echo "$UNAME_MACHINE"-unknown-sortix
27118781e08Smrg	exit ;;
2728bf5c682Smrg    *:Redox:*:*)
2738bf5c682Smrg	echo "$UNAME_MACHINE"-unknown-redox
2748bf5c682Smrg	exit ;;
2758bf5c682Smrg    mips:OSF1:*.*)
2768bf5c682Smrg        echo mips-dec-osf1
2778bf5c682Smrg        exit ;;
278de2362d3Smrg    alpha:OSF1:*:*)
279de2362d3Smrg	case $UNAME_RELEASE in
280de2362d3Smrg	*4.0)
281de2362d3Smrg		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
282de2362d3Smrg		;;
283de2362d3Smrg	*5.*)
28418781e08Smrg		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
285de2362d3Smrg		;;
286de2362d3Smrg	esac
287de2362d3Smrg	# According to Compaq, /usr/sbin/psrinfo has been available on
288de2362d3Smrg	# OSF/1 and Tru64 systems produced since 1995.  I hope that
289de2362d3Smrg	# covers most systems running today.  This code pipes the CPU
290de2362d3Smrg	# types through head -n 1, so we only detect the type of CPU 0.
291de2362d3Smrg	ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\) processor.*$/\1/p' | head -n 1`
292de2362d3Smrg	case "$ALPHA_CPU_TYPE" in
293de2362d3Smrg	    "EV4 (21064)")
29418781e08Smrg		UNAME_MACHINE=alpha ;;
295de2362d3Smrg	    "EV4.5 (21064)")
29618781e08Smrg		UNAME_MACHINE=alpha ;;
297de2362d3Smrg	    "LCA4 (21066/21068)")
29818781e08Smrg		UNAME_MACHINE=alpha ;;
299de2362d3Smrg	    "EV5 (21164)")
30018781e08Smrg		UNAME_MACHINE=alphaev5 ;;
301de2362d3Smrg	    "EV5.6 (21164A)")
30218781e08Smrg		UNAME_MACHINE=alphaev56 ;;
303de2362d3Smrg	    "EV5.6 (21164PC)")
30418781e08Smrg		UNAME_MACHINE=alphapca56 ;;
305de2362d3Smrg	    "EV5.7 (21164PC)")
30618781e08Smrg		UNAME_MACHINE=alphapca57 ;;
307de2362d3Smrg	    "EV6 (21264)")
30818781e08Smrg		UNAME_MACHINE=alphaev6 ;;
309de2362d3Smrg	    "EV6.7 (21264A)")
31018781e08Smrg		UNAME_MACHINE=alphaev67 ;;
311de2362d3Smrg	    "EV6.8CB (21264C)")
31218781e08Smrg		UNAME_MACHINE=alphaev68 ;;
313de2362d3Smrg	    "EV6.8AL (21264B)")
31418781e08Smrg		UNAME_MACHINE=alphaev68 ;;
315de2362d3Smrg	    "EV6.8CX (21264D)")
31618781e08Smrg		UNAME_MACHINE=alphaev68 ;;
317de2362d3Smrg	    "EV6.9A (21264/EV69A)")
31818781e08Smrg		UNAME_MACHINE=alphaev69 ;;
319de2362d3Smrg	    "EV7 (21364)")
32018781e08Smrg		UNAME_MACHINE=alphaev7 ;;
321de2362d3Smrg	    "EV7.9 (21364A)")
32218781e08Smrg		UNAME_MACHINE=alphaev79 ;;
323de2362d3Smrg	esac
324de2362d3Smrg	# A Pn.n version is a patched version.
325de2362d3Smrg	# A Vn.n version is a released version.
326de2362d3Smrg	# A Tn.n version is a released field test version.
327de2362d3Smrg	# A Xn.n version is an unreleased experimental baselevel.
328de2362d3Smrg	# 1.2 uses "1.2" for uname -r.
3298bf5c682Smrg	echo "$UNAME_MACHINE"-dec-osf"`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`"
33018781e08Smrg	# Reset EXIT trap before exiting to avoid spurious non-zero exit code.
33118781e08Smrg	exitcode=$?
33218781e08Smrg	trap '' 0
33318781e08Smrg	exit $exitcode ;;
334de2362d3Smrg    Amiga*:UNIX_System_V:4.0:*)
335de2362d3Smrg	echo m68k-unknown-sysv4
336de2362d3Smrg	exit ;;
337de2362d3Smrg    *:[Aa]miga[Oo][Ss]:*:*)
3388bf5c682Smrg	echo "$UNAME_MACHINE"-unknown-amigaos
339de2362d3Smrg	exit ;;
340de2362d3Smrg    *:[Mm]orph[Oo][Ss]:*:*)
3418bf5c682Smrg	echo "$UNAME_MACHINE"-unknown-morphos
342de2362d3Smrg	exit ;;
343de2362d3Smrg    *:OS/390:*:*)
344de2362d3Smrg	echo i370-ibm-openedition
345de2362d3Smrg	exit ;;
346de2362d3Smrg    *:z/VM:*:*)
347de2362d3Smrg	echo s390-ibm-zvmoe
348de2362d3Smrg	exit ;;
349de2362d3Smrg    *:OS400:*:*)
35018781e08Smrg	echo powerpc-ibm-os400
351de2362d3Smrg	exit ;;
352de2362d3Smrg    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
3538bf5c682Smrg	echo arm-acorn-riscix"$UNAME_RELEASE"
354de2362d3Smrg	exit ;;
35518781e08Smrg    arm*:riscos:*:*|arm*:RISCOS:*:*)
356de2362d3Smrg	echo arm-unknown-riscos
357de2362d3Smrg	exit ;;
358de2362d3Smrg    SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
359de2362d3Smrg	echo hppa1.1-hitachi-hiuxmpp
360de2362d3Smrg	exit ;;
361de2362d3Smrg    Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
362de2362d3Smrg	# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
363de2362d3Smrg	if test "`(/bin/universe) 2>/dev/null`" = att ; then
364de2362d3Smrg		echo pyramid-pyramid-sysv3
365de2362d3Smrg	else
366de2362d3Smrg		echo pyramid-pyramid-bsd
367de2362d3Smrg	fi
368de2362d3Smrg	exit ;;
369de2362d3Smrg    NILE*:*:*:dcosx)
370de2362d3Smrg	echo pyramid-pyramid-svr4
371de2362d3Smrg	exit ;;
372de2362d3Smrg    DRS?6000:unix:4.0:6*)
373de2362d3Smrg	echo sparc-icl-nx6
374de2362d3Smrg	exit ;;
375de2362d3Smrg    DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
376de2362d3Smrg	case `/usr/bin/uname -p` in
377de2362d3Smrg	    sparc) echo sparc-icl-nx7; exit ;;
378de2362d3Smrg	esac ;;
3790d16fef4Smrg    s390x:SunOS:*:*)
3808bf5c682Smrg	echo "$UNAME_MACHINE"-ibm-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`"
3810d16fef4Smrg	exit ;;
382de2362d3Smrg    sun4H:SunOS:5.*:*)
3838bf5c682Smrg	echo sparc-hal-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
384de2362d3Smrg	exit ;;
385de2362d3Smrg    sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
3868bf5c682Smrg	echo sparc-sun-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`"
387de2362d3Smrg	exit ;;
3880d16fef4Smrg    i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
3898bf5c682Smrg	echo i386-pc-auroraux"$UNAME_RELEASE"
3900d16fef4Smrg	exit ;;
391de2362d3Smrg    i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
3928bf5c682Smrg	eval "$set_cc_for_build"
39318781e08Smrg	SUN_ARCH=i386
3940d16fef4Smrg	# If there is a compiler, see if it is configured for 64-bit objects.
3950d16fef4Smrg	# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
3960d16fef4Smrg	# This test works for both compilers.
39718781e08Smrg	if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
3980d16fef4Smrg	    if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
39918781e08Smrg		(CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
4000d16fef4Smrg		grep IS_64BIT_ARCH >/dev/null
4010d16fef4Smrg	    then
40218781e08Smrg		SUN_ARCH=x86_64
4030d16fef4Smrg	    fi
4040d16fef4Smrg	fi
4058bf5c682Smrg	echo "$SUN_ARCH"-pc-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
406de2362d3Smrg	exit ;;
407de2362d3Smrg    sun4*:SunOS:6*:*)
408de2362d3Smrg	# According to config.sub, this is the proper way to canonicalize
409de2362d3Smrg	# SunOS6.  Hard to guess exactly what SunOS6 will be like, but
410de2362d3Smrg	# it's likely to be more like Solaris than SunOS4.
4118bf5c682Smrg	echo sparc-sun-solaris3"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
412de2362d3Smrg	exit ;;
413de2362d3Smrg    sun4*:SunOS:*:*)
414de2362d3Smrg	case "`/usr/bin/arch -k`" in
415de2362d3Smrg	    Series*|S4*)
416de2362d3Smrg		UNAME_RELEASE=`uname -v`
417de2362d3Smrg		;;
418de2362d3Smrg	esac
419de2362d3Smrg	# Japanese Language versions have a version number like `4.1.3-JL'.
4208bf5c682Smrg	echo sparc-sun-sunos"`echo "$UNAME_RELEASE"|sed -e 's/-/_/'`"
421de2362d3Smrg	exit ;;
422de2362d3Smrg    sun3*:SunOS:*:*)
4238bf5c682Smrg	echo m68k-sun-sunos"$UNAME_RELEASE"
424de2362d3Smrg	exit ;;
425de2362d3Smrg    sun*:*:4.2BSD:*)
426de2362d3Smrg	UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
4278bf5c682Smrg	test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3
428de2362d3Smrg	case "`/bin/arch`" in
429de2362d3Smrg	    sun3)
4308bf5c682Smrg		echo m68k-sun-sunos"$UNAME_RELEASE"
431de2362d3Smrg		;;
432de2362d3Smrg	    sun4)
4338bf5c682Smrg		echo sparc-sun-sunos"$UNAME_RELEASE"
434de2362d3Smrg		;;
435de2362d3Smrg	esac
436de2362d3Smrg	exit ;;
437de2362d3Smrg    aushp:SunOS:*:*)
4388bf5c682Smrg	echo sparc-auspex-sunos"$UNAME_RELEASE"
439de2362d3Smrg	exit ;;
440de2362d3Smrg    # The situation for MiNT is a little confusing.  The machine name
441de2362d3Smrg    # can be virtually everything (everything which is not
442de2362d3Smrg    # "atarist" or "atariste" at least should have a processor
443de2362d3Smrg    # > m68000).  The system name ranges from "MiNT" over "FreeMiNT"
444de2362d3Smrg    # to the lowercase version "mint" (or "freemint").  Finally
445de2362d3Smrg    # the system name "TOS" denotes a system which is actually not
446de2362d3Smrg    # MiNT.  But MiNT is downward compatible to TOS, so this should
447de2362d3Smrg    # be no problem.
448de2362d3Smrg    atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
4498bf5c682Smrg	echo m68k-atari-mint"$UNAME_RELEASE"
450de2362d3Smrg	exit ;;
451de2362d3Smrg    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
4528bf5c682Smrg	echo m68k-atari-mint"$UNAME_RELEASE"
45318781e08Smrg	exit ;;
454de2362d3Smrg    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
4558bf5c682Smrg	echo m68k-atari-mint"$UNAME_RELEASE"
456de2362d3Smrg	exit ;;
457de2362d3Smrg    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
4588bf5c682Smrg	echo m68k-milan-mint"$UNAME_RELEASE"
45918781e08Smrg	exit ;;
460de2362d3Smrg    hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
4618bf5c682Smrg	echo m68k-hades-mint"$UNAME_RELEASE"
46218781e08Smrg	exit ;;
463de2362d3Smrg    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
4648bf5c682Smrg	echo m68k-unknown-mint"$UNAME_RELEASE"
46518781e08Smrg	exit ;;
466de2362d3Smrg    m68k:machten:*:*)
4678bf5c682Smrg	echo m68k-apple-machten"$UNAME_RELEASE"
468de2362d3Smrg	exit ;;
469de2362d3Smrg    powerpc:machten:*:*)
4708bf5c682Smrg	echo powerpc-apple-machten"$UNAME_RELEASE"
471de2362d3Smrg	exit ;;
472de2362d3Smrg    RISC*:Mach:*:*)
473de2362d3Smrg	echo mips-dec-mach_bsd4.3
474de2362d3Smrg	exit ;;
475de2362d3Smrg    RISC*:ULTRIX:*:*)
4768bf5c682Smrg	echo mips-dec-ultrix"$UNAME_RELEASE"
477de2362d3Smrg	exit ;;
478de2362d3Smrg    VAX*:ULTRIX*:*:*)
4798bf5c682Smrg	echo vax-dec-ultrix"$UNAME_RELEASE"
480de2362d3Smrg	exit ;;
481de2362d3Smrg    2020:CLIX:*:* | 2430:CLIX:*:*)
4828bf5c682Smrg	echo clipper-intergraph-clix"$UNAME_RELEASE"
483de2362d3Smrg	exit ;;
484de2362d3Smrg    mips:*:*:UMIPS | mips:*:*:RISCos)
4858bf5c682Smrg	eval "$set_cc_for_build"
4868bf5c682Smrg	sed 's/^	//' << EOF > "$dummy.c"
487de2362d3Smrg#ifdef __cplusplus
488de2362d3Smrg#include <stdio.h>  /* for printf() prototype */
489de2362d3Smrg	int main (int argc, char *argv[]) {
490de2362d3Smrg#else
491de2362d3Smrg	int main (argc, argv) int argc; char *argv[]; {
492de2362d3Smrg#endif
493de2362d3Smrg	#if defined (host_mips) && defined (MIPSEB)
494de2362d3Smrg	#if defined (SYSTYPE_SYSV)
4958bf5c682Smrg	  printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0);
496de2362d3Smrg	#endif
497de2362d3Smrg	#if defined (SYSTYPE_SVR4)
4988bf5c682Smrg	  printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0);
499de2362d3Smrg	#endif
500de2362d3Smrg	#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
5018bf5c682Smrg	  printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0);
502de2362d3Smrg	#endif
503de2362d3Smrg	#endif
504de2362d3Smrg	  exit (-1);
505de2362d3Smrg	}
506de2362d3SmrgEOF
5078bf5c682Smrg	$CC_FOR_BUILD -o "$dummy" "$dummy.c" &&
5088bf5c682Smrg	  dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` &&
5098bf5c682Smrg	  SYSTEM_NAME=`"$dummy" "$dummyarg"` &&
510de2362d3Smrg	    { echo "$SYSTEM_NAME"; exit; }
5118bf5c682Smrg	echo mips-mips-riscos"$UNAME_RELEASE"
512de2362d3Smrg	exit ;;
513de2362d3Smrg    Motorola:PowerMAX_OS:*:*)
514de2362d3Smrg	echo powerpc-motorola-powermax
515de2362d3Smrg	exit ;;
516de2362d3Smrg    Motorola:*:4.3:PL8-*)
517de2362d3Smrg	echo powerpc-harris-powermax
518de2362d3Smrg	exit ;;
519de2362d3Smrg    Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
520de2362d3Smrg	echo powerpc-harris-powermax
521de2362d3Smrg	exit ;;
522de2362d3Smrg    Night_Hawk:Power_UNIX:*:*)
523de2362d3Smrg	echo powerpc-harris-powerunix
524de2362d3Smrg	exit ;;
525de2362d3Smrg    m88k:CX/UX:7*:*)
526de2362d3Smrg	echo m88k-harris-cxux7
527de2362d3Smrg	exit ;;
528de2362d3Smrg    m88k:*:4*:R4*)
529de2362d3Smrg	echo m88k-motorola-sysv4
530de2362d3Smrg	exit ;;
531de2362d3Smrg    m88k:*:3*:R3*)
532de2362d3Smrg	echo m88k-motorola-sysv3
533de2362d3Smrg	exit ;;
534de2362d3Smrg    AViiON:dgux:*:*)
53518781e08Smrg	# DG/UX returns AViiON for all architectures
53618781e08Smrg	UNAME_PROCESSOR=`/usr/bin/uname -p`
5378bf5c682Smrg	if [ "$UNAME_PROCESSOR" = mc88100 ] || [ "$UNAME_PROCESSOR" = mc88110 ]
538de2362d3Smrg	then
5398bf5c682Smrg	    if [ "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx ] || \
5408bf5c682Smrg	       [ "$TARGET_BINARY_INTERFACE"x = x ]
541de2362d3Smrg	    then
5428bf5c682Smrg		echo m88k-dg-dgux"$UNAME_RELEASE"
543de2362d3Smrg	    else
5448bf5c682Smrg		echo m88k-dg-dguxbcs"$UNAME_RELEASE"
545de2362d3Smrg	    fi
546de2362d3Smrg	else
5478bf5c682Smrg	    echo i586-dg-dgux"$UNAME_RELEASE"
548de2362d3Smrg	fi
54918781e08Smrg	exit ;;
550de2362d3Smrg    M88*:DolphinOS:*:*)	# DolphinOS (SVR3)
551de2362d3Smrg	echo m88k-dolphin-sysv3
552de2362d3Smrg	exit ;;
553de2362d3Smrg    M88*:*:R3*:*)
554de2362d3Smrg	# Delta 88k system running SVR3
555de2362d3Smrg	echo m88k-motorola-sysv3
556de2362d3Smrg	exit ;;
557de2362d3Smrg    XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
558de2362d3Smrg	echo m88k-tektronix-sysv3
559de2362d3Smrg	exit ;;
560de2362d3Smrg    Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
561de2362d3Smrg	echo m68k-tektronix-bsd
562de2362d3Smrg	exit ;;
563de2362d3Smrg    *:IRIX*:*:*)
5648bf5c682Smrg	echo mips-sgi-irix"`echo "$UNAME_RELEASE"|sed -e 's/-/_/g'`"
565de2362d3Smrg	exit ;;
566de2362d3Smrg    ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
567de2362d3Smrg	echo romp-ibm-aix     # uname -m gives an 8 hex-code CPU id
568de2362d3Smrg	exit ;;               # Note that: echo "'`uname -s`'" gives 'AIX '
569de2362d3Smrg    i*86:AIX:*:*)
570de2362d3Smrg	echo i386-ibm-aix
571de2362d3Smrg	exit ;;
572de2362d3Smrg    ia64:AIX:*:*)
573de2362d3Smrg	if [ -x /usr/bin/oslevel ] ; then
574de2362d3Smrg		IBM_REV=`/usr/bin/oslevel`
575de2362d3Smrg	else
5768bf5c682Smrg		IBM_REV="$UNAME_VERSION.$UNAME_RELEASE"
577de2362d3Smrg	fi
5788bf5c682Smrg	echo "$UNAME_MACHINE"-ibm-aix"$IBM_REV"
579de2362d3Smrg	exit ;;
580de2362d3Smrg    *:AIX:2:3)
581de2362d3Smrg	if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
5828bf5c682Smrg		eval "$set_cc_for_build"
5838bf5c682Smrg		sed 's/^		//' << EOF > "$dummy.c"
584de2362d3Smrg		#include <sys/systemcfg.h>
585de2362d3Smrg
586de2362d3Smrg		main()
587de2362d3Smrg			{
588de2362d3Smrg			if (!__power_pc())
589de2362d3Smrg				exit(1);
590de2362d3Smrg			puts("powerpc-ibm-aix3.2.5");
591de2362d3Smrg			exit(0);
592de2362d3Smrg			}
593de2362d3SmrgEOF
5948bf5c682Smrg		if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"`
595de2362d3Smrg		then
596de2362d3Smrg			echo "$SYSTEM_NAME"
597de2362d3Smrg		else
598de2362d3Smrg			echo rs6000-ibm-aix3.2.5
599de2362d3Smrg		fi
600de2362d3Smrg	elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
601de2362d3Smrg		echo rs6000-ibm-aix3.2.4
602de2362d3Smrg	else
603de2362d3Smrg		echo rs6000-ibm-aix3.2
604de2362d3Smrg	fi
605de2362d3Smrg	exit ;;
60618781e08Smrg    *:AIX:*:[4567])
607de2362d3Smrg	IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
6088bf5c682Smrg	if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then
609de2362d3Smrg		IBM_ARCH=rs6000
610de2362d3Smrg	else
611de2362d3Smrg		IBM_ARCH=powerpc
612de2362d3Smrg	fi
61318781e08Smrg	if [ -x /usr/bin/lslpp ] ; then
61418781e08Smrg		IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc |
61518781e08Smrg			   awk -F: '{ print $3 }' | sed s/[0-9]*$/0/`
616de2362d3Smrg	else
6178bf5c682Smrg		IBM_REV="$UNAME_VERSION.$UNAME_RELEASE"
618de2362d3Smrg	fi
6198bf5c682Smrg	echo "$IBM_ARCH"-ibm-aix"$IBM_REV"
620de2362d3Smrg	exit ;;
621de2362d3Smrg    *:AIX:*:*)
622de2362d3Smrg	echo rs6000-ibm-aix
623de2362d3Smrg	exit ;;
6248bf5c682Smrg    ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*)
625de2362d3Smrg	echo romp-ibm-bsd4.4
626de2362d3Smrg	exit ;;
627de2362d3Smrg    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
6288bf5c682Smrg	echo romp-ibm-bsd"$UNAME_RELEASE"   # 4.3 with uname added to
629de2362d3Smrg	exit ;;                             # report: romp-ibm BSD 4.3
630de2362d3Smrg    *:BOSX:*:*)
631de2362d3Smrg	echo rs6000-bull-bosx
632de2362d3Smrg	exit ;;
633de2362d3Smrg    DPX/2?00:B.O.S.:*:*)
634de2362d3Smrg	echo m68k-bull-sysv3
635de2362d3Smrg	exit ;;
636de2362d3Smrg    9000/[34]??:4.3bsd:1.*:*)
637de2362d3Smrg	echo m68k-hp-bsd
638de2362d3Smrg	exit ;;
639de2362d3Smrg    hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
640de2362d3Smrg	echo m68k-hp-bsd4.4
641de2362d3Smrg	exit ;;
642de2362d3Smrg    9000/[34678]??:HP-UX:*:*)
6438bf5c682Smrg	HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'`
6448bf5c682Smrg	case "$UNAME_MACHINE" in
6458bf5c682Smrg	    9000/31?)            HP_ARCH=m68000 ;;
6468bf5c682Smrg	    9000/[34]??)         HP_ARCH=m68k ;;
647de2362d3Smrg	    9000/[678][0-9][0-9])
648de2362d3Smrg		if [ -x /usr/bin/getconf ]; then
649de2362d3Smrg		    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
65018781e08Smrg		    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
6518bf5c682Smrg		    case "$sc_cpu_version" in
65218781e08Smrg		      523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0
65318781e08Smrg		      528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1
65418781e08Smrg		      532)                      # CPU_PA_RISC2_0
6558bf5c682Smrg			case "$sc_kernel_bits" in
65618781e08Smrg			  32) HP_ARCH=hppa2.0n ;;
65718781e08Smrg			  64) HP_ARCH=hppa2.0w ;;
65818781e08Smrg			  '') HP_ARCH=hppa2.0 ;;   # HP-UX 10.20
65918781e08Smrg			esac ;;
66018781e08Smrg		    esac
661de2362d3Smrg		fi
6628bf5c682Smrg		if [ "$HP_ARCH" = "" ]; then
6638bf5c682Smrg		    eval "$set_cc_for_build"
6648bf5c682Smrg		    sed 's/^		//' << EOF > "$dummy.c"
665de2362d3Smrg
66618781e08Smrg		#define _HPUX_SOURCE
66718781e08Smrg		#include <stdlib.h>
66818781e08Smrg		#include <unistd.h>
669de2362d3Smrg
67018781e08Smrg		int main ()
67118781e08Smrg		{
67218781e08Smrg		#if defined(_SC_KERNEL_BITS)
67318781e08Smrg		    long bits = sysconf(_SC_KERNEL_BITS);
67418781e08Smrg		#endif
67518781e08Smrg		    long cpu  = sysconf (_SC_CPU_VERSION);
676de2362d3Smrg
67718781e08Smrg		    switch (cpu)
67818781e08Smrg			{
67918781e08Smrg			case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
68018781e08Smrg			case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
68118781e08Smrg			case CPU_PA_RISC2_0:
68218781e08Smrg		#if defined(_SC_KERNEL_BITS)
68318781e08Smrg			    switch (bits)
68418781e08Smrg				{
68518781e08Smrg				case 64: puts ("hppa2.0w"); break;
68618781e08Smrg				case 32: puts ("hppa2.0n"); break;
68718781e08Smrg				default: puts ("hppa2.0"); break;
68818781e08Smrg				} break;
68918781e08Smrg		#else  /* !defined(_SC_KERNEL_BITS) */
69018781e08Smrg			    puts ("hppa2.0"); break;
69118781e08Smrg		#endif
69218781e08Smrg			default: puts ("hppa1.0"); break;
69318781e08Smrg			}
69418781e08Smrg		    exit (0);
69518781e08Smrg		}
696de2362d3SmrgEOF
6978bf5c682Smrg		    (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"`
698de2362d3Smrg		    test -z "$HP_ARCH" && HP_ARCH=hppa
699de2362d3Smrg		fi ;;
700de2362d3Smrg	esac
7018bf5c682Smrg	if [ "$HP_ARCH" = hppa2.0w ]
702de2362d3Smrg	then
7038bf5c682Smrg	    eval "$set_cc_for_build"
704de2362d3Smrg
705de2362d3Smrg	    # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
706de2362d3Smrg	    # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler
707de2362d3Smrg	    # generating 64-bit code.  GNU and HP use different nomenclature:
708de2362d3Smrg	    #
709de2362d3Smrg	    # $ CC_FOR_BUILD=cc ./config.guess
710de2362d3Smrg	    # => hppa2.0w-hp-hpux11.23
711de2362d3Smrg	    # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
712de2362d3Smrg	    # => hppa64-hp-hpux11.23
713de2362d3Smrg
71418781e08Smrg	    if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) |
7150d16fef4Smrg		grep -q __LP64__
716de2362d3Smrg	    then
71718781e08Smrg		HP_ARCH=hppa2.0w
718de2362d3Smrg	    else
71918781e08Smrg		HP_ARCH=hppa64
720de2362d3Smrg	    fi
721de2362d3Smrg	fi
7228bf5c682Smrg	echo "$HP_ARCH"-hp-hpux"$HPUX_REV"
723de2362d3Smrg	exit ;;
724de2362d3Smrg    ia64:HP-UX:*:*)
7258bf5c682Smrg	HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'`
7268bf5c682Smrg	echo ia64-hp-hpux"$HPUX_REV"
727de2362d3Smrg	exit ;;
728de2362d3Smrg    3050*:HI-UX:*:*)
7298bf5c682Smrg	eval "$set_cc_for_build"
7308bf5c682Smrg	sed 's/^	//' << EOF > "$dummy.c"
731de2362d3Smrg	#include <unistd.h>
732de2362d3Smrg	int
733de2362d3Smrg	main ()
734de2362d3Smrg	{
735de2362d3Smrg	  long cpu = sysconf (_SC_CPU_VERSION);
736de2362d3Smrg	  /* The order matters, because CPU_IS_HP_MC68K erroneously returns
737de2362d3Smrg	     true for CPU_PA_RISC1_0.  CPU_IS_PA_RISC returns correct
738de2362d3Smrg	     results, however.  */
739de2362d3Smrg	  if (CPU_IS_PA_RISC (cpu))
740de2362d3Smrg	    {
741de2362d3Smrg	      switch (cpu)
742de2362d3Smrg		{
743de2362d3Smrg		  case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
744de2362d3Smrg		  case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
745de2362d3Smrg		  case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
746de2362d3Smrg		  default: puts ("hppa-hitachi-hiuxwe2"); break;
747de2362d3Smrg		}
748de2362d3Smrg	    }
749de2362d3Smrg	  else if (CPU_IS_HP_MC68K (cpu))
750de2362d3Smrg	    puts ("m68k-hitachi-hiuxwe2");
751de2362d3Smrg	  else puts ("unknown-hitachi-hiuxwe2");
752de2362d3Smrg	  exit (0);
753de2362d3Smrg	}
754de2362d3SmrgEOF
7558bf5c682Smrg	$CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` &&
756de2362d3Smrg		{ echo "$SYSTEM_NAME"; exit; }
757de2362d3Smrg	echo unknown-hitachi-hiuxwe2
758de2362d3Smrg	exit ;;
7598bf5c682Smrg    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*)
760de2362d3Smrg	echo hppa1.1-hp-bsd
761de2362d3Smrg	exit ;;
762de2362d3Smrg    9000/8??:4.3bsd:*:*)
763de2362d3Smrg	echo hppa1.0-hp-bsd
764de2362d3Smrg	exit ;;
765de2362d3Smrg    *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
766de2362d3Smrg	echo hppa1.0-hp-mpeix
767de2362d3Smrg	exit ;;
7688bf5c682Smrg    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*)
769de2362d3Smrg	echo hppa1.1-hp-osf
770de2362d3Smrg	exit ;;
771de2362d3Smrg    hp8??:OSF1:*:*)
772de2362d3Smrg	echo hppa1.0-hp-osf
773de2362d3Smrg	exit ;;
774de2362d3Smrg    i*86:OSF1:*:*)
775de2362d3Smrg	if [ -x /usr/sbin/sysversion ] ; then
7768bf5c682Smrg	    echo "$UNAME_MACHINE"-unknown-osf1mk
777de2362d3Smrg	else
7788bf5c682Smrg	    echo "$UNAME_MACHINE"-unknown-osf1
779de2362d3Smrg	fi
780de2362d3Smrg	exit ;;
781de2362d3Smrg    parisc*:Lites*:*:*)
782de2362d3Smrg	echo hppa1.1-hp-lites
783de2362d3Smrg	exit ;;
784de2362d3Smrg    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
785de2362d3Smrg	echo c1-convex-bsd
78618781e08Smrg	exit ;;
787de2362d3Smrg    C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
788de2362d3Smrg	if getsysinfo -f scalar_acc
789de2362d3Smrg	then echo c32-convex-bsd
790de2362d3Smrg	else echo c2-convex-bsd
791de2362d3Smrg	fi
79218781e08Smrg	exit ;;
793de2362d3Smrg    C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
794de2362d3Smrg	echo c34-convex-bsd
79518781e08Smrg	exit ;;
796de2362d3Smrg    C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
797de2362d3Smrg	echo c38-convex-bsd
79818781e08Smrg	exit ;;
799de2362d3Smrg    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
800de2362d3Smrg	echo c4-convex-bsd
80118781e08Smrg	exit ;;
802de2362d3Smrg    CRAY*Y-MP:*:*:*)
8038bf5c682Smrg	echo ymp-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
804de2362d3Smrg	exit ;;
805de2362d3Smrg    CRAY*[A-Z]90:*:*:*)
8068bf5c682Smrg	echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \
807de2362d3Smrg	| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
808de2362d3Smrg	      -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
809de2362d3Smrg	      -e 's/\.[^.]*$/.X/'
810de2362d3Smrg	exit ;;
811de2362d3Smrg    CRAY*TS:*:*:*)
8128bf5c682Smrg	echo t90-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
813de2362d3Smrg	exit ;;
814de2362d3Smrg    CRAY*T3E:*:*:*)
8158bf5c682Smrg	echo alphaev5-cray-unicosmk"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
816de2362d3Smrg	exit ;;
817de2362d3Smrg    CRAY*SV1:*:*:*)
8188bf5c682Smrg	echo sv1-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
819de2362d3Smrg	exit ;;
820de2362d3Smrg    *:UNICOS/mp:*:*)
8218bf5c682Smrg	echo craynv-cray-unicosmp"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
822de2362d3Smrg	exit ;;
823de2362d3Smrg    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
82418781e08Smrg	FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
82518781e08Smrg	FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
8268bf5c682Smrg	FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'`
82718781e08Smrg	echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
82818781e08Smrg	exit ;;
829de2362d3Smrg    5000:UNIX_System_V:4.*:*)
83018781e08Smrg	FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
8318bf5c682Smrg	FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'`
83218781e08Smrg	echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
833de2362d3Smrg	exit ;;
834de2362d3Smrg    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
8358bf5c682Smrg	echo "$UNAME_MACHINE"-pc-bsdi"$UNAME_RELEASE"
836de2362d3Smrg	exit ;;
837de2362d3Smrg    sparc*:BSD/OS:*:*)
8388bf5c682Smrg	echo sparc-unknown-bsdi"$UNAME_RELEASE"
839de2362d3Smrg	exit ;;
840de2362d3Smrg    *:BSD/OS:*:*)
8418bf5c682Smrg	echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE"
842de2362d3Smrg	exit ;;
843de2362d3Smrg    *:FreeBSD:*:*)
84418781e08Smrg	UNAME_PROCESSOR=`/usr/bin/uname -p`
8458bf5c682Smrg	case "$UNAME_PROCESSOR" in
846de2362d3Smrg	    amd64)
8478bf5c682Smrg		UNAME_PROCESSOR=x86_64 ;;
8488bf5c682Smrg	    i386)
8498bf5c682Smrg		UNAME_PROCESSOR=i586 ;;
850de2362d3Smrg	esac
8518bf5c682Smrg	echo "$UNAME_PROCESSOR"-unknown-freebsd"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`"
852de2362d3Smrg	exit ;;
853de2362d3Smrg    i*:CYGWIN*:*)
8548bf5c682Smrg	echo "$UNAME_MACHINE"-pc-cygwin
855de2362d3Smrg	exit ;;
85618781e08Smrg    *:MINGW64*:*)
8578bf5c682Smrg	echo "$UNAME_MACHINE"-pc-mingw64
85818781e08Smrg	exit ;;
859de2362d3Smrg    *:MINGW*:*)
8608bf5c682Smrg	echo "$UNAME_MACHINE"-pc-mingw32
861de2362d3Smrg	exit ;;
86218781e08Smrg    *:MSYS*:*)
8638bf5c682Smrg	echo "$UNAME_MACHINE"-pc-msys
864de2362d3Smrg	exit ;;
865de2362d3Smrg    i*:PW*:*)
8668bf5c682Smrg	echo "$UNAME_MACHINE"-pc-pw32
867de2362d3Smrg	exit ;;
8680d16fef4Smrg    *:Interix*:*)
8698bf5c682Smrg	case "$UNAME_MACHINE" in
870de2362d3Smrg	    x86)
8718bf5c682Smrg		echo i586-pc-interix"$UNAME_RELEASE"
872de2362d3Smrg		exit ;;
8730d16fef4Smrg	    authenticamd | genuineintel | EM64T)
8748bf5c682Smrg		echo x86_64-unknown-interix"$UNAME_RELEASE"
875de2362d3Smrg		exit ;;
876de2362d3Smrg	    IA64)
8778bf5c682Smrg		echo ia64-unknown-interix"$UNAME_RELEASE"
878de2362d3Smrg		exit ;;
879de2362d3Smrg	esac ;;
880de2362d3Smrg    i*:UWIN*:*)
8818bf5c682Smrg	echo "$UNAME_MACHINE"-pc-uwin
882de2362d3Smrg	exit ;;
883de2362d3Smrg    amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
884de2362d3Smrg	echo x86_64-unknown-cygwin
885de2362d3Smrg	exit ;;
886de2362d3Smrg    prep*:SunOS:5.*:*)
8878bf5c682Smrg	echo powerpcle-unknown-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
888de2362d3Smrg	exit ;;
889de2362d3Smrg    *:GNU:*:*)
890de2362d3Smrg	# the GNU system
8918bf5c682Smrg	echo "`echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,'`-unknown-$LIBC`echo "$UNAME_RELEASE"|sed -e 's,/.*$,,'`"
892de2362d3Smrg	exit ;;
893de2362d3Smrg    *:GNU/*:*:*)
894de2362d3Smrg	# other systems with GNU libc and userland
8958bf5c682Smrg	echo "$UNAME_MACHINE-unknown-`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`-$LIBC"
896de2362d3Smrg	exit ;;
897de2362d3Smrg    i*86:Minix:*:*)
8988bf5c682Smrg	echo "$UNAME_MACHINE"-pc-minix
899de2362d3Smrg	exit ;;
90018781e08Smrg    aarch64:Linux:*:*)
9018bf5c682Smrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
90218781e08Smrg	exit ;;
90318781e08Smrg    aarch64_be:Linux:*:*)
90418781e08Smrg	UNAME_MACHINE=aarch64_be
9058bf5c682Smrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
90618781e08Smrg	exit ;;
9070d16fef4Smrg    alpha:Linux:*:*)
9080d16fef4Smrg	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
9090d16fef4Smrg	  EV5)   UNAME_MACHINE=alphaev5 ;;
9100d16fef4Smrg	  EV56)  UNAME_MACHINE=alphaev56 ;;
9110d16fef4Smrg	  PCA56) UNAME_MACHINE=alphapca56 ;;
9120d16fef4Smrg	  PCA57) UNAME_MACHINE=alphapca56 ;;
9130d16fef4Smrg	  EV6)   UNAME_MACHINE=alphaev6 ;;
9140d16fef4Smrg	  EV67)  UNAME_MACHINE=alphaev67 ;;
9150d16fef4Smrg	  EV68*) UNAME_MACHINE=alphaev68 ;;
91618781e08Smrg	esac
9170d16fef4Smrg	objdump --private-headers /bin/sh | grep -q ld.so.1
91818781e08Smrg	if test "$?" = 0 ; then LIBC=gnulibc1 ; fi
9198bf5c682Smrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
92018781e08Smrg	exit ;;
92118781e08Smrg    arc:Linux:*:* | arceb:Linux:*:*)
9228bf5c682Smrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
9230d16fef4Smrg	exit ;;
924de2362d3Smrg    arm*:Linux:*:*)
9258bf5c682Smrg	eval "$set_cc_for_build"
926de2362d3Smrg	if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
927de2362d3Smrg	    | grep -q __ARM_EABI__
928de2362d3Smrg	then
9298bf5c682Smrg	    echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
930de2362d3Smrg	else
93118781e08Smrg	    if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
93218781e08Smrg		| grep -q __ARM_PCS_VFP
93318781e08Smrg	    then
9348bf5c682Smrg		echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabi
93518781e08Smrg	    else
9368bf5c682Smrg		echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabihf
93718781e08Smrg	    fi
938de2362d3Smrg	fi
939de2362d3Smrg	exit ;;
940de2362d3Smrg    avr32*:Linux:*:*)
9418bf5c682Smrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
942de2362d3Smrg	exit ;;
943de2362d3Smrg    cris:Linux:*:*)
9448bf5c682Smrg	echo "$UNAME_MACHINE"-axis-linux-"$LIBC"
945de2362d3Smrg	exit ;;
946de2362d3Smrg    crisv32:Linux:*:*)
9478bf5c682Smrg	echo "$UNAME_MACHINE"-axis-linux-"$LIBC"
94818781e08Smrg	exit ;;
94918781e08Smrg    e2k:Linux:*:*)
9508bf5c682Smrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
951de2362d3Smrg	exit ;;
952de2362d3Smrg    frv:Linux:*:*)
9538bf5c682Smrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
95418781e08Smrg	exit ;;
95518781e08Smrg    hexagon:Linux:*:*)
9568bf5c682Smrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
9570d16fef4Smrg	exit ;;
9580d16fef4Smrg    i*86:Linux:*:*)
9598bf5c682Smrg	echo "$UNAME_MACHINE"-pc-linux-"$LIBC"
960de2362d3Smrg	exit ;;
961de2362d3Smrg    ia64:Linux:*:*)
9628bf5c682Smrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
96318781e08Smrg	exit ;;
96418781e08Smrg    k1om:Linux:*:*)
9658bf5c682Smrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
9667314432eSmrg	exit ;;
967de2362d3Smrg    m32r*:Linux:*:*)
9688bf5c682Smrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
969de2362d3Smrg	exit ;;
970de2362d3Smrg    m68*:Linux:*:*)
9718bf5c682Smrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
972de2362d3Smrg	exit ;;
9730d16fef4Smrg    mips:Linux:*:* | mips64:Linux:*:*)
9748bf5c682Smrg	eval "$set_cc_for_build"
9758bf5c682Smrg	sed 's/^	//' << EOF > "$dummy.c"
976de2362d3Smrg	#undef CPU
9770d16fef4Smrg	#undef ${UNAME_MACHINE}
9780d16fef4Smrg	#undef ${UNAME_MACHINE}el
979de2362d3Smrg	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
9800d16fef4Smrg	CPU=${UNAME_MACHINE}el
981de2362d3Smrg	#else
982de2362d3Smrg	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
9830d16fef4Smrg	CPU=${UNAME_MACHINE}
984de2362d3Smrg	#else
985de2362d3Smrg	CPU=
986de2362d3Smrg	#endif
987de2362d3Smrg	#endif
988de2362d3SmrgEOF
9898bf5c682Smrg	eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU'`"
9908bf5c682Smrg	test "x$CPU" != x && { echo "$CPU-unknown-linux-$LIBC"; exit; }
991de2362d3Smrg	;;
9923ed65abbSmrg    mips64el:Linux:*:*)
9938bf5c682Smrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
9943ed65abbSmrg	exit ;;
99518781e08Smrg    openrisc*:Linux:*:*)
9968bf5c682Smrg	echo or1k-unknown-linux-"$LIBC"
99718781e08Smrg	exit ;;
99818781e08Smrg    or32:Linux:*:* | or1k*:Linux:*:*)
9998bf5c682Smrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
1000de2362d3Smrg	exit ;;
10010d16fef4Smrg    padre:Linux:*:*)
10028bf5c682Smrg	echo sparc-unknown-linux-"$LIBC"
1003de2362d3Smrg	exit ;;
10040d16fef4Smrg    parisc64:Linux:*:* | hppa64:Linux:*:*)
10058bf5c682Smrg	echo hppa64-unknown-linux-"$LIBC"
1006de2362d3Smrg	exit ;;
1007de2362d3Smrg    parisc:Linux:*:* | hppa:Linux:*:*)
1008de2362d3Smrg	# Look for CPU level
1009de2362d3Smrg	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
10108bf5c682Smrg	  PA7*) echo hppa1.1-unknown-linux-"$LIBC" ;;
10118bf5c682Smrg	  PA8*) echo hppa2.0-unknown-linux-"$LIBC" ;;
10128bf5c682Smrg	  *)    echo hppa-unknown-linux-"$LIBC" ;;
1013de2362d3Smrg	esac
1014de2362d3Smrg	exit ;;
10150d16fef4Smrg    ppc64:Linux:*:*)
10168bf5c682Smrg	echo powerpc64-unknown-linux-"$LIBC"
10170d16fef4Smrg	exit ;;
10180d16fef4Smrg    ppc:Linux:*:*)
10198bf5c682Smrg	echo powerpc-unknown-linux-"$LIBC"
102018781e08Smrg	exit ;;
102118781e08Smrg    ppc64le:Linux:*:*)
10228bf5c682Smrg	echo powerpc64le-unknown-linux-"$LIBC"
102318781e08Smrg	exit ;;
102418781e08Smrg    ppcle:Linux:*:*)
10258bf5c682Smrg	echo powerpcle-unknown-linux-"$LIBC"
1026de2362d3Smrg	exit ;;
10273ed65abbSmrg    riscv32:Linux:*:* | riscv64:Linux:*:*)
10288bf5c682Smrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
10293ed65abbSmrg	exit ;;
1030de2362d3Smrg    s390:Linux:*:* | s390x:Linux:*:*)
10318bf5c682Smrg	echo "$UNAME_MACHINE"-ibm-linux-"$LIBC"
1032de2362d3Smrg	exit ;;
1033de2362d3Smrg    sh64*:Linux:*:*)
10348bf5c682Smrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
1035de2362d3Smrg	exit ;;
1036de2362d3Smrg    sh*:Linux:*:*)
10378bf5c682Smrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
1038de2362d3Smrg	exit ;;
1039de2362d3Smrg    sparc:Linux:*:* | sparc64:Linux:*:*)
10408bf5c682Smrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
104118781e08Smrg	exit ;;
104218781e08Smrg    tile*:Linux:*:*)
10438bf5c682Smrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
1044de2362d3Smrg	exit ;;
1045de2362d3Smrg    vax:Linux:*:*)
10468bf5c682Smrg	echo "$UNAME_MACHINE"-dec-linux-"$LIBC"
1047de2362d3Smrg	exit ;;
1048de2362d3Smrg    x86_64:Linux:*:*)
10498bf5c682Smrg	if objdump -f /bin/sh | grep -q elf32-x86-64; then
10508bf5c682Smrg	    echo "$UNAME_MACHINE"-pc-linux-"$LIBC"x32
10518bf5c682Smrg	else
10528bf5c682Smrg	    echo "$UNAME_MACHINE"-pc-linux-"$LIBC"
10538bf5c682Smrg	fi
1054de2362d3Smrg	exit ;;
1055de2362d3Smrg    xtensa*:Linux:*:*)
10568bf5c682Smrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
1057de2362d3Smrg	exit ;;
1058de2362d3Smrg    i*86:DYNIX/ptx:4*:*)
1059de2362d3Smrg	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
1060de2362d3Smrg	# earlier versions are messed up and put the nodename in both
1061de2362d3Smrg	# sysname and nodename.
1062de2362d3Smrg	echo i386-sequent-sysv4
1063de2362d3Smrg	exit ;;
1064de2362d3Smrg    i*86:UNIX_SV:4.2MP:2.*)
106518781e08Smrg	# Unixware is an offshoot of SVR4, but it has its own version
106618781e08Smrg	# number series starting with 2...
106718781e08Smrg	# I am not positive that other SVR4 systems won't match this,
1068de2362d3Smrg	# I just have to hope.  -- rms.
106918781e08Smrg	# Use sysv4.2uw... so that sysv4* matches it.
10708bf5c682Smrg	echo "$UNAME_MACHINE"-pc-sysv4.2uw"$UNAME_VERSION"
1071de2362d3Smrg	exit ;;
1072de2362d3Smrg    i*86:OS/2:*:*)
1073de2362d3Smrg	# If we were able to find `uname', then EMX Unix compatibility
1074de2362d3Smrg	# is probably installed.
10758bf5c682Smrg	echo "$UNAME_MACHINE"-pc-os2-emx
1076de2362d3Smrg	exit ;;
1077de2362d3Smrg    i*86:XTS-300:*:STOP)
10788bf5c682Smrg	echo "$UNAME_MACHINE"-unknown-stop
1079de2362d3Smrg	exit ;;
1080de2362d3Smrg    i*86:atheos:*:*)
10818bf5c682Smrg	echo "$UNAME_MACHINE"-unknown-atheos
1082de2362d3Smrg	exit ;;
1083de2362d3Smrg    i*86:syllable:*:*)
10848bf5c682Smrg	echo "$UNAME_MACHINE"-pc-syllable
1085de2362d3Smrg	exit ;;
10860d16fef4Smrg    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
10878bf5c682Smrg	echo i386-unknown-lynxos"$UNAME_RELEASE"
1088de2362d3Smrg	exit ;;
1089de2362d3Smrg    i*86:*DOS:*:*)
10908bf5c682Smrg	echo "$UNAME_MACHINE"-pc-msdosdjgpp
1091de2362d3Smrg	exit ;;
10928bf5c682Smrg    i*86:*:4.*:*)
10938bf5c682Smrg	UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'`
1094de2362d3Smrg	if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
10958bf5c682Smrg		echo "$UNAME_MACHINE"-univel-sysv"$UNAME_REL"
1096de2362d3Smrg	else
10978bf5c682Smrg		echo "$UNAME_MACHINE"-pc-sysv"$UNAME_REL"
1098de2362d3Smrg	fi
1099de2362d3Smrg	exit ;;
1100de2362d3Smrg    i*86:*:5:[678]*)
110118781e08Smrg	# UnixWare 7.x, OpenUNIX and OpenServer 6.
1102de2362d3Smrg	case `/bin/uname -X | grep "^Machine"` in
1103de2362d3Smrg	    *486*)	     UNAME_MACHINE=i486 ;;
1104de2362d3Smrg	    *Pentium)	     UNAME_MACHINE=i586 ;;
1105de2362d3Smrg	    *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
1106de2362d3Smrg	esac
11078bf5c682Smrg	echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}{$UNAME_VERSION}"
1108de2362d3Smrg	exit ;;
1109de2362d3Smrg    i*86:*:3.2:*)
1110de2362d3Smrg	if test -f /usr/options/cb.name; then
1111de2362d3Smrg		UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
11128bf5c682Smrg		echo "$UNAME_MACHINE"-pc-isc"$UNAME_REL"
1113de2362d3Smrg	elif /bin/uname -X 2>/dev/null >/dev/null ; then
1114de2362d3Smrg		UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
1115de2362d3Smrg		(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
1116de2362d3Smrg		(/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
1117de2362d3Smrg			&& UNAME_MACHINE=i586
1118de2362d3Smrg		(/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
1119de2362d3Smrg			&& UNAME_MACHINE=i686
1120de2362d3Smrg		(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
1121de2362d3Smrg			&& UNAME_MACHINE=i686
11228bf5c682Smrg		echo "$UNAME_MACHINE"-pc-sco"$UNAME_REL"
1123de2362d3Smrg	else
11248bf5c682Smrg		echo "$UNAME_MACHINE"-pc-sysv32
1125de2362d3Smrg	fi
1126de2362d3Smrg	exit ;;
1127de2362d3Smrg    pc:*:*:*)
1128de2362d3Smrg	# Left here for compatibility:
112918781e08Smrg	# uname -m prints for DJGPP always 'pc', but it prints nothing about
113018781e08Smrg	# the processor, so we play safe by assuming i586.
11310d16fef4Smrg	# Note: whatever this is, it MUST be the same as what config.sub
113218781e08Smrg	# prints for the "djgpp" host, or else GDB configure will decide that
11330d16fef4Smrg	# this is a cross-build.
11340d16fef4Smrg	echo i586-pc-msdosdjgpp
113518781e08Smrg	exit ;;
1136de2362d3Smrg    Intel:Mach:3*:*)
1137de2362d3Smrg	echo i386-pc-mach3
1138de2362d3Smrg	exit ;;
1139de2362d3Smrg    paragon:*:*:*)
1140de2362d3Smrg	echo i860-intel-osf1
1141de2362d3Smrg	exit ;;
1142de2362d3Smrg    i860:*:4.*:*) # i860-SVR4
1143de2362d3Smrg	if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
11448bf5c682Smrg	  echo i860-stardent-sysv"$UNAME_RELEASE" # Stardent Vistra i860-SVR4
1145de2362d3Smrg	else # Add other i860-SVR4 vendors below as they are discovered.
11468bf5c682Smrg	  echo i860-unknown-sysv"$UNAME_RELEASE"  # Unknown i860-SVR4
1147de2362d3Smrg	fi
1148de2362d3Smrg	exit ;;
1149de2362d3Smrg    mini*:CTIX:SYS*5:*)
1150de2362d3Smrg	# "miniframe"
1151de2362d3Smrg	echo m68010-convergent-sysv
1152de2362d3Smrg	exit ;;
1153de2362d3Smrg    mc68k:UNIX:SYSTEM5:3.51m)
1154de2362d3Smrg	echo m68k-convergent-sysv
1155de2362d3Smrg	exit ;;
1156de2362d3Smrg    M680?0:D-NIX:5.3:*)
1157de2362d3Smrg	echo m68k-diab-dnix
1158de2362d3Smrg	exit ;;
1159de2362d3Smrg    M68*:*:R3V[5678]*:*)
1160de2362d3Smrg	test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
1161de2362d3Smrg    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)
1162de2362d3Smrg	OS_REL=''
1163de2362d3Smrg	test -r /etc/.relid \
1164de2362d3Smrg	&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
1165de2362d3Smrg	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
11668bf5c682Smrg	  && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
1167de2362d3Smrg	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
11688bf5c682Smrg	  && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
1169de2362d3Smrg    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
117018781e08Smrg	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
117118781e08Smrg	  && { echo i486-ncr-sysv4; exit; } ;;
11720d16fef4Smrg    NCR*:*:4.2:* | MPRAS*:*:4.2:*)
11730d16fef4Smrg	OS_REL='.3'
11740d16fef4Smrg	test -r /etc/.relid \
11750d16fef4Smrg	    && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
11760d16fef4Smrg	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
11778bf5c682Smrg	    && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
11780d16fef4Smrg	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
11798bf5c682Smrg	    && { echo i586-ncr-sysv4.3"$OS_REL"; exit; }
11800d16fef4Smrg	/bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
11818bf5c682Smrg	    && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
1182de2362d3Smrg    m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
11838bf5c682Smrg	echo m68k-unknown-lynxos"$UNAME_RELEASE"
1184de2362d3Smrg	exit ;;
1185de2362d3Smrg    mc68030:UNIX_System_V:4.*:*)
1186de2362d3Smrg	echo m68k-atari-sysv4
1187de2362d3Smrg	exit ;;
1188de2362d3Smrg    TSUNAMI:LynxOS:2.*:*)
11898bf5c682Smrg	echo sparc-unknown-lynxos"$UNAME_RELEASE"
1190de2362d3Smrg	exit ;;
1191de2362d3Smrg    rs6000:LynxOS:2.*:*)
11928bf5c682Smrg	echo rs6000-unknown-lynxos"$UNAME_RELEASE"
1193de2362d3Smrg	exit ;;
11940d16fef4Smrg    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
11958bf5c682Smrg	echo powerpc-unknown-lynxos"$UNAME_RELEASE"
1196de2362d3Smrg	exit ;;
1197de2362d3Smrg    SM[BE]S:UNIX_SV:*:*)
11988bf5c682Smrg	echo mips-dde-sysv"$UNAME_RELEASE"
1199de2362d3Smrg	exit ;;
1200de2362d3Smrg    RM*:ReliantUNIX-*:*:*)
1201de2362d3Smrg	echo mips-sni-sysv4
1202de2362d3Smrg	exit ;;
1203de2362d3Smrg    RM*:SINIX-*:*:*)
1204de2362d3Smrg	echo mips-sni-sysv4
1205de2362d3Smrg	exit ;;
1206de2362d3Smrg    *:SINIX-*:*:*)
1207de2362d3Smrg	if uname -p 2>/dev/null >/dev/null ; then
1208de2362d3Smrg		UNAME_MACHINE=`(uname -p) 2>/dev/null`
12098bf5c682Smrg		echo "$UNAME_MACHINE"-sni-sysv4
1210de2362d3Smrg	else
1211de2362d3Smrg		echo ns32k-sni-sysv
1212de2362d3Smrg	fi
1213de2362d3Smrg	exit ;;
121418781e08Smrg    PENTIUM:*:4.0*:*)	# Unisys `ClearPath HMP IX 4000' SVR4/MP effort
121518781e08Smrg			# says <Richard.M.Bartel@ccMail.Census.GOV>
121618781e08Smrg	echo i586-unisys-sysv4
121718781e08Smrg	exit ;;
1218de2362d3Smrg    *:UNIX_System_V:4*:FTX*)
1219de2362d3Smrg	# From Gerald Hewes <hewes@openmarket.com>.
1220de2362d3Smrg	# How about differentiating between stratus architectures? -djm
1221de2362d3Smrg	echo hppa1.1-stratus-sysv4
1222de2362d3Smrg	exit ;;
1223de2362d3Smrg    *:*:*:FTX*)
1224de2362d3Smrg	# From seanf@swdc.stratus.com.
1225de2362d3Smrg	echo i860-stratus-sysv4
1226de2362d3Smrg	exit ;;
1227de2362d3Smrg    i*86:VOS:*:*)
1228de2362d3Smrg	# From Paul.Green@stratus.com.
12298bf5c682Smrg	echo "$UNAME_MACHINE"-stratus-vos
1230de2362d3Smrg	exit ;;
1231de2362d3Smrg    *:VOS:*:*)
1232de2362d3Smrg	# From Paul.Green@stratus.com.
1233de2362d3Smrg	echo hppa1.1-stratus-vos
1234de2362d3Smrg	exit ;;
1235de2362d3Smrg    mc68*:A/UX:*:*)
12368bf5c682Smrg	echo m68k-apple-aux"$UNAME_RELEASE"
1237de2362d3Smrg	exit ;;
1238de2362d3Smrg    news*:NEWS-OS:6*:*)
1239de2362d3Smrg	echo mips-sony-newsos6
1240de2362d3Smrg	exit ;;
1241de2362d3Smrg    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
1242de2362d3Smrg	if [ -d /usr/nec ]; then
12438bf5c682Smrg		echo mips-nec-sysv"$UNAME_RELEASE"
1244de2362d3Smrg	else
12458bf5c682Smrg		echo mips-unknown-sysv"$UNAME_RELEASE"
1246de2362d3Smrg	fi
124718781e08Smrg	exit ;;
1248de2362d3Smrg    BeBox:BeOS:*:*)	# BeOS running on hardware made by Be, PPC only.
1249de2362d3Smrg	echo powerpc-be-beos
1250de2362d3Smrg	exit ;;
1251de2362d3Smrg    BeMac:BeOS:*:*)	# BeOS running on Mac or Mac clone, PPC only.
1252de2362d3Smrg	echo powerpc-apple-beos
1253de2362d3Smrg	exit ;;
1254de2362d3Smrg    BePC:BeOS:*:*)	# BeOS running on Intel PC compatible.
1255de2362d3Smrg	echo i586-pc-beos
1256de2362d3Smrg	exit ;;
12570d16fef4Smrg    BePC:Haiku:*:*)	# Haiku running on Intel PC compatible.
12580d16fef4Smrg	echo i586-pc-haiku
12590d16fef4Smrg	exit ;;
126018781e08Smrg    x86_64:Haiku:*:*)
126118781e08Smrg	echo x86_64-unknown-haiku
126218781e08Smrg	exit ;;
1263de2362d3Smrg    SX-4:SUPER-UX:*:*)
12648bf5c682Smrg	echo sx4-nec-superux"$UNAME_RELEASE"
1265de2362d3Smrg	exit ;;
1266de2362d3Smrg    SX-5:SUPER-UX:*:*)
12678bf5c682Smrg	echo sx5-nec-superux"$UNAME_RELEASE"
1268de2362d3Smrg	exit ;;
1269de2362d3Smrg    SX-6:SUPER-UX:*:*)
12708bf5c682Smrg	echo sx6-nec-superux"$UNAME_RELEASE"
1271de2362d3Smrg	exit ;;
1272de2362d3Smrg    SX-7:SUPER-UX:*:*)
12738bf5c682Smrg	echo sx7-nec-superux"$UNAME_RELEASE"
1274de2362d3Smrg	exit ;;
1275de2362d3Smrg    SX-8:SUPER-UX:*:*)
12768bf5c682Smrg	echo sx8-nec-superux"$UNAME_RELEASE"
1277de2362d3Smrg	exit ;;
1278de2362d3Smrg    SX-8R:SUPER-UX:*:*)
12798bf5c682Smrg	echo sx8r-nec-superux"$UNAME_RELEASE"
1280de2362d3Smrg	exit ;;
128118781e08Smrg    SX-ACE:SUPER-UX:*:*)
12828bf5c682Smrg	echo sxace-nec-superux"$UNAME_RELEASE"
128318781e08Smrg	exit ;;
1284de2362d3Smrg    Power*:Rhapsody:*:*)
12858bf5c682Smrg	echo powerpc-apple-rhapsody"$UNAME_RELEASE"
1286de2362d3Smrg	exit ;;
1287de2362d3Smrg    *:Rhapsody:*:*)
12888bf5c682Smrg	echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE"
1289de2362d3Smrg	exit ;;
1290de2362d3Smrg    *:Darwin:*:*)
1291de2362d3Smrg	UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
12928bf5c682Smrg	eval "$set_cc_for_build"
129318781e08Smrg	if test "$UNAME_PROCESSOR" = unknown ; then
129418781e08Smrg	    UNAME_PROCESSOR=powerpc
129518781e08Smrg	fi
12968bf5c682Smrg	if test "`echo "$UNAME_RELEASE" | sed -e 's/\..*//'`" -le 10 ; then
129718781e08Smrg	    if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
129818781e08Smrg		if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
12998bf5c682Smrg		       (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
13008bf5c682Smrg		       grep IS_64BIT_ARCH >/dev/null
130118781e08Smrg		then
130218781e08Smrg		    case $UNAME_PROCESSOR in
130318781e08Smrg			i386) UNAME_PROCESSOR=x86_64 ;;
130418781e08Smrg			powerpc) UNAME_PROCESSOR=powerpc64 ;;
130518781e08Smrg		    esac
130618781e08Smrg		fi
13078bf5c682Smrg		# On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc
13088bf5c682Smrg		if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \
13098bf5c682Smrg		       (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
13108bf5c682Smrg		       grep IS_PPC >/dev/null
13118bf5c682Smrg		then
13128bf5c682Smrg		    UNAME_PROCESSOR=powerpc
13138bf5c682Smrg		fi
131418781e08Smrg	    fi
131518781e08Smrg	elif test "$UNAME_PROCESSOR" = i386 ; then
131618781e08Smrg	    # Avoid executing cc on OS X 10.9, as it ships with a stub
131718781e08Smrg	    # that puts up a graphical alert prompting to install
131818781e08Smrg	    # developer tools.  Any system running Mac OS X 10.7 or
131918781e08Smrg	    # later (Darwin 11 and later) is required to have a 64-bit
132018781e08Smrg	    # processor. This is not true of the ARM version of Darwin
132118781e08Smrg	    # that Apple uses in portable devices.
132218781e08Smrg	    UNAME_PROCESSOR=x86_64
132318781e08Smrg	fi
13248bf5c682Smrg	echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE"
1325de2362d3Smrg	exit ;;
1326de2362d3Smrg    *:procnto*:*:* | *:QNX:[0123456789]*:*)
1327de2362d3Smrg	UNAME_PROCESSOR=`uname -p`
132818781e08Smrg	if test "$UNAME_PROCESSOR" = x86; then
1329de2362d3Smrg		UNAME_PROCESSOR=i386
1330de2362d3Smrg		UNAME_MACHINE=pc
1331de2362d3Smrg	fi
13328bf5c682Smrg	echo "$UNAME_PROCESSOR"-"$UNAME_MACHINE"-nto-qnx"$UNAME_RELEASE"
1333de2362d3Smrg	exit ;;
1334de2362d3Smrg    *:QNX:*:4*)
1335de2362d3Smrg	echo i386-pc-qnx
1336de2362d3Smrg	exit ;;
13378bf5c682Smrg    NEO-*:NONSTOP_KERNEL:*:*)
13388bf5c682Smrg	echo neo-tandem-nsk"$UNAME_RELEASE"
133918781e08Smrg	exit ;;
134018781e08Smrg    NSE-*:NONSTOP_KERNEL:*:*)
13418bf5c682Smrg	echo nse-tandem-nsk"$UNAME_RELEASE"
13428bf5c682Smrg	exit ;;
13438bf5c682Smrg    NSR-*:NONSTOP_KERNEL:*:*)
13448bf5c682Smrg	echo nsr-tandem-nsk"$UNAME_RELEASE"
13458bf5c682Smrg	exit ;;
13468bf5c682Smrg    NSV-*:NONSTOP_KERNEL:*:*)
13478bf5c682Smrg	echo nsv-tandem-nsk"$UNAME_RELEASE"
1348de2362d3Smrg	exit ;;
13498bf5c682Smrg    NSX-*:NONSTOP_KERNEL:*:*)
13508bf5c682Smrg	echo nsx-tandem-nsk"$UNAME_RELEASE"
1351de2362d3Smrg	exit ;;
1352de2362d3Smrg    *:NonStop-UX:*:*)
1353de2362d3Smrg	echo mips-compaq-nonstopux
1354de2362d3Smrg	exit ;;
1355de2362d3Smrg    BS2000:POSIX*:*:*)
1356de2362d3Smrg	echo bs2000-siemens-sysv
1357de2362d3Smrg	exit ;;
1358de2362d3Smrg    DS/*:UNIX_System_V:*:*)
13598bf5c682Smrg	echo "$UNAME_MACHINE"-"$UNAME_SYSTEM"-"$UNAME_RELEASE"
1360de2362d3Smrg	exit ;;
1361de2362d3Smrg    *:Plan9:*:*)
1362de2362d3Smrg	# "uname -m" is not consistent, so use $cputype instead. 386
1363de2362d3Smrg	# is converted to i386 for consistency with other x86
1364de2362d3Smrg	# operating systems.
136518781e08Smrg	if test "$cputype" = 386; then
1366de2362d3Smrg	    UNAME_MACHINE=i386
1367de2362d3Smrg	else
1368de2362d3Smrg	    UNAME_MACHINE="$cputype"
1369de2362d3Smrg	fi
13708bf5c682Smrg	echo "$UNAME_MACHINE"-unknown-plan9
1371de2362d3Smrg	exit ;;
1372de2362d3Smrg    *:TOPS-10:*:*)
1373de2362d3Smrg	echo pdp10-unknown-tops10
1374de2362d3Smrg	exit ;;
1375de2362d3Smrg    *:TENEX:*:*)
1376de2362d3Smrg	echo pdp10-unknown-tenex
1377de2362d3Smrg	exit ;;
1378de2362d3Smrg    KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
1379de2362d3Smrg	echo pdp10-dec-tops20
1380de2362d3Smrg	exit ;;
1381de2362d3Smrg    XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
1382de2362d3Smrg	echo pdp10-xkl-tops20
1383de2362d3Smrg	exit ;;
1384de2362d3Smrg    *:TOPS-20:*:*)
1385de2362d3Smrg	echo pdp10-unknown-tops20
1386de2362d3Smrg	exit ;;
1387de2362d3Smrg    *:ITS:*:*)
1388de2362d3Smrg	echo pdp10-unknown-its
1389de2362d3Smrg	exit ;;
1390de2362d3Smrg    SEI:*:*:SEIUX)
13918bf5c682Smrg	echo mips-sei-seiux"$UNAME_RELEASE"
1392de2362d3Smrg	exit ;;
1393de2362d3Smrg    *:DragonFly:*:*)
13948bf5c682Smrg	echo "$UNAME_MACHINE"-unknown-dragonfly"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`"
1395de2362d3Smrg	exit ;;
1396de2362d3Smrg    *:*VMS:*:*)
139718781e08Smrg	UNAME_MACHINE=`(uname -p) 2>/dev/null`
13988bf5c682Smrg	case "$UNAME_MACHINE" in
1399de2362d3Smrg	    A*) echo alpha-dec-vms ; exit ;;
1400de2362d3Smrg	    I*) echo ia64-dec-vms ; exit ;;
1401de2362d3Smrg	    V*) echo vax-dec-vms ; exit ;;
1402de2362d3Smrg	esac ;;
1403de2362d3Smrg    *:XENIX:*:SysV)
1404de2362d3Smrg	echo i386-pc-xenix
1405de2362d3Smrg	exit ;;
1406de2362d3Smrg    i*86:skyos:*:*)
14078bf5c682Smrg	echo "$UNAME_MACHINE"-pc-skyos"`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`"
1408de2362d3Smrg	exit ;;
1409de2362d3Smrg    i*86:rdos:*:*)
14108bf5c682Smrg	echo "$UNAME_MACHINE"-pc-rdos
1411de2362d3Smrg	exit ;;
14120d16fef4Smrg    i*86:AROS:*:*)
14138bf5c682Smrg	echo "$UNAME_MACHINE"-pc-aros
1414de2362d3Smrg	exit ;;
141518781e08Smrg    x86_64:VMkernel:*:*)
14168bf5c682Smrg	echo "$UNAME_MACHINE"-unknown-esx
1417de2362d3Smrg	exit ;;
141818781e08Smrg    amd64:Isilon\ OneFS:*:*)
141918781e08Smrg	echo x86_64-unknown-onefs
14207314432eSmrg	exit ;;
142118781e08Smrgesac
1422de2362d3Smrg
14238bf5c682Smrgecho "$0: unable to guess system type" >&2
14248bf5c682Smrg
14258bf5c682Smrgcase "$UNAME_MACHINE:$UNAME_SYSTEM" in
14268bf5c682Smrg    mips:Linux | mips64:Linux)
14278bf5c682Smrg	# If we got here on MIPS GNU/Linux, output extra information.
14288bf5c682Smrg	cat >&2 <<EOF
14298bf5c682Smrg
14308bf5c682SmrgNOTE: MIPS GNU/Linux systems require a C compiler to fully recognize
14318bf5c682Smrgthe system type. Please install a C compiler and try again.
14328bf5c682SmrgEOF
14338bf5c682Smrg	;;
14348bf5c682Smrgesac
14358bf5c682Smrg
1436de2362d3Smrgcat >&2 <<EOF
1437de2362d3Smrg
14383ed65abbSmrgThis script (version $timestamp), has failed to recognize the
14398bf5c682Smrgoperating system you are using. If your script is old, overwrite *all*
14408bf5c682Smrgcopies of config.guess and config.sub with the latest versions from:
1441de2362d3Smrg
14428bf5c682Smrg  https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
1443de2362d3Smrgand
14448bf5c682Smrg  https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
1445de2362d3Smrg
14463ed65abbSmrgIf $0 has already been updated, send the following data and any
14473ed65abbSmrginformation you think might be pertinent to config-patches@gnu.org to
14483ed65abbSmrgprovide the necessary information to handle your system.
1449de2362d3Smrg
1450de2362d3Smrgconfig.guess timestamp = $timestamp
1451de2362d3Smrg
1452de2362d3Smrguname -m = `(uname -m) 2>/dev/null || echo unknown`
1453de2362d3Smrguname -r = `(uname -r) 2>/dev/null || echo unknown`
1454de2362d3Smrguname -s = `(uname -s) 2>/dev/null || echo unknown`
1455de2362d3Smrguname -v = `(uname -v) 2>/dev/null || echo unknown`
1456de2362d3Smrg
1457de2362d3Smrg/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
1458de2362d3Smrg/bin/uname -X     = `(/bin/uname -X) 2>/dev/null`
1459de2362d3Smrg
1460de2362d3Smrghostinfo               = `(hostinfo) 2>/dev/null`
1461de2362d3Smrg/bin/universe          = `(/bin/universe) 2>/dev/null`
1462de2362d3Smrg/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null`
1463de2362d3Smrg/bin/arch              = `(/bin/arch) 2>/dev/null`
1464de2362d3Smrg/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`
1465de2362d3Smrg/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
1466de2362d3Smrg
14678bf5c682SmrgUNAME_MACHINE = "$UNAME_MACHINE"
14688bf5c682SmrgUNAME_RELEASE = "$UNAME_RELEASE"
14698bf5c682SmrgUNAME_SYSTEM  = "$UNAME_SYSTEM"
14708bf5c682SmrgUNAME_VERSION = "$UNAME_VERSION"
1471de2362d3SmrgEOF
1472de2362d3Smrg
1473de2362d3Smrgexit 1
1474de2362d3Smrg
1475de2362d3Smrg# Local variables:
14768bf5c682Smrg# eval: (add-hook 'write-file-functions 'time-stamp)
1477de2362d3Smrg# time-stamp-start: "timestamp='"
1478de2362d3Smrg# time-stamp-format: "%:y-%02m-%02d"
1479de2362d3Smrg# time-stamp-end: "'"
1480de2362d3Smrg# End:
1481