866
858
echo ${UNAME_MACHINE}-pc-minix
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 ;;
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}
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__
873
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
879
echo ${UNAME_MACHINE}-unknown-linux-gnu
875
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
881
echo ${UNAME_MACHINE}-unknown-linux-gnueabi
878
884
avr32*:Linux:*:*)
879
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
885
echo ${UNAME_MACHINE}-unknown-linux-gnu
882
echo cris-axis-linux-${LIBC}
888
echo cris-axis-linux-gnu
884
890
crisv32:Linux:*:*)
885
echo crisv32-axis-linux-${LIBC}
891
echo crisv32-axis-linux-gnu
888
echo frv-unknown-linux-${LIBC}
894
echo frv-unknown-linux-gnu
898
eval $set_cc_for_build
899
sed 's/^ //' << EOF >$dummy.c
904
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
905
echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
891
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
908
echo ${UNAME_MACHINE}-unknown-linux-gnu
894
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
911
echo ${UNAME_MACHINE}-unknown-linux-gnu
897
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
914
echo ${UNAME_MACHINE}-unknown-linux-gnu
900
eval $set_cc_for_build
901
sed 's/^ //' << EOF >$dummy.c
905
#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
908
#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
915
eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
920
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
923
eval $set_cc_for_build
924
sed 's/^ //' << EOF >$dummy.c
928
#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
931
#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
938
eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
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
920
#undef ${UNAME_MACHINE}
921
#undef ${UNAME_MACHINE}el
922
#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
923
CPU=${UNAME_MACHINE}el
925
#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
932
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
933
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
946
echo or32-unknown-linux-${LIBC}
949
echo powerpc-unknown-linux-${LIBC}
952
echo powerpc64-unknown-linux-${LIBC}
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 ;;
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
969
939
echo sparc-unknown-linux-gnu
941
parisc64:Linux:*:* | hppa64:Linux:*:*)
942
echo hppa64-unknown-linux-gnu
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 ;;
979
parisc64:Linux:*:* | hppa64:Linux:*:*)
980
echo hppa64-unknown-linux-${LIBC}
953
echo powerpc64-unknown-linux-gnu
956
echo powerpc-unknown-linux-gnu
982
958
s390:Linux:*:* | s390x:Linux:*:*)
983
959
echo ${UNAME_MACHINE}-ibm-linux
986
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
962
echo ${UNAME_MACHINE}-unknown-linux-gnu
989
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
965
echo ${UNAME_MACHINE}-unknown-linux-gnu
991
967
sparc:Linux:*:* | sparc64:Linux:*:*)
992
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
968
echo ${UNAME_MACHINE}-unknown-linux-gnu
995
echo ${UNAME_MACHINE}-dec-linux-${LIBC}
971
echo ${UNAME_MACHINE}-dec-linux-gnu
997
973
x86_64:Linux:*:*)
998
echo x86_64-unknown-linux-${LIBC}
974
echo x86_64-unknown-linux-gnu
1000
976
xtensa*:Linux:*:*)
1001
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
977
echo ${UNAME_MACHINE}-unknown-linux-gnu
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
1011
s/.*supported targets: *//
1014
case "$ld_supported_targets" in
1016
TENTATIVE="${UNAME_MACHINE}-pc-linux-${LIBC}"
1019
echo "${UNAME_MACHINE}-pc-linux-${LIBC}aout"
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"
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>
1044
#if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
1054
eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
1059
test x"${LIBC}" != x && {
1060
echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
1063
test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
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