Ticket #3298: haiku_gcc2_osx_2.patch

File haiku_gcc2_osx_2.patch, 94.1 KB (added by VinDuv, 15 years ago)
  • buildtools/legacy/gcc/Makefile.in

     
    141141    then echo $$r/m4/m4 ; \
    142142    else echo ${DEFAULT_M4} ; fi`
    143143
    144 MAKEINFO = `if [ -f $$r/texinfo/makeinfo/Makefile ] ; \
    145     then echo $$r/texinfo/makeinfo/makeinfo ; \
    146     else echo makeinfo ; fi`
     144MAKEINFO = `if [ -x /usr/bin/makeinfo ] ; \
     145    then echo makeinfo ; \
     146    else echo $$r/texinfo/makeinfo/makeinfo ; fi`
    147147
    148148# This just becomes part of the MAKEINFO definition passed down to
    149149# sub-makes.  It lets flags be given on the command line while still
  • buildtools/legacy/gcc/config.guess

     
    11#! /bin/sh
    22# Attempt to guess a canonical system name.
    3 #   Copyright (C) 1992, 93, 94, 95, 96, 97, 1998, 1999 Free Software Foundation, Inc.
    4 #
     3#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
     4#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
     5#   Free Software Foundation, Inc.
     6
     7timestamp='2008-12-19'
     8
    59# This file is free software; you can redistribute it and/or modify it
    610# under the terms of the GNU General Public License as published by
    711# the Free Software Foundation; either version 2 of the License, or
     
    1418#
    1519# You should have received a copy of the GNU General Public License
    1620# along with this program; if not, write to the Free Software
    17 # 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.
    1823#
    1924# As a special exception to the GNU General Public License, if you
    2025# distribute this file as part of a program that contains a
    2126# configuration script generated by Autoconf, you may include it under
    2227# the same distribution terms that you use for the rest of that program.
    2328
    24 # Written by Per Bothner <bothner@cygnus.com>.
    25 # The master version of this file is at the FSF in /home/gd/gnu/lib.
     29
     30# Originally written by Per Bothner <per@bothner.com>.
     31# Please send patches to <config-patches@gnu.org>.  Submit a context
     32# diff and a properly formatted ChangeLog entry.
    2633#
    2734# This script attempts to guess a canonical system name similar to
    2835# config.sub.  If it succeeds, it prints the system name on stdout, and
    2936# exits with 0.  Otherwise, it exits with 1.
    3037#
    3138# The plan is that this can be called by configure scripts if you
    32 # don't specify an explicit system type (host/target name).
    33 #
    34 # Only a few systems have been added to this list; please add others
    35 # (but try to keep the structure clean).
    36 #
     39# don't specify an explicit build system type.
    3740
     41me=`echo "$0" | sed -e 's,.*/,,'`
     42
     43usage="\
     44Usage: $0 [OPTION]
     45
     46Output the configuration name of the system \`$me' is run on.
     47
     48Operation modes:
     49  -h, --help         print this help, then exit
     50  -t, --time-stamp   print date of last modification, then exit
     51  -v, --version      print version number, then exit
     52
     53Report bugs and patches to <config-patches@gnu.org>."
     54
     55version="\
     56GNU config.guess ($timestamp)
     57
     58Originally written by Per Bothner.
     59Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
     602002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
     61
     62This is free software; see the source for copying conditions.  There is NO
     63warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
     64
     65help="
     66Try \`$me --help' for more information."
     67
     68# Parse command line
     69while test $# -gt 0 ; do
     70  case $1 in
     71    --time-stamp | --time* | -t )
     72       echo "$timestamp" ; exit ;;
     73    --version | -v )
     74       echo "$version" ; exit ;;
     75    --help | --h* | -h )
     76       echo "$usage"; exit ;;
     77    -- )     # Stop option processing
     78       shift; break ;;
     79    - ) # Use stdin as input.
     80       break ;;
     81    -* )
     82       echo "$me: invalid option $1$help" >&2
     83       exit 1 ;;
     84    * )
     85       break ;;
     86  esac
     87done
     88
     89if test $# != 0; then
     90  echo "$me: too many arguments$help" >&2
     91  exit 1
     92fi
     93
     94trap 'exit 1' 1 2 15
     95
     96# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
     97# compiler to aid in system detection is discouraged as it requires
     98# temporary files to be created and, as you can see below, it is a
     99# headache to deal with in a portable fashion.
     100
     101# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
     102# use `HOST_CC' if defined, but it is deprecated.
     103
     104# Portable tmp directory creation inspired by the Autoconf team.
     105
     106set_cc_for_build='
     107trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
     108trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
     109: ${TMPDIR=/tmp} ;
     110 { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
     111 { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
     112 { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
     113 { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
     114dummy=$tmp/dummy ;
     115tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
     116case $CC_FOR_BUILD,$HOST_CC,$CC in
     117 ,,)    echo "int x;" > $dummy.c ;
     118    for c in cc gcc c89 c99 ; do
     119      if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
     120         CC_FOR_BUILD="$c"; break ;
     121      fi ;
     122    done ;
     123    if test x"$CC_FOR_BUILD" = x ; then
     124      CC_FOR_BUILD=no_compiler_found ;
     125    fi
     126    ;;
     127 ,,*)   CC_FOR_BUILD=$CC ;;
     128 ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
     129esac ; set_cc_for_build= ;'
     130
    38131# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
    39 # (ghazi@noc.rutgers.edu 8/24/94.)
     132# (ghazi@noc.rutgers.edu 1994-08-24)
    40133if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
    41134    PATH=$PATH:/.attbin ; export PATH
    42135fi
    43136
    44137UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
    45138UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
    46 UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
     139UNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
    47140UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
    48141
    49 trap 'rm -f dummy.c dummy.o dummy; exit 1' 1 2 15
    50 
    51142# Note: order is significant - the case branches are not exclusive.
    52143
    53144case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
     145    *:NetBSD:*:*)
     146    # NetBSD (nbsd) targets should (where applicable) match one or
     147    # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
     148    # *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
     149    # switched to ELF, *-*-netbsd* would select the old
     150    # object file format.  This provides both forward
     151    # compatibility and a consistent mechanism for selecting the
     152    # object file format.
     153    #
     154    # Note: NetBSD doesn't particularly care about the vendor
     155    # portion of the name.  We always set it to "unknown".
     156    sysctl="sysctl -n hw.machine_arch"
     157    UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
     158        /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
     159    case "${UNAME_MACHINE_ARCH}" in
     160        armeb) machine=armeb-unknown ;;
     161        arm*) machine=arm-unknown ;;
     162        sh3el) machine=shl-unknown ;;
     163        sh3eb) machine=sh-unknown ;;
     164        sh5el) machine=sh5le-unknown ;;
     165        *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
     166    esac
     167    # The Operating System including object format, if it has switched
     168    # to ELF recently, or will in the future.
     169    case "${UNAME_MACHINE_ARCH}" in
     170        arm*|i386|m68k|ns32k|sh3*|sparc|vax)
     171        eval $set_cc_for_build
     172        if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
     173            | grep __ELF__ >/dev/null
     174        then
     175            # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
     176            # Return netbsd for either.  FIX?
     177            os=netbsd
     178        else
     179            os=netbsdelf
     180        fi
     181        ;;
     182        *)
     183            os=netbsd
     184        ;;
     185    esac
     186    # The OS release
     187    # Debian GNU/NetBSD machines have a different userland, and
     188    # thus, need a distinct triplet. However, they do not need
     189    # kernel version information, so it can be replaced with a
     190    # suitable tag, in the style of linux-gnu.
     191    case "${UNAME_VERSION}" in
     192        Debian*)
     193        release='-gnu'
     194        ;;
     195        *)
     196        release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
     197        ;;
     198    esac
     199    # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
     200    # contains redundant information, the shorter form:
     201    # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
     202    echo "${machine}-${os}${release}"
     203    exit ;;
     204    *:OpenBSD:*:*)
     205    UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
     206    echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
     207    exit ;;
     208    *:ekkoBSD:*:*)
     209    echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
     210    exit ;;
     211    *:SolidBSD:*:*)
     212    echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
     213    exit ;;
     214    macppc:MirBSD:*:*)
     215    echo powerpc-unknown-mirbsd${UNAME_RELEASE}
     216    exit ;;
     217    *:MirBSD:*:*)
     218    echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
     219    exit ;;
    54220    alpha:OSF1:*:*)
    55     if test $UNAME_RELEASE = "V4.0"; then
     221    case $UNAME_RELEASE in
     222    *4.0)
    56223        UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
    57     fi
     224        ;;
     225    *5.*)
     226            UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
     227        ;;
     228    esac
     229    # According to Compaq, /usr/sbin/psrinfo has been available on
     230    # OSF/1 and Tru64 systems produced since 1995.  I hope that
     231    # covers most systems running today.  This code pipes the CPU
     232    # types through head -n 1, so we only detect the type of CPU 0.
     233    ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\) processor.*$/\1/p' | head -n 1`
     234    case "$ALPHA_CPU_TYPE" in
     235        "EV4 (21064)")
     236        UNAME_MACHINE="alpha" ;;
     237        "EV4.5 (21064)")
     238        UNAME_MACHINE="alpha" ;;
     239        "LCA4 (21066/21068)")
     240        UNAME_MACHINE="alpha" ;;
     241        "EV5 (21164)")
     242        UNAME_MACHINE="alphaev5" ;;
     243        "EV5.6 (21164A)")
     244        UNAME_MACHINE="alphaev56" ;;
     245        "EV5.6 (21164PC)")
     246        UNAME_MACHINE="alphapca56" ;;
     247        "EV5.7 (21164PC)")
     248        UNAME_MACHINE="alphapca57" ;;
     249        "EV6 (21264)")
     250        UNAME_MACHINE="alphaev6" ;;
     251        "EV6.7 (21264A)")
     252        UNAME_MACHINE="alphaev67" ;;
     253        "EV6.8CB (21264C)")
     254        UNAME_MACHINE="alphaev68" ;;
     255        "EV6.8AL (21264B)")
     256        UNAME_MACHINE="alphaev68" ;;
     257        "EV6.8CX (21264D)")
     258        UNAME_MACHINE="alphaev68" ;;
     259        "EV6.9A (21264/EV69A)")
     260        UNAME_MACHINE="alphaev69" ;;
     261        "EV7 (21364)")
     262        UNAME_MACHINE="alphaev7" ;;
     263        "EV7.9 (21364A)")
     264        UNAME_MACHINE="alphaev79" ;;
     265    esac
     266    # A Pn.n version is a patched version.
    58267    # A Vn.n version is a released version.
    59268    # A Tn.n version is a released field test version.
    60269    # A Xn.n version is an unreleased experimental baselevel.
    61270    # 1.2 uses "1.2" for uname -r.
    62     cat <<EOF >dummy.s
    63     .globl main
    64     .ent main
    65 main:
    66     .frame \$30,0,\$26,0
    67     .prologue 0
    68     .long 0x47e03d80 # implver $0
    69     lda \$2,259
    70     .long 0x47e20c21 # amask $2,$1
    71     srl \$1,8,\$2
    72     sll \$2,2,\$2
    73     sll \$0,3,\$0
    74     addl \$1,\$0,\$0
    75     addl \$2,\$0,\$0
    76     ret \$31,(\$26),1
    77     .end main
    78 EOF
    79     ${CC-cc} dummy.s -o dummy 2>/dev/null
    80     if test "$?" = 0 ; then
    81         ./dummy
    82         case "$?" in
    83             7)
    84                 UNAME_MACHINE="alpha"
    85                 ;;
    86             15)
    87                 UNAME_MACHINE="alphaev5"
    88                 ;;
    89             14)
    90                 UNAME_MACHINE="alphaev56"
    91                 ;;
    92             10)
    93                 UNAME_MACHINE="alphapca56"
    94                 ;;
    95             16)
    96                 UNAME_MACHINE="alphaev6"
    97                 ;;
    98         esac
    99     fi
    100     rm -f dummy.s dummy
    101     echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
    102     exit 0 ;;
     271    echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
     272    exit ;;
    103273    Alpha\ *:Windows_NT*:*)
    104         # How do we know it's Interix rather than generic posix subsystem?
    105     # Should we change UNAME_MACHINE based on the output of uname
    106     # instead of the specific alpha model.
     274    # How do we know it's Interix rather than the generic POSIX subsystem?
     275    # Should we change UNAME_MACHINE based on the output of uname instead
     276    # of the specific Alpha model?
    107277    echo alpha-pc-interix
    108     exit 0;;
     278    exit ;;
    109279    21064:Windows_NT:50:3)
    110280    echo alpha-dec-winnt3.5
    111     exit 0 ;;
     281    exit ;;
    112282    Amiga*:UNIX_System_V:4.0:*)
    113     echo m68k-cbm-sysv4
    114     exit 0;;
    115     amiga:NetBSD:*:*)
    116       echo m68k-cbm-netbsd${UNAME_RELEASE}
    117       exit 0 ;;
    118     amiga:OpenBSD:*:*)
    119     echo m68k-unknown-openbsd${UNAME_RELEASE}
    120     exit 0 ;;
     283    echo m68k-unknown-sysv4
     284    exit ;;
    121285    *:[Aa]miga[Oo][Ss]:*:*)
    122286    echo ${UNAME_MACHINE}-unknown-amigaos
    123     exit 0 ;;
    124     arc64:OpenBSD:*:*)
    125     echo mips64el-unknown-openbsd${UNAME_RELEASE}
    126     exit 0 ;;
    127     arc:OpenBSD:*:*)
    128     echo mipsel-unknown-openbsd${UNAME_RELEASE}
    129     exit 0 ;;
    130     hkmips:OpenBSD:*:*)
    131     echo mips-unknown-openbsd${UNAME_RELEASE}
    132     exit 0 ;;
    133     pmax:OpenBSD:*:*)
    134     echo mipsel-unknown-openbsd${UNAME_RELEASE}
    135     exit 0 ;;
    136     sgi:OpenBSD:*:*)
    137     echo mips-unknown-openbsd${UNAME_RELEASE}
    138     exit 0 ;;
    139     wgrisc:OpenBSD:*:*)
    140     echo mipsel-unknown-openbsd${UNAME_RELEASE}
    141     exit 0 ;;
     287    exit ;;
     288    *:[Mm]orph[Oo][Ss]:*:*)
     289    echo ${UNAME_MACHINE}-unknown-morphos
     290    exit ;;
     291    *:OS/390:*:*)
     292    echo i370-ibm-openedition
     293    exit ;;
     294    *:z/VM:*:*)
     295    echo s390-ibm-zvmoe
     296    exit ;;
     297    *:OS400:*:*)
     298        echo powerpc-ibm-os400
     299    exit ;;
    142300    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
    143301    echo arm-acorn-riscix${UNAME_RELEASE}
    144     exit 0;;
    145     arm32:NetBSD:*:*)
    146     echo arm-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
    147     exit 0 ;;
    148     SR2?01:HI-UX/MPP:*:*)
     302    exit ;;
     303    arm:riscos:*:*|arm:RISCOS:*:*)
     304    echo arm-unknown-riscos
     305    exit ;;
     306    SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
    149307    echo hppa1.1-hitachi-hiuxmpp
    150     exit 0;;
    151     Pyramid*:OSx*:*:*|MIS*:OSx*:*:*)
     308    exit ;;
     309    Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
    152310    # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
    153311    if test "`(/bin/universe) 2>/dev/null`" = att ; then
    154312        echo pyramid-pyramid-sysv3
    155313    else
    156314        echo pyramid-pyramid-bsd
    157315    fi
    158     exit 0 ;;
    159     NILE:*:*:dcosx)
     316    exit ;;
     317    NILE*:*:*:dcosx)
    160318    echo pyramid-pyramid-svr4
    161     exit 0 ;;
     319    exit ;;
     320    DRS?6000:unix:4.0:6*)
     321    echo sparc-icl-nx6
     322    exit ;;
     323    DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
     324    case `/usr/bin/uname -p` in
     325        sparc) echo sparc-icl-nx7; exit ;;
     326    esac ;;
    162327    sun4H:SunOS:5.*:*)
    163328    echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
    164     exit 0 ;;
     329    exit ;;
    165330    sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
    166331    echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
    167     exit 0 ;;
    168     i86pc:SunOS:5.*:*)
    169     echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
    170     exit 0 ;;
     332    exit ;;
     333    i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
     334    eval $set_cc_for_build
     335    SUN_ARCH="i386"
     336    # If there is a compiler, see if it is configured for 64-bit objects.
     337    # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
     338    # This test works for both compilers.
     339    if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
     340        if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
     341        (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
     342        grep IS_64BIT_ARCH >/dev/null
     343        then
     344        SUN_ARCH="x86_64"
     345        fi
     346    fi
     347    echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
     348    exit ;;
    171349    sun4*:SunOS:6*:*)
    172350    # According to config.sub, this is the proper way to canonicalize
    173351    # SunOS6.  Hard to guess exactly what SunOS6 will be like, but
    174352    # it's likely to be more like Solaris than SunOS4.
    175353    echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
    176     exit 0 ;;
     354    exit ;;
    177355    sun4*:SunOS:*:*)
    178356    case "`/usr/bin/arch -k`" in
    179357        Series*|S4*)
     
    182360    esac
    183361    # Japanese Language versions have a version number like `4.1.3-JL'.
    184362    echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
    185     exit 0 ;;
     363    exit ;;
    186364    sun3*:SunOS:*:*)
    187365    echo m68k-sun-sunos${UNAME_RELEASE}
    188     exit 0 ;;
     366    exit ;;
    189367    sun*:*:4.2BSD:*)
    190     UNAME_RELEASE=`(head -1 /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
     368    UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
    191369    test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
    192370    case "`/bin/arch`" in
    193371        sun3)
     
    197375        echo sparc-sun-sunos${UNAME_RELEASE}
    198376        ;;
    199377    esac
    200     exit 0 ;;
     378    exit ;;
    201379    aushp:SunOS:*:*)
    202380    echo sparc-auspex-sunos${UNAME_RELEASE}
    203     exit 0 ;;
    204     atari*:NetBSD:*:*)
    205     echo m68k-atari-netbsd${UNAME_RELEASE}
    206     exit 0 ;;
    207     atari*:OpenBSD:*:*)
    208     echo m68k-unknown-openbsd${UNAME_RELEASE}
    209     exit 0 ;;
    210     sun3*:NetBSD:*:*)
    211     echo m68k-sun-netbsd${UNAME_RELEASE}
    212     exit 0 ;;
    213     sun3*:OpenBSD:*:*)
    214     echo m68k-unknown-openbsd${UNAME_RELEASE}
    215     exit 0 ;;
    216     mac68k:NetBSD:*:*)
    217     echo m68k-apple-netbsd${UNAME_RELEASE}
    218     exit 0 ;;
    219     mac68k:OpenBSD:*:*)
    220     echo m68k-unknown-openbsd${UNAME_RELEASE}
    221     exit 0 ;;
    222     mvme68k:OpenBSD:*:*)
    223     echo m68k-unknown-openbsd${UNAME_RELEASE}
    224     exit 0 ;;
    225     mvme88k:OpenBSD:*:*)
    226     echo m88k-unknown-openbsd${UNAME_RELEASE}
    227     exit 0 ;;
     381    exit ;;
     382    # The situation for MiNT is a little confusing.  The machine name
     383    # can be virtually everything (everything which is not
     384    # "atarist" or "atariste" at least should have a processor
     385    # > m68000).  The system name ranges from "MiNT" over "FreeMiNT"
     386    # to the lowercase version "mint" (or "freemint").  Finally
     387    # the system name "TOS" denotes a system which is actually not
     388    # MiNT.  But MiNT is downward compatible to TOS, so this should
     389    # be no problem.
     390    atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
     391        echo m68k-atari-mint${UNAME_RELEASE}
     392    exit ;;
     393    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
     394    echo m68k-atari-mint${UNAME_RELEASE}
     395        exit ;;
     396    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
     397        echo m68k-atari-mint${UNAME_RELEASE}
     398    exit ;;
     399    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
     400        echo m68k-milan-mint${UNAME_RELEASE}
     401        exit ;;
     402    hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
     403        echo m68k-hades-mint${UNAME_RELEASE}
     404        exit ;;
     405    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
     406        echo m68k-unknown-mint${UNAME_RELEASE}
     407        exit ;;
     408    m68k:machten:*:*)
     409    echo m68k-apple-machten${UNAME_RELEASE}
     410    exit ;;
    228411    powerpc:machten:*:*)
    229412    echo powerpc-apple-machten${UNAME_RELEASE}
    230     exit 0 ;;
     413    exit ;;
    231414    RISC*:Mach:*:*)
    232415    echo mips-dec-mach_bsd4.3
    233     exit 0 ;;
     416    exit ;;
    234417    RISC*:ULTRIX:*:*)
    235418    echo mips-dec-ultrix${UNAME_RELEASE}
    236     exit 0 ;;
     419    exit ;;
    237420    VAX*:ULTRIX*:*:*)
    238421    echo vax-dec-ultrix${UNAME_RELEASE}
    239     exit 0 ;;
    240     2020:CLIX:*:*)
     422    exit ;;
     423    2020:CLIX:*:* | 2430:CLIX:*:*)
    241424    echo clipper-intergraph-clix${UNAME_RELEASE}
    242     exit 0 ;;
     425    exit ;;
    243426    mips:*:*:UMIPS | mips:*:*:RISCos)
    244     sed 's/^    //' << EOF >dummy.c
    245     int main (argc, argv) int argc; char **argv; {
     427    eval $set_cc_for_build
     428    sed 's/^    //' << EOF >$dummy.c
     429#ifdef __cplusplus
     430#include <stdio.h>  /* for printf() prototype */
     431    int main (int argc, char *argv[]) {
     432#else
     433    int main (argc, argv) int argc; char *argv[]; {
     434#endif
    246435    #if defined (host_mips) && defined (MIPSEB)
    247436    #if defined (SYSTYPE_SYSV)
    248437      printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
     
    257446      exit (-1);
    258447    }
    259448EOF
    260     ${CC-cc} dummy.c -o dummy \
    261       && ./dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
    262       && rm dummy.c dummy && exit 0
    263     rm -f dummy.c dummy
     449    $CC_FOR_BUILD -o $dummy $dummy.c &&
     450      dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
     451      SYSTEM_NAME=`$dummy $dummyarg` &&
     452        { echo "$SYSTEM_NAME"; exit; }
    264453    echo mips-mips-riscos${UNAME_RELEASE}
    265     exit 0 ;;
     454    exit ;;
     455    Motorola:PowerMAX_OS:*:*)
     456    echo powerpc-motorola-powermax
     457    exit ;;
     458    Motorola:*:4.3:PL8-*)
     459    echo powerpc-harris-powermax
     460    exit ;;
     461    Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
     462    echo powerpc-harris-powermax
     463    exit ;;
    266464    Night_Hawk:Power_UNIX:*:*)
    267465    echo powerpc-harris-powerunix
    268     exit 0 ;;
     466    exit ;;
    269467    m88k:CX/UX:7*:*)
    270468    echo m88k-harris-cxux7
    271     exit 0 ;;
     469    exit ;;
    272470    m88k:*:4*:R4*)
    273471    echo m88k-motorola-sysv4
    274     exit 0 ;;
     472    exit ;;
    275473    m88k:*:3*:R3*)
    276474    echo m88k-motorola-sysv3
    277     exit 0 ;;
     475    exit ;;
    278476    AViiON:dgux:*:*)
    279477        # DG/UX returns AViiON for all architectures
    280478        UNAME_PROCESSOR=`/usr/bin/uname -p`
    281         if [ $UNAME_PROCESSOR = mc88100 -o $UNAME_PROCESSOR = mc88110 ] ; then
    282     if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx \
    283          -o ${TARGET_BINARY_INTERFACE}x = x ] ; then
     479    if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
     480    then
     481        if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
     482           [ ${TARGET_BINARY_INTERFACE}x = x ]
     483        then
    284484        echo m88k-dg-dgux${UNAME_RELEASE}
     485        else
     486        echo m88k-dg-dguxbcs${UNAME_RELEASE}
     487        fi
    285488    else
    286         echo m88k-dg-dguxbcs${UNAME_RELEASE}
     489        echo i586-dg-dgux${UNAME_RELEASE}
    287490    fi
    288         else echo i586-dg-dgux${UNAME_RELEASE}
    289         fi
    290     exit 0 ;;
     491    exit ;;
    291492    M88*:DolphinOS:*:*) # DolphinOS (SVR3)
    292493    echo m88k-dolphin-sysv3
    293     exit 0 ;;
     494    exit ;;
    294495    M88*:*:R3*:*)
    295496    # Delta 88k system running SVR3
    296497    echo m88k-motorola-sysv3
    297     exit 0 ;;
     498    exit ;;
    298499    XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
    299500    echo m88k-tektronix-sysv3
    300     exit 0 ;;
     501    exit ;;
    301502    Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
    302503    echo m68k-tektronix-bsd
    303     exit 0 ;;
     504    exit ;;
    304505    *:IRIX*:*:*)
    305506    echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
    306     exit 0 ;;
     507    exit ;;
    307508    ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
    308     echo romp-ibm-aix      # uname -m gives an 8 hex-code CPU id
    309     exit 0 ;;              # Note that: echo "'`uname -s`'" gives 'AIX '
    310     i?86:AIX:*:*)
     509    echo romp-ibm-aix     # uname -m gives an 8 hex-code CPU id
     510    exit ;;               # Note that: echo "'`uname -s`'" gives 'AIX '
     511    i*86:AIX:*:*)
    311512    echo i386-ibm-aix
    312     exit 0 ;;
     513    exit ;;
     514    ia64:AIX:*:*)
     515    if [ -x /usr/bin/oslevel ] ; then
     516        IBM_REV=`/usr/bin/oslevel`
     517    else
     518        IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
     519    fi
     520    echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
     521    exit ;;
    313522    *:AIX:2:3)
    314523    if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
    315         sed 's/^        //' << EOF >dummy.c
     524        eval $set_cc_for_build
     525        sed 's/^        //' << EOF >$dummy.c
    316526        #include <sys/systemcfg.h>
    317527
    318528        main()
     
    323533            exit(0);
    324534            }
    325535EOF
    326         ${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0
    327         rm -f dummy.c dummy
    328         echo rs6000-ibm-aix3.2.5
     536        if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
     537        then
     538            echo "$SYSTEM_NAME"
     539        else
     540            echo rs6000-ibm-aix3.2.5
     541        fi
    329542    elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
    330543        echo rs6000-ibm-aix3.2.4
    331544    else
    332545        echo rs6000-ibm-aix3.2
    333546    fi
    334     exit 0 ;;
    335     *:AIX:*:4)
    336     if /usr/sbin/lsattr -EHl proc0 | grep POWER >/dev/null 2>&1; then
     547    exit ;;
     548    *:AIX:*:[456])
     549    IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
     550    if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
    337551        IBM_ARCH=rs6000
    338552    else
    339553        IBM_ARCH=powerpc
     
    341555    if [ -x /usr/bin/oslevel ] ; then
    342556        IBM_REV=`/usr/bin/oslevel`
    343557    else
    344         IBM_REV=4.${UNAME_RELEASE}
     558        IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
    345559    fi
    346560    echo ${IBM_ARCH}-ibm-aix${IBM_REV}
    347     exit 0 ;;
     561    exit ;;
    348562    *:AIX:*:*)
    349563    echo rs6000-ibm-aix
    350     exit 0 ;;
     564    exit ;;
    351565    ibmrt:4.4BSD:*|romp-ibm:BSD:*)
    352566    echo romp-ibm-bsd4.4
    353     exit 0 ;;
    354     ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC NetBSD and
     567    exit ;;
     568    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
    355569    echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
    356     exit 0 ;;                           # report: romp-ibm BSD 4.3
     570    exit ;;                             # report: romp-ibm BSD 4.3
    357571    *:BOSX:*:*)
    358572    echo rs6000-bull-bosx
    359     exit 0 ;;
     573    exit ;;
    360574    DPX/2?00:B.O.S.:*:*)
    361575    echo m68k-bull-sysv3
    362     exit 0 ;;
     576    exit ;;
    363577    9000/[34]??:4.3bsd:1.*:*)
    364578    echo m68k-hp-bsd
    365     exit 0 ;;
     579    exit ;;
    366580    hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
    367581    echo m68k-hp-bsd4.4
    368     exit 0 ;;
    369     *9??*:MPE/iX:*:*)
    370     echo hppa1.0-hp-mpeix
    371     exit 0 ;;
     582    exit ;;
    372583    9000/[34678]??:HP-UX:*:*)
     584    HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
    373585    case "${UNAME_MACHINE}" in
    374586        9000/31? )            HP_ARCH=m68000 ;;
    375587        9000/[34]?? )         HP_ARCH=m68k ;;
    376         9000/[678][0-9][0-9] )
     588        9000/[678][0-9][0-9])
     589        if [ -x /usr/bin/getconf ]; then
     590            sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
     591                    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
     592                    case "${sc_cpu_version}" in
     593                      523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
     594                      528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
     595                      532)                      # CPU_PA_RISC2_0
     596                        case "${sc_kernel_bits}" in
     597                          32) HP_ARCH="hppa2.0n" ;;
     598                          64) HP_ARCH="hppa2.0w" ;;
     599              '') HP_ARCH="hppa2.0" ;;   # HP-UX 10.20
     600                        esac ;;
     601                    esac
     602        fi
     603        if [ "${HP_ARCH}" = "" ]; then
     604            eval $set_cc_for_build
     605            sed 's/^              //' << EOF >$dummy.c
    377606
    378               sed 's/^              //' << EOF >dummy.c
     607              #define _HPUX_SOURCE
    379608              #include <stdlib.h>
    380609              #include <unistd.h>
    381              
     610
    382611              int main ()
    383612              {
    384613              #if defined(_SC_KERNEL_BITS)
    385614                  long bits = sysconf(_SC_KERNEL_BITS);
    386               #endif 
     615              #endif
    387616                  long cpu  = sysconf (_SC_CPU_VERSION);
    388              
    389                   switch (cpu) 
     617
     618                  switch (cpu)
    390619                {
    391620                case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
    392621                case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
    393                 case CPU_PA_RISC2_0: 
     622                case CPU_PA_RISC2_0:
    394623              #if defined(_SC_KERNEL_BITS)
    395                     switch (bits) 
     624                    switch (bits)
    396625                    {
    397626                    case 64: puts ("hppa2.0w"); break;
    398627                    case 32: puts ("hppa2.0n"); break;
     
    400629                    } break;
    401630              #else  /* !defined(_SC_KERNEL_BITS) */
    402631                    puts ("hppa2.0"); break;
    403               #endif 
     632              #endif
    404633                default: puts ("hppa1.0"); break;
    405634                }
    406635                  exit (0);
    407636              }
    408637EOF
    409     (${CC-cc} dummy.c -o dummy 2>/dev/null ) && HP_ARCH=`./dummy`
    410     rm -f dummy.c dummy
     638            (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
     639            test -z "$HP_ARCH" && HP_ARCH=hppa
     640        fi ;;
    411641    esac
     642    if [ ${HP_ARCH} = "hppa2.0w" ]
     643    then
     644        eval $set_cc_for_build
     645
     646        # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
     647        # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler
     648        # generating 64-bit code.  GNU and HP use different nomenclature:
     649        #
     650        # $ CC_FOR_BUILD=cc ./config.guess
     651        # => hppa2.0w-hp-hpux11.23
     652        # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
     653        # => hppa64-hp-hpux11.23
     654
     655        if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
     656        grep __LP64__ >/dev/null
     657        then
     658        HP_ARCH="hppa2.0w"
     659        else
     660        HP_ARCH="hppa64"
     661        fi
     662    fi
     663    echo ${HP_ARCH}-hp-hpux${HPUX_REV}
     664    exit ;;
     665    ia64:HP-UX:*:*)
    412666    HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
    413     echo ${HP_ARCH}-hp-hpux${HPUX_REV}
    414     exit 0 ;;
     667    echo ia64-hp-hpux${HPUX_REV}
     668    exit ;;
    415669    3050*:HI-UX:*:*)
    416     sed 's/^    //' << EOF >dummy.c
     670    eval $set_cc_for_build
     671    sed 's/^    //' << EOF >$dummy.c
    417672    #include <unistd.h>
    418673    int
    419674    main ()
     
    438693      exit (0);
    439694    }
    440695EOF
    441     ${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0
    442     rm -f dummy.c dummy
     696    $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
     697        { echo "$SYSTEM_NAME"; exit; }
    443698    echo unknown-hitachi-hiuxwe2
    444     exit 0 ;;
     699    exit ;;
    445700    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
    446701    echo hppa1.1-hp-bsd
    447     exit 0 ;;
     702    exit ;;
    448703    9000/8??:4.3bsd:*:*)
    449704    echo hppa1.0-hp-bsd
    450     exit 0 ;;
     705    exit ;;
     706    *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
     707    echo hppa1.0-hp-mpeix
     708    exit ;;
    451709    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
    452710    echo hppa1.1-hp-osf
    453     exit 0 ;;
     711    exit ;;
    454712    hp8??:OSF1:*:*)
    455713    echo hppa1.0-hp-osf
    456     exit 0 ;;
    457     i?86:OSF1:*:*)
     714    exit ;;
     715    i*86:OSF1:*:*)
    458716    if [ -x /usr/sbin/sysversion ] ; then
    459717        echo ${UNAME_MACHINE}-unknown-osf1mk
    460718    else
    461719        echo ${UNAME_MACHINE}-unknown-osf1
    462720    fi
    463     exit 0 ;;
     721    exit ;;
    464722    parisc*:Lites*:*:*)
    465723    echo hppa1.1-hp-lites
    466     exit 0 ;;
    467     hppa*:OpenBSD:*:*)
    468     echo hppa-unknown-openbsd
    469     exit 0 ;;
     724    exit ;;
    470725    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
    471726    echo c1-convex-bsd
    472         exit 0 ;;
     727        exit ;;
    473728    C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
    474729    if getsysinfo -f scalar_acc
    475730    then echo c32-convex-bsd
    476731    else echo c2-convex-bsd
    477732    fi
    478         exit 0 ;;
     733        exit ;;
    479734    C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
    480735    echo c34-convex-bsd
    481         exit 0 ;;
     736        exit ;;
    482737    C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
    483738    echo c38-convex-bsd
    484         exit 0 ;;
     739        exit ;;
    485740    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
    486741    echo c4-convex-bsd
    487         exit 0 ;;
    488     CRAY*X-MP:*:*:*)
    489     echo xmp-cray-unicos
    490         exit 0 ;;
     742        exit ;;
    491743    CRAY*Y-MP:*:*:*)
    492     echo ymp-cray-unicos${UNAME_RELEASE}
    493     exit 0 ;;
     744    echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
     745    exit ;;
    494746    CRAY*[A-Z]90:*:*:*)
    495747    echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
    496748    | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
    497           -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/
    498     exit 0 ;;
     749          -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
     750          -e 's/\.[^.]*$/.X/'
     751    exit ;;
    499752    CRAY*TS:*:*:*)
    500     echo t90-cray-unicos${UNAME_RELEASE}
    501     exit 0 ;;
    502     CRAY-2:*:*:*)
    503     echo cray2-cray-unicos
    504         exit 0 ;;
    505     F300:UNIX_System_V:*:*)
     753    echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
     754    exit ;;
     755    CRAY*T3E:*:*:*)
     756    echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
     757    exit ;;
     758    CRAY*SV1:*:*:*)
     759    echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
     760    exit ;;
     761    *:UNICOS/mp:*:*)
     762    echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
     763    exit ;;
     764    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
     765    FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
    506766        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
    507767        FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
    508         echo "f300-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
    509         exit 0 ;;
    510     F301:UNIX_System_V:*:*)
    511        echo f301-fujitsu-uxpv`echo $UNAME_RELEASE | sed 's/ .*//'`
    512        exit 0 ;;
    513     hp3[0-9][05]:NetBSD:*:*)
    514     echo m68k-hp-netbsd${UNAME_RELEASE}
    515     exit 0 ;;
    516     hp300:OpenBSD:*:*)
    517     echo m68k-unknown-openbsd${UNAME_RELEASE}
    518     exit 0 ;;
    519     i?86:BSD/386:*:* | *:BSD/OS:*:*)
     768        echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
     769        exit ;;
     770    5000:UNIX_System_V:4.*:*)
     771        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
     772        FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
     773        echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
     774    exit ;;
     775    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
    520776    echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
    521     exit 0 ;;
     777    exit ;;
     778    sparc*:BSD/OS:*:*)
     779    echo sparc-unknown-bsdi${UNAME_RELEASE}
     780    exit ;;
     781    *:BSD/OS:*:*)
     782    echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
     783    exit ;;
    522784    *:FreeBSD:*:*)
    523         if test -x /usr/bin/objformat -a "elf" = "`/usr/bin/objformat`"; then
    524           echo ${UNAME_MACHINE}-unknown-freebsdelf
    525         else
    526       echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*//'`
    527       fi
    528     exit 0 ;;
    529     *:NetBSD:*:*)
    530     echo ${UNAME_MACHINE}-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
    531     exit 0 ;;
    532     *:OpenBSD:*:*)
    533     echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
    534     exit 0 ;;
     785    case ${UNAME_MACHINE} in
     786        pc98)
     787        echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
     788        amd64)
     789        echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
     790        *)
     791        echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
     792    esac
     793    exit ;;
    535794    i*:CYGWIN*:*)
    536     echo ${UNAME_MACHINE}-pc-cygwin32
    537     exit 0 ;;
    538     i*:MINGW*:*)
     795    echo ${UNAME_MACHINE}-pc-cygwin
     796    exit ;;
     797    *:MINGW*:*)
    539798    echo ${UNAME_MACHINE}-pc-mingw32
    540     exit 0 ;;
     799    exit ;;
     800    i*:windows32*:*)
     801        # uname -m includes "-pc" on this system.
     802        echo ${UNAME_MACHINE}-mingw32
     803    exit ;;
     804    i*:PW*:*)
     805    echo ${UNAME_MACHINE}-pc-pw32
     806    exit ;;
     807    *:Interix*:[3456]*)
     808        case ${UNAME_MACHINE} in
     809        x86)
     810        echo i586-pc-interix${UNAME_RELEASE}
     811        exit ;;
     812        EM64T | authenticamd | genuineintel)
     813        echo x86_64-unknown-interix${UNAME_RELEASE}
     814        exit ;;
     815        IA64)
     816        echo ia64-unknown-interix${UNAME_RELEASE}
     817        exit ;;
     818    esac ;;
     819    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
     820    echo i${UNAME_MACHINE}-pc-mks
     821    exit ;;
    541822    i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
    542         # How do we know it's Interix rather than generic posix subsystem?
     823    # How do we know it's Interix rather than the generic POSIX subsystem?
    543824    # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
    544     # change UNAME_MACHINE based on the output of uname instead of
    545     # i386?
    546     echo i386-pc-interix
    547     exit 0 ;;
     825    # UNAME_MACHINE based on the output of uname instead of i386?
     826    echo i586-pc-interix
     827    exit ;;
    548828    i*:UWIN*:*)
    549829    echo ${UNAME_MACHINE}-pc-uwin
    550     exit 0 ;;
     830    exit ;;
     831    amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
     832    echo x86_64-unknown-cygwin
     833    exit ;;
    551834    p*:CYGWIN*:*)
    552     echo powerpcle-unknown-cygwin32
    553     exit 0 ;;
     835    echo powerpcle-unknown-cygwin
     836    exit ;;
    554837    prep*:SunOS:5.*:*)
    555838    echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
    556     exit 0 ;;
     839    exit ;;
    557840    *:GNU:*:*)
     841    # the GNU system
    558842    echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
    559     exit 0 ;;
    560     *:Linux:*:*)
    561     # uname on the ARM produces all sorts of strangeness, and we need to
    562     # filter it out.
    563     case "$UNAME_MACHINE" in
    564       armv*)              UNAME_MACHINE=$UNAME_MACHINE ;;
    565       arm* | sa110*)          UNAME_MACHINE="arm" ;;
     843    exit ;;
     844    *:GNU/*:*:*)
     845    # other systems with GNU libc and userland
     846    echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
     847    exit ;;
     848    i*86:Minix:*:*)
     849    echo ${UNAME_MACHINE}-pc-minix
     850    exit ;;
     851    arm*:Linux:*:*)
     852    eval $set_cc_for_build
     853    if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
     854        | grep -q __ARM_EABI__
     855    then
     856        echo ${UNAME_MACHINE}-unknown-linux-gnu
     857    else
     858        echo ${UNAME_MACHINE}-unknown-linux-gnueabi
     859    fi
     860    exit ;;
     861    avr32*:Linux:*:*)
     862    echo ${UNAME_MACHINE}-unknown-linux-gnu
     863    exit ;;
     864    cris:Linux:*:*)
     865    echo cris-axis-linux-gnu
     866    exit ;;
     867    crisv32:Linux:*:*)
     868    echo crisv32-axis-linux-gnu
     869    exit ;;
     870    frv:Linux:*:*)
     871        echo frv-unknown-linux-gnu
     872    exit ;;
     873    ia64:Linux:*:*)
     874    echo ${UNAME_MACHINE}-unknown-linux-gnu
     875    exit ;;
     876    m32r*:Linux:*:*)
     877    echo ${UNAME_MACHINE}-unknown-linux-gnu
     878    exit ;;
     879    m68*:Linux:*:*)
     880    echo ${UNAME_MACHINE}-unknown-linux-gnu
     881    exit ;;
     882    mips:Linux:*:*)
     883    eval $set_cc_for_build
     884    sed 's/^    //' << EOF >$dummy.c
     885    #undef CPU
     886    #undef mips
     887    #undef mipsel
     888    #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
     889    CPU=mipsel
     890    #else
     891    #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
     892    CPU=mips
     893    #else
     894    CPU=
     895    #endif
     896    #endif
     897EOF
     898    eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
     899        /^CPU/{
     900        s: ::g
     901        p
     902        }'`"
     903    test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
     904    ;;
     905    mips64:Linux:*:*)
     906    eval $set_cc_for_build
     907    sed 's/^    //' << EOF >$dummy.c
     908    #undef CPU
     909    #undef mips64
     910    #undef mips64el
     911    #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
     912    CPU=mips64el
     913    #else
     914    #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
     915    CPU=mips64
     916    #else
     917    CPU=
     918    #endif
     919    #endif
     920EOF
     921    eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
     922        /^CPU/{
     923        s: ::g
     924        p
     925        }'`"
     926    test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
     927    ;;
     928    or32:Linux:*:*)
     929    echo or32-unknown-linux-gnu
     930    exit ;;
     931    ppc:Linux:*:*)
     932    echo powerpc-unknown-linux-gnu
     933    exit ;;
     934    ppc64:Linux:*:*)
     935    echo powerpc64-unknown-linux-gnu
     936    exit ;;
     937    alpha:Linux:*:*)
     938    case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
     939      EV5)   UNAME_MACHINE=alphaev5 ;;
     940      EV56)  UNAME_MACHINE=alphaev56 ;;
     941      PCA56) UNAME_MACHINE=alphapca56 ;;
     942      PCA57) UNAME_MACHINE=alphapca56 ;;
     943      EV6)   UNAME_MACHINE=alphaev6 ;;
     944      EV67)  UNAME_MACHINE=alphaev67 ;;
     945      EV68*) UNAME_MACHINE=alphaev68 ;;
     946        esac
     947    objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
     948    if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
     949    echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
     950    exit ;;
     951    padre:Linux:*:*)
     952    echo sparc-unknown-linux-gnu
     953    exit ;;
     954    parisc:Linux:*:* | hppa:Linux:*:*)
     955    # Look for CPU level
     956    case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
     957      PA7*) echo hppa1.1-unknown-linux-gnu ;;
     958      PA8*) echo hppa2.0-unknown-linux-gnu ;;
     959      *)    echo hppa-unknown-linux-gnu ;;
    566960    esac
    567 
     961    exit ;;
     962    parisc64:Linux:*:* | hppa64:Linux:*:*)
     963    echo hppa64-unknown-linux-gnu
     964    exit ;;
     965    s390:Linux:*:* | s390x:Linux:*:*)
     966    echo ${UNAME_MACHINE}-ibm-linux
     967    exit ;;
     968    sh64*:Linux:*:*)
     969        echo ${UNAME_MACHINE}-unknown-linux-gnu
     970    exit ;;
     971    sh*:Linux:*:*)
     972    echo ${UNAME_MACHINE}-unknown-linux-gnu
     973    exit ;;
     974    sparc:Linux:*:* | sparc64:Linux:*:*)
     975    echo ${UNAME_MACHINE}-unknown-linux-gnu
     976    exit ;;
     977    vax:Linux:*:*)
     978    echo ${UNAME_MACHINE}-dec-linux-gnu
     979    exit ;;
     980    x86_64:Linux:*:*)
     981    echo x86_64-unknown-linux-gnu
     982    exit ;;
     983    xtensa*:Linux:*:*)
     984        echo ${UNAME_MACHINE}-unknown-linux-gnu
     985    exit ;;
     986    i*86:Linux:*:*)
    568987    # The BFD linker knows what the default object file format is, so
    569     # first see if it will tell us.
    570     ld_help_string=`ld --help 2>&1`
    571     ld_supported_emulations=`echo $ld_help_string \
    572              | sed -ne '/supported emulations:/!d
     988    # first see if it will tell us. cd to the root directory to prevent
     989    # problems with other programs or directories called `ld' in the path.
     990    # Set LC_ALL=C to ensure ld outputs messages in English.
     991    ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
     992             | sed -ne '/supported targets:/!d
    573993                    s/[     ][  ]*/ /g
    574                     s/.*supported emulations: *//
     994                    s/.*supported targets: *//
    575995                    s/ .*//
    576996                    p'`
    577         case "$ld_supported_emulations" in
    578       i?86linux)  echo "${UNAME_MACHINE}-pc-linux-gnuaout"      ; exit 0 ;;
    579       i?86coff)   echo "${UNAME_MACHINE}-pc-linux-gnucoff"      ; exit 0 ;;
    580       sparclinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
    581       armlinux)   echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
    582       m68klinux)  echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
    583       elf32ppc | elf32ppclinux)
    584         # Determine Lib Version
    585         cat >dummy.c <<EOF
    586 #include <features.h>
    587 #if defined(__GLIBC__)
    588 extern char __libc_version[];
    589 extern char __libc_release[];
    590 #endif
    591 main(argc, argv)
    592      int argc;
    593      char *argv[];
    594 {
    595 #if defined(__GLIBC__)
    596   printf("%s %s\n", __libc_version, __libc_release);
    597 #else
    598   printf("unkown\n");
    599 #endif
    600   return 0;
    601 }
    602 EOF
    603         LIBC=""
    604         ${CC-cc} dummy.c -o dummy 2>/dev/null
    605         if test "$?" = 0 ; then
    606             ./dummy | grep 1\.99 > /dev/null
    607             if test "$?" = 0 ; then
    608                 LIBC="libc1"
    609             fi
    610         fi 
    611         rm -f dummy.c dummy
    612         echo powerpc-unknown-linux-gnu${LIBC} ; exit 0 ;;
     997        case "$ld_supported_targets" in
     998      elf32-i386)
     999        TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
     1000        ;;
     1001      a.out-i386-linux)
     1002        echo "${UNAME_MACHINE}-pc-linux-gnuaout"
     1003        exit ;;
     1004      "")
     1005        # Either a pre-BFD a.out linker (linux-gnuoldld) or
     1006        # one that does not give us useful --help.
     1007        echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
     1008        exit ;;
    6131009    esac
    614 
    615     if test "${UNAME_MACHINE}" = "alpha" ; then
    616         sed 's/^    //'  <<EOF >dummy.s
    617         .globl main
    618         .ent main
    619     main:
    620         .frame \$30,0,\$26,0
    621         .prologue 0
    622         .long 0x47e03d80 # implver $0
    623         lda \$2,259
    624         .long 0x47e20c21 # amask $2,$1
    625         srl \$1,8,\$2
    626         sll \$2,2,\$2
    627         sll \$0,3,\$0
    628         addl \$1,\$0,\$0
    629         addl \$2,\$0,\$0
    630         ret \$31,(\$26),1
    631         .end main
     1010    # Determine whether the default compiler is a.out or elf
     1011    eval $set_cc_for_build
     1012    sed 's/^    //' << EOF >$dummy.c
     1013    #include <features.h>
     1014    #ifdef __ELF__
     1015    # ifdef __GLIBC__
     1016    #  if __GLIBC__ >= 2
     1017    LIBC=gnu
     1018    #  else
     1019    LIBC=gnulibc1
     1020    #  endif
     1021    # else
     1022    LIBC=gnulibc1
     1023    # endif
     1024    #else
     1025    #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
     1026    LIBC=gnu
     1027    #else
     1028    LIBC=gnuaout
     1029    #endif
     1030    #endif
     1031    #ifdef __dietlibc__
     1032    LIBC=dietlibc
     1033    #endif
    6321034EOF
    633         LIBC=""
    634         ${CC-cc} dummy.s -o dummy 2>/dev/null
    635         if test "$?" = 0 ; then
    636             ./dummy
    637             case "$?" in
    638             7)
    639                 UNAME_MACHINE="alpha"
    640                 ;;
    641             15)
    642                 UNAME_MACHINE="alphaev5"
    643                 ;;
    644             14)
    645                 UNAME_MACHINE="alphaev56"
    646                 ;;
    647             10)
    648                 UNAME_MACHINE="alphapca56"
    649                 ;;
    650             16)
    651                 UNAME_MACHINE="alphaev6"
    652                 ;;
    653             esac   
    654 
    655             objdump --private-headers dummy | \
    656               grep ld.so.1 > /dev/null
    657             if test "$?" = 0 ; then
    658                 LIBC="libc1"
    659             fi
    660         fi 
    661         rm -f dummy.s dummy
    662         echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} ; exit 0
    663     elif test "${UNAME_MACHINE}" = "mips" ; then
    664       cat >dummy.c <<EOF
    665 main(argc, argv)
    666      int argc;
    667      char *argv[];
    668 {
    669 #ifdef __MIPSEB__
    670   printf ("%s-unknown-linux-gnu\n", argv[1]);
    671 #endif
    672 #ifdef __MIPSEL__
    673   printf ("%sel-unknown-linux-gnu\n", argv[1]);
    674 #endif
    675   return 0;
    676 }
    677 EOF
    678       ${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy "${UNAME_MACHINE}" && rm dummy.c dummy && exit 0
    679       rm -f dummy.c dummy
    680     else
    681       # Either a pre-BFD a.out linker (linux-gnuoldld)
    682       # or one that does not give us useful --help.
    683       # GCC wants to distinguish between linux-gnuoldld and linux-gnuaout.
    684       # If ld does not provide *any* "supported emulations:"
    685       # that means it is gnuoldld.
    686       echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations:"
    687       test $? != 0 && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0
    688 
    689       case "${UNAME_MACHINE}" in
    690       i?86)
    691         VENDOR=pc;
    692         ;;
    693       *)
    694         VENDOR=unknown;
    695         ;;
    696       esac
    697       # Determine whether the default compiler is a.out or elf
    698       cat >dummy.c <<EOF
    699 #include <features.h>
    700 main(argc, argv)
    701      int argc;
    702      char *argv[];
    703 {
    704 #ifdef __ELF__
    705 # ifdef __GLIBC__
    706 #  if __GLIBC__ >= 2
    707     printf ("%s-${VENDOR}-linux-gnu\n", argv[1]);
    708 #  else
    709     printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]);
    710 #  endif
    711 # else
    712    printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]);
    713 # endif
    714 #else
    715   printf ("%s-${VENDOR}-linux-gnuaout\n", argv[1]);
    716 #endif
    717   return 0;
    718 }
    719 EOF
    720       ${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy "${UNAME_MACHINE}" && rm dummy.c dummy && exit 0
    721       rm -f dummy.c dummy
    722     fi ;;
    723 # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.  earlier versions
    724 # are messed up and put the nodename in both sysname and nodename.
    725     i?86:DYNIX/ptx:4*:*)
     1035    eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
     1036        /^LIBC/{
     1037        s: ::g
     1038        p
     1039        }'`"
     1040    test x"${LIBC}" != x && {
     1041        echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
     1042        exit
     1043    }
     1044    test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
     1045    ;;
     1046    i*86:DYNIX/ptx:4*:*)
     1047    # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
     1048    # earlier versions are messed up and put the nodename in both
     1049    # sysname and nodename.
    7261050    echo i386-sequent-sysv4
    727     exit 0 ;;
    728     i?86:UNIX_SV:4.2MP:2.*)
     1051    exit ;;
     1052    i*86:UNIX_SV:4.2MP:2.*)
    7291053        # Unixware is an offshoot of SVR4, but it has its own version
    7301054        # number series starting with 2...
    7311055        # I am not positive that other SVR4 systems won't match this,
    7321056    # I just have to hope.  -- rms.
    7331057        # Use sysv4.2uw... so that sysv4* matches it.
    7341058    echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
    735     exit 0 ;;
    736     i?86:*:4.*:* | i?86:SYSTEM_V:4.*:*)
     1059    exit ;;
     1060    i*86:OS/2:*:*)
     1061    # If we were able to find `uname', then EMX Unix compatibility
     1062    # is probably installed.
     1063    echo ${UNAME_MACHINE}-pc-os2-emx
     1064    exit ;;
     1065    i*86:XTS-300:*:STOP)
     1066    echo ${UNAME_MACHINE}-unknown-stop
     1067    exit ;;
     1068    i*86:atheos:*:*)
     1069    echo ${UNAME_MACHINE}-unknown-atheos
     1070    exit ;;
     1071    i*86:syllable:*:*)
     1072    echo ${UNAME_MACHINE}-pc-syllable
     1073    exit ;;
     1074    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
     1075    echo i386-unknown-lynxos${UNAME_RELEASE}
     1076    exit ;;
     1077    i*86:*DOS:*:*)
     1078    echo ${UNAME_MACHINE}-pc-msdosdjgpp
     1079    exit ;;
     1080    i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
     1081    UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
    7371082    if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
    738         echo ${UNAME_MACHINE}-univel-sysv${UNAME_RELEASE}
     1083        echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
    7391084    else
    740         echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE}
     1085        echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
    7411086    fi
    742     exit 0 ;;
    743     i?86:*:5:7*)
    744        UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')`
    745        (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
    746        (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \
    747                && UNAME_MACHINE=i586
    748 # 5.0.4c returns "Pent II".  5.0.5 returns PentII
    749        (/bin/uname -X|egrep '^Machine.*Pent.*II' >/dev/null) \
    750                && UNAME_MACHINE=i686
    751        (/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \
    752                && UNAME_MACHINE=i686
    753        echo ${UNAME_MACHINE}-${UNAME_SYSTEM}${UNAME_VERSION}-sysv${UNAME_RELEASE}
    754        exit 0 ;;
    755     i?86:*:3.2:*)
     1087    exit ;;
     1088    i*86:*:5:[678]*)
     1089        # UnixWare 7.x, OpenUNIX and OpenServer 6.
     1090    case `/bin/uname -X | grep "^Machine"` in
     1091        *486*)       UNAME_MACHINE=i486 ;;
     1092        *Pentium)        UNAME_MACHINE=i586 ;;
     1093        *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
     1094    esac
     1095    echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
     1096    exit ;;
     1097    i*86:*:3.2:*)
    7561098    if test -f /usr/options/cb.name; then
    7571099        UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
    7581100        echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
    7591101    elif /bin/uname -X 2>/dev/null >/dev/null ; then
    760         UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')`
    761         (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
    762         (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \
     1102        UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
     1103        (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
     1104        (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
    7631105            && UNAME_MACHINE=i586
    764         (/bin/uname -X|egrep '^Machine.*PentII' >/dev/null) \
     1106        (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
    7651107            && UNAME_MACHINE=i686
    766         (/bin/uname -X|egrep '^Machine.*Pent II' >/dev/null) \
     1108        (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
    7671109            && UNAME_MACHINE=i686
    768                 (/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \
    769                         && UNAME_MACHINE=i686
    7701110        echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
    7711111    else
    7721112        echo ${UNAME_MACHINE}-pc-sysv32
    7731113    fi
    774     exit 0 ;;
     1114    exit ;;
    7751115    pc:*:*:*)
     1116    # Left here for compatibility:
    7761117        # uname -m prints for DJGPP always 'pc', but it prints nothing about
    7771118        # the processor, so we play safe by assuming i386.
    7781119    echo i386-pc-msdosdjgpp
    779         exit 0 ;;
     1120        exit ;;
    7801121    Intel:Mach:3*:*)
    7811122    echo i386-pc-mach3
    782     exit 0 ;;
     1123    exit ;;
    7831124    paragon:*:*:*)
    7841125    echo i860-intel-osf1
    785     exit 0 ;;
     1126    exit ;;
    7861127    i860:*:4.*:*) # i860-SVR4
    7871128    if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
    7881129      echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
    7891130    else # Add other i860-SVR4 vendors below as they are discovered.
    7901131      echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
    7911132    fi
    792     exit 0 ;;
     1133    exit ;;
    7931134    mini*:CTIX:SYS*5:*)
    7941135    # "miniframe"
    7951136    echo m68010-convergent-sysv
    796     exit 0 ;;
    797     M68*:*:R3V[567]*:*)
    798     test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
    799     3[34]??:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0)
     1137    exit ;;
     1138    mc68k:UNIX:SYSTEM5:3.51m)
     1139    echo m68k-convergent-sysv
     1140    exit ;;
     1141    M680?0:D-NIX:5.3:*)
     1142    echo m68k-diab-dnix
     1143    exit ;;
     1144    M68*:*:R3V[5678]*:*)
     1145    test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
     1146    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)
    8001147    OS_REL=''
    8011148    test -r /etc/.relid \
    8021149    && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
    8031150    /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
    804       && echo i486-ncr-sysv4.3${OS_REL} && exit 0
     1151      && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
    8051152    /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
    806       && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;;
     1153      && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
    8071154    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
    8081155        /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
    809           && echo i486-ncr-sysv4 && exit 0 ;;
    810     m68*:LynxOS:2.*:*)
     1156          && { echo i486-ncr-sysv4; exit; } ;;
     1157    NCR*:*:4.2:* | MPRAS*:*:4.2:*)
     1158    OS_REL='.3'
     1159    test -r /etc/.relid \
     1160        && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
     1161    /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
     1162        && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
     1163    /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
     1164        && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
     1165    /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
     1166        && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
     1167    m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
    8111168    echo m68k-unknown-lynxos${UNAME_RELEASE}
    812     exit 0 ;;
     1169    exit ;;
    8131170    mc68030:UNIX_System_V:4.*:*)
    8141171    echo m68k-atari-sysv4
    815     exit 0 ;;
    816     i?86:LynxOS:2.*:*)
    817     echo i386-unknown-lynxos${UNAME_RELEASE}
    818     exit 0 ;;
     1172    exit ;;
    8191173    TSUNAMI:LynxOS:2.*:*)
    8201174    echo sparc-unknown-lynxos${UNAME_RELEASE}
    821     exit 0 ;;
    822     rs6000:LynxOS:2.*:* | PowerPC:LynxOS:2.*:*)
     1175    exit ;;
     1176    rs6000:LynxOS:2.*:*)
    8231177    echo rs6000-unknown-lynxos${UNAME_RELEASE}
    824     exit 0 ;;
     1178    exit ;;
     1179    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
     1180    echo powerpc-unknown-lynxos${UNAME_RELEASE}
     1181    exit ;;
    8251182    SM[BE]S:UNIX_SV:*:*)
    8261183    echo mips-dde-sysv${UNAME_RELEASE}
    827     exit 0 ;;
     1184    exit ;;
     1185    RM*:ReliantUNIX-*:*:*)
     1186    echo mips-sni-sysv4
     1187    exit ;;
    8281188    RM*:SINIX-*:*:*)
    8291189    echo mips-sni-sysv4
    830     exit 0 ;;
    831     RM*:ReliantUNIX-*:*:*)
    832     echo mips-sni-sysv4
    833     exit 0 ;;
     1190    exit ;;
    8341191    *:SINIX-*:*:*)
    8351192    if uname -p 2>/dev/null >/dev/null ; then
    8361193        UNAME_MACHINE=`(uname -p) 2>/dev/null`
     
    8381195    else
    8391196        echo ns32k-sni-sysv
    8401197    fi
    841     exit 0 ;;
    842     PENTIUM:CPunix:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
    843                            # says <Richard.M.Bartel@ccMail.Census.GOV>
     1198    exit ;;
     1199    PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
     1200                      # says <Richard.M.Bartel@ccMail.Census.GOV>
    8441201        echo i586-unisys-sysv4
    845         exit 0 ;;
     1202        exit ;;
    8461203    *:UNIX_System_V:4*:FTX*)
    8471204    # From Gerald Hewes <hewes@openmarket.com>.
    8481205    # How about differentiating between stratus architectures? -djm
    8491206    echo hppa1.1-stratus-sysv4
    850     exit 0 ;;
     1207    exit ;;
    8511208    *:*:*:FTX*)
    8521209    # From seanf@swdc.stratus.com.
    8531210    echo i860-stratus-sysv4
    854     exit 0 ;;
     1211    exit ;;
     1212    i*86:VOS:*:*)
     1213    # From Paul.Green@stratus.com.
     1214    echo ${UNAME_MACHINE}-stratus-vos
     1215    exit ;;
     1216    *:VOS:*:*)
     1217    # From Paul.Green@stratus.com.
     1218    echo hppa1.1-stratus-vos
     1219    exit ;;
    8551220    mc68*:A/UX:*:*)
    8561221    echo m68k-apple-aux${UNAME_RELEASE}
    857     exit 0 ;;
    858     news*:NEWS-OS:*:6*)
     1222    exit ;;
     1223    news*:NEWS-OS:6*:*)
    8591224    echo mips-sony-newsos6
    860     exit 0 ;;
    861     R3000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R4000:UNIX_SV:*:*)
     1225    exit ;;
     1226    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
    8621227    if [ -d /usr/nec ]; then
    8631228            echo mips-nec-sysv${UNAME_RELEASE}
    8641229    else
    8651230            echo mips-unknown-sysv${UNAME_RELEASE}
    8661231    fi
    867         exit 0 ;;
     1232        exit ;;
    8681233    BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
    8691234    echo powerpc-be-beos
    870     exit 0 ;;
     1235    exit ;;
    8711236    BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
    8721237    echo powerpc-apple-beos
    873     exit 0 ;;
     1238    exit ;;
    8741239    BePC:BeOS:*:*)  # BeOS running on Intel PC compatible.
    8751240    echo i586-pc-beos
    876     exit 0 ;;
    877     BeMac:Haiku:*:*)
    878     echo powerpc-apple-haiku
    879     exit 0 ;;
    880     BePC:Haiku:*:*)
     1241    exit ;;
     1242    BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
    8811243    echo i586-pc-haiku
    882     exit 0 ;;
     1244    exit ;;
     1245    SX-4:SUPER-UX:*:*)
     1246    echo sx4-nec-superux${UNAME_RELEASE}
     1247    exit ;;
     1248    SX-5:SUPER-UX:*:*)
     1249    echo sx5-nec-superux${UNAME_RELEASE}
     1250    exit ;;
     1251    SX-6:SUPER-UX:*:*)
     1252    echo sx6-nec-superux${UNAME_RELEASE}
     1253    exit ;;
     1254    SX-7:SUPER-UX:*:*)
     1255    echo sx7-nec-superux${UNAME_RELEASE}
     1256    exit ;;
     1257    SX-8:SUPER-UX:*:*)
     1258    echo sx8-nec-superux${UNAME_RELEASE}
     1259    exit ;;
     1260    SX-8R:SUPER-UX:*:*)
     1261    echo sx8r-nec-superux${UNAME_RELEASE}
     1262    exit ;;
     1263    Power*:Rhapsody:*:*)
     1264    echo powerpc-apple-rhapsody${UNAME_RELEASE}
     1265    exit ;;
     1266    *:Rhapsody:*:*)
     1267    echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
     1268    exit ;;
     1269    *:Darwin:*:*)
     1270    UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
     1271    case $UNAME_PROCESSOR in
     1272        unknown) UNAME_PROCESSOR=powerpc ;;
     1273    esac
     1274    echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
     1275    exit ;;
     1276    *:procnto*:*:* | *:QNX:[0123456789]*:*)
     1277    UNAME_PROCESSOR=`uname -p`
     1278    if test "$UNAME_PROCESSOR" = "x86"; then
     1279        UNAME_PROCESSOR=i386
     1280        UNAME_MACHINE=pc
     1281    fi
     1282    echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
     1283    exit ;;
     1284    *:QNX:*:4*)
     1285    echo i386-pc-qnx
     1286    exit ;;
     1287    NSE-?:NONSTOP_KERNEL:*:*)
     1288    echo nse-tandem-nsk${UNAME_RELEASE}
     1289    exit ;;
     1290    NSR-?:NONSTOP_KERNEL:*:*)
     1291    echo nsr-tandem-nsk${UNAME_RELEASE}
     1292    exit ;;
     1293    *:NonStop-UX:*:*)
     1294    echo mips-compaq-nonstopux
     1295    exit ;;
     1296    BS2000:POSIX*:*:*)
     1297    echo bs2000-siemens-sysv
     1298    exit ;;
     1299    DS/*:UNIX_System_V:*:*)
     1300    echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
     1301    exit ;;
     1302    *:Plan9:*:*)
     1303    # "uname -m" is not consistent, so use $cputype instead. 386
     1304    # is converted to i386 for consistency with other x86
     1305    # operating systems.
     1306    if test "$cputype" = "386"; then
     1307        UNAME_MACHINE=i386
     1308    else
     1309        UNAME_MACHINE="$cputype"
     1310    fi
     1311    echo ${UNAME_MACHINE}-unknown-plan9
     1312    exit ;;
     1313    *:TOPS-10:*:*)
     1314    echo pdp10-unknown-tops10
     1315    exit ;;
     1316    *:TENEX:*:*)
     1317    echo pdp10-unknown-tenex
     1318    exit ;;
     1319    KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
     1320    echo pdp10-dec-tops20
     1321    exit ;;
     1322    XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
     1323    echo pdp10-xkl-tops20
     1324    exit ;;
     1325    *:TOPS-20:*:*)
     1326    echo pdp10-unknown-tops20
     1327    exit ;;
     1328    *:ITS:*:*)
     1329    echo pdp10-unknown-its
     1330    exit ;;
     1331    SEI:*:*:SEIUX)
     1332        echo mips-sei-seiux${UNAME_RELEASE}
     1333    exit ;;
     1334    *:DragonFly:*:*)
     1335    echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
     1336    exit ;;
     1337    *:*VMS:*:*)
     1338        UNAME_MACHINE=`(uname -p) 2>/dev/null`
     1339    case "${UNAME_MACHINE}" in
     1340        A*) echo alpha-dec-vms ; exit ;;
     1341        I*) echo ia64-dec-vms ; exit ;;
     1342        V*) echo vax-dec-vms ; exit ;;
     1343    esac ;;
     1344    *:XENIX:*:SysV)
     1345    echo i386-pc-xenix
     1346    exit ;;
     1347    i*86:skyos:*:*)
     1348    echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
     1349    exit ;;
     1350    i*86:rdos:*:*)
     1351    echo ${UNAME_MACHINE}-pc-rdos
     1352    exit ;;
    8831353esac
    8841354
    8851355#echo '(No uname command or uname output not recognized.)' 1>&2
    8861356#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
    8871357
    888 cat >dummy.c <<EOF
     1358eval $set_cc_for_build
     1359cat >$dummy.c <<EOF
    8891360#ifdef _SEQUENT_
    8901361# include <sys/types.h>
    8911362# include <sys/utsname.h>
     
    9101381#endif
    9111382
    9121383#if defined (__arm) && defined (__acorn) && defined (__unix)
    913   printf ("arm-acorn-riscix"); exit (0);
     1384  printf ("arm-acorn-riscix\n"); exit (0);
    9141385#endif
    9151386
    9161387#if defined (hp300) && !defined (hpux)
     
    9231394#endif
    9241395  int version;
    9251396  version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
    926   printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
     1397  if (version < 4)
     1398    printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
     1399  else
     1400    printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
    9271401  exit (0);
    9281402#endif
    9291403
     
    9681442#endif
    9691443
    9701444#if defined (vax)
    971 #if !defined (ultrix)
    972   printf ("vax-dec-bsd\n"); exit (0);
    973 #else
    974   printf ("vax-dec-ultrix\n"); exit (0);
     1445# if !defined (ultrix)
     1446#  include <sys/param.h>
     1447#  if defined (BSD)
     1448#   if BSD == 43
     1449      printf ("vax-dec-bsd4.3\n"); exit (0);
     1450#   else
     1451#    if BSD == 199006
     1452      printf ("vax-dec-bsd4.3reno\n"); exit (0);
     1453#    else
     1454      printf ("vax-dec-bsd\n"); exit (0);
     1455#    endif
     1456#   endif
     1457#  else
     1458    printf ("vax-dec-bsd\n"); exit (0);
     1459#  endif
     1460# else
     1461    printf ("vax-dec-ultrix\n"); exit (0);
     1462# endif
    9751463#endif
    976 #endif
    9771464
    9781465#if defined (alliant) && defined (i860)
    9791466  printf ("i860-alliant-bsd\n"); exit (0);
     
    9831470}
    9841471EOF
    9851472
    986 ${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy && rm dummy.c dummy && exit 0
    987 rm -f dummy.c dummy
     1473$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
     1474    { echo "$SYSTEM_NAME"; exit; }
    9881475
    9891476# Apollos put the system type in the environment.
    9901477
    991 test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; }
     1478test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
    9921479
    9931480# Convex versions that predate uname can use getsysinfo(1)
    9941481
     
    9971484    case `getsysinfo -f cpu_type` in
    9981485    c1*)
    9991486    echo c1-convex-bsd
    1000     exit 0 ;;
     1487    exit ;;
    10011488    c2*)
    10021489    if getsysinfo -f scalar_acc
    10031490    then echo c32-convex-bsd
    10041491    else echo c2-convex-bsd
    10051492    fi
    1006     exit 0 ;;
     1493    exit ;;
    10071494    c34*)
    10081495    echo c34-convex-bsd
    1009     exit 0 ;;
     1496    exit ;;
    10101497    c38*)
    10111498    echo c38-convex-bsd
    1012     exit 0 ;;
     1499    exit ;;
    10131500    c4*)
    10141501    echo c4-convex-bsd
    1015     exit 0 ;;
     1502    exit ;;
    10161503    esac
    10171504fi
    10181505
    1019 #echo '(Unable to guess system type)' 1>&2
     1506cat >&2 <<EOF
     1507$0: unable to guess system type
    10201508
     1509This script, last modified $timestamp, has failed to recognize
     1510the operating system you are using. It is advised that you
     1511download the most up to date version of the config scripts from
     1512
     1513  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
     1514and
     1515  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
     1516
     1517If the version you run ($0) is already up to date, please
     1518send the following data and any information you think might be
     1519pertinent to <config-patches@gnu.org> in order to provide the needed
     1520information to handle your system.
     1521
     1522config.guess timestamp = $timestamp
     1523
     1524uname -m = `(uname -m) 2>/dev/null || echo unknown`
     1525uname -r = `(uname -r) 2>/dev/null || echo unknown`
     1526uname -s = `(uname -s) 2>/dev/null || echo unknown`
     1527uname -v = `(uname -v) 2>/dev/null || echo unknown`
     1528
     1529/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
     1530/bin/uname -X     = `(/bin/uname -X) 2>/dev/null`
     1531
     1532hostinfo               = `(hostinfo) 2>/dev/null`
     1533/bin/universe          = `(/bin/universe) 2>/dev/null`
     1534/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null`
     1535/bin/arch              = `(/bin/arch) 2>/dev/null`
     1536/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`
     1537/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
     1538
     1539UNAME_MACHINE = ${UNAME_MACHINE}
     1540UNAME_RELEASE = ${UNAME_RELEASE}
     1541UNAME_SYSTEM  = ${UNAME_SYSTEM}
     1542UNAME_VERSION = ${UNAME_VERSION}
     1543EOF
     1544
    10211545exit 1
     1546
     1547# Local variables:
     1548# eval: (add-hook 'write-file-hooks 'time-stamp)
     1549# time-stamp-start: "timestamp='"
     1550# time-stamp-format: "%:y-%02m-%02d"
     1551# time-stamp-end: "'"
     1552# End:
  • buildtools/legacy/gcc/gcc/configure

     
    35973597        tm_file=i386/freebsd.h
    35983598        tmake_file=t-freebsd
    35993599        ;;
     3600    i[34567]86-*-darwin*)
     3601        tm_file=i386/freebsd.h
     3602        tmake_file=t-freebsd
     3603        ;;
    36003604    i[34567]86-*-netbsd*)
    36013605        tm_file=i386/netbsd.h
    36023606        tmake_file=t-netbsd
  • buildtools/legacy/gcc/gcc/configure.in

     
    12061206        tmake_file=t-freebsd
    12071207        ;;
    12081208changequote(,)dnl
     1209    i[34567]86-*-darwin*)
     1210changequote([,])dnl
     1211        tm_file=i386/freebsd.h
     1212        tmake_file=t-freebsd
     1213        ;;
     1214changequote(,)dnl
    12091215    i[34567]86-*-netbsd*)
    12101216changequote([,])dnl
    12111217        tm_file=i386/netbsd.h
  • buildtools/legacy/gcc/config.sub

     
    11#! /bin/sh
    2 # Configuration validation subroutine script, version 1.1.
    3 #   Copyright (C) 1991, 92-97, 1998, 1999 Free Software Foundation, Inc.
     2# Configuration validation subroutine script.
     3#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
     4#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
     5#   Free Software Foundation, Inc.
     6
     7timestamp='2008-12-11'
     8
    49# This file is (in principle) common to ALL GNU software.
    510# The presence of a machine in this file suggests that SOME GNU software
    611# can handle that machine.  It does not imply ALL GNU software can.
     
    1722#
    1823# You should have received a copy of the GNU General Public License
    1924# along with this program; if not, write to the Free Software
    20 # Foundation, Inc., 59 Temple Place - Suite 330,
    21 # Boston, MA 02111-1307, USA.
    22 
     25# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
     26# 02110-1301, USA.
     27#
    2328# As a special exception to the GNU General Public License, if you
    2429# distribute this file as part of a program that contains a
    2530# configuration script generated by Autoconf, you may include it under
    2631# the same distribution terms that you use for the rest of that program.
    2732
     33
     34# Please send patches to <config-patches@gnu.org>.  Submit a context
     35# diff and a properly formatted ChangeLog entry.
     36#
    2837# Configuration subroutine to validate and canonicalize a configuration type.
    2938# Supply the specified configuration type as an argument.
    3039# If it is invalid, we print an error message on stderr and exit with code 1.
     
    4554#   CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
    4655# It is wrong to echo any other type of specification.
    4756
    48 if [ x$1 = x ]
    49 then
    50     echo Configuration name missing. 1>&2
    51     echo "Usage: $0 CPU-MFR-OPSYS" 1>&2
    52     echo "or     $0 ALIAS" 1>&2
    53     echo where ALIAS is a recognized configuration type. 1>&2
    54     exit 1
    55 fi
     57me=`echo "$0" | sed -e 's,.*/,,'`
    5658
    57 # First pass through any local machine types.
    58 case $1 in
    59     *local*)
    60         echo $1
    61         exit 0
    62         ;;
    63     *)
    64     ;;
     59usage="\
     60Usage: $0 [OPTION] CPU-MFR-OPSYS
     61       $0 [OPTION] ALIAS
     62
     63Canonicalize a configuration name.
     64
     65Operation modes:
     66  -h, --help         print this help, then exit
     67  -t, --time-stamp   print date of last modification, then exit
     68  -v, --version      print version number, then exit
     69
     70Report bugs and patches to <config-patches@gnu.org>."
     71
     72version="\
     73GNU config.sub ($timestamp)
     74
     75Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
     762002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
     77
     78This is free software; see the source for copying conditions.  There is NO
     79warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
     80
     81help="
     82Try \`$me --help' for more information."
     83
     84# Parse command line
     85while test $# -gt 0 ; do
     86  case $1 in
     87    --time-stamp | --time* | -t )
     88       echo "$timestamp" ; exit ;;
     89    --version | -v )
     90       echo "$version" ; exit ;;
     91    --help | --h* | -h )
     92       echo "$usage"; exit ;;
     93    -- )     # Stop option processing
     94       shift; break ;;
     95    - ) # Use stdin as input.
     96       break ;;
     97    -* )
     98       echo "$me: invalid option $1$help"
     99       exit 1 ;;
     100
     101    *local*)
     102       # First pass through any local machine types.
     103       echo $1
     104       exit ;;
     105
     106    * )
     107       break ;;
     108  esac
     109done
     110
     111case $# in
     112 0) echo "$me: missing argument$help" >&2
     113    exit 1;;
     114 1) ;;
     115 *) echo "$me: too many arguments$help" >&2
     116    exit 1;;
    65117esac
    66118
    67119# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
    68120# Here we must recognize all the valid KERNEL-OS combinations.
    69121maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
    70122case $maybe_os in
    71   linux-gnu*)
     123  nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
     124  uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
     125  storm-chaos* | os2-emx* | rtmk-nova*)
    72126    os=-$maybe_os
    73127    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
    74128    ;;
     
    94148    -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
    95149    -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
    96150    -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
    97     -apple)
     151    -apple | -axis | -knuth | -cray)
    98152        os=
    99153        basic_machine=$1
    100154        ;;
    101     -sim | -cisco | -oki | -wec | -winbond )    # EGCS LOCAL
     155    -sim | -cisco | -oki | -wec | -winbond)
    102156        os=
    103157        basic_machine=$1
    104158        ;;
    105     -scout)                     # EGCS LOCAL
     159    -scout)
    106160        ;;
    107     -wrs)                       # EGCS LOCAL
     161    -wrs)
    108162        os=-vxworks
    109163        basic_machine=$1
    110164        ;;
     165    -chorusos*)
     166        os=-chorusos
     167        basic_machine=$1
     168        ;;
     169    -chorusrdb)
     170        os=-chorusrdb
     171        basic_machine=$1
     172        ;;
    111173    -hiux*)
    112174        os=-hiuxwe2
    113175        ;;
     176    -sco6)
     177        os=-sco5v6
     178        basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
     179        ;;
    114180    -sco5)
    115181        os=-sco3.2v5
    116182        basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
     
    127193        # Don't forget version if it is 3.2v4 or newer.
    128194        basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
    129195        ;;
     196    -sco5v6*)
     197        # Don't forget version if it is 3.2v4 or newer.
     198        basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
     199        ;;
    130200    -sco*)
    131201        os=-sco3.2v2
    132202        basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
     
    156226    -psos*)
    157227        os=-psos
    158228        ;;
     229    -mint | -mint[0-9]*)
     230        basic_machine=m68k-atari
     231        os=-mint
     232        ;;
    159233esac
    160234
    161235# Decode aliases for certain CPU-COMPANY combinations.
    162236case $basic_machine in
    163237    # Recognize the basic CPU types without company name.
    164238    # Some are omitted here because they have special meanings below.
    165     tahoe | i860 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \
    166         | arme[lb] | pyramid | mn10200 | mn10300 \
    167         | tron | a29k | 580 | i960 | h8300 \
    168         | hppa | hppa1.0 | hppa1.1 | hppa2.0 | hppa2.0w | hppa2.0n \
    169         | alpha | alphaev5 | alphaev56 | alphapca56 | alphaev6 \
    170         | we32k | ns16k | clipper | i370 | sh | powerpc | powerpcle \
    171         | 1750a | dsp16xx | pdp11 \
    172         | mips64 | mipsel | mips64el | mips64orion | mips64orionel \
    173         | mipstx39 | mipstx39el \
    174         | sparc | sparclet | sparclite | sparc64 | sparcv9 | v850 | c4x)
     239    1750a | 580 \
     240    | a29k \
     241    | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
     242    | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
     243    | am33_2.0 \
     244    | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
     245    | bfin \
     246    | c4x | clipper \
     247    | d10v | d30v | dlx | dsp16xx \
     248    | fido | fr30 | frv \
     249    | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
     250    | i370 | i860 | i960 | ia64 \
     251    | ip2k | iq2000 \
     252    | lm32 \
     253    | m32c | m32r | m32rle | m68000 | m68k | m88k \
     254    | maxq | mb | microblaze | mcore | mep | metag \
     255    | mips | mipsbe | mipseb | mipsel | mipsle \
     256    | mips16 \
     257    | mips64 | mips64el \
     258    | mips64octeon | mips64octeonel \
     259    | mips64orion | mips64orionel \
     260    | mips64r5900 | mips64r5900el \
     261    | mips64vr | mips64vrel \
     262    | mips64vr4100 | mips64vr4100el \
     263    | mips64vr4300 | mips64vr4300el \
     264    | mips64vr5000 | mips64vr5000el \
     265    | mips64vr5900 | mips64vr5900el \
     266    | mipsisa32 | mipsisa32el \
     267    | mipsisa32r2 | mipsisa32r2el \
     268    | mipsisa64 | mipsisa64el \
     269    | mipsisa64r2 | mipsisa64r2el \
     270    | mipsisa64sb1 | mipsisa64sb1el \
     271    | mipsisa64sr71k | mipsisa64sr71kel \
     272    | mipstx39 | mipstx39el \
     273    | mn10200 | mn10300 \
     274    | mt \
     275    | msp430 \
     276    | nios | nios2 \
     277    | ns16k | ns32k \
     278    | or32 \
     279    | pdp10 | pdp11 | pj | pjl \
     280    | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
     281    | pyramid \
     282    | score \
     283    | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
     284    | sh64 | sh64le \
     285    | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
     286    | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
     287    | spu | strongarm \
     288    | tahoe | thumb | tic4x | tic80 | tron \
     289    | v850 | v850e \
     290    | we32k \
     291    | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
     292    | z8k | z80)
    175293        basic_machine=$basic_machine-unknown
    176294        ;;
    177     m88110 | m680[012346]0 | m683?2 | m68360 | m5200 | z8k | v70 \
    178             | h8500 | w65) # EGCS LOCAL
    179         ;;
    180     thumb)
     295    m6811 | m68hc11 | m6812 | m68hc12)
     296        # Motorola 68HC11/12.
    181297        basic_machine=$basic_machine-unknown
     298        os=-none
    182299        ;;
    183     mips64vr4300 | mips64vr4300el) # EGCS LOCAL jsmith/vr4300
    184         basic_machine=$basic_machine-unknown
     300    m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
    185301        ;;
    186     mips64vr4100 | mips64vr4100el) # EGCS LOCAL jsmith/vr4100
    187         basic_machine=$basic_machine-unknown
     302    ms1)
     303        basic_machine=mt-unknown
    188304        ;;
    189     mips64vr5000 | mips64vr5000el) # EGCS LOCAL ian/vr5000
    190         basic_machine=$basic_machine-unknown
    191         ;;
    192     mips16)
    193         basic_machine=$basic_machine-unknown
    194         ;;
    195     d10v)
    196         basic_machine=$basic_machine-unknown
    197         ;;
     305
    198306    # We use `pc' rather than `unknown'
    199307    # because (1) that's what they normally are, and
    200308    # (2) the word "unknown" tends to confuse beginning users.
    201     i[34567]86)
     309    i*86 | x86_64)
    202310      basic_machine=$basic_machine-pc
    203311      ;;
    204312    # Object if more than one company name word.
     
    207315        exit 1
    208316        ;;
    209317    # Recognize the basic CPU types with company name.
    210     vax-* | tahoe-* | i[34567]86-* | i860-* | m32r-* | m68k-* | m68000-* \
    211           | m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | arm-* | c[123]* \
    212           | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \
    213           | power-* | none-* | 580-* | cray2-* | h8300-* | i960-* \
    214           | xmp-* | ymp-* \
    215           | hppa-* | hppa1.0-* | hppa1.1-* \
    216           | hppa2.0-* | hppa2.0w-* | hppa2.0n-* \
    217           | alpha-* | alphaev5-* | alphaev56-* | alphapca56-* \
    218           | alphaev6-* | we32k-* | cydra-* | ns16k-* | pn-* | np1-* \
    219           | xps100-* | clipper-* | orion-* \
    220           | sparclite-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \
    221           | sparc64-* | sparcv9-* | sparc86x-* | mips64-* | mipsel-* \
    222           | mips64el-* | mips64orion-* | mips64orionel-*  \
    223           | mipstx39-* | mipstx39el-* \
    224           | f301-* | arm*-*)
     318    580-* \
     319    | a29k-* \
     320    | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
     321    | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
     322    | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
     323    | arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
     324    | avr-* | avr32-* \
     325    | bfin-* | bs2000-* \
     326    | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
     327    | clipper-* | craynv-* | cydra-* \
     328    | d10v-* | d30v-* | dlx-* \
     329    | elxsi-* \
     330    | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
     331    | h8300-* | h8500-* \
     332    | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
     333    | i*86-* | i860-* | i960-* | ia64-* \
     334    | ip2k-* | iq2000-* \
     335    | lm32-* \
     336    | m32c-* | m32r-* | m32rle-* \
     337    | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
     338    | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
     339    | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
     340    | mips16-* \
     341    | mips64-* | mips64el-* \
     342    | mips64octeon-* | mips64octeonel-* \
     343    | mips64orion-* | mips64orionel-* \
     344    | mips64r5900-* | mips64r5900el-* \
     345    | mips64vr-* | mips64vrel-* \
     346    | mips64vr4100-* | mips64vr4100el-* \
     347    | mips64vr4300-* | mips64vr4300el-* \
     348    | mips64vr5000-* | mips64vr5000el-* \
     349    | mips64vr5900-* | mips64vr5900el-* \
     350    | mipsisa32-* | mipsisa32el-* \
     351    | mipsisa32r2-* | mipsisa32r2el-* \
     352    | mipsisa64-* | mipsisa64el-* \
     353    | mipsisa64r2-* | mipsisa64r2el-* \
     354    | mipsisa64sb1-* | mipsisa64sb1el-* \
     355    | mipsisa64sr71k-* | mipsisa64sr71kel-* \
     356    | mipstx39-* | mipstx39el-* \
     357    | mmix-* \
     358    | mt-* \
     359    | msp430-* \
     360    | nios-* | nios2-* \
     361    | none-* | np1-* | ns16k-* | ns32k-* \
     362    | orion-* \
     363    | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
     364    | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
     365    | pyramid-* \
     366    | romp-* | rs6000-* \
     367    | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
     368    | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
     369    | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
     370    | sparclite-* \
     371    | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
     372    | tahoe-* | thumb-* \
     373    | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \
     374    | tron-* \
     375    | v850-* | v850e-* | vax-* \
     376    | we32k-* \
     377    | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
     378    | xstormy16-* | xtensa*-* \
     379    | ymp-* \
     380    | z8k-* | z80-*)
    225381        ;;
    226     m88110-* | m680[01234]0-* | m683?2-* | m68360-* | z8k-* | h8500-* | d10v-*) # EGCS LOCAL
     382    # Recognize the basic CPU types without company name, with glob match.
     383    xtensa*)
     384        basic_machine=$basic_machine-unknown
    227385        ;;
    228     thumb-*) # EGCS LOCAL angela/thumb
    229         ;;
    230     v850-*) # EGCS LOCAL
    231             ;;
    232     d30v-*) # EGCS LOCAL
    233             ;;
    234     mips64vr4300-* | mips64vr4300el-*) # EGCS LOCAL jsmith/vr4300
    235         ;;
    236     mips64vr4100-* | mips64vr4100el-*) # EGCS LOCAL jsmith/vr4100
    237         ;;
    238     mips16-*) # EGCS LOCAL krk/mips16
    239         ;;
    240     tic30-*) # EGCS LOCAL ian/tic30
    241         ;;
    242     c30-*) # EGCS LOCAL ian/tic30
    243         basic_machine=tic30-unknown
    244         ;;
    245386    # Recognize the various machine names and aliases which stand
    246387    # for a CPU type and a company and sometimes even an OS.
    247     386bsd)                     # EGCS LOCAL
     388    386bsd)
    248389        basic_machine=i386-unknown
    249390        os=-bsd
    250391        ;;
     
    254395    3b*)
    255396        basic_machine=we32k-att
    256397        ;;
    257     a29khif)                    # EGCS LOCAL
     398    a29khif)
    258399        basic_machine=a29k-amd
    259400        os=-udi
    260401        ;;
    261     adobe68k)                   # EGCS LOCAL
     402        abacus)
     403        basic_machine=abacus-unknown
     404        ;;
     405    adobe68k)
    262406        basic_machine=m68010-adobe
    263407        os=-scout
    264408        ;;
     
    272416        basic_machine=a29k-none
    273417        os=-bsd
    274418        ;;
     419    amd64)
     420        basic_machine=x86_64-pc
     421        ;;
     422    amd64-*)
     423        basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
     424        ;;
    275425    amdahl)
    276426        basic_machine=580-amdahl
    277427        os=-sysv
    278428        ;;
    279429    amiga | amiga-*)
    280         basic_machine=m68k-cbm
     430        basic_machine=m68k-unknown
    281431        ;;
    282432    amigaos | amigados)
    283         basic_machine=m68k-cbm
     433        basic_machine=m68k-unknown
    284434        os=-amigaos
    285435        ;;
    286436    amigaunix | amix)
    287         basic_machine=m68k-cbm
     437        basic_machine=m68k-unknown
    288438        os=-sysv4
    289439        ;;
    290440    apollo68)
    291441        basic_machine=m68k-apollo
    292442        os=-sysv
    293443        ;;
    294     apollo68bsd)                    # EGCS LOCAL
     444    apollo68bsd)
    295445        basic_machine=m68k-apollo
    296446        os=-bsd
    297447        ;;
     
    303453        basic_machine=ns32k-sequent
    304454        os=-dynix
    305455        ;;
     456    blackfin)
     457        basic_machine=bfin-unknown
     458        os=-linux
     459        ;;
     460    blackfin-*)
     461        basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
     462        os=-linux
     463        ;;
     464    c90)
     465        basic_machine=c90-cray
     466        os=-unicos
     467        ;;
     468        cegcc)
     469        basic_machine=arm-unknown
     470        os=-cegcc
     471        ;;
    306472    convex-c1)
    307473        basic_machine=c1-convex
    308474        os=-bsd
     
    323489        basic_machine=c38-convex
    324490        os=-bsd
    325491        ;;
    326     cray | ymp)
    327         basic_machine=ymp-cray
     492    cray | j90)
     493        basic_machine=j90-cray
    328494        os=-unicos
    329495        ;;
    330     cray2)
    331         basic_machine=cray2-cray
    332         os=-unicos
     496    craynv)
     497        basic_machine=craynv-cray
     498        os=-unicosmp
    333499        ;;
    334     [ctj]90-cray)
    335         basic_machine=c90-cray
    336         os=-unicos
     500    cr16)
     501        basic_machine=cr16-unknown
     502        os=-elf
    337503        ;;
    338504    crds | unos)
    339505        basic_machine=m68k-crds
    340506        ;;
     507    crisv32 | crisv32-* | etraxfs*)
     508        basic_machine=crisv32-axis
     509        ;;
     510    cris | cris-* | etrax*)
     511        basic_machine=cris-axis
     512        ;;
     513    crx)
     514        basic_machine=crx-unknown
     515        os=-elf
     516        ;;
    341517    da30 | da30-*)
    342518        basic_machine=m68k-da30
    343519        ;;
    344520    decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
    345521        basic_machine=mips-dec
    346522        ;;
     523    decsystem10* | dec10*)
     524        basic_machine=pdp10-dec
     525        os=-tops10
     526        ;;
     527    decsystem20* | dec20*)
     528        basic_machine=pdp10-dec
     529        os=-tops20
     530        ;;
    347531    delta | 3300 | motorola-3300 | motorola-delta \
    348532          | 3300-motorola | delta-motorola)
    349533        basic_machine=m68k-motorola
     
    352536        basic_machine=m88k-motorola
    353537        os=-sysv3
    354538        ;;
     539    dicos)
     540        basic_machine=i686-pc
     541        os=-dicos
     542        ;;
     543    djgpp)
     544        basic_machine=i586-pc
     545        os=-msdosdjgpp
     546        ;;
    355547    dpx20 | dpx20-*)
    356548        basic_machine=rs6000-bull
    357549        os=-bosx
     
    371563    encore | umax | mmax)
    372564        basic_machine=ns32k-encore
    373565        ;;
    374     es1800 | OSE68k | ose68k | ose | OSE)       # EGCS LOCAL
     566    es1800 | OSE68k | ose68k | ose | OSE)
    375567        basic_machine=m68k-ericsson
    376568        os=-ose
    377569        ;;
     
    385577        basic_machine=tron-gmicro
    386578        os=-sysv
    387579        ;;
     580    go32)
     581        basic_machine=i386-pc
     582        os=-go32
     583        ;;
    388584    h3050r* | hiux*)
    389585        basic_machine=hppa1.1-hitachi
    390586        os=-hiuxwe2
     
    393589        basic_machine=h8300-hitachi
    394590        os=-hms
    395591        ;;
    396     h8300xray)                  # EGCS LOCAL
     592    h8300xray)
    397593        basic_machine=h8300-hitachi
    398594        os=-xray
    399595        ;;
    400     h8500hms)                   # EGCS LOCAL
     596    h8500hms)
    401597        basic_machine=h8500-hitachi
    402598        os=-hms
    403599        ;;
     
    416612        basic_machine=m68k-hp
    417613        os=-hpux
    418614        ;;
    419         w89k-*)                     # EGCS LOCAL
    420                 basic_machine=hppa1.1-winbond
    421                 os=-proelf
    422                 ;;
    423         op50n-*)                    # EGCS LOCAL
    424                 basic_machine=hppa1.1-oki
    425                 os=-proelf
    426                 ;;
    427         op60c-*)                    # EGCS LOCAL
    428                 basic_machine=hppa1.1-oki
    429                 os=-proelf
    430                 ;;
    431         hppro)                      # EGCS LOCAL
    432                 basic_machine=hppa1.1-hp
    433                 os=-proelf
    434                 ;;
    435615    hp3k9[0-9][0-9] | hp9[0-9][0-9])
    436616        basic_machine=hppa1.0-hp
    437617        ;;
     
    441621    hp9k3[2-9][0-9])
    442622        basic_machine=m68k-hp
    443623        ;;
    444     hp9k6[0-9][0-9] | hp6[0-9][0-9] )
     624    hp9k6[0-9][0-9] | hp6[0-9][0-9])
    445625        basic_machine=hppa1.0-hp
    446626        ;;
    447     hp9k7[0-79][0-9] | hp7[0-79][0-9] )
     627    hp9k7[0-79][0-9] | hp7[0-79][0-9])
    448628        basic_machine=hppa1.1-hp
    449629        ;;
    450     hp9k78[0-9] | hp78[0-9] )
     630    hp9k78[0-9] | hp78[0-9])
    451631        # FIXME: really hppa2.0-hp
    452632        basic_machine=hppa1.1-hp
    453633        ;;
    454     hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | \
    455     hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893 )
     634    hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
    456635        # FIXME: really hppa2.0-hp
    457636        basic_machine=hppa1.1-hp
    458637        ;;
    459     hp9k8[0-9][13679] | hp8[0-9][13679] )
     638    hp9k8[0-9][13679] | hp8[0-9][13679])
    460639        basic_machine=hppa1.1-hp
    461640        ;;
    462641    hp9k8[0-9][0-9] | hp8[0-9][0-9])
     
    465644    hppa-next)
    466645        os=-nextstep3
    467646        ;;
    468     hppaosf)                    # EGCS LOCAL
     647    hppaosf)
    469648        basic_machine=hppa1.1-hp
    470649        os=-osf
    471650        ;;
     651    hppro)
     652        basic_machine=hppa1.1-hp
     653        os=-proelf
     654        ;;
    472655    i370-ibm* | ibm*)
    473656        basic_machine=i370-ibm
    474         os=-mvs
    475657        ;;
    476658# I'm not sure what "Sysv32" means.  Should this be sysv3.2?
    477     i[34567]86v32)
     659    i*86v32)
    478660        basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
    479661        os=-sysv32
    480662        ;;
    481     i[34567]86v4*)
     663    i*86v4*)
    482664        basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
    483665        os=-sysv4
    484666        ;;
    485     i[34567]86v)
     667    i*86v)
    486668        basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
    487669        os=-sysv
    488670        ;;
    489     i[34567]86sol2)
     671    i*86sol2)
    490672        basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
    491673        os=-solaris2
    492674        ;;
    493     i386mach)                   # EGCS LOCAL
     675    i386mach)
    494676        basic_machine=i386-mach
    495677        os=-mach
    496678        ;;
    497     i386-vsta | vsta)               # EGCS LOCAL
     679    i386-vsta | vsta)
    498680        basic_machine=i386-unknown
    499681        os=-vsta
    500682        ;;
    501     i386-go32 | go32)               # EGCS LOCAL
    502         basic_machine=i386-unknown
    503         os=-go32
    504         ;;
    505     i386-mingw32 | mingw32)
    506         basic_machine=i386-unknown
    507         os=-mingw32
    508         ;;
    509683    iris | iris4d)
    510684        basic_machine=mips-sgi
    511685        case $os in
     
    520694        basic_machine=m68k-isi
    521695        os=-sysv
    522696        ;;
     697    m68knommu)
     698        basic_machine=m68k-unknown
     699        os=-linux
     700        ;;
     701    m68knommu-*)
     702        basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
     703        os=-linux
     704        ;;
    523705    m88k-omron*)
    524706        basic_machine=m88k-omron
    525707        ;;
     
    531713        basic_machine=ns32k-utek
    532714        os=-sysv
    533715        ;;
     716    mingw32)
     717        basic_machine=i386-pc
     718        os=-mingw32
     719        ;;
     720    mingw32ce)
     721        basic_machine=arm-unknown
     722        os=-mingw32ce
     723        ;;
    534724    miniframe)
    535725        basic_machine=m68000-convergent
    536726        ;;
    537     mipsel*-linux*)
    538         basic_machine=mipsel-unknown
    539         os=-linux-gnu
     727    *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
     728        basic_machine=m68k-atari
     729        os=-mint
    540730        ;;
    541     mips*-linux*)
    542         basic_machine=mips-unknown
    543         os=-linux-gnu
    544         ;;
    545731    mips3*-*)
    546732        basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
    547733        ;;
    548734    mips3*)
    549735        basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
    550736        ;;
    551     monitor)                    # EGCS LOCAL
     737    monitor)
    552738        basic_machine=m68k-rom68k
    553739        os=-coff
    554740        ;;
    555     msdos)                      # EGCS LOCAL
    556         basic_machine=i386-unknown 
     741    morphos)
     742        basic_machine=powerpc-unknown
     743        os=-morphos
     744        ;;
     745    msdos)
     746        basic_machine=i386-pc
    557747        os=-msdos
    558748        ;;
     749    ms1-*)
     750        basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
     751        ;;
     752    mvs)
     753        basic_machine=i370-ibm
     754        os=-mvs
     755        ;;
    559756    ncr3000)
    560757        basic_machine=i486-ncr
    561758        os=-sysv4
    562759        ;;
    563760    netbsd386)
    564         basic_machine=i386-unknown      # EGCS LOCAL
     761        basic_machine=i386-unknown
    565762        os=-netbsd
    566763        ;;
    567764    netwinder)
    568         basic_machine=armv4l-corel
     765        basic_machine=armv4l-rebel
    569766        os=-linux
    570767        ;;
    571768    news | news700 | news800 | news900)
     
    580777        basic_machine=mips-sony
    581778        os=-newsos
    582779        ;;
    583     necv70)                     # EGCS LOCAL
     780    necv70)
    584781        basic_machine=v70-nec
    585782        os=-sysv
    586783        ;;
     
    609806        basic_machine=i960-intel
    610807        os=-nindy
    611808        ;;
    612     mon960)                     # EGCS LOCAL
     809    mon960)
    613810        basic_machine=i960-intel
    614811        os=-mon960
    615812        ;;
     813    nonstopux)
     814        basic_machine=mips-compaq
     815        os=-nonstopux
     816        ;;
    616817    np1)
    617818        basic_machine=np1-gould
    618819        ;;
    619     OSE68000 | ose68000)                # EGCS LOCAL
     820    nsr-tandem)
     821        basic_machine=nsr-tandem
     822        ;;
     823    op50n-* | op60c-*)
     824        basic_machine=hppa1.1-oki
     825        os=-proelf
     826        ;;
     827    openrisc | openrisc-*)
     828        basic_machine=or32-unknown
     829        ;;
     830    os400)
     831        basic_machine=powerpc-ibm
     832        os=-os400
     833        ;;
     834    OSE68000 | ose68000)
    620835        basic_machine=m68000-ericsson
    621836        os=-ose
    622837        ;;
    623     os68k)                      # EGCS LOCAL
     838    os68k)
    624839        basic_machine=m68k-none
    625840        os=-os68k
    626841        ;;
     
    632847        basic_machine=i860-intel
    633848        os=-osf
    634849        ;;
     850    parisc)
     851        basic_machine=hppa-unknown
     852        os=-linux
     853        ;;
     854    parisc-*)
     855        basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
     856        os=-linux
     857        ;;
    635858    pbd)
    636859        basic_machine=sparc-tti
    637860        ;;
    638861    pbb)
    639862        basic_machine=m68k-tti
    640863        ;;
    641         pc532 | pc532-*)
     864    pc532 | pc532-*)
    642865        basic_machine=ns32k-pc532
    643866        ;;
    644     pentium | p5 | k5 | k6 | nexen)
     867    pc98)
     868        basic_machine=i386-pc
     869        ;;
     870    pc98-*)
     871        basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
     872        ;;
     873    pentium | p5 | k5 | k6 | nexgen | viac3)
    645874        basic_machine=i586-pc
    646875        ;;
    647     pentiumpro | p6 | 6x86)
     876    pentiumpro | p6 | 6x86 | athlon | athlon_*)
    648877        basic_machine=i686-pc
    649878        ;;
    650     pentiumii | pentium2)
     879    pentiumii | pentium2 | pentiumiii | pentium3)
     880        basic_machine=i686-pc
     881        ;;
     882    pentium4)
    651883        basic_machine=i786-pc
    652884        ;;
    653     pentium-* | p5-* | k5-* | k6-* | nexen-*)
     885    pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
    654886        basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
    655887        ;;
    656     pentiumpro-* | p6-* | 6x86-*)
     888    pentiumpro-* | p6-* | 6x86-* | athlon-*)
    657889        basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
    658890        ;;
    659     pentiumii-* | pentium2-*)
     891    pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
     892        basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
     893        ;;
     894    pentium4-*)
    660895        basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
    661896        ;;
    662897    pn)
    663898        basic_machine=pn-gould
    664899        ;;
    665     power)  basic_machine=rs6000-ibm
     900    power)  basic_machine=power-ibm
    666901        ;;
    667902    ppc)    basic_machine=powerpc-unknown
    668             ;;
     903        ;;
    669904    ppc-*)  basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
    670905        ;;
    671906    ppcle | powerpclittle | ppc-le | powerpc-little)
    672907        basic_machine=powerpcle-unknown
    673             ;;
     908        ;;
    674909    ppcle-* | powerpclittle-*)
    675910        basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
    676911        ;;
     912    ppc64)  basic_machine=powerpc64-unknown
     913        ;;
     914    ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
     915        ;;
     916    ppc64le | powerpc64little | ppc64-le | powerpc64-little)
     917        basic_machine=powerpc64le-unknown
     918        ;;
     919    ppc64le-* | powerpc64little-*)
     920        basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
     921        ;;
    677922    ps2)
    678923        basic_machine=i386-ibm
    679924        ;;
    680     rom68k)                     # EGCS LOCAL
     925    pw32)
     926        basic_machine=i586-unknown
     927        os=-pw32
     928        ;;
     929    rdos)
     930        basic_machine=i386-pc
     931        os=-rdos
     932        ;;
     933    rom68k)
    681934        basic_machine=m68k-rom68k
    682935        os=-coff
    683936        ;;
     
    687940    rtpc | rtpc-*)
    688941        basic_machine=romp-ibm
    689942        ;;
    690     sa29200)                    # EGCS LOCAL
     943    s390 | s390-*)
     944        basic_machine=s390-ibm
     945        ;;
     946    s390x | s390x-*)
     947        basic_machine=s390x-ibm
     948        ;;
     949    sa29200)
    691950        basic_machine=a29k-amd
    692951        os=-udi
    693952        ;;
     953    sb1)
     954        basic_machine=mipsisa64sb1-unknown
     955        ;;
     956    sb1el)
     957        basic_machine=mipsisa64sb1el-unknown
     958        ;;
     959    sde)
     960        basic_machine=mipsisa32-sde
     961        os=-elf
     962        ;;
     963    sei)
     964        basic_machine=mips-sei
     965        os=-seiux
     966        ;;
    694967    sequent)
    695968        basic_machine=i386-sequent
    696969        ;;
     
    698971        basic_machine=sh-hitachi
    699972        os=-hms
    700973        ;;
    701     sparclite-wrs)                  # EGCS LOCAL
     974    sh5el)
     975        basic_machine=sh5le-unknown
     976        ;;
     977    sh64)
     978        basic_machine=sh64-unknown
     979        ;;
     980    sparclite-wrs | simso-wrs)
    702981        basic_machine=sparclite-wrs
    703982        os=-vxworks
    704983        ;;
     
    709988    spur)
    710989        basic_machine=spur-unknown
    711990        ;;
    712     st2000)                     # EGCS LOCAL
     991    st2000)
    713992        basic_machine=m68k-tandem
    714993        ;;
    715     stratus)                    # EGCS LOCAL
     994    stratus)
    716995        basic_machine=i860-stratus
    717996        os=-sysv4
    718997        ;;
     
    7561035    sun386 | sun386i | roadrunner)
    7571036        basic_machine=i386-sun
    7581037        ;;
     1038    sv1)
     1039        basic_machine=sv1-cray
     1040        os=-unicos
     1041        ;;
    7591042    symmetry)
    7601043        basic_machine=i386-sequent
    7611044        os=-dynix
    7621045        ;;
     1046    t3e)
     1047        basic_machine=alphaev5-cray
     1048        os=-unicos
     1049        ;;
     1050    t90)
     1051        basic_machine=t90-cray
     1052        os=-unicos
     1053        ;;
     1054    tic54x | c54x*)
     1055        basic_machine=tic54x-unknown
     1056        os=-coff
     1057        ;;
     1058    tic55x | c55x*)
     1059        basic_machine=tic55x-unknown
     1060        os=-coff
     1061        ;;
     1062    tic6x | c6x*)
     1063        basic_machine=tic6x-unknown
     1064        os=-coff
     1065        ;;
     1066    tile*)
     1067        basic_machine=tile-unknown
     1068        os=-linux-gnu
     1069        ;;
    7631070    tx39)
    7641071        basic_machine=mipstx39-unknown
    7651072        ;;
    7661073    tx39el)
    7671074        basic_machine=mipstx39el-unknown
    7681075        ;;
     1076    toad1)
     1077        basic_machine=pdp10-xkl
     1078        os=-tops20
     1079        ;;
    7691080    tower | tower-32)
    7701081        basic_machine=m68k-ncr
    7711082        ;;
     1083    tpf)
     1084        basic_machine=s390x-ibm
     1085        os=-tpf
     1086        ;;
    7721087    udi29k)
    7731088        basic_machine=a29k-amd
    7741089        os=-udi
     
    7771092        basic_machine=a29k-nyu
    7781093        os=-sym1
    7791094        ;;
    780     v810 | necv810)                 # EGCS LOCAL
     1095    v810 | necv810)
    7811096        basic_machine=v810-nec
    7821097        os=-none
    7831098        ;;
     
    7901105        os=-vms
    7911106        ;;
    7921107    vpp*|vx|vx-*)
    793                basic_machine=f301-fujitsu
    794                ;;
     1108        basic_machine=f301-fujitsu
     1109        ;;
    7951110    vxworks960)
    7961111        basic_machine=i960-wrs
    7971112        os=-vxworks
     
    8041119        basic_machine=a29k-wrs
    8051120        os=-vxworks
    8061121        ;;
    807     w65*)                       # EGCS LOCAL
    808         basic_machine=w65-wdc
    809         os=-none
     1122    w65*)
     1123        basic_machine=w65-wdc
     1124        os=-none
    8101125        ;;
    811     xmp)
    812         basic_machine=xmp-cray
    813         os=-unicos
     1126    w89k-*)
     1127        basic_machine=hppa1.1-winbond
     1128        os=-proelf
    8141129        ;;
    815         xps | xps100)
     1130    xbox)
     1131        basic_machine=i686-pc
     1132        os=-mingw32
     1133        ;;
     1134    xps | xps100)
    8161135        basic_machine=xps100-honeywell
    8171136        ;;
    818     z8k-*-coff)                 # EGCS LOCAL
     1137    ymp)
     1138        basic_machine=ymp-cray
     1139        os=-unicos
     1140        ;;
     1141    z8k-*-coff)
    8191142        basic_machine=z8k-unknown
    8201143        os=-sim
    8211144        ;;
     1145    z80-*-coff)
     1146        basic_machine=z80-unknown
     1147        os=-sim
     1148        ;;
    8221149    none)
    8231150        basic_machine=none-none
    8241151        os=-none
     
    8261153
    8271154# Here we handle the default manufacturer of certain CPU types.  It is in
    8281155# some cases the only manufacturer, in others, it is the most popular.
    829     w89k)                       # EGCS LOCAL
     1156    w89k)
    8301157        basic_machine=hppa1.1-winbond
    8311158        ;;
    832     op50n)                      # EGCS LOCAL
     1159    op50n)
    8331160        basic_machine=hppa1.1-oki
    8341161        ;;
    835     op60c)                      # EGCS LOCAL
     1162    op60c)
    8361163        basic_machine=hppa1.1-oki
    8371164        ;;
    838     mips)
    839         if [ x$os = x-linux-gnu ]; then
    840             basic_machine=mips-unknown
    841         else
    842             basic_machine=mips-mips
    843         fi
    844         ;;
    8451165    romp)
    8461166        basic_machine=romp-ibm
    8471167        ;;
     1168    mmix)
     1169        basic_machine=mmix-knuth
     1170        ;;
    8481171    rs6000)
    8491172        basic_machine=rs6000-ibm
    8501173        ;;
    8511174    vax)
    8521175        basic_machine=vax-dec
    8531176        ;;
     1177    pdp10)
     1178        # there are many clones, so DEC is not a safe bet
     1179        basic_machine=pdp10-unknown
     1180        ;;
    8541181    pdp11)
    8551182        basic_machine=pdp11-dec
    8561183        ;;
    8571184    we32k)
    8581185        basic_machine=we32k-att
    8591186        ;;
    860     sparc | sparcv9)
     1187    sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
     1188        basic_machine=sh-unknown
     1189        ;;
     1190    sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
    8611191        basic_machine=sparc-sun
    8621192        ;;
    863         cydra)
     1193    cydra)
    8641194        basic_machine=cydra-cydrome
    8651195        ;;
    8661196    orion)
     
    8691199    orion105)
    8701200        basic_machine=clipper-highlevel
    8711201        ;;
    872     mac | mpw | mac-mpw)                # EGCS LOCAL
     1202    mac | mpw | mac-mpw)
    8731203        basic_machine=m68k-apple
    8741204        ;;
    875     pmac | pmac-mpw)                # EGCS LOCAL
     1205    pmac | pmac-mpw)
    8761206        basic_machine=powerpc-apple
    8771207        ;;
    878     c4x*)
    879         basic_machine=c4x-none
    880         os=-coff
    881         ;;
     1208    *-unknown)
     1209        # Make sure to match an already-canonicalized machine name.
     1210        ;;
    8821211    *)
    8831212        echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
    8841213        exit 1
     
    9311260          | -aos* \
    9321261          | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
    9331262          | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
    934           | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \
    935           | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
     1263          | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
     1264          | -openbsd* | -solidbsd* \
     1265          | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
     1266          | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
    9361267          | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
    9371268          | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
     1269          | -chorusos* | -chorusrdb* | -cegcc* \
    9381270          | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
    939           | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
    940           | -interix* | -uwin* | -haiku* )
     1271          | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
     1272          | -uxpv* | -beos* | -mpeix* | -udk* \
     1273          | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
     1274          | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
     1275          | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
     1276          | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
     1277          | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
     1278          | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
     1279          | -skyos* | -haiku* | -rdos* | -toppers* | -drops*)
    9411280    # Remember, each alternative MUST END IN *, to match a version number.
    9421281        ;;
    943     # EGCS LOCAL
     1282    -qnx*)
     1283        case $basic_machine in
     1284            x86-* | i*86-*)
     1285            ;;
     1286            *)
     1287            os=-nto$os
     1288            ;;
     1289        esac
     1290        ;;
     1291    -nto-qnx*)
     1292        ;;
     1293    -nto*)
     1294        os=`echo $os | sed -e 's|nto|nto-qnx|'`
     1295        ;;
    9441296    -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
    945           | -windows* | -osx | -abug |  -netware* | -os9* | -beos* \
    946           | -macos* | -mpw* | -magic* | -mon960* | -lnews* | -haiku* )
     1297          | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
     1298          | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
    9471299        ;;
    9481300    -mac*)
    9491301        os=`echo $os | sed -e 's|mac|macos|'`
    9501302        ;;
    951     # END EGCS LOCAL
     1303    -linux-dietlibc)
     1304        os=-linux-dietlibc
     1305        ;;
    9521306    -linux*)
    9531307        os=`echo $os | sed -e 's|linux|linux-gnu|'`
    9541308        ;;
     
    9581312    -sunos6*)
    9591313        os=`echo $os | sed -e 's|sunos6|solaris3|'`
    9601314        ;;
     1315    -opened*)
     1316        os=-openedition
     1317        ;;
     1318        -os400*)
     1319        os=-os400
     1320        ;;
     1321    -wince*)
     1322        os=-wince
     1323        ;;
    9611324    -osfrose*)
    9621325        os=-osfrose
    9631326        ;;
     
    9731336    -acis*)
    9741337        os=-aos
    9751338        ;;
    976     -386bsd)                    # EGCS LOCAL
     1339    -atheos*)
     1340        os=-atheos
     1341        ;;
     1342    -syllable*)
     1343        os=-syllable
     1344        ;;
     1345    -386bsd)
    9771346        os=-bsd
    9781347        ;;
    9791348    -ctix* | -uts*)
    9801349        os=-sysv
    9811350        ;;
     1351    -nova*)
     1352        os=-rtmk-nova
     1353        ;;
    9821354    -ns2 )
    983             os=-nextstep2
     1355        os=-nextstep2
    9841356        ;;
     1357    -nsk*)
     1358        os=-nsk
     1359        ;;
    9851360    # Preserve the version number of sinix5.
    9861361    -sinix5.*)
    9871362        os=`echo $os | sed -e 's|sinix|sysv|'`
     
    9891364    -sinix*)
    9901365        os=-sysv4
    9911366        ;;
     1367        -tpf*)
     1368        os=-tpf
     1369        ;;
    9921370    -triton*)
    9931371        os=-sysv3
    9941372        ;;
     
    10071385    # This must come after -sysvr4.
    10081386    -sysv*)
    10091387        ;;
    1010     -ose*)                      # EGCS LOCAL
     1388    -ose*)
    10111389        os=-ose
    10121390        ;;
    1013     -es1800*)                   # EGCS LOCAL
     1391    -es1800*)
    10141392        os=-ose
    10151393        ;;
    10161394    -xenix)
    10171395        os=-xenix
    10181396        ;;
     1397    -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
     1398        os=-mint
     1399        ;;
     1400    -aros*)
     1401        os=-aros
     1402        ;;
     1403    -kaos*)
     1404        os=-kaos
     1405        ;;
     1406    -zvmoe)
     1407        os=-zvmoe
     1408        ;;
     1409    -dicos*)
     1410        os=-dicos
     1411        ;;
    10191412    -none)
    10201413        ;;
    10211414    *)
     
    10381431# system, and we'll never get to this point.
    10391432
    10401433case $basic_machine in
     1434        score-*)
     1435        os=-elf
     1436        ;;
     1437        spu-*)
     1438        os=-elf
     1439        ;;
    10411440    *-acorn)
    10421441        os=-riscix1.2
    10431442        ;;
    1044     arm*-corel)
     1443    arm*-rebel)
    10451444        os=-linux
    10461445        ;;
    10471446    arm*-semi)
    10481447        os=-aout
    10491448        ;;
    1050         pdp11-*)
     1449        c4x-* | tic4x-*)
     1450            os=-coff
     1451        ;;
     1452    # This must come before the *-dec entry.
     1453    pdp10-*)
     1454        os=-tops20
     1455        ;;
     1456    pdp11-*)
    10511457        os=-none
    10521458        ;;
    10531459    *-dec | vax-*)
     
    10651471        # default.
    10661472        # os=-sunos4
    10671473        ;;
    1068     m68*-cisco)                 # EGCS LOCAL
     1474    m68*-cisco)
    10691475        os=-aout
    10701476        ;;
    1071     mips*-cisco)                    # EGCS LOCAL
     1477        mep-*)
    10721478        os=-elf
    10731479        ;;
    1074         mips*-*)                                        # EGCS LOCAL
    1075                 os=-elf
    1076                 ;;
     1480    mips*-cisco)
     1481        os=-elf
     1482        ;;
     1483    mips*-*)
     1484        os=-elf
     1485        ;;
     1486    or32-*)
     1487        os=-coff
     1488        ;;
    10771489    *-tti)  # must be before sparc entry or we get the wrong os.
    10781490        os=-sysv3
    10791491        ;;
     
    10891501    *-ibm)
    10901502        os=-aix
    10911503        ;;
    1092     *-wec)                      # EGCS LOCAL
     1504        *-knuth)
     1505        os=-mmixware
     1506        ;;
     1507    *-wec)
    10931508        os=-proelf
    10941509        ;;
    1095     *-winbond)                  # EGCS LOCAL
     1510    *-winbond)
    10961511        os=-proelf
    10971512        ;;
    1098     *-oki)                      # EGCS LOCAL
     1513    *-oki)
    10991514        os=-proelf
    11001515        ;;
    11011516    *-hp)
     
    11401555    *-next)
    11411556        os=-nextstep3
    11421557        ;;
    1143         *-gould)
     1558    *-gould)
    11441559        os=-sysv
    11451560        ;;
    1146         *-highlevel)
     1561    *-highlevel)
    11471562        os=-bsd
    11481563        ;;
    11491564    *-encore)
    11501565        os=-bsd
    11511566        ;;
    1152         *-sgi)
     1567    *-sgi)
    11531568        os=-irix
    11541569        ;;
    1155         *-siemens)
     1570    *-siemens)
    11561571        os=-sysv4
    11571572        ;;
    11581573    *-masscomp)
    11591574        os=-rtu
    11601575        ;;
    1161     f301-fujitsu)
     1576    f30[01]-fujitsu | f700-fujitsu)
    11621577        os=-uxpv
    11631578        ;;
    1164     *-rom68k)                   # EGCS LOCAL
     1579    *-rom68k)
    11651580        os=-coff
    11661581        ;;
    1167     *-*bug)                     # EGCS LOCAL
     1582    *-*bug)
    11681583        os=-coff
    11691584        ;;
    1170     *-apple)                    # EGCS LOCAL
     1585    *-apple)
    11711586        os=-macos
    11721587        ;;
     1588    *-atari*)
     1589        os=-mint
     1590        ;;
    11731591    *)
    11741592        os=-none
    11751593        ;;
     
    11941612            -beos*)
    11951613                vendor=be
    11961614                ;;
    1197             -haiku*)
    1198                 vendor=haiku
    1199                 ;;
    12001615            -hpux*)
    12011616                vendor=hp
    12021617                ;;
     
    12181633            -genix*)
    12191634                vendor=ns
    12201635                ;;
    1221             -mvs*)
     1636            -mvs* | -opened*)
    12221637                vendor=ibm
    12231638                ;;
     1639            -os400*)
     1640                vendor=ibm
     1641                ;;
    12241642            -ptx*)
    12251643                vendor=sequent
    12261644                ;;
    1227             -vxsim* | -vxworks*)
     1645            -tpf*)
     1646                vendor=ibm
     1647                ;;
     1648            -vxsim* | -vxworks* | -windiss*)
    12281649                vendor=wrs
    12291650                ;;
    12301651            -aux*)
    12311652                vendor=apple
    12321653                ;;
    1233             -hms*)              # EGCS LOCAL
     1654            -hms*)
    12341655                vendor=hitachi
    12351656                ;;
    1236             -mpw* | -macos*)        # EGCS LOCAL
     1657            -mpw* | -macos*)
    12371658                vendor=apple
    12381659                ;;
     1660            -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
     1661                vendor=atari
     1662                ;;
     1663            -vos*)
     1664                vendor=stratus
     1665                ;;
    12391666        esac
    12401667        basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
    12411668        ;;
    12421669esac
    12431670
    12441671echo $basic_machine$os
     1672exit
     1673
     1674# Local variables:
     1675# eval: (add-hook 'write-file-hooks 'time-stamp)
     1676# time-stamp-start: "timestamp='"
     1677# time-stamp-format: "%:y-%02m-%02d"
     1678# time-stamp-end: "'"
     1679# End: