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