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