4
4
# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
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
if [ "${UNAME_SYSTEM}" = "Linux" ] ; then
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__
156
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep LIBC= | sed -e 's: ::g'`
159
142
# Note: order is significant - the case branches are not exclusive.
161
144
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
178
161
arm*) machine=arm-unknown ;;
179
162
sh3el) machine=shl-unknown ;;
180
163
sh3eb) machine=sh-unknown ;;
164
sh5el) machine=sh5le-unknown ;;
181
165
*) machine=${UNAME_MACHINE_ARCH}-unknown ;;
183
167
# The Operating System including object format, if it has switched
808
792
echo ${UNAME_MACHINE}-pc-pw32
810
x86:Interix*:[3456]*)
811
echo i586-pc-interix${UNAME_RELEASE}
813
EM64T:Interix*:[3456]*)
814
echo x86_64-unknown-interix${UNAME_RELEASE}
795
case ${UNAME_MACHINE} in
797
echo i586-pc-interix${UNAME_RELEASE}
799
EM64T | authenticamd)
800
echo x86_64-unknown-interix${UNAME_RELEASE}
816
803
[345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
817
804
echo i${UNAME_MACHINE}-pc-mks
846
833
echo ${UNAME_MACHINE}-pc-minix
849
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
836
echo ${UNAME_MACHINE}-unknown-linux-gnu
851
838
avr32*:Linux:*:*)
852
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
839
echo ${UNAME_MACHINE}-unknown-linux-gnu
855
echo cris-axis-linux-${LIBC}
842
echo cris-axis-linux-gnu
857
844
crisv32:Linux:*:*)
858
echo crisv32-axis-linux-${LIBC}
845
echo crisv32-axis-linux-gnu
861
echo frv-unknown-linux-${LIBC}
848
echo frv-unknown-linux-gnu
864
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
851
echo ${UNAME_MACHINE}-unknown-linux-gnu
867
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
854
echo ${UNAME_MACHINE}-unknown-linux-gnu
870
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
857
echo ${UNAME_MACHINE}-unknown-linux-gnu
873
860
eval $set_cc_for_build
916
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
903
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
919
echo or32-unknown-linux-${LIBC}
906
echo or32-unknown-linux-gnu
922
echo powerpc-unknown-linux-${LIBC}
909
echo powerpc-unknown-linux-gnu
925
echo powerpc64-unknown-linux-${LIBC}
912
echo powerpc64-unknown-linux-gnu
928
915
case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
935
922
EV68*) UNAME_MACHINE=alphaev68 ;;
937
924
objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
938
if test "$?" = 0 ; then LIBC="gnulibc1" ; fi
939
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
925
if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
926
echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
941
928
parisc:Linux:*:* | hppa:Linux:*:*)
942
929
# Look for CPU level
943
930
case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
944
PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
945
PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
946
*) echo hppa-unknown-linux-${LIBC} ;;
931
PA7*) echo hppa1.1-unknown-linux-gnu ;;
932
PA8*) echo hppa2.0-unknown-linux-gnu ;;
933
*) echo hppa-unknown-linux-gnu ;;
949
936
parisc64:Linux:*:* | hppa64:Linux:*:*)
950
echo hppa64-unknown-linux-${LIBC}
937
echo hppa64-unknown-linux-gnu
952
939
s390:Linux:*:* | s390x:Linux:*:*)
953
940
echo ${UNAME_MACHINE}-ibm-linux
956
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
943
echo ${UNAME_MACHINE}-unknown-linux-gnu
959
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
946
echo ${UNAME_MACHINE}-unknown-linux-gnu
961
948
sparc:Linux:*:* | sparc64:Linux:*:*)
962
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
949
echo ${UNAME_MACHINE}-unknown-linux-gnu
965
echo ${UNAME_MACHINE}-dec-linux-${LIBC}
952
echo ${UNAME_MACHINE}-dec-linux-gnu
967
954
x86_64:Linux:*:*)
968
echo x86_64-unknown-linux-${LIBC}
955
echo x86_64-unknown-linux-gnu
958
echo xtensa-unknown-linux-gnu
971
961
# The BFD linker knows what the default object file format is, so
981
971
case "$ld_supported_targets" in
983
TENTATIVE="${UNAME_MACHINE}-pc-linux-${LIBC}"
973
TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
985
975
a.out-i386-linux)
986
echo "${UNAME_MACHINE}-pc-linux-${LIBC}aout"
976
echo "${UNAME_MACHINE}-pc-linux-gnuaout"
989
echo "${UNAME_MACHINE}-pc-linux-${LIBC}coff"
979
echo "${UNAME_MACHINE}-pc-linux-gnucoff"
992
982
# Either a pre-BFD a.out linker (linux-gnuoldld) or
993
983
# one that does not give us useful --help.
994
echo "${UNAME_MACHINE}-pc-linux-${LIBC}oldld"
984
echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
997
# This should get integrated into the C code below, but now we hack
998
if [ "$LIBC" != "gnu" ] ; then echo "$TENTATIVE" && exit 0 ; fi
999
987
# Determine whether the default compiler is a.out or elf
1000
988
eval $set_cc_for_build
1001
989
sed 's/^ //' << EOF >$dummy.c
1227
1215
SX-6:SUPER-UX:*:*)
1228
1216
echo sx6-nec-superux${UNAME_RELEASE}
1219
echo sx7-nec-superux${UNAME_RELEASE}
1222
echo sx8-nec-superux${UNAME_RELEASE}
1225
echo sx8r-nec-superux${UNAME_RELEASE}
1230
1227
Power*:Rhapsody:*:*)
1231
1228
echo powerpc-apple-rhapsody${UNAME_RELEASE}