Skip to content

Commit 087b393

Browse files
committed
Update config.guess and config.sub
1 parent c9c25a9 commit 087b393

File tree

2 files changed

+153
-162
lines changed

2 files changed

+153
-162
lines changed

config/config.guess

+81-134
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#! /bin/sh
22
# Attempt to guess a canonical system name.
33
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
4-
# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
4+
# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
55
# Free Software Foundation, Inc.
66

7-
timestamp='2009-02-03'
7+
timestamp='2010-04-03'
88

99
# This file is free software; you can redistribute it and/or modify it
1010
# under the terms of the GNU General Public License as published by
@@ -27,16 +27,16 @@ timestamp='2009-02-03'
2727
# the same distribution terms that you use for the rest of that program.
2828

2929

30-
# Originally written by Per Bothner <[email protected]>.
31-
# Please send patches to <[email protected]>. 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 <[email protected]> and include a ChangeLog
32+
# entry.
3333
#
3434
# This script attempts to guess a canonical system name similar to
3535
# config.sub. If it succeeds, it prints the system name on stdout, and
3636
# exits with 0. Otherwise, it exits with 1.
3737
#
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
4040

4141
me=`echo "$0" | sed -e 's,.*/,,'`
4242

@@ -56,8 +56,9 @@ version="\
5656
GNU config.guess ($timestamp)
5757
5858
Originally written by Per Bothner.
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.
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.
6162
6263
This is free software; see the source for copying conditions. There is NO
6364
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -91,7 +92,7 @@ if test $# != 0; then
9192
exit 1
9293
fi
9394

94-
trap 'exit 1' 1 2 15
95+
trap 'exit 1' HUP INT TERM
9596

9697
# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
9798
# compiler to aid in system detection is discouraged as it requires
@@ -105,7 +106,7 @@ trap 'exit 1' 1 2 15
105106

106107
set_cc_for_build='
107108
trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
108-
trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
109+
trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" HUP INT PIPE TERM ;
109110
: ${TMPDIR=/tmp} ;
110111
{ tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
111112
{ test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
@@ -170,7 +171,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
170171
arm*|i386|m68k|ns32k|sh3*|sparc|vax)
171172
eval $set_cc_for_build
172173
if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
173-
| grep __ELF__ >/dev/null
174+
| grep -q __ELF__
174175
then
175176
# Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
176177
# Return netbsd for either. FIX?
@@ -324,12 +325,18 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
324325
case `/usr/bin/uname -p` in
325326
sparc) echo sparc-icl-nx7; exit ;;
326327
esac ;;
328+
s390x:SunOS:*:*)
329+
echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
330+
exit ;;
327331
sun4H:SunOS:5.*:*)
328332
echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
329333
exit ;;
330334
sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
331335
echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
332336
exit ;;
337+
i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
338+
echo i386-pc-auroraux${UNAME_RELEASE}
339+
exit ;;
333340
i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
334341
eval $set_cc_for_build
335342
SUN_ARCH="i386"
@@ -653,7 +660,7 @@ EOF
653660
# => hppa64-hp-hpux11.23
654661

655662
if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
656-
grep __LP64__ >/dev/null
663+
grep -q __LP64__
657664
then
658665
HP_ARCH="hppa2.0w"
659666
else
@@ -804,12 +811,12 @@ EOF
804811
i*:PW*:*)
805812
echo ${UNAME_MACHINE}-pc-pw32
806813
exit ;;
807-
*:Interix*:[3456]*)
814+
*:Interix*:*)
808815
case ${UNAME_MACHINE} in
809816
x86)
810817
echo i586-pc-interix${UNAME_RELEASE}
811818
exit ;;
812-
EM64T | authenticamd | genuineintel)
819+
authenticamd | genuineintel | EM64T)
813820
echo x86_64-unknown-interix${UNAME_RELEASE}
814821
exit ;;
815822
IA64)
@@ -819,6 +826,9 @@ EOF
819826
[345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
820827
echo i${UNAME_MACHINE}-pc-mks
821828
exit ;;
829+
8664:Windows_NT:*)
830+
echo x86_64-pc-mks
831+
exit ;;
822832
i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
823833
# How do we know it's Interix rather than the generic POSIX subsystem?
824834
# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
@@ -848,6 +858,20 @@ EOF
848858
i*86:Minix:*:*)
849859
echo ${UNAME_MACHINE}-pc-minix
850860
exit ;;
861+
alpha:Linux:*:*)
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 ;;
870+
esac
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}
874+
exit ;;
851875
arm*:Linux:*:*)
852876
eval $set_cc_for_build
853877
if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
@@ -870,6 +894,17 @@ EOF
870894
frv:Linux:*:*)
871895
echo frv-unknown-linux-gnu
872896
exit ;;
897+
i*86:Linux:*:*)
898+
LIBC=gnu
899+
eval $set_cc_for_build
900+
sed 's/^ //' << EOF >$dummy.c
901+
#ifdef __dietlibc__
902+
LIBC=dietlibc
903+
#endif
904+
EOF
905+
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
906+
echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
907+
exit ;;
873908
ia64:Linux:*:*)
874909
echo ${UNAME_MACHINE}-unknown-linux-gnu
875910
exit ;;
@@ -879,78 +914,34 @@ EOF
879914
m68*:Linux:*:*)
880915
echo ${UNAME_MACHINE}-unknown-linux-gnu
881916
exit ;;
882-
mips:Linux:*:*)
883-
eval $set_cc_for_build
884-
sed 's/^ //' << EOF >$dummy.c
885-
#undef CPU
886-
#undef mips
887-
#undef mipsel
888-
#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
889-
CPU=mipsel
890-
#else
891-
#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
892-
CPU=mips
893-
#else
894-
CPU=
895-
#endif
896-
#endif
897-
EOF
898-
eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
899-
/^CPU/{
900-
s: ::g
901-
p
902-
}'`"
903-
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
904-
;;
905-
mips64:Linux:*:*)
917+
mips:Linux:*:* | mips64:Linux:*:*)
906918
eval $set_cc_for_build
907919
sed 's/^ //' << EOF >$dummy.c
908920
#undef CPU
909-
#undef mips64
910-
#undef mips64el
921+
#undef ${UNAME_MACHINE}
922+
#undef ${UNAME_MACHINE}el
911923
#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
912-
CPU=mips64el
924+
CPU=${UNAME_MACHINE}el
913925
#else
914926
#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
915-
CPU=mips64
927+
CPU=${UNAME_MACHINE}
916928
#else
917929
CPU=
918930
#endif
919931
#endif
920932
EOF
921-
eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
922-
/^CPU/{
923-
s: ::g
924-
p
925-
}'`"
933+
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
926934
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
927935
;;
928936
or32:Linux:*:*)
929937
echo or32-unknown-linux-gnu
930938
exit ;;
931-
ppc:Linux:*:*)
932-
echo powerpc-unknown-linux-gnu
933-
exit ;;
934-
ppc64:Linux:*:*)
935-
echo powerpc64-unknown-linux-gnu
936-
exit ;;
937-
alpha:Linux:*:*)
938-
case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
939-
EV5) UNAME_MACHINE=alphaev5 ;;
940-
EV56) UNAME_MACHINE=alphaev56 ;;
941-
PCA56) UNAME_MACHINE=alphapca56 ;;
942-
PCA57) UNAME_MACHINE=alphapca56 ;;
943-
EV6) UNAME_MACHINE=alphaev6 ;;
944-
EV67) UNAME_MACHINE=alphaev67 ;;
945-
EV68*) UNAME_MACHINE=alphaev68 ;;
946-
esac
947-
objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
948-
if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
949-
echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
950-
exit ;;
951939
padre:Linux:*:*)
952940
echo sparc-unknown-linux-gnu
953941
exit ;;
942+
parisc64:Linux:*:* | hppa64:Linux:*:*)
943+
echo hppa64-unknown-linux-gnu
944+
exit ;;
954945
parisc:Linux:*:* | hppa:Linux:*:*)
955946
# Look for CPU level
956947
case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
@@ -959,8 +950,11 @@ EOF
959950
*) echo hppa-unknown-linux-gnu ;;
960951
esac
961952
exit ;;
962-
parisc64:Linux:*:* | hppa64:Linux:*:*)
963-
echo hppa64-unknown-linux-gnu
953+
ppc64:Linux:*:*)
954+
echo powerpc64-unknown-linux-gnu
955+
exit ;;
956+
ppc:Linux:*:*)
957+
echo powerpc-unknown-linux-gnu
964958
exit ;;
965959
s390:Linux:*:* | s390x:Linux:*:*)
966960
echo ${UNAME_MACHINE}-ibm-linux
@@ -983,66 +977,6 @@ EOF
983977
xtensa*:Linux:*:*)
984978
echo ${UNAME_MACHINE}-unknown-linux-gnu
985979
exit ;;
986-
i*86:Linux:*:*)
987-
# The BFD linker knows what the default object file format is, so
988-
# first see if it will tell us. cd to the root directory to prevent
989-
# problems with other programs or directories called `ld' in the path.
990-
# Set LC_ALL=C to ensure ld outputs messages in English.
991-
ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
992-
| sed -ne '/supported targets:/!d
993-
s/[ ][ ]*/ /g
994-
s/.*supported targets: *//
995-
s/ .*//
996-
p'`
997-
case "$ld_supported_targets" in
998-
elf32-i386)
999-
TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
1000-
;;
1001-
a.out-i386-linux)
1002-
echo "${UNAME_MACHINE}-pc-linux-gnuaout"
1003-
exit ;;
1004-
"")
1005-
# Either a pre-BFD a.out linker (linux-gnuoldld) or
1006-
# one that does not give us useful --help.
1007-
echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
1008-
exit ;;
1009-
esac
1010-
# Determine whether the default compiler is a.out or elf
1011-
eval $set_cc_for_build
1012-
sed 's/^ //' << EOF >$dummy.c
1013-
#include <features.h>
1014-
#ifdef __ELF__
1015-
# ifdef __GLIBC__
1016-
# if __GLIBC__ >= 2
1017-
LIBC=gnu
1018-
# else
1019-
LIBC=gnulibc1
1020-
# endif
1021-
# else
1022-
LIBC=gnulibc1
1023-
# endif
1024-
#else
1025-
#if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
1026-
LIBC=gnu
1027-
#else
1028-
LIBC=gnuaout
1029-
#endif
1030-
#endif
1031-
#ifdef __dietlibc__
1032-
LIBC=dietlibc
1033-
#endif
1034-
EOF
1035-
eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
1036-
/^LIBC/{
1037-
s: ::g
1038-
p
1039-
}'`"
1040-
test x"${LIBC}" != x && {
1041-
echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
1042-
exit
1043-
}
1044-
test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
1045-
;;
1046980
i*86:DYNIX/ptx:4*:*)
1047981
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
1048982
# earlier versions are messed up and put the nodename in both
@@ -1071,7 +1005,7 @@ EOF
10711005
i*86:syllable:*:*)
10721006
echo ${UNAME_MACHINE}-pc-syllable
10731007
exit ;;
1074-
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]*:*)
10751009
echo i386-unknown-lynxos${UNAME_RELEASE}
10761010
exit ;;
10771011
i*86:*DOS:*:*)
@@ -1115,8 +1049,11 @@ EOF
11151049
pc:*:*:*)
11161050
# Left here for compatibility:
11171051
# uname -m prints for DJGPP always 'pc', but it prints nothing about
1118-
# the processor, so we play safe by assuming i386.
1119-
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
11201057
exit ;;
11211058
Intel:Mach:3*:*)
11221059
echo i386-pc-mach3
@@ -1176,7 +1113,7 @@ EOF
11761113
rs6000:LynxOS:2.*:*)
11771114
echo rs6000-unknown-lynxos${UNAME_RELEASE}
11781115
exit ;;
1179-
PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
1116+
PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
11801117
echo powerpc-unknown-lynxos${UNAME_RELEASE}
11811118
exit ;;
11821119
SM[BE]S:UNIX_SV:*:*)
@@ -1269,6 +1206,16 @@ EOF
12691206
*:Darwin:*:*)
12701207
UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
12711208
case $UNAME_PROCESSOR in
1209+
i386)
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
1215+
then
1216+
UNAME_PROCESSOR="x86_64"
1217+
fi
1218+
fi ;;
12721219
unknown) UNAME_PROCESSOR=powerpc ;;
12731220
esac
12741221
echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}

0 commit comments

Comments
 (0)