| 1 |
|
#! /bin/sh |
| 2 |
|
# 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 |
| 4 |
> |
# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 |
| 5 |
|
# Free Software Foundation, Inc. |
| 6 |
|
|
| 7 |
< |
timestamp='2009-04-27' |
| 7 |
> |
timestamp='2010-08-21' |
| 8 |
|
|
| 9 |
|
# This file is free software; you can redistribute it and/or modify it |
| 10 |
|
# under the terms of the GNU General Public License as published by |
| 27 |
|
# the same distribution terms that you use for the rest of that program. |
| 28 |
|
|
| 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 |
|
# |
| 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. |
| 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 |
|
|
| 41 |
|
me=`echo "$0" | sed -e 's,.*/,,'` |
| 42 |
|
|
| 56 |
|
GNU config.guess ($timestamp) |
| 57 |
|
|
| 58 |
|
Originally written by Per Bothner. |
| 59 |
< |
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, |
| 60 |
< |
2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. |
| 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. |
| 62 |
|
|
| 63 |
|
This is free software; see the source for copying conditions. There is NO |
| 64 |
|
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." |
| 92 |
|
exit 1 |
| 93 |
|
fi |
| 94 |
|
|
| 95 |
< |
trap 'exit 1' 1 2 15 |
| 95 |
> |
trap 'exit 1' HUP INT TERM |
| 96 |
|
|
| 97 |
|
# CC_FOR_BUILD -- compiler used by this script. Note that the use of a |
| 98 |
|
# compiler to aid in system detection is discouraged as it requires |
| 106 |
|
|
| 107 |
|
set_cc_for_build=' |
| 108 |
|
trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; |
| 109 |
< |
trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; |
| 109 |
> |
trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" HUP INT PIPE TERM ; |
| 110 |
|
: ${TMPDIR=/tmp} ; |
| 111 |
|
{ tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || |
| 112 |
|
{ test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || |
| 171 |
|
arm*|i386|m68k|ns32k|sh3*|sparc|vax) |
| 172 |
|
eval $set_cc_for_build |
| 173 |
|
if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ |
| 174 |
< |
| grep __ELF__ >/dev/null |
| 174 |
> |
| grep -q __ELF__ |
| 175 |
|
then |
| 176 |
|
# Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). |
| 177 |
|
# Return netbsd for either. FIX? |
| 334 |
|
sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) |
| 335 |
|
echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` |
| 336 |
|
exit ;; |
| 337 |
+ |
i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) |
| 338 |
+ |
echo i386-pc-auroraux${UNAME_RELEASE} |
| 339 |
+ |
exit ;; |
| 340 |
|
i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) |
| 341 |
|
eval $set_cc_for_build |
| 342 |
|
SUN_ARCH="i386" |
| 552 |
|
echo rs6000-ibm-aix3.2 |
| 553 |
|
fi |
| 554 |
|
exit ;; |
| 555 |
< |
*:AIX:*:[456]) |
| 555 |
> |
*:AIX:*:[4567]) |
| 556 |
|
IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` |
| 557 |
|
if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then |
| 558 |
|
IBM_ARCH=rs6000 |
| 660 |
|
# => hppa64-hp-hpux11.23 |
| 661 |
|
|
| 662 |
|
if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | |
| 663 |
< |
grep __LP64__ >/dev/null |
| 663 |
> |
grep -q __LP64__ |
| 664 |
|
then |
| 665 |
|
HP_ARCH="hppa2.0w" |
| 666 |
|
else |
| 811 |
|
i*:PW*:*) |
| 812 |
|
echo ${UNAME_MACHINE}-pc-pw32 |
| 813 |
|
exit ;; |
| 814 |
< |
*:Interix*:[3456]*) |
| 814 |
> |
*:Interix*:*) |
| 815 |
|
case ${UNAME_MACHINE} in |
| 816 |
|
x86) |
| 817 |
|
echo i586-pc-interix${UNAME_RELEASE} |
| 818 |
|
exit ;; |
| 819 |
< |
EM64T | authenticamd | genuineintel) |
| 819 |
> |
authenticamd | genuineintel | EM64T) |
| 820 |
|
echo x86_64-unknown-interix${UNAME_RELEASE} |
| 821 |
|
exit ;; |
| 822 |
|
IA64) |
| 826 |
|
[345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) |
| 827 |
|
echo i${UNAME_MACHINE}-pc-mks |
| 828 |
|
exit ;; |
| 829 |
+ |
8664:Windows_NT:*) |
| 830 |
+ |
echo x86_64-pc-mks |
| 831 |
+ |
exit ;; |
| 832 |
|
i*:Windows_NT*:* | Pentium*:Windows_NT*:*) |
| 833 |
|
# How do we know it's Interix rather than the generic POSIX subsystem? |
| 834 |
|
# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we |
| 857 |
|
exit ;; |
| 858 |
|
i*86:Minix:*:*) |
| 859 |
|
echo ${UNAME_MACHINE}-pc-minix |
| 860 |
+ |
exit ;; |
| 861 |
+ |
alpha:Linux:*:*) |
| 862 |
+ |
case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in |
| 863 |
+ |
EV5) UNAME_MACHINE=alphaev5 ;; |
| 864 |
+ |
EV56) UNAME_MACHINE=alphaev56 ;; |
| 865 |
+ |
PCA56) UNAME_MACHINE=alphapca56 ;; |
| 866 |
+ |
PCA57) UNAME_MACHINE=alphapca56 ;; |
| 867 |
+ |
EV6) UNAME_MACHINE=alphaev6 ;; |
| 868 |
+ |
EV67) UNAME_MACHINE=alphaev67 ;; |
| 869 |
+ |
EV68*) UNAME_MACHINE=alphaev68 ;; |
| 870 |
+ |
esac |
| 871 |
+ |
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} |
| 874 |
|
exit ;; |
| 875 |
|
arm*:Linux:*:*) |
| 876 |
|
eval $set_cc_for_build |
| 894 |
|
frv:Linux:*:*) |
| 895 |
|
echo frv-unknown-linux-gnu |
| 896 |
|
exit ;; |
| 897 |
+ |
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}" |
| 907 |
+ |
exit ;; |
| 908 |
|
ia64:Linux:*:*) |
| 909 |
|
echo ${UNAME_MACHINE}-unknown-linux-gnu |
| 910 |
|
exit ;; |
| 914 |
|
m68*:Linux:*:*) |
| 915 |
|
echo ${UNAME_MACHINE}-unknown-linux-gnu |
| 916 |
|
exit ;; |
| 917 |
< |
mips:Linux:*:*) |
| 917 |
> |
mips:Linux:*:* | mips64:Linux:*:*) |
| 918 |
|
eval $set_cc_for_build |
| 919 |
|
sed 's/^ //' << EOF >$dummy.c |
| 920 |
|
#undef CPU |
| 921 |
< |
#undef mips |
| 922 |
< |
#undef mipsel |
| 921 |
> |
#undef ${UNAME_MACHINE} |
| 922 |
> |
#undef ${UNAME_MACHINE}el |
| 923 |
|
#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) |
| 924 |
< |
CPU=mipsel |
| 924 |
> |
CPU=${UNAME_MACHINE}el |
| 925 |
|
#else |
| 926 |
|
#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) |
| 927 |
< |
CPU=mips |
| 927 |
> |
CPU=${UNAME_MACHINE} |
| 928 |
|
#else |
| 929 |
|
CPU= |
| 930 |
|
#endif |
| 931 |
|
#endif |
| 932 |
|
EOF |
| 933 |
< |
eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' |
| 902 |
< |
/^CPU/{ |
| 903 |
< |
s: ::g |
| 904 |
< |
p |
| 905 |
< |
}'`" |
| 933 |
> |
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` |
| 934 |
|
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } |
| 935 |
|
;; |
| 908 |
– |
mips64:Linux:*:*) |
| 909 |
– |
eval $set_cc_for_build |
| 910 |
– |
sed 's/^ //' << EOF >$dummy.c |
| 911 |
– |
#undef CPU |
| 912 |
– |
#undef mips64 |
| 913 |
– |
#undef mips64el |
| 914 |
– |
#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) |
| 915 |
– |
CPU=mips64el |
| 916 |
– |
#else |
| 917 |
– |
#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) |
| 918 |
– |
CPU=mips64 |
| 919 |
– |
#else |
| 920 |
– |
CPU= |
| 921 |
– |
#endif |
| 922 |
– |
#endif |
| 923 |
– |
EOF |
| 924 |
– |
eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' |
| 925 |
– |
/^CPU/{ |
| 926 |
– |
s: ::g |
| 927 |
– |
p |
| 928 |
– |
}'`" |
| 929 |
– |
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } |
| 930 |
– |
;; |
| 936 |
|
or32:Linux:*:*) |
| 937 |
|
echo or32-unknown-linux-gnu |
| 933 |
– |
exit ;; |
| 934 |
– |
ppc:Linux:*:*) |
| 935 |
– |
echo powerpc-unknown-linux-gnu |
| 938 |
|
exit ;; |
| 937 |
– |
ppc64:Linux:*:*) |
| 938 |
– |
echo powerpc64-unknown-linux-gnu |
| 939 |
– |
exit ;; |
| 940 |
– |
alpha:Linux:*:*) |
| 941 |
– |
case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in |
| 942 |
– |
EV5) UNAME_MACHINE=alphaev5 ;; |
| 943 |
– |
EV56) UNAME_MACHINE=alphaev56 ;; |
| 944 |
– |
PCA56) UNAME_MACHINE=alphapca56 ;; |
| 945 |
– |
PCA57) UNAME_MACHINE=alphapca56 ;; |
| 946 |
– |
EV6) UNAME_MACHINE=alphaev6 ;; |
| 947 |
– |
EV67) UNAME_MACHINE=alphaev67 ;; |
| 948 |
– |
EV68*) UNAME_MACHINE=alphaev68 ;; |
| 949 |
– |
esac |
| 950 |
– |
objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null |
| 951 |
– |
if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi |
| 952 |
– |
echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} |
| 953 |
– |
exit ;; |
| 939 |
|
padre:Linux:*:*) |
| 940 |
|
echo sparc-unknown-linux-gnu |
| 941 |
|
exit ;; |
| 942 |
+ |
parisc64:Linux:*:* | hppa64:Linux:*:*) |
| 943 |
+ |
echo hppa64-unknown-linux-gnu |
| 944 |
+ |
exit ;; |
| 945 |
|
parisc:Linux:*:* | hppa:Linux:*:*) |
| 946 |
|
# Look for CPU level |
| 947 |
|
case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in |
| 950 |
|
*) echo hppa-unknown-linux-gnu ;; |
| 951 |
|
esac |
| 952 |
|
exit ;; |
| 953 |
< |
parisc64:Linux:*:* | hppa64:Linux:*:*) |
| 954 |
< |
echo hppa64-unknown-linux-gnu |
| 953 |
> |
ppc64:Linux:*:*) |
| 954 |
> |
echo powerpc64-unknown-linux-gnu |
| 955 |
|
exit ;; |
| 956 |
+ |
ppc:Linux:*:*) |
| 957 |
+ |
echo powerpc-unknown-linux-gnu |
| 958 |
+ |
exit ;; |
| 959 |
|
s390:Linux:*:* | s390x:Linux:*:*) |
| 960 |
|
echo ${UNAME_MACHINE}-ibm-linux |
| 961 |
|
exit ;; |
| 968 |
|
sparc:Linux:*:* | sparc64:Linux:*:*) |
| 969 |
|
echo ${UNAME_MACHINE}-unknown-linux-gnu |
| 970 |
|
exit ;; |
| 971 |
+ |
tile*:Linux:*:*) |
| 972 |
+ |
echo ${UNAME_MACHINE}-tilera-linux-gnu |
| 973 |
+ |
exit ;; |
| 974 |
|
vax:Linux:*:*) |
| 975 |
|
echo ${UNAME_MACHINE}-dec-linux-gnu |
| 976 |
|
exit ;; |
| 980 |
|
xtensa*:Linux:*:*) |
| 981 |
|
echo ${UNAME_MACHINE}-unknown-linux-gnu |
| 982 |
|
exit ;; |
| 989 |
– |
i*86:Linux:*:*) |
| 990 |
– |
# The BFD linker knows what the default object file format is, so |
| 991 |
– |
# first see if it will tell us. cd to the root directory to prevent |
| 992 |
– |
# problems with other programs or directories called `ld' in the path. |
| 993 |
– |
# Set LC_ALL=C to ensure ld outputs messages in English. |
| 994 |
– |
ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ |
| 995 |
– |
| sed -ne '/supported targets:/!d |
| 996 |
– |
s/[ ][ ]*/ /g |
| 997 |
– |
s/.*supported targets: *// |
| 998 |
– |
s/ .*// |
| 999 |
– |
p'` |
| 1000 |
– |
case "$ld_supported_targets" in |
| 1001 |
– |
elf32-i386) |
| 1002 |
– |
TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" |
| 1003 |
– |
;; |
| 1004 |
– |
a.out-i386-linux) |
| 1005 |
– |
echo "${UNAME_MACHINE}-pc-linux-gnuaout" |
| 1006 |
– |
exit ;; |
| 1007 |
– |
"") |
| 1008 |
– |
# Either a pre-BFD a.out linker (linux-gnuoldld) or |
| 1009 |
– |
# one that does not give us useful --help. |
| 1010 |
– |
echo "${UNAME_MACHINE}-pc-linux-gnuoldld" |
| 1011 |
– |
exit ;; |
| 1012 |
– |
esac |
| 1013 |
– |
# Determine whether the default compiler is a.out or elf |
| 1014 |
– |
eval $set_cc_for_build |
| 1015 |
– |
sed 's/^ //' << EOF >$dummy.c |
| 1016 |
– |
#include <features.h> |
| 1017 |
– |
#ifdef __ELF__ |
| 1018 |
– |
# ifdef __GLIBC__ |
| 1019 |
– |
# if __GLIBC__ >= 2 |
| 1020 |
– |
LIBC=gnu |
| 1021 |
– |
# else |
| 1022 |
– |
LIBC=gnulibc1 |
| 1023 |
– |
# endif |
| 1024 |
– |
# else |
| 1025 |
– |
LIBC=gnulibc1 |
| 1026 |
– |
# endif |
| 1027 |
– |
#else |
| 1028 |
– |
#if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) |
| 1029 |
– |
LIBC=gnu |
| 1030 |
– |
#else |
| 1031 |
– |
LIBC=gnuaout |
| 1032 |
– |
#endif |
| 1033 |
– |
#endif |
| 1034 |
– |
#ifdef __dietlibc__ |
| 1035 |
– |
LIBC=dietlibc |
| 1036 |
– |
#endif |
| 1037 |
– |
EOF |
| 1038 |
– |
eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' |
| 1039 |
– |
/^LIBC/{ |
| 1040 |
– |
s: ::g |
| 1041 |
– |
p |
| 1042 |
– |
}'`" |
| 1043 |
– |
test x"${LIBC}" != x && { |
| 1044 |
– |
echo "${UNAME_MACHINE}-pc-linux-${LIBC}" |
| 1045 |
– |
exit |
| 1046 |
– |
} |
| 1047 |
– |
test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; } |
| 1048 |
– |
;; |
| 983 |
|
i*86:DYNIX/ptx:4*:*) |
| 984 |
|
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. |
| 985 |
|
# earlier versions are messed up and put the nodename in both |
| 1008 |
|
i*86:syllable:*:*) |
| 1009 |
|
echo ${UNAME_MACHINE}-pc-syllable |
| 1010 |
|
exit ;; |
| 1011 |
< |
i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) |
| 1011 |
> |
i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) |
| 1012 |
|
echo i386-unknown-lynxos${UNAME_RELEASE} |
| 1013 |
|
exit ;; |
| 1014 |
|
i*86:*DOS:*:*) |
| 1116 |
|
rs6000:LynxOS:2.*:*) |
| 1117 |
|
echo rs6000-unknown-lynxos${UNAME_RELEASE} |
| 1118 |
|
exit ;; |
| 1119 |
< |
PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) |
| 1119 |
> |
PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) |
| 1120 |
|
echo powerpc-unknown-lynxos${UNAME_RELEASE} |
| 1121 |
|
exit ;; |
| 1122 |
|
SM[BE]S:UNIX_SV:*:*) |
| 1209 |
|
*:Darwin:*:*) |
| 1210 |
|
UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown |
| 1211 |
|
case $UNAME_PROCESSOR in |
| 1212 |
+ |
i386) |
| 1213 |
+ |
eval $set_cc_for_build |
| 1214 |
+ |
if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then |
| 1215 |
+ |
if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ |
| 1216 |
+ |
(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ |
| 1217 |
+ |
grep IS_64BIT_ARCH >/dev/null |
| 1218 |
+ |
then |
| 1219 |
+ |
UNAME_PROCESSOR="x86_64" |
| 1220 |
+ |
fi |
| 1221 |
+ |
fi ;; |
| 1222 |
|
unknown) UNAME_PROCESSOR=powerpc ;; |
| 1223 |
|
esac |
| 1224 |
|
echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} |