View | Details | Raw Unified | Return to bug 2409 | Differences between
and this patch

Collapse All | Expand All

(-)a/config.guess (-229 / +130 lines)
Lines 1-14 Link Here
1
#! /bin/sh
1
#! /bin/sh
2
# Attempt to guess a canonical system name.
2
# Attempt to guess a canonical system name.
3
#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
3
#   Copyright 1992-2015 Free Software Foundation, Inc.
4
#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
5
#   2011, 2012, 2013 Free Software Foundation, Inc.
6
4
7
timestamp='2012-12-23'
5
timestamp='2015-03-04'
8
6
9
# This file is free software; you can redistribute it and/or modify it
7
# This file is free software; you can redistribute it and/or modify it
10
# under the terms of the GNU General Public License as published by
8
# under the terms of the GNU General Public License as published by
11
# the Free Software Foundation; either version 2 of the License, or
9
# the Free Software Foundation; either version 3 of the License, or
12
# (at your option) any later version.
10
# (at your option) any later version.
13
#
11
#
14
# This program is distributed in the hope that it will be useful, but
12
# This program is distributed in the hope that it will be useful, but
Lines 22-40 timestamp='2012-12-23' Link Here
22
# As a special exception to the GNU General Public License, if you
20
# As a special exception to the GNU General Public License, if you
23
# distribute this file as part of a program that contains a
21
# distribute this file as part of a program that contains a
24
# configuration script generated by Autoconf, you may include it under
22
# configuration script generated by Autoconf, you may include it under
25
# the same distribution terms that you use for the rest of that program.
23
# the same distribution terms that you use for the rest of that
26
24
# program.  This Exception is an additional permission under section 7
27
25
# of the GNU General Public License, version 3 ("GPLv3").
28
# Originally written by Per Bothner.  Please send patches (context
29
# diff format) to <config-patches@gnu.org> and include a ChangeLog
30
# entry.
31
#
26
#
32
# This script attempts to guess a canonical system name similar to
27
# Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
33
# config.sub.  If it succeeds, it prints the system name on stdout, and
34
# exits with 0.  Otherwise, it exits with 1.
35
#
28
#
36
# You can get the latest version of this script from:
29
# You can get the latest version of this script from:
37
# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
30
# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
31
#
32
# Please send patches to <config-patches@gnu.org>.
33
38
34
39
me=`echo "$0" | sed -e 's,.*/,,'`
35
me=`echo "$0" | sed -e 's,.*/,,'`
40
36
Lines 54-62 version="\ Link Here
54
GNU config.guess ($timestamp)
50
GNU config.guess ($timestamp)
55
51
56
Originally written by Per Bothner.
52
Originally written by Per Bothner.
57
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
53
Copyright 1992-2015 Free Software Foundation, Inc.
58
2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011,
59
2012, 2013 Free Software Foundation, Inc.
60
54
61
This is free software; see the source for copying conditions.  There is NO
55
This is free software; see the source for copying conditions.  There is NO
62
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
56
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
Lines 138-143 UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown Link Here
138
UNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
132
UNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
139
UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
133
UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
140
134
135
case "${UNAME_SYSTEM}" in
136
Linux|GNU|GNU/*)
137
	# If the system lacks a compiler, then just pick glibc.
138
	# We could probably try harder.
139
	LIBC=gnu
140
141
	eval $set_cc_for_build
142
	cat <<-EOF > $dummy.c
143
	#include <features.h>
144
	#if defined(__UCLIBC__)
145
	LIBC=uclibc
146
	#elif defined(__dietlibc__)
147
	LIBC=dietlibc
148
	#else
149
	LIBC=gnu
150
	#endif
151
	EOF
152
	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`
153
	;;
154
esac
155
141
# Note: order is significant - the case branches are not exclusive.
156
# Note: order is significant - the case branches are not exclusive.
142
157
143
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
158
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
Lines 153-172 case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in Link Here
153
	# Note: NetBSD doesn't particularly care about the vendor
168
	# Note: NetBSD doesn't particularly care about the vendor
154
	# portion of the name.  We always set it to "unknown".
169
	# portion of the name.  We always set it to "unknown".
155
	sysctl="sysctl -n hw.machine_arch"
170
	sysctl="sysctl -n hw.machine_arch"
156
	UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
171
	UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \
157
	    /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
172
	    /sbin/$sysctl 2>/dev/null || \
173
	    /usr/sbin/$sysctl 2>/dev/null || \
174
	    echo unknown)`
158
	case "${UNAME_MACHINE_ARCH}" in
175
	case "${UNAME_MACHINE_ARCH}" in
159
	    armeb) machine=armeb-unknown ;;
176
	    armeb) machine=armeb-unknown ;;
160
	    arm*) machine=arm-unknown ;;
177
	    arm*) machine=arm-unknown ;;
161
	    sh3el) machine=shl-unknown ;;
178
	    sh3el) machine=shl-unknown ;;
162
	    sh3eb) machine=sh-unknown ;;
179
	    sh3eb) machine=sh-unknown ;;
163
	    sh5el) machine=sh5le-unknown ;;
180
	    sh5el) machine=sh5le-unknown ;;
181
	    earmv*)
182
		arch=`echo ${UNAME_MACHINE_ARCH} | sed -e 's,^e\(armv[0-9]\).*$,\1,'`
183
		endian=`echo ${UNAME_MACHINE_ARCH} | sed -ne 's,^.*\(eb\)$,\1,p'`
184
		machine=${arch}${endian}-unknown
185
		;;
164
	    *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
186
	    *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
165
	esac
187
	esac
166
	# The Operating System including object format, if it has switched
188
	# The Operating System including object format, if it has switched
167
	# to ELF recently, or will in the future.
189
	# to ELF recently, or will in the future.
168
	case "${UNAME_MACHINE_ARCH}" in
190
	case "${UNAME_MACHINE_ARCH}" in
169
	    arm*|i386|m68k|ns32k|sh3*|sparc|vax)
191
	    arm*|earm*|i386|m68k|ns32k|sh3*|sparc|vax)
170
		eval $set_cc_for_build
192
		eval $set_cc_for_build
171
		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
193
		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
172
			| grep -q __ELF__
194
			| grep -q __ELF__
Lines 182-187 case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in Link Here
182
		os=netbsd
204
		os=netbsd
183
		;;
205
		;;
184
	esac
206
	esac
207
	# Determine ABI tags.
208
	case "${UNAME_MACHINE_ARCH}" in
209
	    earm*)
210
		expr='s/^earmv[0-9]/-eabi/;s/eb$//'
211
		abi=`echo ${UNAME_MACHINE_ARCH} | sed -e "$expr"`
212
		;;
213
	esac
185
	# The OS release
214
	# The OS release
186
	# Debian GNU/NetBSD machines have a different userland, and
215
	# Debian GNU/NetBSD machines have a different userland, and
187
	# thus, need a distinct triplet. However, they do not need
216
	# thus, need a distinct triplet. However, they do not need
Lines 198-204 case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in Link Here
198
	# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
227
	# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
199
	# contains redundant information, the shorter form:
228
	# contains redundant information, the shorter form:
200
	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
229
	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
201
	echo "${machine}-${os}${release}"
230
	echo "${machine}-${os}${release}${abi}"
202
	exit ;;
231
	exit ;;
203
    *:Bitrig:*:*)
232
    *:Bitrig:*:*)
204
	UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
233
	UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
Lines 564-571 EOF Link Here
564
	else
593
	else
565
		IBM_ARCH=powerpc
594
		IBM_ARCH=powerpc
566
	fi
595
	fi
567
	if [ -x /usr/bin/oslevel ] ; then
596
	if [ -x /usr/bin/lslpp ] ; then
568
		IBM_REV=`/usr/bin/oslevel`
597
		IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc |
598
			   awk -F: '{ print $3 }' | sed s/[0-9]*$/0/`
569
	else
599
	else
570
		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
600
		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
571
	fi
601
	fi
Lines 811-817 EOF Link Here
811
    *:MINGW*:*)
841
    *:MINGW*:*)
812
	echo ${UNAME_MACHINE}-pc-mingw32
842
	echo ${UNAME_MACHINE}-pc-mingw32
813
	exit ;;
843
	exit ;;
814
    i*:MSYS*:*)
844
    *:MSYS*:*)
815
	echo ${UNAME_MACHINE}-pc-msys
845
	echo ${UNAME_MACHINE}-pc-msys
816
	exit ;;
846
	exit ;;
817
    i*:windows32*:*)
847
    i*:windows32*:*)
Lines 859-879 EOF Link Here
859
	exit ;;
889
	exit ;;
860
    *:GNU:*:*)
890
    *:GNU:*:*)
861
	# the GNU system
891
	# the GNU system
862
	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
892
	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
863
	exit ;;
893
	exit ;;
864
    *:GNU/*:*:*)
894
    *:GNU/*:*:*)
865
	# other systems with GNU libc and userland
895
	# other systems with GNU libc and userland
866
	echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
896
	echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
867
	exit ;;
897
	exit ;;
868
    i*86:Minix:*:*)
898
    i*86:Minix:*:*)
869
	echo ${UNAME_MACHINE}-pc-minix
899
	echo ${UNAME_MACHINE}-pc-minix
870
	exit ;;
900
	exit ;;
871
    aarch64:Linux:*:*)
901
    aarch64:Linux:*:*)
872
	echo ${UNAME_MACHINE}-unknown-linux-gnu
902
	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
873
	exit ;;
903
	exit ;;
874
    aarch64_be:Linux:*:*)
904
    aarch64_be:Linux:*:*)
875
	UNAME_MACHINE=aarch64_be
905
	UNAME_MACHINE=aarch64_be
876
	echo ${UNAME_MACHINE}-unknown-linux-gnu
906
	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
877
	exit ;;
907
	exit ;;
878
    alpha:Linux:*:*)
908
    alpha:Linux:*:*)
879
	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
909
	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
Lines 886-944 EOF Link Here
886
	  EV68*) UNAME_MACHINE=alphaev68 ;;
916
	  EV68*) UNAME_MACHINE=alphaev68 ;;
887
	esac
917
	esac
888
	objdump --private-headers /bin/sh | grep -q ld.so.1
918
	objdump --private-headers /bin/sh | grep -q ld.so.1
889
	if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
919
	if test "$?" = 0 ; then LIBC="gnulibc1" ; fi
890
	echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
920
	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
921
	exit ;;
922
    arc:Linux:*:* | arceb:Linux:*:*)
923
	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
891
	exit ;;
924
	exit ;;
892
    arm*:Linux:*:*)
925
    arm*:Linux:*:*)
893
	eval $set_cc_for_build
926
	eval $set_cc_for_build
894
	if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
927
	if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
895
	    | grep -q __ARM_EABI__
928
	    | grep -q __ARM_EABI__
896
	then
929
	then
897
	    echo ${UNAME_MACHINE}-unknown-linux-gnu
930
	    echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
898
	else
931
	else
899
	    if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
932
	    if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
900
		| grep -q __ARM_PCS_VFP
933
		| grep -q __ARM_PCS_VFP
901
	    then
934
	    then
902
		echo ${UNAME_MACHINE}-unknown-linux-gnueabi
935
		echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
903
	    else
936
	    else
904
		echo ${UNAME_MACHINE}-unknown-linux-gnueabihf
937
		echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf
905
	    fi
938
	    fi
906
	fi
939
	fi
907
	exit ;;
940
	exit ;;
908
    avr32*:Linux:*:*)
941
    avr32*:Linux:*:*)
909
	echo ${UNAME_MACHINE}-unknown-linux-gnu
942
	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
910
	exit ;;
943
	exit ;;
911
    cris:Linux:*:*)
944
    cris:Linux:*:*)
912
	echo ${UNAME_MACHINE}-axis-linux-gnu
945
	echo ${UNAME_MACHINE}-axis-linux-${LIBC}
913
	exit ;;
946
	exit ;;
914
    crisv32:Linux:*:*)
947
    crisv32:Linux:*:*)
915
	echo ${UNAME_MACHINE}-axis-linux-gnu
948
	echo ${UNAME_MACHINE}-axis-linux-${LIBC}
949
	exit ;;
950
    e2k:Linux:*:*)
951
	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
916
	exit ;;
952
	exit ;;
917
    frv:Linux:*:*)
953
    frv:Linux:*:*)
918
	echo ${UNAME_MACHINE}-unknown-linux-gnu
954
	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
919
	exit ;;
955
	exit ;;
920
    hexagon:Linux:*:*)
956
    hexagon:Linux:*:*)
921
	echo ${UNAME_MACHINE}-unknown-linux-gnu
957
	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
922
	exit ;;
958
	exit ;;
923
    i*86:Linux:*:*)
959
    i*86:Linux:*:*)
924
	LIBC=gnu
960
	echo ${UNAME_MACHINE}-pc-linux-${LIBC}
925
	eval $set_cc_for_build
926
	sed 's/^	//' << EOF >$dummy.c
927
	#ifdef __dietlibc__
928
	LIBC=dietlibc
929
	#endif
930
EOF
931
	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
932
	echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
933
	exit ;;
961
	exit ;;
934
    ia64:Linux:*:*)
962
    ia64:Linux:*:*)
935
	echo ${UNAME_MACHINE}-unknown-linux-gnu
963
	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
936
	exit ;;
964
	exit ;;
937
    m32r*:Linux:*:*)
965
    m32r*:Linux:*:*)
938
	echo ${UNAME_MACHINE}-unknown-linux-gnu
966
	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
939
	exit ;;
967
	exit ;;
940
    m68*:Linux:*:*)
968
    m68*:Linux:*:*)
941
	echo ${UNAME_MACHINE}-unknown-linux-gnu
969
	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
942
	exit ;;
970
	exit ;;
943
    mips:Linux:*:* | mips64:Linux:*:*)
971
    mips:Linux:*:* | mips64:Linux:*:*)
944
	eval $set_cc_for_build
972
	eval $set_cc_for_build
Lines 957-1010 EOF Link Here
957
	#endif
985
	#endif
958
EOF
986
EOF
959
	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
987
	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
960
	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
988
	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
961
	;;
989
	;;
962
    or32:Linux:*:*)
990
    openrisc*:Linux:*:*)
963
	echo ${UNAME_MACHINE}-unknown-linux-gnu
991
	echo or1k-unknown-linux-${LIBC}
992
	exit ;;
993
    or32:Linux:*:* | or1k*:Linux:*:*)
994
	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
964
	exit ;;
995
	exit ;;
965
    padre:Linux:*:*)
996
    padre:Linux:*:*)
966
	echo sparc-unknown-linux-gnu
997
	echo sparc-unknown-linux-${LIBC}
967
	exit ;;
998
	exit ;;
968
    parisc64:Linux:*:* | hppa64:Linux:*:*)
999
    parisc64:Linux:*:* | hppa64:Linux:*:*)
969
	echo hppa64-unknown-linux-gnu
1000
	echo hppa64-unknown-linux-${LIBC}
970
	exit ;;
1001
	exit ;;
971
    parisc:Linux:*:* | hppa:Linux:*:*)
1002
    parisc:Linux:*:* | hppa:Linux:*:*)
972
	# Look for CPU level
1003
	# Look for CPU level
973
	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
1004
	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
974
	  PA7*) echo hppa1.1-unknown-linux-gnu ;;
1005
	  PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
975
	  PA8*) echo hppa2.0-unknown-linux-gnu ;;
1006
	  PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
976
	  *)    echo hppa-unknown-linux-gnu ;;
1007
	  *)    echo hppa-unknown-linux-${LIBC} ;;
977
	esac
1008
	esac
978
	exit ;;
1009
	exit ;;
979
    ppc64:Linux:*:*)
1010
    ppc64:Linux:*:*)
980
	echo powerpc64-unknown-linux-gnu
1011
	echo powerpc64-unknown-linux-${LIBC}
981
	exit ;;
1012
	exit ;;
982
    ppc:Linux:*:*)
1013
    ppc:Linux:*:*)
983
	echo powerpc-unknown-linux-gnu
1014
	echo powerpc-unknown-linux-${LIBC}
1015
	exit ;;
1016
    ppc64le:Linux:*:*)
1017
	echo powerpc64le-unknown-linux-${LIBC}
1018
	exit ;;
1019
    ppcle:Linux:*:*)
1020
	echo powerpcle-unknown-linux-${LIBC}
984
	exit ;;
1021
	exit ;;
985
    s390:Linux:*:* | s390x:Linux:*:*)
1022
    s390:Linux:*:* | s390x:Linux:*:*)
986
	echo ${UNAME_MACHINE}-ibm-linux
1023
	echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
987
	exit ;;
1024
	exit ;;
988
    sh64*:Linux:*:*)
1025
    sh64*:Linux:*:*)
989
	echo ${UNAME_MACHINE}-unknown-linux-gnu
1026
	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
990
	exit ;;
1027
	exit ;;
991
    sh*:Linux:*:*)
1028
    sh*:Linux:*:*)
992
	echo ${UNAME_MACHINE}-unknown-linux-gnu
1029
	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
993
	exit ;;
1030
	exit ;;
994
    sparc:Linux:*:* | sparc64:Linux:*:*)
1031
    sparc:Linux:*:* | sparc64:Linux:*:*)
995
	echo ${UNAME_MACHINE}-unknown-linux-gnu
1032
	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
996
	exit ;;
1033
	exit ;;
997
    tile*:Linux:*:*)
1034
    tile*:Linux:*:*)
998
	echo ${UNAME_MACHINE}-unknown-linux-gnu
1035
	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
999
	exit ;;
1036
	exit ;;
1000
    vax:Linux:*:*)
1037
    vax:Linux:*:*)
1001
	echo ${UNAME_MACHINE}-dec-linux-gnu
1038
	echo ${UNAME_MACHINE}-dec-linux-${LIBC}
1002
	exit ;;
1039
	exit ;;
1003
    x86_64:Linux:*:*)
1040
    x86_64:Linux:*:*)
1004
	echo ${UNAME_MACHINE}-unknown-linux-gnu
1041
	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
1005
	exit ;;
1042
	exit ;;
1006
    xtensa*:Linux:*:*)
1043
    xtensa*:Linux:*:*)
1007
	echo ${UNAME_MACHINE}-unknown-linux-gnu
1044
	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
1008
	exit ;;
1045
	exit ;;
1009
    i*86:DYNIX/ptx:4*:*)
1046
    i*86:DYNIX/ptx:4*:*)
1010
	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
1047
	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
Lines 1237-1255 EOF Link Here
1237
	exit ;;
1274
	exit ;;
1238
    *:Darwin:*:*)
1275
    *:Darwin:*:*)
1239
	UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
1276
	UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
1240
	case $UNAME_PROCESSOR in
1277
	eval $set_cc_for_build
1241
	    i386)
1278
	if test "$UNAME_PROCESSOR" = unknown ; then
1242
		eval $set_cc_for_build
1279
	    UNAME_PROCESSOR=powerpc
1243
		if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
1280
	fi
1244
		  if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
1281
	if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then
1245
		      (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
1282
	    if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
1246
		      grep IS_64BIT_ARCH >/dev/null
1283
		if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
1247
		  then
1284
		    (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
1248
		      UNAME_PROCESSOR="x86_64"
1285
		    grep IS_64BIT_ARCH >/dev/null
1249
		  fi
1286
		then
1250
		fi ;;
1287
		    case $UNAME_PROCESSOR in
1251
	    unknown) UNAME_PROCESSOR=powerpc ;;
1288
			i386) UNAME_PROCESSOR=x86_64 ;;
1252
	esac
1289
			powerpc) UNAME_PROCESSOR=powerpc64 ;;
1290
		    esac
1291
		fi
1292
	    fi
1293
	elif test "$UNAME_PROCESSOR" = i386 ; then
1294
	    # Avoid executing cc on OS X 10.9, as it ships with a stub
1295
	    # that puts up a graphical alert prompting to install
1296
	    # developer tools.  Any system running Mac OS X 10.7 or
1297
	    # later (Darwin 11 and later) is required to have a 64-bit
1298
	    # processor. This is not true of the ARM version of Darwin
1299
	    # that Apple uses in portable devices.
1300
	    UNAME_PROCESSOR=x86_64
1301
	fi
1253
	echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
1302
	echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
1254
	exit ;;
1303
	exit ;;
1255
    *:procnto*:*:* | *:QNX:[0123456789]*:*)
1304
    *:procnto*:*:* | *:QNX:[0123456789]*:*)
Lines 1340-1493 EOF Link Here
1340
	exit ;;
1389
	exit ;;
1341
esac
1390
esac
1342
1391
1343
eval $set_cc_for_build
1344
cat >$dummy.c <<EOF
1345
#ifdef _SEQUENT_
1346
# include <sys/types.h>
1347
# include <sys/utsname.h>
1348
#endif
1349
main ()
1350
{
1351
#if defined (sony)
1352
#if defined (MIPSEB)
1353
  /* BFD wants "bsd" instead of "newsos".  Perhaps BFD should be changed,
1354
     I don't know....  */
1355
  printf ("mips-sony-bsd\n"); exit (0);
1356
#else
1357
#include <sys/param.h>
1358
  printf ("m68k-sony-newsos%s\n",
1359
#ifdef NEWSOS4
1360
	"4"
1361
#else
1362
	""
1363
#endif
1364
	); exit (0);
1365
#endif
1366
#endif
1367
1368
#if defined (__arm) && defined (__acorn) && defined (__unix)
1369
  printf ("arm-acorn-riscix\n"); exit (0);
1370
#endif
1371
1372
#if defined (hp300) && !defined (hpux)
1373
  printf ("m68k-hp-bsd\n"); exit (0);
1374
#endif
1375
1376
#if defined (NeXT)
1377
#if !defined (__ARCHITECTURE__)
1378
#define __ARCHITECTURE__ "m68k"
1379
#endif
1380
  int version;
1381
  version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
1382
  if (version < 4)
1383
    printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
1384
  else
1385
    printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
1386
  exit (0);
1387
#endif
1388
1389
#if defined (MULTIMAX) || defined (n16)
1390
#if defined (UMAXV)
1391
  printf ("ns32k-encore-sysv\n"); exit (0);
1392
#else
1393
#if defined (CMU)
1394
  printf ("ns32k-encore-mach\n"); exit (0);
1395
#else
1396
  printf ("ns32k-encore-bsd\n"); exit (0);
1397
#endif
1398
#endif
1399
#endif
1400
1401
#if defined (__386BSD__)
1402
  printf ("i386-pc-bsd\n"); exit (0);
1403
#endif
1404
1405
#if defined (sequent)
1406
#if defined (i386)
1407
  printf ("i386-sequent-dynix\n"); exit (0);
1408
#endif
1409
#if defined (ns32000)
1410
  printf ("ns32k-sequent-dynix\n"); exit (0);
1411
#endif
1412
#endif
1413
1414
#if defined (_SEQUENT_)
1415
    struct utsname un;
1416
1417
    uname(&un);
1418
1419
    if (strncmp(un.version, "V2", 2) == 0) {
1420
	printf ("i386-sequent-ptx2\n"); exit (0);
1421
    }
1422
    if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
1423
	printf ("i386-sequent-ptx1\n"); exit (0);
1424
    }
1425
    printf ("i386-sequent-ptx\n"); exit (0);
1426
1427
#endif
1428
1429
#if defined (vax)
1430
# if !defined (ultrix)
1431
#  include <sys/param.h>
1432
#  if defined (BSD)
1433
#   if BSD == 43
1434
      printf ("vax-dec-bsd4.3\n"); exit (0);
1435
#   else
1436
#    if BSD == 199006
1437
      printf ("vax-dec-bsd4.3reno\n"); exit (0);
1438
#    else
1439
      printf ("vax-dec-bsd\n"); exit (0);
1440
#    endif
1441
#   endif
1442
#  else
1443
    printf ("vax-dec-bsd\n"); exit (0);
1444
#  endif
1445
# else
1446
    printf ("vax-dec-ultrix\n"); exit (0);
1447
# endif
1448
#endif
1449
1450
#if defined (alliant) && defined (i860)
1451
  printf ("i860-alliant-bsd\n"); exit (0);
1452
#endif
1453
1454
  exit (1);
1455
}
1456
EOF
1457
1458
$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
1459
	{ echo "$SYSTEM_NAME"; exit; }
1460
1461
# Apollos put the system type in the environment.
1462
1463
test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
1464
1465
# Convex versions that predate uname can use getsysinfo(1)
1466
1467
if [ -x /usr/convex/getsysinfo ]
1468
then
1469
    case `getsysinfo -f cpu_type` in
1470
    c1*)
1471
	echo c1-convex-bsd
1472
	exit ;;
1473
    c2*)
1474
	if getsysinfo -f scalar_acc
1475
	then echo c32-convex-bsd
1476
	else echo c2-convex-bsd
1477
	fi
1478
	exit ;;
1479
    c34*)
1480
	echo c34-convex-bsd
1481
	exit ;;
1482
    c38*)
1483
	echo c38-convex-bsd
1484
	exit ;;
1485
    c4*)
1486
	echo c4-convex-bsd
1487
	exit ;;
1488
    esac
1489
fi
1490
1491
cat >&2 <<EOF
1392
cat >&2 <<EOF
1492
$0: unable to guess system type
1393
$0: unable to guess system type
1493
1394

Return to bug 2409