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