Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/branches/collision_detection/config.guess @ 6828

Last change on this file since 6828 was 5479, checked in by bensch, 19 years ago

orxonox/trunk: updated to new autoconf, moved resourcemanager to util/loading

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