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