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?
832
822
[345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
833
823
echo i${UNAME_MACHINE}-pc-mks
835
828
i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
836
829
# How do we know it's Interix rather than the generic POSIX subsystem?
837
830
# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
866
859
if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
867
860
| grep -q __ARM_EABI__
869
echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
862
echo ${UNAME_MACHINE}-unknown-linux-gnu
871
echo ${UNAME_MACHINE}-${VENDOR}-linux-gnueabi
864
echo ${UNAME_MACHINE}-unknown-linux-gnueabi
874
867
avr32*:Linux:*:*)
875
echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
868
echo ${UNAME_MACHINE}-unknown-linux-gnu
878
871
echo cris-axis-linux-gnu
881
874
echo crisv32-axis-linux-gnu
884
echo frv-${VENDOR}-linux-gnu
877
echo frv-unknown-linux-gnu
887
echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
880
echo ${UNAME_MACHINE}-unknown-linux-gnu
890
echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
883
echo ${UNAME_MACHINE}-unknown-linux-gnu
893
echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
886
echo ${UNAME_MACHINE}-unknown-linux-gnu
896
eval $set_cc_for_build
897
sed 's/^ //' << EOF >$dummy.c
901
#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
904
#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
911
eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
916
test x"${CPU}" != x && { echo "${CPU}-${VENDOR}-linux-gnu"; exit; }
919
eval $set_cc_for_build
920
sed 's/^ //' << EOF >$dummy.c
924
#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
927
#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
934
eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
939
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; }
942
echo or32-${VENDOR}-linux-gnu
912
echo or32-unknown-linux-gnu
945
echo powerpc-${VENDOR}-linux-gnu
915
echo powerpc-unknown-linux-gnu
948
echo powerpc64-${VENDOR}-linux-gnu
918
echo powerpc64-unknown-linux-gnu
951
921
case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
957
927
EV67) UNAME_MACHINE=alphaev67 ;;
958
928
EV68*) UNAME_MACHINE=alphaev68 ;;
960
objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
930
objdump --private-headers /bin/sh | grep -q ld.so.1
961
931
if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
962
echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu${LIBC}
932
echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
965
935
echo sparc-unknown-linux-gnu
967
937
parisc:Linux:*:* | hppa:Linux:*:*)
968
938
# Look for CPU level
969
939
case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
970
PA7*) echo hppa1.1-${VENDOR}-linux-gnu ;;
971
PA8*) echo hppa2.0-${VENDOR}-linux-gnu ;;
972
*) 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 ;;
975
945
parisc64:Linux:*:* | hppa64:Linux:*:*)
976
echo hppa64-${VENDOR}-linux-gnu
946
echo hppa64-unknown-linux-gnu
978
948
s390:Linux:*:* | s390x:Linux:*:*)
979
949
echo ${UNAME_MACHINE}-ibm-linux
982
echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
952
echo ${UNAME_MACHINE}-unknown-linux-gnu
985
echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
955
echo ${UNAME_MACHINE}-unknown-linux-gnu
987
957
sparc:Linux:*:* | sparc64:Linux:*:*)
988
echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
958
echo ${UNAME_MACHINE}-unknown-linux-gnu
991
961
echo ${UNAME_MACHINE}-dec-linux-gnu
993
963
x86_64:Linux:*:*)
994
echo x86_64-${VENDOR}-linux-gnu
964
echo x86_64-unknown-linux-gnu
996
966
xtensa*:Linux:*:*)
997
echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
967
echo ${UNAME_MACHINE}-unknown-linux-gnu
1000
970
# The BFD linker knows what the default object file format is, so
1010
980
case "$ld_supported_targets" in
1012
TENTATIVE="${UNAME_MACHINE}-${VENDOR}-linux-gnu"
982
TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
1015
echo "${UNAME_MACHINE}-${VENDOR}-linux-gnuaout"
1018
# Either a pre-BFD a.out linker (linux-gnuoldld) or
1019
# one that does not give us useful --help.
1020
echo "${UNAME_MACHINE}-${VENDOR}-linux-gnuoldld"
1023
985
# Determine whether the default compiler is a.out or elf
1024
986
eval $set_cc_for_build
1076
1038
echo ${UNAME_MACHINE}-pc-os2-emx
1078
1040
i*86:XTS-300:*:STOP)
1079
echo ${UNAME_MACHINE}-${VENDOR}-stop
1041
echo ${UNAME_MACHINE}-unknown-stop
1081
1043
i*86:atheos:*:*)
1082
echo ${UNAME_MACHINE}-${VENDOR}-atheos
1044
echo ${UNAME_MACHINE}-unknown-atheos
1084
1046
i*86:syllable:*:*)
1085
1047
echo ${UNAME_MACHINE}-pc-syllable
1087
i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
1088
echo i386-${VENDOR}-lynxos${UNAME_RELEASE}
1049
i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
1050
echo i386-unknown-lynxos${UNAME_RELEASE}
1091
1053
echo ${UNAME_MACHINE}-pc-msdosdjgpp
1105
1067
*Pentium) UNAME_MACHINE=i586 ;;
1106
1068
*Pent*|*Celeron) UNAME_MACHINE=i686 ;;
1108
echo ${UNAME_MACHINE}-${VENDOR}-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
1070
echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
1111
1073
if test -f /usr/options/cb.name; then
1144
1106
if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
1145
1107
echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
1146
1108
else # Add other i860-SVR4 vendors below as they are discovered.
1147
echo i860-${VENDOR}-sysv${UNAME_RELEASE} # Unknown i860-SVR4
1109
echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
1150
1112
mini*:CTIX:SYS*5:*)
1181
1143
/bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
1182
1144
&& { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
1183
1145
m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
1184
echo m68k-${VENDOR}-lynxos${UNAME_RELEASE}
1146
echo m68k-unknown-lynxos${UNAME_RELEASE}
1186
1148
mc68030:UNIX_System_V:4.*:*)
1187
1149
echo m68k-atari-sysv4
1189
1151
TSUNAMI:LynxOS:2.*:*)
1190
echo sparc-${VENDOR}-lynxos${UNAME_RELEASE}
1152
echo sparc-unknown-lynxos${UNAME_RELEASE}
1192
1154
rs6000:LynxOS:2.*:*)
1193
echo rs6000-${VENDOR}-lynxos${UNAME_RELEASE}
1155
echo rs6000-unknown-lynxos${UNAME_RELEASE}
1195
PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
1196
echo powerpc-${VENDOR}-lynxos${UNAME_RELEASE}
1157
PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
1158
echo powerpc-unknown-lynxos${UNAME_RELEASE}
1198
1160
SM[BE]S:UNIX_SV:*:*)
1199
1161
echo mips-dde-sysv${UNAME_RELEASE}
1243
1205
if [ -d /usr/nec ]; then
1244
1206
echo mips-nec-sysv${UNAME_RELEASE}
1246
echo mips-${VENDOR}-sysv${UNAME_RELEASE}
1208
echo mips-unknown-sysv${UNAME_RELEASE}
1249
1211
BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
1325
1287
UNAME_MACHINE="$cputype"
1327
echo ${UNAME_MACHINE}-${VENDOR}-plan9
1289
echo ${UNAME_MACHINE}-unknown-plan9
1330
echo pdp10-${VENDOR}-tops10
1292
echo pdp10-unknown-tops10
1333
echo pdp10-${VENDOR}-tenex
1295
echo pdp10-unknown-tenex
1335
1297
KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
1336
1298
echo pdp10-dec-tops20
1339
1301
echo pdp10-xkl-tops20
1342
echo pdp10-${VENDOR}-tops20
1304
echo pdp10-unknown-tops20
1345
echo pdp10-${VENDOR}-its
1307
echo pdp10-unknown-its
1348
1310
echo mips-sei-seiux${UNAME_RELEASE}
1350
1312
*:DragonFly:*:*)
1351
echo ${UNAME_MACHINE}-${VENDOR}-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
1313
echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
1354
1316
UNAME_MACHINE=`(uname -p) 2>/dev/null`