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, 2010
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,
60
2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free
61
Software Foundation, Inc.
62
63
This is free software; see the source for copying conditions. There is NO
63
64
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
170
171
arm*|i386|m68k|ns32k|sh3*|sparc|vax)
171
172
eval $set_cc_for_build
172
173
if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
173
| grep __ELF__ >/dev/null
175
176
# Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
176
177
# Return netbsd for either. FIX?
324
325
case `/usr/bin/uname -p` in
325
326
sparc) echo sparc-icl-nx7; exit ;;
329
echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
327
331
sun4H:SunOS:5.*:*)
328
332
echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
330
334
sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
331
335
echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
333
i86pc:SunOS:5.*:* | ix86xen:SunOS:5.*:*)
334
echo i386-pc-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/[^.]*//'`
336
356
sun4*:SunOS:6*:*)
337
357
# According to config.sub, this is the proper way to canonicalize
792
812
echo ${UNAME_MACHINE}-pc-pw32
795
815
case ${UNAME_MACHINE} in
797
817
echo i586-pc-interix${UNAME_RELEASE}
799
EM64T | authenticamd)
819
authenticamd | genuineintel | EM64T)
800
820
echo x86_64-unknown-interix${UNAME_RELEASE}
823
echo ia64-unknown-interix${UNAME_RELEASE}
803
826
[345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
804
827
echo i${UNAME_MACHINE}-pc-mks
806
832
i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
807
833
# How do we know it's Interix rather than the generic POSIX subsystem?
808
834
# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
833
859
echo ${UNAME_MACHINE}-pc-minix
862
case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
863
EV5) UNAME_MACHINE=alphaev5 ;;
864
EV56) UNAME_MACHINE=alphaev56 ;;
865
PCA56) UNAME_MACHINE=alphapca56 ;;
866
PCA57) UNAME_MACHINE=alphapca56 ;;
867
EV6) UNAME_MACHINE=alphaev6 ;;
868
EV67) UNAME_MACHINE=alphaev67 ;;
869
EV68*) UNAME_MACHINE=alphaev68 ;;
871
objdump --private-headers /bin/sh | grep -q ld.so.1
872
if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
873
echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
836
echo ${UNAME_MACHINE}-unknown-linux-gnu
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
838
885
avr32*:Linux:*:*)
839
886
echo ${UNAME_MACHINE}-unknown-linux-gnu
848
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}"
851
909
echo ${UNAME_MACHINE}-unknown-linux-gnu
857
915
echo ${UNAME_MACHINE}-unknown-linux-gnu
860
eval $set_cc_for_build
861
sed 's/^ //' << EOF >$dummy.c
865
#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
868
#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
875
eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
880
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
883
eval $set_cc_for_build
884
sed 's/^ //' << EOF >$dummy.c
888
#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
891
#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
898
eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
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'`
903
934
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
906
937
echo or32-unknown-linux-gnu
909
echo powerpc-unknown-linux-gnu
912
echo powerpc64-unknown-linux-gnu
915
case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
916
EV5) UNAME_MACHINE=alphaev5 ;;
917
EV56) UNAME_MACHINE=alphaev56 ;;
918
PCA56) UNAME_MACHINE=alphapca56 ;;
919
PCA57) UNAME_MACHINE=alphapca56 ;;
920
EV6) UNAME_MACHINE=alphaev6 ;;
921
EV67) UNAME_MACHINE=alphaev67 ;;
922
EV68*) UNAME_MACHINE=alphaev68 ;;
924
objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
925
if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
926
echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
940
echo sparc-unknown-linux-gnu
942
parisc64:Linux:*:* | hppa64:Linux:*:*)
943
echo hppa64-unknown-linux-gnu
928
945
parisc:Linux:*:* | hppa:Linux:*:*)
929
946
# Look for CPU level
933
950
*) echo hppa-unknown-linux-gnu ;;
936
parisc64:Linux:*:* | hppa64:Linux:*:*)
937
echo hppa64-unknown-linux-gnu
954
echo powerpc64-unknown-linux-gnu
957
echo powerpc-unknown-linux-gnu
939
959
s390:Linux:*:* | s390x:Linux:*:*)
940
960
echo ${UNAME_MACHINE}-ibm-linux
954
974
x86_64:Linux:*:*)
955
975
echo x86_64-unknown-linux-gnu
958
echo xtensa-unknown-linux-gnu
978
echo ${UNAME_MACHINE}-unknown-linux-gnu
961
# The BFD linker knows what the default object file format is, so
962
# first see if it will tell us. cd to the root directory to prevent
963
# problems with other programs or directories called `ld' in the path.
964
# Set LC_ALL=C to ensure ld outputs messages in English.
965
ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
966
| sed -ne '/supported targets:/!d
968
s/.*supported targets: *//
971
case "$ld_supported_targets" in
973
TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
976
echo "${UNAME_MACHINE}-pc-linux-gnuaout"
979
echo "${UNAME_MACHINE}-pc-linux-gnucoff"
982
# Either a pre-BFD a.out linker (linux-gnuoldld) or
983
# one that does not give us useful --help.
984
echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
987
# Determine whether the default compiler is a.out or elf
988
eval $set_cc_for_build
989
sed 's/^ //' << EOF >$dummy.c
990
#include <features.h>
1002
#if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
1012
eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
1017
test x"${LIBC}" != x && {
1018
echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
1021
test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
1023
980
i*86:DYNIX/ptx:4*:*)
1024
981
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
1025
982
# earlier versions are messed up and put the nodename in both
1048
1005
i*86:syllable:*:*)
1049
1006
echo ${UNAME_MACHINE}-pc-syllable
1051
i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
1008
i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
1052
1009
echo i386-unknown-lynxos${UNAME_RELEASE}
1093
1050
# Left here for compatibility:
1094
1051
# uname -m prints for DJGPP always 'pc', but it prints nothing about
1095
# the processor, so we play safe by assuming i386.
1096
echo i386-pc-msdosdjgpp
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
1098
1058
Intel:Mach:3*:*)
1099
1059
echo i386-pc-mach3
1131
1091
3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
1132
1092
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1133
1093
&& { 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; } ;;
1134
1104
m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
1135
1105
echo m68k-unknown-lynxos${UNAME_RELEASE}
1143
1113
rs6000:LynxOS:2.*:*)
1144
1114
echo rs6000-unknown-lynxos${UNAME_RELEASE}
1146
PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
1116
PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
1147
1117
echo powerpc-unknown-lynxos${UNAME_RELEASE}
1149
1119
SM[BE]S:UNIX_SV:*:*)
1234
1207
UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
1235
1208
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"
1236
1219
unknown) UNAME_PROCESSOR=powerpc ;;
1238
1221
echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
1474
1460
the operating system you are using. It is advised that you
1475
1461
download the most up to date version of the config scripts from
1477
http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess
1463
http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
1479
http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub
1465
http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
1481
1467
If the version you run ($0) is already up to date, please
1482
1468
send the following data and any information you think might be