~ubuntu-branches/ubuntu/vivid/icoutils/vivid

« back to all changes in this revision

Viewing changes to build-aux/config.guess

  • Committer: Package Import Robot
  • Author(s): Colin Watson
  • Date: 2012-09-07 01:29:54 UTC
  • mfrom: (1.1.5)
  • Revision ID: package-import@ubuntu.com-20120907012954-xmrjyo1pp6tvk798
Tags: 0.30.0-1
* New upstream release.
  - Limit size of extracted icon to size of resource (LP: #872739,
    #956065, #976092).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#! /bin/sh
2
2
# Attempt to guess a canonical system name.
3
3
#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
4
 
#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
 
4
#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
5
5
#   Free Software Foundation, Inc.
6
6
 
7
 
timestamp='2009-02-03'
 
7
timestamp='2009-11-20'
8
8
 
9
9
# This file is free software; you can redistribute it and/or modify it
10
10
# under the terms of the GNU General Public License as published by
27
27
# the same distribution terms that you use for the rest of that program.
28
28
 
29
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.
 
30
# Originally written by Per Bothner.  Please send patches (context
 
31
# diff format) to <config-patches@gnu.org> and include a ChangeLog
 
32
# entry.
33
33
#
34
34
# This script attempts to guess a canonical system name similar to
35
35
# config.sub.  If it succeeds, it prints the system name on stdout, and
36
36
# exits with 0.  Otherwise, it exits with 1.
37
37
#
38
 
# The plan is that this can be called by configure scripts if you
39
 
# don't specify an explicit build system type.
 
38
# You can get the latest version of this script from:
 
39
# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
40
40
 
41
41
me=`echo "$0" | sed -e 's,.*/,,'`
42
42
 
139
139
UNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
140
140
UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
141
141
 
142
 
if [ "${UNAME_SYSTEM}" = "Linux" ] ; then
143
 
        eval $set_cc_for_build
144
 
        cat << EOF > $dummy.c
145
 
        #include <features.h>
146
 
        #ifdef __UCLIBC__
147
 
        # ifdef __UCLIBC_CONFIG_VERSION__
148
 
        LIBC=uclibc __UCLIBC_CONFIG_VERSION__
149
 
        # else
150
 
        LIBC=uclibc
151
 
        # endif
152
 
        #else
153
 
        LIBC=gnu
154
 
        #endif
155
 
EOF
156
 
        eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep LIBC= | sed -e 's: ::g'`
157
 
fi
158
 
 
159
142
# Note: order is significant - the case branches are not exclusive.
160
143
 
161
144
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
187
170
            arm*|i386|m68k|ns32k|sh3*|sparc|vax)
188
171
                eval $set_cc_for_build
189
172
                if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
190
 
                        | grep __ELF__ >/dev/null
 
173
                        | grep -q __ELF__
191
174
                then
192
175
                    # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
193
176
                    # Return netbsd for either.  FIX?
341
324
        case `/usr/bin/uname -p` in
342
325
            sparc) echo sparc-icl-nx7; exit ;;
343
326
        esac ;;
 
327
    s390x:SunOS:*:*)
 
328
        echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
 
329
        exit ;;
344
330
    sun4H:SunOS:5.*:*)
345
331
        echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
346
332
        exit ;;
347
333
    sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
348
334
        echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
349
335
        exit ;;
 
336
    i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
 
337
        echo i386-pc-auroraux${UNAME_RELEASE}
 
338
        exit ;;
350
339
    i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
351
340
        eval $set_cc_for_build
352
341
        SUN_ARCH="i386"
670
659
            # => hppa64-hp-hpux11.23
671
660
 
672
661
            if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
673
 
                grep __LP64__ >/dev/null
 
662
                grep -q __LP64__
674
663
            then
675
664
                HP_ARCH="hppa2.0w"
676
665
            else
821
810
    i*:PW*:*)
822
811
        echo ${UNAME_MACHINE}-pc-pw32
823
812
        exit ;;
824
 
    *:Interix*:[3456]*)
 
813
    *:Interix*:*)
825
814
        case ${UNAME_MACHINE} in
826
815
            x86)
827
816
                echo i586-pc-interix${UNAME_RELEASE}
828
817
                exit ;;
829
 
            EM64T | authenticamd | genuineintel)
 
818
            authenticamd | genuineintel | EM64T)
830
819
                echo x86_64-unknown-interix${UNAME_RELEASE}
831
820
                exit ;;
832
821
            IA64)
836
825
    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
837
826
        echo i${UNAME_MACHINE}-pc-mks
838
827
        exit ;;
 
828
    8664:Windows_NT:*)
 
829
        echo x86_64-pc-mks
 
830
        exit ;;
839
831
    i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
840
832
        # How do we know it's Interix rather than the generic POSIX subsystem?
841
833
        # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
865
857
    i*86:Minix:*:*)
866
858
        echo ${UNAME_MACHINE}-pc-minix
867
859
        exit ;;
 
860
    alpha:Linux:*:*)
 
861
        case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
 
862
          EV5)   UNAME_MACHINE=alphaev5 ;;
 
863
          EV56)  UNAME_MACHINE=alphaev56 ;;
 
864
          PCA56) UNAME_MACHINE=alphapca56 ;;
 
865
          PCA57) UNAME_MACHINE=alphapca56 ;;
 
866
          EV6)   UNAME_MACHINE=alphaev6 ;;
 
867
          EV67)  UNAME_MACHINE=alphaev67 ;;
 
868
          EV68*) UNAME_MACHINE=alphaev68 ;;
 
869
        esac
 
870
        objdump --private-headers /bin/sh | grep -q ld.so.1
 
871
        if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
 
872
        echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
 
873
        exit ;;
868
874
    arm*:Linux:*:*)
869
875
        eval $set_cc_for_build
870
876
        if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
871
877
            | grep -q __ARM_EABI__
872
878
        then
873
 
            echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 
879
            echo ${UNAME_MACHINE}-unknown-linux-gnu
874
880
        else
875
 
            echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
 
881
            echo ${UNAME_MACHINE}-unknown-linux-gnueabi
876
882
        fi
877
883
        exit ;;
878
884
    avr32*:Linux:*:*)
879
 
        echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 
885
        echo ${UNAME_MACHINE}-unknown-linux-gnu
880
886
        exit ;;
881
887
    cris:Linux:*:*)
882
 
        echo cris-axis-linux-${LIBC}
 
888
        echo cris-axis-linux-gnu
883
889
        exit ;;
884
890
    crisv32:Linux:*:*)
885
 
        echo crisv32-axis-linux-${LIBC}
 
891
        echo crisv32-axis-linux-gnu
886
892
        exit ;;
887
893
    frv:Linux:*:*)
888
 
        echo frv-unknown-linux-${LIBC}
 
894
        echo frv-unknown-linux-gnu
 
895
        exit ;;
 
896
    i*86:Linux:*:*)
 
897
        LIBC=gnu
 
898
        eval $set_cc_for_build
 
899
        sed 's/^        //' << EOF >$dummy.c
 
900
        #ifdef __dietlibc__
 
901
        LIBC=dietlibc
 
902
        #endif
 
903
EOF
 
904
        eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
 
905
        echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
889
906
        exit ;;
890
907
    ia64:Linux:*:*)
891
 
        echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 
908
        echo ${UNAME_MACHINE}-unknown-linux-gnu
892
909
        exit ;;
893
910
    m32r*:Linux:*:*)
894
 
        echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 
911
        echo ${UNAME_MACHINE}-unknown-linux-gnu
895
912
        exit ;;
896
913
    m68*:Linux:*:*)
897
 
        echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 
914
        echo ${UNAME_MACHINE}-unknown-linux-gnu
898
915
        exit ;;
899
 
    mips:Linux:*:*)
900
 
        eval $set_cc_for_build
901
 
        sed 's/^        //' << EOF >$dummy.c
902
 
        #undef CPU
903
 
        #undef mips
904
 
        #undef mipsel
905
 
        #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
906
 
        CPU=mipsel
907
 
        #else
908
 
        #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
909
 
        CPU=mips
910
 
        #else
911
 
        CPU=
912
 
        #endif
913
 
        #endif
914
 
EOF
915
 
        eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
916
 
            /^CPU/{
917
 
                s: ::g
918
 
                p
919
 
            }'`"
920
 
        test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
921
 
        ;;
922
 
    mips64:Linux:*:*)
923
 
        eval $set_cc_for_build
924
 
        sed 's/^        //' << EOF >$dummy.c
925
 
        #undef CPU
926
 
        #undef mips64
927
 
        #undef mips64el
928
 
        #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
929
 
        CPU=mips64el
930
 
        #else
931
 
        #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
932
 
        CPU=mips64
933
 
        #else
934
 
        CPU=
935
 
        #endif
936
 
        #endif
937
 
EOF
938
 
        eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
939
 
            /^CPU/{
940
 
                s: ::g
941
 
                p
942
 
            }'`"
943
 
        test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
 
916
    mips:Linux:*:* | mips64:Linux:*:*)
 
917
        eval $set_cc_for_build
 
918
        sed 's/^        //' << EOF >$dummy.c
 
919
        #undef CPU
 
920
        #undef ${UNAME_MACHINE}
 
921
        #undef ${UNAME_MACHINE}el
 
922
        #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
 
923
        CPU=${UNAME_MACHINE}el
 
924
        #else
 
925
        #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
 
926
        CPU=${UNAME_MACHINE}
 
927
        #else
 
928
        CPU=
 
929
        #endif
 
930
        #endif
 
931
EOF
 
932
        eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
 
933
        test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
944
934
        ;;
945
935
    or32:Linux:*:*)
946
 
        echo or32-unknown-linux-${LIBC}
947
 
        exit ;;
948
 
    ppc:Linux:*:*)
949
 
        echo powerpc-unknown-linux-${LIBC}
950
 
        exit ;;
951
 
    ppc64:Linux:*:*)
952
 
        echo powerpc64-unknown-linux-${LIBC}
953
 
        exit ;;
954
 
    alpha:Linux:*:*)
955
 
        case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
956
 
          EV5)   UNAME_MACHINE=alphaev5 ;;
957
 
          EV56)  UNAME_MACHINE=alphaev56 ;;
958
 
          PCA56) UNAME_MACHINE=alphapca56 ;;
959
 
          PCA57) UNAME_MACHINE=alphapca56 ;;
960
 
          EV6)   UNAME_MACHINE=alphaev6 ;;
961
 
          EV67)  UNAME_MACHINE=alphaev67 ;;
962
 
          EV68*) UNAME_MACHINE=alphaev68 ;;
963
 
        esac
964
 
        objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
965
 
        if test "$?" = 0 ; then LIBC="gnulibc1" ; fi
966
 
        echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 
936
        echo or32-unknown-linux-gnu
967
937
        exit ;;
968
938
    padre:Linux:*:*)
969
939
        echo sparc-unknown-linux-gnu
970
940
        exit ;;
 
941
    parisc64:Linux:*:* | hppa64:Linux:*:*)
 
942
        echo hppa64-unknown-linux-gnu
 
943
        exit ;;
971
944
    parisc:Linux:*:* | hppa:Linux:*:*)
972
945
        # Look for CPU level
973
946
        case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
974
 
          PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
975
 
          PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
976
 
          *)    echo hppa-unknown-linux-${LIBC} ;;
 
947
          PA7*) echo hppa1.1-unknown-linux-gnu ;;
 
948
          PA8*) echo hppa2.0-unknown-linux-gnu ;;
 
949
          *)    echo hppa-unknown-linux-gnu ;;
977
950
        esac
978
951
        exit ;;
979
 
    parisc64:Linux:*:* | hppa64:Linux:*:*)
980
 
        echo hppa64-unknown-linux-${LIBC}
 
952
    ppc64:Linux:*:*)
 
953
        echo powerpc64-unknown-linux-gnu
 
954
        exit ;;
 
955
    ppc:Linux:*:*)
 
956
        echo powerpc-unknown-linux-gnu
981
957
        exit ;;
982
958
    s390:Linux:*:* | s390x:Linux:*:*)
983
959
        echo ${UNAME_MACHINE}-ibm-linux
984
960
        exit ;;
985
961
    sh64*:Linux:*:*)
986
 
        echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 
962
        echo ${UNAME_MACHINE}-unknown-linux-gnu
987
963
        exit ;;
988
964
    sh*:Linux:*:*)
989
 
        echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 
965
        echo ${UNAME_MACHINE}-unknown-linux-gnu
990
966
        exit ;;
991
967
    sparc:Linux:*:* | sparc64:Linux:*:*)
992
 
        echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 
968
        echo ${UNAME_MACHINE}-unknown-linux-gnu
993
969
        exit ;;
994
970
    vax:Linux:*:*)
995
 
        echo ${UNAME_MACHINE}-dec-linux-${LIBC}
 
971
        echo ${UNAME_MACHINE}-dec-linux-gnu
996
972
        exit ;;
997
973
    x86_64:Linux:*:*)
998
 
        echo x86_64-unknown-linux-${LIBC}
 
974
        echo x86_64-unknown-linux-gnu
999
975
        exit ;;
1000
976
    xtensa*:Linux:*:*)
1001
 
        echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 
977
        echo ${UNAME_MACHINE}-unknown-linux-gnu
1002
978
        exit ;;
1003
 
    i*86:Linux:*:*)
1004
 
        # The BFD linker knows what the default object file format is, so
1005
 
        # first see if it will tell us. cd to the root directory to prevent
1006
 
        # problems with other programs or directories called `ld' in the path.
1007
 
        # Set LC_ALL=C to ensure ld outputs messages in English.
1008
 
        ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
1009
 
                         | sed -ne '/supported targets:/!d
1010
 
                                    s/[         ][      ]*/ /g
1011
 
                                    s/.*supported targets: *//
1012
 
                                    s/ .*//
1013
 
                                    p'`
1014
 
        case "$ld_supported_targets" in
1015
 
          elf32-i386)
1016
 
                TENTATIVE="${UNAME_MACHINE}-pc-linux-${LIBC}"
1017
 
                ;;
1018
 
          a.out-i386-linux)
1019
 
                echo "${UNAME_MACHINE}-pc-linux-${LIBC}aout"
1020
 
                exit ;;
1021
 
          "")
1022
 
                # Either a pre-BFD a.out linker (linux-gnuoldld) or
1023
 
                # one that does not give us useful --help.
1024
 
                echo "${UNAME_MACHINE}-pc-linux-${LIBC}oldld"
1025
 
                exit ;;
1026
 
        esac
1027
 
        # This should get integrated into the C code below, but now we hack
1028
 
        if [ "$LIBC" != "gnu" ] ; then echo "$TENTATIVE" && exit 0 ; fi
1029
 
        # Determine whether the default compiler is a.out or elf
1030
 
        eval $set_cc_for_build
1031
 
        sed 's/^        //' << EOF >$dummy.c
1032
 
        #include <features.h>
1033
 
        #ifdef __ELF__
1034
 
        # ifdef __GLIBC__
1035
 
        #  if __GLIBC__ >= 2
1036
 
        LIBC=gnu
1037
 
        #  else
1038
 
        LIBC=gnulibc1
1039
 
        #  endif
1040
 
        # else
1041
 
        LIBC=gnulibc1
1042
 
        # endif
1043
 
        #else
1044
 
        #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
1045
 
        LIBC=gnu
1046
 
        #else
1047
 
        LIBC=gnuaout
1048
 
        #endif
1049
 
        #endif
1050
 
        #ifdef __dietlibc__
1051
 
        LIBC=dietlibc
1052
 
        #endif
1053
 
EOF
1054
 
        eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
1055
 
            /^LIBC/{
1056
 
                s: ::g
1057
 
                p
1058
 
            }'`"
1059
 
        test x"${LIBC}" != x && {
1060
 
                echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
1061
 
                exit
1062
 
        }
1063
 
        test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
1064
 
        ;;
1065
979
    i*86:DYNIX/ptx:4*:*)
1066
980
        # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
1067
981
        # earlier versions are messed up and put the nodename in both
1090
1004
    i*86:syllable:*:*)
1091
1005
        echo ${UNAME_MACHINE}-pc-syllable
1092
1006
        exit ;;
1093
 
    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
 
1007
    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
1094
1008
        echo i386-unknown-lynxos${UNAME_RELEASE}
1095
1009
        exit ;;
1096
1010
    i*86:*DOS:*:*)
1134
1048
    pc:*:*:*)
1135
1049
        # Left here for compatibility:
1136
1050
        # uname -m prints for DJGPP always 'pc', but it prints nothing about
1137
 
        # the processor, so we play safe by assuming i386.
1138
 
        echo i386-pc-msdosdjgpp
 
1051
        # the processor, so we play safe by assuming i586.
 
1052
        # Note: whatever this is, it MUST be the same as what config.sub
 
1053
        # prints for the "djgpp" host, or else GDB configury will decide that
 
1054
        # this is a cross-build.
 
1055
        echo i586-pc-msdosdjgpp
1139
1056
        exit ;;
1140
1057
    Intel:Mach:3*:*)
1141
1058
        echo i386-pc-mach3
1195
1112
    rs6000:LynxOS:2.*:*)
1196
1113
        echo rs6000-unknown-lynxos${UNAME_RELEASE}
1197
1114
        exit ;;
1198
 
    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
 
1115
    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
1199
1116
        echo powerpc-unknown-lynxos${UNAME_RELEASE}
1200
1117
        exit ;;
1201
1118
    SM[BE]S:UNIX_SV:*:*)
1288
1205
    *:Darwin:*:*)
1289
1206
        UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
1290
1207
        case $UNAME_PROCESSOR in
 
1208
            i386)
 
1209
                eval $set_cc_for_build
 
1210
                if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
 
1211
                  if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
 
1212
                      (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
 
1213
                      grep IS_64BIT_ARCH >/dev/null
 
1214
                  then
 
1215
                      UNAME_PROCESSOR="x86_64"
 
1216
                  fi
 
1217
                fi ;;
1291
1218
            unknown) UNAME_PROCESSOR=powerpc ;;
1292
1219
        esac
1293
1220
        echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}