Ignore:
Timestamp:
2013-01-29T16:19:58+13:00 (11 years ago)
Author:
davidb
Message:

Newer version of config.guess and config.sub to include architecture support for Android

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/common-src/indexers/mg/config.guess

    r16583 r26793  
    11#! /bin/sh
    22# Attempt to guess a canonical system name.
    3 #   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
    4 #   Free Software Foundation, Inc.
    5 
    6 timestamp='2001-07-12'
     3#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
     4#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
     5#   2011 Free Software Foundation, Inc.
     6
     7timestamp='2011-11-11'
    78
    89# This file is free software; you can redistribute it and/or modify it
     
    1819# You should have received a copy of the GNU General Public License
    1920# along with this program; if not, write to the Free Software
    20 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
     21# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
     22# 02110-1301, USA.
    2123#
    2224# As a special exception to the GNU General Public License, if you
     
    2527# the same distribution terms that you use for the rest of that program.
    2628
    27 # Written by Per Bothner <[email protected]>.
    28 # Please send patches to <[email protected]>.
     29
     30# Originally written by Per Bothner.  Please send patches (context
     31# diff format) to <[email protected]> and include a ChangeLog
     32# entry.
    2933#
    3034# This script attempts to guess a canonical system name similar to
     
    3236# exits with 0.  Otherwise, it exits with 1.
    3337#
    34 # The plan is that this can be called by configure scripts if you
    35 # don't specify an explicit build system type.
     38# You can get the latest version of this script from:
     39# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
    3640
    3741me=`echo "$0" | sed -e 's,.*/,,'`
     
    5357
    5458Originally written by Per Bothner.
    55 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
    56 Free Software Foundation, Inc.
     59Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
     602001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free
     61Software Foundation, Inc.
    5762
    5863This is free software; see the source for copying conditions.  There is NO
     
    6671  case $1 in
    6772    --time-stamp | --time* | -t )
    68        echo "$timestamp" ; exit 0 ;;
     73       echo "$timestamp" ; exit ;;
    6974    --version | -v )
    70        echo "$version" ; exit 0 ;;
     75       echo "$version" ; exit ;;
    7176    --help | --h* | -h )
    72        echo "$usage"; exit 0 ;;
     77       echo "$usage"; exit ;;
    7378    -- )     # Stop option processing
    7479       shift; break ;;
     
    8893fi
    8994
    90 
    91 dummy=dummy-$$
    92 trap 'rm -f $dummy.c $dummy.o $dummy.rel $dummy; exit 1' 1 2 15
    93 
    94 # CC_FOR_BUILD -- compiler used by this script.
     95trap 'exit 1' 1 2 15
     96
     97# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
     98# compiler to aid in system detection is discouraged as it requires
     99# temporary files to be created and, as you can see below, it is a
     100# headache to deal with in a portable fashion.
     101
    95102# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
    96103# use `HOST_CC' if defined, but it is deprecated.
    97104
    98 set_cc_for_build='case $CC_FOR_BUILD,$HOST_CC,$CC in
    99  ,,)    echo "int dummy(){}" > $dummy.c ;
    100     for c in cc gcc c89 ; do
    101       ($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1 ;
    102       if test $? = 0 ; then
     105# Portable tmp directory creation inspired by the Autoconf team.
     106
     107set_cc_for_build='
     108trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
     109trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
     110: ${TMPDIR=/tmp} ;
     111 { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
     112 { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
     113 { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
     114 { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
     115dummy=$tmp/dummy ;
     116tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
     117case $CC_FOR_BUILD,$HOST_CC,$CC in
     118 ,,)    echo "int x;" > $dummy.c ;
     119    for c in cc gcc c89 c99 ; do
     120      if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
    103121         CC_FOR_BUILD="$c"; break ;
    104122      fi ;
    105123    done ;
    106     rm -f $dummy.c $dummy.o $dummy.rel ;
    107124    if test x"$CC_FOR_BUILD" = x ; then
    108125      CC_FOR_BUILD=no_compiler_found ;
     
    111128 ,,*)   CC_FOR_BUILD=$CC ;;
    112129 ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
    113 esac'
     130esac ; set_cc_for_build= ;'
    114131
    115132# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
     
    128145case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
    129146    *:NetBSD:*:*)
    130     # Netbsd (nbsd) targets should (where applicable) match one or
     147    # NetBSD (nbsd) targets should (where applicable) match one or
    131148    # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
    132149    # *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
     
    135152    # compatibility and a consistent mechanism for selecting the
    136153    # object file format.
    137     # Determine the machine/vendor (is the vendor relevant).
    138     case "${UNAME_MACHINE}" in
    139         amiga) machine=m68k-unknown ;;
    140         arm32) machine=arm-unknown ;;
    141         atari*) machine=m68k-atari ;;
    142         sun3*) machine=m68k-sun ;;
    143         mac68k) machine=m68k-apple ;;
    144         macppc) machine=powerpc-apple ;;
    145         hp3[0-9][05]) machine=m68k-hp ;;
    146         ibmrt|romp-ibm) machine=romp-ibm ;;
    147         *) machine=${UNAME_MACHINE}-unknown ;;
     154    #
     155    # Note: NetBSD doesn't particularly care about the vendor
     156    # portion of the name.  We always set it to "unknown".
     157    sysctl="sysctl -n hw.machine_arch"
     158    UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
     159        /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
     160    case "${UNAME_MACHINE_ARCH}" in
     161        armeb) machine=armeb-unknown ;;
     162        arm*) machine=arm-unknown ;;
     163        sh3el) machine=shl-unknown ;;
     164        sh3eb) machine=sh-unknown ;;
     165        sh5el) machine=sh5le-unknown ;;
     166        *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
    148167    esac
    149168    # The Operating System including object format, if it has switched
    150169    # to ELF recently, or will in the future.
    151     case "${UNAME_MACHINE}" in
    152         i386|sparc|amiga|arm*|hp300|mvme68k|vax|atari|luna68k|mac68k|news68k|next68k|pc532|sun3*|x68k)
     170    case "${UNAME_MACHINE_ARCH}" in
     171        arm*|i386|m68k|ns32k|sh3*|sparc|vax)
    153172        eval $set_cc_for_build
    154173        if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
    155             | grep __ELF__ >/dev/null
     174            | grep -q __ELF__
    156175        then
    157176            # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
     
    163182        ;;
    164183        *)
    165             os=netbsd
     184        os=netbsd
    166185        ;;
    167186    esac
    168187    # The OS release
    169     release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
     188    # Debian GNU/NetBSD machines have a different userland, and
     189    # thus, need a distinct triplet. However, they do not need
     190    # kernel version information, so it can be replaced with a
     191    # suitable tag, in the style of linux-gnu.
     192    case "${UNAME_VERSION}" in
     193        Debian*)
     194        release='-gnu'
     195        ;;
     196        *)
     197        release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
     198        ;;
     199    esac
    170200    # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
    171201    # contains redundant information, the shorter form:
    172202    # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
    173203    echo "${machine}-${os}${release}"
    174     exit 0 ;;
     204    exit ;;
     205    *:OpenBSD:*:*)
     206    UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
     207    echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
     208    exit ;;
     209    *:ekkoBSD:*:*)
     210    echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
     211    exit ;;
     212    *:SolidBSD:*:*)
     213    echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
     214    exit ;;
     215    macppc:MirBSD:*:*)
     216    echo powerpc-unknown-mirbsd${UNAME_RELEASE}
     217    exit ;;
     218    *:MirBSD:*:*)
     219    echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
     220    exit ;;
    175221    alpha:OSF1:*:*)
    176     if test $UNAME_RELEASE = "V4.0"; then
     222    case $UNAME_RELEASE in
     223    *4.0)
    177224        UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
    178     fi
     225        ;;
     226    *5.*)
     227        UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
     228        ;;
     229    esac
     230    # According to Compaq, /usr/sbin/psrinfo has been available on
     231    # OSF/1 and Tru64 systems produced since 1995.  I hope that
     232    # covers most systems running today.  This code pipes the CPU
     233    # types through head -n 1, so we only detect the type of CPU 0.
     234    ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\) processor.*$/\1/p' | head -n 1`
     235    case "$ALPHA_CPU_TYPE" in
     236        "EV4 (21064)")
     237        UNAME_MACHINE="alpha" ;;
     238        "EV4.5 (21064)")
     239        UNAME_MACHINE="alpha" ;;
     240        "LCA4 (21066/21068)")
     241        UNAME_MACHINE="alpha" ;;
     242        "EV5 (21164)")
     243        UNAME_MACHINE="alphaev5" ;;
     244        "EV5.6 (21164A)")
     245        UNAME_MACHINE="alphaev56" ;;
     246        "EV5.6 (21164PC)")
     247        UNAME_MACHINE="alphapca56" ;;
     248        "EV5.7 (21164PC)")
     249        UNAME_MACHINE="alphapca57" ;;
     250        "EV6 (21264)")
     251        UNAME_MACHINE="alphaev6" ;;
     252        "EV6.7 (21264A)")
     253        UNAME_MACHINE="alphaev67" ;;
     254        "EV6.8CB (21264C)")
     255        UNAME_MACHINE="alphaev68" ;;
     256        "EV6.8AL (21264B)")
     257        UNAME_MACHINE="alphaev68" ;;
     258        "EV6.8CX (21264D)")
     259        UNAME_MACHINE="alphaev68" ;;
     260        "EV6.9A (21264/EV69A)")
     261        UNAME_MACHINE="alphaev69" ;;
     262        "EV7 (21364)")
     263        UNAME_MACHINE="alphaev7" ;;
     264        "EV7.9 (21364A)")
     265        UNAME_MACHINE="alphaev79" ;;
     266    esac
     267    # A Pn.n version is a patched version.
    179268    # A Vn.n version is a released version.
    180269    # A Tn.n version is a released field test version.
    181270    # A Xn.n version is an unreleased experimental baselevel.
    182271    # 1.2 uses "1.2" for uname -r.
    183     cat <<EOF >$dummy.s
    184     .data
    185 \$Lformat:
    186     .byte 37,100,45,37,120,10,0 # "%d-%x\n"
    187 
    188     .text
    189     .globl main
    190     .align 4
    191     .ent main
    192 main:
    193     .frame \$30,16,\$26,0
    194     ldgp \$29,0(\$27)
    195     .prologue 1
    196     .long 0x47e03d80 # implver \$0
    197     lda \$2,-1
    198     .long 0x47e20c21 # amask \$2,\$1
    199     lda \$16,\$Lformat
    200     mov \$0,\$17
    201     not \$1,\$18
    202     jsr \$26,printf
    203     ldgp \$29,0(\$26)
    204     mov 0,\$16
    205     jsr \$26,exit
    206     .end main
    207 EOF
    208     eval $set_cc_for_build
    209     $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
    210     if test "$?" = 0 ; then
    211         case `./$dummy` in
    212             0-0)
    213                 UNAME_MACHINE="alpha"
    214                 ;;
    215             1-0)
    216                 UNAME_MACHINE="alphaev5"
    217                 ;;
    218             1-1)
    219                 UNAME_MACHINE="alphaev56"
    220                 ;;
    221             1-101)
    222                 UNAME_MACHINE="alphapca56"
    223                 ;;
    224             2-303)
    225                 UNAME_MACHINE="alphaev6"
    226                 ;;
    227             2-307)
    228                 UNAME_MACHINE="alphaev67"
    229                 ;;
    230         esac
    231     fi
    232     rm -f $dummy.s $dummy
    233     echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
    234     exit 0 ;;
     272    echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
     273    # Reset EXIT trap before exiting to avoid spurious non-zero exit code.
     274    exitcode=$?
     275    trap '' 0
     276    exit $exitcode ;;
    235277    Alpha\ *:Windows_NT*:*)
    236278    # How do we know it's Interix rather than the generic POSIX subsystem?
     
    238280    # of the specific Alpha model?
    239281    echo alpha-pc-interix
    240     exit 0 ;;
     282    exit ;;
    241283    21064:Windows_NT:50:3)
    242284    echo alpha-dec-winnt3.5
    243     exit 0 ;;
     285    exit ;;
    244286    Amiga*:UNIX_System_V:4.0:*)
    245287    echo m68k-unknown-sysv4
    246     exit 0;;
    247     amiga:OpenBSD:*:*)
    248     echo m68k-unknown-openbsd${UNAME_RELEASE}
    249     exit 0 ;;
     288    exit ;;
    250289    *:[Aa]miga[Oo][Ss]:*:*)
    251290    echo ${UNAME_MACHINE}-unknown-amigaos
    252     exit 0 ;;
    253     arc64:OpenBSD:*:*)
    254     echo mips64el-unknown-openbsd${UNAME_RELEASE}
    255     exit 0 ;;
    256     arc:OpenBSD:*:*)
    257     echo mipsel-unknown-openbsd${UNAME_RELEASE}
    258     exit 0 ;;
    259     hkmips:OpenBSD:*:*)
    260     echo mips-unknown-openbsd${UNAME_RELEASE}
    261     exit 0 ;;
    262     pmax:OpenBSD:*:*)
    263     echo mipsel-unknown-openbsd${UNAME_RELEASE}
    264     exit 0 ;;
    265     sgi:OpenBSD:*:*)
    266     echo mips-unknown-openbsd${UNAME_RELEASE}
    267     exit 0 ;;
    268     wgrisc:OpenBSD:*:*)
    269     echo mipsel-unknown-openbsd${UNAME_RELEASE}
    270     exit 0 ;;
     291    exit ;;
     292    *:[Mm]orph[Oo][Ss]:*:*)
     293    echo ${UNAME_MACHINE}-unknown-morphos
     294    exit ;;
    271295    *:OS/390:*:*)
    272296    echo i370-ibm-openedition
    273     exit 0 ;;
     297    exit ;;
     298    *:z/VM:*:*)
     299    echo s390-ibm-zvmoe
     300    exit ;;
     301    *:OS400:*:*)
     302    echo powerpc-ibm-os400
     303    exit ;;
    274304    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
    275305    echo arm-acorn-riscix${UNAME_RELEASE}
    276     exit 0;;
     306    exit ;;
     307    arm:riscos:*:*|arm:RISCOS:*:*)
     308    echo arm-unknown-riscos
     309    exit ;;
    277310    SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
    278311    echo hppa1.1-hitachi-hiuxmpp
    279     exit 0;;
     312    exit ;;
    280313    Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
    281314    # [email protected] (Earle F. Ake) contributed MIS and NILE.
     
    285318        echo pyramid-pyramid-bsd
    286319    fi
    287     exit 0 ;;
     320    exit ;;
    288321    NILE*:*:*:dcosx)
    289322    echo pyramid-pyramid-svr4
    290     exit 0 ;;
     323    exit ;;
     324    DRS?6000:unix:4.0:6*)
     325    echo sparc-icl-nx6
     326    exit ;;
     327    DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
     328    case `/usr/bin/uname -p` in
     329        sparc) echo sparc-icl-nx7; exit ;;
     330    esac ;;
     331    s390x:SunOS:*:*)
     332    echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
     333    exit ;;
    291334    sun4H:SunOS:5.*:*)
    292335    echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
    293     exit 0 ;;
     336    exit ;;
    294337    sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
    295338    echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
    296     exit 0 ;;
    297     i86pc:SunOS:5.*:*)
    298     echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
    299     exit 0 ;;
     339    exit ;;
     340    i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
     341    echo i386-pc-auroraux${UNAME_RELEASE}
     342    exit ;;
     343    i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
     344    eval $set_cc_for_build
     345    SUN_ARCH="i386"
     346    # If there is a compiler, see if it is configured for 64-bit objects.
     347    # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
     348    # This test works for both compilers.
     349    if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
     350        if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
     351        (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
     352        grep IS_64BIT_ARCH >/dev/null
     353        then
     354        SUN_ARCH="x86_64"
     355        fi
     356    fi
     357    echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
     358    exit ;;
    300359    sun4*:SunOS:6*:*)
    301360    # According to config.sub, this is the proper way to canonicalize
     
    303362    # it's likely to be more like Solaris than SunOS4.
    304363    echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
    305     exit 0 ;;
     364    exit ;;
    306365    sun4*:SunOS:*:*)
    307366    case "`/usr/bin/arch -k`" in
     
    312371    # Japanese Language versions have a version number like `4.1.3-JL'.
    313372    echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
    314     exit 0 ;;
     373    exit ;;
    315374    sun3*:SunOS:*:*)
    316375    echo m68k-sun-sunos${UNAME_RELEASE}
    317     exit 0 ;;
     376    exit ;;
    318377    sun*:*:4.2BSD:*)
    319     UNAME_RELEASE=`(head -1 /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
     378    UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
    320379    test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
    321380    case "`/bin/arch`" in
     
    327386        ;;
    328387    esac
    329     exit 0 ;;
     388    exit ;;
    330389    aushp:SunOS:*:*)
    331390    echo sparc-auspex-sunos${UNAME_RELEASE}
    332     exit 0 ;;
    333     atari*:OpenBSD:*:*)
    334     echo m68k-unknown-openbsd${UNAME_RELEASE}
    335     exit 0 ;;
     391    exit ;;
    336392    # The situation for MiNT is a little confusing.  The machine name
    337393    # can be virtually everything (everything which is not
     
    343399    # be no problem.
    344400    atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
    345         echo m68k-atari-mint${UNAME_RELEASE}
    346     exit 0 ;;
     401    echo m68k-atari-mint${UNAME_RELEASE}
     402    exit ;;
    347403    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
    348404    echo m68k-atari-mint${UNAME_RELEASE}
    349         exit 0 ;;
     405    exit ;;
    350406    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
    351         echo m68k-atari-mint${UNAME_RELEASE}
    352     exit 0 ;;
     407    echo m68k-atari-mint${UNAME_RELEASE}
     408    exit ;;
    353409    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
    354         echo m68k-milan-mint${UNAME_RELEASE}
    355         exit 0 ;;
     410    echo m68k-milan-mint${UNAME_RELEASE}
     411    exit ;;
    356412    hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
    357         echo m68k-hades-mint${UNAME_RELEASE}
    358         exit 0 ;;
     413    echo m68k-hades-mint${UNAME_RELEASE}
     414    exit ;;
    359415    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
    360         echo m68k-unknown-mint${UNAME_RELEASE}
    361         exit 0 ;;
    362     sun3*:OpenBSD:*:*)
    363     echo m68k-unknown-openbsd${UNAME_RELEASE}
    364     exit 0 ;;
    365     mac68k:OpenBSD:*:*)
    366     echo m68k-unknown-openbsd${UNAME_RELEASE}
    367     exit 0 ;;
    368     mvme68k:OpenBSD:*:*)
    369     echo m68k-unknown-openbsd${UNAME_RELEASE}
    370     exit 0 ;;
    371     mvme88k:OpenBSD:*:*)
    372     echo m88k-unknown-openbsd${UNAME_RELEASE}
    373     exit 0 ;;
     416    echo m68k-unknown-mint${UNAME_RELEASE}
     417    exit ;;
     418    m68k:machten:*:*)
     419    echo m68k-apple-machten${UNAME_RELEASE}
     420    exit ;;
    374421    powerpc:machten:*:*)
    375422    echo powerpc-apple-machten${UNAME_RELEASE}
    376     exit 0 ;;
     423    exit ;;
    377424    RISC*:Mach:*:*)
    378425    echo mips-dec-mach_bsd4.3
    379     exit 0 ;;
     426    exit ;;
    380427    RISC*:ULTRIX:*:*)
    381428    echo mips-dec-ultrix${UNAME_RELEASE}
    382     exit 0 ;;
     429    exit ;;
    383430    VAX*:ULTRIX*:*:*)
    384431    echo vax-dec-ultrix${UNAME_RELEASE}
    385     exit 0 ;;
     432    exit ;;
    386433    2020:CLIX:*:* | 2430:CLIX:*:*)
    387434    echo clipper-intergraph-clix${UNAME_RELEASE}
    388     exit 0 ;;
     435    exit ;;
    389436    mips:*:*:UMIPS | mips:*:*:RISCos)
     437    eval $set_cc_for_build
    390438    sed 's/^    //' << EOF >$dummy.c
    391439#ifdef __cplusplus
     
    409457    }
    410458EOF
    411     eval $set_cc_for_build
    412     $CC_FOR_BUILD $dummy.c -o $dummy \
    413       && ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
    414       && rm -f $dummy.c $dummy && exit 0
    415     rm -f $dummy.c $dummy
     459    $CC_FOR_BUILD -o $dummy $dummy.c &&
     460      dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
     461      SYSTEM_NAME=`$dummy $dummyarg` &&
     462        { echo "$SYSTEM_NAME"; exit; }
    416463    echo mips-mips-riscos${UNAME_RELEASE}
    417     exit 0 ;;
     464    exit ;;
    418465    Motorola:PowerMAX_OS:*:*)
    419466    echo powerpc-motorola-powermax
    420     exit 0 ;;
     467    exit ;;
     468    Motorola:*:4.3:PL8-*)
     469    echo powerpc-harris-powermax
     470    exit ;;
     471    Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
     472    echo powerpc-harris-powermax
     473    exit ;;
    421474    Night_Hawk:Power_UNIX:*:*)
    422475    echo powerpc-harris-powerunix
    423     exit 0 ;;
     476    exit ;;
    424477    m88k:CX/UX:7*:*)
    425478    echo m88k-harris-cxux7
    426     exit 0 ;;
     479    exit ;;
    427480    m88k:*:4*:R4*)
    428481    echo m88k-motorola-sysv4
    429     exit 0 ;;
     482    exit ;;
    430483    m88k:*:3*:R3*)
    431484    echo m88k-motorola-sysv3
    432     exit 0 ;;
     485    exit ;;
    433486    AViiON:dgux:*:*)
    434         # DG/UX returns AViiON for all architectures
    435         UNAME_PROCESSOR=`/usr/bin/uname -p`
     487    # DG/UX returns AViiON for all architectures
     488    UNAME_PROCESSOR=`/usr/bin/uname -p`
    436489    if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
    437490    then
     
    446499        echo i586-dg-dgux${UNAME_RELEASE}
    447500    fi
    448     exit 0 ;;
     501    exit ;;
    449502    M88*:DolphinOS:*:*) # DolphinOS (SVR3)
    450503    echo m88k-dolphin-sysv3
    451     exit 0 ;;
     504    exit ;;
    452505    M88*:*:R3*:*)
    453506    # Delta 88k system running SVR3
    454507    echo m88k-motorola-sysv3
    455     exit 0 ;;
     508    exit ;;
    456509    XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
    457510    echo m88k-tektronix-sysv3
    458     exit 0 ;;
     511    exit ;;
    459512    Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
    460513    echo m68k-tektronix-bsd
    461     exit 0 ;;
     514    exit ;;
    462515    *:IRIX*:*:*)
    463516    echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
    464     exit 0 ;;
     517    exit ;;
    465518    ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
    466     echo romp-ibm-aix      # uname -m gives an 8 hex-code CPU id
    467     exit 0 ;;              # Note that: echo "'`uname -s`'" gives 'AIX '
     519    echo romp-ibm-aix     # uname -m gives an 8 hex-code CPU id
     520    exit ;;               # Note that: echo "'`uname -s`'" gives 'AIX '
    468521    i*86:AIX:*:*)
    469522    echo i386-ibm-aix
    470     exit 0 ;;
     523    exit ;;
    471524    ia64:AIX:*:*)
    472525    if [ -x /usr/bin/oslevel ] ; then
     
    476529    fi
    477530    echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
    478     exit 0 ;;
     531    exit ;;
    479532    *:AIX:2:3)
    480533    if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
     534        eval $set_cc_for_build
    481535        sed 's/^        //' << EOF >$dummy.c
    482536        #include <sys/systemcfg.h>
     
    490544            }
    491545EOF
    492         eval $set_cc_for_build
    493         $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0
    494         rm -f $dummy.c $dummy
    495         echo rs6000-ibm-aix3.2.5
     546        if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
     547        then
     548            echo "$SYSTEM_NAME"
     549        else
     550            echo rs6000-ibm-aix3.2.5
     551        fi
    496552    elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
    497553        echo rs6000-ibm-aix3.2.4
     
    499555        echo rs6000-ibm-aix3.2
    500556    fi
    501     exit 0 ;;
    502     *:AIX:*:[45])
    503     IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | head -1 | awk '{ print $1 }'`
     557    exit ;;
     558    *:AIX:*:[4567])
     559    IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
    504560    if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
    505561        IBM_ARCH=rs6000
     
    513569    fi
    514570    echo ${IBM_ARCH}-ibm-aix${IBM_REV}
    515     exit 0 ;;
     571    exit ;;
    516572    *:AIX:*:*)
    517573    echo rs6000-ibm-aix
    518     exit 0 ;;
     574    exit ;;
    519575    ibmrt:4.4BSD:*|romp-ibm:BSD:*)
    520576    echo romp-ibm-bsd4.4
    521     exit 0 ;;
     577    exit ;;
    522578    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
    523579    echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
    524     exit 0 ;;                           # report: romp-ibm BSD 4.3
     580    exit ;;                             # report: romp-ibm BSD 4.3
    525581    *:BOSX:*:*)
    526582    echo rs6000-bull-bosx
    527     exit 0 ;;
     583    exit ;;
    528584    DPX/2?00:B.O.S.:*:*)
    529585    echo m68k-bull-sysv3
    530     exit 0 ;;
     586    exit ;;
    531587    9000/[34]??:4.3bsd:1.*:*)
    532588    echo m68k-hp-bsd
    533     exit 0 ;;
     589    exit ;;
    534590    hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
    535591    echo m68k-hp-bsd4.4
    536     exit 0 ;;
     592    exit ;;
    537593    9000/[34678]??:HP-UX:*:*)
    538594    HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
     
    541597        9000/[34]?? )         HP_ARCH=m68k ;;
    542598        9000/[678][0-9][0-9])
    543               case "${HPUX_REV}" in
    544                 11.[0-9][0-9])
    545                   if [ -x /usr/bin/getconf ]; then
    546                     sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
    547                     sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
    548                     case "${sc_cpu_version}" in
    549                       523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
    550                       528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
    551                       532)                      # CPU_PA_RISC2_0
    552                         case "${sc_kernel_bits}" in
    553                           32) HP_ARCH="hppa2.0n" ;;
    554                           64) HP_ARCH="hppa2.0w" ;;
    555                         esac ;;
    556                     esac
    557                   fi ;;
    558               esac
    559               if [ "${HP_ARCH}" = "" ]; then
    560               sed 's/^              //' << EOF >$dummy.c
    561 
    562               #define _HPUX_SOURCE
    563               #include <stdlib.h>
    564               #include <unistd.h>
    565 
    566               int main ()
    567               {
    568               #if defined(_SC_KERNEL_BITS)
    569                   long bits = sysconf(_SC_KERNEL_BITS);
    570               #endif
    571                   long cpu  = sysconf (_SC_CPU_VERSION);
    572 
    573                   switch (cpu)
    574                 {
    575                 case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
    576                 case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
    577                 case CPU_PA_RISC2_0:
    578               #if defined(_SC_KERNEL_BITS)
    579                     switch (bits)
    580                     {
    581                     case 64: puts ("hppa2.0w"); break;
    582                     case 32: puts ("hppa2.0n"); break;
    583                     default: puts ("hppa2.0"); break;
    584                     } break;
    585               #else  /* !defined(_SC_KERNEL_BITS) */
    586                     puts ("hppa2.0"); break;
    587               #endif
    588                 default: puts ("hppa1.0"); break;
    589                 }
    590                   exit (0);
    591               }
     599        if [ -x /usr/bin/getconf ]; then
     600            sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
     601            sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
     602            case "${sc_cpu_version}" in
     603              523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
     604              528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
     605              532)                      # CPU_PA_RISC2_0
     606            case "${sc_kernel_bits}" in
     607              32) HP_ARCH="hppa2.0n" ;;
     608              64) HP_ARCH="hppa2.0w" ;;
     609              '') HP_ARCH="hppa2.0" ;;   # HP-UX 10.20
     610            esac ;;
     611            esac
     612        fi
     613        if [ "${HP_ARCH}" = "" ]; then
     614            eval $set_cc_for_build
     615            sed 's/^        //' << EOF >$dummy.c
     616
     617        #define _HPUX_SOURCE
     618        #include <stdlib.h>
     619        #include <unistd.h>
     620
     621        int main ()
     622        {
     623        #if defined(_SC_KERNEL_BITS)
     624            long bits = sysconf(_SC_KERNEL_BITS);
     625        #endif
     626            long cpu  = sysconf (_SC_CPU_VERSION);
     627
     628            switch (cpu)
     629            {
     630            case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
     631            case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
     632            case CPU_PA_RISC2_0:
     633        #if defined(_SC_KERNEL_BITS)
     634                switch (bits)
     635                {
     636                case 64: puts ("hppa2.0w"); break;
     637                case 32: puts ("hppa2.0n"); break;
     638                default: puts ("hppa2.0"); break;
     639                } break;
     640        #else  /* !defined(_SC_KERNEL_BITS) */
     641                puts ("hppa2.0"); break;
     642        #endif
     643            default: puts ("hppa1.0"); break;
     644            }
     645            exit (0);
     646        }
    592647EOF
    593     eval $set_cc_for_build
    594     (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy`
    595     if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi
    596     rm -f $dummy.c $dummy
    597     fi ;;
     648            (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
     649            test -z "$HP_ARCH" && HP_ARCH=hppa
     650        fi ;;
    598651    esac
     652    if [ ${HP_ARCH} = "hppa2.0w" ]
     653    then
     654        eval $set_cc_for_build
     655
     656        # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
     657        # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler
     658        # generating 64-bit code.  GNU and HP use different nomenclature:
     659        #
     660        # $ CC_FOR_BUILD=cc ./config.guess
     661        # => hppa2.0w-hp-hpux11.23
     662        # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
     663        # => hppa64-hp-hpux11.23
     664
     665        if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
     666        grep -q __LP64__
     667        then
     668        HP_ARCH="hppa2.0w"
     669        else
     670        HP_ARCH="hppa64"
     671        fi
     672    fi
    599673    echo ${HP_ARCH}-hp-hpux${HPUX_REV}
    600     exit 0 ;;
     674    exit ;;
    601675    ia64:HP-UX:*:*)
    602676    HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
    603677    echo ia64-hp-hpux${HPUX_REV}
    604     exit 0 ;;
     678    exit ;;
    605679    3050*:HI-UX:*:*)
     680    eval $set_cc_for_build
    606681    sed 's/^    //' << EOF >$dummy.c
    607682    #include <unistd.h>
     
    629704    }
    630705EOF
    631     eval $set_cc_for_build
    632     $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0
    633     rm -f $dummy.c $dummy
     706    $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
     707        { echo "$SYSTEM_NAME"; exit; }
    634708    echo unknown-hitachi-hiuxwe2
    635     exit 0 ;;
     709    exit ;;
    636710    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
    637711    echo hppa1.1-hp-bsd
    638     exit 0 ;;
     712    exit ;;
    639713    9000/8??:4.3bsd:*:*)
    640714    echo hppa1.0-hp-bsd
    641     exit 0 ;;
     715    exit ;;
    642716    *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
    643717    echo hppa1.0-hp-mpeix
    644     exit 0 ;;
     718    exit ;;
    645719    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
    646720    echo hppa1.1-hp-osf
    647     exit 0 ;;
     721    exit ;;
    648722    hp8??:OSF1:*:*)
    649723    echo hppa1.0-hp-osf
    650     exit 0 ;;
     724    exit ;;
    651725    i*86:OSF1:*:*)
    652726    if [ -x /usr/sbin/sysversion ] ; then
     
    655729        echo ${UNAME_MACHINE}-unknown-osf1
    656730    fi
    657     exit 0 ;;
     731    exit ;;
    658732    parisc*:Lites*:*:*)
    659733    echo hppa1.1-hp-lites
    660     exit 0 ;;
    661     hppa*:OpenBSD:*:*)
    662     echo hppa-unknown-openbsd
    663     exit 0 ;;
     734    exit ;;
    664735    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
    665736    echo c1-convex-bsd
    666         exit 0 ;;
     737    exit ;;
    667738    C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
    668739    if getsysinfo -f scalar_acc
     
    670741    else echo c2-convex-bsd
    671742    fi
    672         exit 0 ;;
     743    exit ;;
    673744    C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
    674745    echo c34-convex-bsd
    675         exit 0 ;;
     746    exit ;;
    676747    C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
    677748    echo c38-convex-bsd
    678         exit 0 ;;
     749    exit ;;
    679750    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
    680751    echo c4-convex-bsd
    681         exit 0 ;;
    682     CRAY*X-MP:*:*:*)
    683     echo xmp-cray-unicos
    684         exit 0 ;;
     752    exit ;;
    685753    CRAY*Y-MP:*:*:*)
    686754    echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
    687     exit 0 ;;
     755    exit ;;
    688756    CRAY*[A-Z]90:*:*:*)
    689757    echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
     
    691759          -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
    692760          -e 's/\.[^.]*$/.X/'
    693     exit 0 ;;
     761    exit ;;
    694762    CRAY*TS:*:*:*)
    695763    echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
    696     exit 0 ;;
    697     CRAY*T3D:*:*:*)
    698     echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
    699     exit 0 ;;
     764    exit ;;
    700765    CRAY*T3E:*:*:*)
    701766    echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
    702     exit 0 ;;
     767    exit ;;
    703768    CRAY*SV1:*:*:*)
    704769    echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
    705     exit 0 ;;
    706     CRAY-2:*:*:*)
    707     echo cray2-cray-unicos
    708         exit 0 ;;
     770    exit ;;
     771    *:UNICOS/mp:*:*)
     772    echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
     773    exit ;;
    709774    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
    710775    FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
    711         FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
    712         FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
    713         echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
    714         exit 0 ;;
    715     hp300:OpenBSD:*:*)
    716     echo m68k-unknown-openbsd${UNAME_RELEASE}
    717     exit 0 ;;
     776    FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
     777    FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
     778    echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
     779    exit ;;
     780    5000:UNIX_System_V:4.*:*)
     781    FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
     782    FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
     783    echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
     784    exit ;;
    718785    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
    719786    echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
    720     exit 0 ;;
     787    exit ;;
    721788    sparc*:BSD/OS:*:*)
    722789    echo sparc-unknown-bsdi${UNAME_RELEASE}
    723     exit 0 ;;
     790    exit ;;
    724791    *:BSD/OS:*:*)
    725792    echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
    726     exit 0 ;;
     793    exit ;;
    727794    *:FreeBSD:*:*)
    728     echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
    729     exit 0 ;;
    730     *:OpenBSD:*:*)
    731     echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
    732     exit 0 ;;
     795    UNAME_PROCESSOR=`/usr/bin/uname -p`
     796    case ${UNAME_PROCESSOR} in
     797        amd64)
     798        echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
     799        *)
     800        echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
     801    esac
     802    exit ;;
    733803    i*:CYGWIN*:*)
    734804    echo ${UNAME_MACHINE}-pc-cygwin
    735     exit 0 ;;
    736     i*:MINGW*:*)
     805    exit ;;
     806    *:MINGW*:*)
    737807    echo ${UNAME_MACHINE}-pc-mingw32
    738     exit 0 ;;
     808    exit ;;
     809    i*:MSYS*:*)
     810    echo ${UNAME_MACHINE}-pc-msys
     811    exit ;;
     812    i*:windows32*:*)
     813    # uname -m includes "-pc" on this system.
     814    echo ${UNAME_MACHINE}-mingw32
     815    exit ;;
    739816    i*:PW*:*)
    740817    echo ${UNAME_MACHINE}-pc-pw32
    741     exit 0 ;;
     818    exit ;;
     819    *:Interix*:*)
     820    case ${UNAME_MACHINE} in
     821        x86)
     822        echo i586-pc-interix${UNAME_RELEASE}
     823        exit ;;
     824        authenticamd | genuineintel | EM64T)
     825        echo x86_64-unknown-interix${UNAME_RELEASE}
     826        exit ;;
     827        IA64)
     828        echo ia64-unknown-interix${UNAME_RELEASE}
     829        exit ;;
     830    esac ;;
     831    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
     832    echo i${UNAME_MACHINE}-pc-mks
     833    exit ;;
     834    8664:Windows_NT:*)
     835    echo x86_64-pc-mks
     836    exit ;;
    742837    i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
    743838    # How do we know it's Interix rather than the generic POSIX subsystem?
    744839    # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
    745840    # UNAME_MACHINE based on the output of uname instead of i386?
    746     echo i386-pc-interix
    747     exit 0 ;;
     841    echo i586-pc-interix
     842    exit ;;
    748843    i*:UWIN*:*)
    749844    echo ${UNAME_MACHINE}-pc-uwin
    750     exit 0 ;;
     845    exit ;;
     846    amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
     847    echo x86_64-unknown-cygwin
     848    exit ;;
    751849    p*:CYGWIN*:*)
    752850    echo powerpcle-unknown-cygwin
    753     exit 0 ;;
     851    exit ;;
    754852    prep*:SunOS:5.*:*)
    755853    echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
    756     exit 0 ;;
     854    exit ;;
    757855    *:GNU:*:*)
     856    # the GNU system
    758857    echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
    759     exit 0 ;;
     858    exit ;;
     859    *:GNU/*:*:*)
     860    # other systems with GNU libc and userland
     861    echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
     862    exit ;;
    760863    i*86:Minix:*:*)
    761864    echo ${UNAME_MACHINE}-pc-minix
    762     exit 0 ;;
    763     arm*:Linux:*:*)
    764     echo ${UNAME_MACHINE}-unknown-linux-gnu
    765     exit 0 ;;
    766     ia64:Linux:*:*)
    767     echo ${UNAME_MACHINE}-unknown-linux
    768     exit 0 ;;
    769     m68*:Linux:*:*)
    770     echo ${UNAME_MACHINE}-unknown-linux-gnu
    771     exit 0 ;;
    772     mips:Linux:*:*)
    773     case `sed -n '/^byte/s/^.*: \(.*\) endian/\1/p' < /proc/cpuinfo` in
    774       big)    echo mips-unknown-linux-gnu && exit 0 ;;
    775       little) echo mipsel-unknown-linux-gnu && exit 0 ;;
    776     esac
    777     ;;
    778     ppc:Linux:*:*)
    779     echo powerpc-unknown-linux-gnu
    780     exit 0 ;;
     865    exit ;;
    781866    alpha:Linux:*:*)
    782867    case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
     
    787872      EV6)   UNAME_MACHINE=alphaev6 ;;
    788873      EV67)  UNAME_MACHINE=alphaev67 ;;
    789       EV68*) UNAME_MACHINE=alphaev67 ;;
    790         esac
    791     objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
     874      EV68*) UNAME_MACHINE=alphaev68 ;;
     875    esac
     876    objdump --private-headers /bin/sh | grep -q ld.so.1
    792877    if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
    793878    echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
    794     exit 0 ;;
     879    exit ;;
     880    arm*:Linux:*:*)
     881    eval $set_cc_for_build
     882    if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
     883        | grep -q __ARM_EABI__
     884    then
     885        echo ${UNAME_MACHINE}-unknown-linux-gnu
     886    else
     887        if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
     888        | grep -q __ARM_PCS_VFP
     889        then
     890        echo ${UNAME_MACHINE}-unknown-linux-gnueabi
     891        else
     892        echo ${UNAME_MACHINE}-unknown-linux-gnueabihf
     893        fi
     894    fi
     895    exit ;;
     896    avr32*:Linux:*:*)
     897    echo ${UNAME_MACHINE}-unknown-linux-gnu
     898    exit ;;
     899    cris:Linux:*:*)
     900    echo cris-axis-linux-gnu
     901    exit ;;
     902    crisv32:Linux:*:*)
     903    echo crisv32-axis-linux-gnu
     904    exit ;;
     905    frv:Linux:*:*)
     906    echo frv-unknown-linux-gnu
     907    exit ;;
     908    hexagon:Linux:*:*)
     909    echo hexagon-unknown-linux-gnu
     910    exit ;;
     911    i*86:Linux:*:*)
     912    LIBC=gnu
     913    eval $set_cc_for_build
     914    sed 's/^    //' << EOF >$dummy.c
     915    #ifdef __dietlibc__
     916    LIBC=dietlibc
     917    #endif
     918EOF
     919    eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
     920    echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
     921    exit ;;
     922    ia64:Linux:*:*)
     923    echo ${UNAME_MACHINE}-unknown-linux-gnu
     924    exit ;;
     925    m32r*:Linux:*:*)
     926    echo ${UNAME_MACHINE}-unknown-linux-gnu
     927    exit ;;
     928    m68*:Linux:*:*)
     929    echo ${UNAME_MACHINE}-unknown-linux-gnu
     930    exit ;;
     931    mips:Linux:*:* | mips64:Linux:*:*)
     932    eval $set_cc_for_build
     933    sed 's/^    //' << EOF >$dummy.c
     934    #undef CPU
     935    #undef ${UNAME_MACHINE}
     936    #undef ${UNAME_MACHINE}el
     937    #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
     938    CPU=${UNAME_MACHINE}el
     939    #else
     940    #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
     941    CPU=${UNAME_MACHINE}
     942    #else
     943    CPU=
     944    #endif
     945    #endif
     946EOF
     947    eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
     948    test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
     949    ;;
     950    or32:Linux:*:*)
     951    echo or32-unknown-linux-gnu
     952    exit ;;
     953    padre:Linux:*:*)
     954    echo sparc-unknown-linux-gnu
     955    exit ;;
     956    parisc64:Linux:*:* | hppa64:Linux:*:*)
     957    echo hppa64-unknown-linux-gnu
     958    exit ;;
    795959    parisc:Linux:*:* | hppa:Linux:*:*)
    796960    # Look for CPU level
     
    800964      *)    echo hppa-unknown-linux-gnu ;;
    801965    esac
    802     exit 0 ;;
    803     parisc64:Linux:*:* | hppa64:Linux:*:*)
    804     echo hppa64-unknown-linux-gnu
    805     exit 0 ;;
     966    exit ;;
     967    ppc64:Linux:*:*)
     968    echo powerpc64-unknown-linux-gnu
     969    exit ;;
     970    ppc:Linux:*:*)
     971    echo powerpc-unknown-linux-gnu
     972    exit ;;
    806973    s390:Linux:*:* | s390x:Linux:*:*)
    807974    echo ${UNAME_MACHINE}-ibm-linux
    808     exit 0 ;;
     975    exit ;;
     976    sh64*:Linux:*:*)
     977    echo ${UNAME_MACHINE}-unknown-linux-gnu
     978    exit ;;
    809979    sh*:Linux:*:*)
    810980    echo ${UNAME_MACHINE}-unknown-linux-gnu
    811     exit 0 ;;
     981    exit ;;
    812982    sparc:Linux:*:* | sparc64:Linux:*:*)
    813983    echo ${UNAME_MACHINE}-unknown-linux-gnu
    814     exit 0 ;;
     984    exit ;;
     985    tile*:Linux:*:*)
     986    echo ${UNAME_MACHINE}-unknown-linux-gnu
     987    exit ;;
     988    vax:Linux:*:*)
     989    echo ${UNAME_MACHINE}-dec-linux-gnu
     990    exit ;;
    815991    x86_64:Linux:*:*)
    816992    echo x86_64-unknown-linux-gnu
    817     exit 0 ;;
    818     i*86:Linux:*:*)
    819     # The BFD linker knows what the default object file format is, so
    820     # first see if it will tell us. cd to the root directory to prevent
    821     # problems with other programs or directories called `ld' in the path.
    822     ld_supported_targets=`cd /; ld --help 2>&1 \
    823              | sed -ne '/supported targets:/!d
    824                     s/[     ][  ]*/ /g
    825                     s/.*supported targets: *//
    826                     s/ .*//
    827                     p'`
    828         case "$ld_supported_targets" in
    829       elf32-i386)
    830         TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
    831         ;;
    832       a.out-i386-linux)
    833         echo "${UNAME_MACHINE}-pc-linux-gnuaout"
    834         exit 0 ;;       
    835       coff-i386)
    836         echo "${UNAME_MACHINE}-pc-linux-gnucoff"
    837         exit 0 ;;
    838       "")
    839         # Either a pre-BFD a.out linker (linux-gnuoldld) or
    840         # one that does not give us useful --help.
    841         echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
    842         exit 0 ;;
    843     esac
    844     # Determine whether the default compiler is a.out or elf
    845     cat >$dummy.c <<EOF
    846 #include <features.h>
    847 #ifdef __cplusplus
    848 #include <stdio.h>  /* for printf() prototype */
    849     int main (int argc, char *argv[]) {
    850 #else
    851     int main (argc, argv) int argc; char *argv[]; {
    852 #endif
    853 #ifdef __ELF__
    854 # ifdef __GLIBC__
    855 #  if __GLIBC__ >= 2
    856     printf ("%s-pc-linux-gnu\n", argv[1]);
    857 #  else
    858     printf ("%s-pc-linux-gnulibc1\n", argv[1]);
    859 #  endif
    860 # else
    861    printf ("%s-pc-linux-gnulibc1\n", argv[1]);
    862 # endif
    863 #else
    864   printf ("%s-pc-linux-gnuaout\n", argv[1]);
    865 #endif
    866   return 0;
    867 }
    868 EOF
    869     eval $set_cc_for_build
    870     $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm -f $dummy.c $dummy && exit 0
    871     rm -f $dummy.c $dummy
    872     test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
    873     ;;
     993    exit ;;
     994    xtensa*:Linux:*:*)
     995    echo ${UNAME_MACHINE}-unknown-linux-gnu
     996    exit ;;
    874997    i*86:DYNIX/ptx:4*:*)
    875998    # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
     
    8771000    # sysname and nodename.
    8781001    echo i386-sequent-sysv4
    879     exit 0 ;;
     1002    exit ;;
    8801003    i*86:UNIX_SV:4.2MP:2.*)
    881         # Unixware is an offshoot of SVR4, but it has its own version
    882         # number series starting with 2...
    883         # I am not positive that other SVR4 systems won't match this,
     1004    # Unixware is an offshoot of SVR4, but it has its own version
     1005    # number series starting with 2...
     1006    # I am not positive that other SVR4 systems won't match this,
    8841007    # I just have to hope.  -- rms.
    885         # Use sysv4.2uw... so that sysv4* matches it.
     1008    # Use sysv4.2uw... so that sysv4* matches it.
    8861009    echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
    887     exit 0 ;;
     1010    exit ;;
     1011    i*86:OS/2:*:*)
     1012    # If we were able to find `uname', then EMX Unix compatibility
     1013    # is probably installed.
     1014    echo ${UNAME_MACHINE}-pc-os2-emx
     1015    exit ;;
     1016    i*86:XTS-300:*:STOP)
     1017    echo ${UNAME_MACHINE}-unknown-stop
     1018    exit ;;
     1019    i*86:atheos:*:*)
     1020    echo ${UNAME_MACHINE}-unknown-atheos
     1021    exit ;;
     1022    i*86:syllable:*:*)
     1023    echo ${UNAME_MACHINE}-pc-syllable
     1024    exit ;;
     1025    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
     1026    echo i386-unknown-lynxos${UNAME_RELEASE}
     1027    exit ;;
     1028    i*86:*DOS:*:*)
     1029    echo ${UNAME_MACHINE}-pc-msdosdjgpp
     1030    exit ;;
    8881031    i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
    8891032    UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
     
    8931036        echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
    8941037    fi
    895     exit 0 ;;
    896     i*86:*:5:[78]*)
     1038    exit ;;
     1039    i*86:*:5:[678]*)
     1040    # UnixWare 7.x, OpenUNIX and OpenServer 6.
    8971041    case `/bin/uname -X | grep "^Machine"` in
    8981042        *486*)       UNAME_MACHINE=i486 ;;
     
    9011045    esac
    9021046    echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
    903     exit 0 ;;
     1047    exit ;;
    9041048    i*86:*:3.2:*)
    9051049    if test -f /usr/options/cb.name; then
     
    9071051        echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
    9081052    elif /bin/uname -X 2>/dev/null >/dev/null ; then
    909         UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')`
    910         (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
    911         (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \
     1053        UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
     1054        (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
     1055        (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
    9121056            && UNAME_MACHINE=i586
    913         (/bin/uname -X|egrep '^Machine.*Pent ?II' >/dev/null) \
     1057        (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
    9141058            && UNAME_MACHINE=i686
    915         (/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \
     1059        (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
    9161060            && UNAME_MACHINE=i686
    9171061        echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
     
    9191063        echo ${UNAME_MACHINE}-pc-sysv32
    9201064    fi
    921     exit 0 ;;
    922     i*86:*DOS:*:*)
    923     echo ${UNAME_MACHINE}-pc-msdosdjgpp
    924     exit 0 ;;
     1065    exit ;;
    9251066    pc:*:*:*)
    9261067    # Left here for compatibility:
    927         # uname -m prints for DJGPP always 'pc', but it prints nothing about
    928         # the processor, so we play safe by assuming i386.
    929     echo i386-pc-msdosdjgpp
    930         exit 0 ;;
     1068    # uname -m prints for DJGPP always 'pc', but it prints nothing about
     1069    # the processor, so we play safe by assuming i586.
     1070    # Note: whatever this is, it MUST be the same as what config.sub
     1071    # prints for the "djgpp" host, or else GDB configury will decide that
     1072    # this is a cross-build.
     1073    echo i586-pc-msdosdjgpp
     1074    exit ;;
    9311075    Intel:Mach:3*:*)
    9321076    echo i386-pc-mach3
    933     exit 0 ;;
     1077    exit ;;
    9341078    paragon:*:*:*)
    9351079    echo i860-intel-osf1
    936     exit 0 ;;
     1080    exit ;;
    9371081    i860:*:4.*:*) # i860-SVR4
    9381082    if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
     
    9411085      echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
    9421086    fi
    943     exit 0 ;;
     1087    exit ;;
    9441088    mini*:CTIX:SYS*5:*)
    9451089    # "miniframe"
    9461090    echo m68010-convergent-sysv
    947     exit 0 ;;
    948     M68*:*:R3V[567]*:*)
    949     test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
    950     3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0)
     1091    exit ;;
     1092    mc68k:UNIX:SYSTEM5:3.51m)
     1093    echo m68k-convergent-sysv
     1094    exit ;;
     1095    M680?0:D-NIX:5.3:*)
     1096    echo m68k-diab-dnix
     1097    exit ;;
     1098    M68*:*:R3V[5678]*:*)
     1099    test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
     1100    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)
    9511101    OS_REL=''
    9521102    test -r /etc/.relid \
    9531103    && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
    9541104    /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
    955       && echo i486-ncr-sysv4.3${OS_REL} && exit 0
     1105      && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
    9561106    /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
    957       && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;;
     1107      && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
    9581108    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
    959         /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
    960           && echo i486-ncr-sysv4 && exit 0 ;;
     1109    /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
     1110      && { echo i486-ncr-sysv4; exit; } ;;
     1111    NCR*:*:4.2:* | MPRAS*:*:4.2:*)
     1112    OS_REL='.3'
     1113    test -r /etc/.relid \
     1114        && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
     1115    /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
     1116        && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
     1117    /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
     1118        && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
     1119    /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
     1120        && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
    9611121    m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
    9621122    echo m68k-unknown-lynxos${UNAME_RELEASE}
    963     exit 0 ;;
     1123    exit ;;
    9641124    mc68030:UNIX_System_V:4.*:*)
    9651125    echo m68k-atari-sysv4
    966     exit 0 ;;
    967     i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
    968     echo i386-unknown-lynxos${UNAME_RELEASE}
    969     exit 0 ;;
     1126    exit ;;
    9701127    TSUNAMI:LynxOS:2.*:*)
    9711128    echo sparc-unknown-lynxos${UNAME_RELEASE}
    972     exit 0 ;;
     1129    exit ;;
    9731130    rs6000:LynxOS:2.*:*)
    9741131    echo rs6000-unknown-lynxos${UNAME_RELEASE}
    975     exit 0 ;;
    976     PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
     1132    exit ;;
     1133    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
    9771134    echo powerpc-unknown-lynxos${UNAME_RELEASE}
    978     exit 0 ;;
     1135    exit ;;
    9791136    SM[BE]S:UNIX_SV:*:*)
    9801137    echo mips-dde-sysv${UNAME_RELEASE}
    981     exit 0 ;;
     1138    exit ;;
    9821139    RM*:ReliantUNIX-*:*:*)
    9831140    echo mips-sni-sysv4
    984     exit 0 ;;
     1141    exit ;;
    9851142    RM*:SINIX-*:*:*)
    9861143    echo mips-sni-sysv4
    987     exit 0 ;;
     1144    exit ;;
    9881145    *:SINIX-*:*:*)
    9891146    if uname -p 2>/dev/null >/dev/null ; then
     
    9931150        echo ns32k-sni-sysv
    9941151    fi
    995     exit 0 ;;
    996     PENTIUM:CPunix:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
    997                            # says <[email protected]>
    998         echo i586-unisys-sysv4
    999         exit 0 ;;
     1152    exit ;;
     1153    PENTIUM:*:4.0*:*)   # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
     1154            # says <[email protected]>
     1155    echo i586-unisys-sysv4
     1156    exit ;;
    10001157    *:UNIX_System_V:4*:FTX*)
    10011158    # From Gerald Hewes <[email protected]>.
    10021159    # How about differentiating between stratus architectures? -djm
    10031160    echo hppa1.1-stratus-sysv4
    1004     exit 0 ;;
     1161    exit ;;
    10051162    *:*:*:FTX*)
    10061163    # From [email protected].
    10071164    echo i860-stratus-sysv4
    1008     exit 0 ;;
     1165    exit ;;
     1166    i*86:VOS:*:*)
     1167    # From [email protected].
     1168    echo ${UNAME_MACHINE}-stratus-vos
     1169    exit ;;
     1170    *:VOS:*:*)
     1171    # From [email protected].
     1172    echo hppa1.1-stratus-vos
     1173    exit ;;
    10091174    mc68*:A/UX:*:*)
    10101175    echo m68k-apple-aux${UNAME_RELEASE}
    1011     exit 0 ;;
     1176    exit ;;
    10121177    news*:NEWS-OS:6*:*)
    10131178    echo mips-sony-newsos6
    1014     exit 0 ;;
     1179    exit ;;
    10151180    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
    10161181    if [ -d /usr/nec ]; then
    1017             echo mips-nec-sysv${UNAME_RELEASE}
     1182        echo mips-nec-sysv${UNAME_RELEASE}
    10181183    else
    1019             echo mips-unknown-sysv${UNAME_RELEASE}
    1020     fi
    1021         exit 0 ;;
     1184        echo mips-unknown-sysv${UNAME_RELEASE}
     1185    fi
     1186    exit ;;
    10221187    BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
    10231188    echo powerpc-be-beos
    1024     exit 0 ;;
     1189    exit ;;
    10251190    BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
    10261191    echo powerpc-apple-beos
    1027     exit 0 ;;
     1192    exit ;;
    10281193    BePC:BeOS:*:*)  # BeOS running on Intel PC compatible.
    10291194    echo i586-pc-beos
    1030     exit 0 ;;
     1195    exit ;;
     1196    BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
     1197    echo i586-pc-haiku
     1198    exit ;;
    10311199    SX-4:SUPER-UX:*:*)
    10321200    echo sx4-nec-superux${UNAME_RELEASE}
    1033     exit 0 ;;
     1201    exit ;;
    10341202    SX-5:SUPER-UX:*:*)
    10351203    echo sx5-nec-superux${UNAME_RELEASE}
    1036     exit 0 ;;
     1204    exit ;;
     1205    SX-6:SUPER-UX:*:*)
     1206    echo sx6-nec-superux${UNAME_RELEASE}
     1207    exit ;;
     1208    SX-7:SUPER-UX:*:*)
     1209    echo sx7-nec-superux${UNAME_RELEASE}
     1210    exit ;;
     1211    SX-8:SUPER-UX:*:*)
     1212    echo sx8-nec-superux${UNAME_RELEASE}
     1213    exit ;;
     1214    SX-8R:SUPER-UX:*:*)
     1215    echo sx8r-nec-superux${UNAME_RELEASE}
     1216    exit ;;
    10371217    Power*:Rhapsody:*:*)
    10381218    echo powerpc-apple-rhapsody${UNAME_RELEASE}
    1039     exit 0 ;;
     1219    exit ;;
    10401220    *:Rhapsody:*:*)
    10411221    echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
    1042     exit 0 ;;
     1222    exit ;;
    10431223    *:Darwin:*:*)
    1044     echo `uname -p`-apple-darwin${UNAME_RELEASE}
    1045     exit 0 ;;
     1224    UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
     1225    case $UNAME_PROCESSOR in
     1226        i386)
     1227        eval $set_cc_for_build
     1228        if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
     1229          if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
     1230              (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
     1231              grep IS_64BIT_ARCH >/dev/null
     1232          then
     1233              UNAME_PROCESSOR="x86_64"
     1234          fi
     1235        fi ;;
     1236        unknown) UNAME_PROCESSOR=powerpc ;;
     1237    esac
     1238    echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
     1239    exit ;;
    10461240    *:procnto*:*:* | *:QNX:[0123456789]*:*)
    1047     if test "${UNAME_MACHINE}" = "x86pc"; then
     1241    UNAME_PROCESSOR=`uname -p`
     1242    if test "$UNAME_PROCESSOR" = "x86"; then
     1243        UNAME_PROCESSOR=i386
    10481244        UNAME_MACHINE=pc
    10491245    fi
    1050     echo `uname -p`-${UNAME_MACHINE}-nto-qnx
    1051     exit 0 ;;
     1246    echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
     1247    exit ;;
    10521248    *:QNX:*:4*)
    10531249    echo i386-pc-qnx
    1054     exit 0 ;;
    1055     NSR-[KW]:NONSTOP_KERNEL:*:*)
     1250    exit ;;
     1251    NEO-?:NONSTOP_KERNEL:*:*)
     1252    echo neo-tandem-nsk${UNAME_RELEASE}
     1253    exit ;;
     1254    NSE-?:NONSTOP_KERNEL:*:*)
     1255    echo nse-tandem-nsk${UNAME_RELEASE}
     1256    exit ;;
     1257    NSR-?:NONSTOP_KERNEL:*:*)
    10561258    echo nsr-tandem-nsk${UNAME_RELEASE}
    1057     exit 0 ;;
     1259    exit ;;
    10581260    *:NonStop-UX:*:*)
    10591261    echo mips-compaq-nonstopux
    1060     exit 0 ;;
     1262    exit ;;
    10611263    BS2000:POSIX*:*:*)
    10621264    echo bs2000-siemens-sysv
    1063     exit 0 ;;
     1265    exit ;;
    10641266    DS/*:UNIX_System_V:*:*)
    10651267    echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
    1066     exit 0 ;;
     1268    exit ;;
    10671269    *:Plan9:*:*)
    10681270    # "uname -m" is not consistent, so use $cputype instead. 386
     
    10751277    fi
    10761278    echo ${UNAME_MACHINE}-unknown-plan9
    1077     exit 0 ;;
    1078     i*86:OS/2:*:*)
    1079     # If we were able to find `uname', then EMX Unix compatibility
    1080     # is probably installed.
    1081     echo ${UNAME_MACHINE}-pc-os2-emx
    1082     exit 0 ;;
     1279    exit ;;
    10831280    *:TOPS-10:*:*)
    10841281    echo pdp10-unknown-tops10
    1085     exit 0 ;;
     1282    exit ;;
    10861283    *:TENEX:*:*)
    10871284    echo pdp10-unknown-tenex
    1088     exit 0 ;;
     1285    exit ;;
    10891286    KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
    10901287    echo pdp10-dec-tops20
    1091     exit 0 ;;
     1288    exit ;;
    10921289    XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
    10931290    echo pdp10-xkl-tops20
    1094     exit 0 ;;
     1291    exit ;;
    10951292    *:TOPS-20:*:*)
    10961293    echo pdp10-unknown-tops20
    1097     exit 0 ;;
     1294    exit ;;
    10981295    *:ITS:*:*)
    10991296    echo pdp10-unknown-its
    1100     exit 0 ;;
     1297    exit ;;
     1298    SEI:*:*:SEIUX)
     1299    echo mips-sei-seiux${UNAME_RELEASE}
     1300    exit ;;
     1301    *:DragonFly:*:*)
     1302    echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
     1303    exit ;;
     1304    *:*VMS:*:*)
     1305    UNAME_MACHINE=`(uname -p) 2>/dev/null`
     1306    case "${UNAME_MACHINE}" in
     1307        A*) echo alpha-dec-vms ; exit ;;
     1308        I*) echo ia64-dec-vms ; exit ;;
     1309        V*) echo vax-dec-vms ; exit ;;
     1310    esac ;;
     1311    *:XENIX:*:SysV)
     1312    echo i386-pc-xenix
     1313    exit ;;
     1314    i*86:skyos:*:*)
     1315    echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
     1316    exit ;;
     1317    i*86:rdos:*:*)
     1318    echo ${UNAME_MACHINE}-pc-rdos
     1319    exit ;;
     1320    i*86:AROS:*:*)
     1321    echo ${UNAME_MACHINE}-pc-aros
     1322    exit ;;
    11011323esac
    11021324
     
    11041326#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
    11051327
     1328eval $set_cc_for_build
    11061329cat >$dummy.c <<EOF
    11071330#ifdef _SEQUENT_
     
    11201343  printf ("m68k-sony-newsos%s\n",
    11211344#ifdef NEWSOS4
    1122           "4"
     1345    "4"
    11231346#else
    1124       ""
    1125 #endif
    1126          ); exit (0);
     1347    ""
     1348#endif
     1349    ); exit (0);
    11271350#endif
    11281351#endif
    11291352
    11301353#if defined (__arm) && defined (__acorn) && defined (__unix)
    1131   printf ("arm-acorn-riscix"); exit (0);
     1354  printf ("arm-acorn-riscix\n"); exit (0);
    11321355#endif
    11331356
     
    12181441EOF
    12191442
    1220 eval $set_cc_for_build
    1221 $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm -f $dummy.c $dummy && exit 0
    1222 rm -f $dummy.c $dummy
     1443$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
     1444    { echo "$SYSTEM_NAME"; exit; }
    12231445
    12241446# Apollos put the system type in the environment.
    12251447
    1226 test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; }
     1448test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
    12271449
    12281450# Convex versions that predate uname can use getsysinfo(1)
     
    12331455    c1*)
    12341456    echo c1-convex-bsd
    1235     exit 0 ;;
     1457    exit ;;
    12361458    c2*)
    12371459    if getsysinfo -f scalar_acc
     
    12391461    else echo c2-convex-bsd
    12401462    fi
    1241     exit 0 ;;
     1463    exit ;;
    12421464    c34*)
    12431465    echo c34-convex-bsd
    1244     exit 0 ;;
     1466    exit ;;
    12451467    c38*)
    12461468    echo c38-convex-bsd
    1247     exit 0 ;;
     1469    exit ;;
    12481470    c4*)
    12491471    echo c4-convex-bsd
    1250     exit 0 ;;
     1472    exit ;;
    12511473    esac
    12521474fi
     
    12591481download the most up to date version of the config scripts from
    12601482
    1261     ftp://ftp.gnu.org/pub/gnu/config/
     1483  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
     1484and
     1485  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
    12621486
    12631487If the version you run ($0) is already up to date, please
Note: See TracChangeset for help on using the changeset viewer.