config.guess revision 05bee9bc
1ff7e0accSmrg#! /bin/sh
2ff7e0accSmrg# Attempt to guess a canonical system name.
305bee9bcSmrg#   Copyright 1992-2013 Free Software Foundation, Inc.
4ff7e0accSmrg
505bee9bcSmrgtimestamp='2013-04-24'
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
1805bee9bcSmrg# along with this program; if not, see <http://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#
2705bee9bcSmrg# Originally written by Per Bothner.
28ff7e0accSmrg#
29863f95b1Smrg# You can get the latest version of this script from:
30863f95b1Smrg# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
3105bee9bcSmrg#
3205bee9bcSmrg# Please send patches with a ChangeLog entry 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
42ff7e0accSmrgOperation modes:
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.
5305bee9bcSmrgCopyright 1992-2013 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
110ff7e0accSmrg ,,)    echo "int x;" > $dummy.c ;
111ff7e0accSmrg	for c in cc gcc c89 c99 ; do
112ff7e0accSmrg	  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
135ff7e0accSmrg# Note: order is significant - the case branches are not exclusive.
136ff7e0accSmrg
137ff7e0accSmrgcase "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
138ff7e0accSmrg    *:NetBSD:*:*)
139ff7e0accSmrg	# NetBSD (nbsd) targets should (where applicable) match one or
14005bee9bcSmrg	# more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
141ff7e0accSmrg	# *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
142ff7e0accSmrg	# switched to ELF, *-*-netbsd* would select the old
143ff7e0accSmrg	# object file format.  This provides both forward
144ff7e0accSmrg	# compatibility and a consistent mechanism for selecting the
145ff7e0accSmrg	# object file format.
146ff7e0accSmrg	#
147ff7e0accSmrg	# Note: NetBSD doesn't particularly care about the vendor
148ff7e0accSmrg	# portion of the name.  We always set it to "unknown".
149ff7e0accSmrg	sysctl="sysctl -n hw.machine_arch"
150ff7e0accSmrg	UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
151ff7e0accSmrg	    /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
152ff7e0accSmrg	case "${UNAME_MACHINE_ARCH}" in
153ff7e0accSmrg	    armeb) machine=armeb-unknown ;;
154ff7e0accSmrg	    arm*) machine=arm-unknown ;;
155ff7e0accSmrg	    sh3el) machine=shl-unknown ;;
156ff7e0accSmrg	    sh3eb) machine=sh-unknown ;;
157ff7e0accSmrg	    sh5el) machine=sh5le-unknown ;;
158ff7e0accSmrg	    *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
159ff7e0accSmrg	esac
160ff7e0accSmrg	# The Operating System including object format, if it has switched
161ff7e0accSmrg	# to ELF recently, or will in the future.
162ff7e0accSmrg	case "${UNAME_MACHINE_ARCH}" in
163ff7e0accSmrg	    arm*|i386|m68k|ns32k|sh3*|sparc|vax)
164ff7e0accSmrg		eval $set_cc_for_build
165ff7e0accSmrg		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
166863f95b1Smrg			| grep -q __ELF__
167ff7e0accSmrg		then
168ff7e0accSmrg		    # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
169ff7e0accSmrg		    # Return netbsd for either.  FIX?
170ff7e0accSmrg		    os=netbsd
171ff7e0accSmrg		else
172ff7e0accSmrg		    os=netbsdelf
173ff7e0accSmrg		fi
174ff7e0accSmrg		;;
175ff7e0accSmrg	    *)
17605bee9bcSmrg		os=netbsd
177ff7e0accSmrg		;;
178ff7e0accSmrg	esac
179ff7e0accSmrg	# The OS release
180ff7e0accSmrg	# Debian GNU/NetBSD machines have a different userland, and
181ff7e0accSmrg	# thus, need a distinct triplet. However, they do not need
182ff7e0accSmrg	# kernel version information, so it can be replaced with a
183ff7e0accSmrg	# suitable tag, in the style of linux-gnu.
184ff7e0accSmrg	case "${UNAME_VERSION}" in
185ff7e0accSmrg	    Debian*)
186ff7e0accSmrg		release='-gnu'
187ff7e0accSmrg		;;
188ff7e0accSmrg	    *)
189ff7e0accSmrg		release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
190ff7e0accSmrg		;;
191ff7e0accSmrg	esac
192ff7e0accSmrg	# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
193ff7e0accSmrg	# contains redundant information, the shorter form:
194ff7e0accSmrg	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
195ff7e0accSmrg	echo "${machine}-${os}${release}"
196ff7e0accSmrg	exit ;;
19705bee9bcSmrg    *:Bitrig:*:*)
19805bee9bcSmrg	UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
19905bee9bcSmrg	echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE}
20005bee9bcSmrg	exit ;;
201ff7e0accSmrg    *:OpenBSD:*:*)
202ff7e0accSmrg	UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
203ff7e0accSmrg	echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
204ff7e0accSmrg	exit ;;
205ff7e0accSmrg    *:ekkoBSD:*:*)
206ff7e0accSmrg	echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
207ff7e0accSmrg	exit ;;
208ff7e0accSmrg    *:SolidBSD:*:*)
209ff7e0accSmrg	echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
210ff7e0accSmrg	exit ;;
211ff7e0accSmrg    macppc:MirBSD:*:*)
212ff7e0accSmrg	echo powerpc-unknown-mirbsd${UNAME_RELEASE}
213ff7e0accSmrg	exit ;;
214ff7e0accSmrg    *:MirBSD:*:*)
215ff7e0accSmrg	echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
216ff7e0accSmrg	exit ;;
217ff7e0accSmrg    alpha:OSF1:*:*)
218ff7e0accSmrg	case $UNAME_RELEASE in
219ff7e0accSmrg	*4.0)
220ff7e0accSmrg		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
221ff7e0accSmrg		;;
222ff7e0accSmrg	*5.*)
22305bee9bcSmrg		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
224ff7e0accSmrg		;;
225ff7e0accSmrg	esac
226ff7e0accSmrg	# According to Compaq, /usr/sbin/psrinfo has been available on
227ff7e0accSmrg	# OSF/1 and Tru64 systems produced since 1995.  I hope that
228ff7e0accSmrg	# covers most systems running today.  This code pipes the CPU
229ff7e0accSmrg	# types through head -n 1, so we only detect the type of CPU 0.
230ff7e0accSmrg	ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\) processor.*$/\1/p' | head -n 1`
231ff7e0accSmrg	case "$ALPHA_CPU_TYPE" in
232ff7e0accSmrg	    "EV4 (21064)")
233ff7e0accSmrg		UNAME_MACHINE="alpha" ;;
234ff7e0accSmrg	    "EV4.5 (21064)")
235ff7e0accSmrg		UNAME_MACHINE="alpha" ;;
236ff7e0accSmrg	    "LCA4 (21066/21068)")
237ff7e0accSmrg		UNAME_MACHINE="alpha" ;;
238ff7e0accSmrg	    "EV5 (21164)")
239ff7e0accSmrg		UNAME_MACHINE="alphaev5" ;;
240ff7e0accSmrg	    "EV5.6 (21164A)")
241ff7e0accSmrg		UNAME_MACHINE="alphaev56" ;;
242ff7e0accSmrg	    "EV5.6 (21164PC)")
243ff7e0accSmrg		UNAME_MACHINE="alphapca56" ;;
244ff7e0accSmrg	    "EV5.7 (21164PC)")
245ff7e0accSmrg		UNAME_MACHINE="alphapca57" ;;
246ff7e0accSmrg	    "EV6 (21264)")
247ff7e0accSmrg		UNAME_MACHINE="alphaev6" ;;
248ff7e0accSmrg	    "EV6.7 (21264A)")
249ff7e0accSmrg		UNAME_MACHINE="alphaev67" ;;
250ff7e0accSmrg	    "EV6.8CB (21264C)")
251ff7e0accSmrg		UNAME_MACHINE="alphaev68" ;;
252ff7e0accSmrg	    "EV6.8AL (21264B)")
253ff7e0accSmrg		UNAME_MACHINE="alphaev68" ;;
254ff7e0accSmrg	    "EV6.8CX (21264D)")
255ff7e0accSmrg		UNAME_MACHINE="alphaev68" ;;
256ff7e0accSmrg	    "EV6.9A (21264/EV69A)")
257ff7e0accSmrg		UNAME_MACHINE="alphaev69" ;;
258ff7e0accSmrg	    "EV7 (21364)")
259ff7e0accSmrg		UNAME_MACHINE="alphaev7" ;;
260ff7e0accSmrg	    "EV7.9 (21364A)")
261ff7e0accSmrg		UNAME_MACHINE="alphaev79" ;;
262ff7e0accSmrg	esac
263ff7e0accSmrg	# A Pn.n version is a patched version.
264ff7e0accSmrg	# A Vn.n version is a released version.
265ff7e0accSmrg	# A Tn.n version is a released field test version.
266ff7e0accSmrg	# A Xn.n version is an unreleased experimental baselevel.
267ff7e0accSmrg	# 1.2 uses "1.2" for uname -r.
268ff7e0accSmrg	echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
26905bee9bcSmrg	# Reset EXIT trap before exiting to avoid spurious non-zero exit code.
27005bee9bcSmrg	exitcode=$?
27105bee9bcSmrg	trap '' 0
27205bee9bcSmrg	exit $exitcode ;;
273ff7e0accSmrg    Alpha\ *:Windows_NT*:*)
274ff7e0accSmrg	# How do we know it's Interix rather than the generic POSIX subsystem?
275ff7e0accSmrg	# Should we change UNAME_MACHINE based on the output of uname instead
276ff7e0accSmrg	# of the specific Alpha model?
277ff7e0accSmrg	echo alpha-pc-interix
278ff7e0accSmrg	exit ;;
279ff7e0accSmrg    21064:Windows_NT:50:3)
280ff7e0accSmrg	echo alpha-dec-winnt3.5
281ff7e0accSmrg	exit ;;
282ff7e0accSmrg    Amiga*:UNIX_System_V:4.0:*)
283ff7e0accSmrg	echo m68k-unknown-sysv4
284ff7e0accSmrg	exit ;;
285ff7e0accSmrg    *:[Aa]miga[Oo][Ss]:*:*)
286ff7e0accSmrg	echo ${UNAME_MACHINE}-unknown-amigaos
287ff7e0accSmrg	exit ;;
288ff7e0accSmrg    *:[Mm]orph[Oo][Ss]:*:*)
289ff7e0accSmrg	echo ${UNAME_MACHINE}-unknown-morphos
290ff7e0accSmrg	exit ;;
291ff7e0accSmrg    *:OS/390:*:*)
292ff7e0accSmrg	echo i370-ibm-openedition
293ff7e0accSmrg	exit ;;
294ff7e0accSmrg    *:z/VM:*:*)
295ff7e0accSmrg	echo s390-ibm-zvmoe
296ff7e0accSmrg	exit ;;
297ff7e0accSmrg    *:OS400:*:*)
29805bee9bcSmrg	echo powerpc-ibm-os400
299ff7e0accSmrg	exit ;;
300ff7e0accSmrg    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
301ff7e0accSmrg	echo arm-acorn-riscix${UNAME_RELEASE}
302ff7e0accSmrg	exit ;;
30305bee9bcSmrg    arm*:riscos:*:*|arm*:RISCOS:*:*)
304ff7e0accSmrg	echo arm-unknown-riscos
305ff7e0accSmrg	exit ;;
306ff7e0accSmrg    SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
307ff7e0accSmrg	echo hppa1.1-hitachi-hiuxmpp
308ff7e0accSmrg	exit ;;
309ff7e0accSmrg    Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
310ff7e0accSmrg	# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
311ff7e0accSmrg	if test "`(/bin/universe) 2>/dev/null`" = att ; then
312ff7e0accSmrg		echo pyramid-pyramid-sysv3
313ff7e0accSmrg	else
314ff7e0accSmrg		echo pyramid-pyramid-bsd
315ff7e0accSmrg	fi
316ff7e0accSmrg	exit ;;
317ff7e0accSmrg    NILE*:*:*:dcosx)
318ff7e0accSmrg	echo pyramid-pyramid-svr4
319ff7e0accSmrg	exit ;;
320ff7e0accSmrg    DRS?6000:unix:4.0:6*)
321ff7e0accSmrg	echo sparc-icl-nx6
322ff7e0accSmrg	exit ;;
323ff7e0accSmrg    DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
324ff7e0accSmrg	case `/usr/bin/uname -p` in
325ff7e0accSmrg	    sparc) echo sparc-icl-nx7; exit ;;
326ff7e0accSmrg	esac ;;
32710998002Smrg    s390x:SunOS:*:*)
32810998002Smrg	echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
32910998002Smrg	exit ;;
330ff7e0accSmrg    sun4H:SunOS:5.*:*)
331ff7e0accSmrg	echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
332ff7e0accSmrg	exit ;;
333ff7e0accSmrg    sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
334ff7e0accSmrg	echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
335ff7e0accSmrg	exit ;;
336863f95b1Smrg    i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
337863f95b1Smrg	echo i386-pc-auroraux${UNAME_RELEASE}
338863f95b1Smrg	exit ;;
339ff7e0accSmrg    i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
34010998002Smrg	eval $set_cc_for_build
34110998002Smrg	SUN_ARCH="i386"
34210998002Smrg	# If there is a compiler, see if it is configured for 64-bit objects.
34310998002Smrg	# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
34410998002Smrg	# This test works for both compilers.
34510998002Smrg	if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
34610998002Smrg	    if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
34710998002Smrg		(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
34810998002Smrg		grep IS_64BIT_ARCH >/dev/null
34910998002Smrg	    then
35010998002Smrg		SUN_ARCH="x86_64"
35110998002Smrg	    fi
35210998002Smrg	fi
35310998002Smrg	echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
354ff7e0accSmrg	exit ;;
355ff7e0accSmrg    sun4*:SunOS:6*:*)
356ff7e0accSmrg	# According to config.sub, this is the proper way to canonicalize
357ff7e0accSmrg	# SunOS6.  Hard to guess exactly what SunOS6 will be like, but
358ff7e0accSmrg	# it's likely to be more like Solaris than SunOS4.
359ff7e0accSmrg	echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
360ff7e0accSmrg	exit ;;
361ff7e0accSmrg    sun4*:SunOS:*:*)
362ff7e0accSmrg	case "`/usr/bin/arch -k`" in
363ff7e0accSmrg	    Series*|S4*)
364ff7e0accSmrg		UNAME_RELEASE=`uname -v`
365ff7e0accSmrg		;;
366ff7e0accSmrg	esac
367ff7e0accSmrg	# Japanese Language versions have a version number like `4.1.3-JL'.
368ff7e0accSmrg	echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
369ff7e0accSmrg	exit ;;
370ff7e0accSmrg    sun3*:SunOS:*:*)
371ff7e0accSmrg	echo m68k-sun-sunos${UNAME_RELEASE}
372ff7e0accSmrg	exit ;;
373ff7e0accSmrg    sun*:*:4.2BSD:*)
374ff7e0accSmrg	UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
375ff7e0accSmrg	test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
376ff7e0accSmrg	case "`/bin/arch`" in
377ff7e0accSmrg	    sun3)
378ff7e0accSmrg		echo m68k-sun-sunos${UNAME_RELEASE}
379ff7e0accSmrg		;;
380ff7e0accSmrg	    sun4)
381ff7e0accSmrg		echo sparc-sun-sunos${UNAME_RELEASE}
382ff7e0accSmrg		;;
383ff7e0accSmrg	esac
384ff7e0accSmrg	exit ;;
385ff7e0accSmrg    aushp:SunOS:*:*)
386ff7e0accSmrg	echo sparc-auspex-sunos${UNAME_RELEASE}
387ff7e0accSmrg	exit ;;
388ff7e0accSmrg    # The situation for MiNT is a little confusing.  The machine name
389ff7e0accSmrg    # can be virtually everything (everything which is not
390ff7e0accSmrg    # "atarist" or "atariste" at least should have a processor
391ff7e0accSmrg    # > m68000).  The system name ranges from "MiNT" over "FreeMiNT"
392ff7e0accSmrg    # to the lowercase version "mint" (or "freemint").  Finally
393ff7e0accSmrg    # the system name "TOS" denotes a system which is actually not
394ff7e0accSmrg    # MiNT.  But MiNT is downward compatible to TOS, so this should
395ff7e0accSmrg    # be no problem.
396ff7e0accSmrg    atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
39705bee9bcSmrg	echo m68k-atari-mint${UNAME_RELEASE}
398ff7e0accSmrg	exit ;;
399ff7e0accSmrg    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
400ff7e0accSmrg	echo m68k-atari-mint${UNAME_RELEASE}
40105bee9bcSmrg	exit ;;
402ff7e0accSmrg    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
40305bee9bcSmrg	echo m68k-atari-mint${UNAME_RELEASE}
404ff7e0accSmrg	exit ;;
405ff7e0accSmrg    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
40605bee9bcSmrg	echo m68k-milan-mint${UNAME_RELEASE}
40705bee9bcSmrg	exit ;;
408ff7e0accSmrg    hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
40905bee9bcSmrg	echo m68k-hades-mint${UNAME_RELEASE}
41005bee9bcSmrg	exit ;;
411ff7e0accSmrg    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
41205bee9bcSmrg	echo m68k-unknown-mint${UNAME_RELEASE}
41305bee9bcSmrg	exit ;;
414ff7e0accSmrg    m68k:machten:*:*)
415ff7e0accSmrg	echo m68k-apple-machten${UNAME_RELEASE}
416ff7e0accSmrg	exit ;;
417ff7e0accSmrg    powerpc:machten:*:*)
418ff7e0accSmrg	echo powerpc-apple-machten${UNAME_RELEASE}
419ff7e0accSmrg	exit ;;
420ff7e0accSmrg    RISC*:Mach:*:*)
421ff7e0accSmrg	echo mips-dec-mach_bsd4.3
422ff7e0accSmrg	exit ;;
423ff7e0accSmrg    RISC*:ULTRIX:*:*)
424ff7e0accSmrg	echo mips-dec-ultrix${UNAME_RELEASE}
425ff7e0accSmrg	exit ;;
426ff7e0accSmrg    VAX*:ULTRIX*:*:*)
427ff7e0accSmrg	echo vax-dec-ultrix${UNAME_RELEASE}
428ff7e0accSmrg	exit ;;
429ff7e0accSmrg    2020:CLIX:*:* | 2430:CLIX:*:*)
430ff7e0accSmrg	echo clipper-intergraph-clix${UNAME_RELEASE}
431ff7e0accSmrg	exit ;;
432ff7e0accSmrg    mips:*:*:UMIPS | mips:*:*:RISCos)
433ff7e0accSmrg	eval $set_cc_for_build
434ff7e0accSmrg	sed 's/^	//' << EOF >$dummy.c
435ff7e0accSmrg#ifdef __cplusplus
436ff7e0accSmrg#include <stdio.h>  /* for printf() prototype */
437ff7e0accSmrg	int main (int argc, char *argv[]) {
438ff7e0accSmrg#else
439ff7e0accSmrg	int main (argc, argv) int argc; char *argv[]; {
440ff7e0accSmrg#endif
441ff7e0accSmrg	#if defined (host_mips) && defined (MIPSEB)
442ff7e0accSmrg	#if defined (SYSTYPE_SYSV)
443ff7e0accSmrg	  printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
444ff7e0accSmrg	#endif
445ff7e0accSmrg	#if defined (SYSTYPE_SVR4)
446ff7e0accSmrg	  printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
447ff7e0accSmrg	#endif
448ff7e0accSmrg	#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
449ff7e0accSmrg	  printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
450ff7e0accSmrg	#endif
451ff7e0accSmrg	#endif
452ff7e0accSmrg	  exit (-1);
453ff7e0accSmrg	}
454ff7e0accSmrgEOF
455ff7e0accSmrg	$CC_FOR_BUILD -o $dummy $dummy.c &&
456ff7e0accSmrg	  dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
457ff7e0accSmrg	  SYSTEM_NAME=`$dummy $dummyarg` &&
458ff7e0accSmrg	    { echo "$SYSTEM_NAME"; exit; }
459ff7e0accSmrg	echo mips-mips-riscos${UNAME_RELEASE}
460ff7e0accSmrg	exit ;;
461ff7e0accSmrg    Motorola:PowerMAX_OS:*:*)
462ff7e0accSmrg	echo powerpc-motorola-powermax
463ff7e0accSmrg	exit ;;
464ff7e0accSmrg    Motorola:*:4.3:PL8-*)
465ff7e0accSmrg	echo powerpc-harris-powermax
466ff7e0accSmrg	exit ;;
467ff7e0accSmrg    Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
468ff7e0accSmrg	echo powerpc-harris-powermax
469ff7e0accSmrg	exit ;;
470ff7e0accSmrg    Night_Hawk:Power_UNIX:*:*)
471ff7e0accSmrg	echo powerpc-harris-powerunix
472ff7e0accSmrg	exit ;;
473ff7e0accSmrg    m88k:CX/UX:7*:*)
474ff7e0accSmrg	echo m88k-harris-cxux7
475ff7e0accSmrg	exit ;;
476ff7e0accSmrg    m88k:*:4*:R4*)
477ff7e0accSmrg	echo m88k-motorola-sysv4
478ff7e0accSmrg	exit ;;
479ff7e0accSmrg    m88k:*:3*:R3*)
480ff7e0accSmrg	echo m88k-motorola-sysv3
481ff7e0accSmrg	exit ;;
482ff7e0accSmrg    AViiON:dgux:*:*)
48305bee9bcSmrg	# DG/UX returns AViiON for all architectures
48405bee9bcSmrg	UNAME_PROCESSOR=`/usr/bin/uname -p`
485ff7e0accSmrg	if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
486ff7e0accSmrg	then
487ff7e0accSmrg	    if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
488ff7e0accSmrg	       [ ${TARGET_BINARY_INTERFACE}x = x ]
489ff7e0accSmrg	    then
490ff7e0accSmrg		echo m88k-dg-dgux${UNAME_RELEASE}
491ff7e0accSmrg	    else
492ff7e0accSmrg		echo m88k-dg-dguxbcs${UNAME_RELEASE}
493ff7e0accSmrg	    fi
494ff7e0accSmrg	else
495ff7e0accSmrg	    echo i586-dg-dgux${UNAME_RELEASE}
496ff7e0accSmrg	fi
49705bee9bcSmrg	exit ;;
498ff7e0accSmrg    M88*:DolphinOS:*:*)	# DolphinOS (SVR3)
499ff7e0accSmrg	echo m88k-dolphin-sysv3
500ff7e0accSmrg	exit ;;
501ff7e0accSmrg    M88*:*:R3*:*)
502ff7e0accSmrg	# Delta 88k system running SVR3
503ff7e0accSmrg	echo m88k-motorola-sysv3
504ff7e0accSmrg	exit ;;
505ff7e0accSmrg    XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
506ff7e0accSmrg	echo m88k-tektronix-sysv3
507ff7e0accSmrg	exit ;;
508ff7e0accSmrg    Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
509ff7e0accSmrg	echo m68k-tektronix-bsd
510ff7e0accSmrg	exit ;;
511ff7e0accSmrg    *:IRIX*:*:*)
512ff7e0accSmrg	echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
513ff7e0accSmrg	exit ;;
514ff7e0accSmrg    ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
515ff7e0accSmrg	echo romp-ibm-aix     # uname -m gives an 8 hex-code CPU id
516ff7e0accSmrg	exit ;;               # Note that: echo "'`uname -s`'" gives 'AIX '
517ff7e0accSmrg    i*86:AIX:*:*)
518ff7e0accSmrg	echo i386-ibm-aix
519ff7e0accSmrg	exit ;;
520ff7e0accSmrg    ia64:AIX:*:*)
521ff7e0accSmrg	if [ -x /usr/bin/oslevel ] ; then
522ff7e0accSmrg		IBM_REV=`/usr/bin/oslevel`
523ff7e0accSmrg	else
524ff7e0accSmrg		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
525ff7e0accSmrg	fi
526ff7e0accSmrg	echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
527ff7e0accSmrg	exit ;;
528ff7e0accSmrg    *:AIX:2:3)
529ff7e0accSmrg	if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
530ff7e0accSmrg		eval $set_cc_for_build
531ff7e0accSmrg		sed 's/^		//' << EOF >$dummy.c
532ff7e0accSmrg		#include <sys/systemcfg.h>
533ff7e0accSmrg
534ff7e0accSmrg		main()
535ff7e0accSmrg			{
536ff7e0accSmrg			if (!__power_pc())
537ff7e0accSmrg				exit(1);
538ff7e0accSmrg			puts("powerpc-ibm-aix3.2.5");
539ff7e0accSmrg			exit(0);
540ff7e0accSmrg			}
541ff7e0accSmrgEOF
542ff7e0accSmrg		if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
543ff7e0accSmrg		then
544ff7e0accSmrg			echo "$SYSTEM_NAME"
545ff7e0accSmrg		else
546ff7e0accSmrg			echo rs6000-ibm-aix3.2.5
547ff7e0accSmrg		fi
548ff7e0accSmrg	elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
549ff7e0accSmrg		echo rs6000-ibm-aix3.2.4
550ff7e0accSmrg	else
551ff7e0accSmrg		echo rs6000-ibm-aix3.2
552ff7e0accSmrg	fi
553ff7e0accSmrg	exit ;;
554863f95b1Smrg    *:AIX:*:[4567])
555ff7e0accSmrg	IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
556ff7e0accSmrg	if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
557ff7e0accSmrg		IBM_ARCH=rs6000
558ff7e0accSmrg	else
559ff7e0accSmrg		IBM_ARCH=powerpc
560ff7e0accSmrg	fi
561ff7e0accSmrg	if [ -x /usr/bin/oslevel ] ; then
562ff7e0accSmrg		IBM_REV=`/usr/bin/oslevel`
563ff7e0accSmrg	else
564ff7e0accSmrg		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
565ff7e0accSmrg	fi
566ff7e0accSmrg	echo ${IBM_ARCH}-ibm-aix${IBM_REV}
567ff7e0accSmrg	exit ;;
568ff7e0accSmrg    *:AIX:*:*)
569ff7e0accSmrg	echo rs6000-ibm-aix
570ff7e0accSmrg	exit ;;
571ff7e0accSmrg    ibmrt:4.4BSD:*|romp-ibm:BSD:*)
572ff7e0accSmrg	echo romp-ibm-bsd4.4
573ff7e0accSmrg	exit ;;
574ff7e0accSmrg    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
575ff7e0accSmrg	echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
576ff7e0accSmrg	exit ;;                             # report: romp-ibm BSD 4.3
577ff7e0accSmrg    *:BOSX:*:*)
578ff7e0accSmrg	echo rs6000-bull-bosx
579ff7e0accSmrg	exit ;;
580ff7e0accSmrg    DPX/2?00:B.O.S.:*:*)
581ff7e0accSmrg	echo m68k-bull-sysv3
582ff7e0accSmrg	exit ;;
583ff7e0accSmrg    9000/[34]??:4.3bsd:1.*:*)
584ff7e0accSmrg	echo m68k-hp-bsd
585ff7e0accSmrg	exit ;;
586ff7e0accSmrg    hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
587ff7e0accSmrg	echo m68k-hp-bsd4.4
588ff7e0accSmrg	exit ;;
589ff7e0accSmrg    9000/[34678]??:HP-UX:*:*)
590ff7e0accSmrg	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
591ff7e0accSmrg	case "${UNAME_MACHINE}" in
592ff7e0accSmrg	    9000/31? )            HP_ARCH=m68000 ;;
593ff7e0accSmrg	    9000/[34]?? )         HP_ARCH=m68k ;;
594ff7e0accSmrg	    9000/[678][0-9][0-9])
595ff7e0accSmrg		if [ -x /usr/bin/getconf ]; then
596ff7e0accSmrg		    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
59705bee9bcSmrg		    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
59805bee9bcSmrg		    case "${sc_cpu_version}" in
59905bee9bcSmrg		      523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
60005bee9bcSmrg		      528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
60105bee9bcSmrg		      532)                      # CPU_PA_RISC2_0
60205bee9bcSmrg			case "${sc_kernel_bits}" in
60305bee9bcSmrg			  32) HP_ARCH="hppa2.0n" ;;
60405bee9bcSmrg			  64) HP_ARCH="hppa2.0w" ;;
605ff7e0accSmrg			  '') HP_ARCH="hppa2.0" ;;   # HP-UX 10.20
60605bee9bcSmrg			esac ;;
60705bee9bcSmrg		    esac
608ff7e0accSmrg		fi
609ff7e0accSmrg		if [ "${HP_ARCH}" = "" ]; then
610ff7e0accSmrg		    eval $set_cc_for_build
61105bee9bcSmrg		    sed 's/^		//' << EOF >$dummy.c
612ff7e0accSmrg
61305bee9bcSmrg		#define _HPUX_SOURCE
61405bee9bcSmrg		#include <stdlib.h>
61505bee9bcSmrg		#include <unistd.h>
616ff7e0accSmrg
61705bee9bcSmrg		int main ()
61805bee9bcSmrg		{
61905bee9bcSmrg		#if defined(_SC_KERNEL_BITS)
62005bee9bcSmrg		    long bits = sysconf(_SC_KERNEL_BITS);
62105bee9bcSmrg		#endif
62205bee9bcSmrg		    long cpu  = sysconf (_SC_CPU_VERSION);
623ff7e0accSmrg
62405bee9bcSmrg		    switch (cpu)
62505bee9bcSmrg			{
62605bee9bcSmrg			case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
62705bee9bcSmrg			case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
62805bee9bcSmrg			case CPU_PA_RISC2_0:
62905bee9bcSmrg		#if defined(_SC_KERNEL_BITS)
63005bee9bcSmrg			    switch (bits)
63105bee9bcSmrg				{
63205bee9bcSmrg				case 64: puts ("hppa2.0w"); break;
63305bee9bcSmrg				case 32: puts ("hppa2.0n"); break;
63405bee9bcSmrg				default: puts ("hppa2.0"); break;
63505bee9bcSmrg				} break;
63605bee9bcSmrg		#else  /* !defined(_SC_KERNEL_BITS) */
63705bee9bcSmrg			    puts ("hppa2.0"); break;
63805bee9bcSmrg		#endif
63905bee9bcSmrg			default: puts ("hppa1.0"); break;
64005bee9bcSmrg			}
64105bee9bcSmrg		    exit (0);
64205bee9bcSmrg		}
643ff7e0accSmrgEOF
644ff7e0accSmrg		    (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
645ff7e0accSmrg		    test -z "$HP_ARCH" && HP_ARCH=hppa
646ff7e0accSmrg		fi ;;
647ff7e0accSmrg	esac
648ff7e0accSmrg	if [ ${HP_ARCH} = "hppa2.0w" ]
649ff7e0accSmrg	then
650ff7e0accSmrg	    eval $set_cc_for_build
651ff7e0accSmrg
652ff7e0accSmrg	    # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
653ff7e0accSmrg	    # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler
654ff7e0accSmrg	    # generating 64-bit code.  GNU and HP use different nomenclature:
655ff7e0accSmrg	    #
656ff7e0accSmrg	    # $ CC_FOR_BUILD=cc ./config.guess
657ff7e0accSmrg	    # => hppa2.0w-hp-hpux11.23
658ff7e0accSmrg	    # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
659ff7e0accSmrg	    # => hppa64-hp-hpux11.23
660ff7e0accSmrg
661ff7e0accSmrg	    if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
662863f95b1Smrg		grep -q __LP64__
663ff7e0accSmrg	    then
664ff7e0accSmrg		HP_ARCH="hppa2.0w"
665ff7e0accSmrg	    else
666ff7e0accSmrg		HP_ARCH="hppa64"
667ff7e0accSmrg	    fi
668ff7e0accSmrg	fi
669ff7e0accSmrg	echo ${HP_ARCH}-hp-hpux${HPUX_REV}
670ff7e0accSmrg	exit ;;
671ff7e0accSmrg    ia64:HP-UX:*:*)
672ff7e0accSmrg	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
673ff7e0accSmrg	echo ia64-hp-hpux${HPUX_REV}
674ff7e0accSmrg	exit ;;
675ff7e0accSmrg    3050*:HI-UX:*:*)
676ff7e0accSmrg	eval $set_cc_for_build
677ff7e0accSmrg	sed 's/^	//' << EOF >$dummy.c
678ff7e0accSmrg	#include <unistd.h>
679ff7e0accSmrg	int
680ff7e0accSmrg	main ()
681ff7e0accSmrg	{
682ff7e0accSmrg	  long cpu = sysconf (_SC_CPU_VERSION);
683ff7e0accSmrg	  /* The order matters, because CPU_IS_HP_MC68K erroneously returns
684ff7e0accSmrg	     true for CPU_PA_RISC1_0.  CPU_IS_PA_RISC returns correct
685ff7e0accSmrg	     results, however.  */
686ff7e0accSmrg	  if (CPU_IS_PA_RISC (cpu))
687ff7e0accSmrg	    {
688ff7e0accSmrg	      switch (cpu)
689ff7e0accSmrg		{
690ff7e0accSmrg		  case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
691ff7e0accSmrg		  case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
692ff7e0accSmrg		  case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
693ff7e0accSmrg		  default: puts ("hppa-hitachi-hiuxwe2"); break;
694ff7e0accSmrg		}
695ff7e0accSmrg	    }
696ff7e0accSmrg	  else if (CPU_IS_HP_MC68K (cpu))
697ff7e0accSmrg	    puts ("m68k-hitachi-hiuxwe2");
698ff7e0accSmrg	  else puts ("unknown-hitachi-hiuxwe2");
699ff7e0accSmrg	  exit (0);
700ff7e0accSmrg	}
701ff7e0accSmrgEOF
702ff7e0accSmrg	$CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
703ff7e0accSmrg		{ echo "$SYSTEM_NAME"; exit; }
704ff7e0accSmrg	echo unknown-hitachi-hiuxwe2
705ff7e0accSmrg	exit ;;
706ff7e0accSmrg    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
707ff7e0accSmrg	echo hppa1.1-hp-bsd
708ff7e0accSmrg	exit ;;
709ff7e0accSmrg    9000/8??:4.3bsd:*:*)
710ff7e0accSmrg	echo hppa1.0-hp-bsd
711ff7e0accSmrg	exit ;;
712ff7e0accSmrg    *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
713ff7e0accSmrg	echo hppa1.0-hp-mpeix
714ff7e0accSmrg	exit ;;
715ff7e0accSmrg    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
716ff7e0accSmrg	echo hppa1.1-hp-osf
717ff7e0accSmrg	exit ;;
718ff7e0accSmrg    hp8??:OSF1:*:*)
719ff7e0accSmrg	echo hppa1.0-hp-osf
720ff7e0accSmrg	exit ;;
721ff7e0accSmrg    i*86:OSF1:*:*)
722ff7e0accSmrg	if [ -x /usr/sbin/sysversion ] ; then
723ff7e0accSmrg	    echo ${UNAME_MACHINE}-unknown-osf1mk
724ff7e0accSmrg	else
725ff7e0accSmrg	    echo ${UNAME_MACHINE}-unknown-osf1
726ff7e0accSmrg	fi
727ff7e0accSmrg	exit ;;
728ff7e0accSmrg    parisc*:Lites*:*:*)
729ff7e0accSmrg	echo hppa1.1-hp-lites
730ff7e0accSmrg	exit ;;
731ff7e0accSmrg    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
732ff7e0accSmrg	echo c1-convex-bsd
73305bee9bcSmrg	exit ;;
734ff7e0accSmrg    C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
735ff7e0accSmrg	if getsysinfo -f scalar_acc
736ff7e0accSmrg	then echo c32-convex-bsd
737ff7e0accSmrg	else echo c2-convex-bsd
738ff7e0accSmrg	fi
73905bee9bcSmrg	exit ;;
740ff7e0accSmrg    C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
741ff7e0accSmrg	echo c34-convex-bsd
74205bee9bcSmrg	exit ;;
743ff7e0accSmrg    C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
744ff7e0accSmrg	echo c38-convex-bsd
74505bee9bcSmrg	exit ;;
746ff7e0accSmrg    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
747ff7e0accSmrg	echo c4-convex-bsd
74805bee9bcSmrg	exit ;;
749ff7e0accSmrg    CRAY*Y-MP:*:*:*)
750ff7e0accSmrg	echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
751ff7e0accSmrg	exit ;;
752ff7e0accSmrg    CRAY*[A-Z]90:*:*:*)
753ff7e0accSmrg	echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
754ff7e0accSmrg	| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
755ff7e0accSmrg	      -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
756ff7e0accSmrg	      -e 's/\.[^.]*$/.X/'
757ff7e0accSmrg	exit ;;
758ff7e0accSmrg    CRAY*TS:*:*:*)
759ff7e0accSmrg	echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
760ff7e0accSmrg	exit ;;
761ff7e0accSmrg    CRAY*T3E:*:*:*)
762ff7e0accSmrg	echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
763ff7e0accSmrg	exit ;;
764ff7e0accSmrg    CRAY*SV1:*:*:*)
765ff7e0accSmrg	echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
766ff7e0accSmrg	exit ;;
767ff7e0accSmrg    *:UNICOS/mp:*:*)
768ff7e0accSmrg	echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
769ff7e0accSmrg	exit ;;
770ff7e0accSmrg    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
771ff7e0accSmrg	FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
77205bee9bcSmrg	FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
77305bee9bcSmrg	FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
77405bee9bcSmrg	echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
77505bee9bcSmrg	exit ;;
776ff7e0accSmrg    5000:UNIX_System_V:4.*:*)
77705bee9bcSmrg	FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
77805bee9bcSmrg	FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
77905bee9bcSmrg	echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
780ff7e0accSmrg	exit ;;
781ff7e0accSmrg    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
782ff7e0accSmrg	echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
783ff7e0accSmrg	exit ;;
784ff7e0accSmrg    sparc*:BSD/OS:*:*)
785ff7e0accSmrg	echo sparc-unknown-bsdi${UNAME_RELEASE}
786ff7e0accSmrg	exit ;;
787ff7e0accSmrg    *:BSD/OS:*:*)
788ff7e0accSmrg	echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
789ff7e0accSmrg	exit ;;
790ff7e0accSmrg    *:FreeBSD:*:*)
79105bee9bcSmrg	UNAME_PROCESSOR=`/usr/bin/uname -p`
79205bee9bcSmrg	case ${UNAME_PROCESSOR} in
793ff7e0accSmrg	    amd64)
794ff7e0accSmrg		echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
795ff7e0accSmrg	    *)
79605bee9bcSmrg		echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
797ff7e0accSmrg	esac
798ff7e0accSmrg	exit ;;
799ff7e0accSmrg    i*:CYGWIN*:*)
800ff7e0accSmrg	echo ${UNAME_MACHINE}-pc-cygwin
801ff7e0accSmrg	exit ;;
80205bee9bcSmrg    *:MINGW64*:*)
80305bee9bcSmrg	echo ${UNAME_MACHINE}-pc-mingw64
80405bee9bcSmrg	exit ;;
805ff7e0accSmrg    *:MINGW*:*)
806ff7e0accSmrg	echo ${UNAME_MACHINE}-pc-mingw32
807ff7e0accSmrg	exit ;;
80805bee9bcSmrg    i*:MSYS*:*)
80905bee9bcSmrg	echo ${UNAME_MACHINE}-pc-msys
81005bee9bcSmrg	exit ;;
811ff7e0accSmrg    i*:windows32*:*)
81205bee9bcSmrg	# uname -m includes "-pc" on this system.
81305bee9bcSmrg	echo ${UNAME_MACHINE}-mingw32
814ff7e0accSmrg	exit ;;
815ff7e0accSmrg    i*:PW*:*)
816ff7e0accSmrg	echo ${UNAME_MACHINE}-pc-pw32
817ff7e0accSmrg	exit ;;
818863f95b1Smrg    *:Interix*:*)
81905bee9bcSmrg	case ${UNAME_MACHINE} in
820ff7e0accSmrg	    x86)
821ff7e0accSmrg		echo i586-pc-interix${UNAME_RELEASE}
822ff7e0accSmrg		exit ;;
823863f95b1Smrg	    authenticamd | genuineintel | EM64T)
824ff7e0accSmrg		echo x86_64-unknown-interix${UNAME_RELEASE}
825ff7e0accSmrg		exit ;;
826a005d216Smrg	    IA64)
827a005d216Smrg		echo ia64-unknown-interix${UNAME_RELEASE}
828a005d216Smrg		exit ;;
829ff7e0accSmrg	esac ;;
830ff7e0accSmrg    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
831ff7e0accSmrg	echo i${UNAME_MACHINE}-pc-mks
832ff7e0accSmrg	exit ;;
833863f95b1Smrg    8664:Windows_NT:*)
834863f95b1Smrg	echo x86_64-pc-mks
835863f95b1Smrg	exit ;;
836ff7e0accSmrg    i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
837ff7e0accSmrg	# How do we know it's Interix rather than the generic POSIX subsystem?
838ff7e0accSmrg	# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
839ff7e0accSmrg	# UNAME_MACHINE based on the output of uname instead of i386?
840ff7e0accSmrg	echo i586-pc-interix
841ff7e0accSmrg	exit ;;
842ff7e0accSmrg    i*:UWIN*:*)
843ff7e0accSmrg	echo ${UNAME_MACHINE}-pc-uwin
844ff7e0accSmrg	exit ;;
845ff7e0accSmrg    amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
846ff7e0accSmrg	echo x86_64-unknown-cygwin
847ff7e0accSmrg	exit ;;
848ff7e0accSmrg    p*:CYGWIN*:*)
849ff7e0accSmrg	echo powerpcle-unknown-cygwin
850ff7e0accSmrg	exit ;;
851ff7e0accSmrg    prep*:SunOS:5.*:*)
852ff7e0accSmrg	echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
853ff7e0accSmrg	exit ;;
854ff7e0accSmrg    *:GNU:*:*)
855ff7e0accSmrg	# the GNU system
856ff7e0accSmrg	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
857ff7e0accSmrg	exit ;;
858ff7e0accSmrg    *:GNU/*:*:*)
859ff7e0accSmrg	# other systems with GNU libc and userland
860ff7e0accSmrg	echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
861ff7e0accSmrg	exit ;;
862ff7e0accSmrg    i*86:Minix:*:*)
863ff7e0accSmrg	echo ${UNAME_MACHINE}-pc-minix
864ff7e0accSmrg	exit ;;
86505bee9bcSmrg    aarch64:Linux:*:*)
86605bee9bcSmrg	echo ${UNAME_MACHINE}-unknown-linux-gnu
86705bee9bcSmrg	exit ;;
86805bee9bcSmrg    aarch64_be:Linux:*:*)
86905bee9bcSmrg	UNAME_MACHINE=aarch64_be
87005bee9bcSmrg	echo ${UNAME_MACHINE}-unknown-linux-gnu
87105bee9bcSmrg	exit ;;
872863f95b1Smrg    alpha:Linux:*:*)
873863f95b1Smrg	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
874863f95b1Smrg	  EV5)   UNAME_MACHINE=alphaev5 ;;
875863f95b1Smrg	  EV56)  UNAME_MACHINE=alphaev56 ;;
876863f95b1Smrg	  PCA56) UNAME_MACHINE=alphapca56 ;;
877863f95b1Smrg	  PCA57) UNAME_MACHINE=alphapca56 ;;
878863f95b1Smrg	  EV6)   UNAME_MACHINE=alphaev6 ;;
879863f95b1Smrg	  EV67)  UNAME_MACHINE=alphaev67 ;;
880863f95b1Smrg	  EV68*) UNAME_MACHINE=alphaev68 ;;
88105bee9bcSmrg	esac
882863f95b1Smrg	objdump --private-headers /bin/sh | grep -q ld.so.1
883863f95b1Smrg	if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
884863f95b1Smrg	echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
885863f95b1Smrg	exit ;;
88605bee9bcSmrg    arc:Linux:*:* | arceb:Linux:*:*)
88705bee9bcSmrg	echo ${UNAME_MACHINE}-unknown-linux-gnu
88805bee9bcSmrg	exit ;;
889ff7e0accSmrg    arm*:Linux:*:*)
890a005d216Smrg	eval $set_cc_for_build
891a005d216Smrg	if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
892a005d216Smrg	    | grep -q __ARM_EABI__
893a005d216Smrg	then
89410998002Smrg	    echo ${UNAME_MACHINE}-unknown-linux-gnu
895a005d216Smrg	else
89605bee9bcSmrg	    if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
89705bee9bcSmrg		| grep -q __ARM_PCS_VFP
89805bee9bcSmrg	    then
89905bee9bcSmrg		echo ${UNAME_MACHINE}-unknown-linux-gnueabi
90005bee9bcSmrg	    else
90105bee9bcSmrg		echo ${UNAME_MACHINE}-unknown-linux-gnueabihf
90205bee9bcSmrg	    fi
903a005d216Smrg	fi
904ff7e0accSmrg	exit ;;
905ff7e0accSmrg    avr32*:Linux:*:*)
90610998002Smrg	echo ${UNAME_MACHINE}-unknown-linux-gnu
907ff7e0accSmrg	exit ;;
908ff7e0accSmrg    cris:Linux:*:*)
90905bee9bcSmrg	echo ${UNAME_MACHINE}-axis-linux-gnu
910ff7e0accSmrg	exit ;;
911ff7e0accSmrg    crisv32:Linux:*:*)
91205bee9bcSmrg	echo ${UNAME_MACHINE}-axis-linux-gnu
913ff7e0accSmrg	exit ;;
914ff7e0accSmrg    frv:Linux:*:*)
91505bee9bcSmrg	echo ${UNAME_MACHINE}-unknown-linux-gnu
91605bee9bcSmrg	exit ;;
91705bee9bcSmrg    hexagon:Linux:*:*)
91805bee9bcSmrg	echo ${UNAME_MACHINE}-unknown-linux-gnu
919ff7e0accSmrg	exit ;;
920863f95b1Smrg    i*86:Linux:*:*)
921863f95b1Smrg	LIBC=gnu
922863f95b1Smrg	eval $set_cc_for_build
923863f95b1Smrg	sed 's/^	//' << EOF >$dummy.c
924863f95b1Smrg	#ifdef __dietlibc__
925863f95b1Smrg	LIBC=dietlibc
926863f95b1Smrg	#endif
92705bee9bcSmrg	#else
92805bee9bcSmrg	#include <features.h>
92905bee9bcSmrg	#ifdef __UCLIBC__
93005bee9bcSmrg	LIBC=uclibc
93105bee9bcSmrg	#endif
932863f95b1SmrgEOF
933863f95b1Smrg	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
934863f95b1Smrg	echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
935863f95b1Smrg	exit ;;
936ff7e0accSmrg    ia64:Linux:*:*)
93710998002Smrg	echo ${UNAME_MACHINE}-unknown-linux-gnu
938ff7e0accSmrg	exit ;;
939ff7e0accSmrg    m32r*:Linux:*:*)
94010998002Smrg	echo ${UNAME_MACHINE}-unknown-linux-gnu
941ff7e0accSmrg	exit ;;
942ff7e0accSmrg    m68*:Linux:*:*)
94310998002Smrg	echo ${UNAME_MACHINE}-unknown-linux-gnu
944ff7e0accSmrg	exit ;;
945863f95b1Smrg    mips:Linux:*:* | mips64:Linux:*:*)
946ff7e0accSmrg	eval $set_cc_for_build
947ff7e0accSmrg	sed 's/^	//' << EOF >$dummy.c
948ff7e0accSmrg	#undef CPU
949863f95b1Smrg	#undef ${UNAME_MACHINE}
950863f95b1Smrg	#undef ${UNAME_MACHINE}el
951ff7e0accSmrg	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
952863f95b1Smrg	CPU=${UNAME_MACHINE}el
953ff7e0accSmrg	#else
954ff7e0accSmrg	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
955863f95b1Smrg	CPU=${UNAME_MACHINE}
956ff7e0accSmrg	#else
957ff7e0accSmrg	CPU=
958ff7e0accSmrg	#endif
959ff7e0accSmrg	#endif
960ff7e0accSmrgEOF
961863f95b1Smrg	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
96210998002Smrg	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
963ff7e0accSmrg	;;
96405bee9bcSmrg    or1k:Linux:*:*)
96505bee9bcSmrg	echo ${UNAME_MACHINE}-unknown-linux-gnu
96605bee9bcSmrg	exit ;;
967ff7e0accSmrg    or32:Linux:*:*)
96805bee9bcSmrg	echo ${UNAME_MACHINE}-unknown-linux-gnu
969ff7e0accSmrg	exit ;;
97010998002Smrg    padre:Linux:*:*)
97110998002Smrg	echo sparc-unknown-linux-gnu
972ff7e0accSmrg	exit ;;
973863f95b1Smrg    parisc64:Linux:*:* | hppa64:Linux:*:*)
974863f95b1Smrg	echo hppa64-unknown-linux-gnu
975863f95b1Smrg	exit ;;
976ff7e0accSmrg    parisc:Linux:*:* | hppa:Linux:*:*)
977ff7e0accSmrg	# Look for CPU level
978ff7e0accSmrg	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
97910998002Smrg	  PA7*) echo hppa1.1-unknown-linux-gnu ;;
98010998002Smrg	  PA8*) echo hppa2.0-unknown-linux-gnu ;;
98110998002Smrg	  *)    echo hppa-unknown-linux-gnu ;;
982ff7e0accSmrg	esac
983ff7e0accSmrg	exit ;;
984863f95b1Smrg    ppc64:Linux:*:*)
985863f95b1Smrg	echo powerpc64-unknown-linux-gnu
986863f95b1Smrg	exit ;;
987863f95b1Smrg    ppc:Linux:*:*)
988863f95b1Smrg	echo powerpc-unknown-linux-gnu
989ff7e0accSmrg	exit ;;
990ff7e0accSmrg    s390:Linux:*:* | s390x:Linux:*:*)
991ff7e0accSmrg	echo ${UNAME_MACHINE}-ibm-linux
992ff7e0accSmrg	exit ;;
993ff7e0accSmrg    sh64*:Linux:*:*)
99405bee9bcSmrg	echo ${UNAME_MACHINE}-unknown-linux-gnu
995ff7e0accSmrg	exit ;;
996ff7e0accSmrg    sh*:Linux:*:*)
99710998002Smrg	echo ${UNAME_MACHINE}-unknown-linux-gnu
998ff7e0accSmrg	exit ;;
999ff7e0accSmrg    sparc:Linux:*:* | sparc64:Linux:*:*)
100010998002Smrg	echo ${UNAME_MACHINE}-unknown-linux-gnu
1001ff7e0accSmrg	exit ;;
1002863f95b1Smrg    tile*:Linux:*:*)
100305bee9bcSmrg	echo ${UNAME_MACHINE}-unknown-linux-gnu
1004863f95b1Smrg	exit ;;
1005ff7e0accSmrg    vax:Linux:*:*)
100610998002Smrg	echo ${UNAME_MACHINE}-dec-linux-gnu
1007ff7e0accSmrg	exit ;;
1008ff7e0accSmrg    x86_64:Linux:*:*)
100905bee9bcSmrg	LIBC=gnu
101005bee9bcSmrg	test -r /lib/libc.so && od -An -S13 /lib/libc.so | grep -q __uClibc_main && LIBC=uclibc
101105bee9bcSmrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
1012ff7e0accSmrg	exit ;;
1013a005d216Smrg    xtensa*:Linux:*:*)
101405bee9bcSmrg	echo ${UNAME_MACHINE}-unknown-linux-gnu
1015ff7e0accSmrg	exit ;;
1016ff7e0accSmrg    i*86:DYNIX/ptx:4*:*)
1017ff7e0accSmrg	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
1018ff7e0accSmrg	# earlier versions are messed up and put the nodename in both
1019ff7e0accSmrg	# sysname and nodename.
1020ff7e0accSmrg	echo i386-sequent-sysv4
1021ff7e0accSmrg	exit ;;
1022ff7e0accSmrg    i*86:UNIX_SV:4.2MP:2.*)
102305bee9bcSmrg	# Unixware is an offshoot of SVR4, but it has its own version
102405bee9bcSmrg	# number series starting with 2...
102505bee9bcSmrg	# I am not positive that other SVR4 systems won't match this,
1026ff7e0accSmrg	# I just have to hope.  -- rms.
102705bee9bcSmrg	# Use sysv4.2uw... so that sysv4* matches it.
1028ff7e0accSmrg	echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
1029ff7e0accSmrg	exit ;;
1030ff7e0accSmrg    i*86:OS/2:*:*)
1031ff7e0accSmrg	# If we were able to find `uname', then EMX Unix compatibility
1032ff7e0accSmrg	# is probably installed.
1033ff7e0accSmrg	echo ${UNAME_MACHINE}-pc-os2-emx
1034ff7e0accSmrg	exit ;;
1035ff7e0accSmrg    i*86:XTS-300:*:STOP)
1036ff7e0accSmrg	echo ${UNAME_MACHINE}-unknown-stop
1037ff7e0accSmrg	exit ;;
1038ff7e0accSmrg    i*86:atheos:*:*)
1039ff7e0accSmrg	echo ${UNAME_MACHINE}-unknown-atheos
1040ff7e0accSmrg	exit ;;
1041ff7e0accSmrg    i*86:syllable:*:*)
1042ff7e0accSmrg	echo ${UNAME_MACHINE}-pc-syllable
1043ff7e0accSmrg	exit ;;
1044863f95b1Smrg    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
1045ff7e0accSmrg	echo i386-unknown-lynxos${UNAME_RELEASE}
1046ff7e0accSmrg	exit ;;
1047ff7e0accSmrg    i*86:*DOS:*:*)
1048ff7e0accSmrg	echo ${UNAME_MACHINE}-pc-msdosdjgpp
1049ff7e0accSmrg	exit ;;
1050ff7e0accSmrg    i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
1051ff7e0accSmrg	UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
1052ff7e0accSmrg	if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
1053ff7e0accSmrg		echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
1054ff7e0accSmrg	else
1055ff7e0accSmrg		echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
1056ff7e0accSmrg	fi
1057ff7e0accSmrg	exit ;;
1058ff7e0accSmrg    i*86:*:5:[678]*)
105905bee9bcSmrg	# UnixWare 7.x, OpenUNIX and OpenServer 6.
1060ff7e0accSmrg	case `/bin/uname -X | grep "^Machine"` in
1061ff7e0accSmrg	    *486*)	     UNAME_MACHINE=i486 ;;
1062ff7e0accSmrg	    *Pentium)	     UNAME_MACHINE=i586 ;;
1063ff7e0accSmrg	    *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
1064ff7e0accSmrg	esac
1065ff7e0accSmrg	echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
1066ff7e0accSmrg	exit ;;
1067ff7e0accSmrg    i*86:*:3.2:*)
1068ff7e0accSmrg	if test -f /usr/options/cb.name; then
1069ff7e0accSmrg		UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
1070ff7e0accSmrg		echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
1071ff7e0accSmrg	elif /bin/uname -X 2>/dev/null >/dev/null ; then
1072ff7e0accSmrg		UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
1073ff7e0accSmrg		(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
1074ff7e0accSmrg		(/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
1075ff7e0accSmrg			&& UNAME_MACHINE=i586
1076ff7e0accSmrg		(/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
1077ff7e0accSmrg			&& UNAME_MACHINE=i686
1078ff7e0accSmrg		(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
1079ff7e0accSmrg			&& UNAME_MACHINE=i686
1080ff7e0accSmrg		echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
1081ff7e0accSmrg	else
1082ff7e0accSmrg		echo ${UNAME_MACHINE}-pc-sysv32
1083ff7e0accSmrg	fi
1084ff7e0accSmrg	exit ;;
1085ff7e0accSmrg    pc:*:*:*)
1086ff7e0accSmrg	# Left here for compatibility:
108705bee9bcSmrg	# uname -m prints for DJGPP always 'pc', but it prints nothing about
108805bee9bcSmrg	# the processor, so we play safe by assuming i586.
108910998002Smrg	# Note: whatever this is, it MUST be the same as what config.sub
109010998002Smrg	# prints for the "djgpp" host, or else GDB configury will decide that
109110998002Smrg	# this is a cross-build.
109210998002Smrg	echo i586-pc-msdosdjgpp
109305bee9bcSmrg	exit ;;
1094ff7e0accSmrg    Intel:Mach:3*:*)
1095ff7e0accSmrg	echo i386-pc-mach3
1096ff7e0accSmrg	exit ;;
1097ff7e0accSmrg    paragon:*:*:*)
1098ff7e0accSmrg	echo i860-intel-osf1
1099ff7e0accSmrg	exit ;;
1100ff7e0accSmrg    i860:*:4.*:*) # i860-SVR4
1101ff7e0accSmrg	if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
1102ff7e0accSmrg	  echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
1103ff7e0accSmrg	else # Add other i860-SVR4 vendors below as they are discovered.
1104ff7e0accSmrg	  echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
1105ff7e0accSmrg	fi
1106ff7e0accSmrg	exit ;;
1107ff7e0accSmrg    mini*:CTIX:SYS*5:*)
1108ff7e0accSmrg	# "miniframe"
1109ff7e0accSmrg	echo m68010-convergent-sysv
1110ff7e0accSmrg	exit ;;
1111ff7e0accSmrg    mc68k:UNIX:SYSTEM5:3.51m)
1112ff7e0accSmrg	echo m68k-convergent-sysv
1113ff7e0accSmrg	exit ;;
1114ff7e0accSmrg    M680?0:D-NIX:5.3:*)
1115ff7e0accSmrg	echo m68k-diab-dnix
1116ff7e0accSmrg	exit ;;
1117ff7e0accSmrg    M68*:*:R3V[5678]*:*)
1118ff7e0accSmrg	test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
1119ff7e0accSmrg    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)
1120ff7e0accSmrg	OS_REL=''
1121ff7e0accSmrg	test -r /etc/.relid \
1122ff7e0accSmrg	&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
1123ff7e0accSmrg	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1124ff7e0accSmrg	  && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
1125ff7e0accSmrg	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
1126ff7e0accSmrg	  && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
1127ff7e0accSmrg    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
112805bee9bcSmrg	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
112905bee9bcSmrg	  && { echo i486-ncr-sysv4; exit; } ;;
113010998002Smrg    NCR*:*:4.2:* | MPRAS*:*:4.2:*)
113110998002Smrg	OS_REL='.3'
113210998002Smrg	test -r /etc/.relid \
113310998002Smrg	    && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
113410998002Smrg	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
113510998002Smrg	    && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
113610998002Smrg	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
113710998002Smrg	    && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
113810998002Smrg	/bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
113910998002Smrg	    && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
1140ff7e0accSmrg    m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
1141ff7e0accSmrg	echo m68k-unknown-lynxos${UNAME_RELEASE}
1142ff7e0accSmrg	exit ;;
1143ff7e0accSmrg    mc68030:UNIX_System_V:4.*:*)
1144ff7e0accSmrg	echo m68k-atari-sysv4
1145ff7e0accSmrg	exit ;;
1146ff7e0accSmrg    TSUNAMI:LynxOS:2.*:*)
1147ff7e0accSmrg	echo sparc-unknown-lynxos${UNAME_RELEASE}
1148ff7e0accSmrg	exit ;;
1149ff7e0accSmrg    rs6000:LynxOS:2.*:*)
1150ff7e0accSmrg	echo rs6000-unknown-lynxos${UNAME_RELEASE}
1151ff7e0accSmrg	exit ;;
1152863f95b1Smrg    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
1153ff7e0accSmrg	echo powerpc-unknown-lynxos${UNAME_RELEASE}
1154ff7e0accSmrg	exit ;;
1155ff7e0accSmrg    SM[BE]S:UNIX_SV:*:*)
1156ff7e0accSmrg	echo mips-dde-sysv${UNAME_RELEASE}
1157ff7e0accSmrg	exit ;;
1158ff7e0accSmrg    RM*:ReliantUNIX-*:*:*)
1159ff7e0accSmrg	echo mips-sni-sysv4
1160ff7e0accSmrg	exit ;;
1161ff7e0accSmrg    RM*:SINIX-*:*:*)
1162ff7e0accSmrg	echo mips-sni-sysv4
1163ff7e0accSmrg	exit ;;
1164ff7e0accSmrg    *:SINIX-*:*:*)
1165ff7e0accSmrg	if uname -p 2>/dev/null >/dev/null ; then
1166ff7e0accSmrg		UNAME_MACHINE=`(uname -p) 2>/dev/null`
1167ff7e0accSmrg		echo ${UNAME_MACHINE}-sni-sysv4
1168ff7e0accSmrg	else
1169ff7e0accSmrg		echo ns32k-sni-sysv
1170ff7e0accSmrg	fi
1171ff7e0accSmrg	exit ;;
117205bee9bcSmrg    PENTIUM:*:4.0*:*)	# Unisys `ClearPath HMP IX 4000' SVR4/MP effort
117305bee9bcSmrg			# says <Richard.M.Bartel@ccMail.Census.GOV>
117405bee9bcSmrg	echo i586-unisys-sysv4
117505bee9bcSmrg	exit ;;
1176ff7e0accSmrg    *:UNIX_System_V:4*:FTX*)
1177ff7e0accSmrg	# From Gerald Hewes <hewes@openmarket.com>.
1178ff7e0accSmrg	# How about differentiating between stratus architectures? -djm
1179ff7e0accSmrg	echo hppa1.1-stratus-sysv4
1180ff7e0accSmrg	exit ;;
1181ff7e0accSmrg    *:*:*:FTX*)
1182ff7e0accSmrg	# From seanf@swdc.stratus.com.
1183ff7e0accSmrg	echo i860-stratus-sysv4
1184ff7e0accSmrg	exit ;;
1185ff7e0accSmrg    i*86:VOS:*:*)
1186ff7e0accSmrg	# From Paul.Green@stratus.com.
1187ff7e0accSmrg	echo ${UNAME_MACHINE}-stratus-vos
1188ff7e0accSmrg	exit ;;
1189ff7e0accSmrg    *:VOS:*:*)
1190ff7e0accSmrg	# From Paul.Green@stratus.com.
1191ff7e0accSmrg	echo hppa1.1-stratus-vos
1192ff7e0accSmrg	exit ;;
1193ff7e0accSmrg    mc68*:A/UX:*:*)
1194ff7e0accSmrg	echo m68k-apple-aux${UNAME_RELEASE}
1195ff7e0accSmrg	exit ;;
1196ff7e0accSmrg    news*:NEWS-OS:6*:*)
1197ff7e0accSmrg	echo mips-sony-newsos6
1198ff7e0accSmrg	exit ;;
1199ff7e0accSmrg    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
1200ff7e0accSmrg	if [ -d /usr/nec ]; then
120105bee9bcSmrg		echo mips-nec-sysv${UNAME_RELEASE}
1202ff7e0accSmrg	else
120305bee9bcSmrg		echo mips-unknown-sysv${UNAME_RELEASE}
1204ff7e0accSmrg	fi
120505bee9bcSmrg	exit ;;
1206ff7e0accSmrg    BeBox:BeOS:*:*)	# BeOS running on hardware made by Be, PPC only.
1207ff7e0accSmrg	echo powerpc-be-beos
1208ff7e0accSmrg	exit ;;
1209ff7e0accSmrg    BeMac:BeOS:*:*)	# BeOS running on Mac or Mac clone, PPC only.
1210ff7e0accSmrg	echo powerpc-apple-beos
1211ff7e0accSmrg	exit ;;
1212ff7e0accSmrg    BePC:BeOS:*:*)	# BeOS running on Intel PC compatible.
1213ff7e0accSmrg	echo i586-pc-beos
1214ff7e0accSmrg	exit ;;
121510998002Smrg    BePC:Haiku:*:*)	# Haiku running on Intel PC compatible.
121610998002Smrg	echo i586-pc-haiku
121710998002Smrg	exit ;;
121805bee9bcSmrg    x86_64:Haiku:*:*)
121905bee9bcSmrg	echo x86_64-unknown-haiku
122005bee9bcSmrg	exit ;;
1221ff7e0accSmrg    SX-4:SUPER-UX:*:*)
1222ff7e0accSmrg	echo sx4-nec-superux${UNAME_RELEASE}
1223ff7e0accSmrg	exit ;;
1224ff7e0accSmrg    SX-5:SUPER-UX:*:*)
1225ff7e0accSmrg	echo sx5-nec-superux${UNAME_RELEASE}
1226ff7e0accSmrg	exit ;;
1227ff7e0accSmrg    SX-6:SUPER-UX:*:*)
1228ff7e0accSmrg	echo sx6-nec-superux${UNAME_RELEASE}
1229ff7e0accSmrg	exit ;;
1230ff7e0accSmrg    SX-7:SUPER-UX:*:*)
1231ff7e0accSmrg	echo sx7-nec-superux${UNAME_RELEASE}
1232ff7e0accSmrg	exit ;;
1233ff7e0accSmrg    SX-8:SUPER-UX:*:*)
1234ff7e0accSmrg	echo sx8-nec-superux${UNAME_RELEASE}
1235ff7e0accSmrg	exit ;;
1236ff7e0accSmrg    SX-8R:SUPER-UX:*:*)
1237ff7e0accSmrg	echo sx8r-nec-superux${UNAME_RELEASE}
1238ff7e0accSmrg	exit ;;
1239ff7e0accSmrg    Power*:Rhapsody:*:*)
1240ff7e0accSmrg	echo powerpc-apple-rhapsody${UNAME_RELEASE}
1241ff7e0accSmrg	exit ;;
1242ff7e0accSmrg    *:Rhapsody:*:*)
1243ff7e0accSmrg	echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
1244ff7e0accSmrg	exit ;;
1245ff7e0accSmrg    *:Darwin:*:*)
1246ff7e0accSmrg	UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
1247ff7e0accSmrg	case $UNAME_PROCESSOR in
1248863f95b1Smrg	    i386)
1249863f95b1Smrg		eval $set_cc_for_build
1250863f95b1Smrg		if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
1251863f95b1Smrg		  if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
1252863f95b1Smrg		      (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
1253863f95b1Smrg		      grep IS_64BIT_ARCH >/dev/null
1254863f95b1Smrg		  then
1255863f95b1Smrg		      UNAME_PROCESSOR="x86_64"
1256863f95b1Smrg		  fi
1257863f95b1Smrg		fi ;;
1258ff7e0accSmrg	    unknown) UNAME_PROCESSOR=powerpc ;;
1259ff7e0accSmrg	esac
1260ff7e0accSmrg	echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
1261ff7e0accSmrg	exit ;;
1262ff7e0accSmrg    *:procnto*:*:* | *:QNX:[0123456789]*:*)
1263ff7e0accSmrg	UNAME_PROCESSOR=`uname -p`
1264ff7e0accSmrg	if test "$UNAME_PROCESSOR" = "x86"; then
1265ff7e0accSmrg		UNAME_PROCESSOR=i386
1266ff7e0accSmrg		UNAME_MACHINE=pc
1267ff7e0accSmrg	fi
1268ff7e0accSmrg	echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
1269ff7e0accSmrg	exit ;;
1270ff7e0accSmrg    *:QNX:*:4*)
1271ff7e0accSmrg	echo i386-pc-qnx
1272ff7e0accSmrg	exit ;;
127305bee9bcSmrg    NEO-?:NONSTOP_KERNEL:*:*)
127405bee9bcSmrg	echo neo-tandem-nsk${UNAME_RELEASE}
127505bee9bcSmrg	exit ;;
127605bee9bcSmrg    NSE-*:NONSTOP_KERNEL:*:*)
1277ff7e0accSmrg	echo nse-tandem-nsk${UNAME_RELEASE}
1278ff7e0accSmrg	exit ;;
1279ff7e0accSmrg    NSR-?:NONSTOP_KERNEL:*:*)
1280ff7e0accSmrg	echo nsr-tandem-nsk${UNAME_RELEASE}
1281ff7e0accSmrg	exit ;;
1282ff7e0accSmrg    *:NonStop-UX:*:*)
1283ff7e0accSmrg	echo mips-compaq-nonstopux
1284ff7e0accSmrg	exit ;;
1285ff7e0accSmrg    BS2000:POSIX*:*:*)
1286ff7e0accSmrg	echo bs2000-siemens-sysv
1287ff7e0accSmrg	exit ;;
1288ff7e0accSmrg    DS/*:UNIX_System_V:*:*)
1289ff7e0accSmrg	echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
1290ff7e0accSmrg	exit ;;
1291ff7e0accSmrg    *:Plan9:*:*)
1292ff7e0accSmrg	# "uname -m" is not consistent, so use $cputype instead. 386
1293ff7e0accSmrg	# is converted to i386 for consistency with other x86
1294ff7e0accSmrg	# operating systems.
1295ff7e0accSmrg	if test "$cputype" = "386"; then
1296ff7e0accSmrg	    UNAME_MACHINE=i386
1297ff7e0accSmrg	else
1298ff7e0accSmrg	    UNAME_MACHINE="$cputype"
1299ff7e0accSmrg	fi
1300ff7e0accSmrg	echo ${UNAME_MACHINE}-unknown-plan9
1301ff7e0accSmrg	exit ;;
1302ff7e0accSmrg    *:TOPS-10:*:*)
1303ff7e0accSmrg	echo pdp10-unknown-tops10
1304ff7e0accSmrg	exit ;;
1305ff7e0accSmrg    *:TENEX:*:*)
1306ff7e0accSmrg	echo pdp10-unknown-tenex
1307ff7e0accSmrg	exit ;;
1308ff7e0accSmrg    KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
1309ff7e0accSmrg	echo pdp10-dec-tops20
1310ff7e0accSmrg	exit ;;
1311ff7e0accSmrg    XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
1312ff7e0accSmrg	echo pdp10-xkl-tops20
1313ff7e0accSmrg	exit ;;
1314ff7e0accSmrg    *:TOPS-20:*:*)
1315ff7e0accSmrg	echo pdp10-unknown-tops20
1316ff7e0accSmrg	exit ;;
1317ff7e0accSmrg    *:ITS:*:*)
1318ff7e0accSmrg	echo pdp10-unknown-its
1319ff7e0accSmrg	exit ;;
1320ff7e0accSmrg    SEI:*:*:SEIUX)
132105bee9bcSmrg	echo mips-sei-seiux${UNAME_RELEASE}
1322ff7e0accSmrg	exit ;;
1323ff7e0accSmrg    *:DragonFly:*:*)
1324ff7e0accSmrg	echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
1325ff7e0accSmrg	exit ;;
1326ff7e0accSmrg    *:*VMS:*:*)
132705bee9bcSmrg	UNAME_MACHINE=`(uname -p) 2>/dev/null`
1328ff7e0accSmrg	case "${UNAME_MACHINE}" in
1329ff7e0accSmrg	    A*) echo alpha-dec-vms ; exit ;;
1330ff7e0accSmrg	    I*) echo ia64-dec-vms ; exit ;;
1331ff7e0accSmrg	    V*) echo vax-dec-vms ; exit ;;
1332ff7e0accSmrg	esac ;;
1333ff7e0accSmrg    *:XENIX:*:SysV)
1334ff7e0accSmrg	echo i386-pc-xenix
1335ff7e0accSmrg	exit ;;
1336ff7e0accSmrg    i*86:skyos:*:*)
1337ff7e0accSmrg	echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
1338ff7e0accSmrg	exit ;;
1339ff7e0accSmrg    i*86:rdos:*:*)
1340ff7e0accSmrg	echo ${UNAME_MACHINE}-pc-rdos
1341ff7e0accSmrg	exit ;;
134210998002Smrg    i*86:AROS:*:*)
134310998002Smrg	echo ${UNAME_MACHINE}-pc-aros
134410998002Smrg	exit ;;
134505bee9bcSmrg    x86_64:VMkernel:*:*)
134605bee9bcSmrg	echo ${UNAME_MACHINE}-unknown-esx
134705bee9bcSmrg	exit ;;
1348ff7e0accSmrgesac
1349ff7e0accSmrg
1350ff7e0accSmrgeval $set_cc_for_build
1351ff7e0accSmrgcat >$dummy.c <<EOF
1352ff7e0accSmrg#ifdef _SEQUENT_
1353ff7e0accSmrg# include <sys/types.h>
1354ff7e0accSmrg# include <sys/utsname.h>
1355ff7e0accSmrg#endif
1356ff7e0accSmrgmain ()
1357ff7e0accSmrg{
1358ff7e0accSmrg#if defined (sony)
1359ff7e0accSmrg#if defined (MIPSEB)
1360ff7e0accSmrg  /* BFD wants "bsd" instead of "newsos".  Perhaps BFD should be changed,
1361ff7e0accSmrg     I don't know....  */
1362ff7e0accSmrg  printf ("mips-sony-bsd\n"); exit (0);
1363ff7e0accSmrg#else
1364ff7e0accSmrg#include <sys/param.h>
1365ff7e0accSmrg  printf ("m68k-sony-newsos%s\n",
1366ff7e0accSmrg#ifdef NEWSOS4
136705bee9bcSmrg	"4"
1368ff7e0accSmrg#else
136905bee9bcSmrg	""
1370ff7e0accSmrg#endif
137105bee9bcSmrg	); exit (0);
1372ff7e0accSmrg#endif
1373ff7e0accSmrg#endif
1374ff7e0accSmrg
1375ff7e0accSmrg#if defined (__arm) && defined (__acorn) && defined (__unix)
1376ff7e0accSmrg  printf ("arm-acorn-riscix\n"); exit (0);
1377ff7e0accSmrg#endif
1378ff7e0accSmrg
1379ff7e0accSmrg#if defined (hp300) && !defined (hpux)
1380ff7e0accSmrg  printf ("m68k-hp-bsd\n"); exit (0);
1381ff7e0accSmrg#endif
1382ff7e0accSmrg
1383ff7e0accSmrg#if defined (NeXT)
1384ff7e0accSmrg#if !defined (__ARCHITECTURE__)
1385ff7e0accSmrg#define __ARCHITECTURE__ "m68k"
1386ff7e0accSmrg#endif
1387ff7e0accSmrg  int version;
1388ff7e0accSmrg  version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
1389ff7e0accSmrg  if (version < 4)
1390ff7e0accSmrg    printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
1391ff7e0accSmrg  else
1392ff7e0accSmrg    printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
1393ff7e0accSmrg  exit (0);
1394ff7e0accSmrg#endif
1395ff7e0accSmrg
1396ff7e0accSmrg#if defined (MULTIMAX) || defined (n16)
1397ff7e0accSmrg#if defined (UMAXV)
1398ff7e0accSmrg  printf ("ns32k-encore-sysv\n"); exit (0);
1399ff7e0accSmrg#else
1400ff7e0accSmrg#if defined (CMU)
1401ff7e0accSmrg  printf ("ns32k-encore-mach\n"); exit (0);
1402ff7e0accSmrg#else
1403ff7e0accSmrg  printf ("ns32k-encore-bsd\n"); exit (0);
1404ff7e0accSmrg#endif
1405ff7e0accSmrg#endif
1406ff7e0accSmrg#endif
1407ff7e0accSmrg
1408ff7e0accSmrg#if defined (__386BSD__)
1409ff7e0accSmrg  printf ("i386-pc-bsd\n"); exit (0);
1410ff7e0accSmrg#endif
1411ff7e0accSmrg
1412ff7e0accSmrg#if defined (sequent)
1413ff7e0accSmrg#if defined (i386)
1414ff7e0accSmrg  printf ("i386-sequent-dynix\n"); exit (0);
1415ff7e0accSmrg#endif
1416ff7e0accSmrg#if defined (ns32000)
1417ff7e0accSmrg  printf ("ns32k-sequent-dynix\n"); exit (0);
1418ff7e0accSmrg#endif
1419ff7e0accSmrg#endif
1420ff7e0accSmrg
1421ff7e0accSmrg#if defined (_SEQUENT_)
1422ff7e0accSmrg    struct utsname un;
1423ff7e0accSmrg
1424ff7e0accSmrg    uname(&un);
1425ff7e0accSmrg
1426ff7e0accSmrg    if (strncmp(un.version, "V2", 2) == 0) {
1427ff7e0accSmrg	printf ("i386-sequent-ptx2\n"); exit (0);
1428ff7e0accSmrg    }
1429ff7e0accSmrg    if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
1430ff7e0accSmrg	printf ("i386-sequent-ptx1\n"); exit (0);
1431ff7e0accSmrg    }
1432ff7e0accSmrg    printf ("i386-sequent-ptx\n"); exit (0);
1433ff7e0accSmrg
1434ff7e0accSmrg#endif
1435ff7e0accSmrg
1436ff7e0accSmrg#if defined (vax)
1437ff7e0accSmrg# if !defined (ultrix)
1438ff7e0accSmrg#  include <sys/param.h>
1439ff7e0accSmrg#  if defined (BSD)
1440ff7e0accSmrg#   if BSD == 43
1441ff7e0accSmrg      printf ("vax-dec-bsd4.3\n"); exit (0);
1442ff7e0accSmrg#   else
1443ff7e0accSmrg#    if BSD == 199006
1444ff7e0accSmrg      printf ("vax-dec-bsd4.3reno\n"); exit (0);
1445ff7e0accSmrg#    else
1446ff7e0accSmrg      printf ("vax-dec-bsd\n"); exit (0);
1447ff7e0accSmrg#    endif
1448ff7e0accSmrg#   endif
1449ff7e0accSmrg#  else
1450ff7e0accSmrg    printf ("vax-dec-bsd\n"); exit (0);
1451ff7e0accSmrg#  endif
1452ff7e0accSmrg# else
1453ff7e0accSmrg    printf ("vax-dec-ultrix\n"); exit (0);
1454ff7e0accSmrg# endif
1455ff7e0accSmrg#endif
1456ff7e0accSmrg
1457ff7e0accSmrg#if defined (alliant) && defined (i860)
1458ff7e0accSmrg  printf ("i860-alliant-bsd\n"); exit (0);
1459ff7e0accSmrg#endif
1460ff7e0accSmrg
1461ff7e0accSmrg  exit (1);
1462ff7e0accSmrg}
1463ff7e0accSmrgEOF
1464ff7e0accSmrg
1465ff7e0accSmrg$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
1466ff7e0accSmrg	{ echo "$SYSTEM_NAME"; exit; }
1467ff7e0accSmrg
1468ff7e0accSmrg# Apollos put the system type in the environment.
1469ff7e0accSmrg
1470ff7e0accSmrgtest -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
1471ff7e0accSmrg
1472ff7e0accSmrg# Convex versions that predate uname can use getsysinfo(1)
1473ff7e0accSmrg
1474ff7e0accSmrgif [ -x /usr/convex/getsysinfo ]
1475ff7e0accSmrgthen
1476ff7e0accSmrg    case `getsysinfo -f cpu_type` in
1477ff7e0accSmrg    c1*)
1478ff7e0accSmrg	echo c1-convex-bsd
1479ff7e0accSmrg	exit ;;
1480ff7e0accSmrg    c2*)
1481ff7e0accSmrg	if getsysinfo -f scalar_acc
1482ff7e0accSmrg	then echo c32-convex-bsd
1483ff7e0accSmrg	else echo c2-convex-bsd
1484ff7e0accSmrg	fi
1485ff7e0accSmrg	exit ;;
1486ff7e0accSmrg    c34*)
1487ff7e0accSmrg	echo c34-convex-bsd
1488ff7e0accSmrg	exit ;;
1489ff7e0accSmrg    c38*)
1490ff7e0accSmrg	echo c38-convex-bsd
1491ff7e0accSmrg	exit ;;
1492ff7e0accSmrg    c4*)
1493ff7e0accSmrg	echo c4-convex-bsd
1494ff7e0accSmrg	exit ;;
1495ff7e0accSmrg    esac
1496ff7e0accSmrgfi
1497ff7e0accSmrg
1498ff7e0accSmrgcat >&2 <<EOF
1499ff7e0accSmrg$0: unable to guess system type
1500ff7e0accSmrg
1501ff7e0accSmrgThis script, last modified $timestamp, has failed to recognize
1502ff7e0accSmrgthe operating system you are using. It is advised that you
1503ff7e0accSmrgdownload the most up to date version of the config scripts from
1504ff7e0accSmrg
1505a005d216Smrg  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
1506ff7e0accSmrgand
1507a005d216Smrg  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
1508ff7e0accSmrg
1509ff7e0accSmrgIf the version you run ($0) is already up to date, please
1510ff7e0accSmrgsend the following data and any information you think might be
1511ff7e0accSmrgpertinent to <config-patches@gnu.org> in order to provide the needed
1512ff7e0accSmrginformation to handle your system.
1513ff7e0accSmrg
1514ff7e0accSmrgconfig.guess timestamp = $timestamp
1515ff7e0accSmrg
1516ff7e0accSmrguname -m = `(uname -m) 2>/dev/null || echo unknown`
1517ff7e0accSmrguname -r = `(uname -r) 2>/dev/null || echo unknown`
1518ff7e0accSmrguname -s = `(uname -s) 2>/dev/null || echo unknown`
1519ff7e0accSmrguname -v = `(uname -v) 2>/dev/null || echo unknown`
1520ff7e0accSmrg
1521ff7e0accSmrg/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
1522ff7e0accSmrg/bin/uname -X     = `(/bin/uname -X) 2>/dev/null`
1523ff7e0accSmrg
1524ff7e0accSmrghostinfo               = `(hostinfo) 2>/dev/null`
1525ff7e0accSmrg/bin/universe          = `(/bin/universe) 2>/dev/null`
1526ff7e0accSmrg/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null`
1527ff7e0accSmrg/bin/arch              = `(/bin/arch) 2>/dev/null`
1528ff7e0accSmrg/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`
1529ff7e0accSmrg/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
1530ff7e0accSmrg
1531ff7e0accSmrgUNAME_MACHINE = ${UNAME_MACHINE}
1532ff7e0accSmrgUNAME_RELEASE = ${UNAME_RELEASE}
1533ff7e0accSmrgUNAME_SYSTEM  = ${UNAME_SYSTEM}
1534ff7e0accSmrgUNAME_VERSION = ${UNAME_VERSION}
1535ff7e0accSmrgEOF
1536ff7e0accSmrg
1537ff7e0accSmrgexit 1
1538ff7e0accSmrg
1539ff7e0accSmrg# Local variables:
1540ff7e0accSmrg# eval: (add-hook 'write-file-hooks 'time-stamp)
1541ff7e0accSmrg# time-stamp-start: "timestamp='"
1542ff7e0accSmrg# time-stamp-format: "%:y-%02m-%02d"
1543ff7e0accSmrg# time-stamp-end: "'"
1544ff7e0accSmrg# End:
1545