config.guess revision 0c91c449
1ff7e0accSmrg#! /bin/sh
2ff7e0accSmrg# Attempt to guess a canonical system name.
30c91c449Smrg#   Copyright 1992-2018 Free Software Foundation, Inc.
4ff7e0accSmrg
50c91c449Smrgtimestamp='2018-03-01'
6ff7e0accSmrg
7ff7e0accSmrg# This file is free software; you can redistribute it and/or modify it
8ff7e0accSmrg# under the terms of the GNU General Public License as published by
905bee9bcSmrg# the Free Software Foundation; either version 3 of the License, or
10ff7e0accSmrg# (at your option) any later version.
11ff7e0accSmrg#
12ff7e0accSmrg# This program is distributed in the hope that it will be useful, but
13ff7e0accSmrg# WITHOUT ANY WARRANTY; without even the implied warranty of
14ff7e0accSmrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15ff7e0accSmrg# General Public License for more details.
16ff7e0accSmrg#
17ff7e0accSmrg# You should have received a copy of the GNU General Public License
180c91c449Smrg# along with this program; if not, see <https://www.gnu.org/licenses/>.
19ff7e0accSmrg#
20ff7e0accSmrg# As a special exception to the GNU General Public License, if you
21ff7e0accSmrg# distribute this file as part of a program that contains a
22ff7e0accSmrg# configuration script generated by Autoconf, you may include it under
2305bee9bcSmrg# the same distribution terms that you use for the rest of that
2405bee9bcSmrg# program.  This Exception is an additional permission under section 7
2505bee9bcSmrg# of the GNU General Public License, version 3 ("GPLv3").
26ff7e0accSmrg#
270c91c449Smrg# Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
28ff7e0accSmrg#
29863f95b1Smrg# You can get the latest version of this script from:
300c91c449Smrg# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
3105bee9bcSmrg#
320c91c449Smrg# Please send patches to <config-patches@gnu.org>.
3305bee9bcSmrg
34ff7e0accSmrg
35ff7e0accSmrgme=`echo "$0" | sed -e 's,.*/,,'`
36ff7e0accSmrg
37ff7e0accSmrgusage="\
38ff7e0accSmrgUsage: $0 [OPTION]
39ff7e0accSmrg
40ff7e0accSmrgOutput the configuration name of the system \`$me' is run on.
41ff7e0accSmrg
420c91c449SmrgOptions:
43ff7e0accSmrg  -h, --help         print this help, then exit
44ff7e0accSmrg  -t, --time-stamp   print date of last modification, then exit
45ff7e0accSmrg  -v, --version      print version number, then exit
46ff7e0accSmrg
47ff7e0accSmrgReport bugs and patches to <config-patches@gnu.org>."
48ff7e0accSmrg
49ff7e0accSmrgversion="\
50ff7e0accSmrgGNU config.guess ($timestamp)
51ff7e0accSmrg
52ff7e0accSmrgOriginally written by Per Bothner.
530c91c449SmrgCopyright 1992-2018 Free Software Foundation, Inc.
54ff7e0accSmrg
55ff7e0accSmrgThis is free software; see the source for copying conditions.  There is NO
56ff7e0accSmrgwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
57ff7e0accSmrg
58ff7e0accSmrghelp="
59ff7e0accSmrgTry \`$me --help' for more information."
60ff7e0accSmrg
61ff7e0accSmrg# Parse command line
62ff7e0accSmrgwhile test $# -gt 0 ; do
63ff7e0accSmrg  case $1 in
64ff7e0accSmrg    --time-stamp | --time* | -t )
65ff7e0accSmrg       echo "$timestamp" ; exit ;;
66ff7e0accSmrg    --version | -v )
67ff7e0accSmrg       echo "$version" ; exit ;;
68ff7e0accSmrg    --help | --h* | -h )
69ff7e0accSmrg       echo "$usage"; exit ;;
70ff7e0accSmrg    -- )     # Stop option processing
71ff7e0accSmrg       shift; break ;;
72ff7e0accSmrg    - )	# Use stdin as input.
73ff7e0accSmrg       break ;;
74ff7e0accSmrg    -* )
75ff7e0accSmrg       echo "$me: invalid option $1$help" >&2
76ff7e0accSmrg       exit 1 ;;
77ff7e0accSmrg    * )
78ff7e0accSmrg       break ;;
79ff7e0accSmrg  esac
80ff7e0accSmrgdone
81ff7e0accSmrg
82ff7e0accSmrgif test $# != 0; then
83ff7e0accSmrg  echo "$me: too many arguments$help" >&2
84ff7e0accSmrg  exit 1
85ff7e0accSmrgfi
86ff7e0accSmrg
8705bee9bcSmrgtrap 'exit 1' 1 2 15
88ff7e0accSmrg
89ff7e0accSmrg# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
90ff7e0accSmrg# compiler to aid in system detection is discouraged as it requires
91ff7e0accSmrg# temporary files to be created and, as you can see below, it is a
92ff7e0accSmrg# headache to deal with in a portable fashion.
93ff7e0accSmrg
94ff7e0accSmrg# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
95ff7e0accSmrg# use `HOST_CC' if defined, but it is deprecated.
96ff7e0accSmrg
97ff7e0accSmrg# Portable tmp directory creation inspired by the Autoconf team.
98ff7e0accSmrg
99ff7e0accSmrgset_cc_for_build='
100ff7e0accSmrgtrap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
10105bee9bcSmrgtrap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
102ff7e0accSmrg: ${TMPDIR=/tmp} ;
103ff7e0accSmrg { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
104ff7e0accSmrg { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
105ff7e0accSmrg { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
106ff7e0accSmrg { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
107ff7e0accSmrgdummy=$tmp/dummy ;
108ff7e0accSmrgtmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
109ff7e0accSmrgcase $CC_FOR_BUILD,$HOST_CC,$CC in
1100c91c449Smrg ,,)    echo "int x;" > "$dummy.c" ;
111ff7e0accSmrg	for c in cc gcc c89 c99 ; do
1120c91c449Smrg	  if ($c -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then
113ff7e0accSmrg	     CC_FOR_BUILD="$c"; break ;
114ff7e0accSmrg	  fi ;
115ff7e0accSmrg	done ;
116ff7e0accSmrg	if test x"$CC_FOR_BUILD" = x ; then
117ff7e0accSmrg	  CC_FOR_BUILD=no_compiler_found ;
118ff7e0accSmrg	fi
119ff7e0accSmrg	;;
120ff7e0accSmrg ,,*)   CC_FOR_BUILD=$CC ;;
121ff7e0accSmrg ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
122ff7e0accSmrgesac ; set_cc_for_build= ;'
123ff7e0accSmrg
124ff7e0accSmrg# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
125ff7e0accSmrg# (ghazi@noc.rutgers.edu 1994-08-24)
126ff7e0accSmrgif (test -f /.attbin/uname) >/dev/null 2>&1 ; then
127ff7e0accSmrg	PATH=$PATH:/.attbin ; export PATH
128ff7e0accSmrgfi
129ff7e0accSmrg
130ff7e0accSmrgUNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
131ff7e0accSmrgUNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
132ff7e0accSmrgUNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
133ff7e0accSmrgUNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
134ff7e0accSmrg
1350c91c449Smrgcase "$UNAME_SYSTEM" in
1360c91c449SmrgLinux|GNU|GNU/*)
1370c91c449Smrg	# If the system lacks a compiler, then just pick glibc.
1380c91c449Smrg	# We could probably try harder.
1390c91c449Smrg	LIBC=gnu
1400c91c449Smrg
1410c91c449Smrg	eval "$set_cc_for_build"
1420c91c449Smrg	cat <<-EOF > "$dummy.c"
1430c91c449Smrg	#include <features.h>
1440c91c449Smrg	#if defined(__UCLIBC__)
1450c91c449Smrg	LIBC=uclibc
1460c91c449Smrg	#elif defined(__dietlibc__)
1470c91c449Smrg	LIBC=dietlibc
1480c91c449Smrg	#else
1490c91c449Smrg	LIBC=gnu
1500c91c449Smrg	#endif
1510c91c449Smrg	EOF
1520c91c449Smrg	eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`"
1530c91c449Smrg
1540c91c449Smrg	# If ldd exists, use it to detect musl libc.
1550c91c449Smrg	if command -v ldd >/dev/null && \
1560c91c449Smrg		ldd --version 2>&1 | grep -q ^musl
1570c91c449Smrg	then
1580c91c449Smrg	    LIBC=musl
1590c91c449Smrg	fi
1600c91c449Smrg	;;
1610c91c449Smrgesac
1620c91c449Smrg
163ff7e0accSmrg# Note: order is significant - the case branches are not exclusive.
164ff7e0accSmrg
1650c91c449Smrgcase "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
166ff7e0accSmrg    *:NetBSD:*:*)
167ff7e0accSmrg	# NetBSD (nbsd) targets should (where applicable) match one or
16805bee9bcSmrg	# more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
169ff7e0accSmrg	# *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
170ff7e0accSmrg	# switched to ELF, *-*-netbsd* would select the old
171ff7e0accSmrg	# object file format.  This provides both forward
172ff7e0accSmrg	# compatibility and a consistent mechanism for selecting the
173ff7e0accSmrg	# object file format.
174ff7e0accSmrg	#
175ff7e0accSmrg	# Note: NetBSD doesn't particularly care about the vendor
176ff7e0accSmrg	# portion of the name.  We always set it to "unknown".
177ff7e0accSmrg	sysctl="sysctl -n hw.machine_arch"
1780c91c449Smrg	UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \
1790c91c449Smrg	    "/sbin/$sysctl" 2>/dev/null || \
1800c91c449Smrg	    "/usr/sbin/$sysctl" 2>/dev/null || \
1810c91c449Smrg	    echo unknown)`
1820c91c449Smrg	case "$UNAME_MACHINE_ARCH" in
183ff7e0accSmrg	    armeb) machine=armeb-unknown ;;
184ff7e0accSmrg	    arm*) machine=arm-unknown ;;
185ff7e0accSmrg	    sh3el) machine=shl-unknown ;;
186ff7e0accSmrg	    sh3eb) machine=sh-unknown ;;
187ff7e0accSmrg	    sh5el) machine=sh5le-unknown ;;
1880c91c449Smrg	    earmv*)
1890c91c449Smrg		arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'`
1900c91c449Smrg		endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'`
1910c91c449Smrg		machine="${arch}${endian}"-unknown
1920c91c449Smrg		;;
1930c91c449Smrg	    *) machine="$UNAME_MACHINE_ARCH"-unknown ;;
194ff7e0accSmrg	esac
195ff7e0accSmrg	# The Operating System including object format, if it has switched
1960c91c449Smrg	# to ELF recently (or will in the future) and ABI.
1970c91c449Smrg	case "$UNAME_MACHINE_ARCH" in
1980c91c449Smrg	    earm*)
1990c91c449Smrg		os=netbsdelf
2000c91c449Smrg		;;
201ff7e0accSmrg	    arm*|i386|m68k|ns32k|sh3*|sparc|vax)
2020c91c449Smrg		eval "$set_cc_for_build"
203ff7e0accSmrg		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
204863f95b1Smrg			| grep -q __ELF__
205ff7e0accSmrg		then
206ff7e0accSmrg		    # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
207ff7e0accSmrg		    # Return netbsd for either.  FIX?
208ff7e0accSmrg		    os=netbsd
209ff7e0accSmrg		else
210ff7e0accSmrg		    os=netbsdelf
211ff7e0accSmrg		fi
212ff7e0accSmrg		;;
213ff7e0accSmrg	    *)
21405bee9bcSmrg		os=netbsd
215ff7e0accSmrg		;;
216ff7e0accSmrg	esac
2170c91c449Smrg	# Determine ABI tags.
2180c91c449Smrg	case "$UNAME_MACHINE_ARCH" in
2190c91c449Smrg	    earm*)
2200c91c449Smrg		expr='s/^earmv[0-9]/-eabi/;s/eb$//'
2210c91c449Smrg		abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"`
2220c91c449Smrg		;;
2230c91c449Smrg	esac
224ff7e0accSmrg	# The OS release
225ff7e0accSmrg	# Debian GNU/NetBSD machines have a different userland, and
226ff7e0accSmrg	# thus, need a distinct triplet. However, they do not need
227ff7e0accSmrg	# kernel version information, so it can be replaced with a
228ff7e0accSmrg	# suitable tag, in the style of linux-gnu.
2290c91c449Smrg	case "$UNAME_VERSION" in
230ff7e0accSmrg	    Debian*)
231ff7e0accSmrg		release='-gnu'
232ff7e0accSmrg		;;
233ff7e0accSmrg	    *)
2340c91c449Smrg		release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2`
235ff7e0accSmrg		;;
236ff7e0accSmrg	esac
237ff7e0accSmrg	# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
238ff7e0accSmrg	# contains redundant information, the shorter form:
239ff7e0accSmrg	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
2400c91c449Smrg	echo "$machine-${os}${release}${abi}"
241ff7e0accSmrg	exit ;;
24205bee9bcSmrg    *:Bitrig:*:*)
24305bee9bcSmrg	UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
2440c91c449Smrg	echo "$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE"
24505bee9bcSmrg	exit ;;
246ff7e0accSmrg    *:OpenBSD:*:*)
247ff7e0accSmrg	UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
2480c91c449Smrg	echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE"
2490c91c449Smrg	exit ;;
2500c91c449Smrg    *:LibertyBSD:*:*)
2510c91c449Smrg	UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'`
2520c91c449Smrg	echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE"
2530c91c449Smrg	exit ;;
2540c91c449Smrg    *:MidnightBSD:*:*)
2550c91c449Smrg	echo "$UNAME_MACHINE"-unknown-midnightbsd"$UNAME_RELEASE"
256ff7e0accSmrg	exit ;;
257ff7e0accSmrg    *:ekkoBSD:*:*)
2580c91c449Smrg	echo "$UNAME_MACHINE"-unknown-ekkobsd"$UNAME_RELEASE"
259ff7e0accSmrg	exit ;;
260ff7e0accSmrg    *:SolidBSD:*:*)
2610c91c449Smrg	echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE"
262ff7e0accSmrg	exit ;;
263ff7e0accSmrg    macppc:MirBSD:*:*)
2640c91c449Smrg	echo powerpc-unknown-mirbsd"$UNAME_RELEASE"
265ff7e0accSmrg	exit ;;
266ff7e0accSmrg    *:MirBSD:*:*)
2670c91c449Smrg	echo "$UNAME_MACHINE"-unknown-mirbsd"$UNAME_RELEASE"
2680c91c449Smrg	exit ;;
2690c91c449Smrg    *:Sortix:*:*)
2700c91c449Smrg	echo "$UNAME_MACHINE"-unknown-sortix
271ff7e0accSmrg	exit ;;
2720c91c449Smrg    *:Redox:*:*)
2730c91c449Smrg	echo "$UNAME_MACHINE"-unknown-redox
2740c91c449Smrg	exit ;;
2750c91c449Smrg    mips:OSF1:*.*)
2760c91c449Smrg        echo mips-dec-osf1
2770c91c449Smrg        exit ;;
278ff7e0accSmrg    alpha:OSF1:*:*)
279ff7e0accSmrg	case $UNAME_RELEASE in
280ff7e0accSmrg	*4.0)
281ff7e0accSmrg		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
282ff7e0accSmrg		;;
283ff7e0accSmrg	*5.*)
28405bee9bcSmrg		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
285ff7e0accSmrg		;;
286ff7e0accSmrg	esac
287ff7e0accSmrg	# According to Compaq, /usr/sbin/psrinfo has been available on
288ff7e0accSmrg	# OSF/1 and Tru64 systems produced since 1995.  I hope that
289ff7e0accSmrg	# covers most systems running today.  This code pipes the CPU
290ff7e0accSmrg	# types through head -n 1, so we only detect the type of CPU 0.
291ff7e0accSmrg	ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\) processor.*$/\1/p' | head -n 1`
292ff7e0accSmrg	case "$ALPHA_CPU_TYPE" in
293ff7e0accSmrg	    "EV4 (21064)")
2940c91c449Smrg		UNAME_MACHINE=alpha ;;
295ff7e0accSmrg	    "EV4.5 (21064)")
2960c91c449Smrg		UNAME_MACHINE=alpha ;;
297ff7e0accSmrg	    "LCA4 (21066/21068)")
2980c91c449Smrg		UNAME_MACHINE=alpha ;;
299ff7e0accSmrg	    "EV5 (21164)")
3000c91c449Smrg		UNAME_MACHINE=alphaev5 ;;
301ff7e0accSmrg	    "EV5.6 (21164A)")
3020c91c449Smrg		UNAME_MACHINE=alphaev56 ;;
303ff7e0accSmrg	    "EV5.6 (21164PC)")
3040c91c449Smrg		UNAME_MACHINE=alphapca56 ;;
305ff7e0accSmrg	    "EV5.7 (21164PC)")
3060c91c449Smrg		UNAME_MACHINE=alphapca57 ;;
307ff7e0accSmrg	    "EV6 (21264)")
3080c91c449Smrg		UNAME_MACHINE=alphaev6 ;;
309ff7e0accSmrg	    "EV6.7 (21264A)")
3100c91c449Smrg		UNAME_MACHINE=alphaev67 ;;
311ff7e0accSmrg	    "EV6.8CB (21264C)")
3120c91c449Smrg		UNAME_MACHINE=alphaev68 ;;
313ff7e0accSmrg	    "EV6.8AL (21264B)")
3140c91c449Smrg		UNAME_MACHINE=alphaev68 ;;
315ff7e0accSmrg	    "EV6.8CX (21264D)")
3160c91c449Smrg		UNAME_MACHINE=alphaev68 ;;
317ff7e0accSmrg	    "EV6.9A (21264/EV69A)")
3180c91c449Smrg		UNAME_MACHINE=alphaev69 ;;
319ff7e0accSmrg	    "EV7 (21364)")
3200c91c449Smrg		UNAME_MACHINE=alphaev7 ;;
321ff7e0accSmrg	    "EV7.9 (21364A)")
3220c91c449Smrg		UNAME_MACHINE=alphaev79 ;;
323ff7e0accSmrg	esac
324ff7e0accSmrg	# A Pn.n version is a patched version.
325ff7e0accSmrg	# A Vn.n version is a released version.
326ff7e0accSmrg	# A Tn.n version is a released field test version.
327ff7e0accSmrg	# A Xn.n version is an unreleased experimental baselevel.
328ff7e0accSmrg	# 1.2 uses "1.2" for uname -r.
3290c91c449Smrg	echo "$UNAME_MACHINE"-dec-osf"`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`"
33005bee9bcSmrg	# Reset EXIT trap before exiting to avoid spurious non-zero exit code.
33105bee9bcSmrg	exitcode=$?
33205bee9bcSmrg	trap '' 0
33305bee9bcSmrg	exit $exitcode ;;
334ff7e0accSmrg    Amiga*:UNIX_System_V:4.0:*)
335ff7e0accSmrg	echo m68k-unknown-sysv4
336ff7e0accSmrg	exit ;;
337ff7e0accSmrg    *:[Aa]miga[Oo][Ss]:*:*)
3380c91c449Smrg	echo "$UNAME_MACHINE"-unknown-amigaos
339ff7e0accSmrg	exit ;;
340ff7e0accSmrg    *:[Mm]orph[Oo][Ss]:*:*)
3410c91c449Smrg	echo "$UNAME_MACHINE"-unknown-morphos
342ff7e0accSmrg	exit ;;
343ff7e0accSmrg    *:OS/390:*:*)
344ff7e0accSmrg	echo i370-ibm-openedition
345ff7e0accSmrg	exit ;;
346ff7e0accSmrg    *:z/VM:*:*)
347ff7e0accSmrg	echo s390-ibm-zvmoe
348ff7e0accSmrg	exit ;;
349ff7e0accSmrg    *:OS400:*:*)
35005bee9bcSmrg	echo powerpc-ibm-os400
351ff7e0accSmrg	exit ;;
352ff7e0accSmrg    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
3530c91c449Smrg	echo arm-acorn-riscix"$UNAME_RELEASE"
354ff7e0accSmrg	exit ;;
35505bee9bcSmrg    arm*:riscos:*:*|arm*:RISCOS:*:*)
356ff7e0accSmrg	echo arm-unknown-riscos
357ff7e0accSmrg	exit ;;
358ff7e0accSmrg    SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
359ff7e0accSmrg	echo hppa1.1-hitachi-hiuxmpp
360ff7e0accSmrg	exit ;;
361ff7e0accSmrg    Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
362ff7e0accSmrg	# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
363ff7e0accSmrg	if test "`(/bin/universe) 2>/dev/null`" = att ; then
364ff7e0accSmrg		echo pyramid-pyramid-sysv3
365ff7e0accSmrg	else
366ff7e0accSmrg		echo pyramid-pyramid-bsd
367ff7e0accSmrg	fi
368ff7e0accSmrg	exit ;;
369ff7e0accSmrg    NILE*:*:*:dcosx)
370ff7e0accSmrg	echo pyramid-pyramid-svr4
371ff7e0accSmrg	exit ;;
372ff7e0accSmrg    DRS?6000:unix:4.0:6*)
373ff7e0accSmrg	echo sparc-icl-nx6
374ff7e0accSmrg	exit ;;
375ff7e0accSmrg    DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
376ff7e0accSmrg	case `/usr/bin/uname -p` in
377ff7e0accSmrg	    sparc) echo sparc-icl-nx7; exit ;;
378ff7e0accSmrg	esac ;;
37910998002Smrg    s390x:SunOS:*:*)
3800c91c449Smrg	echo "$UNAME_MACHINE"-ibm-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`"
38110998002Smrg	exit ;;
382ff7e0accSmrg    sun4H:SunOS:5.*:*)
3830c91c449Smrg	echo sparc-hal-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
384ff7e0accSmrg	exit ;;
385ff7e0accSmrg    sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
3860c91c449Smrg	echo sparc-sun-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`"
387ff7e0accSmrg	exit ;;
388863f95b1Smrg    i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
3890c91c449Smrg	echo i386-pc-auroraux"$UNAME_RELEASE"
390863f95b1Smrg	exit ;;
391ff7e0accSmrg    i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
3920c91c449Smrg	eval "$set_cc_for_build"
3930c91c449Smrg	SUN_ARCH=i386
39410998002Smrg	# If there is a compiler, see if it is configured for 64-bit objects.
39510998002Smrg	# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
39610998002Smrg	# This test works for both compilers.
3970c91c449Smrg	if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
39810998002Smrg	    if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
3990c91c449Smrg		(CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
40010998002Smrg		grep IS_64BIT_ARCH >/dev/null
40110998002Smrg	    then
4020c91c449Smrg		SUN_ARCH=x86_64
40310998002Smrg	    fi
40410998002Smrg	fi
4050c91c449Smrg	echo "$SUN_ARCH"-pc-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
406ff7e0accSmrg	exit ;;
407ff7e0accSmrg    sun4*:SunOS:6*:*)
408ff7e0accSmrg	# According to config.sub, this is the proper way to canonicalize
409ff7e0accSmrg	# SunOS6.  Hard to guess exactly what SunOS6 will be like, but
410ff7e0accSmrg	# it's likely to be more like Solaris than SunOS4.
4110c91c449Smrg	echo sparc-sun-solaris3"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
412ff7e0accSmrg	exit ;;
413ff7e0accSmrg    sun4*:SunOS:*:*)
414ff7e0accSmrg	case "`/usr/bin/arch -k`" in
415ff7e0accSmrg	    Series*|S4*)
416ff7e0accSmrg		UNAME_RELEASE=`uname -v`
417ff7e0accSmrg		;;
418ff7e0accSmrg	esac
419ff7e0accSmrg	# Japanese Language versions have a version number like `4.1.3-JL'.
4200c91c449Smrg	echo sparc-sun-sunos"`echo "$UNAME_RELEASE"|sed -e 's/-/_/'`"
421ff7e0accSmrg	exit ;;
422ff7e0accSmrg    sun3*:SunOS:*:*)
4230c91c449Smrg	echo m68k-sun-sunos"$UNAME_RELEASE"
424ff7e0accSmrg	exit ;;
425ff7e0accSmrg    sun*:*:4.2BSD:*)
426ff7e0accSmrg	UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
4270c91c449Smrg	test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3
428ff7e0accSmrg	case "`/bin/arch`" in
429ff7e0accSmrg	    sun3)
4300c91c449Smrg		echo m68k-sun-sunos"$UNAME_RELEASE"
431ff7e0accSmrg		;;
432ff7e0accSmrg	    sun4)
4330c91c449Smrg		echo sparc-sun-sunos"$UNAME_RELEASE"
434ff7e0accSmrg		;;
435ff7e0accSmrg	esac
436ff7e0accSmrg	exit ;;
437ff7e0accSmrg    aushp:SunOS:*:*)
4380c91c449Smrg	echo sparc-auspex-sunos"$UNAME_RELEASE"
439ff7e0accSmrg	exit ;;
440ff7e0accSmrg    # The situation for MiNT is a little confusing.  The machine name
441ff7e0accSmrg    # can be virtually everything (everything which is not
442ff7e0accSmrg    # "atarist" or "atariste" at least should have a processor
443ff7e0accSmrg    # > m68000).  The system name ranges from "MiNT" over "FreeMiNT"
444ff7e0accSmrg    # to the lowercase version "mint" (or "freemint").  Finally
445ff7e0accSmrg    # the system name "TOS" denotes a system which is actually not
446ff7e0accSmrg    # MiNT.  But MiNT is downward compatible to TOS, so this should
447ff7e0accSmrg    # be no problem.
448ff7e0accSmrg    atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
4490c91c449Smrg	echo m68k-atari-mint"$UNAME_RELEASE"
450ff7e0accSmrg	exit ;;
451ff7e0accSmrg    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
4520c91c449Smrg	echo m68k-atari-mint"$UNAME_RELEASE"
45305bee9bcSmrg	exit ;;
454ff7e0accSmrg    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
4550c91c449Smrg	echo m68k-atari-mint"$UNAME_RELEASE"
456ff7e0accSmrg	exit ;;
457ff7e0accSmrg    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
4580c91c449Smrg	echo m68k-milan-mint"$UNAME_RELEASE"
45905bee9bcSmrg	exit ;;
460ff7e0accSmrg    hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
4610c91c449Smrg	echo m68k-hades-mint"$UNAME_RELEASE"
46205bee9bcSmrg	exit ;;
463ff7e0accSmrg    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
4640c91c449Smrg	echo m68k-unknown-mint"$UNAME_RELEASE"
46505bee9bcSmrg	exit ;;
466ff7e0accSmrg    m68k:machten:*:*)
4670c91c449Smrg	echo m68k-apple-machten"$UNAME_RELEASE"
468ff7e0accSmrg	exit ;;
469ff7e0accSmrg    powerpc:machten:*:*)
4700c91c449Smrg	echo powerpc-apple-machten"$UNAME_RELEASE"
471ff7e0accSmrg	exit ;;
472ff7e0accSmrg    RISC*:Mach:*:*)
473ff7e0accSmrg	echo mips-dec-mach_bsd4.3
474ff7e0accSmrg	exit ;;
475ff7e0accSmrg    RISC*:ULTRIX:*:*)
4760c91c449Smrg	echo mips-dec-ultrix"$UNAME_RELEASE"
477ff7e0accSmrg	exit ;;
478ff7e0accSmrg    VAX*:ULTRIX*:*:*)
4790c91c449Smrg	echo vax-dec-ultrix"$UNAME_RELEASE"
480ff7e0accSmrg	exit ;;
481ff7e0accSmrg    2020:CLIX:*:* | 2430:CLIX:*:*)
4820c91c449Smrg	echo clipper-intergraph-clix"$UNAME_RELEASE"
483ff7e0accSmrg	exit ;;
484ff7e0accSmrg    mips:*:*:UMIPS | mips:*:*:RISCos)
4850c91c449Smrg	eval "$set_cc_for_build"
4860c91c449Smrg	sed 's/^	//' << EOF > "$dummy.c"
487ff7e0accSmrg#ifdef __cplusplus
488ff7e0accSmrg#include <stdio.h>  /* for printf() prototype */
489ff7e0accSmrg	int main (int argc, char *argv[]) {
490ff7e0accSmrg#else
491ff7e0accSmrg	int main (argc, argv) int argc; char *argv[]; {
492ff7e0accSmrg#endif
493ff7e0accSmrg	#if defined (host_mips) && defined (MIPSEB)
494ff7e0accSmrg	#if defined (SYSTYPE_SYSV)
4950c91c449Smrg	  printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0);
496ff7e0accSmrg	#endif
497ff7e0accSmrg	#if defined (SYSTYPE_SVR4)
4980c91c449Smrg	  printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0);
499ff7e0accSmrg	#endif
500ff7e0accSmrg	#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
5010c91c449Smrg	  printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0);
502ff7e0accSmrg	#endif
503ff7e0accSmrg	#endif
504ff7e0accSmrg	  exit (-1);
505ff7e0accSmrg	}
506ff7e0accSmrgEOF
5070c91c449Smrg	$CC_FOR_BUILD -o "$dummy" "$dummy.c" &&
5080c91c449Smrg	  dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` &&
5090c91c449Smrg	  SYSTEM_NAME=`"$dummy" "$dummyarg"` &&
510ff7e0accSmrg	    { echo "$SYSTEM_NAME"; exit; }
5110c91c449Smrg	echo mips-mips-riscos"$UNAME_RELEASE"
512ff7e0accSmrg	exit ;;
513ff7e0accSmrg    Motorola:PowerMAX_OS:*:*)
514ff7e0accSmrg	echo powerpc-motorola-powermax
515ff7e0accSmrg	exit ;;
516ff7e0accSmrg    Motorola:*:4.3:PL8-*)
517ff7e0accSmrg	echo powerpc-harris-powermax
518ff7e0accSmrg	exit ;;
519ff7e0accSmrg    Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
520ff7e0accSmrg	echo powerpc-harris-powermax
521ff7e0accSmrg	exit ;;
522ff7e0accSmrg    Night_Hawk:Power_UNIX:*:*)
523ff7e0accSmrg	echo powerpc-harris-powerunix
524ff7e0accSmrg	exit ;;
525ff7e0accSmrg    m88k:CX/UX:7*:*)
526ff7e0accSmrg	echo m88k-harris-cxux7
527ff7e0accSmrg	exit ;;
528ff7e0accSmrg    m88k:*:4*:R4*)
529ff7e0accSmrg	echo m88k-motorola-sysv4
530ff7e0accSmrg	exit ;;
531ff7e0accSmrg    m88k:*:3*:R3*)
532ff7e0accSmrg	echo m88k-motorola-sysv3
533ff7e0accSmrg	exit ;;
534ff7e0accSmrg    AViiON:dgux:*:*)
53505bee9bcSmrg	# DG/UX returns AViiON for all architectures
53605bee9bcSmrg	UNAME_PROCESSOR=`/usr/bin/uname -p`
5370c91c449Smrg	if [ "$UNAME_PROCESSOR" = mc88100 ] || [ "$UNAME_PROCESSOR" = mc88110 ]
538ff7e0accSmrg	then
5390c91c449Smrg	    if [ "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx ] || \
5400c91c449Smrg	       [ "$TARGET_BINARY_INTERFACE"x = x ]
541ff7e0accSmrg	    then
5420c91c449Smrg		echo m88k-dg-dgux"$UNAME_RELEASE"
543ff7e0accSmrg	    else
5440c91c449Smrg		echo m88k-dg-dguxbcs"$UNAME_RELEASE"
545ff7e0accSmrg	    fi
546ff7e0accSmrg	else
5470c91c449Smrg	    echo i586-dg-dgux"$UNAME_RELEASE"
548ff7e0accSmrg	fi
54905bee9bcSmrg	exit ;;
550ff7e0accSmrg    M88*:DolphinOS:*:*)	# DolphinOS (SVR3)
551ff7e0accSmrg	echo m88k-dolphin-sysv3
552ff7e0accSmrg	exit ;;
553ff7e0accSmrg    M88*:*:R3*:*)
554ff7e0accSmrg	# Delta 88k system running SVR3
555ff7e0accSmrg	echo m88k-motorola-sysv3
556ff7e0accSmrg	exit ;;
557ff7e0accSmrg    XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
558ff7e0accSmrg	echo m88k-tektronix-sysv3
559ff7e0accSmrg	exit ;;
560ff7e0accSmrg    Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
561ff7e0accSmrg	echo m68k-tektronix-bsd
562ff7e0accSmrg	exit ;;
563ff7e0accSmrg    *:IRIX*:*:*)
5640c91c449Smrg	echo mips-sgi-irix"`echo "$UNAME_RELEASE"|sed -e 's/-/_/g'`"
565ff7e0accSmrg	exit ;;
566ff7e0accSmrg    ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
567ff7e0accSmrg	echo romp-ibm-aix     # uname -m gives an 8 hex-code CPU id
568ff7e0accSmrg	exit ;;               # Note that: echo "'`uname -s`'" gives 'AIX '
569ff7e0accSmrg    i*86:AIX:*:*)
570ff7e0accSmrg	echo i386-ibm-aix
571ff7e0accSmrg	exit ;;
572ff7e0accSmrg    ia64:AIX:*:*)
573ff7e0accSmrg	if [ -x /usr/bin/oslevel ] ; then
574ff7e0accSmrg		IBM_REV=`/usr/bin/oslevel`
575ff7e0accSmrg	else
5760c91c449Smrg		IBM_REV="$UNAME_VERSION.$UNAME_RELEASE"
577ff7e0accSmrg	fi
5780c91c449Smrg	echo "$UNAME_MACHINE"-ibm-aix"$IBM_REV"
579ff7e0accSmrg	exit ;;
580ff7e0accSmrg    *:AIX:2:3)
581ff7e0accSmrg	if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
5820c91c449Smrg		eval "$set_cc_for_build"
5830c91c449Smrg		sed 's/^		//' << EOF > "$dummy.c"
584ff7e0accSmrg		#include <sys/systemcfg.h>
585ff7e0accSmrg
586ff7e0accSmrg		main()
587ff7e0accSmrg			{
588ff7e0accSmrg			if (!__power_pc())
589ff7e0accSmrg				exit(1);
590ff7e0accSmrg			puts("powerpc-ibm-aix3.2.5");
591ff7e0accSmrg			exit(0);
592ff7e0accSmrg			}
593ff7e0accSmrgEOF
5940c91c449Smrg		if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"`
595ff7e0accSmrg		then
596ff7e0accSmrg			echo "$SYSTEM_NAME"
597ff7e0accSmrg		else
598ff7e0accSmrg			echo rs6000-ibm-aix3.2.5
599ff7e0accSmrg		fi
600ff7e0accSmrg	elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
601ff7e0accSmrg		echo rs6000-ibm-aix3.2.4
602ff7e0accSmrg	else
603ff7e0accSmrg		echo rs6000-ibm-aix3.2
604ff7e0accSmrg	fi
605ff7e0accSmrg	exit ;;
606863f95b1Smrg    *:AIX:*:[4567])
607ff7e0accSmrg	IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
6080c91c449Smrg	if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then
609ff7e0accSmrg		IBM_ARCH=rs6000
610ff7e0accSmrg	else
611ff7e0accSmrg		IBM_ARCH=powerpc
612ff7e0accSmrg	fi
6130c91c449Smrg	if [ -x /usr/bin/lslpp ] ; then
6140c91c449Smrg		IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc |
6150c91c449Smrg			   awk -F: '{ print $3 }' | sed s/[0-9]*$/0/`
616ff7e0accSmrg	else
6170c91c449Smrg		IBM_REV="$UNAME_VERSION.$UNAME_RELEASE"
618ff7e0accSmrg	fi
6190c91c449Smrg	echo "$IBM_ARCH"-ibm-aix"$IBM_REV"
620ff7e0accSmrg	exit ;;
621ff7e0accSmrg    *:AIX:*:*)
622ff7e0accSmrg	echo rs6000-ibm-aix
623ff7e0accSmrg	exit ;;
6240c91c449Smrg    ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*)
625ff7e0accSmrg	echo romp-ibm-bsd4.4
626ff7e0accSmrg	exit ;;
627ff7e0accSmrg    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
6280c91c449Smrg	echo romp-ibm-bsd"$UNAME_RELEASE"   # 4.3 with uname added to
629ff7e0accSmrg	exit ;;                             # report: romp-ibm BSD 4.3
630ff7e0accSmrg    *:BOSX:*:*)
631ff7e0accSmrg	echo rs6000-bull-bosx
632ff7e0accSmrg	exit ;;
633ff7e0accSmrg    DPX/2?00:B.O.S.:*:*)
634ff7e0accSmrg	echo m68k-bull-sysv3
635ff7e0accSmrg	exit ;;
636ff7e0accSmrg    9000/[34]??:4.3bsd:1.*:*)
637ff7e0accSmrg	echo m68k-hp-bsd
638ff7e0accSmrg	exit ;;
639ff7e0accSmrg    hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
640ff7e0accSmrg	echo m68k-hp-bsd4.4
641ff7e0accSmrg	exit ;;
642ff7e0accSmrg    9000/[34678]??:HP-UX:*:*)
6430c91c449Smrg	HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'`
6440c91c449Smrg	case "$UNAME_MACHINE" in
6450c91c449Smrg	    9000/31?)            HP_ARCH=m68000 ;;
6460c91c449Smrg	    9000/[34]??)         HP_ARCH=m68k ;;
647ff7e0accSmrg	    9000/[678][0-9][0-9])
648ff7e0accSmrg		if [ -x /usr/bin/getconf ]; then
649ff7e0accSmrg		    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
65005bee9bcSmrg		    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
6510c91c449Smrg		    case "$sc_cpu_version" in
6520c91c449Smrg		      523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0
6530c91c449Smrg		      528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1
65405bee9bcSmrg		      532)                      # CPU_PA_RISC2_0
6550c91c449Smrg			case "$sc_kernel_bits" in
6560c91c449Smrg			  32) HP_ARCH=hppa2.0n ;;
6570c91c449Smrg			  64) HP_ARCH=hppa2.0w ;;
6580c91c449Smrg			  '') HP_ARCH=hppa2.0 ;;   # HP-UX 10.20
65905bee9bcSmrg			esac ;;
66005bee9bcSmrg		    esac
661ff7e0accSmrg		fi
6620c91c449Smrg		if [ "$HP_ARCH" = "" ]; then
6630c91c449Smrg		    eval "$set_cc_for_build"
6640c91c449Smrg		    sed 's/^		//' << EOF > "$dummy.c"
665ff7e0accSmrg
66605bee9bcSmrg		#define _HPUX_SOURCE
66705bee9bcSmrg		#include <stdlib.h>
66805bee9bcSmrg		#include <unistd.h>
669ff7e0accSmrg
67005bee9bcSmrg		int main ()
67105bee9bcSmrg		{
67205bee9bcSmrg		#if defined(_SC_KERNEL_BITS)
67305bee9bcSmrg		    long bits = sysconf(_SC_KERNEL_BITS);
67405bee9bcSmrg		#endif
67505bee9bcSmrg		    long cpu  = sysconf (_SC_CPU_VERSION);
676ff7e0accSmrg
67705bee9bcSmrg		    switch (cpu)
67805bee9bcSmrg			{
67905bee9bcSmrg			case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
68005bee9bcSmrg			case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
68105bee9bcSmrg			case CPU_PA_RISC2_0:
68205bee9bcSmrg		#if defined(_SC_KERNEL_BITS)
68305bee9bcSmrg			    switch (bits)
68405bee9bcSmrg				{
68505bee9bcSmrg				case 64: puts ("hppa2.0w"); break;
68605bee9bcSmrg				case 32: puts ("hppa2.0n"); break;
68705bee9bcSmrg				default: puts ("hppa2.0"); break;
68805bee9bcSmrg				} break;
68905bee9bcSmrg		#else  /* !defined(_SC_KERNEL_BITS) */
69005bee9bcSmrg			    puts ("hppa2.0"); break;
69105bee9bcSmrg		#endif
69205bee9bcSmrg			default: puts ("hppa1.0"); break;
69305bee9bcSmrg			}
69405bee9bcSmrg		    exit (0);
69505bee9bcSmrg		}
696ff7e0accSmrgEOF
6970c91c449Smrg		    (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"`
698ff7e0accSmrg		    test -z "$HP_ARCH" && HP_ARCH=hppa
699ff7e0accSmrg		fi ;;
700ff7e0accSmrg	esac
7010c91c449Smrg	if [ "$HP_ARCH" = hppa2.0w ]
702ff7e0accSmrg	then
7030c91c449Smrg	    eval "$set_cc_for_build"
704ff7e0accSmrg
705ff7e0accSmrg	    # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
706ff7e0accSmrg	    # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler
707ff7e0accSmrg	    # generating 64-bit code.  GNU and HP use different nomenclature:
708ff7e0accSmrg	    #
709ff7e0accSmrg	    # $ CC_FOR_BUILD=cc ./config.guess
710ff7e0accSmrg	    # => hppa2.0w-hp-hpux11.23
711ff7e0accSmrg	    # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
712ff7e0accSmrg	    # => hppa64-hp-hpux11.23
713ff7e0accSmrg
7140c91c449Smrg	    if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) |
715863f95b1Smrg		grep -q __LP64__
716ff7e0accSmrg	    then
7170c91c449Smrg		HP_ARCH=hppa2.0w
718ff7e0accSmrg	    else
7190c91c449Smrg		HP_ARCH=hppa64
720ff7e0accSmrg	    fi
721ff7e0accSmrg	fi
7220c91c449Smrg	echo "$HP_ARCH"-hp-hpux"$HPUX_REV"
723ff7e0accSmrg	exit ;;
724ff7e0accSmrg    ia64:HP-UX:*:*)
7250c91c449Smrg	HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'`
7260c91c449Smrg	echo ia64-hp-hpux"$HPUX_REV"
727ff7e0accSmrg	exit ;;
728ff7e0accSmrg    3050*:HI-UX:*:*)
7290c91c449Smrg	eval "$set_cc_for_build"
7300c91c449Smrg	sed 's/^	//' << EOF > "$dummy.c"
731ff7e0accSmrg	#include <unistd.h>
732ff7e0accSmrg	int
733ff7e0accSmrg	main ()
734ff7e0accSmrg	{
735ff7e0accSmrg	  long cpu = sysconf (_SC_CPU_VERSION);
736ff7e0accSmrg	  /* The order matters, because CPU_IS_HP_MC68K erroneously returns
737ff7e0accSmrg	     true for CPU_PA_RISC1_0.  CPU_IS_PA_RISC returns correct
738ff7e0accSmrg	     results, however.  */
739ff7e0accSmrg	  if (CPU_IS_PA_RISC (cpu))
740ff7e0accSmrg	    {
741ff7e0accSmrg	      switch (cpu)
742ff7e0accSmrg		{
743ff7e0accSmrg		  case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
744ff7e0accSmrg		  case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
745ff7e0accSmrg		  case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
746ff7e0accSmrg		  default: puts ("hppa-hitachi-hiuxwe2"); break;
747ff7e0accSmrg		}
748ff7e0accSmrg	    }
749ff7e0accSmrg	  else if (CPU_IS_HP_MC68K (cpu))
750ff7e0accSmrg	    puts ("m68k-hitachi-hiuxwe2");
751ff7e0accSmrg	  else puts ("unknown-hitachi-hiuxwe2");
752ff7e0accSmrg	  exit (0);
753ff7e0accSmrg	}
754ff7e0accSmrgEOF
7550c91c449Smrg	$CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` &&
756ff7e0accSmrg		{ echo "$SYSTEM_NAME"; exit; }
757ff7e0accSmrg	echo unknown-hitachi-hiuxwe2
758ff7e0accSmrg	exit ;;
7590c91c449Smrg    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*)
760ff7e0accSmrg	echo hppa1.1-hp-bsd
761ff7e0accSmrg	exit ;;
762ff7e0accSmrg    9000/8??:4.3bsd:*:*)
763ff7e0accSmrg	echo hppa1.0-hp-bsd
764ff7e0accSmrg	exit ;;
765ff7e0accSmrg    *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
766ff7e0accSmrg	echo hppa1.0-hp-mpeix
767ff7e0accSmrg	exit ;;
7680c91c449Smrg    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*)
769ff7e0accSmrg	echo hppa1.1-hp-osf
770ff7e0accSmrg	exit ;;
771ff7e0accSmrg    hp8??:OSF1:*:*)
772ff7e0accSmrg	echo hppa1.0-hp-osf
773ff7e0accSmrg	exit ;;
774ff7e0accSmrg    i*86:OSF1:*:*)
775ff7e0accSmrg	if [ -x /usr/sbin/sysversion ] ; then
7760c91c449Smrg	    echo "$UNAME_MACHINE"-unknown-osf1mk
777ff7e0accSmrg	else
7780c91c449Smrg	    echo "$UNAME_MACHINE"-unknown-osf1
779ff7e0accSmrg	fi
780ff7e0accSmrg	exit ;;
781ff7e0accSmrg    parisc*:Lites*:*:*)
782ff7e0accSmrg	echo hppa1.1-hp-lites
783ff7e0accSmrg	exit ;;
784ff7e0accSmrg    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
785ff7e0accSmrg	echo c1-convex-bsd
78605bee9bcSmrg	exit ;;
787ff7e0accSmrg    C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
788ff7e0accSmrg	if getsysinfo -f scalar_acc
789ff7e0accSmrg	then echo c32-convex-bsd
790ff7e0accSmrg	else echo c2-convex-bsd
791ff7e0accSmrg	fi
79205bee9bcSmrg	exit ;;
793ff7e0accSmrg    C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
794ff7e0accSmrg	echo c34-convex-bsd
79505bee9bcSmrg	exit ;;
796ff7e0accSmrg    C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
797ff7e0accSmrg	echo c38-convex-bsd
79805bee9bcSmrg	exit ;;
799ff7e0accSmrg    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
800ff7e0accSmrg	echo c4-convex-bsd
80105bee9bcSmrg	exit ;;
802ff7e0accSmrg    CRAY*Y-MP:*:*:*)
8030c91c449Smrg	echo ymp-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
804ff7e0accSmrg	exit ;;
805ff7e0accSmrg    CRAY*[A-Z]90:*:*:*)
8060c91c449Smrg	echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \
807ff7e0accSmrg	| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
808ff7e0accSmrg	      -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
809ff7e0accSmrg	      -e 's/\.[^.]*$/.X/'
810ff7e0accSmrg	exit ;;
811ff7e0accSmrg    CRAY*TS:*:*:*)
8120c91c449Smrg	echo t90-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
813ff7e0accSmrg	exit ;;
814ff7e0accSmrg    CRAY*T3E:*:*:*)
8150c91c449Smrg	echo alphaev5-cray-unicosmk"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
816ff7e0accSmrg	exit ;;
817ff7e0accSmrg    CRAY*SV1:*:*:*)
8180c91c449Smrg	echo sv1-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
819ff7e0accSmrg	exit ;;
820ff7e0accSmrg    *:UNICOS/mp:*:*)
8210c91c449Smrg	echo craynv-cray-unicosmp"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
822ff7e0accSmrg	exit ;;
823ff7e0accSmrg    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
8240c91c449Smrg	FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
8250c91c449Smrg	FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
8260c91c449Smrg	FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'`
82705bee9bcSmrg	echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
82805bee9bcSmrg	exit ;;
829ff7e0accSmrg    5000:UNIX_System_V:4.*:*)
8300c91c449Smrg	FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
8310c91c449Smrg	FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'`
83205bee9bcSmrg	echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
833ff7e0accSmrg	exit ;;
834ff7e0accSmrg    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
8350c91c449Smrg	echo "$UNAME_MACHINE"-pc-bsdi"$UNAME_RELEASE"
836ff7e0accSmrg	exit ;;
837ff7e0accSmrg    sparc*:BSD/OS:*:*)
8380c91c449Smrg	echo sparc-unknown-bsdi"$UNAME_RELEASE"
839ff7e0accSmrg	exit ;;
840ff7e0accSmrg    *:BSD/OS:*:*)
8410c91c449Smrg	echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE"
842ff7e0accSmrg	exit ;;
843ff7e0accSmrg    *:FreeBSD:*:*)
84405bee9bcSmrg	UNAME_PROCESSOR=`/usr/bin/uname -p`
8450c91c449Smrg	case "$UNAME_PROCESSOR" in
846ff7e0accSmrg	    amd64)
8470c91c449Smrg		UNAME_PROCESSOR=x86_64 ;;
8480c91c449Smrg	    i386)
8490c91c449Smrg		UNAME_PROCESSOR=i586 ;;
850ff7e0accSmrg	esac
8510c91c449Smrg	echo "$UNAME_PROCESSOR"-unknown-freebsd"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`"
852ff7e0accSmrg	exit ;;
853ff7e0accSmrg    i*:CYGWIN*:*)
8540c91c449Smrg	echo "$UNAME_MACHINE"-pc-cygwin
855ff7e0accSmrg	exit ;;
85605bee9bcSmrg    *:MINGW64*:*)
8570c91c449Smrg	echo "$UNAME_MACHINE"-pc-mingw64
85805bee9bcSmrg	exit ;;
859ff7e0accSmrg    *:MINGW*:*)
8600c91c449Smrg	echo "$UNAME_MACHINE"-pc-mingw32
86105bee9bcSmrg	exit ;;
8620c91c449Smrg    *:MSYS*:*)
8630c91c449Smrg	echo "$UNAME_MACHINE"-pc-msys
864ff7e0accSmrg	exit ;;
865ff7e0accSmrg    i*:PW*:*)
8660c91c449Smrg	echo "$UNAME_MACHINE"-pc-pw32
867ff7e0accSmrg	exit ;;
868863f95b1Smrg    *:Interix*:*)
8690c91c449Smrg	case "$UNAME_MACHINE" in
870ff7e0accSmrg	    x86)
8710c91c449Smrg		echo i586-pc-interix"$UNAME_RELEASE"
872ff7e0accSmrg		exit ;;
873863f95b1Smrg	    authenticamd | genuineintel | EM64T)
8740c91c449Smrg		echo x86_64-unknown-interix"$UNAME_RELEASE"
875ff7e0accSmrg		exit ;;
876a005d216Smrg	    IA64)
8770c91c449Smrg		echo ia64-unknown-interix"$UNAME_RELEASE"
878a005d216Smrg		exit ;;
879ff7e0accSmrg	esac ;;
880ff7e0accSmrg    i*:UWIN*:*)
8810c91c449Smrg	echo "$UNAME_MACHINE"-pc-uwin
882ff7e0accSmrg	exit ;;
883ff7e0accSmrg    amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
884ff7e0accSmrg	echo x86_64-unknown-cygwin
885ff7e0accSmrg	exit ;;
886ff7e0accSmrg    prep*:SunOS:5.*:*)
8870c91c449Smrg	echo powerpcle-unknown-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
888ff7e0accSmrg	exit ;;
889ff7e0accSmrg    *:GNU:*:*)
890ff7e0accSmrg	# the GNU system
8910c91c449Smrg	echo "`echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,'`-unknown-$LIBC`echo "$UNAME_RELEASE"|sed -e 's,/.*$,,'`"
892ff7e0accSmrg	exit ;;
893ff7e0accSmrg    *:GNU/*:*:*)
894ff7e0accSmrg	# other systems with GNU libc and userland
8950c91c449Smrg	echo "$UNAME_MACHINE-unknown-`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`-$LIBC"
896ff7e0accSmrg	exit ;;
897ff7e0accSmrg    i*86:Minix:*:*)
8980c91c449Smrg	echo "$UNAME_MACHINE"-pc-minix
899ff7e0accSmrg	exit ;;
90005bee9bcSmrg    aarch64:Linux:*:*)
9010c91c449Smrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
90205bee9bcSmrg	exit ;;
90305bee9bcSmrg    aarch64_be:Linux:*:*)
90405bee9bcSmrg	UNAME_MACHINE=aarch64_be
9050c91c449Smrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
90605bee9bcSmrg	exit ;;
907863f95b1Smrg    alpha:Linux:*:*)
908863f95b1Smrg	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
909863f95b1Smrg	  EV5)   UNAME_MACHINE=alphaev5 ;;
910863f95b1Smrg	  EV56)  UNAME_MACHINE=alphaev56 ;;
911863f95b1Smrg	  PCA56) UNAME_MACHINE=alphapca56 ;;
912863f95b1Smrg	  PCA57) UNAME_MACHINE=alphapca56 ;;
913863f95b1Smrg	  EV6)   UNAME_MACHINE=alphaev6 ;;
914863f95b1Smrg	  EV67)  UNAME_MACHINE=alphaev67 ;;
915863f95b1Smrg	  EV68*) UNAME_MACHINE=alphaev68 ;;
91605bee9bcSmrg	esac
917863f95b1Smrg	objdump --private-headers /bin/sh | grep -q ld.so.1
9180c91c449Smrg	if test "$?" = 0 ; then LIBC=gnulibc1 ; fi
9190c91c449Smrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
920863f95b1Smrg	exit ;;
92105bee9bcSmrg    arc:Linux:*:* | arceb:Linux:*:*)
9220c91c449Smrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
92305bee9bcSmrg	exit ;;
924ff7e0accSmrg    arm*:Linux:*:*)
9250c91c449Smrg	eval "$set_cc_for_build"
926a005d216Smrg	if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
927a005d216Smrg	    | grep -q __ARM_EABI__
928a005d216Smrg	then
9290c91c449Smrg	    echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
930a005d216Smrg	else
93105bee9bcSmrg	    if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
93205bee9bcSmrg		| grep -q __ARM_PCS_VFP
93305bee9bcSmrg	    then
9340c91c449Smrg		echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabi
93505bee9bcSmrg	    else
9360c91c449Smrg		echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabihf
93705bee9bcSmrg	    fi
938a005d216Smrg	fi
939ff7e0accSmrg	exit ;;
940ff7e0accSmrg    avr32*:Linux:*:*)
9410c91c449Smrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
942ff7e0accSmrg	exit ;;
943ff7e0accSmrg    cris:Linux:*:*)
9440c91c449Smrg	echo "$UNAME_MACHINE"-axis-linux-"$LIBC"
945ff7e0accSmrg	exit ;;
946ff7e0accSmrg    crisv32:Linux:*:*)
9470c91c449Smrg	echo "$UNAME_MACHINE"-axis-linux-"$LIBC"
9480c91c449Smrg	exit ;;
9490c91c449Smrg    e2k:Linux:*:*)
9500c91c449Smrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
951ff7e0accSmrg	exit ;;
952ff7e0accSmrg    frv:Linux:*:*)
9530c91c449Smrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
95405bee9bcSmrg	exit ;;
95505bee9bcSmrg    hexagon:Linux:*:*)
9560c91c449Smrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
957ff7e0accSmrg	exit ;;
958863f95b1Smrg    i*86:Linux:*:*)
9590c91c449Smrg	echo "$UNAME_MACHINE"-pc-linux-"$LIBC"
960863f95b1Smrg	exit ;;
961ff7e0accSmrg    ia64:Linux:*:*)
9620c91c449Smrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
9630c91c449Smrg	exit ;;
9640c91c449Smrg    k1om:Linux:*:*)
9650c91c449Smrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
966ff7e0accSmrg	exit ;;
967ff7e0accSmrg    m32r*:Linux:*:*)
9680c91c449Smrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
969ff7e0accSmrg	exit ;;
970ff7e0accSmrg    m68*:Linux:*:*)
9710c91c449Smrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
972ff7e0accSmrg	exit ;;
973863f95b1Smrg    mips:Linux:*:* | mips64:Linux:*:*)
9740c91c449Smrg	eval "$set_cc_for_build"
9750c91c449Smrg	sed 's/^	//' << EOF > "$dummy.c"
976ff7e0accSmrg	#undef CPU
977863f95b1Smrg	#undef ${UNAME_MACHINE}
978863f95b1Smrg	#undef ${UNAME_MACHINE}el
979ff7e0accSmrg	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
980863f95b1Smrg	CPU=${UNAME_MACHINE}el
981ff7e0accSmrg	#else
982ff7e0accSmrg	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
983863f95b1Smrg	CPU=${UNAME_MACHINE}
984ff7e0accSmrg	#else
985ff7e0accSmrg	CPU=
986ff7e0accSmrg	#endif
987ff7e0accSmrg	#endif
988ff7e0accSmrgEOF
9890c91c449Smrg	eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU'`"
9900c91c449Smrg	test "x$CPU" != x && { echo "$CPU-unknown-linux-$LIBC"; exit; }
991ff7e0accSmrg	;;
9920c91c449Smrg    mips64el:Linux:*:*)
9930c91c449Smrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
9940c91c449Smrg	exit ;;
9950c91c449Smrg    openrisc*:Linux:*:*)
9960c91c449Smrg	echo or1k-unknown-linux-"$LIBC"
99705bee9bcSmrg	exit ;;
9980c91c449Smrg    or32:Linux:*:* | or1k*:Linux:*:*)
9990c91c449Smrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
1000ff7e0accSmrg	exit ;;
100110998002Smrg    padre:Linux:*:*)
10020c91c449Smrg	echo sparc-unknown-linux-"$LIBC"
1003ff7e0accSmrg	exit ;;
1004863f95b1Smrg    parisc64:Linux:*:* | hppa64:Linux:*:*)
10050c91c449Smrg	echo hppa64-unknown-linux-"$LIBC"
1006863f95b1Smrg	exit ;;
1007ff7e0accSmrg    parisc:Linux:*:* | hppa:Linux:*:*)
1008ff7e0accSmrg	# Look for CPU level
1009ff7e0accSmrg	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
10100c91c449Smrg	  PA7*) echo hppa1.1-unknown-linux-"$LIBC" ;;
10110c91c449Smrg	  PA8*) echo hppa2.0-unknown-linux-"$LIBC" ;;
10120c91c449Smrg	  *)    echo hppa-unknown-linux-"$LIBC" ;;
1013ff7e0accSmrg	esac
1014ff7e0accSmrg	exit ;;
1015863f95b1Smrg    ppc64:Linux:*:*)
10160c91c449Smrg	echo powerpc64-unknown-linux-"$LIBC"
1017863f95b1Smrg	exit ;;
1018863f95b1Smrg    ppc:Linux:*:*)
10190c91c449Smrg	echo powerpc-unknown-linux-"$LIBC"
10200c91c449Smrg	exit ;;
10210c91c449Smrg    ppc64le:Linux:*:*)
10220c91c449Smrg	echo powerpc64le-unknown-linux-"$LIBC"
10230c91c449Smrg	exit ;;
10240c91c449Smrg    ppcle:Linux:*:*)
10250c91c449Smrg	echo powerpcle-unknown-linux-"$LIBC"
10260c91c449Smrg	exit ;;
10270c91c449Smrg    riscv32:Linux:*:* | riscv64:Linux:*:*)
10280c91c449Smrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
1029ff7e0accSmrg	exit ;;
1030ff7e0accSmrg    s390:Linux:*:* | s390x:Linux:*:*)
10310c91c449Smrg	echo "$UNAME_MACHINE"-ibm-linux-"$LIBC"
1032ff7e0accSmrg	exit ;;
1033ff7e0accSmrg    sh64*:Linux:*:*)
10340c91c449Smrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
1035ff7e0accSmrg	exit ;;
1036ff7e0accSmrg    sh*:Linux:*:*)
10370c91c449Smrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
1038ff7e0accSmrg	exit ;;
1039ff7e0accSmrg    sparc:Linux:*:* | sparc64:Linux:*:*)
10400c91c449Smrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
1041ff7e0accSmrg	exit ;;
1042863f95b1Smrg    tile*:Linux:*:*)
10430c91c449Smrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
1044863f95b1Smrg	exit ;;
1045ff7e0accSmrg    vax:Linux:*:*)
10460c91c449Smrg	echo "$UNAME_MACHINE"-dec-linux-"$LIBC"
1047ff7e0accSmrg	exit ;;
1048ff7e0accSmrg    x86_64:Linux:*:*)
10490c91c449Smrg	echo "$UNAME_MACHINE"-pc-linux-"$LIBC"
1050ff7e0accSmrg	exit ;;
1051a005d216Smrg    xtensa*:Linux:*:*)
10520c91c449Smrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
1053ff7e0accSmrg	exit ;;
1054ff7e0accSmrg    i*86:DYNIX/ptx:4*:*)
1055ff7e0accSmrg	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
1056ff7e0accSmrg	# earlier versions are messed up and put the nodename in both
1057ff7e0accSmrg	# sysname and nodename.
1058ff7e0accSmrg	echo i386-sequent-sysv4
1059ff7e0accSmrg	exit ;;
1060ff7e0accSmrg    i*86:UNIX_SV:4.2MP:2.*)
106105bee9bcSmrg	# Unixware is an offshoot of SVR4, but it has its own version
106205bee9bcSmrg	# number series starting with 2...
106305bee9bcSmrg	# I am not positive that other SVR4 systems won't match this,
1064ff7e0accSmrg	# I just have to hope.  -- rms.
106505bee9bcSmrg	# Use sysv4.2uw... so that sysv4* matches it.
10660c91c449Smrg	echo "$UNAME_MACHINE"-pc-sysv4.2uw"$UNAME_VERSION"
1067ff7e0accSmrg	exit ;;
1068ff7e0accSmrg    i*86:OS/2:*:*)
1069ff7e0accSmrg	# If we were able to find `uname', then EMX Unix compatibility
1070ff7e0accSmrg	# is probably installed.
10710c91c449Smrg	echo "$UNAME_MACHINE"-pc-os2-emx
1072ff7e0accSmrg	exit ;;
1073ff7e0accSmrg    i*86:XTS-300:*:STOP)
10740c91c449Smrg	echo "$UNAME_MACHINE"-unknown-stop
1075ff7e0accSmrg	exit ;;
1076ff7e0accSmrg    i*86:atheos:*:*)
10770c91c449Smrg	echo "$UNAME_MACHINE"-unknown-atheos
1078ff7e0accSmrg	exit ;;
1079ff7e0accSmrg    i*86:syllable:*:*)
10800c91c449Smrg	echo "$UNAME_MACHINE"-pc-syllable
1081ff7e0accSmrg	exit ;;
1082863f95b1Smrg    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
10830c91c449Smrg	echo i386-unknown-lynxos"$UNAME_RELEASE"
1084ff7e0accSmrg	exit ;;
1085ff7e0accSmrg    i*86:*DOS:*:*)
10860c91c449Smrg	echo "$UNAME_MACHINE"-pc-msdosdjgpp
1087ff7e0accSmrg	exit ;;
10880c91c449Smrg    i*86:*:4.*:*)
10890c91c449Smrg	UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'`
1090ff7e0accSmrg	if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
10910c91c449Smrg		echo "$UNAME_MACHINE"-univel-sysv"$UNAME_REL"
1092ff7e0accSmrg	else
10930c91c449Smrg		echo "$UNAME_MACHINE"-pc-sysv"$UNAME_REL"
1094ff7e0accSmrg	fi
1095ff7e0accSmrg	exit ;;
1096ff7e0accSmrg    i*86:*:5:[678]*)
109705bee9bcSmrg	# UnixWare 7.x, OpenUNIX and OpenServer 6.
1098ff7e0accSmrg	case `/bin/uname -X | grep "^Machine"` in
1099ff7e0accSmrg	    *486*)	     UNAME_MACHINE=i486 ;;
1100ff7e0accSmrg	    *Pentium)	     UNAME_MACHINE=i586 ;;
1101ff7e0accSmrg	    *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
1102ff7e0accSmrg	esac
11030c91c449Smrg	echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}{$UNAME_VERSION}"
1104ff7e0accSmrg	exit ;;
1105ff7e0accSmrg    i*86:*:3.2:*)
1106ff7e0accSmrg	if test -f /usr/options/cb.name; then
1107ff7e0accSmrg		UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
11080c91c449Smrg		echo "$UNAME_MACHINE"-pc-isc"$UNAME_REL"
1109ff7e0accSmrg	elif /bin/uname -X 2>/dev/null >/dev/null ; then
1110ff7e0accSmrg		UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
1111ff7e0accSmrg		(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
1112ff7e0accSmrg		(/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
1113ff7e0accSmrg			&& UNAME_MACHINE=i586
1114ff7e0accSmrg		(/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
1115ff7e0accSmrg			&& UNAME_MACHINE=i686
1116ff7e0accSmrg		(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
1117ff7e0accSmrg			&& UNAME_MACHINE=i686
11180c91c449Smrg		echo "$UNAME_MACHINE"-pc-sco"$UNAME_REL"
1119ff7e0accSmrg	else
11200c91c449Smrg		echo "$UNAME_MACHINE"-pc-sysv32
1121ff7e0accSmrg	fi
1122ff7e0accSmrg	exit ;;
1123ff7e0accSmrg    pc:*:*:*)
1124ff7e0accSmrg	# Left here for compatibility:
112505bee9bcSmrg	# uname -m prints for DJGPP always 'pc', but it prints nothing about
112605bee9bcSmrg	# the processor, so we play safe by assuming i586.
112710998002Smrg	# Note: whatever this is, it MUST be the same as what config.sub
11280c91c449Smrg	# prints for the "djgpp" host, or else GDB configure will decide that
112910998002Smrg	# this is a cross-build.
113010998002Smrg	echo i586-pc-msdosdjgpp
113105bee9bcSmrg	exit ;;
1132ff7e0accSmrg    Intel:Mach:3*:*)
1133ff7e0accSmrg	echo i386-pc-mach3
1134ff7e0accSmrg	exit ;;
1135ff7e0accSmrg    paragon:*:*:*)
1136ff7e0accSmrg	echo i860-intel-osf1
1137ff7e0accSmrg	exit ;;
1138ff7e0accSmrg    i860:*:4.*:*) # i860-SVR4
1139ff7e0accSmrg	if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
11400c91c449Smrg	  echo i860-stardent-sysv"$UNAME_RELEASE" # Stardent Vistra i860-SVR4
1141ff7e0accSmrg	else # Add other i860-SVR4 vendors below as they are discovered.
11420c91c449Smrg	  echo i860-unknown-sysv"$UNAME_RELEASE"  # Unknown i860-SVR4
1143ff7e0accSmrg	fi
1144ff7e0accSmrg	exit ;;
1145ff7e0accSmrg    mini*:CTIX:SYS*5:*)
1146ff7e0accSmrg	# "miniframe"
1147ff7e0accSmrg	echo m68010-convergent-sysv
1148ff7e0accSmrg	exit ;;
1149ff7e0accSmrg    mc68k:UNIX:SYSTEM5:3.51m)
1150ff7e0accSmrg	echo m68k-convergent-sysv
1151ff7e0accSmrg	exit ;;
1152ff7e0accSmrg    M680?0:D-NIX:5.3:*)
1153ff7e0accSmrg	echo m68k-diab-dnix
1154ff7e0accSmrg	exit ;;
1155ff7e0accSmrg    M68*:*:R3V[5678]*:*)
1156ff7e0accSmrg	test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
1157ff7e0accSmrg    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)
1158ff7e0accSmrg	OS_REL=''
1159ff7e0accSmrg	test -r /etc/.relid \
1160ff7e0accSmrg	&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
1161ff7e0accSmrg	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
11620c91c449Smrg	  && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
1163ff7e0accSmrg	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
11640c91c449Smrg	  && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
1165ff7e0accSmrg    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
116605bee9bcSmrg	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
116705bee9bcSmrg	  && { echo i486-ncr-sysv4; exit; } ;;
116810998002Smrg    NCR*:*:4.2:* | MPRAS*:*:4.2:*)
116910998002Smrg	OS_REL='.3'
117010998002Smrg	test -r /etc/.relid \
117110998002Smrg	    && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
117210998002Smrg	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
11730c91c449Smrg	    && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
117410998002Smrg	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
11750c91c449Smrg	    && { echo i586-ncr-sysv4.3"$OS_REL"; exit; }
117610998002Smrg	/bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
11770c91c449Smrg	    && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
1178ff7e0accSmrg    m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
11790c91c449Smrg	echo m68k-unknown-lynxos"$UNAME_RELEASE"
1180ff7e0accSmrg	exit ;;
1181ff7e0accSmrg    mc68030:UNIX_System_V:4.*:*)
1182ff7e0accSmrg	echo m68k-atari-sysv4
1183ff7e0accSmrg	exit ;;
1184ff7e0accSmrg    TSUNAMI:LynxOS:2.*:*)
11850c91c449Smrg	echo sparc-unknown-lynxos"$UNAME_RELEASE"
1186ff7e0accSmrg	exit ;;
1187ff7e0accSmrg    rs6000:LynxOS:2.*:*)
11880c91c449Smrg	echo rs6000-unknown-lynxos"$UNAME_RELEASE"
1189ff7e0accSmrg	exit ;;
1190863f95b1Smrg    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
11910c91c449Smrg	echo powerpc-unknown-lynxos"$UNAME_RELEASE"
1192ff7e0accSmrg	exit ;;
1193ff7e0accSmrg    SM[BE]S:UNIX_SV:*:*)
11940c91c449Smrg	echo mips-dde-sysv"$UNAME_RELEASE"
1195ff7e0accSmrg	exit ;;
1196ff7e0accSmrg    RM*:ReliantUNIX-*:*:*)
1197ff7e0accSmrg	echo mips-sni-sysv4
1198ff7e0accSmrg	exit ;;
1199ff7e0accSmrg    RM*:SINIX-*:*:*)
1200ff7e0accSmrg	echo mips-sni-sysv4
1201ff7e0accSmrg	exit ;;
1202ff7e0accSmrg    *:SINIX-*:*:*)
1203ff7e0accSmrg	if uname -p 2>/dev/null >/dev/null ; then
1204ff7e0accSmrg		UNAME_MACHINE=`(uname -p) 2>/dev/null`
12050c91c449Smrg		echo "$UNAME_MACHINE"-sni-sysv4
1206ff7e0accSmrg	else
1207ff7e0accSmrg		echo ns32k-sni-sysv
1208ff7e0accSmrg	fi
1209ff7e0accSmrg	exit ;;
121005bee9bcSmrg    PENTIUM:*:4.0*:*)	# Unisys `ClearPath HMP IX 4000' SVR4/MP effort
121105bee9bcSmrg			# says <Richard.M.Bartel@ccMail.Census.GOV>
121205bee9bcSmrg	echo i586-unisys-sysv4
121305bee9bcSmrg	exit ;;
1214ff7e0accSmrg    *:UNIX_System_V:4*:FTX*)
1215ff7e0accSmrg	# From Gerald Hewes <hewes@openmarket.com>.
1216ff7e0accSmrg	# How about differentiating between stratus architectures? -djm
1217ff7e0accSmrg	echo hppa1.1-stratus-sysv4
1218ff7e0accSmrg	exit ;;
1219ff7e0accSmrg    *:*:*:FTX*)
1220ff7e0accSmrg	# From seanf@swdc.stratus.com.
1221ff7e0accSmrg	echo i860-stratus-sysv4
1222ff7e0accSmrg	exit ;;
1223ff7e0accSmrg    i*86:VOS:*:*)
1224ff7e0accSmrg	# From Paul.Green@stratus.com.
12250c91c449Smrg	echo "$UNAME_MACHINE"-stratus-vos
1226ff7e0accSmrg	exit ;;
1227ff7e0accSmrg    *:VOS:*:*)
1228ff7e0accSmrg	# From Paul.Green@stratus.com.
1229ff7e0accSmrg	echo hppa1.1-stratus-vos
1230ff7e0accSmrg	exit ;;
1231ff7e0accSmrg    mc68*:A/UX:*:*)
12320c91c449Smrg	echo m68k-apple-aux"$UNAME_RELEASE"
1233ff7e0accSmrg	exit ;;
1234ff7e0accSmrg    news*:NEWS-OS:6*:*)
1235ff7e0accSmrg	echo mips-sony-newsos6
1236ff7e0accSmrg	exit ;;
1237ff7e0accSmrg    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
1238ff7e0accSmrg	if [ -d /usr/nec ]; then
12390c91c449Smrg		echo mips-nec-sysv"$UNAME_RELEASE"
1240ff7e0accSmrg	else
12410c91c449Smrg		echo mips-unknown-sysv"$UNAME_RELEASE"
1242ff7e0accSmrg	fi
124305bee9bcSmrg	exit ;;
1244ff7e0accSmrg    BeBox:BeOS:*:*)	# BeOS running on hardware made by Be, PPC only.
1245ff7e0accSmrg	echo powerpc-be-beos
1246ff7e0accSmrg	exit ;;
1247ff7e0accSmrg    BeMac:BeOS:*:*)	# BeOS running on Mac or Mac clone, PPC only.
1248ff7e0accSmrg	echo powerpc-apple-beos
1249ff7e0accSmrg	exit ;;
1250ff7e0accSmrg    BePC:BeOS:*:*)	# BeOS running on Intel PC compatible.
1251ff7e0accSmrg	echo i586-pc-beos
1252ff7e0accSmrg	exit ;;
125310998002Smrg    BePC:Haiku:*:*)	# Haiku running on Intel PC compatible.
125410998002Smrg	echo i586-pc-haiku
125510998002Smrg	exit ;;
125605bee9bcSmrg    x86_64:Haiku:*:*)
125705bee9bcSmrg	echo x86_64-unknown-haiku
125805bee9bcSmrg	exit ;;
1259ff7e0accSmrg    SX-4:SUPER-UX:*:*)
12600c91c449Smrg	echo sx4-nec-superux"$UNAME_RELEASE"
1261ff7e0accSmrg	exit ;;
1262ff7e0accSmrg    SX-5:SUPER-UX:*:*)
12630c91c449Smrg	echo sx5-nec-superux"$UNAME_RELEASE"
1264ff7e0accSmrg	exit ;;
1265ff7e0accSmrg    SX-6:SUPER-UX:*:*)
12660c91c449Smrg	echo sx6-nec-superux"$UNAME_RELEASE"
1267ff7e0accSmrg	exit ;;
1268ff7e0accSmrg    SX-7:SUPER-UX:*:*)
12690c91c449Smrg	echo sx7-nec-superux"$UNAME_RELEASE"
1270ff7e0accSmrg	exit ;;
1271ff7e0accSmrg    SX-8:SUPER-UX:*:*)
12720c91c449Smrg	echo sx8-nec-superux"$UNAME_RELEASE"
1273ff7e0accSmrg	exit ;;
1274ff7e0accSmrg    SX-8R:SUPER-UX:*:*)
12750c91c449Smrg	echo sx8r-nec-superux"$UNAME_RELEASE"
12760c91c449Smrg	exit ;;
12770c91c449Smrg    SX-ACE:SUPER-UX:*:*)
12780c91c449Smrg	echo sxace-nec-superux"$UNAME_RELEASE"
1279ff7e0accSmrg	exit ;;
1280ff7e0accSmrg    Power*:Rhapsody:*:*)
12810c91c449Smrg	echo powerpc-apple-rhapsody"$UNAME_RELEASE"
1282ff7e0accSmrg	exit ;;
1283ff7e0accSmrg    *:Rhapsody:*:*)
12840c91c449Smrg	echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE"
1285ff7e0accSmrg	exit ;;
1286ff7e0accSmrg    *:Darwin:*:*)
1287ff7e0accSmrg	UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
12880c91c449Smrg	eval "$set_cc_for_build"
12890c91c449Smrg	if test "$UNAME_PROCESSOR" = unknown ; then
12900c91c449Smrg	    UNAME_PROCESSOR=powerpc
12910c91c449Smrg	fi
12920c91c449Smrg	if test "`echo "$UNAME_RELEASE" | sed -e 's/\..*//'`" -le 10 ; then
12930c91c449Smrg	    if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
12940c91c449Smrg		if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
12950c91c449Smrg		       (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
12960c91c449Smrg		       grep IS_64BIT_ARCH >/dev/null
12970c91c449Smrg		then
12980c91c449Smrg		    case $UNAME_PROCESSOR in
12990c91c449Smrg			i386) UNAME_PROCESSOR=x86_64 ;;
13000c91c449Smrg			powerpc) UNAME_PROCESSOR=powerpc64 ;;
13010c91c449Smrg		    esac
13020c91c449Smrg		fi
13030c91c449Smrg		# On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc
13040c91c449Smrg		if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \
13050c91c449Smrg		       (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
13060c91c449Smrg		       grep IS_PPC >/dev/null
13070c91c449Smrg		then
13080c91c449Smrg		    UNAME_PROCESSOR=powerpc
13090c91c449Smrg		fi
13100c91c449Smrg	    fi
13110c91c449Smrg	elif test "$UNAME_PROCESSOR" = i386 ; then
13120c91c449Smrg	    # Avoid executing cc on OS X 10.9, as it ships with a stub
13130c91c449Smrg	    # that puts up a graphical alert prompting to install
13140c91c449Smrg	    # developer tools.  Any system running Mac OS X 10.7 or
13150c91c449Smrg	    # later (Darwin 11 and later) is required to have a 64-bit
13160c91c449Smrg	    # processor. This is not true of the ARM version of Darwin
13170c91c449Smrg	    # that Apple uses in portable devices.
13180c91c449Smrg	    UNAME_PROCESSOR=x86_64
13190c91c449Smrg	fi
13200c91c449Smrg	echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE"
1321ff7e0accSmrg	exit ;;
1322ff7e0accSmrg    *:procnto*:*:* | *:QNX:[0123456789]*:*)
1323ff7e0accSmrg	UNAME_PROCESSOR=`uname -p`
13240c91c449Smrg	if test "$UNAME_PROCESSOR" = x86; then
1325ff7e0accSmrg		UNAME_PROCESSOR=i386
1326ff7e0accSmrg		UNAME_MACHINE=pc
1327ff7e0accSmrg	fi
13280c91c449Smrg	echo "$UNAME_PROCESSOR"-"$UNAME_MACHINE"-nto-qnx"$UNAME_RELEASE"
1329ff7e0accSmrg	exit ;;
1330ff7e0accSmrg    *:QNX:*:4*)
1331ff7e0accSmrg	echo i386-pc-qnx
1332ff7e0accSmrg	exit ;;
13330c91c449Smrg    NEO-*:NONSTOP_KERNEL:*:*)
13340c91c449Smrg	echo neo-tandem-nsk"$UNAME_RELEASE"
133505bee9bcSmrg	exit ;;
133605bee9bcSmrg    NSE-*:NONSTOP_KERNEL:*:*)
13370c91c449Smrg	echo nse-tandem-nsk"$UNAME_RELEASE"
13380c91c449Smrg	exit ;;
13390c91c449Smrg    NSR-*:NONSTOP_KERNEL:*:*)
13400c91c449Smrg	echo nsr-tandem-nsk"$UNAME_RELEASE"
1341ff7e0accSmrg	exit ;;
13420c91c449Smrg    NSV-*:NONSTOP_KERNEL:*:*)
13430c91c449Smrg	echo nsv-tandem-nsk"$UNAME_RELEASE"
13440c91c449Smrg	exit ;;
13450c91c449Smrg    NSX-*:NONSTOP_KERNEL:*:*)
13460c91c449Smrg	echo nsx-tandem-nsk"$UNAME_RELEASE"
1347ff7e0accSmrg	exit ;;
1348ff7e0accSmrg    *:NonStop-UX:*:*)
1349ff7e0accSmrg	echo mips-compaq-nonstopux
1350ff7e0accSmrg	exit ;;
1351ff7e0accSmrg    BS2000:POSIX*:*:*)
1352ff7e0accSmrg	echo bs2000-siemens-sysv
1353ff7e0accSmrg	exit ;;
1354ff7e0accSmrg    DS/*:UNIX_System_V:*:*)
13550c91c449Smrg	echo "$UNAME_MACHINE"-"$UNAME_SYSTEM"-"$UNAME_RELEASE"
1356ff7e0accSmrg	exit ;;
1357ff7e0accSmrg    *:Plan9:*:*)
1358ff7e0accSmrg	# "uname -m" is not consistent, so use $cputype instead. 386
1359ff7e0accSmrg	# is converted to i386 for consistency with other x86
1360ff7e0accSmrg	# operating systems.
13610c91c449Smrg	if test "$cputype" = 386; then
1362ff7e0accSmrg	    UNAME_MACHINE=i386
1363ff7e0accSmrg	else
1364ff7e0accSmrg	    UNAME_MACHINE="$cputype"
1365ff7e0accSmrg	fi
13660c91c449Smrg	echo "$UNAME_MACHINE"-unknown-plan9
1367ff7e0accSmrg	exit ;;
1368ff7e0accSmrg    *:TOPS-10:*:*)
1369ff7e0accSmrg	echo pdp10-unknown-tops10
1370ff7e0accSmrg	exit ;;
1371ff7e0accSmrg    *:TENEX:*:*)
1372ff7e0accSmrg	echo pdp10-unknown-tenex
1373ff7e0accSmrg	exit ;;
1374ff7e0accSmrg    KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
1375ff7e0accSmrg	echo pdp10-dec-tops20
1376ff7e0accSmrg	exit ;;
1377ff7e0accSmrg    XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
1378ff7e0accSmrg	echo pdp10-xkl-tops20
1379ff7e0accSmrg	exit ;;
1380ff7e0accSmrg    *:TOPS-20:*:*)
1381ff7e0accSmrg	echo pdp10-unknown-tops20
1382ff7e0accSmrg	exit ;;
1383ff7e0accSmrg    *:ITS:*:*)
1384ff7e0accSmrg	echo pdp10-unknown-its
1385ff7e0accSmrg	exit ;;
1386ff7e0accSmrg    SEI:*:*:SEIUX)
13870c91c449Smrg	echo mips-sei-seiux"$UNAME_RELEASE"
1388ff7e0accSmrg	exit ;;
1389ff7e0accSmrg    *:DragonFly:*:*)
13900c91c449Smrg	echo "$UNAME_MACHINE"-unknown-dragonfly"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`"
1391ff7e0accSmrg	exit ;;
1392ff7e0accSmrg    *:*VMS:*:*)
139305bee9bcSmrg	UNAME_MACHINE=`(uname -p) 2>/dev/null`
13940c91c449Smrg	case "$UNAME_MACHINE" in
1395ff7e0accSmrg	    A*) echo alpha-dec-vms ; exit ;;
1396ff7e0accSmrg	    I*) echo ia64-dec-vms ; exit ;;
1397ff7e0accSmrg	    V*) echo vax-dec-vms ; exit ;;
1398ff7e0accSmrg	esac ;;
1399ff7e0accSmrg    *:XENIX:*:SysV)
1400ff7e0accSmrg	echo i386-pc-xenix
1401ff7e0accSmrg	exit ;;
1402ff7e0accSmrg    i*86:skyos:*:*)
14030c91c449Smrg	echo "$UNAME_MACHINE"-pc-skyos"`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`"
1404ff7e0accSmrg	exit ;;
1405ff7e0accSmrg    i*86:rdos:*:*)
14060c91c449Smrg	echo "$UNAME_MACHINE"-pc-rdos
1407ff7e0accSmrg	exit ;;
140810998002Smrg    i*86:AROS:*:*)
14090c91c449Smrg	echo "$UNAME_MACHINE"-pc-aros
141010998002Smrg	exit ;;
141105bee9bcSmrg    x86_64:VMkernel:*:*)
14120c91c449Smrg	echo "$UNAME_MACHINE"-unknown-esx
14130c91c449Smrg	exit ;;
14140c91c449Smrg    amd64:Isilon\ OneFS:*:*)
14150c91c449Smrg	echo x86_64-unknown-onefs
141605bee9bcSmrg	exit ;;
1417ff7e0accSmrgesac
1418ff7e0accSmrg
14190c91c449Smrgecho "$0: unable to guess system type" >&2
1420ff7e0accSmrg
14210c91c449Smrgcase "$UNAME_MACHINE:$UNAME_SYSTEM" in
14220c91c449Smrg    mips:Linux | mips64:Linux)
14230c91c449Smrg	# If we got here on MIPS GNU/Linux, output extra information.
14240c91c449Smrg	cat >&2 <<EOF
1425ff7e0accSmrg
14260c91c449SmrgNOTE: MIPS GNU/Linux systems require a C compiler to fully recognize
14270c91c449Smrgthe system type. Please install a C compiler and try again.
1428ff7e0accSmrgEOF
14290c91c449Smrg	;;
14300c91c449Smrgesac
1431ff7e0accSmrg
1432ff7e0accSmrgcat >&2 <<EOF
1433ff7e0accSmrg
14340c91c449SmrgThis script (version $timestamp), has failed to recognize the
14350c91c449Smrgoperating system you are using. If your script is old, overwrite *all*
14360c91c449Smrgcopies of config.guess and config.sub with the latest versions from:
1437ff7e0accSmrg
14380c91c449Smrg  https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
1439ff7e0accSmrgand
14400c91c449Smrg  https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
1441ff7e0accSmrg
14420c91c449SmrgIf $0 has already been updated, send the following data and any
14430c91c449Smrginformation you think might be pertinent to config-patches@gnu.org to
14440c91c449Smrgprovide the necessary information to handle your system.
1445ff7e0accSmrg
1446ff7e0accSmrgconfig.guess timestamp = $timestamp
1447ff7e0accSmrg
1448ff7e0accSmrguname -m = `(uname -m) 2>/dev/null || echo unknown`
1449ff7e0accSmrguname -r = `(uname -r) 2>/dev/null || echo unknown`
1450ff7e0accSmrguname -s = `(uname -s) 2>/dev/null || echo unknown`
1451ff7e0accSmrguname -v = `(uname -v) 2>/dev/null || echo unknown`
1452ff7e0accSmrg
1453ff7e0accSmrg/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
1454ff7e0accSmrg/bin/uname -X     = `(/bin/uname -X) 2>/dev/null`
1455ff7e0accSmrg
1456ff7e0accSmrghostinfo               = `(hostinfo) 2>/dev/null`
1457ff7e0accSmrg/bin/universe          = `(/bin/universe) 2>/dev/null`
1458ff7e0accSmrg/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null`
1459ff7e0accSmrg/bin/arch              = `(/bin/arch) 2>/dev/null`
1460ff7e0accSmrg/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`
1461ff7e0accSmrg/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
1462ff7e0accSmrg
14630c91c449SmrgUNAME_MACHINE = "$UNAME_MACHINE"
14640c91c449SmrgUNAME_RELEASE = "$UNAME_RELEASE"
14650c91c449SmrgUNAME_SYSTEM  = "$UNAME_SYSTEM"
14660c91c449SmrgUNAME_VERSION = "$UNAME_VERSION"
1467ff7e0accSmrgEOF
1468ff7e0accSmrg
1469ff7e0accSmrgexit 1
1470ff7e0accSmrg
1471ff7e0accSmrg# Local variables:
14720c91c449Smrg# eval: (add-hook 'write-file-functions 'time-stamp)
1473ff7e0accSmrg# time-stamp-start: "timestamp='"
1474ff7e0accSmrg# time-stamp-format: "%:y-%02m-%02d"
1475ff7e0accSmrg# time-stamp-end: "'"
1476ff7e0accSmrg# End:
1477