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, 2009, 2010
5
# Free Software Foundation, Inc.
4
# 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
9
8
# This file is free software; you can redistribute it and/or modify it
10
9
# under the terms of the GNU General Public License as published by
27
26
# the same distribution terms that you use for the rest of that program.
30
# Originally written by Per Bothner. Please send patches (context
31
# diff format) to <config-patches@gnu.org> and include a ChangeLog
29
# Originally written by Per Bothner <per@bothner.com>.
30
# Please send patches to <config-patches@gnu.org>. Submit a context
31
# diff and a properly formatted ChangeLog entry.
34
33
# This script attempts to guess a canonical system name similar to
35
34
# config.sub. If it succeeds, it prints the system name on stdout, and
36
35
# exits with 0. Otherwise, it exits with 1.
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
37
# The plan is that this can be called by configure scripts if you
38
# don't specify an explicit build system type.
41
40
me=`echo "$0" | sed -e 's,.*/,,'`
56
55
GNU config.guess ($timestamp)
58
57
Originally written by Per Bothner.
59
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
60
2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free
61
Software Foundation, Inc.
58
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
59
Free Software Foundation, Inc.
63
61
This is free software; see the source for copying conditions. There is NO
64
62
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
108
106
trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
109
107
trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
110
108
: ${TMPDIR=/tmp} ;
111
{ tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
109
{ tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
112
110
{ test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
113
111
{ tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
114
112
{ echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
162
160
arm*) machine=arm-unknown ;;
163
161
sh3el) machine=shl-unknown ;;
164
162
sh3eb) machine=sh-unknown ;;
165
sh5el) machine=sh5le-unknown ;;
166
163
*) machine=${UNAME_MACHINE_ARCH}-unknown ;;
168
165
# The Operating System including object format, if it has switched
171
168
arm*|i386|m68k|ns32k|sh3*|sparc|vax)
172
169
eval $set_cc_for_build
173
170
if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
171
| grep __ELF__ >/dev/null
176
173
# Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
177
174
# Return netbsd for either. FIX?
210
207
echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
213
echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
215
209
macppc:MirBSD:*:*)
216
echo powerpc-unknown-mirbsd${UNAME_RELEASE}
210
echo powerppc-unknown-mirbsd${UNAME_RELEASE}
219
213
echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
325
319
case `/usr/bin/uname -p` in
326
320
sparc) echo sparc-icl-nx7; exit ;;
329
echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
331
322
sun4H:SunOS:5.*:*)
332
323
echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
334
325
sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
335
326
echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
337
i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
338
echo i386-pc-auroraux${UNAME_RELEASE}
340
i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
341
eval $set_cc_for_build
343
# If there is a compiler, see if it is configured for 64-bit objects.
344
# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
345
# This test works for both compilers.
346
if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
347
if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
348
(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
349
grep IS_64BIT_ARCH >/dev/null
354
echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
329
echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
356
331
sun4*:SunOS:6*:*)
357
332
# According to config.sub, this is the proper way to canonicalize
789
764
echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
792
case ${UNAME_MACHINE} in
794
echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
796
echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
798
echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
767
echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
802
770
echo ${UNAME_MACHINE}-pc-cygwin
805
773
echo ${UNAME_MACHINE}-pc-mingw32
812
780
echo ${UNAME_MACHINE}-pc-pw32
815
case ${UNAME_MACHINE} in
817
echo i586-pc-interix${UNAME_RELEASE}
819
authenticamd | genuineintel | EM64T)
820
echo x86_64-unknown-interix${UNAME_RELEASE}
823
echo ia64-unknown-interix${UNAME_RELEASE}
783
echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//'
826
785
[345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
827
786
echo i${UNAME_MACHINE}-pc-mks
832
788
i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
833
789
# How do we know it's Interix rather than the generic POSIX subsystem?
834
790
# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
859
815
echo ${UNAME_MACHINE}-pc-minix
818
echo ${UNAME_MACHINE}-unknown-linux-gnu
821
echo cris-axis-linux-gnu
824
echo crisv32-axis-linux-gnu
827
echo frv-unknown-linux-gnu
830
echo ${UNAME_MACHINE}-unknown-linux-gnu
833
echo ${UNAME_MACHINE}-unknown-linux-gnu
836
echo ${UNAME_MACHINE}-unknown-linux-gnu
839
eval $set_cc_for_build
840
sed 's/^ //' << EOF >$dummy.c
844
#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
847
#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
854
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
855
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
858
eval $set_cc_for_build
859
sed 's/^ //' << EOF >$dummy.c
863
#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
866
#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
873
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
874
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
877
echo or32-unknown-linux-gnu
880
echo powerpc-unknown-linux-gnu
883
echo powerpc64-unknown-linux-gnu
862
886
case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
863
887
EV5) UNAME_MACHINE=alphaev5 ;;
868
892
EV67) UNAME_MACHINE=alphaev67 ;;
869
893
EV68*) UNAME_MACHINE=alphaev68 ;;
871
objdump --private-headers /bin/sh | grep -q ld.so.1
895
objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
872
896
if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
873
897
echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
876
eval $set_cc_for_build
877
if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
878
| grep -q __ARM_EABI__
880
echo ${UNAME_MACHINE}-unknown-linux-gnu
882
echo ${UNAME_MACHINE}-unknown-linux-gnueabi
886
echo ${UNAME_MACHINE}-unknown-linux-gnu
889
echo cris-axis-linux-gnu
892
echo crisv32-axis-linux-gnu
895
echo frv-unknown-linux-gnu
899
eval $set_cc_for_build
900
sed 's/^ //' << EOF >$dummy.c
905
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
906
echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
909
echo ${UNAME_MACHINE}-unknown-linux-gnu
912
echo ${UNAME_MACHINE}-unknown-linux-gnu
915
echo ${UNAME_MACHINE}-unknown-linux-gnu
917
mips:Linux:*:* | mips64:Linux:*:*)
918
eval $set_cc_for_build
919
sed 's/^ //' << EOF >$dummy.c
921
#undef ${UNAME_MACHINE}
922
#undef ${UNAME_MACHINE}el
923
#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
924
CPU=${UNAME_MACHINE}el
926
#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
933
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
934
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
937
echo or32-unknown-linux-gnu
940
echo sparc-unknown-linux-gnu
942
parisc64:Linux:*:* | hppa64:Linux:*:*)
943
echo hppa64-unknown-linux-gnu
945
899
parisc:Linux:*:* | hppa:Linux:*:*)
946
900
# Look for CPU level
947
901
case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
950
904
*) echo hppa-unknown-linux-gnu ;;
954
echo powerpc64-unknown-linux-gnu
957
echo powerpc-unknown-linux-gnu
907
parisc64:Linux:*:* | hppa64:Linux:*:*)
908
echo hppa64-unknown-linux-gnu
959
910
s390:Linux:*:* | s390x:Linux:*:*)
960
911
echo ${UNAME_MACHINE}-ibm-linux
968
919
sparc:Linux:*:* | sparc64:Linux:*:*)
969
920
echo ${UNAME_MACHINE}-unknown-linux-gnu
972
echo ${UNAME_MACHINE}-dec-linux-gnu
974
922
x86_64:Linux:*:*)
975
923
echo x86_64-unknown-linux-gnu
978
echo ${UNAME_MACHINE}-unknown-linux-gnu
926
# The BFD linker knows what the default object file format is, so
927
# first see if it will tell us. cd to the root directory to prevent
928
# problems with other programs or directories called `ld' in the path.
929
# Set LC_ALL=C to ensure ld outputs messages in English.
930
ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
931
| sed -ne '/supported targets:/!d
933
s/.*supported targets: *//
936
case "$ld_supported_targets" in
938
TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
941
echo "${UNAME_MACHINE}-pc-linux-gnuaout"
944
echo "${UNAME_MACHINE}-pc-linux-gnucoff"
947
# Either a pre-BFD a.out linker (linux-gnuoldld) or
948
# one that does not give us useful --help.
949
echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
952
# Determine whether the default compiler is a.out or elf
953
eval $set_cc_for_build
954
sed 's/^ //' << EOF >$dummy.c
955
#include <features.h>
967
#ifdef __INTEL_COMPILER
977
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
978
test x"${LIBC}" != x && {
979
echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
982
test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
980
984
i*86:DYNIX/ptx:4*:*)
981
985
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
982
986
# earlier versions are messed up and put the nodename in both
1005
1009
i*86:syllable:*:*)
1006
1010
echo ${UNAME_MACHINE}-pc-syllable
1008
i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
1012
i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
1009
1013
echo i386-unknown-lynxos${UNAME_RELEASE}
1050
1054
# Left here for compatibility:
1051
1055
# uname -m prints for DJGPP always 'pc', but it prints nothing about
1052
# the processor, so we play safe by assuming i586.
1053
# Note: whatever this is, it MUST be the same as what config.sub
1054
# prints for the "djgpp" host, or else GDB configury will decide that
1055
# this is a cross-build.
1056
echo i586-pc-msdosdjgpp
1056
# the processor, so we play safe by assuming i386.
1057
echo i386-pc-msdosdjgpp
1058
1059
Intel:Mach:3*:*)
1059
1060
echo i386-pc-mach3
1091
1092
3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
1092
1093
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1093
1094
&& { echo i486-ncr-sysv4; exit; } ;;
1094
NCR*:*:4.2:* | MPRAS*:*:4.2:*)
1096
test -r /etc/.relid \
1097
&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
1098
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1099
&& { echo i486-ncr-sysv4.3${OS_REL}; exit; }
1100
/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
1101
&& { echo i586-ncr-sysv4.3${OS_REL}; exit; }
1102
/bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
1103
&& { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
1104
1095
m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
1105
1096
echo m68k-unknown-lynxos${UNAME_RELEASE}
1113
1104
rs6000:LynxOS:2.*:*)
1114
1105
echo rs6000-unknown-lynxos${UNAME_RELEASE}
1116
PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
1107
PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
1117
1108
echo powerpc-unknown-lynxos${UNAME_RELEASE}
1119
1110
SM[BE]S:UNIX_SV:*:*)
1188
1176
SX-6:SUPER-UX:*:*)
1189
1177
echo sx6-nec-superux${UNAME_RELEASE}
1192
echo sx7-nec-superux${UNAME_RELEASE}
1195
echo sx8-nec-superux${UNAME_RELEASE}
1198
echo sx8r-nec-superux${UNAME_RELEASE}
1200
1179
Power*:Rhapsody:*:*)
1201
1180
echo powerpc-apple-rhapsody${UNAME_RELEASE}
1207
1186
UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
1208
1187
case $UNAME_PROCESSOR in
1210
eval $set_cc_for_build
1211
if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
1212
if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
1213
(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
1214
grep IS_64BIT_ARCH >/dev/null
1216
UNAME_PROCESSOR="x86_64"
1188
*86) UNAME_PROCESSOR=i686 ;;
1219
1189
unknown) UNAME_PROCESSOR=powerpc ;;
1221
1191
echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
1460
1424
the operating system you are using. It is advised that you
1461
1425
download the most up to date version of the config scripts from
1463
http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
1427
http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess
1465
http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
1429
http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub
1467
1431
If the version you run ($0) is already up to date, please
1468
1432
send the following data and any information you think might be