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 Free Software Foundation,
4
# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
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
27
27
# the same distribution terms that you use for the rest of that program.
30
# Originally written by Per Bothner <per@bothner.com>.
31
# Please send patches to <config-patches@gnu.org>. Submit a context
32
# diff and a properly formatted ChangeLog entry.
30
# Originally written by Per Bothner. Please send patches (context
31
# diff format) to <config-patches@gnu.org> and include a ChangeLog
34
34
# This script attempts to guess a canonical system name similar to
35
35
# config.sub. If it succeeds, it prints the system name on stdout, and
36
36
# exits with 0. Otherwise, it exits with 1.
38
# The plan is that this can be called by configure scripts if you
39
# don't specify an explicit build system type.
38
# You can get the latest version of this script from:
39
# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
41
41
me=`echo "$0" | sed -e 's,.*/,,'`
56
56
GNU config.guess ($timestamp)
58
58
Originally written by Per Bothner.
59
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
60
Free Software Foundation, Inc.
59
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
60
2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
62
62
This is free software; see the source for copying conditions. There is NO
63
63
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
161
161
arm*) machine=arm-unknown ;;
162
162
sh3el) machine=shl-unknown ;;
163
163
sh3eb) machine=sh-unknown ;;
164
sh5el) machine=sh5le-unknown ;;
164
165
*) machine=${UNAME_MACHINE_ARCH}-unknown ;;
166
167
# The Operating System including object format, if it has switched
169
170
arm*|i386|m68k|ns32k|sh3*|sparc|vax)
170
171
eval $set_cc_for_build
171
172
if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
172
| grep __ELF__ >/dev/null
174
175
# Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
175
176
# Return netbsd for either. FIX?
323
324
case `/usr/bin/uname -p` in
324
325
sparc) echo sparc-icl-nx7; exit ;;
328
echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
326
330
sun4H:SunOS:5.*:*)
327
331
echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
329
333
sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
330
334
echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
333
echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
336
i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
337
echo i386-pc-auroraux${UNAME_RELEASE}
339
i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
340
eval $set_cc_for_build
342
# If there is a compiler, see if it is configured for 64-bit objects.
343
# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
344
# This test works for both compilers.
345
if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
346
if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
347
(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
348
grep IS_64BIT_ARCH >/dev/null
353
echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
335
355
sun4*:SunOS:6*:*)
336
356
# According to config.sub, this is the proper way to canonicalize
791
811
echo ${UNAME_MACHINE}-pc-pw32
793
x86:Interix*:[3456]*)
794
echo i586-pc-interix${UNAME_RELEASE}
796
EM64T:Interix*:[3456]*)
797
echo x86_64-unknown-interix${UNAME_RELEASE}
814
case ${UNAME_MACHINE} in
816
echo i586-pc-interix${UNAME_RELEASE}
818
authenticamd | genuineintel | EM64T)
819
echo x86_64-unknown-interix${UNAME_RELEASE}
822
echo ia64-unknown-interix${UNAME_RELEASE}
799
825
[345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
800
826
echo i${UNAME_MACHINE}-pc-mks
802
831
i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
803
832
# How do we know it's Interix rather than the generic POSIX subsystem?
804
833
# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
829
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}
832
echo ${UNAME_MACHINE}-unknown-linux-gnu
875
eval $set_cc_for_build
876
if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
877
| grep -q __ARM_EABI__
879
echo ${UNAME_MACHINE}-unknown-linux-gnu
881
echo ${UNAME_MACHINE}-unknown-linux-gnueabi
834
884
avr32*:Linux:*:*)
835
885
echo ${UNAME_MACHINE}-unknown-linux-gnu
844
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}"
847
908
echo ${UNAME_MACHINE}-unknown-linux-gnu
853
914
echo ${UNAME_MACHINE}-unknown-linux-gnu
856
eval $set_cc_for_build
857
sed 's/^ //' << EOF >$dummy.c
861
#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
864
#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
871
eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
876
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
879
eval $set_cc_for_build
880
sed 's/^ //' << EOF >$dummy.c
884
#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
887
#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
894
eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
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'`
899
933
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
902
936
echo or32-unknown-linux-gnu
905
echo powerpc-unknown-linux-gnu
908
echo powerpc64-unknown-linux-gnu
911
case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
912
EV5) UNAME_MACHINE=alphaev5 ;;
913
EV56) UNAME_MACHINE=alphaev56 ;;
914
PCA56) UNAME_MACHINE=alphapca56 ;;
915
PCA57) UNAME_MACHINE=alphapca56 ;;
916
EV6) UNAME_MACHINE=alphaev6 ;;
917
EV67) UNAME_MACHINE=alphaev67 ;;
918
EV68*) UNAME_MACHINE=alphaev68 ;;
920
objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
921
if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
922
echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
939
echo sparc-unknown-linux-gnu
941
parisc64:Linux:*:* | hppa64:Linux:*:*)
942
echo hppa64-unknown-linux-gnu
924
944
parisc:Linux:*:* | hppa:Linux:*:*)
925
945
# Look for CPU level
929
949
*) echo hppa-unknown-linux-gnu ;;
932
parisc64:Linux:*:* | hppa64:Linux:*:*)
933
echo hppa64-unknown-linux-gnu
953
echo powerpc64-unknown-linux-gnu
956
echo powerpc-unknown-linux-gnu
935
958
s390:Linux:*:* | s390x:Linux:*:*)
936
959
echo ${UNAME_MACHINE}-ibm-linux
950
973
x86_64:Linux:*:*)
951
974
echo x86_64-unknown-linux-gnu
954
# The BFD linker knows what the default object file format is, so
955
# first see if it will tell us. cd to the root directory to prevent
956
# problems with other programs or directories called `ld' in the path.
957
# Set LC_ALL=C to ensure ld outputs messages in English.
958
ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
959
| sed -ne '/supported targets:/!d
961
s/.*supported targets: *//
964
case "$ld_supported_targets" in
966
TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
969
echo "${UNAME_MACHINE}-pc-linux-gnuaout"
972
echo "${UNAME_MACHINE}-pc-linux-gnucoff"
975
# Either a pre-BFD a.out linker (linux-gnuoldld) or
976
# one that does not give us useful --help.
977
echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
980
# Determine whether the default compiler is a.out or elf
981
eval $set_cc_for_build
982
sed 's/^ //' << EOF >$dummy.c
983
#include <features.h>
995
#if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
1005
eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
1010
test x"${LIBC}" != x && {
1011
echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
1014
test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
977
echo ${UNAME_MACHINE}-unknown-linux-gnu
1016
979
i*86:DYNIX/ptx:4*:*)
1017
980
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
1018
981
# earlier versions are messed up and put the nodename in both
1041
1004
i*86:syllable:*:*)
1042
1005
echo ${UNAME_MACHINE}-pc-syllable
1044
i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
1007
i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
1045
1008
echo i386-unknown-lynxos${UNAME_RELEASE}
1086
1049
# Left here for compatibility:
1087
1050
# uname -m prints for DJGPP always 'pc', but it prints nothing about
1088
# the processor, so we play safe by assuming i386.
1089
echo i386-pc-msdosdjgpp
1051
# the processor, so we play safe by assuming i586.
1052
# Note: whatever this is, it MUST be the same as what config.sub
1053
# prints for the "djgpp" host, or else GDB configury will decide that
1054
# this is a cross-build.
1055
echo i586-pc-msdosdjgpp
1091
1057
Intel:Mach:3*:*)
1092
1058
echo i386-pc-mach3
1124
1090
3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
1125
1091
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1126
1092
&& { echo i486-ncr-sysv4; exit; } ;;
1093
NCR*:*:4.2:* | MPRAS*:*:4.2:*)
1095
test -r /etc/.relid \
1096
&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
1097
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1098
&& { echo i486-ncr-sysv4.3${OS_REL}; exit; }
1099
/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
1100
&& { echo i586-ncr-sysv4.3${OS_REL}; exit; }
1101
/bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
1102
&& { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
1127
1103
m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
1128
1104
echo m68k-unknown-lynxos${UNAME_RELEASE}
1136
1112
rs6000:LynxOS:2.*:*)
1137
1113
echo rs6000-unknown-lynxos${UNAME_RELEASE}
1139
PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
1115
PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
1140
1116
echo powerpc-unknown-lynxos${UNAME_RELEASE}
1142
1118
SM[BE]S:UNIX_SV:*:*)
1208
1187
SX-6:SUPER-UX:*:*)
1209
1188
echo sx6-nec-superux${UNAME_RELEASE}
1191
echo sx7-nec-superux${UNAME_RELEASE}
1194
echo sx8-nec-superux${UNAME_RELEASE}
1197
echo sx8r-nec-superux${UNAME_RELEASE}
1211
1199
Power*:Rhapsody:*:*)
1212
1200
echo powerpc-apple-rhapsody${UNAME_RELEASE}
1218
1206
UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
1219
1207
case $UNAME_PROCESSOR in
1209
eval $set_cc_for_build
1210
if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
1211
if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
1212
(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
1213
grep IS_64BIT_ARCH >/dev/null
1215
UNAME_PROCESSOR="x86_64"
1220
1218
unknown) UNAME_PROCESSOR=powerpc ;;
1222
1220
echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
1458
1459
the operating system you are using. It is advised that you
1459
1460
download the most up to date version of the config scripts from
1461
http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess
1462
http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
1463
http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub
1464
http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
1465
1466
If the version you run ($0) is already up to date, please
1466
1467
send the following data and any information you think might be