138
138
UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
139
139
UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
141
case "${UNAME_SYSTEM}" in
143
eval $set_cc_for_build
144
cat <<-EOF > $dummy.c
145
#include <features.h>
147
# ifdef __UCLIBC_CONFIG_VERSION__
148
LIBC=uclibc __UCLIBC_CONFIG_VERSION__
160
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
141
164
# Note: order is significant - the case branches are not exclusive.
143
166
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
855
echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
878
echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
858
881
# other systems with GNU libc and userland
859
echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
882
echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
862
885
echo ${UNAME_MACHINE}-pc-minix
864
887
aarch64:Linux:*:*)
865
echo ${UNAME_MACHINE}-unknown-linux-gnu
888
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
867
890
aarch64_be:Linux:*:*)
868
891
UNAME_MACHINE=aarch64_be
869
echo ${UNAME_MACHINE}-unknown-linux-gnu
892
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
872
895
case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
879
902
EV68*) UNAME_MACHINE=alphaev68 ;;
881
904
objdump --private-headers /bin/sh | grep -q ld.so.1
882
if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
883
echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
905
if test "$?" = 0 ; then LIBC="gnulibc1" ; fi
906
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
886
909
eval $set_cc_for_build
887
910
if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
888
911
| grep -q __ARM_EABI__
890
echo ${UNAME_MACHINE}-unknown-linux-gnu
913
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
892
915
if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
893
916
| grep -q __ARM_PCS_VFP
895
echo ${UNAME_MACHINE}-unknown-linux-gnueabi
918
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
897
echo ${UNAME_MACHINE}-unknown-linux-gnueabihf
920
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf
901
924
avr32*:Linux:*:*)
902
echo ${UNAME_MACHINE}-unknown-linux-gnu
925
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
905
echo ${UNAME_MACHINE}-axis-linux-gnu
928
echo ${UNAME_MACHINE}-axis-linux-${LIBC}
907
930
crisv32:Linux:*:*)
908
echo ${UNAME_MACHINE}-axis-linux-gnu
931
echo ${UNAME_MACHINE}-axis-linux-${LIBC}
911
echo ${UNAME_MACHINE}-unknown-linux-gnu
934
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
913
936
hexagon:Linux:*:*)
914
echo ${UNAME_MACHINE}-unknown-linux-gnu
937
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
918
eval $set_cc_for_build
919
sed 's/^ //' << EOF >$dummy.c
924
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
925
echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
940
echo ${UNAME_MACHINE}-pc-linux-${LIBC}
928
echo ${UNAME_MACHINE}-unknown-linux-gnu
943
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
931
echo ${UNAME_MACHINE}-unknown-linux-gnu
946
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
934
echo ${UNAME_MACHINE}-unknown-linux-gnu
949
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
936
951
mips:Linux:*:* | mips64:Linux:*:*)
937
952
eval $set_cc_for_build
952
967
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
953
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
968
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
956
echo ${UNAME_MACHINE}-unknown-linux-gnu
971
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
959
echo sparc-unknown-linux-gnu
974
echo sparc-unknown-linux-${LIBC}
961
976
parisc64:Linux:*:* | hppa64:Linux:*:*)
962
echo hppa64-unknown-linux-gnu
977
echo hppa64-unknown-linux-${LIBC}
964
979
parisc:Linux:*:* | hppa:Linux:*:*)
965
980
# Look for CPU level
966
981
case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
967
PA7*) echo hppa1.1-unknown-linux-gnu ;;
968
PA8*) echo hppa2.0-unknown-linux-gnu ;;
969
*) echo hppa-unknown-linux-gnu ;;
982
PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
983
PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
984
*) echo hppa-unknown-linux-${LIBC} ;;
973
echo powerpc64-unknown-linux-gnu
988
echo powerpc64-unknown-linux-${LIBC}
976
echo powerpc-unknown-linux-gnu
991
echo powerpc-unknown-linux-${LIBC}
978
993
s390:Linux:*:* | s390x:Linux:*:*)
979
994
echo ${UNAME_MACHINE}-ibm-linux
982
echo ${UNAME_MACHINE}-unknown-linux-gnu
997
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
985
echo ${UNAME_MACHINE}-unknown-linux-gnu
1000
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
987
1002
sparc:Linux:*:* | sparc64:Linux:*:*)
988
echo ${UNAME_MACHINE}-unknown-linux-gnu
1003
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
990
1005
tile*:Linux:*:*)
991
echo ${UNAME_MACHINE}-unknown-linux-gnu
1006
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
994
echo ${UNAME_MACHINE}-dec-linux-gnu
1009
echo ${UNAME_MACHINE}-dec-linux-${LIBC}
996
1011
x86_64:Linux:*:*)
997
echo ${UNAME_MACHINE}-unknown-linux-gnu
1012
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
999
1014
xtensa*:Linux:*:*)
1000
echo ${UNAME_MACHINE}-unknown-linux-gnu
1015
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
1002
1017
i*86:DYNIX/ptx:4*:*)
1003
1018
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.