Changeset 26793


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

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

Location:
main/trunk/greenstone2/common-src
Files:
8 edited

Legend:

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

    r19872 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 <bothner@cygnus.com>.
    28 # Please send patches to <config-patches@gnu.org>.
     29
     30# Originally written by Per Bothner.  Please send patches (context
     31# diff format) to <config-patches@gnu.org> 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    # akee@wpdis03.wpafb.af.mil (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 <Richard.M.Bartel@ccMail.Census.GOV>
    998         echo i586-unisys-sysv4
    999         exit 0 ;;
     1152    exit ;;
     1153    PENTIUM:*:4.0*:*)   # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
     1154            # says <Richard.M.Bartel@ccMail.Census.GOV>
     1155    echo i586-unisys-sysv4
     1156    exit ;;
    10001157    *:UNIX_System_V:4*:FTX*)
    10011158    # From Gerald Hewes <hewes@openmarket.com>.
    10021159    # How about differentiating between stratus architectures? -djm
    10031160    echo hppa1.1-stratus-sysv4
    1004     exit 0 ;;
     1161    exit ;;
    10051162    *:*:*:FTX*)
    10061163    # From seanf@swdc.stratus.com.
    10071164    echo i860-stratus-sysv4
    1008     exit 0 ;;
     1165    exit ;;
     1166    i*86:VOS:*:*)
     1167    # From Paul.Green@stratus.com.
     1168    echo ${UNAME_MACHINE}-stratus-vos
     1169    exit ;;
     1170    *:VOS:*:*)
     1171    # From Paul.Green@stratus.com.
     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
  • main/trunk/greenstone2/common-src/config.sub

    r19872 r26793  
    11#! /bin/sh
    22# Configuration validation subroutine script.
    3 #   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
    4 #   Free Software Foundation, Inc.
    5 
    6 timestamp='2001-06-08'
     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 (in principle) common to ALL GNU software.
     
    2223# You should have received a copy of the GNU General Public License
    2324# along with this program; if not, write to the Free Software
    24 # Foundation, Inc., 59 Temple Place - Suite 330,
    25 # Boston, MA 02111-1307, USA.
    26 
     25# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
     26# 02110-1301, USA.
     27#
    2728# As a special exception to the GNU General Public License, if you
    2829# distribute this file as part of a program that contains a
     
    3031# the same distribution terms that you use for the rest of that program.
    3132
    32 # Please send patches to <config-patches@gnu.org>.
     33
     34# Please send patches to <config-patches@gnu.org>.  Submit a context
     35# diff and a properly formatted GNU ChangeLog entry.
    3336#
    3437# Configuration subroutine to validate and canonicalize a configuration type.
     
    3639# If it is invalid, we print an error message on stderr and exit with code 1.
    3740# Otherwise, we print the canonical config type on stdout and succeed.
     41
     42# You can get the latest version of this script from:
     43# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
    3844
    3945# This file is supposed to be the same for all GNU packages
     
    7076GNU config.sub ($timestamp)
    7177
    72 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
    73 Free Software Foundation, Inc.
     78Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
     792001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free
     80Software Foundation, Inc.
    7481
    7582This is free software; see the source for copying conditions.  There is NO
     
    8390  case $1 in
    8491    --time-stamp | --time* | -t )
    85        echo "$timestamp" ; exit 0 ;;
     92       echo "$timestamp" ; exit ;;
    8693    --version | -v )
    87        echo "$version" ; exit 0 ;;
     94       echo "$version" ; exit ;;
    8895    --help | --h* | -h )
    89        echo "$usage"; exit 0 ;;
     96       echo "$usage"; exit ;;
    9097    -- )     # Stop option processing
    9198       shift; break ;;
     
    99106       # First pass through any local machine types.
    100107       echo $1
    101        exit 0;;
     108       exit ;;
    102109
    103110    * )
     
    118125maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
    119126case $maybe_os in
    120   nto-qnx* | linux-gnu* | storm-chaos* | os2-emx* | windows32-*)
     127  nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
     128  linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
     129  knetbsd*-gnu* | netbsd*-gnu* | \
     130  kopensolaris*-gnu* | \
     131  storm-chaos* | os2-emx* | rtmk-nova*)
    121132    os=-$maybe_os
    122133    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
     
    144155    -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
    145156    -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
    146     -apple | -axis)
     157    -apple | -axis | -knuth | -cray | -microblaze)
    147158        os=
    148159        basic_machine=$1
     160        ;;
     161    -bluegene*)
     162        os=-cnk
    149163        ;;
    150164    -sim | -cisco | -oki | -wec | -winbond)
     
    162176        basic_machine=$1
    163177        ;;
    164     -chorusrdb)
    165         os=-chorusrdb
     178    -chorusrdb)
     179        os=-chorusrdb
    166180        basic_machine=$1
    167         ;;
     181        ;;
    168182    -hiux*)
    169183        os=-hiuxwe2
     184        ;;
     185    -sco6)
     186        os=-sco5v6
     187        basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
    170188        ;;
    171189    -sco5)
     
    182200        ;;
    183201    -sco3.2v[4-9]*)
     202        # Don't forget version if it is 3.2v4 or newer.
     203        basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
     204        ;;
     205    -sco5v6*)
    184206        # Don't forget version if it is 3.2v4 or newer.
    185207        basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
     
    224246    # Recognize the basic CPU types without company name.
    225247    # Some are omitted here because they have special meanings below.
    226     tahoe | i860 | ia64 | m32r | m68k | m68000 | m88k | ns32k | arc \
    227             | arm | arme[lb] | arm[bl]e | armv[2345] | armv[345][lb] | strongarm | xscale \
    228         | pyramid | mn10200 | mn10300 | tron | a29k \
    229         | 580 | i960 | h8300 \
    230         | x86 | ppcbe | mipsbe | mipsle | shbe | shle \
    231         | hppa | hppa1.0 | hppa1.1 | hppa2.0 | hppa2.0w | hppa2.0n \
    232         | hppa64 \
    233         | alpha | alphaev[4-8] | alphaev56 | alphapca5[67] \
    234         | alphaev6[78] \
    235         | we32k | ns16k | clipper | i370 | sh | sh[34] \
    236         | powerpc | powerpcle \
    237         | 1750a | dsp16xx | pdp10 | pdp11 \
    238         | mips16 | mips64 | mipsel | mips64el \
    239         | mips64orion | mips64orionel | mipstx39 | mipstx39el \
    240         | mips64vr4300 | mips64vr4300el | mips64vr4100 | mips64vr4100el \
    241         | mips64vr5000 | mips64vr5000el | mcore | s390 | s390x \
    242         | sparc | sparclet | sparclite | sparc64 | sparcv9 | sparcv9b \
    243         | v850 | c4x \
    244         | thumb | d10v | d30v | fr30 | avr | openrisc | tic80 \
    245         | pj | pjl | h8500 | z8k)
     248    1750a | 580 \
     249    | a29k \
     250    | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
     251    | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
     252    | am33_2.0 \
     253    | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
     254        | be32 | be64 \
     255    | bfin \
     256    | c4x | clipper \
     257    | d10v | d30v | dlx | dsp16xx \
     258    | epiphany \
     259    | fido | fr30 | frv \
     260    | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
     261    | hexagon \
     262    | i370 | i860 | i960 | ia64 \
     263    | ip2k | iq2000 \
     264    | le32 | le64 \
     265    | lm32 \
     266    | m32c | m32r | m32rle | m68000 | m68k | m88k \
     267    | maxq | mb | microblaze | mcore | mep | metag \
     268    | mips | mipsbe | mipseb | mipsel | mipsle \
     269    | mips16 \
     270    | mips64 | mips64el \
     271    | mips64octeon | mips64octeonel \
     272    | mips64orion | mips64orionel \
     273    | mips64r5900 | mips64r5900el \
     274    | mips64vr | mips64vrel \
     275    | mips64vr4100 | mips64vr4100el \
     276    | mips64vr4300 | mips64vr4300el \
     277    | mips64vr5000 | mips64vr5000el \
     278    | mips64vr5900 | mips64vr5900el \
     279    | mipsisa32 | mipsisa32el \
     280    | mipsisa32r2 | mipsisa32r2el \
     281    | mipsisa64 | mipsisa64el \
     282    | mipsisa64r2 | mipsisa64r2el \
     283    | mipsisa64sb1 | mipsisa64sb1el \
     284    | mipsisa64sr71k | mipsisa64sr71kel \
     285    | mipstx39 | mipstx39el \
     286    | mn10200 | mn10300 \
     287    | moxie \
     288    | mt \
     289    | msp430 \
     290    | nds32 | nds32le | nds32be \
     291    | nios | nios2 \
     292    | ns16k | ns32k \
     293    | open8 \
     294    | or32 \
     295    | pdp10 | pdp11 | pj | pjl \
     296    | powerpc | powerpc64 | powerpc64le | powerpcle \
     297    | pyramid \
     298    | rl78 | rx \
     299    | score \
     300    | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
     301    | sh64 | sh64le \
     302    | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
     303    | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
     304    | spu \
     305    | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
     306    | ubicom32 \
     307    | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
     308    | we32k \
     309    | x86 | xc16x | xstormy16 | xtensa \
     310    | z8k | z80)
    246311        basic_machine=$basic_machine-unknown
    247312        ;;
    248     m6811 | m68hc11 | m6812 | m68hc12)
     313    c54x)
     314        basic_machine=tic54x-unknown
     315        ;;
     316    c55x)
     317        basic_machine=tic55x-unknown
     318        ;;
     319    c6x)
     320        basic_machine=tic6x-unknown
     321        ;;
     322    m6811 | m68hc11 | m6812 | m68hc12 | picochip)
    249323        # Motorola 68HC11/12.
    250324        basic_machine=$basic_machine-unknown
     
    252326        ;;
    253327    m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
     328        ;;
     329    ms1)
     330        basic_machine=mt-unknown
     331        ;;
     332
     333    strongarm | thumb | xscale)
     334        basic_machine=arm-unknown
     335        ;;
     336
     337    xscaleeb)
     338        basic_machine=armeb-unknown
     339        ;;
     340
     341    xscaleel)
     342        basic_machine=armel-unknown
    254343        ;;
    255344
     
    266355        ;;
    267356    # Recognize the basic CPU types with company name.
    268     # FIXME: clean up the formatting here.
    269     vax-* | tahoe-* | i*86-* | i860-* | ia64-* | m32r-* | m68k-* | m68000-* \
    270           | m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | c[123]* \
    271           | arm-*  | armbe-* | armle-* | armv*-* | strongarm-* | xscale-* \
    272           | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \
    273           | power-* | none-* | 580-* | cray2-* | h8300-* | h8500-* | i960-* \
    274           | xmp-* | ymp-* \
    275           | x86-* | ppcbe-* | mipsbe-* | mipsle-* | shbe-* | shle-* \
    276           | hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* | hppa2.0w-* \
    277           | hppa2.0n-* | hppa64-* \
    278           | alpha-* | alphaev[4-8]-* | alphaev56-* | alphapca5[67]-* \
    279           | alphaev6[78]-* \
    280           | we32k-* | cydra-* | ns16k-* | pn-* | np1-* | xps100-* \
    281           | clipper-* | orion-* \
    282           | sparclite-* | pdp10-* | pdp11-* | sh-* | sh[34]-* | sh[34]eb-* \
    283           | powerpc-* | powerpcle-* | sparc64-* | sparcv9-* | sparcv9b-* | sparc86x-* \
    284           | mips16-* | mips64-* | mipsel-* \
    285           | mips64el-* | mips64orion-* | mips64orionel-* \
    286           | mips64vr4100-* | mips64vr4100el-* | mips64vr4300-* | mips64vr4300el-* \
    287           | mipstx39-* | mipstx39el-* | mcore-* \
    288           | f30[01]-* | f700-* | s390-* | s390x-* | sv1-* | t3e-* \
    289           | [cjt]90-* \
    290           | m88110-* | m680[01234]0-* | m683?2-* | m68360-* | z8k-* | d10v-* \
    291           | thumb-* | v850-* | d30v-* | tic30-* | tic80-* | c30-* | fr30-* \
    292           | bs2000-* | tic54x-* | c54x-* | x86_64-* | pj-* | pjl-*)
     357    580-* \
     358    | a29k-* \
     359    | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
     360    | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
     361    | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
     362    | arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
     363    | avr-* | avr32-* \
     364    | be32-* | be64-* \
     365    | bfin-* | bs2000-* \
     366    | c[123]* | c30-* | [cjt]90-* | c4x-* \
     367    | clipper-* | craynv-* | cydra-* \
     368    | d10v-* | d30v-* | dlx-* \
     369    | elxsi-* \
     370    | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
     371    | h8300-* | h8500-* \
     372    | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
     373    | hexagon-* \
     374    | i*86-* | i860-* | i960-* | ia64-* \
     375    | ip2k-* | iq2000-* \
     376    | le32-* | le64-* \
     377    | lm32-* \
     378    | m32c-* | m32r-* | m32rle-* \
     379    | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
     380    | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \
     381    | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
     382    | mips16-* \
     383    | mips64-* | mips64el-* \
     384    | mips64octeon-* | mips64octeonel-* \
     385    | mips64orion-* | mips64orionel-* \
     386    | mips64r5900-* | mips64r5900el-* \
     387    | mips64vr-* | mips64vrel-* \
     388    | mips64vr4100-* | mips64vr4100el-* \
     389    | mips64vr4300-* | mips64vr4300el-* \
     390    | mips64vr5000-* | mips64vr5000el-* \
     391    | mips64vr5900-* | mips64vr5900el-* \
     392    | mipsisa32-* | mipsisa32el-* \
     393    | mipsisa32r2-* | mipsisa32r2el-* \
     394    | mipsisa64-* | mipsisa64el-* \
     395    | mipsisa64r2-* | mipsisa64r2el-* \
     396    | mipsisa64sb1-* | mipsisa64sb1el-* \
     397    | mipsisa64sr71k-* | mipsisa64sr71kel-* \
     398    | mipstx39-* | mipstx39el-* \
     399    | mmix-* \
     400    | mt-* \
     401    | msp430-* \
     402    | nds32-* | nds32le-* | nds32be-* \
     403    | nios-* | nios2-* \
     404    | none-* | np1-* | ns16k-* | ns32k-* \
     405    | open8-* \
     406    | orion-* \
     407    | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
     408    | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
     409    | pyramid-* \
     410    | rl78-* | romp-* | rs6000-* | rx-* \
     411    | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
     412    | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
     413    | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
     414    | sparclite-* \
     415    | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \
     416    | tahoe-* \
     417    | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
     418    | tile*-* \
     419    | tron-* \
     420    | ubicom32-* \
     421    | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
     422    | vax-* \
     423    | we32k-* \
     424    | x86-* | x86_64-* | xc16x-* | xps100-* \
     425    | xstormy16-* | xtensa*-* \
     426    | ymp-* \
     427    | z8k-* | z80-*)
     428        ;;
     429    # Recognize the basic CPU types without company name, with glob match.
     430    xtensa*)
     431        basic_machine=$basic_machine-unknown
    293432        ;;
    294433    # Recognize the various machine names and aliases which stand
     
    308447        os=-udi
    309448        ;;
     449    abacus)
     450        basic_machine=abacus-unknown
     451        ;;
    310452    adobe68k)
    311453        basic_machine=m68010-adobe
     
    322464        os=-bsd
    323465        ;;
     466    amd64)
     467        basic_machine=x86_64-pc
     468        ;;
     469    amd64-*)
     470        basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
     471        ;;
    324472    amdahl)
    325473        basic_machine=580-amdahl
     
    345493        os=-bsd
    346494        ;;
     495    aros)
     496        basic_machine=i386-pc
     497        os=-aros
     498        ;;
    347499    aux)
    348500        basic_machine=m68k-apple
     
    353505        os=-dynix
    354506        ;;
     507    blackfin)
     508        basic_machine=bfin-unknown
     509        os=-linux
     510        ;;
     511    blackfin-*)
     512        basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
     513        os=-linux
     514        ;;
     515    bluegene*)
     516        basic_machine=powerpc-ibm
     517        os=-cnk
     518        ;;
     519    c54x-*)
     520        basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
     521        ;;
     522    c55x-*)
     523        basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
     524        ;;
     525    c6x-*)
     526        basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
     527        ;;
     528    c90)
     529        basic_machine=c90-cray
     530        os=-unicos
     531        ;;
     532    cegcc)
     533        basic_machine=arm-unknown
     534        os=-cegcc
     535        ;;
    355536    convex-c1)
    356537        basic_machine=c1-convex
     
    373554        os=-bsd
    374555        ;;
    375     cray | ymp)
    376         basic_machine=ymp-cray
     556    cray | j90)
     557        basic_machine=j90-cray
    377558        os=-unicos
    378559        ;;
    379     cray2)
    380         basic_machine=cray2-cray
    381         os=-unicos
    382         ;;
    383     [cjt]90)
    384         basic_machine=${basic_machine}-cray
    385         os=-unicos
     560    craynv)
     561        basic_machine=craynv-cray
     562        os=-unicosmp
     563        ;;
     564    cr16 | cr16-*)
     565        basic_machine=cr16-unknown
     566        os=-elf
    386567        ;;
    387568    crds | unos)
    388569        basic_machine=m68k-crds
    389570        ;;
     571    crisv32 | crisv32-* | etraxfs*)
     572        basic_machine=crisv32-axis
     573        ;;
    390574    cris | cris-* | etrax*)
    391575        basic_machine=cris-axis
    392576        ;;
     577    crx)
     578        basic_machine=crx-unknown
     579        os=-elf
     580        ;;
    393581    da30 | da30-*)
    394582        basic_machine=m68k-da30
     
    396584    decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
    397585        basic_machine=mips-dec
     586        ;;
     587    decsystem10* | dec10*)
     588        basic_machine=pdp10-dec
     589        os=-tops10
     590        ;;
     591    decsystem20* | dec20*)
     592        basic_machine=pdp10-dec
     593        os=-tops20
    398594        ;;
    399595    delta | 3300 | motorola-3300 | motorola-delta \
     
    404600        basic_machine=m88k-motorola
    405601        os=-sysv3
     602        ;;
     603    dicos)
     604        basic_machine=i686-pc
     605        os=-dicos
     606        ;;
     607    djgpp)
     608        basic_machine=i586-pc
     609        os=-msdosdjgpp
    406610        ;;
    407611    dpx20 | dpx20-*)
     
    555759        os=-sysv
    556760        ;;
     761    m68knommu)
     762        basic_machine=m68k-unknown
     763        os=-linux
     764        ;;
     765    m68knommu-*)
     766        basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
     767        os=-linux
     768        ;;
    557769    m88k-omron*)
    558770        basic_machine=m88k-omron
     
    566778        os=-sysv
    567779        ;;
     780    microblaze)
     781        basic_machine=microblaze-xilinx
     782        ;;
    568783    mingw32)
    569784        basic_machine=i386-pc
    570785        os=-mingw32
    571786        ;;
     787    mingw32ce)
     788        basic_machine=arm-unknown
     789        os=-mingw32ce
     790        ;;
    572791    miniframe)
    573792        basic_machine=m68000-convergent
     
    577796        os=-mint
    578797        ;;
    579     mipsel*-linux*)
    580         basic_machine=mipsel-unknown
    581         os=-linux-gnu
    582         ;;
    583     mips*-linux*)
    584         basic_machine=mips-unknown
    585         os=-linux-gnu
    586         ;;
    587798    mips3*-*)
    588799        basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
     
    590801    mips3*)
    591802        basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
    592         ;;
    593     mmix*)
    594         basic_machine=mmix-knuth
    595         os=-mmixware
    596803        ;;
    597804    monitor)
     
    599806        os=-coff
    600807        ;;
     808    morphos)
     809        basic_machine=powerpc-unknown
     810        os=-morphos
     811        ;;
    601812    msdos)
    602813        basic_machine=i386-pc
    603814        os=-msdos
    604815        ;;
     816    ms1-*)
     817        basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
     818        ;;
     819    msys)
     820        basic_machine=i386-pc
     821        os=-msys
     822        ;;
    605823    mvs)
    606824        basic_machine=i370-ibm
    607825        os=-mvs
     826        ;;
     827    nacl)
     828        basic_machine=le32-unknown
     829        os=-nacl
    608830        ;;
    609831    ncr3000)
     
    671893        basic_machine=np1-gould
    672894        ;;
     895    neo-tandem)
     896        basic_machine=neo-tandem
     897        ;;
     898    nse-tandem)
     899        basic_machine=nse-tandem
     900        ;;
    673901    nsr-tandem)
    674902        basic_machine=nsr-tandem
     
    678906        os=-proelf
    679907        ;;
     908    openrisc | openrisc-*)
     909        basic_machine=or32-unknown
     910        ;;
     911    os400)
     912        basic_machine=powerpc-ibm
     913        os=-os400
     914        ;;
    680915    OSE68000 | ose68000)
    681916        basic_machine=m68000-ericsson
     
    694929        os=-osf
    695930        ;;
     931    parisc)
     932        basic_machine=hppa-unknown
     933        os=-linux
     934        ;;
     935    parisc-*)
     936        basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
     937        os=-linux
     938        ;;
    696939    pbd)
    697940        basic_machine=sparc-tti
     
    700943        basic_machine=m68k-tti
    701944        ;;
    702         pc532 | pc532-*)
     945    pc532 | pc532-*)
    703946        basic_machine=ns32k-pc532
    704947        ;;
    705     pentium | p5 | k5 | k6 | nexgen)
     948    pc98)
     949        basic_machine=i386-pc
     950        ;;
     951    pc98-*)
     952        basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
     953        ;;
     954    pentium | p5 | k5 | k6 | nexgen | viac3)
    706955        basic_machine=i586-pc
    707956        ;;
    708     pentiumpro | p6 | 6x86 | athlon)
     957    pentiumpro | p6 | 6x86 | athlon | athlon_*)
    709958        basic_machine=i686-pc
    710959        ;;
    711     pentiumii | pentium2)
     960    pentiumii | pentium2 | pentiumiii | pentium3)
    712961        basic_machine=i686-pc
    713962        ;;
    714     pentium-* | p5-* | k5-* | k6-* | nexgen-*)
     963    pentium4)
     964        basic_machine=i786-pc
     965        ;;
     966    pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
    715967        basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
    716968        ;;
     
    718970        basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
    719971        ;;
    720     pentiumii-* | pentium2-*)
     972    pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
    721973        basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
     974        ;;
     975    pentium4-*)
     976        basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
    722977        ;;
    723978    pn)
     
    726981    power)  basic_machine=power-ibm
    727982        ;;
    728     ppc)    basic_machine=powerpc-unknown
    729             ;;
    730     ppc-*)  basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
     983    ppc | ppcbe)    basic_machine=powerpc-unknown
     984        ;;
     985    ppc-* | ppcbe-*)
     986        basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
    731987        ;;
    732988    ppcle | powerpclittle | ppc-le | powerpc-little)
    733989        basic_machine=powerpcle-unknown
    734             ;;
     990        ;;
    735991    ppcle-* | powerpclittle-*)
    736992        basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
     993        ;;
     994    ppc64)  basic_machine=powerpc64-unknown
     995        ;;
     996    ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
     997        ;;
     998    ppc64le | powerpc64little | ppc64-le | powerpc64-little)
     999        basic_machine=powerpc64le-unknown
     1000        ;;
     1001    ppc64le-* | powerpc64little-*)
     1002        basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
    7371003        ;;
    7381004    ps2)
     
    7431009        os=-pw32
    7441010        ;;
     1011    rdos)
     1012        basic_machine=i386-pc
     1013        os=-rdos
     1014        ;;
    7451015    rom68k)
    7461016        basic_machine=m68k-rom68k
     
    7531023        basic_machine=romp-ibm
    7541024        ;;
     1025    s390 | s390-*)
     1026        basic_machine=s390-ibm
     1027        ;;
     1028    s390x | s390x-*)
     1029        basic_machine=s390x-ibm
     1030        ;;
    7551031    sa29200)
    7561032        basic_machine=a29k-amd
    7571033        os=-udi
    7581034        ;;
     1035    sb1)
     1036        basic_machine=mipsisa64sb1-unknown
     1037        ;;
     1038    sb1el)
     1039        basic_machine=mipsisa64sb1el-unknown
     1040        ;;
     1041    sde)
     1042        basic_machine=mipsisa32-sde
     1043        os=-elf
     1044        ;;
     1045    sei)
     1046        basic_machine=mips-sei
     1047        os=-seiux
     1048        ;;
    7591049    sequent)
    7601050        basic_machine=i386-sequent
     
    7641054        os=-hms
    7651055        ;;
    766     sparclite-wrs)
     1056    sh5el)
     1057        basic_machine=sh5le-unknown
     1058        ;;
     1059    sh64)
     1060        basic_machine=sh64-unknown
     1061        ;;
     1062    sparclite-wrs | simso-wrs)
    7671063        basic_machine=sparclite-wrs
    7681064        os=-vxworks
     
    7821078        os=-sysv4
    7831079        ;;
     1080    strongarm-* | thumb-*)
     1081        basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
     1082        ;;
    7841083    sun2)
    7851084        basic_machine=m68000-sun
     
    8311130        ;;
    8321131    t3e)
    833         basic_machine=t3e-cray
     1132        basic_machine=alphaev5-cray
    8341133        os=-unicos
    8351134        ;;
    836     tic54x | c54x*)
    837         basic_machine=tic54x-unknown
    838         os=-coff
     1135    t90)
     1136        basic_machine=t90-cray
     1137        os=-unicos
     1138        ;;
     1139    tile*)
     1140        basic_machine=$basic_machine-unknown
     1141        os=-linux-gnu
    8391142        ;;
    8401143    tx39)
     
    8441147        basic_machine=mipstx39el-unknown
    8451148        ;;
     1149    toad1)
     1150        basic_machine=pdp10-xkl
     1151        os=-tops20
     1152        ;;
    8461153    tower | tower-32)
    8471154        basic_machine=m68k-ncr
     1155        ;;
     1156    tpf)
     1157        basic_machine=s390x-ibm
     1158        os=-tpf
    8481159        ;;
    8491160    udi29k)
     
    8681179        ;;
    8691180    vpp*|vx|vx-*)
    870                basic_machine=f301-fujitsu
    871                ;;
     1181        basic_machine=f301-fujitsu
     1182        ;;
    8721183    vxworks960)
    8731184        basic_machine=i960-wrs
     
    8901201        os=-proelf
    8911202        ;;
    892     windows32)
    893         basic_machine=i386-pc
    894         os=-windows32-msvcrt
    895         ;;
    896     xmp)
    897         basic_machine=xmp-cray
     1203    xbox)
     1204        basic_machine=i686-pc
     1205        os=-mingw32
     1206        ;;
     1207    xps | xps100)
     1208        basic_machine=xps100-honeywell
     1209        ;;
     1210    xscale-* | xscalee[bl]-*)
     1211        basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
     1212        ;;
     1213    ymp)
     1214        basic_machine=ymp-cray
    8981215        os=-unicos
    899         ;;
    900         xps | xps100)
    901         basic_machine=xps100-honeywell
    9021216        ;;
    9031217    z8k-*-coff)
    9041218        basic_machine=z8k-unknown
     1219        os=-sim
     1220        ;;
     1221    z80-*-coff)
     1222        basic_machine=z80-unknown
    9051223        os=-sim
    9061224        ;;
     
    9211239        basic_machine=hppa1.1-oki
    9221240        ;;
    923     mips)
    924         if [ x$os = x-linux-gnu ]; then
    925             basic_machine=mips-unknown
    926         else
    927             basic_machine=mips-mips
    928         fi
    929         ;;
    9301241    romp)
    9311242        basic_machine=romp-ibm
     1243        ;;
     1244    mmix)
     1245        basic_machine=mmix-knuth
    9321246        ;;
    9331247    rs6000)
     
    9471261        basic_machine=we32k-att
    9481262        ;;
    949     sh3 | sh4)
     1263    sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
    9501264        basic_machine=sh-unknown
    9511265        ;;
    952     sparc | sparcv9 | sparcv9b)
     1266    sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
    9531267        basic_machine=sparc-sun
    9541268        ;;
    955         cydra)
     1269    cydra)
    9561270        basic_machine=cydra-cydrome
    9571271        ;;
     
    9671281    pmac | pmac-mpw)
    9681282        basic_machine=powerpc-apple
    969         ;;
    970     c4x*)
    971         basic_machine=c4x-none
    972         os=-coff
    9731283        ;;
    9741284    *-unknown)
     
    9981308then
    9991309case $os in
    1000         # First match some system type aliases
    1001         # that might get confused with valid system types.
     1310    # First match some system type aliases
     1311    # that might get confused with valid system types.
    10021312    # -solaris* is a basic system type, with this one exception.
     1313    -auroraux)
     1314        os=-auroraux
     1315        ;;
    10031316    -solaris1 | -solaris1.*)
    10041317        os=`echo $os | sed -e 's|solaris1|sunos4|'`
     
    10211334    # -sysv* is not here because it comes later, after sysvr4.
    10221335    -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
    1023           | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
    1024           | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
     1336          | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
     1337          | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
     1338          | -sym* | -kopensolaris* \
    10251339          | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
    1026           | -aos* \
     1340          | -aos* | -aros* \
    10271341          | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
    10281342          | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
    1029           | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \
    1030           | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
     1343          | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
     1344          | -openbsd* | -solidbsd* \
     1345          | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
     1346          | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
    10311347          | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
    10321348          | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
    1033           | -chorusos* | -chorusrdb* \
    1034           | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
    1035           | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
    1036           | -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \
     1349          | -chorusos* | -chorusrdb* | -cegcc* \
     1350          | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
     1351          | -mingw32* | -linux-gnu* | -linux-android* \
     1352          | -linux-newlib* | -linux-uclibc* \
     1353          | -uxpv* | -beos* | -mpeix* | -udk* \
     1354          | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
    10371355          | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
    1038           | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* | -os2*)
     1356          | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
     1357          | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
     1358          | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
     1359          | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
     1360          | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*)
    10391361    # Remember, each alternative MUST END IN *, to match a version number.
    10401362        ;;
     
    10481370        esac
    10491371        ;;
     1372    -nto-qnx*)
     1373        ;;
    10501374    -nto*)
    1051         os=-nto-qnx
     1375        os=`echo $os | sed -e 's|nto|nto-qnx|'`
    10521376        ;;
    10531377    -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
    1054           | -windows* | -osx | -abug | -netware* | -os9* | -beos* \
     1378          | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
    10551379          | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
    10561380        ;;
     
    10581382        os=`echo $os | sed -e 's|mac|macos|'`
    10591383        ;;
     1384    -linux-dietlibc)
     1385        os=-linux-dietlibc
     1386        ;;
    10601387    -linux*)
    10611388        os=`echo $os | sed -e 's|linux|linux-gnu|'`
     
    10701397        os=-openedition
    10711398        ;;
     1399    -os400*)
     1400        os=-os400
     1401        ;;
    10721402    -wince*)
    10731403        os=-wince
     
    10881418        os=-aos
    10891419        ;;
     1420    -atheos*)
     1421        os=-atheos
     1422        ;;
     1423    -syllable*)
     1424        os=-syllable
     1425        ;;
    10901426    -386bsd)
    10911427        os=-bsd
     
    10941430        os=-sysv
    10951431        ;;
     1432    -nova*)
     1433        os=-rtmk-nova
     1434        ;;
    10961435    -ns2 )
    1097             os=-nextstep2
     1436        os=-nextstep2
    10981437        ;;
    10991438    -nsk*)
     
    11071446        os=-sysv4
    11081447        ;;
     1448    -tpf*)
     1449        os=-tpf
     1450        ;;
    11091451    -triton*)
    11101452        os=-sysv3
     
    11341476        os=-xenix
    11351477        ;;
    1136         -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
    1137             os=-mint
     1478    -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
     1479        os=-mint
     1480        ;;
     1481    -aros*)
     1482        os=-aros
     1483        ;;
     1484    -kaos*)
     1485        os=-kaos
     1486        ;;
     1487    -zvmoe)
     1488        os=-zvmoe
     1489        ;;
     1490    -dicos*)
     1491        os=-dicos
     1492        ;;
     1493    -nacl*)
    11381494        ;;
    11391495    -none)
     
    11591515
    11601516case $basic_machine in
     1517    score-*)
     1518        os=-elf
     1519        ;;
     1520    spu-*)
     1521        os=-elf
     1522        ;;
    11611523    *-acorn)
    11621524        os=-riscix1.2
     
    11681530        os=-aout
    11691531        ;;
     1532    c4x-* | tic4x-*)
     1533        os=-coff
     1534        ;;
     1535    tic54x-*)
     1536        os=-coff
     1537        ;;
     1538    tic55x-*)
     1539        os=-coff
     1540        ;;
     1541    tic6x-*)
     1542        os=-coff
     1543        ;;
     1544    # This must come before the *-dec entry.
    11701545    pdp10-*)
    11711546        os=-tops20
    11721547        ;;
    1173         pdp11-*)
     1548    pdp11-*)
    11741549        os=-none
    11751550        ;;
     
    11921567        os=-aout
    11931568        ;;
     1569    mep-*)
     1570        os=-elf
     1571        ;;
    11941572    mips*-cisco)
    11951573        os=-elf
     
    11981576        os=-elf
    11991577        ;;
     1578    or32-*)
     1579        os=-coff
     1580        ;;
    12001581    *-tti)  # must be before sparc entry or we get the wrong os.
    12011582        os=-sysv3
     
    12071588        os=-beos
    12081589        ;;
     1590    *-haiku)
     1591        os=-haiku
     1592        ;;
    12091593    *-ibm)
    12101594        os=-aix
    12111595        ;;
     1596    *-knuth)
     1597        os=-mmixware
     1598        ;;
    12121599    *-wec)
    12131600        os=-proelf
     
    12611648        os=-nextstep3
    12621649        ;;
    1263         *-gould)
     1650    *-gould)
    12641651        os=-sysv
    12651652        ;;
    1266         *-highlevel)
     1653    *-highlevel)
    12671654        os=-bsd
    12681655        ;;
     
    12701657        os=-bsd
    12711658        ;;
    1272         *-sgi)
     1659    *-sgi)
    12731660        os=-irix
    12741661        ;;
    1275         *-siemens)
     1662    *-siemens)
    12761663        os=-sysv4
    12771664        ;;
     
    13121699                vendor=sun
    13131700                ;;
    1314             -aix*)
     1701            -cnk*|-aix*)
    13151702                vendor=ibm
    13161703                ;;
     
    13421729                vendor=ibm
    13431730                ;;
     1731            -os400*)
     1732                vendor=ibm
     1733                ;;
    13441734            -ptx*)
    13451735                vendor=sequent
    13461736                ;;
    1347             -vxsim* | -vxworks*)
     1737            -tpf*)
     1738                vendor=ibm
     1739                ;;
     1740            -vxsim* | -vxworks* | -windiss*)
    13481741                vendor=wrs
    13491742                ;;
     
    13601753                vendor=atari
    13611754                ;;
     1755            -vos*)
     1756                vendor=stratus
     1757                ;;
    13621758        esac
    13631759        basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
     
    13661762
    13671763echo $basic_machine$os
    1368 exit 0
     1764exit
    13691765
    13701766# Local variables:
  • main/trunk/greenstone2/common-src/indexers/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 <bothner@cygnus.com>.
    28 # Please send patches to <config-patches@gnu.org>.
     29
     30# Originally written by Per Bothner.  Please send patches (context
     31# diff format) to <config-patches@gnu.org> 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    # akee@wpdis03.wpafb.af.mil (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 <Richard.M.Bartel@ccMail.Census.GOV>
    998         echo i586-unisys-sysv4
    999         exit 0 ;;
     1152    exit ;;
     1153    PENTIUM:*:4.0*:*)   # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
     1154            # says <Richard.M.Bartel@ccMail.Census.GOV>
     1155    echo i586-unisys-sysv4
     1156    exit ;;
    10001157    *:UNIX_System_V:4*:FTX*)
    10011158    # From Gerald Hewes <hewes@openmarket.com>.
    10021159    # How about differentiating between stratus architectures? -djm
    10031160    echo hppa1.1-stratus-sysv4
    1004     exit 0 ;;
     1161    exit ;;
    10051162    *:*:*:FTX*)
    10061163    # From seanf@swdc.stratus.com.
    10071164    echo i860-stratus-sysv4
    1008     exit 0 ;;
     1165    exit ;;
     1166    i*86:VOS:*:*)
     1167    # From Paul.Green@stratus.com.
     1168    echo ${UNAME_MACHINE}-stratus-vos
     1169    exit ;;
     1170    *:VOS:*:*)
     1171    # From Paul.Green@stratus.com.
     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
  • main/trunk/greenstone2/common-src/indexers/config.sub

    r16583 r26793  
    11#! /bin/sh
    22# Configuration validation subroutine script.
    3 #   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
    4 #   Free Software Foundation, Inc.
    5 
    6 timestamp='2001-06-08'
     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 (in principle) common to ALL GNU software.
     
    2223# You should have received a copy of the GNU General Public License
    2324# along with this program; if not, write to the Free Software
    24 # Foundation, Inc., 59 Temple Place - Suite 330,
    25 # Boston, MA 02111-1307, USA.
    26 
     25# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
     26# 02110-1301, USA.
     27#
    2728# As a special exception to the GNU General Public License, if you
    2829# distribute this file as part of a program that contains a
     
    3031# the same distribution terms that you use for the rest of that program.
    3132
    32 # Please send patches to <config-patches@gnu.org>.
     33
     34# Please send patches to <config-patches@gnu.org>.  Submit a context
     35# diff and a properly formatted GNU ChangeLog entry.
    3336#
    3437# Configuration subroutine to validate and canonicalize a configuration type.
     
    3639# If it is invalid, we print an error message on stderr and exit with code 1.
    3740# Otherwise, we print the canonical config type on stdout and succeed.
     41
     42# You can get the latest version of this script from:
     43# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
    3844
    3945# This file is supposed to be the same for all GNU packages
     
    7076GNU config.sub ($timestamp)
    7177
    72 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
    73 Free Software Foundation, Inc.
     78Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
     792001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free
     80Software Foundation, Inc.
    7481
    7582This is free software; see the source for copying conditions.  There is NO
     
    8390  case $1 in
    8491    --time-stamp | --time* | -t )
    85        echo "$timestamp" ; exit 0 ;;
     92       echo "$timestamp" ; exit ;;
    8693    --version | -v )
    87        echo "$version" ; exit 0 ;;
     94       echo "$version" ; exit ;;
    8895    --help | --h* | -h )
    89        echo "$usage"; exit 0 ;;
     96       echo "$usage"; exit ;;
    9097    -- )     # Stop option processing
    9198       shift; break ;;
     
    99106       # First pass through any local machine types.
    100107       echo $1
    101        exit 0;;
     108       exit ;;
    102109
    103110    * )
     
    118125maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
    119126case $maybe_os in
    120   nto-qnx* | linux-gnu* | storm-chaos* | os2-emx* | windows32-*)
     127  nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
     128  linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
     129  knetbsd*-gnu* | netbsd*-gnu* | \
     130  kopensolaris*-gnu* | \
     131  storm-chaos* | os2-emx* | rtmk-nova*)
    121132    os=-$maybe_os
    122133    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
     
    144155    -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
    145156    -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
    146     -apple | -axis)
     157    -apple | -axis | -knuth | -cray | -microblaze)
    147158        os=
    148159        basic_machine=$1
     160        ;;
     161    -bluegene*)
     162        os=-cnk
    149163        ;;
    150164    -sim | -cisco | -oki | -wec | -winbond)
     
    162176        basic_machine=$1
    163177        ;;
    164     -chorusrdb)
    165         os=-chorusrdb
     178    -chorusrdb)
     179        os=-chorusrdb
    166180        basic_machine=$1
    167         ;;
     181        ;;
    168182    -hiux*)
    169183        os=-hiuxwe2
     184        ;;
     185    -sco6)
     186        os=-sco5v6
     187        basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
    170188        ;;
    171189    -sco5)
     
    182200        ;;
    183201    -sco3.2v[4-9]*)
     202        # Don't forget version if it is 3.2v4 or newer.
     203        basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
     204        ;;
     205    -sco5v6*)
    184206        # Don't forget version if it is 3.2v4 or newer.
    185207        basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
     
    224246    # Recognize the basic CPU types without company name.
    225247    # Some are omitted here because they have special meanings below.
    226     tahoe | i860 | ia64 | m32r | m68k | m68000 | m88k | ns32k | arc \
    227             | arm | arme[lb] | arm[bl]e | armv[2345] | armv[345][lb] | strongarm | xscale \
    228         | pyramid | mn10200 | mn10300 | tron | a29k \
    229         | 580 | i960 | h8300 \
    230         | x86 | ppcbe | mipsbe | mipsle | shbe | shle \
    231         | hppa | hppa1.0 | hppa1.1 | hppa2.0 | hppa2.0w | hppa2.0n \
    232         | hppa64 \
    233         | alpha | alphaev[4-8] | alphaev56 | alphapca5[67] \
    234         | alphaev6[78] \
    235         | we32k | ns16k | clipper | i370 | sh | sh[34] \
    236         | powerpc | powerpcle \
    237         | 1750a | dsp16xx | pdp10 | pdp11 \
    238         | mips16 | mips64 | mipsel | mips64el \
    239         | mips64orion | mips64orionel | mipstx39 | mipstx39el \
    240         | mips64vr4300 | mips64vr4300el | mips64vr4100 | mips64vr4100el \
    241         | mips64vr5000 | mips64vr5000el | mcore | s390 | s390x \
    242         | sparc | sparclet | sparclite | sparc64 | sparcv9 | sparcv9b \
    243         | v850 | c4x \
    244         | thumb | d10v | d30v | fr30 | avr | openrisc | tic80 \
    245         | pj | pjl | h8500 | z8k)
     248    1750a | 580 \
     249    | a29k \
     250    | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
     251    | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
     252    | am33_2.0 \
     253    | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
     254        | be32 | be64 \
     255    | bfin \
     256    | c4x | clipper \
     257    | d10v | d30v | dlx | dsp16xx \
     258    | epiphany \
     259    | fido | fr30 | frv \
     260    | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
     261    | hexagon \
     262    | i370 | i860 | i960 | ia64 \
     263    | ip2k | iq2000 \
     264    | le32 | le64 \
     265    | lm32 \
     266    | m32c | m32r | m32rle | m68000 | m68k | m88k \
     267    | maxq | mb | microblaze | mcore | mep | metag \
     268    | mips | mipsbe | mipseb | mipsel | mipsle \
     269    | mips16 \
     270    | mips64 | mips64el \
     271    | mips64octeon | mips64octeonel \
     272    | mips64orion | mips64orionel \
     273    | mips64r5900 | mips64r5900el \
     274    | mips64vr | mips64vrel \
     275    | mips64vr4100 | mips64vr4100el \
     276    | mips64vr4300 | mips64vr4300el \
     277    | mips64vr5000 | mips64vr5000el \
     278    | mips64vr5900 | mips64vr5900el \
     279    | mipsisa32 | mipsisa32el \
     280    | mipsisa32r2 | mipsisa32r2el \
     281    | mipsisa64 | mipsisa64el \
     282    | mipsisa64r2 | mipsisa64r2el \
     283    | mipsisa64sb1 | mipsisa64sb1el \
     284    | mipsisa64sr71k | mipsisa64sr71kel \
     285    | mipstx39 | mipstx39el \
     286    | mn10200 | mn10300 \
     287    | moxie \
     288    | mt \
     289    | msp430 \
     290    | nds32 | nds32le | nds32be \
     291    | nios | nios2 \
     292    | ns16k | ns32k \
     293    | open8 \
     294    | or32 \
     295    | pdp10 | pdp11 | pj | pjl \
     296    | powerpc | powerpc64 | powerpc64le | powerpcle \
     297    | pyramid \
     298    | rl78 | rx \
     299    | score \
     300    | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
     301    | sh64 | sh64le \
     302    | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
     303    | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
     304    | spu \
     305    | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
     306    | ubicom32 \
     307    | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
     308    | we32k \
     309    | x86 | xc16x | xstormy16 | xtensa \
     310    | z8k | z80)
    246311        basic_machine=$basic_machine-unknown
    247312        ;;
    248     m6811 | m68hc11 | m6812 | m68hc12)
     313    c54x)
     314        basic_machine=tic54x-unknown
     315        ;;
     316    c55x)
     317        basic_machine=tic55x-unknown
     318        ;;
     319    c6x)
     320        basic_machine=tic6x-unknown
     321        ;;
     322    m6811 | m68hc11 | m6812 | m68hc12 | picochip)
    249323        # Motorola 68HC11/12.
    250324        basic_machine=$basic_machine-unknown
     
    252326        ;;
    253327    m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
     328        ;;
     329    ms1)
     330        basic_machine=mt-unknown
     331        ;;
     332
     333    strongarm | thumb | xscale)
     334        basic_machine=arm-unknown
     335        ;;
     336
     337    xscaleeb)
     338        basic_machine=armeb-unknown
     339        ;;
     340
     341    xscaleel)
     342        basic_machine=armel-unknown
    254343        ;;
    255344
     
    266355        ;;
    267356    # Recognize the basic CPU types with company name.
    268     # FIXME: clean up the formatting here.
    269     vax-* | tahoe-* | i*86-* | i860-* | ia64-* | m32r-* | m68k-* | m68000-* \
    270           | m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | c[123]* \
    271           | arm-*  | armbe-* | armle-* | armv*-* | strongarm-* | xscale-* \
    272           | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \
    273           | power-* | none-* | 580-* | cray2-* | h8300-* | h8500-* | i960-* \
    274           | xmp-* | ymp-* \
    275           | x86-* | ppcbe-* | mipsbe-* | mipsle-* | shbe-* | shle-* \
    276           | hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* | hppa2.0w-* \
    277           | hppa2.0n-* | hppa64-* \
    278           | alpha-* | alphaev[4-8]-* | alphaev56-* | alphapca5[67]-* \
    279           | alphaev6[78]-* \
    280           | we32k-* | cydra-* | ns16k-* | pn-* | np1-* | xps100-* \
    281           | clipper-* | orion-* \
    282           | sparclite-* | pdp10-* | pdp11-* | sh-* | sh[34]-* | sh[34]eb-* \
    283           | powerpc-* | powerpcle-* | sparc64-* | sparcv9-* | sparcv9b-* | sparc86x-* \
    284           | mips16-* | mips64-* | mipsel-* \
    285           | mips64el-* | mips64orion-* | mips64orionel-* \
    286           | mips64vr4100-* | mips64vr4100el-* | mips64vr4300-* | mips64vr4300el-* \
    287           | mipstx39-* | mipstx39el-* | mcore-* \
    288           | f30[01]-* | f700-* | s390-* | s390x-* | sv1-* | t3e-* \
    289           | [cjt]90-* \
    290           | m88110-* | m680[01234]0-* | m683?2-* | m68360-* | z8k-* | d10v-* \
    291           | thumb-* | v850-* | d30v-* | tic30-* | tic80-* | c30-* | fr30-* \
    292           | bs2000-* | tic54x-* | c54x-* | x86_64-* | pj-* | pjl-*)
     357    580-* \
     358    | a29k-* \
     359    | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
     360    | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
     361    | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
     362    | arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
     363    | avr-* | avr32-* \
     364    | be32-* | be64-* \
     365    | bfin-* | bs2000-* \
     366    | c[123]* | c30-* | [cjt]90-* | c4x-* \
     367    | clipper-* | craynv-* | cydra-* \
     368    | d10v-* | d30v-* | dlx-* \
     369    | elxsi-* \
     370    | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
     371    | h8300-* | h8500-* \
     372    | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
     373    | hexagon-* \
     374    | i*86-* | i860-* | i960-* | ia64-* \
     375    | ip2k-* | iq2000-* \
     376    | le32-* | le64-* \
     377    | lm32-* \
     378    | m32c-* | m32r-* | m32rle-* \
     379    | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
     380    | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \
     381    | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
     382    | mips16-* \
     383    | mips64-* | mips64el-* \
     384    | mips64octeon-* | mips64octeonel-* \
     385    | mips64orion-* | mips64orionel-* \
     386    | mips64r5900-* | mips64r5900el-* \
     387    | mips64vr-* | mips64vrel-* \
     388    | mips64vr4100-* | mips64vr4100el-* \
     389    | mips64vr4300-* | mips64vr4300el-* \
     390    | mips64vr5000-* | mips64vr5000el-* \
     391    | mips64vr5900-* | mips64vr5900el-* \
     392    | mipsisa32-* | mipsisa32el-* \
     393    | mipsisa32r2-* | mipsisa32r2el-* \
     394    | mipsisa64-* | mipsisa64el-* \
     395    | mipsisa64r2-* | mipsisa64r2el-* \
     396    | mipsisa64sb1-* | mipsisa64sb1el-* \
     397    | mipsisa64sr71k-* | mipsisa64sr71kel-* \
     398    | mipstx39-* | mipstx39el-* \
     399    | mmix-* \
     400    | mt-* \
     401    | msp430-* \
     402    | nds32-* | nds32le-* | nds32be-* \
     403    | nios-* | nios2-* \
     404    | none-* | np1-* | ns16k-* | ns32k-* \
     405    | open8-* \
     406    | orion-* \
     407    | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
     408    | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
     409    | pyramid-* \
     410    | rl78-* | romp-* | rs6000-* | rx-* \
     411    | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
     412    | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
     413    | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
     414    | sparclite-* \
     415    | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \
     416    | tahoe-* \
     417    | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
     418    | tile*-* \
     419    | tron-* \
     420    | ubicom32-* \
     421    | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
     422    | vax-* \
     423    | we32k-* \
     424    | x86-* | x86_64-* | xc16x-* | xps100-* \
     425    | xstormy16-* | xtensa*-* \
     426    | ymp-* \
     427    | z8k-* | z80-*)
     428        ;;
     429    # Recognize the basic CPU types without company name, with glob match.
     430    xtensa*)
     431        basic_machine=$basic_machine-unknown
    293432        ;;
    294433    # Recognize the various machine names and aliases which stand
     
    308447        os=-udi
    309448        ;;
     449    abacus)
     450        basic_machine=abacus-unknown
     451        ;;
    310452    adobe68k)
    311453        basic_machine=m68010-adobe
     
    322464        os=-bsd
    323465        ;;
     466    amd64)
     467        basic_machine=x86_64-pc
     468        ;;
     469    amd64-*)
     470        basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
     471        ;;
    324472    amdahl)
    325473        basic_machine=580-amdahl
     
    345493        os=-bsd
    346494        ;;
     495    aros)
     496        basic_machine=i386-pc
     497        os=-aros
     498        ;;
    347499    aux)
    348500        basic_machine=m68k-apple
     
    353505        os=-dynix
    354506        ;;
     507    blackfin)
     508        basic_machine=bfin-unknown
     509        os=-linux
     510        ;;
     511    blackfin-*)
     512        basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
     513        os=-linux
     514        ;;
     515    bluegene*)
     516        basic_machine=powerpc-ibm
     517        os=-cnk
     518        ;;
     519    c54x-*)
     520        basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
     521        ;;
     522    c55x-*)
     523        basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
     524        ;;
     525    c6x-*)
     526        basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
     527        ;;
     528    c90)
     529        basic_machine=c90-cray
     530        os=-unicos
     531        ;;
     532    cegcc)
     533        basic_machine=arm-unknown
     534        os=-cegcc
     535        ;;
    355536    convex-c1)
    356537        basic_machine=c1-convex
     
    373554        os=-bsd
    374555        ;;
    375     cray | ymp)
    376         basic_machine=ymp-cray
     556    cray | j90)
     557        basic_machine=j90-cray
    377558        os=-unicos
    378559        ;;
    379     cray2)
    380         basic_machine=cray2-cray
    381         os=-unicos
    382         ;;
    383     [cjt]90)
    384         basic_machine=${basic_machine}-cray
    385         os=-unicos
     560    craynv)
     561        basic_machine=craynv-cray
     562        os=-unicosmp
     563        ;;
     564    cr16 | cr16-*)
     565        basic_machine=cr16-unknown
     566        os=-elf
    386567        ;;
    387568    crds | unos)
    388569        basic_machine=m68k-crds
    389570        ;;
     571    crisv32 | crisv32-* | etraxfs*)
     572        basic_machine=crisv32-axis
     573        ;;
    390574    cris | cris-* | etrax*)
    391575        basic_machine=cris-axis
    392576        ;;
     577    crx)
     578        basic_machine=crx-unknown
     579        os=-elf
     580        ;;
    393581    da30 | da30-*)
    394582        basic_machine=m68k-da30
     
    396584    decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
    397585        basic_machine=mips-dec
     586        ;;
     587    decsystem10* | dec10*)
     588        basic_machine=pdp10-dec
     589        os=-tops10
     590        ;;
     591    decsystem20* | dec20*)
     592        basic_machine=pdp10-dec
     593        os=-tops20
    398594        ;;
    399595    delta | 3300 | motorola-3300 | motorola-delta \
     
    404600        basic_machine=m88k-motorola
    405601        os=-sysv3
     602        ;;
     603    dicos)
     604        basic_machine=i686-pc
     605        os=-dicos
     606        ;;
     607    djgpp)
     608        basic_machine=i586-pc
     609        os=-msdosdjgpp
    406610        ;;
    407611    dpx20 | dpx20-*)
     
    555759        os=-sysv
    556760        ;;
     761    m68knommu)
     762        basic_machine=m68k-unknown
     763        os=-linux
     764        ;;
     765    m68knommu-*)
     766        basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
     767        os=-linux
     768        ;;
    557769    m88k-omron*)
    558770        basic_machine=m88k-omron
     
    566778        os=-sysv
    567779        ;;
     780    microblaze)
     781        basic_machine=microblaze-xilinx
     782        ;;
    568783    mingw32)
    569784        basic_machine=i386-pc
    570785        os=-mingw32
    571786        ;;
     787    mingw32ce)
     788        basic_machine=arm-unknown
     789        os=-mingw32ce
     790        ;;
    572791    miniframe)
    573792        basic_machine=m68000-convergent
     
    577796        os=-mint
    578797        ;;
    579     mipsel*-linux*)
    580         basic_machine=mipsel-unknown
    581         os=-linux-gnu
    582         ;;
    583     mips*-linux*)
    584         basic_machine=mips-unknown
    585         os=-linux-gnu
    586         ;;
    587798    mips3*-*)
    588799        basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
     
    590801    mips3*)
    591802        basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
    592         ;;
    593     mmix*)
    594         basic_machine=mmix-knuth
    595         os=-mmixware
    596803        ;;
    597804    monitor)
     
    599806        os=-coff
    600807        ;;
     808    morphos)
     809        basic_machine=powerpc-unknown
     810        os=-morphos
     811        ;;
    601812    msdos)
    602813        basic_machine=i386-pc
    603814        os=-msdos
    604815        ;;
     816    ms1-*)
     817        basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
     818        ;;
     819    msys)
     820        basic_machine=i386-pc
     821        os=-msys
     822        ;;
    605823    mvs)
    606824        basic_machine=i370-ibm
    607825        os=-mvs
     826        ;;
     827    nacl)
     828        basic_machine=le32-unknown
     829        os=-nacl
    608830        ;;
    609831    ncr3000)
     
    671893        basic_machine=np1-gould
    672894        ;;
     895    neo-tandem)
     896        basic_machine=neo-tandem
     897        ;;
     898    nse-tandem)
     899        basic_machine=nse-tandem
     900        ;;
    673901    nsr-tandem)
    674902        basic_machine=nsr-tandem
     
    678906        os=-proelf
    679907        ;;
     908    openrisc | openrisc-*)
     909        basic_machine=or32-unknown
     910        ;;
     911    os400)
     912        basic_machine=powerpc-ibm
     913        os=-os400
     914        ;;
    680915    OSE68000 | ose68000)
    681916        basic_machine=m68000-ericsson
     
    694929        os=-osf
    695930        ;;
     931    parisc)
     932        basic_machine=hppa-unknown
     933        os=-linux
     934        ;;
     935    parisc-*)
     936        basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
     937        os=-linux
     938        ;;
    696939    pbd)
    697940        basic_machine=sparc-tti
     
    700943        basic_machine=m68k-tti
    701944        ;;
    702         pc532 | pc532-*)
     945    pc532 | pc532-*)
    703946        basic_machine=ns32k-pc532
    704947        ;;
    705     pentium | p5 | k5 | k6 | nexgen)
     948    pc98)
     949        basic_machine=i386-pc
     950        ;;
     951    pc98-*)
     952        basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
     953        ;;
     954    pentium | p5 | k5 | k6 | nexgen | viac3)
    706955        basic_machine=i586-pc
    707956        ;;
    708     pentiumpro | p6 | 6x86 | athlon)
     957    pentiumpro | p6 | 6x86 | athlon | athlon_*)
    709958        basic_machine=i686-pc
    710959        ;;
    711     pentiumii | pentium2)
     960    pentiumii | pentium2 | pentiumiii | pentium3)
    712961        basic_machine=i686-pc
    713962        ;;
    714     pentium-* | p5-* | k5-* | k6-* | nexgen-*)
     963    pentium4)
     964        basic_machine=i786-pc
     965        ;;
     966    pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
    715967        basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
    716968        ;;
     
    718970        basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
    719971        ;;
    720     pentiumii-* | pentium2-*)
     972    pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
    721973        basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
     974        ;;
     975    pentium4-*)
     976        basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
    722977        ;;
    723978    pn)
     
    726981    power)  basic_machine=power-ibm
    727982        ;;
    728     ppc)    basic_machine=powerpc-unknown
    729             ;;
    730     ppc-*)  basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
     983    ppc | ppcbe)    basic_machine=powerpc-unknown
     984        ;;
     985    ppc-* | ppcbe-*)
     986        basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
    731987        ;;
    732988    ppcle | powerpclittle | ppc-le | powerpc-little)
    733989        basic_machine=powerpcle-unknown
    734             ;;
     990        ;;
    735991    ppcle-* | powerpclittle-*)
    736992        basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
     993        ;;
     994    ppc64)  basic_machine=powerpc64-unknown
     995        ;;
     996    ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
     997        ;;
     998    ppc64le | powerpc64little | ppc64-le | powerpc64-little)
     999        basic_machine=powerpc64le-unknown
     1000        ;;
     1001    ppc64le-* | powerpc64little-*)
     1002        basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
    7371003        ;;
    7381004    ps2)
     
    7431009        os=-pw32
    7441010        ;;
     1011    rdos)
     1012        basic_machine=i386-pc
     1013        os=-rdos
     1014        ;;
    7451015    rom68k)
    7461016        basic_machine=m68k-rom68k
     
    7531023        basic_machine=romp-ibm
    7541024        ;;
     1025    s390 | s390-*)
     1026        basic_machine=s390-ibm
     1027        ;;
     1028    s390x | s390x-*)
     1029        basic_machine=s390x-ibm
     1030        ;;
    7551031    sa29200)
    7561032        basic_machine=a29k-amd
    7571033        os=-udi
    7581034        ;;
     1035    sb1)
     1036        basic_machine=mipsisa64sb1-unknown
     1037        ;;
     1038    sb1el)
     1039        basic_machine=mipsisa64sb1el-unknown
     1040        ;;
     1041    sde)
     1042        basic_machine=mipsisa32-sde
     1043        os=-elf
     1044        ;;
     1045    sei)
     1046        basic_machine=mips-sei
     1047        os=-seiux
     1048        ;;
    7591049    sequent)
    7601050        basic_machine=i386-sequent
     
    7641054        os=-hms
    7651055        ;;
    766     sparclite-wrs)
     1056    sh5el)
     1057        basic_machine=sh5le-unknown
     1058        ;;
     1059    sh64)
     1060        basic_machine=sh64-unknown
     1061        ;;
     1062    sparclite-wrs | simso-wrs)
    7671063        basic_machine=sparclite-wrs
    7681064        os=-vxworks
     
    7821078        os=-sysv4
    7831079        ;;
     1080    strongarm-* | thumb-*)
     1081        basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
     1082        ;;
    7841083    sun2)
    7851084        basic_machine=m68000-sun
     
    8311130        ;;
    8321131    t3e)
    833         basic_machine=t3e-cray
     1132        basic_machine=alphaev5-cray
    8341133        os=-unicos
    8351134        ;;
    836     tic54x | c54x*)
    837         basic_machine=tic54x-unknown
    838         os=-coff
     1135    t90)
     1136        basic_machine=t90-cray
     1137        os=-unicos
     1138        ;;
     1139    tile*)
     1140        basic_machine=$basic_machine-unknown
     1141        os=-linux-gnu
    8391142        ;;
    8401143    tx39)
     
    8441147        basic_machine=mipstx39el-unknown
    8451148        ;;
     1149    toad1)
     1150        basic_machine=pdp10-xkl
     1151        os=-tops20
     1152        ;;
    8461153    tower | tower-32)
    8471154        basic_machine=m68k-ncr
     1155        ;;
     1156    tpf)
     1157        basic_machine=s390x-ibm
     1158        os=-tpf
    8481159        ;;
    8491160    udi29k)
     
    8681179        ;;
    8691180    vpp*|vx|vx-*)
    870                basic_machine=f301-fujitsu
    871                ;;
     1181        basic_machine=f301-fujitsu
     1182        ;;
    8721183    vxworks960)
    8731184        basic_machine=i960-wrs
     
    8901201        os=-proelf
    8911202        ;;
    892     windows32)
    893         basic_machine=i386-pc
    894         os=-windows32-msvcrt
    895         ;;
    896     xmp)
    897         basic_machine=xmp-cray
     1203    xbox)
     1204        basic_machine=i686-pc
     1205        os=-mingw32
     1206        ;;
     1207    xps | xps100)
     1208        basic_machine=xps100-honeywell
     1209        ;;
     1210    xscale-* | xscalee[bl]-*)
     1211        basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
     1212        ;;
     1213    ymp)
     1214        basic_machine=ymp-cray
    8981215        os=-unicos
    899         ;;
    900         xps | xps100)
    901         basic_machine=xps100-honeywell
    9021216        ;;
    9031217    z8k-*-coff)
    9041218        basic_machine=z8k-unknown
     1219        os=-sim
     1220        ;;
     1221    z80-*-coff)
     1222        basic_machine=z80-unknown
    9051223        os=-sim
    9061224        ;;
     
    9211239        basic_machine=hppa1.1-oki
    9221240        ;;
    923     mips)
    924         if [ x$os = x-linux-gnu ]; then
    925             basic_machine=mips-unknown
    926         else
    927             basic_machine=mips-mips
    928         fi
    929         ;;
    9301241    romp)
    9311242        basic_machine=romp-ibm
     1243        ;;
     1244    mmix)
     1245        basic_machine=mmix-knuth
    9321246        ;;
    9331247    rs6000)
     
    9471261        basic_machine=we32k-att
    9481262        ;;
    949     sh3 | sh4)
     1263    sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
    9501264        basic_machine=sh-unknown
    9511265        ;;
    952     sparc | sparcv9 | sparcv9b)
     1266    sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
    9531267        basic_machine=sparc-sun
    9541268        ;;
    955         cydra)
     1269    cydra)
    9561270        basic_machine=cydra-cydrome
    9571271        ;;
     
    9671281    pmac | pmac-mpw)
    9681282        basic_machine=powerpc-apple
    969         ;;
    970     c4x*)
    971         basic_machine=c4x-none
    972         os=-coff
    9731283        ;;
    9741284    *-unknown)
     
    9981308then
    9991309case $os in
    1000         # First match some system type aliases
    1001         # that might get confused with valid system types.
     1310    # First match some system type aliases
     1311    # that might get confused with valid system types.
    10021312    # -solaris* is a basic system type, with this one exception.
     1313    -auroraux)
     1314        os=-auroraux
     1315        ;;
    10031316    -solaris1 | -solaris1.*)
    10041317        os=`echo $os | sed -e 's|solaris1|sunos4|'`
     
    10211334    # -sysv* is not here because it comes later, after sysvr4.
    10221335    -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
    1023           | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
    1024           | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
     1336          | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
     1337          | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
     1338          | -sym* | -kopensolaris* \
    10251339          | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
    1026           | -aos* \
     1340          | -aos* | -aros* \
    10271341          | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
    10281342          | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
    1029           | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \
    1030           | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
     1343          | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
     1344          | -openbsd* | -solidbsd* \
     1345          | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
     1346          | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
    10311347          | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
    10321348          | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
    1033           | -chorusos* | -chorusrdb* \
    1034           | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
    1035           | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
    1036           | -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \
     1349          | -chorusos* | -chorusrdb* | -cegcc* \
     1350          | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
     1351          | -mingw32* | -linux-gnu* | -linux-android* \
     1352          | -linux-newlib* | -linux-uclibc* \
     1353          | -uxpv* | -beos* | -mpeix* | -udk* \
     1354          | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
    10371355          | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
    1038           | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* | -os2*)
     1356          | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
     1357          | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
     1358          | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
     1359          | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
     1360          | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*)
    10391361    # Remember, each alternative MUST END IN *, to match a version number.
    10401362        ;;
     
    10481370        esac
    10491371        ;;
     1372    -nto-qnx*)
     1373        ;;
    10501374    -nto*)
    1051         os=-nto-qnx
     1375        os=`echo $os | sed -e 's|nto|nto-qnx|'`
    10521376        ;;
    10531377    -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
    1054           | -windows* | -osx | -abug | -netware* | -os9* | -beos* \
     1378          | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
    10551379          | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
    10561380        ;;
     
    10581382        os=`echo $os | sed -e 's|mac|macos|'`
    10591383        ;;
     1384    -linux-dietlibc)
     1385        os=-linux-dietlibc
     1386        ;;
    10601387    -linux*)
    10611388        os=`echo $os | sed -e 's|linux|linux-gnu|'`
     
    10701397        os=-openedition
    10711398        ;;
     1399    -os400*)
     1400        os=-os400
     1401        ;;
    10721402    -wince*)
    10731403        os=-wince
     
    10881418        os=-aos
    10891419        ;;
     1420    -atheos*)
     1421        os=-atheos
     1422        ;;
     1423    -syllable*)
     1424        os=-syllable
     1425        ;;
    10901426    -386bsd)
    10911427        os=-bsd
     
    10941430        os=-sysv
    10951431        ;;
     1432    -nova*)
     1433        os=-rtmk-nova
     1434        ;;
    10961435    -ns2 )
    1097             os=-nextstep2
     1436        os=-nextstep2
    10981437        ;;
    10991438    -nsk*)
     
    11071446        os=-sysv4
    11081447        ;;
     1448    -tpf*)
     1449        os=-tpf
     1450        ;;
    11091451    -triton*)
    11101452        os=-sysv3
     
    11341476        os=-xenix
    11351477        ;;
    1136         -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
    1137             os=-mint
     1478    -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
     1479        os=-mint
     1480        ;;
     1481    -aros*)
     1482        os=-aros
     1483        ;;
     1484    -kaos*)
     1485        os=-kaos
     1486        ;;
     1487    -zvmoe)
     1488        os=-zvmoe
     1489        ;;
     1490    -dicos*)
     1491        os=-dicos
     1492        ;;
     1493    -nacl*)
    11381494        ;;
    11391495    -none)
     
    11591515
    11601516case $basic_machine in
     1517    score-*)
     1518        os=-elf
     1519        ;;
     1520    spu-*)
     1521        os=-elf
     1522        ;;
    11611523    *-acorn)
    11621524        os=-riscix1.2
     
    11681530        os=-aout
    11691531        ;;
     1532    c4x-* | tic4x-*)
     1533        os=-coff
     1534        ;;
     1535    tic54x-*)
     1536        os=-coff
     1537        ;;
     1538    tic55x-*)
     1539        os=-coff
     1540        ;;
     1541    tic6x-*)
     1542        os=-coff
     1543        ;;
     1544    # This must come before the *-dec entry.
    11701545    pdp10-*)
    11711546        os=-tops20
    11721547        ;;
    1173         pdp11-*)
     1548    pdp11-*)
    11741549        os=-none
    11751550        ;;
     
    11921567        os=-aout
    11931568        ;;
     1569    mep-*)
     1570        os=-elf
     1571        ;;
    11941572    mips*-cisco)
    11951573        os=-elf
     
    11981576        os=-elf
    11991577        ;;
     1578    or32-*)
     1579        os=-coff
     1580        ;;
    12001581    *-tti)  # must be before sparc entry or we get the wrong os.
    12011582        os=-sysv3
     
    12071588        os=-beos
    12081589        ;;
     1590    *-haiku)
     1591        os=-haiku
     1592        ;;
    12091593    *-ibm)
    12101594        os=-aix
    12111595        ;;
     1596    *-knuth)
     1597        os=-mmixware
     1598        ;;
    12121599    *-wec)
    12131600        os=-proelf
     
    12611648        os=-nextstep3
    12621649        ;;
    1263         *-gould)
     1650    *-gould)
    12641651        os=-sysv
    12651652        ;;
    1266         *-highlevel)
     1653    *-highlevel)
    12671654        os=-bsd
    12681655        ;;
     
    12701657        os=-bsd
    12711658        ;;
    1272         *-sgi)
     1659    *-sgi)
    12731660        os=-irix
    12741661        ;;
    1275         *-siemens)
     1662    *-siemens)
    12761663        os=-sysv4
    12771664        ;;
     
    13121699                vendor=sun
    13131700                ;;
    1314             -aix*)
     1701            -cnk*|-aix*)
    13151702                vendor=ibm
    13161703                ;;
     
    13421729                vendor=ibm
    13431730                ;;
     1731            -os400*)
     1732                vendor=ibm
     1733                ;;
    13441734            -ptx*)
    13451735                vendor=sequent
    13461736                ;;
    1347             -vxsim* | -vxworks*)
     1737            -tpf*)
     1738                vendor=ibm
     1739                ;;
     1740            -vxsim* | -vxworks* | -windiss*)
    13481741                vendor=wrs
    13491742                ;;
     
    13601753                vendor=atari
    13611754                ;;
     1755            -vos*)
     1756                vendor=stratus
     1757                ;;
    13621758        esac
    13631759        basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
     
    13661762
    13671763echo $basic_machine$os
    1368 exit 0
     1764exit
    13691765
    13701766# Local variables:
  • 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 <bothner@cygnus.com>.
    28 # Please send patches to <config-patches@gnu.org>.
     29
     30# Originally written by Per Bothner.  Please send patches (context
     31# diff format) to <config-patches@gnu.org> 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