Changeset 481 for trunk/config.guess


Ignore:
Timestamp:
Jul 18, 2015, 5:06:52 PM (5 years ago)
Author:
katerina
Message:

Enhancements and fixes for tickets #374, #375, #376, #377, #378, and #379.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/config.guess

    r378 r481  
    11#! /bin/sh
    22# Attempt to guess a canonical system name.
    3 #   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
    4 #   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
    5 #   Free Software Foundation, Inc.
    6 
    7 timestamp='2009-12-30'
     3#   Copyright 1992-2014 Free Software Foundation, Inc.
     4
     5timestamp='2014-03-23'
    86
    97# This file is free software; you can redistribute it and/or modify it
    108# under the terms of the GNU General Public License as published by
    11 # the Free Software Foundation; either version 2 of the License, or
     9# the Free Software Foundation; either version 3 of the License, or
    1210# (at your option) any later version.
    1311#
     
    1816#
    1917# You should have received a copy of the GNU General Public License
    20 # along with this program; if not, write to the Free Software
    21 # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
    22 # 02110-1301, USA.
     18# along with this program; if not, see <http://www.gnu.org/licenses/>.
    2319#
    2420# As a special exception to the GNU General Public License, if you
    2521# distribute this file as part of a program that contains a
    2622# configuration script generated by Autoconf, you may include it under
    27 # the same distribution terms that you use for the rest of that program.
    28 
    29 
    30 # Originally written by Per Bothner.  Please send patches (context
    31 # diff format) to <config-patches@gnu.org> and include a ChangeLog
    32 # entry.
     23# the same distribution terms that you use for the rest of that
     24# program.  This Exception is an additional permission under section 7
     25# of the GNU General Public License, version 3 ("GPLv3").
    3326#
    34 # This script attempts to guess a canonical system name similar to
    35 # config.sub.  If it succeeds, it prints the system name on stdout, and
    36 # exits with 0.  Otherwise, it exits with 1.
     27# Originally written by Per Bothner.
    3728#
    3829# You can get the latest version of this script from:
    3930# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
     31#
     32# Please send patches with a ChangeLog entry to config-patches@gnu.org.
     33
    4034
    4135me=`echo "$0" | sed -e 's,.*/,,'`
     
    5751
    5852Originally written by Per Bothner.
    59 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
    60 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free
    61 Software Foundation, Inc.
     53Copyright 1992-2014 Free Software Foundation, Inc.
    6254
    6355This is free software; see the source for copying conditions.  There is NO
     
    141133UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
    142134
     135case "${UNAME_SYSTEM}" in
     136Linux|GNU|GNU/*)
     137        # If the system lacks a compiler, then just pick glibc.
     138        # We could probably try harder.
     139        LIBC=gnu
     140
     141        eval $set_cc_for_build
     142        cat <<-EOF > $dummy.c
     143        #include <features.h>
     144        #if defined(__UCLIBC__)
     145        LIBC=uclibc
     146        #elif defined(__dietlibc__)
     147        LIBC=dietlibc
     148        #else
     149        LIBC=gnu
     150        #endif
     151        EOF
     152        eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`
     153        ;;
     154esac
     155
    143156# Note: order is significant - the case branches are not exclusive.
    144157
     
    146159    *:NetBSD:*:*)
    147160        # NetBSD (nbsd) targets should (where applicable) match one or
    148         # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
     161        # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
    149162        # *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
    150163        # switched to ELF, *-*-netbsd* would select the old
     
    182195                ;;
    183196            *)
    184                 os=netbsd
     197                os=netbsd
    185198                ;;
    186199        esac
     
    203216        echo "${machine}-${os}${release}"
    204217        exit ;;
     218    *:Bitrig:*:*)
     219        UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
     220        echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE}
     221        exit ;;
    205222    *:OpenBSD:*:*)
    206223        UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
     
    225242                ;;
    226243        *5.*)
    227                 UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
     244                UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
    228245                ;;
    229246        esac
     
    271288        # 1.2 uses "1.2" for uname -r.
    272289        echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
    273         exit ;;
     290        # Reset EXIT trap before exiting to avoid spurious non-zero exit code.
     291        exitcode=$?
     292        trap '' 0
     293        exit $exitcode ;;
    274294    Alpha\ *:Windows_NT*:*)
    275295        # How do we know it's Interix rather than the generic POSIX subsystem?
     
    297317        exit ;;
    298318    *:OS400:*:*)
    299         echo powerpc-ibm-os400
     319        echo powerpc-ibm-os400
    300320        exit ;;
    301321    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
    302322        echo arm-acorn-riscix${UNAME_RELEASE}
    303323        exit ;;
    304     arm:riscos:*:*|arm:RISCOS:*:*)
     324    arm*:riscos:*:*|arm*:RISCOS:*:*)
    305325        echo arm-unknown-riscos
    306326        exit ;;
     
    396416    # be no problem.
    397417    atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
    398         echo m68k-atari-mint${UNAME_RELEASE}
     418        echo m68k-atari-mint${UNAME_RELEASE}
    399419        exit ;;
    400420    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
    401421        echo m68k-atari-mint${UNAME_RELEASE}
    402         exit ;;
     422        exit ;;
    403423    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
    404         echo m68k-atari-mint${UNAME_RELEASE}
     424        echo m68k-atari-mint${UNAME_RELEASE}
    405425        exit ;;
    406426    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
    407         echo m68k-milan-mint${UNAME_RELEASE}
    408         exit ;;
     427        echo m68k-milan-mint${UNAME_RELEASE}
     428        exit ;;
    409429    hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
    410         echo m68k-hades-mint${UNAME_RELEASE}
    411         exit ;;
     430        echo m68k-hades-mint${UNAME_RELEASE}
     431        exit ;;
    412432    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
    413         echo m68k-unknown-mint${UNAME_RELEASE}
    414         exit ;;
     433        echo m68k-unknown-mint${UNAME_RELEASE}
     434        exit ;;
    415435    m68k:machten:*:*)
    416436        echo m68k-apple-machten${UNAME_RELEASE}
     
    482502        exit ;;
    483503    AViiON:dgux:*:*)
    484         # DG/UX returns AViiON for all architectures
    485         UNAME_PROCESSOR=`/usr/bin/uname -p`
     504        # DG/UX returns AViiON for all architectures
     505        UNAME_PROCESSOR=`/usr/bin/uname -p`
    486506        if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
    487507        then
     
    496516            echo i586-dg-dgux${UNAME_RELEASE}
    497517        fi
    498         exit ;;
     518        exit ;;
    499519    M88*:DolphinOS:*:*) # DolphinOS (SVR3)
    500520        echo m88k-dolphin-sysv3
     
    553573        fi
    554574        exit ;;
    555     *:AIX:*:[456])
     575    *:AIX:*:[4567])
    556576        IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
    557577        if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
     
    596616                if [ -x /usr/bin/getconf ]; then
    597617                    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
    598                     sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
    599                     case "${sc_cpu_version}" in
    600                       523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
    601                       528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
    602                       532)                      # CPU_PA_RISC2_0
    603                         case "${sc_kernel_bits}" in
    604                           32) HP_ARCH="hppa2.0n" ;;
    605                           64) HP_ARCH="hppa2.0w" ;;
     618                    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
     619                    case "${sc_cpu_version}" in
     620                      523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
     621                      528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
     622                      532)                      # CPU_PA_RISC2_0
     623                        case "${sc_kernel_bits}" in
     624                          32) HP_ARCH="hppa2.0n" ;;
     625                          64) HP_ARCH="hppa2.0w" ;;
    606626                          '') HP_ARCH="hppa2.0" ;;   # HP-UX 10.20
    607                         esac ;;
    608                     esac
     627                        esac ;;
     628                    esac
    609629                fi
    610630                if [ "${HP_ARCH}" = "" ]; then
    611631                    eval $set_cc_for_build
    612                     sed 's/^              //' << EOF >$dummy.c
    613 
    614               #define _HPUX_SOURCE
    615               #include <stdlib.h>
    616               #include <unistd.h>
    617 
    618               int main ()
    619               {
    620               #if defined(_SC_KERNEL_BITS)
    621                   long bits = sysconf(_SC_KERNEL_BITS);
    622               #endif
    623                   long cpu  = sysconf (_SC_CPU_VERSION);
    624 
    625                   switch (cpu)
    626                 {
    627                 case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
    628                 case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
    629                 case CPU_PA_RISC2_0:
    630               #if defined(_SC_KERNEL_BITS)
    631                     switch (bits)
    632                         {
    633                         case 64: puts ("hppa2.0w"); break;
    634                         case 32: puts ("hppa2.0n"); break;
    635                         default: puts ("hppa2.0"); break;
    636                         } break;
    637               #else  /* !defined(_SC_KERNEL_BITS) */
    638                     puts ("hppa2.0"); break;
    639               #endif
    640                 default: puts ("hppa1.0"); break;
    641                 }
    642                   exit (0);
    643               }
     632                    sed 's/^            //' << EOF >$dummy.c
     633
     634                #define _HPUX_SOURCE
     635                #include <stdlib.h>
     636                #include <unistd.h>
     637
     638                int main ()
     639                {
     640                #if defined(_SC_KERNEL_BITS)
     641                    long bits = sysconf(_SC_KERNEL_BITS);
     642                #endif
     643                    long cpu  = sysconf (_SC_CPU_VERSION);
     644
     645                    switch (cpu)
     646                        {
     647                        case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
     648                        case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
     649                        case CPU_PA_RISC2_0:
     650                #if defined(_SC_KERNEL_BITS)
     651                            switch (bits)
     652                                {
     653                                case 64: puts ("hppa2.0w"); break;
     654                                case 32: puts ("hppa2.0n"); break;
     655                                default: puts ("hppa2.0"); break;
     656                                } break;
     657                #else  /* !defined(_SC_KERNEL_BITS) */
     658                            puts ("hppa2.0"); break;
     659                #endif
     660                        default: puts ("hppa1.0"); break;
     661                        }
     662                    exit (0);
     663                }
    644664EOF
    645665                    (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
     
    732752    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
    733753        echo c1-convex-bsd
    734         exit ;;
     754        exit ;;
    735755    C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
    736756        if getsysinfo -f scalar_acc
     
    738758        else echo c2-convex-bsd
    739759        fi
    740         exit ;;
     760        exit ;;
    741761    C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
    742762        echo c34-convex-bsd
    743         exit ;;
     763        exit ;;
    744764    C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
    745765        echo c38-convex-bsd
    746         exit ;;
     766        exit ;;
    747767    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
    748768        echo c4-convex-bsd
    749         exit ;;
     769        exit ;;
    750770    CRAY*Y-MP:*:*:*)
    751771        echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
     
    771791    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
    772792        FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
    773         FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
    774         FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
    775         echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
    776         exit ;;
     793        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
     794        FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
     795        echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
     796        exit ;;
    777797    5000:UNIX_System_V:4.*:*)
    778         FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
    779         FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
    780         echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
     798        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
     799        FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
     800        echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
    781801        exit ;;
    782802    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
     
    790810        exit ;;
    791811    *:FreeBSD:*:*)
    792         case ${UNAME_MACHINE} in
    793             pc98)
    794                 echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
     812        UNAME_PROCESSOR=`/usr/bin/uname -p`
     813        case ${UNAME_PROCESSOR} in
    795814            amd64)
    796815                echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
    797816            *)
    798                 echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
     817                echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
    799818        esac
    800819        exit ;;
     
    802821        echo ${UNAME_MACHINE}-pc-cygwin
    803822        exit ;;
     823    *:MINGW64*:*)
     824        echo ${UNAME_MACHINE}-pc-mingw64
     825        exit ;;
    804826    *:MINGW*:*)
    805827        echo ${UNAME_MACHINE}-pc-mingw32
    806828        exit ;;
     829    *:MSYS*:*)
     830        echo ${UNAME_MACHINE}-pc-msys
     831        exit ;;
    807832    i*:windows32*:*)
    808         # uname -m includes "-pc" on this system.
    809         echo ${UNAME_MACHINE}-mingw32
     833        # uname -m includes "-pc" on this system.
     834        echo ${UNAME_MACHINE}-mingw32
    810835        exit ;;
    811836    i*:PW*:*)
     
    813838        exit ;;
    814839    *:Interix*:*)
    815         case ${UNAME_MACHINE} in
     840        case ${UNAME_MACHINE} in
    816841            x86)
    817842                echo i586-pc-interix${UNAME_RELEASE}
     
    850875    *:GNU:*:*)
    851876        # the GNU system
    852         echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
     877        echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
    853878        exit ;;
    854879    *:GNU/*:*:*)
    855880        # other systems with GNU libc and userland
    856         echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
     881        echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
    857882        exit ;;
    858883    i*86:Minix:*:*)
    859884        echo ${UNAME_MACHINE}-pc-minix
     885        exit ;;
     886    aarch64:Linux:*:*)
     887        echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
     888        exit ;;
     889    aarch64_be:Linux:*:*)
     890        UNAME_MACHINE=aarch64_be
     891        echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
    860892        exit ;;
    861893    alpha:Linux:*:*)
     
    868900          EV67)  UNAME_MACHINE=alphaev67 ;;
    869901          EV68*) UNAME_MACHINE=alphaev68 ;;
    870         esac
     902        esac
    871903        objdump --private-headers /bin/sh | grep -q ld.so.1
    872         if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
    873         echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
     904        if test "$?" = 0 ; then LIBC="gnulibc1" ; fi
     905        echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
     906        exit ;;
     907    arc:Linux:*:* | arceb:Linux:*:*)
     908        echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
    874909        exit ;;
    875910    arm*:Linux:*:*)
     
    878913            | grep -q __ARM_EABI__
    879914        then
    880             echo ${UNAME_MACHINE}-unknown-linux-gnu
     915            echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
    881916        else
    882             echo ${UNAME_MACHINE}-unknown-linux-gnueabi
     917            if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
     918                | grep -q __ARM_PCS_VFP
     919            then
     920                echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
     921            else
     922                echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf
     923            fi
    883924        fi
    884925        exit ;;
    885926    avr32*:Linux:*:*)
    886         echo ${UNAME_MACHINE}-unknown-linux-gnu
     927        echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
    887928        exit ;;
    888929    cris:Linux:*:*)
    889         echo cris-axis-linux-gnu
     930        echo ${UNAME_MACHINE}-axis-linux-${LIBC}
    890931        exit ;;
    891932    crisv32:Linux:*:*)
    892         echo crisv32-axis-linux-gnu
     933        echo ${UNAME_MACHINE}-axis-linux-${LIBC}
    893934        exit ;;
    894935    frv:Linux:*:*)
    895         echo frv-unknown-linux-gnu
     936        echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
     937        exit ;;
     938    hexagon:Linux:*:*)
     939        echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
    896940        exit ;;
    897941    i*86:Linux:*:*)
    898         LIBC=gnu
    899         eval $set_cc_for_build
    900         sed 's/^        //' << EOF >$dummy.c
    901         #ifdef __dietlibc__
    902         LIBC=dietlibc
    903         #endif
    904 EOF
    905         eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
    906         echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
     942        echo ${UNAME_MACHINE}-pc-linux-${LIBC}
    907943        exit ;;
    908944    ia64:Linux:*:*)
    909         echo ${UNAME_MACHINE}-unknown-linux-gnu
     945        echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
    910946        exit ;;
    911947    m32r*:Linux:*:*)
    912         echo ${UNAME_MACHINE}-unknown-linux-gnu
     948        echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
    913949        exit ;;
    914950    m68*:Linux:*:*)
    915         echo ${UNAME_MACHINE}-unknown-linux-gnu
     951        echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
    916952        exit ;;
    917953    mips:Linux:*:* | mips64:Linux:*:*)
     
    932968EOF
    933969        eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
    934         test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
     970        test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
    935971        ;;
    936     or32:Linux:*:*)
    937         echo or32-unknown-linux-gnu
     972    openrisc*:Linux:*:*)
     973        echo or1k-unknown-linux-${LIBC}
     974        exit ;;
     975    or32:Linux:*:* | or1k*:Linux:*:*)
     976        echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
    938977        exit ;;
    939978    padre:Linux:*:*)
    940         echo sparc-unknown-linux-gnu
     979        echo sparc-unknown-linux-${LIBC}
    941980        exit ;;
    942981    parisc64:Linux:*:* | hppa64:Linux:*:*)
    943         echo hppa64-unknown-linux-gnu
     982        echo hppa64-unknown-linux-${LIBC}
    944983        exit ;;
    945984    parisc:Linux:*:* | hppa:Linux:*:*)
    946985        # Look for CPU level
    947986        case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
    948           PA7*) echo hppa1.1-unknown-linux-gnu ;;
    949           PA8*) echo hppa2.0-unknown-linux-gnu ;;
    950           *)    echo hppa-unknown-linux-gnu ;;
     987          PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
     988          PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
     989          *)    echo hppa-unknown-linux-${LIBC} ;;
    951990        esac
    952991        exit ;;
    953992    ppc64:Linux:*:*)
    954         echo powerpc64-unknown-linux-gnu
     993        echo powerpc64-unknown-linux-${LIBC}
    955994        exit ;;
    956995    ppc:Linux:*:*)
    957         echo powerpc-unknown-linux-gnu
     996        echo powerpc-unknown-linux-${LIBC}
     997        exit ;;
     998    ppc64le:Linux:*:*)
     999        echo powerpc64le-unknown-linux-${LIBC}
     1000        exit ;;
     1001    ppcle:Linux:*:*)
     1002        echo powerpcle-unknown-linux-${LIBC}
    9581003        exit ;;
    9591004    s390:Linux:*:* | s390x:Linux:*:*)
    960         echo ${UNAME_MACHINE}-ibm-linux
     1005        echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
    9611006        exit ;;
    9621007    sh64*:Linux:*:*)
    963         echo ${UNAME_MACHINE}-unknown-linux-gnu
     1008        echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
    9641009        exit ;;
    9651010    sh*:Linux:*:*)
    966         echo ${UNAME_MACHINE}-unknown-linux-gnu
     1011        echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
    9671012        exit ;;
    9681013    sparc:Linux:*:* | sparc64:Linux:*:*)
    969         echo ${UNAME_MACHINE}-unknown-linux-gnu
     1014        echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
     1015        exit ;;
     1016    tile*:Linux:*:*)
     1017        echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
    9701018        exit ;;
    9711019    vax:Linux:*:*)
    972         echo ${UNAME_MACHINE}-dec-linux-gnu
     1020        echo ${UNAME_MACHINE}-dec-linux-${LIBC}
    9731021        exit ;;
    9741022    x86_64:Linux:*:*)
    975         echo x86_64-unknown-linux-gnu
     1023        echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
    9761024        exit ;;
    9771025    xtensa*:Linux:*:*)
    978         echo ${UNAME_MACHINE}-unknown-linux-gnu
     1026        echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
    9791027        exit ;;
    9801028    i*86:DYNIX/ptx:4*:*)
     
    9851033        exit ;;
    9861034    i*86:UNIX_SV:4.2MP:2.*)
    987         # Unixware is an offshoot of SVR4, but it has its own version
    988         # number series starting with 2...
    989         # I am not positive that other SVR4 systems won't match this,
     1035        # Unixware is an offshoot of SVR4, but it has its own version
     1036        # number series starting with 2...
     1037        # I am not positive that other SVR4 systems won't match this,
    9901038        # I just have to hope.  -- rms.
    991         # Use sysv4.2uw... so that sysv4* matches it.
     1039        # Use sysv4.2uw... so that sysv4* matches it.
    9921040        echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
    9931041        exit ;;
     
    10211069        exit ;;
    10221070    i*86:*:5:[678]*)
    1023         # UnixWare 7.x, OpenUNIX and OpenServer 6.
     1071        # UnixWare 7.x, OpenUNIX and OpenServer 6.
    10241072        case `/bin/uname -X | grep "^Machine"` in
    10251073            *486*)           UNAME_MACHINE=i486 ;;
     
    10491097    pc:*:*:*)
    10501098        # Left here for compatibility:
    1051         # uname -m prints for DJGPP always 'pc', but it prints nothing about
    1052         # the processor, so we play safe by assuming i586.
     1099        # uname -m prints for DJGPP always 'pc', but it prints nothing about
     1100        # the processor, so we play safe by assuming i586.
    10531101        # Note: whatever this is, it MUST be the same as what config.sub
    10541102        # prints for the "djgpp" host, or else GDB configury will decide that
    10551103        # this is a cross-build.
    10561104        echo i586-pc-msdosdjgpp
    1057         exit ;;
     1105        exit ;;
    10581106    Intel:Mach:3*:*)
    10591107        echo i386-pc-mach3
     
    10901138          && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
    10911139    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
    1092         /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
    1093           && { echo i486-ncr-sysv4; exit; } ;;
     1140        /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
     1141          && { echo i486-ncr-sysv4; exit; } ;;
    10941142    NCR*:*:4.2:* | MPRAS*:*:4.2:*)
    10951143        OS_REL='.3'
     
    11341182        fi
    11351183        exit ;;
    1136     PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
    1137                       # says <Richard.M.Bartel@ccMail.Census.GOV>
    1138         echo i586-unisys-sysv4
    1139         exit ;;
     1184    PENTIUM:*:4.0*:*)   # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
     1185                        # says <Richard.M.Bartel@ccMail.Census.GOV>
     1186        echo i586-unisys-sysv4
     1187        exit ;;
    11401188    *:UNIX_System_V:4*:FTX*)
    11411189        # From Gerald Hewes <hewes@openmarket.com>.
     
    11631211    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
    11641212        if [ -d /usr/nec ]; then
    1165                 echo mips-nec-sysv${UNAME_RELEASE}
     1213                echo mips-nec-sysv${UNAME_RELEASE}
    11661214        else
    1167                 echo mips-unknown-sysv${UNAME_RELEASE}
    1168         fi
    1169         exit ;;
     1215                echo mips-unknown-sysv${UNAME_RELEASE}
     1216        fi
     1217        exit ;;
    11701218    BeBox:BeOS:*:*)     # BeOS running on hardware made by Be, PPC only.
    11711219        echo powerpc-be-beos
     
    11801228        echo i586-pc-haiku
    11811229        exit ;;
     1230    x86_64:Haiku:*:*)
     1231        echo x86_64-unknown-haiku
     1232        exit ;;
    11821233    SX-4:SUPER-UX:*:*)
    11831234        echo sx4-nec-superux${UNAME_RELEASE}
     
    12061257    *:Darwin:*:*)
    12071258        UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
    1208         case $UNAME_PROCESSOR in
    1209             i386)
    1210                 eval $set_cc_for_build
    1211                 if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
    1212                   if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
    1213                       (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
    1214                       grep IS_64BIT_ARCH >/dev/null
    1215                   then
    1216                       UNAME_PROCESSOR="x86_64"
    1217                   fi
    1218                 fi ;;
    1219             unknown) UNAME_PROCESSOR=powerpc ;;
    1220         esac
     1259        eval $set_cc_for_build
     1260        if test "$UNAME_PROCESSOR" = unknown ; then
     1261            UNAME_PROCESSOR=powerpc
     1262        fi
     1263        if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then
     1264            if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
     1265                if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
     1266                    (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
     1267                    grep IS_64BIT_ARCH >/dev/null
     1268                then
     1269                    case $UNAME_PROCESSOR in
     1270                        i386) UNAME_PROCESSOR=x86_64 ;;
     1271                        powerpc) UNAME_PROCESSOR=powerpc64 ;;
     1272                    esac
     1273                fi
     1274            fi
     1275        elif test "$UNAME_PROCESSOR" = i386 ; then
     1276            # Avoid executing cc on OS X 10.9, as it ships with a stub
     1277            # that puts up a graphical alert prompting to install
     1278            # developer tools.  Any system running Mac OS X 10.7 or
     1279            # later (Darwin 11 and later) is required to have a 64-bit
     1280            # processor. This is not true of the ARM version of Darwin
     1281            # that Apple uses in portable devices.
     1282            UNAME_PROCESSOR=x86_64
     1283        fi
    12211284        echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
    12221285        exit ;;
     
    12321295        echo i386-pc-qnx
    12331296        exit ;;
    1234     NSE-?:NONSTOP_KERNEL:*:*)
     1297    NEO-?:NONSTOP_KERNEL:*:*)
     1298        echo neo-tandem-nsk${UNAME_RELEASE}
     1299        exit ;;
     1300    NSE-*:NONSTOP_KERNEL:*:*)
    12351301        echo nse-tandem-nsk${UNAME_RELEASE}
    12361302        exit ;;
     
    12771343        exit ;;
    12781344    SEI:*:*:SEIUX)
    1279         echo mips-sei-seiux${UNAME_RELEASE}
     1345        echo mips-sei-seiux${UNAME_RELEASE}
    12801346        exit ;;
    12811347    *:DragonFly:*:*)
     
    12831349        exit ;;
    12841350    *:*VMS:*:*)
    1285         UNAME_MACHINE=`(uname -p) 2>/dev/null`
     1351        UNAME_MACHINE=`(uname -p) 2>/dev/null`
    12861352        case "${UNAME_MACHINE}" in
    12871353            A*) echo alpha-dec-vms ; exit ;;
     
    13011367        echo ${UNAME_MACHINE}-pc-aros
    13021368        exit ;;
     1369    x86_64:VMkernel:*:*)
     1370        echo ${UNAME_MACHINE}-unknown-esx
     1371        exit ;;
    13031372esac
    1304 
    1305 #echo '(No uname command or uname output not recognized.)' 1>&2
    1306 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
    1307 
    1308 eval $set_cc_for_build
    1309 cat >$dummy.c <<EOF
    1310 #ifdef _SEQUENT_
    1311 # include <sys/types.h>
    1312 # include <sys/utsname.h>
    1313 #endif
    1314 main ()
    1315 {
    1316 #if defined (sony)
    1317 #if defined (MIPSEB)
    1318   /* BFD wants "bsd" instead of "newsos".  Perhaps BFD should be changed,
    1319      I don't know....  */
    1320   printf ("mips-sony-bsd\n"); exit (0);
    1321 #else
    1322 #include <sys/param.h>
    1323   printf ("m68k-sony-newsos%s\n",
    1324 #ifdef NEWSOS4
    1325           "4"
    1326 #else
    1327           ""
    1328 #endif
    1329          ); exit (0);
    1330 #endif
    1331 #endif
    1332 
    1333 #if defined (__arm) && defined (__acorn) && defined (__unix)
    1334   printf ("arm-acorn-riscix\n"); exit (0);
    1335 #endif
    1336 
    1337 #if defined (hp300) && !defined (hpux)
    1338   printf ("m68k-hp-bsd\n"); exit (0);
    1339 #endif
    1340 
    1341 #if defined (NeXT)
    1342 #if !defined (__ARCHITECTURE__)
    1343 #define __ARCHITECTURE__ "m68k"
    1344 #endif
    1345   int version;
    1346   version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
    1347   if (version < 4)
    1348     printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
    1349   else
    1350     printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
    1351   exit (0);
    1352 #endif
    1353 
    1354 #if defined (MULTIMAX) || defined (n16)
    1355 #if defined (UMAXV)
    1356   printf ("ns32k-encore-sysv\n"); exit (0);
    1357 #else
    1358 #if defined (CMU)
    1359   printf ("ns32k-encore-mach\n"); exit (0);
    1360 #else
    1361   printf ("ns32k-encore-bsd\n"); exit (0);
    1362 #endif
    1363 #endif
    1364 #endif
    1365 
    1366 #if defined (__386BSD__)
    1367   printf ("i386-pc-bsd\n"); exit (0);
    1368 #endif
    1369 
    1370 #if defined (sequent)
    1371 #if defined (i386)
    1372   printf ("i386-sequent-dynix\n"); exit (0);
    1373 #endif
    1374 #if defined (ns32000)
    1375   printf ("ns32k-sequent-dynix\n"); exit (0);
    1376 #endif
    1377 #endif
    1378 
    1379 #if defined (_SEQUENT_)
    1380     struct utsname un;
    1381 
    1382     uname(&un);
    1383 
    1384     if (strncmp(un.version, "V2", 2) == 0) {
    1385         printf ("i386-sequent-ptx2\n"); exit (0);
    1386     }
    1387     if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
    1388         printf ("i386-sequent-ptx1\n"); exit (0);
    1389     }
    1390     printf ("i386-sequent-ptx\n"); exit (0);
    1391 
    1392 #endif
    1393 
    1394 #if defined (vax)
    1395 # if !defined (ultrix)
    1396 #  include <sys/param.h>
    1397 #  if defined (BSD)
    1398 #   if BSD == 43
    1399       printf ("vax-dec-bsd4.3\n"); exit (0);
    1400 #   else
    1401 #    if BSD == 199006
    1402       printf ("vax-dec-bsd4.3reno\n"); exit (0);
    1403 #    else
    1404       printf ("vax-dec-bsd\n"); exit (0);
    1405 #    endif
    1406 #   endif
    1407 #  else
    1408     printf ("vax-dec-bsd\n"); exit (0);
    1409 #  endif
    1410 # else
    1411     printf ("vax-dec-ultrix\n"); exit (0);
    1412 # endif
    1413 #endif
    1414 
    1415 #if defined (alliant) && defined (i860)
    1416   printf ("i860-alliant-bsd\n"); exit (0);
    1417 #endif
    1418 
    1419   exit (1);
    1420 }
    1421 EOF
    1422 
    1423 $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
    1424         { echo "$SYSTEM_NAME"; exit; }
    1425 
    1426 # Apollos put the system type in the environment.
    1427 
    1428 test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
    1429 
    1430 # Convex versions that predate uname can use getsysinfo(1)
    1431 
    1432 if [ -x /usr/convex/getsysinfo ]
    1433 then
    1434     case `getsysinfo -f cpu_type` in
    1435     c1*)
    1436         echo c1-convex-bsd
    1437         exit ;;
    1438     c2*)
    1439         if getsysinfo -f scalar_acc
    1440         then echo c32-convex-bsd
    1441         else echo c2-convex-bsd
    1442         fi
    1443         exit ;;
    1444     c34*)
    1445         echo c34-convex-bsd
    1446         exit ;;
    1447     c38*)
    1448         echo c38-convex-bsd
    1449         exit ;;
    1450     c4*)
    1451         echo c4-convex-bsd
    1452         exit ;;
    1453     esac
    1454 fi
    14551373
    14561374cat >&2 <<EOF
Note: See TracChangeset for help on using the changeset viewer.