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.
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
139
139
UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
140
140
UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
142
case "${UNAME_MACHINE}" in
144
test -z "$VENDOR" && VENDOR=pc
147
test -z "$VENDOR" && VENDOR=unknown
150
test -f /etc/SuSE-release -o -f /.buildenv && VENDOR=suse
152
142
# Note: order is significant - the case branches are not exclusive.
154
144
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
180
170
arm*|i386|m68k|ns32k|sh3*|sparc|vax)
181
171
eval $set_cc_for_build
182
172
if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
183
| grep __ELF__ >/dev/null
185
175
# Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
186
176
# Return netbsd for either. FIX?
334
324
case `/usr/bin/uname -p` in
335
325
sparc) echo sparc-icl-nx7; exit ;;
328
echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
337
330
sun4H:SunOS:5.*:*)
338
331
echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
341
334
echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
343
336
i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
344
echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
337
eval $set_cc_for_build
339
# If there is a compiler, see if it is configured for 64-bit objects.
340
# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
341
# This test works for both compilers.
342
if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
343
if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
344
(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
345
grep IS_64BIT_ARCH >/dev/null
350
echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
346
352
sun4*:SunOS:6*:*)
347
353
# According to config.sub, this is the proper way to canonicalize
816
822
[345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
817
823
echo i${UNAME_MACHINE}-pc-mks
819
828
i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
820
829
# How do we know it's Interix rather than the generic POSIX subsystem?
821
830
# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
850
859
if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
851
860
| grep -q __ARM_EABI__
853
echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
862
echo ${UNAME_MACHINE}-unknown-linux-gnu
855
echo ${UNAME_MACHINE}-${VENDOR}-linux-gnueabi
864
echo ${UNAME_MACHINE}-unknown-linux-gnueabi
858
867
avr32*:Linux:*:*)
859
echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
868
echo ${UNAME_MACHINE}-unknown-linux-gnu
862
871
echo cris-axis-linux-gnu
865
874
echo crisv32-axis-linux-gnu
868
echo frv-${VENDOR}-linux-gnu
877
echo frv-unknown-linux-gnu
871
echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
880
echo ${UNAME_MACHINE}-unknown-linux-gnu
874
echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
883
echo ${UNAME_MACHINE}-unknown-linux-gnu
877
echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
886
echo ${UNAME_MACHINE}-unknown-linux-gnu
880
eval $set_cc_for_build
881
sed 's/^ //' << EOF >$dummy.c
885
#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
888
#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
895
eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
900
test x"${CPU}" != x && { echo "${CPU}-${VENDOR}-linux-gnu"; exit; }
903
eval $set_cc_for_build
904
sed 's/^ //' << EOF >$dummy.c
908
#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
911
#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
918
eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
923
test x"${CPU}" != x && { echo "${CPU}-${VENDOR}-linux-gnu"; exit; }
888
mips:Linux:*:* | mips64:Linux:*:*)
889
eval $set_cc_for_build
890
sed 's/^ //' << EOF >$dummy.c
892
#undef ${UNAME_MACHINE}
893
#undef ${UNAME_MACHINE}el
894
#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
895
CPU=${UNAME_MACHINE}el
897
#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
904
eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
909
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
926
echo or32-${VENDOR}-linux-gnu
912
echo or32-unknown-linux-gnu
929
echo powerpc-${VENDOR}-linux-gnu
915
echo powerpc-unknown-linux-gnu
932
echo powerpc64-${VENDOR}-linux-gnu
918
echo powerpc64-unknown-linux-gnu
935
921
case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
941
927
EV67) UNAME_MACHINE=alphaev67 ;;
942
928
EV68*) UNAME_MACHINE=alphaev68 ;;
944
objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
930
objdump --private-headers /bin/sh | grep -q ld.so.1
945
931
if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
946
echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu${LIBC}
932
echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
935
echo sparc-unknown-linux-gnu
948
937
parisc:Linux:*:* | hppa:Linux:*:*)
949
938
# Look for CPU level
950
939
case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
951
PA7*) echo hppa1.1-${VENDOR}-linux-gnu ;;
952
PA8*) echo hppa2.0-${VENDOR}-linux-gnu ;;
953
*) echo hppa-${VENDOR}-linux-gnu ;;
940
PA7*) echo hppa1.1-unknown-linux-gnu ;;
941
PA8*) echo hppa2.0-unknown-linux-gnu ;;
942
*) echo hppa-unknown-linux-gnu ;;
956
945
parisc64:Linux:*:* | hppa64:Linux:*:*)
957
echo hppa64-${VENDOR}-linux-gnu
946
echo hppa64-unknown-linux-gnu
959
948
s390:Linux:*:* | s390x:Linux:*:*)
960
949
echo ${UNAME_MACHINE}-ibm-linux
963
echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
952
echo ${UNAME_MACHINE}-unknown-linux-gnu
966
echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
955
echo ${UNAME_MACHINE}-unknown-linux-gnu
968
957
sparc:Linux:*:* | sparc64:Linux:*:*)
969
echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
958
echo ${UNAME_MACHINE}-unknown-linux-gnu
972
961
echo ${UNAME_MACHINE}-dec-linux-gnu
974
963
x86_64:Linux:*:*)
975
echo x86_64-${VENDOR}-linux-gnu
964
echo x86_64-unknown-linux-gnu
977
966
xtensa*:Linux:*:*)
978
echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
967
echo ${UNAME_MACHINE}-unknown-linux-gnu
981
970
# The BFD linker knows what the default object file format is, so
991
980
case "$ld_supported_targets" in
993
TENTATIVE="${UNAME_MACHINE}-${VENDOR}-linux-gnu"
982
TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
996
echo "${UNAME_MACHINE}-${VENDOR}-linux-gnuaout"
999
echo "${UNAME_MACHINE}-${VENDOR}-linux-gnucoff"
1002
# Either a pre-BFD a.out linker (linux-gnuoldld) or
1003
# one that does not give us useful --help.
1004
echo "${UNAME_MACHINE}-${VENDOR}-linux-gnuoldld"
1007
985
# Determine whether the default compiler is a.out or elf
1008
986
eval $set_cc_for_build
1068
1046
i*86:syllable:*:*)
1069
1047
echo ${UNAME_MACHINE}-pc-syllable
1071
i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
1049
i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
1072
1050
echo i386-unknown-lynxos${UNAME_RELEASE}
1113
1091
# Left here for compatibility:
1114
1092
# uname -m prints for DJGPP always 'pc', but it prints nothing about
1115
# the processor, so we play safe by assuming i386.
1116
echo i386-pc-msdosdjgpp
1093
# the processor, so we play safe by assuming i586.
1094
# Note: whatever this is, it MUST be the same as what config.sub
1095
# prints for the "djgpp" host, or else GDB configury will decide that
1096
# this is a cross-build.
1097
echo i586-pc-msdosdjgpp
1118
1099
Intel:Mach:3*:*)
1119
1100
echo i386-pc-mach3
1151
1132
3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
1152
1133
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1153
1134
&& { echo i486-ncr-sysv4; exit; } ;;
1135
NCR*:*:4.2:* | MPRAS*:*:4.2:*)
1137
test -r /etc/.relid \
1138
&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
1139
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1140
&& { echo i486-ncr-sysv4.3${OS_REL}; exit; }
1141
/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
1142
&& { echo i586-ncr-sysv4.3${OS_REL}; exit; }
1143
/bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
1144
&& { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
1154
1145
m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
1155
1146
echo m68k-unknown-lynxos${UNAME_RELEASE}
1163
1154
rs6000:LynxOS:2.*:*)
1164
1155
echo rs6000-unknown-lynxos${UNAME_RELEASE}
1166
PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
1157
PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
1167
1158
echo powerpc-unknown-lynxos${UNAME_RELEASE}
1169
1160
SM[BE]S:UNIX_SV:*:*)
1494
1491
the operating system you are using. It is advised that you
1495
1492
download the most up to date version of the config scripts from
1497
http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess
1494
http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
1499
http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub
1496
http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
1501
1498
If the version you run ($0) is already up to date, please
1502
1499
send the following data and any information you think might be