aboutsummaryrefslogtreecommitdiffstats
path: root/mps/tool/autoconf/build-aux/config.guess
diff options
context:
space:
mode:
Diffstat (limited to 'mps/tool/autoconf/build-aux/config.guess')
-rw-r--r--mps/tool/autoconf/build-aux/config.guess1775
1 files changed, 1026 insertions, 749 deletions
diff --git a/mps/tool/autoconf/build-aux/config.guess b/mps/tool/autoconf/build-aux/config.guess
index c0adba94b2f..cdfc4392047 100644
--- a/mps/tool/autoconf/build-aux/config.guess
+++ b/mps/tool/autoconf/build-aux/config.guess
@@ -1,14 +1,14 @@
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-2023 Free Software Foundation, Inc.
4# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
5# 2011, 2012 Free Software Foundation, Inc.
6 4
7timestamp='2012-06-10' 5# shellcheck disable=SC2006,SC2268 # see below for rationale
6
7timestamp='2023-08-22'
8 8
9# This file is free software; you can redistribute it and/or modify it 9# 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 10# under the terms of the GNU General Public License as published by
11# the Free Software Foundation; either version 2 of the License, or 11# the Free Software Foundation, either version 3 of the License, or
12# (at your option) any later version. 12# (at your option) any later version.
13# 13#
14# This program is distributed in the hope that it will be useful, but 14# This program is distributed in the hope that it will be useful, but
@@ -17,33 +17,39 @@ timestamp='2012-06-10'
17# General Public License for more details. 17# General Public License for more details.
18# 18#
19# You should have received a copy of the GNU General Public License 19# You should have received a copy of the GNU General Public License
20# along with this program; if not, see <http://www.gnu.org/licenses/>. 20# along with this program; if not, see <https://www.gnu.org/licenses/>.
21# 21#
22# As a special exception to the GNU General Public License, if you 22# As a special exception to the GNU General Public License, if you
23# distribute this file as part of a program that contains a 23# distribute this file as part of a program that contains a
24# configuration script generated by Autoconf, you may include it under 24# configuration script generated by Autoconf, you may include it under
25# the same distribution terms that you use for the rest of that program. 25# the same distribution terms that you use for the rest of that
26 26# program. This Exception is an additional permission under section 7
27 27# 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# 28#
32# This script attempts to guess a canonical system name similar to 29# 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# 30#
36# You can get the latest version of this script from: 31# 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 32# https://git.savannah.gnu.org/cgit/config.git/plain/config.guess
33#
34# Please send patches to <config-patches@gnu.org>.
35
36
37# The "shellcheck disable" line above the timestamp inhibits complaints
38# about features and limitations of the classic Bourne shell that were
39# superseded or lifted in POSIX. However, this script identifies a wide
40# variety of pre-POSIX systems that do not have POSIX shells at all, and
41# even some reasonably current systems (Solaris 10 as case-in-point) still
42# have a pre-POSIX /bin/sh.
43
38 44
39me=`echo "$0" | sed -e 's,.*/,,'` 45me=`echo "$0" | sed -e 's,.*/,,'`
40 46
41usage="\ 47usage="\
42Usage: $0 [OPTION] 48Usage: $0 [OPTION]
43 49
44Output the configuration name of the system \`$me' is run on. 50Output the configuration name of the system '$me' is run on.
45 51
46Operation modes: 52Options:
47 -h, --help print this help, then exit 53 -h, --help print this help, then exit
48 -t, --time-stamp print date of last modification, then exit 54 -t, --time-stamp print date of last modification, then exit
49 -v, --version print version number, then exit 55 -v, --version print version number, then exit
@@ -54,15 +60,13 @@ version="\
54GNU config.guess ($timestamp) 60GNU config.guess ($timestamp)
55 61
56Originally written by Per Bothner. 62Originally written by Per Bothner.
57Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 63Copyright 1992-2023 Free Software Foundation, Inc.
582001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
59Free Software Foundation, Inc.
60 64
61This is free software; see the source for copying conditions. There is NO 65This is free software; see the source for copying conditions. There is NO
62warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." 66warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
63 67
64help=" 68help="
65Try \`$me --help' for more information." 69Try '$me --help' for more information."
66 70
67# Parse command line 71# Parse command line
68while test $# -gt 0 ; do 72while test $# -gt 0 ; do
@@ -90,57 +94,107 @@ if test $# != 0; then
90 exit 1 94 exit 1
91fi 95fi
92 96
93trap 'exit 1' 1 2 15 97# Just in case it came from the environment.
98GUESS=
94 99
95# CC_FOR_BUILD -- compiler used by this script. Note that the use of a 100# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
96# compiler to aid in system detection is discouraged as it requires 101# compiler to aid in system detection is discouraged as it requires
97# temporary files to be created and, as you can see below, it is a 102# temporary files to be created and, as you can see below, it is a
98# headache to deal with in a portable fashion. 103# headache to deal with in a portable fashion.
99 104
100# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still 105# Historically, 'CC_FOR_BUILD' used to be named 'HOST_CC'. We still
101# use `HOST_CC' if defined, but it is deprecated. 106# use 'HOST_CC' if defined, but it is deprecated.
102 107
103# Portable tmp directory creation inspired by the Autoconf team. 108# Portable tmp directory creation inspired by the Autoconf team.
104 109
105set_cc_for_build=' 110tmp=
106trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; 111# shellcheck disable=SC2172
107trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; 112trap 'test -z "$tmp" || rm -fr "$tmp"' 0 1 2 13 15
108: ${TMPDIR=/tmp} ; 113
109 { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || 114set_cc_for_build() {
110 { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || 115 # prevent multiple calls if $tmp is already set
111 { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || 116 test "$tmp" && return 0
112 { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; 117 : "${TMPDIR=/tmp}"
113dummy=$tmp/dummy ; 118 # shellcheck disable=SC2039,SC3028
114tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; 119 { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
115case $CC_FOR_BUILD,$HOST_CC,$CC in 120 { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } ||
116 ,,) echo "int x;" > $dummy.c ; 121 { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } ||
117 for c in cc gcc c89 c99 ; do 122 { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; }
118 if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then 123 dummy=$tmp/dummy
119 CC_FOR_BUILD="$c"; break ; 124 case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in
120 fi ; 125 ,,) echo "int x;" > "$dummy.c"
121 done ; 126 for driver in cc gcc c89 c99 ; do
122 if test x"$CC_FOR_BUILD" = x ; then 127 if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then
123 CC_FOR_BUILD=no_compiler_found ; 128 CC_FOR_BUILD=$driver
124 fi 129 break
125 ;; 130 fi
126 ,,*) CC_FOR_BUILD=$CC ;; 131 done
127 ,*,*) CC_FOR_BUILD=$HOST_CC ;; 132 if test x"$CC_FOR_BUILD" = x ; then
128esac ; set_cc_for_build= ;' 133 CC_FOR_BUILD=no_compiler_found
134 fi
135 ;;
136 ,,*) CC_FOR_BUILD=$CC ;;
137 ,*,*) CC_FOR_BUILD=$HOST_CC ;;
138 esac
139}
129 140
130# This is needed to find uname on a Pyramid OSx when run in the BSD universe. 141# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
131# (ghazi@noc.rutgers.edu 1994-08-24) 142# (ghazi@noc.rutgers.edu 1994-08-24)
132if (test -f /.attbin/uname) >/dev/null 2>&1 ; then 143if test -f /.attbin/uname ; then
133 PATH=$PATH:/.attbin ; export PATH 144 PATH=$PATH:/.attbin ; export PATH
134fi 145fi
135 146
136UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown 147UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
137UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown 148UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
138UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown 149UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
139UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown 150UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
140 151
152case $UNAME_SYSTEM in
153Linux|GNU|GNU/*)
154 LIBC=unknown
155
156 set_cc_for_build
157 cat <<-EOF > "$dummy.c"
158 #if defined(__ANDROID__)
159 LIBC=android
160 #else
161 #include <features.h>
162 #if defined(__UCLIBC__)
163 LIBC=uclibc
164 #elif defined(__dietlibc__)
165 LIBC=dietlibc
166 #elif defined(__GLIBC__)
167 LIBC=gnu
168 #else
169 #include <stdarg.h>
170 /* First heuristic to detect musl libc. */
171 #ifdef __DEFINED_va_list
172 LIBC=musl
173 #endif
174 #endif
175 #endif
176 EOF
177 cc_set_libc=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`
178 eval "$cc_set_libc"
179
180 # Second heuristic to detect musl libc.
181 if [ "$LIBC" = unknown ] &&
182 command -v ldd >/dev/null &&
183 ldd --version 2>&1 | grep -q ^musl; then
184 LIBC=musl
185 fi
186
187 # If the system lacks a compiler, then just pick glibc.
188 # We could probably try harder.
189 if [ "$LIBC" = unknown ]; then
190 LIBC=gnu
191 fi
192 ;;
193esac
194
141# Note: order is significant - the case branches are not exclusive. 195# Note: order is significant - the case branches are not exclusive.
142 196
143case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in 197case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in
144 *:NetBSD:*:*) 198 *:NetBSD:*:*)
145 # NetBSD (nbsd) targets should (where applicable) match one or 199 # NetBSD (nbsd) targets should (where applicable) match one or
146 # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, 200 # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
@@ -152,22 +206,32 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
152 # 206 #
153 # Note: NetBSD doesn't particularly care about the vendor 207 # Note: NetBSD doesn't particularly care about the vendor
154 # portion of the name. We always set it to "unknown". 208 # portion of the name. We always set it to "unknown".
155 sysctl="sysctl -n hw.machine_arch" 209 UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \
156 UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ 210 /sbin/sysctl -n hw.machine_arch 2>/dev/null || \
157 /usr/sbin/$sysctl 2>/dev/null || echo unknown)` 211 /usr/sbin/sysctl -n hw.machine_arch 2>/dev/null || \
158 case "${UNAME_MACHINE_ARCH}" in 212 echo unknown)`
213 case $UNAME_MACHINE_ARCH in
214 aarch64eb) machine=aarch64_be-unknown ;;
159 armeb) machine=armeb-unknown ;; 215 armeb) machine=armeb-unknown ;;
160 arm*) machine=arm-unknown ;; 216 arm*) machine=arm-unknown ;;
161 sh3el) machine=shl-unknown ;; 217 sh3el) machine=shl-unknown ;;
162 sh3eb) machine=sh-unknown ;; 218 sh3eb) machine=sh-unknown ;;
163 sh5el) machine=sh5le-unknown ;; 219 sh5el) machine=sh5le-unknown ;;
164 *) machine=${UNAME_MACHINE_ARCH}-unknown ;; 220 earmv*)
221 arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'`
222 endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'`
223 machine=${arch}${endian}-unknown
224 ;;
225 *) machine=$UNAME_MACHINE_ARCH-unknown ;;
165 esac 226 esac
166 # The Operating System including object format, if it has switched 227 # The Operating System including object format, if it has switched
167 # to ELF recently, or will in the future. 228 # to ELF recently (or will in the future) and ABI.
168 case "${UNAME_MACHINE_ARCH}" in 229 case $UNAME_MACHINE_ARCH in
230 earm*)
231 os=netbsdelf
232 ;;
169 arm*|i386|m68k|ns32k|sh3*|sparc|vax) 233 arm*|i386|m68k|ns32k|sh3*|sparc|vax)
170 eval $set_cc_for_build 234 set_cc_for_build
171 if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ 235 if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
172 | grep -q __ELF__ 236 | grep -q __ELF__
173 then 237 then
@@ -182,41 +246,80 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
182 os=netbsd 246 os=netbsd
183 ;; 247 ;;
184 esac 248 esac
249 # Determine ABI tags.
250 case $UNAME_MACHINE_ARCH in
251 earm*)
252 expr='s/^earmv[0-9]/-eabi/;s/eb$//'
253 abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"`
254 ;;
255 esac
185 # The OS release 256 # The OS release
186 # Debian GNU/NetBSD machines have a different userland, and 257 # Debian GNU/NetBSD machines have a different userland, and
187 # thus, need a distinct triplet. However, they do not need 258 # thus, need a distinct triplet. However, they do not need
188 # kernel version information, so it can be replaced with a 259 # kernel version information, so it can be replaced with a
189 # suitable tag, in the style of linux-gnu. 260 # suitable tag, in the style of linux-gnu.
190 case "${UNAME_VERSION}" in 261 case $UNAME_VERSION in
191 Debian*) 262 Debian*)
192 release='-gnu' 263 release='-gnu'
193 ;; 264 ;;
194 *) 265 *)
195 release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` 266 release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2`
196 ;; 267 ;;
197 esac 268 esac
198 # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: 269 # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
199 # contains redundant information, the shorter form: 270 # contains redundant information, the shorter form:
200 # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. 271 # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
201 echo "${machine}-${os}${release}" 272 GUESS=$machine-${os}${release}${abi-}
202 exit ;; 273 ;;
274 *:Bitrig:*:*)
275 UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
276 GUESS=$UNAME_MACHINE_ARCH-unknown-bitrig$UNAME_RELEASE
277 ;;
203 *:OpenBSD:*:*) 278 *:OpenBSD:*:*)
204 UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` 279 UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
205 echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} 280 GUESS=$UNAME_MACHINE_ARCH-unknown-openbsd$UNAME_RELEASE
206 exit ;; 281 ;;
282 *:SecBSD:*:*)
283 UNAME_MACHINE_ARCH=`arch | sed 's/SecBSD.//'`
284 GUESS=$UNAME_MACHINE_ARCH-unknown-secbsd$UNAME_RELEASE
285 ;;
286 *:LibertyBSD:*:*)
287 UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'`
288 GUESS=$UNAME_MACHINE_ARCH-unknown-libertybsd$UNAME_RELEASE
289 ;;
290 *:MidnightBSD:*:*)
291 GUESS=$UNAME_MACHINE-unknown-midnightbsd$UNAME_RELEASE
292 ;;
207 *:ekkoBSD:*:*) 293 *:ekkoBSD:*:*)
208 echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} 294 GUESS=$UNAME_MACHINE-unknown-ekkobsd$UNAME_RELEASE
209 exit ;; 295 ;;
210 *:SolidBSD:*:*) 296 *:SolidBSD:*:*)
211 echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} 297 GUESS=$UNAME_MACHINE-unknown-solidbsd$UNAME_RELEASE
212 exit ;; 298 ;;
299 *:OS108:*:*)
300 GUESS=$UNAME_MACHINE-unknown-os108_$UNAME_RELEASE
301 ;;
213 macppc:MirBSD:*:*) 302 macppc:MirBSD:*:*)
214 echo powerpc-unknown-mirbsd${UNAME_RELEASE} 303 GUESS=powerpc-unknown-mirbsd$UNAME_RELEASE
215 exit ;; 304 ;;
216 *:MirBSD:*:*) 305 *:MirBSD:*:*)
217 echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} 306 GUESS=$UNAME_MACHINE-unknown-mirbsd$UNAME_RELEASE
218 exit ;; 307 ;;
308 *:Sortix:*:*)
309 GUESS=$UNAME_MACHINE-unknown-sortix
310 ;;
311 *:Twizzler:*:*)
312 GUESS=$UNAME_MACHINE-unknown-twizzler
313 ;;
314 *:Redox:*:*)
315 GUESS=$UNAME_MACHINE-unknown-redox
316 ;;
317 mips:OSF1:*.*)
318 GUESS=mips-dec-osf1
319 ;;
219 alpha:OSF1:*:*) 320 alpha:OSF1:*:*)
321 # Reset EXIT trap before exiting to avoid spurious non-zero exit code.
322 trap '' 0
220 case $UNAME_RELEASE in 323 case $UNAME_RELEASE in
221 *4.0) 324 *4.0)
222 UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` 325 UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
@@ -230,163 +333,158 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
230 # covers most systems running today. This code pipes the CPU 333 # covers most systems running today. This code pipes the CPU
231 # types through head -n 1, so we only detect the type of CPU 0. 334 # types through head -n 1, so we only detect the type of CPU 0.
232 ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` 335 ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
233 case "$ALPHA_CPU_TYPE" in 336 case $ALPHA_CPU_TYPE in
234 "EV4 (21064)") 337 "EV4 (21064)")
235 UNAME_MACHINE="alpha" ;; 338 UNAME_MACHINE=alpha ;;
236 "EV4.5 (21064)") 339 "EV4.5 (21064)")
237 UNAME_MACHINE="alpha" ;; 340 UNAME_MACHINE=alpha ;;
238 "LCA4 (21066/21068)") 341 "LCA4 (21066/21068)")
239 UNAME_MACHINE="alpha" ;; 342 UNAME_MACHINE=alpha ;;
240 "EV5 (21164)") 343 "EV5 (21164)")
241 UNAME_MACHINE="alphaev5" ;; 344 UNAME_MACHINE=alphaev5 ;;
242 "EV5.6 (21164A)") 345 "EV5.6 (21164A)")
243 UNAME_MACHINE="alphaev56" ;; 346 UNAME_MACHINE=alphaev56 ;;
244 "EV5.6 (21164PC)") 347 "EV5.6 (21164PC)")
245 UNAME_MACHINE="alphapca56" ;; 348 UNAME_MACHINE=alphapca56 ;;
246 "EV5.7 (21164PC)") 349 "EV5.7 (21164PC)")
247 UNAME_MACHINE="alphapca57" ;; 350 UNAME_MACHINE=alphapca57 ;;
248 "EV6 (21264)") 351 "EV6 (21264)")
249 UNAME_MACHINE="alphaev6" ;; 352 UNAME_MACHINE=alphaev6 ;;
250 "EV6.7 (21264A)") 353 "EV6.7 (21264A)")
251 UNAME_MACHINE="alphaev67" ;; 354 UNAME_MACHINE=alphaev67 ;;
252 "EV6.8CB (21264C)") 355 "EV6.8CB (21264C)")
253 UNAME_MACHINE="alphaev68" ;; 356 UNAME_MACHINE=alphaev68 ;;
254 "EV6.8AL (21264B)") 357 "EV6.8AL (21264B)")
255 UNAME_MACHINE="alphaev68" ;; 358 UNAME_MACHINE=alphaev68 ;;
256 "EV6.8CX (21264D)") 359 "EV6.8CX (21264D)")
257 UNAME_MACHINE="alphaev68" ;; 360 UNAME_MACHINE=alphaev68 ;;
258 "EV6.9A (21264/EV69A)") 361 "EV6.9A (21264/EV69A)")
259 UNAME_MACHINE="alphaev69" ;; 362 UNAME_MACHINE=alphaev69 ;;
260 "EV7 (21364)") 363 "EV7 (21364)")
261 UNAME_MACHINE="alphaev7" ;; 364 UNAME_MACHINE=alphaev7 ;;
262 "EV7.9 (21364A)") 365 "EV7.9 (21364A)")
263 UNAME_MACHINE="alphaev79" ;; 366 UNAME_MACHINE=alphaev79 ;;
264 esac 367 esac
265 # A Pn.n version is a patched version. 368 # A Pn.n version is a patched version.
266 # A Vn.n version is a released version. 369 # A Vn.n version is a released version.
267 # A Tn.n version is a released field test version. 370 # A Tn.n version is a released field test version.
268 # A Xn.n version is an unreleased experimental baselevel. 371 # A Xn.n version is an unreleased experimental baselevel.
269 # 1.2 uses "1.2" for uname -r. 372 # 1.2 uses "1.2" for uname -r.
270 echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` 373 OSF_REL=`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
271 # Reset EXIT trap before exiting to avoid spurious non-zero exit code. 374 GUESS=$UNAME_MACHINE-dec-osf$OSF_REL
272 exitcode=$? 375 ;;
273 trap '' 0
274 exit $exitcode ;;
275 Alpha\ *:Windows_NT*:*)
276 # How do we know it's Interix rather than the generic POSIX subsystem?
277 # Should we change UNAME_MACHINE based on the output of uname instead
278 # of the specific Alpha model?
279 echo alpha-pc-interix
280 exit ;;
281 21064:Windows_NT:50:3)
282 echo alpha-dec-winnt3.5
283 exit ;;
284 Amiga*:UNIX_System_V:4.0:*) 376 Amiga*:UNIX_System_V:4.0:*)
285 echo m68k-unknown-sysv4 377 GUESS=m68k-unknown-sysv4
286 exit ;; 378 ;;
287 *:[Aa]miga[Oo][Ss]:*:*) 379 *:[Aa]miga[Oo][Ss]:*:*)
288 echo ${UNAME_MACHINE}-unknown-amigaos 380 GUESS=$UNAME_MACHINE-unknown-amigaos
289 exit ;; 381 ;;
290 *:[Mm]orph[Oo][Ss]:*:*) 382 *:[Mm]orph[Oo][Ss]:*:*)
291 echo ${UNAME_MACHINE}-unknown-morphos 383 GUESS=$UNAME_MACHINE-unknown-morphos
292 exit ;; 384 ;;
293 *:OS/390:*:*) 385 *:OS/390:*:*)
294 echo i370-ibm-openedition 386 GUESS=i370-ibm-openedition
295 exit ;; 387 ;;
296 *:z/VM:*:*) 388 *:z/VM:*:*)
297 echo s390-ibm-zvmoe 389 GUESS=s390-ibm-zvmoe
298 exit ;; 390 ;;
299 *:OS400:*:*) 391 *:OS400:*:*)
300 echo powerpc-ibm-os400 392 GUESS=powerpc-ibm-os400
301 exit ;; 393 ;;
302 arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) 394 arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
303 echo arm-acorn-riscix${UNAME_RELEASE} 395 GUESS=arm-acorn-riscix$UNAME_RELEASE
304 exit ;; 396 ;;
305 arm:riscos:*:*|arm:RISCOS:*:*) 397 arm*:riscos:*:*|arm*:RISCOS:*:*)
306 echo arm-unknown-riscos 398 GUESS=arm-unknown-riscos
307 exit ;; 399 ;;
308 SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) 400 SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
309 echo hppa1.1-hitachi-hiuxmpp 401 GUESS=hppa1.1-hitachi-hiuxmpp
310 exit ;; 402 ;;
311 Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) 403 Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
312 # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. 404 # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
313 if test "`(/bin/universe) 2>/dev/null`" = att ; then 405 case `(/bin/universe) 2>/dev/null` in
314 echo pyramid-pyramid-sysv3 406 att) GUESS=pyramid-pyramid-sysv3 ;;
315 else 407 *) GUESS=pyramid-pyramid-bsd ;;
316 echo pyramid-pyramid-bsd 408 esac
317 fi 409 ;;
318 exit ;;
319 NILE*:*:*:dcosx) 410 NILE*:*:*:dcosx)
320 echo pyramid-pyramid-svr4 411 GUESS=pyramid-pyramid-svr4
321 exit ;; 412 ;;
322 DRS?6000:unix:4.0:6*) 413 DRS?6000:unix:4.0:6*)
323 echo sparc-icl-nx6 414 GUESS=sparc-icl-nx6
324 exit ;; 415 ;;
325 DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) 416 DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
326 case `/usr/bin/uname -p` in 417 case `/usr/bin/uname -p` in
327 sparc) echo sparc-icl-nx7; exit ;; 418 sparc) GUESS=sparc-icl-nx7 ;;
328 esac ;; 419 esac
420 ;;
329 s390x:SunOS:*:*) 421 s390x:SunOS:*:*)
330 echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` 422 SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
331 exit ;; 423 GUESS=$UNAME_MACHINE-ibm-solaris2$SUN_REL
424 ;;
332 sun4H:SunOS:5.*:*) 425 sun4H:SunOS:5.*:*)
333 echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` 426 SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
334 exit ;; 427 GUESS=sparc-hal-solaris2$SUN_REL
428 ;;
335 sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) 429 sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
336 echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` 430 SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
337 exit ;; 431 GUESS=sparc-sun-solaris2$SUN_REL
432 ;;
338 i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) 433 i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
339 echo i386-pc-auroraux${UNAME_RELEASE} 434 GUESS=i386-pc-auroraux$UNAME_RELEASE
340 exit ;; 435 ;;
341 i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) 436 i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
342 eval $set_cc_for_build 437 set_cc_for_build
343 SUN_ARCH="i386" 438 SUN_ARCH=i386
344 # If there is a compiler, see if it is configured for 64-bit objects. 439 # If there is a compiler, see if it is configured for 64-bit objects.
345 # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. 440 # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
346 # This test works for both compilers. 441 # This test works for both compilers.
347 if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then 442 if test "$CC_FOR_BUILD" != no_compiler_found; then
348 if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ 443 if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
349 (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ 444 (CCOPTS="" $CC_FOR_BUILD -m64 -E - 2>/dev/null) | \
350 grep IS_64BIT_ARCH >/dev/null 445 grep IS_64BIT_ARCH >/dev/null
351 then 446 then
352 SUN_ARCH="x86_64" 447 SUN_ARCH=x86_64
353 fi 448 fi
354 fi 449 fi
355 echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` 450 SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
356 exit ;; 451 GUESS=$SUN_ARCH-pc-solaris2$SUN_REL
452 ;;
357 sun4*:SunOS:6*:*) 453 sun4*:SunOS:6*:*)
358 # According to config.sub, this is the proper way to canonicalize 454 # According to config.sub, this is the proper way to canonicalize
359 # SunOS6. Hard to guess exactly what SunOS6 will be like, but 455 # SunOS6. Hard to guess exactly what SunOS6 will be like, but
360 # it's likely to be more like Solaris than SunOS4. 456 # it's likely to be more like Solaris than SunOS4.
361 echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` 457 SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
362 exit ;; 458 GUESS=sparc-sun-solaris3$SUN_REL
459 ;;
363 sun4*:SunOS:*:*) 460 sun4*:SunOS:*:*)
364 case "`/usr/bin/arch -k`" in 461 case `/usr/bin/arch -k` in
365 Series*|S4*) 462 Series*|S4*)
366 UNAME_RELEASE=`uname -v` 463 UNAME_RELEASE=`uname -v`
367 ;; 464 ;;
368 esac 465 esac
369 # Japanese Language versions have a version number like `4.1.3-JL'. 466 # Japanese Language versions have a version number like '4.1.3-JL'.
370 echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` 467 SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/'`
371 exit ;; 468 GUESS=sparc-sun-sunos$SUN_REL
469 ;;
372 sun3*:SunOS:*:*) 470 sun3*:SunOS:*:*)
373 echo m68k-sun-sunos${UNAME_RELEASE} 471 GUESS=m68k-sun-sunos$UNAME_RELEASE
374 exit ;; 472 ;;
375 sun*:*:4.2BSD:*) 473 sun*:*:4.2BSD:*)
376 UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` 474 UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
377 test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 475 test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3
378 case "`/bin/arch`" in 476 case `/bin/arch` in
379 sun3) 477 sun3)
380 echo m68k-sun-sunos${UNAME_RELEASE} 478 GUESS=m68k-sun-sunos$UNAME_RELEASE
381 ;; 479 ;;
382 sun4) 480 sun4)
383 echo sparc-sun-sunos${UNAME_RELEASE} 481 GUESS=sparc-sun-sunos$UNAME_RELEASE
384 ;; 482 ;;
385 esac 483 esac
386 exit ;; 484 ;;
387 aushp:SunOS:*:*) 485 aushp:SunOS:*:*)
388 echo sparc-auspex-sunos${UNAME_RELEASE} 486 GUESS=sparc-auspex-sunos$UNAME_RELEASE
389 exit ;; 487 ;;
390 # The situation for MiNT is a little confusing. The machine name 488 # The situation for MiNT is a little confusing. The machine name
391 # can be virtually everything (everything which is not 489 # can be virtually everything (everything which is not
392 # "atarist" or "atariste" at least should have a processor 490 # "atarist" or "atariste" at least should have a processor
@@ -396,44 +494,44 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
396 # MiNT. But MiNT is downward compatible to TOS, so this should 494 # MiNT. But MiNT is downward compatible to TOS, so this should
397 # be no problem. 495 # be no problem.
398 atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) 496 atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
399 echo m68k-atari-mint${UNAME_RELEASE} 497 GUESS=m68k-atari-mint$UNAME_RELEASE
400 exit ;; 498 ;;
401 atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) 499 atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
402 echo m68k-atari-mint${UNAME_RELEASE} 500 GUESS=m68k-atari-mint$UNAME_RELEASE
403 exit ;; 501 ;;
404 *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) 502 *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
405 echo m68k-atari-mint${UNAME_RELEASE} 503 GUESS=m68k-atari-mint$UNAME_RELEASE
406 exit ;; 504 ;;
407 milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) 505 milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
408 echo m68k-milan-mint${UNAME_RELEASE} 506 GUESS=m68k-milan-mint$UNAME_RELEASE
409 exit ;; 507 ;;
410 hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) 508 hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
411 echo m68k-hades-mint${UNAME_RELEASE} 509 GUESS=m68k-hades-mint$UNAME_RELEASE
412 exit ;; 510 ;;
413 *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) 511 *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
414 echo m68k-unknown-mint${UNAME_RELEASE} 512 GUESS=m68k-unknown-mint$UNAME_RELEASE
415 exit ;; 513 ;;
416 m68k:machten:*:*) 514 m68k:machten:*:*)
417 echo m68k-apple-machten${UNAME_RELEASE} 515 GUESS=m68k-apple-machten$UNAME_RELEASE
418 exit ;; 516 ;;
419 powerpc:machten:*:*) 517 powerpc:machten:*:*)
420 echo powerpc-apple-machten${UNAME_RELEASE} 518 GUESS=powerpc-apple-machten$UNAME_RELEASE
421 exit ;; 519 ;;
422 RISC*:Mach:*:*) 520 RISC*:Mach:*:*)
423 echo mips-dec-mach_bsd4.3 521 GUESS=mips-dec-mach_bsd4.3
424 exit ;; 522 ;;
425 RISC*:ULTRIX:*:*) 523 RISC*:ULTRIX:*:*)
426 echo mips-dec-ultrix${UNAME_RELEASE} 524 GUESS=mips-dec-ultrix$UNAME_RELEASE
427 exit ;; 525 ;;
428 VAX*:ULTRIX*:*:*) 526 VAX*:ULTRIX*:*:*)
429 echo vax-dec-ultrix${UNAME_RELEASE} 527 GUESS=vax-dec-ultrix$UNAME_RELEASE
430 exit ;; 528 ;;
431 2020:CLIX:*:* | 2430:CLIX:*:*) 529 2020:CLIX:*:* | 2430:CLIX:*:*)
432 echo clipper-intergraph-clix${UNAME_RELEASE} 530 GUESS=clipper-intergraph-clix$UNAME_RELEASE
433 exit ;; 531 ;;
434 mips:*:*:UMIPS | mips:*:*:RISCos) 532 mips:*:*:UMIPS | mips:*:*:RISCos)
435 eval $set_cc_for_build 533 set_cc_for_build
436 sed 's/^ //' << EOF >$dummy.c 534 sed 's/^ //' << EOF > "$dummy.c"
437#ifdef __cplusplus 535#ifdef __cplusplus
438#include <stdio.h> /* for printf() prototype */ 536#include <stdio.h> /* for printf() prototype */
439 int main (int argc, char *argv[]) { 537 int main (int argc, char *argv[]) {
@@ -442,95 +540,96 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
442#endif 540#endif
443 #if defined (host_mips) && defined (MIPSEB) 541 #if defined (host_mips) && defined (MIPSEB)
444 #if defined (SYSTYPE_SYSV) 542 #if defined (SYSTYPE_SYSV)
445 printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); 543 printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0);
446 #endif 544 #endif
447 #if defined (SYSTYPE_SVR4) 545 #if defined (SYSTYPE_SVR4)
448 printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); 546 printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0);
449 #endif 547 #endif
450 #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) 548 #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
451 printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); 549 printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0);
452 #endif 550 #endif
453 #endif 551 #endif
454 exit (-1); 552 exit (-1);
455 } 553 }
456EOF 554EOF
457 $CC_FOR_BUILD -o $dummy $dummy.c && 555 $CC_FOR_BUILD -o "$dummy" "$dummy.c" &&
458 dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && 556 dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` &&
459 SYSTEM_NAME=`$dummy $dummyarg` && 557 SYSTEM_NAME=`"$dummy" "$dummyarg"` &&
460 { echo "$SYSTEM_NAME"; exit; } 558 { echo "$SYSTEM_NAME"; exit; }
461 echo mips-mips-riscos${UNAME_RELEASE} 559 GUESS=mips-mips-riscos$UNAME_RELEASE
462 exit ;; 560 ;;
463 Motorola:PowerMAX_OS:*:*) 561 Motorola:PowerMAX_OS:*:*)
464 echo powerpc-motorola-powermax 562 GUESS=powerpc-motorola-powermax
465 exit ;; 563 ;;
466 Motorola:*:4.3:PL8-*) 564 Motorola:*:4.3:PL8-*)
467 echo powerpc-harris-powermax 565 GUESS=powerpc-harris-powermax
468 exit ;; 566 ;;
469 Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) 567 Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
470 echo powerpc-harris-powermax 568 GUESS=powerpc-harris-powermax
471 exit ;; 569 ;;
472 Night_Hawk:Power_UNIX:*:*) 570 Night_Hawk:Power_UNIX:*:*)
473 echo powerpc-harris-powerunix 571 GUESS=powerpc-harris-powerunix
474 exit ;; 572 ;;
475 m88k:CX/UX:7*:*) 573 m88k:CX/UX:7*:*)
476 echo m88k-harris-cxux7 574 GUESS=m88k-harris-cxux7
477 exit ;; 575 ;;
478 m88k:*:4*:R4*) 576 m88k:*:4*:R4*)
479 echo m88k-motorola-sysv4 577 GUESS=m88k-motorola-sysv4
480 exit ;; 578 ;;
481 m88k:*:3*:R3*) 579 m88k:*:3*:R3*)
482 echo m88k-motorola-sysv3 580 GUESS=m88k-motorola-sysv3
483 exit ;; 581 ;;
484 AViiON:dgux:*:*) 582 AViiON:dgux:*:*)
485 # DG/UX returns AViiON for all architectures 583 # DG/UX returns AViiON for all architectures
486 UNAME_PROCESSOR=`/usr/bin/uname -p` 584 UNAME_PROCESSOR=`/usr/bin/uname -p`
487 if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] 585 if test "$UNAME_PROCESSOR" = mc88100 || test "$UNAME_PROCESSOR" = mc88110
488 then 586 then
489 if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ 587 if test "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx || \
490 [ ${TARGET_BINARY_INTERFACE}x = x ] 588 test "$TARGET_BINARY_INTERFACE"x = x
491 then 589 then
492 echo m88k-dg-dgux${UNAME_RELEASE} 590 GUESS=m88k-dg-dgux$UNAME_RELEASE
493 else 591 else
494 echo m88k-dg-dguxbcs${UNAME_RELEASE} 592 GUESS=m88k-dg-dguxbcs$UNAME_RELEASE
495 fi 593 fi
496 else 594 else
497 echo i586-dg-dgux${UNAME_RELEASE} 595 GUESS=i586-dg-dgux$UNAME_RELEASE
498 fi 596 fi
499 exit ;; 597 ;;
500 M88*:DolphinOS:*:*) # DolphinOS (SVR3) 598 M88*:DolphinOS:*:*) # DolphinOS (SVR3)
501 echo m88k-dolphin-sysv3 599 GUESS=m88k-dolphin-sysv3
502 exit ;; 600 ;;
503 M88*:*:R3*:*) 601 M88*:*:R3*:*)
504 # Delta 88k system running SVR3 602 # Delta 88k system running SVR3
505 echo m88k-motorola-sysv3 603 GUESS=m88k-motorola-sysv3
506 exit ;; 604 ;;
507 XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) 605 XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
508 echo m88k-tektronix-sysv3 606 GUESS=m88k-tektronix-sysv3
509 exit ;; 607 ;;
510 Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) 608 Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
511 echo m68k-tektronix-bsd 609 GUESS=m68k-tektronix-bsd
512 exit ;; 610 ;;
513 *:IRIX*:*:*) 611 *:IRIX*:*:*)
514 echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` 612 IRIX_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/g'`
515 exit ;; 613 GUESS=mips-sgi-irix$IRIX_REL
614 ;;
516 ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. 615 ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
517 echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id 616 GUESS=romp-ibm-aix # uname -m gives an 8 hex-code CPU id
518 exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' 617 ;; # Note that: echo "'`uname -s`'" gives 'AIX '
519 i*86:AIX:*:*) 618 i*86:AIX:*:*)
520 echo i386-ibm-aix 619 GUESS=i386-ibm-aix
521 exit ;; 620 ;;
522 ia64:AIX:*:*) 621 ia64:AIX:*:*)
523 if [ -x /usr/bin/oslevel ] ; then 622 if test -x /usr/bin/oslevel ; then
524 IBM_REV=`/usr/bin/oslevel` 623 IBM_REV=`/usr/bin/oslevel`
525 else 624 else
526 IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} 625 IBM_REV=$UNAME_VERSION.$UNAME_RELEASE
527 fi 626 fi
528 echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} 627 GUESS=$UNAME_MACHINE-ibm-aix$IBM_REV
529 exit ;; 628 ;;
530 *:AIX:2:3) 629 *:AIX:2:3)
531 if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then 630 if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
532 eval $set_cc_for_build 631 set_cc_for_build
533 sed 's/^ //' << EOF >$dummy.c 632 sed 's/^ //' << EOF > "$dummy.c"
534 #include <sys/systemcfg.h> 633 #include <sys/systemcfg.h>
535 634
536 main() 635 main()
@@ -541,76 +640,77 @@ EOF
541 exit(0); 640 exit(0);
542 } 641 }
543EOF 642EOF
544 if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` 643 if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"`
545 then 644 then
546 echo "$SYSTEM_NAME" 645 GUESS=$SYSTEM_NAME
547 else 646 else
548 echo rs6000-ibm-aix3.2.5 647 GUESS=rs6000-ibm-aix3.2.5
549 fi 648 fi
550 elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then 649 elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
551 echo rs6000-ibm-aix3.2.4 650 GUESS=rs6000-ibm-aix3.2.4
552 else 651 else
553 echo rs6000-ibm-aix3.2 652 GUESS=rs6000-ibm-aix3.2
554 fi 653 fi
555 exit ;; 654 ;;
556 *:AIX:*:[4567]) 655 *:AIX:*:[4567])
557 IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` 656 IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
558 if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then 657 if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then
559 IBM_ARCH=rs6000 658 IBM_ARCH=rs6000
560 else 659 else
561 IBM_ARCH=powerpc 660 IBM_ARCH=powerpc
562 fi 661 fi
563 if [ -x /usr/bin/oslevel ] ; then 662 if test -x /usr/bin/lslpp ; then
564 IBM_REV=`/usr/bin/oslevel` 663 IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | \
664 awk -F: '{ print $3 }' | sed s/[0-9]*$/0/`
565 else 665 else
566 IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} 666 IBM_REV=$UNAME_VERSION.$UNAME_RELEASE
567 fi 667 fi
568 echo ${IBM_ARCH}-ibm-aix${IBM_REV} 668 GUESS=$IBM_ARCH-ibm-aix$IBM_REV
569 exit ;; 669 ;;
570 *:AIX:*:*) 670 *:AIX:*:*)
571 echo rs6000-ibm-aix 671 GUESS=rs6000-ibm-aix
572 exit ;; 672 ;;
573 ibmrt:4.4BSD:*|romp-ibm:BSD:*) 673 ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*)
574 echo romp-ibm-bsd4.4 674 GUESS=romp-ibm-bsd4.4
575 exit ;; 675 ;;
576 ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and 676 ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
577 echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to 677 GUESS=romp-ibm-bsd$UNAME_RELEASE # 4.3 with uname added to
578 exit ;; # report: romp-ibm BSD 4.3 678 ;; # report: romp-ibm BSD 4.3
579 *:BOSX:*:*) 679 *:BOSX:*:*)
580 echo rs6000-bull-bosx 680 GUESS=rs6000-bull-bosx
581 exit ;; 681 ;;
582 DPX/2?00:B.O.S.:*:*) 682 DPX/2?00:B.O.S.:*:*)
583 echo m68k-bull-sysv3 683 GUESS=m68k-bull-sysv3
584 exit ;; 684 ;;
585 9000/[34]??:4.3bsd:1.*:*) 685 9000/[34]??:4.3bsd:1.*:*)
586 echo m68k-hp-bsd 686 GUESS=m68k-hp-bsd
587 exit ;; 687 ;;
588 hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) 688 hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
589 echo m68k-hp-bsd4.4 689 GUESS=m68k-hp-bsd4.4
590 exit ;; 690 ;;
591 9000/[34678]??:HP-UX:*:*) 691 9000/[34678]??:HP-UX:*:*)
592 HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` 692 HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'`
593 case "${UNAME_MACHINE}" in 693 case $UNAME_MACHINE in
594 9000/31? ) HP_ARCH=m68000 ;; 694 9000/31?) HP_ARCH=m68000 ;;
595 9000/[34]?? ) HP_ARCH=m68k ;; 695 9000/[34]??) HP_ARCH=m68k ;;
596 9000/[678][0-9][0-9]) 696 9000/[678][0-9][0-9])
597 if [ -x /usr/bin/getconf ]; then 697 if test -x /usr/bin/getconf; then
598 sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` 698 sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
599 sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` 699 sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
600 case "${sc_cpu_version}" in 700 case $sc_cpu_version in
601 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 701 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0
602 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 702 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1
603 532) # CPU_PA_RISC2_0 703 532) # CPU_PA_RISC2_0
604 case "${sc_kernel_bits}" in 704 case $sc_kernel_bits in
605 32) HP_ARCH="hppa2.0n" ;; 705 32) HP_ARCH=hppa2.0n ;;
606 64) HP_ARCH="hppa2.0w" ;; 706 64) HP_ARCH=hppa2.0w ;;
607 '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 707 '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20
608 esac ;; 708 esac ;;
609 esac 709 esac
610 fi 710 fi
611 if [ "${HP_ARCH}" = "" ]; then 711 if test "$HP_ARCH" = ""; then
612 eval $set_cc_for_build 712 set_cc_for_build
613 sed 's/^ //' << EOF >$dummy.c 713 sed 's/^ //' << EOF > "$dummy.c"
614 714
615 #define _HPUX_SOURCE 715 #define _HPUX_SOURCE
616 #include <stdlib.h> 716 #include <stdlib.h>
@@ -643,13 +743,13 @@ EOF
643 exit (0); 743 exit (0);
644 } 744 }
645EOF 745EOF
646 (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` 746 (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"`
647 test -z "$HP_ARCH" && HP_ARCH=hppa 747 test -z "$HP_ARCH" && HP_ARCH=hppa
648 fi ;; 748 fi ;;
649 esac 749 esac
650 if [ ${HP_ARCH} = "hppa2.0w" ] 750 if test "$HP_ARCH" = hppa2.0w
651 then 751 then
652 eval $set_cc_for_build 752 set_cc_for_build
653 753
654 # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating 754 # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
655 # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler 755 # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler
@@ -660,23 +760,23 @@ EOF
660 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess 760 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
661 # => hppa64-hp-hpux11.23 761 # => hppa64-hp-hpux11.23
662 762
663 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | 763 if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) |
664 grep -q __LP64__ 764 grep -q __LP64__
665 then 765 then
666 HP_ARCH="hppa2.0w" 766 HP_ARCH=hppa2.0w
667 else 767 else
668 HP_ARCH="hppa64" 768 HP_ARCH=hppa64
669 fi 769 fi
670 fi 770 fi
671 echo ${HP_ARCH}-hp-hpux${HPUX_REV} 771 GUESS=$HP_ARCH-hp-hpux$HPUX_REV
672 exit ;; 772 ;;
673 ia64:HP-UX:*:*) 773 ia64:HP-UX:*:*)
674 HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` 774 HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'`
675 echo ia64-hp-hpux${HPUX_REV} 775 GUESS=ia64-hp-hpux$HPUX_REV
676 exit ;; 776 ;;
677 3050*:HI-UX:*:*) 777 3050*:HI-UX:*:*)
678 eval $set_cc_for_build 778 set_cc_for_build
679 sed 's/^ //' << EOF >$dummy.c 779 sed 's/^ //' << EOF > "$dummy.c"
680 #include <unistd.h> 780 #include <unistd.h>
681 int 781 int
682 main () 782 main ()
@@ -701,38 +801,38 @@ EOF
701 exit (0); 801 exit (0);
702 } 802 }
703EOF 803EOF
704 $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && 804 $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` &&
705 { echo "$SYSTEM_NAME"; exit; } 805 { echo "$SYSTEM_NAME"; exit; }
706 echo unknown-hitachi-hiuxwe2 806 GUESS=unknown-hitachi-hiuxwe2
707 exit ;; 807 ;;
708 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) 808 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*)
709 echo hppa1.1-hp-bsd 809 GUESS=hppa1.1-hp-bsd
710 exit ;; 810 ;;
711 9000/8??:4.3bsd:*:*) 811 9000/8??:4.3bsd:*:*)
712 echo hppa1.0-hp-bsd 812 GUESS=hppa1.0-hp-bsd
713 exit ;; 813 ;;
714 *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) 814 *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
715 echo hppa1.0-hp-mpeix 815 GUESS=hppa1.0-hp-mpeix
716 exit ;; 816 ;;
717 hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) 817 hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*)
718 echo hppa1.1-hp-osf 818 GUESS=hppa1.1-hp-osf
719 exit ;; 819 ;;
720 hp8??:OSF1:*:*) 820 hp8??:OSF1:*:*)
721 echo hppa1.0-hp-osf 821 GUESS=hppa1.0-hp-osf
722 exit ;; 822 ;;
723 i*86:OSF1:*:*) 823 i*86:OSF1:*:*)
724 if [ -x /usr/sbin/sysversion ] ; then 824 if test -x /usr/sbin/sysversion ; then
725 echo ${UNAME_MACHINE}-unknown-osf1mk 825 GUESS=$UNAME_MACHINE-unknown-osf1mk
726 else 826 else
727 echo ${UNAME_MACHINE}-unknown-osf1 827 GUESS=$UNAME_MACHINE-unknown-osf1
728 fi 828 fi
729 exit ;; 829 ;;
730 parisc*:Lites*:*:*) 830 parisc*:Lites*:*:*)
731 echo hppa1.1-hp-lites 831 GUESS=hppa1.1-hp-lites
732 exit ;; 832 ;;
733 C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) 833 C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
734 echo c1-convex-bsd 834 GUESS=c1-convex-bsd
735 exit ;; 835 ;;
736 C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) 836 C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
737 if getsysinfo -f scalar_acc 837 if getsysinfo -f scalar_acc
738 then echo c32-convex-bsd 838 then echo c32-convex-bsd
@@ -740,136 +840,174 @@ EOF
740 fi 840 fi
741 exit ;; 841 exit ;;
742 C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) 842 C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
743 echo c34-convex-bsd 843 GUESS=c34-convex-bsd
744 exit ;; 844 ;;
745 C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) 845 C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
746 echo c38-convex-bsd 846 GUESS=c38-convex-bsd
747 exit ;; 847 ;;
748 C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) 848 C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
749 echo c4-convex-bsd 849 GUESS=c4-convex-bsd
750 exit ;; 850 ;;
751 CRAY*Y-MP:*:*:*) 851 CRAY*Y-MP:*:*:*)
752 echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' 852 CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
753 exit ;; 853 GUESS=ymp-cray-unicos$CRAY_REL
854 ;;
754 CRAY*[A-Z]90:*:*:*) 855 CRAY*[A-Z]90:*:*:*)
755 echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ 856 echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \
756 | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ 857 | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
757 -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ 858 -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
758 -e 's/\.[^.]*$/.X/' 859 -e 's/\.[^.]*$/.X/'
759 exit ;; 860 exit ;;
760 CRAY*TS:*:*:*) 861 CRAY*TS:*:*:*)
761 echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' 862 CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
762 exit ;; 863 GUESS=t90-cray-unicos$CRAY_REL
864 ;;
763 CRAY*T3E:*:*:*) 865 CRAY*T3E:*:*:*)
764 echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' 866 CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
765 exit ;; 867 GUESS=alphaev5-cray-unicosmk$CRAY_REL
868 ;;
766 CRAY*SV1:*:*:*) 869 CRAY*SV1:*:*:*)
767 echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' 870 CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
768 exit ;; 871 GUESS=sv1-cray-unicos$CRAY_REL
872 ;;
769 *:UNICOS/mp:*:*) 873 *:UNICOS/mp:*:*)
770 echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' 874 CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
771 exit ;; 875 GUESS=craynv-cray-unicosmp$CRAY_REL
876 ;;
772 F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) 877 F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
773 FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` 878 FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
774 FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` 879 FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
775 FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` 880 FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'`
776 echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" 881 GUESS=${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}
777 exit ;; 882 ;;
778 5000:UNIX_System_V:4.*:*) 883 5000:UNIX_System_V:4.*:*)
779 FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` 884 FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
780 FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` 885 FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'`
781 echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" 886 GUESS=sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}
782 exit ;; 887 ;;
783 i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) 888 i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
784 echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} 889 GUESS=$UNAME_MACHINE-pc-bsdi$UNAME_RELEASE
785 exit ;; 890 ;;
786 sparc*:BSD/OS:*:*) 891 sparc*:BSD/OS:*:*)
787 echo sparc-unknown-bsdi${UNAME_RELEASE} 892 GUESS=sparc-unknown-bsdi$UNAME_RELEASE
788 exit ;; 893 ;;
789 *:BSD/OS:*:*) 894 *:BSD/OS:*:*)
790 echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} 895 GUESS=$UNAME_MACHINE-unknown-bsdi$UNAME_RELEASE
791 exit ;; 896 ;;
897 arm:FreeBSD:*:*)
898 UNAME_PROCESSOR=`uname -p`
899 set_cc_for_build
900 if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
901 | grep -q __ARM_PCS_VFP
902 then
903 FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
904 GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabi
905 else
906 FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
907 GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabihf
908 fi
909 ;;
792 *:FreeBSD:*:*) 910 *:FreeBSD:*:*)
793 UNAME_PROCESSOR=`/usr/bin/uname -p` 911 UNAME_PROCESSOR=`uname -p`
794 case ${UNAME_PROCESSOR} in 912 case $UNAME_PROCESSOR in
795 amd64) 913 amd64)
796 echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; 914 UNAME_PROCESSOR=x86_64 ;;
797 *) 915 i386)
798 echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; 916 UNAME_PROCESSOR=i586 ;;
799 esac 917 esac
800 exit ;; 918 FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
919 GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL
920 ;;
801 i*:CYGWIN*:*) 921 i*:CYGWIN*:*)
802 echo ${UNAME_MACHINE}-pc-cygwin 922 GUESS=$UNAME_MACHINE-pc-cygwin
803 exit ;; 923 ;;
924 *:MINGW64*:*)
925 GUESS=$UNAME_MACHINE-pc-mingw64
926 ;;
804 *:MINGW*:*) 927 *:MINGW*:*)
805 echo ${UNAME_MACHINE}-pc-mingw32 928 GUESS=$UNAME_MACHINE-pc-mingw32
806 exit ;; 929 ;;
807 i*:MSYS*:*) 930 *:MSYS*:*)
808 echo ${UNAME_MACHINE}-pc-msys 931 GUESS=$UNAME_MACHINE-pc-msys
809 exit ;; 932 ;;
810 i*:windows32*:*)
811 # uname -m includes "-pc" on this system.
812 echo ${UNAME_MACHINE}-mingw32
813 exit ;;
814 i*:PW*:*) 933 i*:PW*:*)
815 echo ${UNAME_MACHINE}-pc-pw32 934 GUESS=$UNAME_MACHINE-pc-pw32
816 exit ;; 935 ;;
936 *:SerenityOS:*:*)
937 GUESS=$UNAME_MACHINE-pc-serenity
938 ;;
817 *:Interix*:*) 939 *:Interix*:*)
818 case ${UNAME_MACHINE} in 940 case $UNAME_MACHINE in
819 x86) 941 x86)
820 echo i586-pc-interix${UNAME_RELEASE} 942 GUESS=i586-pc-interix$UNAME_RELEASE
821 exit ;; 943 ;;
822 authenticamd | genuineintel | EM64T) 944 authenticamd | genuineintel | EM64T)
823 echo x86_64-unknown-interix${UNAME_RELEASE} 945 GUESS=x86_64-unknown-interix$UNAME_RELEASE
824 exit ;; 946 ;;
825 IA64) 947 IA64)
826 echo ia64-unknown-interix${UNAME_RELEASE} 948 GUESS=ia64-unknown-interix$UNAME_RELEASE
827 exit ;; 949 ;;
828 esac ;; 950 esac ;;
829 [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
830 echo i${UNAME_MACHINE}-pc-mks
831 exit ;;
832 8664:Windows_NT:*)
833 echo x86_64-pc-mks
834 exit ;;
835 i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
836 # How do we know it's Interix rather than the generic POSIX subsystem?
837 # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
838 # UNAME_MACHINE based on the output of uname instead of i386?
839 echo i586-pc-interix
840 exit ;;
841 i*:UWIN*:*) 951 i*:UWIN*:*)
842 echo ${UNAME_MACHINE}-pc-uwin 952 GUESS=$UNAME_MACHINE-pc-uwin
843 exit ;; 953 ;;
844 amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) 954 amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
845 echo x86_64-unknown-cygwin 955 GUESS=x86_64-pc-cygwin
846 exit ;; 956 ;;
847 p*:CYGWIN*:*)
848 echo powerpcle-unknown-cygwin
849 exit ;;
850 prep*:SunOS:5.*:*) 957 prep*:SunOS:5.*:*)
851 echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` 958 SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
852 exit ;; 959 GUESS=powerpcle-unknown-solaris2$SUN_REL
960 ;;
853 *:GNU:*:*) 961 *:GNU:*:*)
854 # the GNU system 962 # the GNU system
855 echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` 963 GNU_ARCH=`echo "$UNAME_MACHINE" | sed -e 's,[-/].*$,,'`
856 exit ;; 964 GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's,/.*$,,'`
965 GUESS=$GNU_ARCH-unknown-$LIBC$GNU_REL
966 ;;
857 *:GNU/*:*:*) 967 *:GNU/*:*:*)
858 # other systems with GNU libc and userland 968 # other systems with GNU libc and userland
859 echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu 969 GNU_SYS=`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"`
860 exit ;; 970 GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
861 i*86:Minix:*:*) 971 GUESS=$UNAME_MACHINE-unknown-$GNU_SYS$GNU_REL-$LIBC
862 echo ${UNAME_MACHINE}-pc-minix 972 ;;
863 exit ;; 973 x86_64:[Mm]anagarm:*:*|i?86:[Mm]anagarm:*:*)
974 GUESS="$UNAME_MACHINE-pc-managarm-mlibc"
975 ;;
976 *:[Mm]anagarm:*:*)
977 GUESS="$UNAME_MACHINE-unknown-managarm-mlibc"
978 ;;
979 *:Minix:*:*)
980 GUESS=$UNAME_MACHINE-unknown-minix
981 ;;
864 aarch64:Linux:*:*) 982 aarch64:Linux:*:*)
865 echo ${UNAME_MACHINE}-unknown-linux-gnu 983 set_cc_for_build
866 exit ;; 984 CPU=$UNAME_MACHINE
985 LIBCABI=$LIBC
986 if test "$CC_FOR_BUILD" != no_compiler_found; then
987 ABI=64
988 sed 's/^ //' << EOF > "$dummy.c"
989 #ifdef __ARM_EABI__
990 #ifdef __ARM_PCS_VFP
991 ABI=eabihf
992 #else
993 ABI=eabi
994 #endif
995 #endif
996EOF
997 cc_set_abi=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^ABI' | sed 's, ,,g'`
998 eval "$cc_set_abi"
999 case $ABI in
1000 eabi | eabihf) CPU=armv8l; LIBCABI=$LIBC$ABI ;;
1001 esac
1002 fi
1003 GUESS=$CPU-unknown-linux-$LIBCABI
1004 ;;
867 aarch64_be:Linux:*:*) 1005 aarch64_be:Linux:*:*)
868 UNAME_MACHINE=aarch64_be 1006 UNAME_MACHINE=aarch64_be
869 echo ${UNAME_MACHINE}-unknown-linux-gnu 1007 GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
870 exit ;; 1008 ;;
871 alpha:Linux:*:*) 1009 alpha:Linux:*:*)
872 case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in 1010 case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null` in
873 EV5) UNAME_MACHINE=alphaev5 ;; 1011 EV5) UNAME_MACHINE=alphaev5 ;;
874 EV56) UNAME_MACHINE=alphaev56 ;; 1012 EV56) UNAME_MACHINE=alphaev56 ;;
875 PCA56) UNAME_MACHINE=alphapca56 ;; 1013 PCA56) UNAME_MACHINE=alphapca56 ;;
@@ -879,168 +1017,246 @@ EOF
879 EV68*) UNAME_MACHINE=alphaev68 ;; 1017 EV68*) UNAME_MACHINE=alphaev68 ;;
880 esac 1018 esac
881 objdump --private-headers /bin/sh | grep -q ld.so.1 1019 objdump --private-headers /bin/sh | grep -q ld.so.1
882 if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi 1020 if test "$?" = 0 ; then LIBC=gnulibc1 ; fi
883 echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} 1021 GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
884 exit ;; 1022 ;;
1023 arc:Linux:*:* | arceb:Linux:*:* | arc32:Linux:*:* | arc64:Linux:*:*)
1024 GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1025 ;;
885 arm*:Linux:*:*) 1026 arm*:Linux:*:*)
886 eval $set_cc_for_build 1027 set_cc_for_build
887 if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ 1028 if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
888 | grep -q __ARM_EABI__ 1029 | grep -q __ARM_EABI__
889 then 1030 then
890 echo ${UNAME_MACHINE}-unknown-linux-gnu 1031 GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
891 else 1032 else
892 if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ 1033 if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
893 | grep -q __ARM_PCS_VFP 1034 | grep -q __ARM_PCS_VFP
894 then 1035 then
895 echo ${UNAME_MACHINE}-unknown-linux-gnueabi 1036 GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabi
896 else 1037 else
897 echo ${UNAME_MACHINE}-unknown-linux-gnueabihf 1038 GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabihf
898 fi 1039 fi
899 fi 1040 fi
900 exit ;; 1041 ;;
901 avr32*:Linux:*:*) 1042 avr32*:Linux:*:*)
902 echo ${UNAME_MACHINE}-unknown-linux-gnu 1043 GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
903 exit ;; 1044 ;;
904 cris:Linux:*:*) 1045 cris:Linux:*:*)
905 echo ${UNAME_MACHINE}-axis-linux-gnu 1046 GUESS=$UNAME_MACHINE-axis-linux-$LIBC
906 exit ;; 1047 ;;
907 crisv32:Linux:*:*) 1048 crisv32:Linux:*:*)
908 echo ${UNAME_MACHINE}-axis-linux-gnu 1049 GUESS=$UNAME_MACHINE-axis-linux-$LIBC
909 exit ;; 1050 ;;
1051 e2k:Linux:*:*)
1052 GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1053 ;;
910 frv:Linux:*:*) 1054 frv:Linux:*:*)
911 echo ${UNAME_MACHINE}-unknown-linux-gnu 1055 GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
912 exit ;; 1056 ;;
913 hexagon:Linux:*:*) 1057 hexagon:Linux:*:*)
914 echo ${UNAME_MACHINE}-unknown-linux-gnu 1058 GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
915 exit ;; 1059 ;;
916 i*86:Linux:*:*) 1060 i*86:Linux:*:*)
917 LIBC=gnu 1061 GUESS=$UNAME_MACHINE-pc-linux-$LIBC
918 eval $set_cc_for_build 1062 ;;
919 sed 's/^ //' << EOF >$dummy.c
920 #ifdef __dietlibc__
921 LIBC=dietlibc
922 #endif
923EOF
924 eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
925 echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
926 exit ;;
927 ia64:Linux:*:*) 1063 ia64:Linux:*:*)
928 echo ${UNAME_MACHINE}-unknown-linux-gnu 1064 GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
929 exit ;; 1065 ;;
1066 k1om:Linux:*:*)
1067 GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1068 ;;
1069 kvx:Linux:*:*)
1070 GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1071 ;;
1072 kvx:cos:*:*)
1073 GUESS=$UNAME_MACHINE-unknown-cos
1074 ;;
1075 kvx:mbr:*:*)
1076 GUESS=$UNAME_MACHINE-unknown-mbr
1077 ;;
1078 loongarch32:Linux:*:* | loongarch64:Linux:*:*)
1079 GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1080 ;;
930 m32r*:Linux:*:*) 1081 m32r*:Linux:*:*)
931 echo ${UNAME_MACHINE}-unknown-linux-gnu 1082 GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
932 exit ;; 1083 ;;
933 m68*:Linux:*:*) 1084 m68*:Linux:*:*)
934 echo ${UNAME_MACHINE}-unknown-linux-gnu 1085 GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
935 exit ;; 1086 ;;
936 mips:Linux:*:* | mips64:Linux:*:*) 1087 mips:Linux:*:* | mips64:Linux:*:*)
937 eval $set_cc_for_build 1088 set_cc_for_build
938 sed 's/^ //' << EOF >$dummy.c 1089 IS_GLIBC=0
1090 test x"${LIBC}" = xgnu && IS_GLIBC=1
1091 sed 's/^ //' << EOF > "$dummy.c"
939 #undef CPU 1092 #undef CPU
940 #undef ${UNAME_MACHINE} 1093 #undef mips
941 #undef ${UNAME_MACHINE}el 1094 #undef mipsel
1095 #undef mips64
1096 #undef mips64el
1097 #if ${IS_GLIBC} && defined(_ABI64)
1098 LIBCABI=gnuabi64
1099 #else
1100 #if ${IS_GLIBC} && defined(_ABIN32)
1101 LIBCABI=gnuabin32
1102 #else
1103 LIBCABI=${LIBC}
1104 #endif
1105 #endif
1106
1107 #if ${IS_GLIBC} && defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6
1108 CPU=mipsisa64r6
1109 #else
1110 #if ${IS_GLIBC} && !defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6
1111 CPU=mipsisa32r6
1112 #else
1113 #if defined(__mips64)
1114 CPU=mips64
1115 #else
1116 CPU=mips
1117 #endif
1118 #endif
1119 #endif
1120
942 #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) 1121 #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
943 CPU=${UNAME_MACHINE}el 1122 MIPS_ENDIAN=el
944 #else 1123 #else
945 #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) 1124 #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
946 CPU=${UNAME_MACHINE} 1125 MIPS_ENDIAN=
947 #else 1126 #else
948 CPU= 1127 MIPS_ENDIAN=
949 #endif 1128 #endif
950 #endif 1129 #endif
951EOF 1130EOF
952 eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` 1131 cc_set_vars=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI'`
953 test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } 1132 eval "$cc_set_vars"
1133 test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; }
1134 ;;
1135 mips64el:Linux:*:*)
1136 GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1137 ;;
1138 openrisc*:Linux:*:*)
1139 GUESS=or1k-unknown-linux-$LIBC
1140 ;;
1141 or32:Linux:*:* | or1k*:Linux:*:*)
1142 GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
954 ;; 1143 ;;
955 or32:Linux:*:*)
956 echo ${UNAME_MACHINE}-unknown-linux-gnu
957 exit ;;
958 padre:Linux:*:*) 1144 padre:Linux:*:*)
959 echo sparc-unknown-linux-gnu 1145 GUESS=sparc-unknown-linux-$LIBC
960 exit ;; 1146 ;;
961 parisc64:Linux:*:* | hppa64:Linux:*:*) 1147 parisc64:Linux:*:* | hppa64:Linux:*:*)
962 echo hppa64-unknown-linux-gnu 1148 GUESS=hppa64-unknown-linux-$LIBC
963 exit ;; 1149 ;;
964 parisc:Linux:*:* | hppa:Linux:*:*) 1150 parisc:Linux:*:* | hppa:Linux:*:*)
965 # Look for CPU level 1151 # Look for CPU level
966 case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in 1152 case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
967 PA7*) echo hppa1.1-unknown-linux-gnu ;; 1153 PA7*) GUESS=hppa1.1-unknown-linux-$LIBC ;;
968 PA8*) echo hppa2.0-unknown-linux-gnu ;; 1154 PA8*) GUESS=hppa2.0-unknown-linux-$LIBC ;;
969 *) echo hppa-unknown-linux-gnu ;; 1155 *) GUESS=hppa-unknown-linux-$LIBC ;;
970 esac 1156 esac
971 exit ;; 1157 ;;
972 ppc64:Linux:*:*) 1158 ppc64:Linux:*:*)
973 echo powerpc64-unknown-linux-gnu 1159 GUESS=powerpc64-unknown-linux-$LIBC
974 exit ;; 1160 ;;
975 ppc:Linux:*:*) 1161 ppc:Linux:*:*)
976 echo powerpc-unknown-linux-gnu 1162 GUESS=powerpc-unknown-linux-$LIBC
977 exit ;; 1163 ;;
1164 ppc64le:Linux:*:*)
1165 GUESS=powerpc64le-unknown-linux-$LIBC
1166 ;;
1167 ppcle:Linux:*:*)
1168 GUESS=powerpcle-unknown-linux-$LIBC
1169 ;;
1170 riscv32:Linux:*:* | riscv32be:Linux:*:* | riscv64:Linux:*:* | riscv64be:Linux:*:*)
1171 GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1172 ;;
978 s390:Linux:*:* | s390x:Linux:*:*) 1173 s390:Linux:*:* | s390x:Linux:*:*)
979 echo ${UNAME_MACHINE}-ibm-linux 1174 GUESS=$UNAME_MACHINE-ibm-linux-$LIBC
980 exit ;; 1175 ;;
981 sh64*:Linux:*:*) 1176 sh64*:Linux:*:*)
982 echo ${UNAME_MACHINE}-unknown-linux-gnu 1177 GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
983 exit ;; 1178 ;;
984 sh*:Linux:*:*) 1179 sh*:Linux:*:*)
985 echo ${UNAME_MACHINE}-unknown-linux-gnu 1180 GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
986 exit ;; 1181 ;;
987 sparc:Linux:*:* | sparc64:Linux:*:*) 1182 sparc:Linux:*:* | sparc64:Linux:*:*)
988 echo ${UNAME_MACHINE}-unknown-linux-gnu 1183 GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
989 exit ;; 1184 ;;
990 tile*:Linux:*:*) 1185 tile*:Linux:*:*)
991 echo ${UNAME_MACHINE}-unknown-linux-gnu 1186 GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
992 exit ;; 1187 ;;
993 vax:Linux:*:*) 1188 vax:Linux:*:*)
994 echo ${UNAME_MACHINE}-dec-linux-gnu 1189 GUESS=$UNAME_MACHINE-dec-linux-$LIBC
995 exit ;; 1190 ;;
996 x86_64:Linux:*:*) 1191 x86_64:Linux:*:*)
997 echo ${UNAME_MACHINE}-unknown-linux-gnu 1192 set_cc_for_build
998 exit ;; 1193 CPU=$UNAME_MACHINE
1194 LIBCABI=$LIBC
1195 if test "$CC_FOR_BUILD" != no_compiler_found; then
1196 ABI=64
1197 sed 's/^ //' << EOF > "$dummy.c"
1198 #ifdef __i386__
1199 ABI=x86
1200 #else
1201 #ifdef __ILP32__
1202 ABI=x32
1203 #endif
1204 #endif
1205EOF
1206 cc_set_abi=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^ABI' | sed 's, ,,g'`
1207 eval "$cc_set_abi"
1208 case $ABI in
1209 x86) CPU=i686 ;;
1210 x32) LIBCABI=${LIBC}x32 ;;
1211 esac
1212 fi
1213 GUESS=$CPU-pc-linux-$LIBCABI
1214 ;;
999 xtensa*:Linux:*:*) 1215 xtensa*:Linux:*:*)
1000 echo ${UNAME_MACHINE}-unknown-linux-gnu 1216 GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1001 exit ;; 1217 ;;
1002 i*86:DYNIX/ptx:4*:*) 1218 i*86:DYNIX/ptx:4*:*)
1003 # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. 1219 # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
1004 # earlier versions are messed up and put the nodename in both 1220 # earlier versions are messed up and put the nodename in both
1005 # sysname and nodename. 1221 # sysname and nodename.
1006 echo i386-sequent-sysv4 1222 GUESS=i386-sequent-sysv4
1007 exit ;; 1223 ;;
1008 i*86:UNIX_SV:4.2MP:2.*) 1224 i*86:UNIX_SV:4.2MP:2.*)
1009 # Unixware is an offshoot of SVR4, but it has its own version 1225 # Unixware is an offshoot of SVR4, but it has its own version
1010 # number series starting with 2... 1226 # number series starting with 2...
1011 # I am not positive that other SVR4 systems won't match this, 1227 # I am not positive that other SVR4 systems won't match this,
1012 # I just have to hope. -- rms. 1228 # I just have to hope. -- rms.
1013 # Use sysv4.2uw... so that sysv4* matches it. 1229 # Use sysv4.2uw... so that sysv4* matches it.
1014 echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} 1230 GUESS=$UNAME_MACHINE-pc-sysv4.2uw$UNAME_VERSION
1015 exit ;; 1231 ;;
1016 i*86:OS/2:*:*) 1232 i*86:OS/2:*:*)
1017 # If we were able to find `uname', then EMX Unix compatibility 1233 # If we were able to find 'uname', then EMX Unix compatibility
1018 # is probably installed. 1234 # is probably installed.
1019 echo ${UNAME_MACHINE}-pc-os2-emx 1235 GUESS=$UNAME_MACHINE-pc-os2-emx
1020 exit ;; 1236 ;;
1021 i*86:XTS-300:*:STOP) 1237 i*86:XTS-300:*:STOP)
1022 echo ${UNAME_MACHINE}-unknown-stop 1238 GUESS=$UNAME_MACHINE-unknown-stop
1023 exit ;; 1239 ;;
1024 i*86:atheos:*:*) 1240 i*86:atheos:*:*)
1025 echo ${UNAME_MACHINE}-unknown-atheos 1241 GUESS=$UNAME_MACHINE-unknown-atheos
1026 exit ;; 1242 ;;
1027 i*86:syllable:*:*) 1243 i*86:syllable:*:*)
1028 echo ${UNAME_MACHINE}-pc-syllable 1244 GUESS=$UNAME_MACHINE-pc-syllable
1029 exit ;; 1245 ;;
1030 i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) 1246 i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
1031 echo i386-unknown-lynxos${UNAME_RELEASE} 1247 GUESS=i386-unknown-lynxos$UNAME_RELEASE
1032 exit ;; 1248 ;;
1033 i*86:*DOS:*:*) 1249 i*86:*DOS:*:*)
1034 echo ${UNAME_MACHINE}-pc-msdosdjgpp 1250 GUESS=$UNAME_MACHINE-pc-msdosdjgpp
1035 exit ;; 1251 ;;
1036 i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) 1252 i*86:*:4.*:*)
1037 UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` 1253 UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'`
1038 if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then 1254 if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
1039 echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} 1255 GUESS=$UNAME_MACHINE-univel-sysv$UNAME_REL
1040 else 1256 else
1041 echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} 1257 GUESS=$UNAME_MACHINE-pc-sysv$UNAME_REL
1042 fi 1258 fi
1043 exit ;; 1259 ;;
1044 i*86:*:5:[678]*) 1260 i*86:*:5:[678]*)
1045 # UnixWare 7.x, OpenUNIX and OpenServer 6. 1261 # UnixWare 7.x, OpenUNIX and OpenServer 6.
1046 case `/bin/uname -X | grep "^Machine"` in 1262 case `/bin/uname -X | grep "^Machine"` in
@@ -1048,12 +1264,12 @@ EOF
1048 *Pentium) UNAME_MACHINE=i586 ;; 1264 *Pentium) UNAME_MACHINE=i586 ;;
1049 *Pent*|*Celeron) UNAME_MACHINE=i686 ;; 1265 *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
1050 esac 1266 esac
1051 echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} 1267 GUESS=$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
1052 exit ;; 1268 ;;
1053 i*86:*:3.2:*) 1269 i*86:*:3.2:*)
1054 if test -f /usr/options/cb.name; then 1270 if test -f /usr/options/cb.name; then
1055 UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name` 1271 UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
1056 echo ${UNAME_MACHINE}-pc-isc$UNAME_REL 1272 GUESS=$UNAME_MACHINE-pc-isc$UNAME_REL
1057 elif /bin/uname -X 2>/dev/null >/dev/null ; then 1273 elif /bin/uname -X 2>/dev/null >/dev/null ; then
1058 UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` 1274 UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
1059 (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 1275 (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
@@ -1063,43 +1279,43 @@ EOF
1063 && UNAME_MACHINE=i686 1279 && UNAME_MACHINE=i686
1064 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ 1280 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
1065 && UNAME_MACHINE=i686 1281 && UNAME_MACHINE=i686
1066 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL 1282 GUESS=$UNAME_MACHINE-pc-sco$UNAME_REL
1067 else 1283 else
1068 echo ${UNAME_MACHINE}-pc-sysv32 1284 GUESS=$UNAME_MACHINE-pc-sysv32
1069 fi 1285 fi
1070 exit ;; 1286 ;;
1071 pc:*:*:*) 1287 pc:*:*:*)
1072 # Left here for compatibility: 1288 # Left here for compatibility:
1073 # uname -m prints for DJGPP always 'pc', but it prints nothing about 1289 # uname -m prints for DJGPP always 'pc', but it prints nothing about
1074 # the processor, so we play safe by assuming i586. 1290 # the processor, so we play safe by assuming i586.
1075 # Note: whatever this is, it MUST be the same as what config.sub 1291 # Note: whatever this is, it MUST be the same as what config.sub
1076 # prints for the "djgpp" host, or else GDB configury will decide that 1292 # prints for the "djgpp" host, or else GDB configure will decide that
1077 # this is a cross-build. 1293 # this is a cross-build.
1078 echo i586-pc-msdosdjgpp 1294 GUESS=i586-pc-msdosdjgpp
1079 exit ;; 1295 ;;
1080 Intel:Mach:3*:*) 1296 Intel:Mach:3*:*)
1081 echo i386-pc-mach3 1297 GUESS=i386-pc-mach3
1082 exit ;; 1298 ;;
1083 paragon:*:*:*) 1299 paragon:*:*:*)
1084 echo i860-intel-osf1 1300 GUESS=i860-intel-osf1
1085 exit ;; 1301 ;;
1086 i860:*:4.*:*) # i860-SVR4 1302 i860:*:4.*:*) # i860-SVR4
1087 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then 1303 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
1088 echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 1304 GUESS=i860-stardent-sysv$UNAME_RELEASE # Stardent Vistra i860-SVR4
1089 else # Add other i860-SVR4 vendors below as they are discovered. 1305 else # Add other i860-SVR4 vendors below as they are discovered.
1090 echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 1306 GUESS=i860-unknown-sysv$UNAME_RELEASE # Unknown i860-SVR4
1091 fi 1307 fi
1092 exit ;; 1308 ;;
1093 mini*:CTIX:SYS*5:*) 1309 mini*:CTIX:SYS*5:*)
1094 # "miniframe" 1310 # "miniframe"
1095 echo m68010-convergent-sysv 1311 GUESS=m68010-convergent-sysv
1096 exit ;; 1312 ;;
1097 mc68k:UNIX:SYSTEM5:3.51m) 1313 mc68k:UNIX:SYSTEM5:3.51m)
1098 echo m68k-convergent-sysv 1314 GUESS=m68k-convergent-sysv
1099 exit ;; 1315 ;;
1100 M680?0:D-NIX:5.3:*) 1316 M680?0:D-NIX:5.3:*)
1101 echo m68k-diab-dnix 1317 GUESS=m68k-diab-dnix
1102 exit ;; 1318 ;;
1103 M68*:*:R3V[5678]*:*) 1319 M68*:*:R3V[5678]*:*)
1104 test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 1320 test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
1105 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) 1321 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
@@ -1107,9 +1323,9 @@ EOF
1107 test -r /etc/.relid \ 1323 test -r /etc/.relid \
1108 && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` 1324 && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
1109 /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ 1325 /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1110 && { echo i486-ncr-sysv4.3${OS_REL}; exit; } 1326 && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
1111 /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ 1327 /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
1112 && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 1328 && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
1113 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) 1329 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
1114 /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ 1330 /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1115 && { echo i486-ncr-sysv4; exit; } ;; 1331 && { echo i486-ncr-sysv4; exit; } ;;
@@ -1118,226 +1334,287 @@ EOF
1118 test -r /etc/.relid \ 1334 test -r /etc/.relid \
1119 && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` 1335 && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
1120 /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ 1336 /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1121 && { echo i486-ncr-sysv4.3${OS_REL}; exit; } 1337 && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
1122 /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ 1338 /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
1123 && { echo i586-ncr-sysv4.3${OS_REL}; exit; } 1339 && { echo i586-ncr-sysv4.3"$OS_REL"; exit; }
1124 /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ 1340 /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
1125 && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 1341 && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
1126 m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) 1342 m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
1127 echo m68k-unknown-lynxos${UNAME_RELEASE} 1343 GUESS=m68k-unknown-lynxos$UNAME_RELEASE
1128 exit ;; 1344 ;;
1129 mc68030:UNIX_System_V:4.*:*) 1345 mc68030:UNIX_System_V:4.*:*)
1130 echo m68k-atari-sysv4 1346 GUESS=m68k-atari-sysv4
1131 exit ;; 1347 ;;
1132 TSUNAMI:LynxOS:2.*:*) 1348 TSUNAMI:LynxOS:2.*:*)
1133 echo sparc-unknown-lynxos${UNAME_RELEASE} 1349 GUESS=sparc-unknown-lynxos$UNAME_RELEASE
1134 exit ;; 1350 ;;
1135 rs6000:LynxOS:2.*:*) 1351 rs6000:LynxOS:2.*:*)
1136 echo rs6000-unknown-lynxos${UNAME_RELEASE} 1352 GUESS=rs6000-unknown-lynxos$UNAME_RELEASE
1137 exit ;; 1353 ;;
1138 PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) 1354 PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
1139 echo powerpc-unknown-lynxos${UNAME_RELEASE} 1355 GUESS=powerpc-unknown-lynxos$UNAME_RELEASE
1140 exit ;; 1356 ;;
1141 SM[BE]S:UNIX_SV:*:*) 1357 SM[BE]S:UNIX_SV:*:*)
1142 echo mips-dde-sysv${UNAME_RELEASE} 1358 GUESS=mips-dde-sysv$UNAME_RELEASE
1143 exit ;; 1359 ;;
1144 RM*:ReliantUNIX-*:*:*) 1360 RM*:ReliantUNIX-*:*:*)
1145 echo mips-sni-sysv4 1361 GUESS=mips-sni-sysv4
1146 exit ;; 1362 ;;
1147 RM*:SINIX-*:*:*) 1363 RM*:SINIX-*:*:*)
1148 echo mips-sni-sysv4 1364 GUESS=mips-sni-sysv4
1149 exit ;; 1365 ;;
1150 *:SINIX-*:*:*) 1366 *:SINIX-*:*:*)
1151 if uname -p 2>/dev/null >/dev/null ; then 1367 if uname -p 2>/dev/null >/dev/null ; then
1152 UNAME_MACHINE=`(uname -p) 2>/dev/null` 1368 UNAME_MACHINE=`(uname -p) 2>/dev/null`
1153 echo ${UNAME_MACHINE}-sni-sysv4 1369 GUESS=$UNAME_MACHINE-sni-sysv4
1154 else 1370 else
1155 echo ns32k-sni-sysv 1371 GUESS=ns32k-sni-sysv
1156 fi 1372 fi
1157 exit ;; 1373 ;;
1158 PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort 1374 PENTIUM:*:4.0*:*) # Unisys 'ClearPath HMP IX 4000' SVR4/MP effort
1159 # says <Richard.M.Bartel@ccMail.Census.GOV> 1375 # says <Richard.M.Bartel@ccMail.Census.GOV>
1160 echo i586-unisys-sysv4 1376 GUESS=i586-unisys-sysv4
1161 exit ;; 1377 ;;
1162 *:UNIX_System_V:4*:FTX*) 1378 *:UNIX_System_V:4*:FTX*)
1163 # From Gerald Hewes <hewes@openmarket.com>. 1379 # From Gerald Hewes <hewes@openmarket.com>.
1164 # How about differentiating between stratus architectures? -djm 1380 # How about differentiating between stratus architectures? -djm
1165 echo hppa1.1-stratus-sysv4 1381 GUESS=hppa1.1-stratus-sysv4
1166 exit ;; 1382 ;;
1167 *:*:*:FTX*) 1383 *:*:*:FTX*)
1168 # From seanf@swdc.stratus.com. 1384 # From seanf@swdc.stratus.com.
1169 echo i860-stratus-sysv4 1385 GUESS=i860-stratus-sysv4
1170 exit ;; 1386 ;;
1171 i*86:VOS:*:*) 1387 i*86:VOS:*:*)
1172 # From Paul.Green@stratus.com. 1388 # From Paul.Green@stratus.com.
1173 echo ${UNAME_MACHINE}-stratus-vos 1389 GUESS=$UNAME_MACHINE-stratus-vos
1174 exit ;; 1390 ;;
1175 *:VOS:*:*) 1391 *:VOS:*:*)
1176 # From Paul.Green@stratus.com. 1392 # From Paul.Green@stratus.com.
1177 echo hppa1.1-stratus-vos 1393 GUESS=hppa1.1-stratus-vos
1178 exit ;; 1394 ;;
1179 mc68*:A/UX:*:*) 1395 mc68*:A/UX:*:*)
1180 echo m68k-apple-aux${UNAME_RELEASE} 1396 GUESS=m68k-apple-aux$UNAME_RELEASE
1181 exit ;; 1397 ;;
1182 news*:NEWS-OS:6*:*) 1398 news*:NEWS-OS:6*:*)
1183 echo mips-sony-newsos6 1399 GUESS=mips-sony-newsos6
1184 exit ;; 1400 ;;
1185 R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) 1401 R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
1186 if [ -d /usr/nec ]; then 1402 if test -d /usr/nec; then
1187 echo mips-nec-sysv${UNAME_RELEASE} 1403 GUESS=mips-nec-sysv$UNAME_RELEASE
1188 else 1404 else
1189 echo mips-unknown-sysv${UNAME_RELEASE} 1405 GUESS=mips-unknown-sysv$UNAME_RELEASE
1190 fi 1406 fi
1191 exit ;; 1407 ;;
1192 BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. 1408 BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
1193 echo powerpc-be-beos 1409 GUESS=powerpc-be-beos
1194 exit ;; 1410 ;;
1195 BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. 1411 BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
1196 echo powerpc-apple-beos 1412 GUESS=powerpc-apple-beos
1197 exit ;; 1413 ;;
1198 BePC:BeOS:*:*) # BeOS running on Intel PC compatible. 1414 BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
1199 echo i586-pc-beos 1415 GUESS=i586-pc-beos
1200 exit ;; 1416 ;;
1201 BePC:Haiku:*:*) # Haiku running on Intel PC compatible. 1417 BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
1202 echo i586-pc-haiku 1418 GUESS=i586-pc-haiku
1203 exit ;; 1419 ;;
1420 ppc:Haiku:*:*) # Haiku running on Apple PowerPC
1421 GUESS=powerpc-apple-haiku
1422 ;;
1423 *:Haiku:*:*) # Haiku modern gcc (not bound by BeOS compat)
1424 GUESS=$UNAME_MACHINE-unknown-haiku
1425 ;;
1204 SX-4:SUPER-UX:*:*) 1426 SX-4:SUPER-UX:*:*)
1205 echo sx4-nec-superux${UNAME_RELEASE} 1427 GUESS=sx4-nec-superux$UNAME_RELEASE
1206 exit ;; 1428 ;;
1207 SX-5:SUPER-UX:*:*) 1429 SX-5:SUPER-UX:*:*)
1208 echo sx5-nec-superux${UNAME_RELEASE} 1430 GUESS=sx5-nec-superux$UNAME_RELEASE
1209 exit ;; 1431 ;;
1210 SX-6:SUPER-UX:*:*) 1432 SX-6:SUPER-UX:*:*)
1211 echo sx6-nec-superux${UNAME_RELEASE} 1433 GUESS=sx6-nec-superux$UNAME_RELEASE
1212 exit ;; 1434 ;;
1213 SX-7:SUPER-UX:*:*) 1435 SX-7:SUPER-UX:*:*)
1214 echo sx7-nec-superux${UNAME_RELEASE} 1436 GUESS=sx7-nec-superux$UNAME_RELEASE
1215 exit ;; 1437 ;;
1216 SX-8:SUPER-UX:*:*) 1438 SX-8:SUPER-UX:*:*)
1217 echo sx8-nec-superux${UNAME_RELEASE} 1439 GUESS=sx8-nec-superux$UNAME_RELEASE
1218 exit ;; 1440 ;;
1219 SX-8R:SUPER-UX:*:*) 1441 SX-8R:SUPER-UX:*:*)
1220 echo sx8r-nec-superux${UNAME_RELEASE} 1442 GUESS=sx8r-nec-superux$UNAME_RELEASE
1221 exit ;; 1443 ;;
1444 SX-ACE:SUPER-UX:*:*)
1445 GUESS=sxace-nec-superux$UNAME_RELEASE
1446 ;;
1222 Power*:Rhapsody:*:*) 1447 Power*:Rhapsody:*:*)
1223 echo powerpc-apple-rhapsody${UNAME_RELEASE} 1448 GUESS=powerpc-apple-rhapsody$UNAME_RELEASE
1224 exit ;; 1449 ;;
1225 *:Rhapsody:*:*) 1450 *:Rhapsody:*:*)
1226 echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} 1451 GUESS=$UNAME_MACHINE-apple-rhapsody$UNAME_RELEASE
1227 exit ;; 1452 ;;
1453 arm64:Darwin:*:*)
1454 GUESS=aarch64-apple-darwin$UNAME_RELEASE
1455 ;;
1228 *:Darwin:*:*) 1456 *:Darwin:*:*)
1229 UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown 1457 UNAME_PROCESSOR=`uname -p`
1230 case $UNAME_PROCESSOR in 1458 case $UNAME_PROCESSOR in
1231 i386)
1232 eval $set_cc_for_build
1233 if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
1234 if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
1235 (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
1236 grep IS_64BIT_ARCH >/dev/null
1237 then
1238 UNAME_PROCESSOR="x86_64"
1239 fi
1240 fi ;;
1241 unknown) UNAME_PROCESSOR=powerpc ;; 1459 unknown) UNAME_PROCESSOR=powerpc ;;
1242 esac 1460 esac
1243 echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} 1461 if command -v xcode-select > /dev/null 2> /dev/null && \
1244 exit ;; 1462 ! xcode-select --print-path > /dev/null 2> /dev/null ; then
1463 # Avoid executing cc if there is no toolchain installed as
1464 # cc will be a stub that puts up a graphical alert
1465 # prompting the user to install developer tools.
1466 CC_FOR_BUILD=no_compiler_found
1467 else
1468 set_cc_for_build
1469 fi
1470 if test "$CC_FOR_BUILD" != no_compiler_found; then
1471 if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
1472 (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
1473 grep IS_64BIT_ARCH >/dev/null
1474 then
1475 case $UNAME_PROCESSOR in
1476 i386) UNAME_PROCESSOR=x86_64 ;;
1477 powerpc) UNAME_PROCESSOR=powerpc64 ;;
1478 esac
1479 fi
1480 # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc
1481 if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \
1482 (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
1483 grep IS_PPC >/dev/null
1484 then
1485 UNAME_PROCESSOR=powerpc
1486 fi
1487 elif test "$UNAME_PROCESSOR" = i386 ; then
1488 # uname -m returns i386 or x86_64
1489 UNAME_PROCESSOR=$UNAME_MACHINE
1490 fi
1491 GUESS=$UNAME_PROCESSOR-apple-darwin$UNAME_RELEASE
1492 ;;
1245 *:procnto*:*:* | *:QNX:[0123456789]*:*) 1493 *:procnto*:*:* | *:QNX:[0123456789]*:*)
1246 UNAME_PROCESSOR=`uname -p` 1494 UNAME_PROCESSOR=`uname -p`
1247 if test "$UNAME_PROCESSOR" = "x86"; then 1495 if test "$UNAME_PROCESSOR" = x86; then
1248 UNAME_PROCESSOR=i386 1496 UNAME_PROCESSOR=i386
1249 UNAME_MACHINE=pc 1497 UNAME_MACHINE=pc
1250 fi 1498 fi
1251 echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} 1499 GUESS=$UNAME_PROCESSOR-$UNAME_MACHINE-nto-qnx$UNAME_RELEASE
1252 exit ;; 1500 ;;
1253 *:QNX:*:4*) 1501 *:QNX:*:4*)
1254 echo i386-pc-qnx 1502 GUESS=i386-pc-qnx
1255 exit ;; 1503 ;;
1256 NEO-?:NONSTOP_KERNEL:*:*) 1504 NEO-*:NONSTOP_KERNEL:*:*)
1257 echo neo-tandem-nsk${UNAME_RELEASE} 1505 GUESS=neo-tandem-nsk$UNAME_RELEASE
1258 exit ;; 1506 ;;
1259 NSE-*:NONSTOP_KERNEL:*:*) 1507 NSE-*:NONSTOP_KERNEL:*:*)
1260 echo nse-tandem-nsk${UNAME_RELEASE} 1508 GUESS=nse-tandem-nsk$UNAME_RELEASE
1261 exit ;; 1509 ;;
1262 NSR-?:NONSTOP_KERNEL:*:*) 1510 NSR-*:NONSTOP_KERNEL:*:*)
1263 echo nsr-tandem-nsk${UNAME_RELEASE} 1511 GUESS=nsr-tandem-nsk$UNAME_RELEASE
1264 exit ;; 1512 ;;
1513 NSV-*:NONSTOP_KERNEL:*:*)
1514 GUESS=nsv-tandem-nsk$UNAME_RELEASE
1515 ;;
1516 NSX-*:NONSTOP_KERNEL:*:*)
1517 GUESS=nsx-tandem-nsk$UNAME_RELEASE
1518 ;;
1265 *:NonStop-UX:*:*) 1519 *:NonStop-UX:*:*)
1266 echo mips-compaq-nonstopux 1520 GUESS=mips-compaq-nonstopux
1267 exit ;; 1521 ;;
1268 BS2000:POSIX*:*:*) 1522 BS2000:POSIX*:*:*)
1269 echo bs2000-siemens-sysv 1523 GUESS=bs2000-siemens-sysv
1270 exit ;; 1524 ;;
1271 DS/*:UNIX_System_V:*:*) 1525 DS/*:UNIX_System_V:*:*)
1272 echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} 1526 GUESS=$UNAME_MACHINE-$UNAME_SYSTEM-$UNAME_RELEASE
1273 exit ;; 1527 ;;
1274 *:Plan9:*:*) 1528 *:Plan9:*:*)
1275 # "uname -m" is not consistent, so use $cputype instead. 386 1529 # "uname -m" is not consistent, so use $cputype instead. 386
1276 # is converted to i386 for consistency with other x86 1530 # is converted to i386 for consistency with other x86
1277 # operating systems. 1531 # operating systems.
1278 if test "$cputype" = "386"; then 1532 if test "${cputype-}" = 386; then
1279 UNAME_MACHINE=i386 1533 UNAME_MACHINE=i386
1280 else 1534 elif test "x${cputype-}" != x; then
1281 UNAME_MACHINE="$cputype" 1535 UNAME_MACHINE=$cputype
1282 fi 1536 fi
1283 echo ${UNAME_MACHINE}-unknown-plan9 1537 GUESS=$UNAME_MACHINE-unknown-plan9
1284 exit ;; 1538 ;;
1285 *:TOPS-10:*:*) 1539 *:TOPS-10:*:*)
1286 echo pdp10-unknown-tops10 1540 GUESS=pdp10-unknown-tops10
1287 exit ;; 1541 ;;
1288 *:TENEX:*:*) 1542 *:TENEX:*:*)
1289 echo pdp10-unknown-tenex 1543 GUESS=pdp10-unknown-tenex
1290 exit ;; 1544 ;;
1291 KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) 1545 KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
1292 echo pdp10-dec-tops20 1546 GUESS=pdp10-dec-tops20
1293 exit ;; 1547 ;;
1294 XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) 1548 XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
1295 echo pdp10-xkl-tops20 1549 GUESS=pdp10-xkl-tops20
1296 exit ;; 1550 ;;
1297 *:TOPS-20:*:*) 1551 *:TOPS-20:*:*)
1298 echo pdp10-unknown-tops20 1552 GUESS=pdp10-unknown-tops20
1299 exit ;; 1553 ;;
1300 *:ITS:*:*) 1554 *:ITS:*:*)
1301 echo pdp10-unknown-its 1555 GUESS=pdp10-unknown-its
1302 exit ;; 1556 ;;
1303 SEI:*:*:SEIUX) 1557 SEI:*:*:SEIUX)
1304 echo mips-sei-seiux${UNAME_RELEASE} 1558 GUESS=mips-sei-seiux$UNAME_RELEASE
1305 exit ;; 1559 ;;
1306 *:DragonFly:*:*) 1560 *:DragonFly:*:*)
1307 echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` 1561 DRAGONFLY_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
1308 exit ;; 1562 GUESS=$UNAME_MACHINE-unknown-dragonfly$DRAGONFLY_REL
1563 ;;
1309 *:*VMS:*:*) 1564 *:*VMS:*:*)
1310 UNAME_MACHINE=`(uname -p) 2>/dev/null` 1565 UNAME_MACHINE=`(uname -p) 2>/dev/null`
1311 case "${UNAME_MACHINE}" in 1566 case $UNAME_MACHINE in
1312 A*) echo alpha-dec-vms ; exit ;; 1567 A*) GUESS=alpha-dec-vms ;;
1313 I*) echo ia64-dec-vms ; exit ;; 1568 I*) GUESS=ia64-dec-vms ;;
1314 V*) echo vax-dec-vms ; exit ;; 1569 V*) GUESS=vax-dec-vms ;;
1315 esac ;; 1570 esac ;;
1316 *:XENIX:*:SysV) 1571 *:XENIX:*:SysV)
1317 echo i386-pc-xenix 1572 GUESS=i386-pc-xenix
1318 exit ;; 1573 ;;
1319 i*86:skyos:*:*) 1574 i*86:skyos:*:*)
1320 echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' 1575 SKYOS_REL=`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`
1321 exit ;; 1576 GUESS=$UNAME_MACHINE-pc-skyos$SKYOS_REL
1577 ;;
1322 i*86:rdos:*:*) 1578 i*86:rdos:*:*)
1323 echo ${UNAME_MACHINE}-pc-rdos 1579 GUESS=$UNAME_MACHINE-pc-rdos
1324 exit ;; 1580 ;;
1325 i*86:AROS:*:*) 1581 i*86:Fiwix:*:*)
1326 echo ${UNAME_MACHINE}-pc-aros 1582 GUESS=$UNAME_MACHINE-pc-fiwix
1327 exit ;; 1583 ;;
1584 *:AROS:*:*)
1585 GUESS=$UNAME_MACHINE-unknown-aros
1586 ;;
1328 x86_64:VMkernel:*:*) 1587 x86_64:VMkernel:*:*)
1329 echo ${UNAME_MACHINE}-unknown-esx 1588 GUESS=$UNAME_MACHINE-unknown-esx
1330 exit ;; 1589 ;;
1590 amd64:Isilon\ OneFS:*:*)
1591 GUESS=x86_64-unknown-onefs
1592 ;;
1593 *:Unleashed:*:*)
1594 GUESS=$UNAME_MACHINE-unknown-unleashed$UNAME_RELEASE
1595 ;;
1331esac 1596esac
1332 1597
1333#echo '(No uname command or uname output not recognized.)' 1>&2 1598# Do we have a guess based on uname results?
1334#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 1599if test "x$GUESS" != x; then
1600 echo "$GUESS"
1601 exit
1602fi
1335 1603
1336eval $set_cc_for_build 1604# No uname command or uname output not recognized.
1337cat >$dummy.c <<EOF 1605set_cc_for_build
1606cat > "$dummy.c" <<EOF
1338#ifdef _SEQUENT_ 1607#ifdef _SEQUENT_
1339# include <sys/types.h> 1608#include <sys/types.h>
1340# include <sys/utsname.h> 1609#include <sys/utsname.h>
1610#endif
1611#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__)
1612#if defined (vax) || defined (__vax) || defined (__vax__) || defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__)
1613#include <signal.h>
1614#if defined(_SIZE_T_) || defined(SIGLOST)
1615#include <sys/utsname.h>
1616#endif
1617#endif
1341#endif 1618#endif
1342main () 1619main ()
1343{ 1620{
@@ -1350,20 +1627,12 @@ main ()
1350#include <sys/param.h> 1627#include <sys/param.h>
1351 printf ("m68k-sony-newsos%s\n", 1628 printf ("m68k-sony-newsos%s\n",
1352#ifdef NEWSOS4 1629#ifdef NEWSOS4
1353 "4" 1630 "4"
1354#else 1631#else
1355 "" 1632 ""
1356#endif
1357 ); exit (0);
1358#endif 1633#endif
1634 ); exit (0);
1359#endif 1635#endif
1360
1361#if defined (__arm) && defined (__acorn) && defined (__unix)
1362 printf ("arm-acorn-riscix\n"); exit (0);
1363#endif
1364
1365#if defined (hp300) && !defined (hpux)
1366 printf ("m68k-hp-bsd\n"); exit (0);
1367#endif 1636#endif
1368 1637
1369#if defined (NeXT) 1638#if defined (NeXT)
@@ -1405,39 +1674,54 @@ main ()
1405#endif 1674#endif
1406 1675
1407#if defined (_SEQUENT_) 1676#if defined (_SEQUENT_)
1408 struct utsname un; 1677 struct utsname un;
1409
1410 uname(&un);
1411
1412 if (strncmp(un.version, "V2", 2) == 0) {
1413 printf ("i386-sequent-ptx2\n"); exit (0);
1414 }
1415 if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
1416 printf ("i386-sequent-ptx1\n"); exit (0);
1417 }
1418 printf ("i386-sequent-ptx\n"); exit (0);
1419 1678
1679 uname(&un);
1680 if (strncmp(un.version, "V2", 2) == 0) {
1681 printf ("i386-sequent-ptx2\n"); exit (0);
1682 }
1683 if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
1684 printf ("i386-sequent-ptx1\n"); exit (0);
1685 }
1686 printf ("i386-sequent-ptx\n"); exit (0);
1420#endif 1687#endif
1421 1688
1422#if defined (vax) 1689#if defined (vax)
1423# if !defined (ultrix) 1690#if !defined (ultrix)
1424# include <sys/param.h> 1691#include <sys/param.h>
1425# if defined (BSD) 1692#if defined (BSD)
1426# if BSD == 43 1693#if BSD == 43
1427 printf ("vax-dec-bsd4.3\n"); exit (0); 1694 printf ("vax-dec-bsd4.3\n"); exit (0);
1428# else 1695#else
1429# if BSD == 199006 1696#if BSD == 199006
1430 printf ("vax-dec-bsd4.3reno\n"); exit (0); 1697 printf ("vax-dec-bsd4.3reno\n"); exit (0);
1431# else 1698#else
1432 printf ("vax-dec-bsd\n"); exit (0); 1699 printf ("vax-dec-bsd\n"); exit (0);
1433# endif 1700#endif
1434# endif 1701#endif
1435# else 1702#else
1436 printf ("vax-dec-bsd\n"); exit (0); 1703 printf ("vax-dec-bsd\n"); exit (0);
1437# endif 1704#endif
1438# else 1705#else
1439 printf ("vax-dec-ultrix\n"); exit (0); 1706#if defined(_SIZE_T_) || defined(SIGLOST)
1440# endif 1707 struct utsname un;
1708 uname (&un);
1709 printf ("vax-dec-ultrix%s\n", un.release); exit (0);
1710#else
1711 printf ("vax-dec-ultrix\n"); exit (0);
1712#endif
1713#endif
1714#endif
1715#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__)
1716#if defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__)
1717#if defined(_SIZE_T_) || defined(SIGLOST)
1718 struct utsname *un;
1719 uname (&un);
1720 printf ("mips-dec-ultrix%s\n", un.release); exit (0);
1721#else
1722 printf ("mips-dec-ultrix\n"); exit (0);
1723#endif
1724#endif
1441#endif 1725#endif
1442 1726
1443#if defined (alliant) && defined (i860) 1727#if defined (alliant) && defined (i860)
@@ -1448,54 +1732,46 @@ main ()
1448} 1732}
1449EOF 1733EOF
1450 1734
1451$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && 1735$CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=`"$dummy"` &&
1452 { echo "$SYSTEM_NAME"; exit; } 1736 { echo "$SYSTEM_NAME"; exit; }
1453 1737
1454# Apollos put the system type in the environment. 1738# Apollos put the system type in the environment.
1739test -d /usr/apollo && { echo "$ISP-apollo-$SYSTYPE"; exit; }
1455 1740
1456test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } 1741echo "$0: unable to guess system type" >&2
1457 1742
1458# Convex versions that predate uname can use getsysinfo(1) 1743case $UNAME_MACHINE:$UNAME_SYSTEM in
1744 mips:Linux | mips64:Linux)
1745 # If we got here on MIPS GNU/Linux, output extra information.
1746 cat >&2 <<EOF
1459 1747
1460if [ -x /usr/convex/getsysinfo ] 1748NOTE: MIPS GNU/Linux systems require a C compiler to fully recognize
1461then 1749the system type. Please install a C compiler and try again.
1462 case `getsysinfo -f cpu_type` in 1750EOF
1463 c1*) 1751 ;;
1464 echo c1-convex-bsd 1752esac
1465 exit ;;
1466 c2*)
1467 if getsysinfo -f scalar_acc
1468 then echo c32-convex-bsd
1469 else echo c2-convex-bsd
1470 fi
1471 exit ;;
1472 c34*)
1473 echo c34-convex-bsd
1474 exit ;;
1475 c38*)
1476 echo c38-convex-bsd
1477 exit ;;
1478 c4*)
1479 echo c4-convex-bsd
1480 exit ;;
1481 esac
1482fi
1483 1753
1484cat >&2 <<EOF 1754cat >&2 <<EOF
1485$0: unable to guess system type
1486 1755
1487This script, last modified $timestamp, has failed to recognize 1756This script (version $timestamp), has failed to recognize the
1488the operating system you are using. It is advised that you 1757operating system you are using. If your script is old, overwrite *all*
1489download the most up to date version of the config scripts from 1758copies of config.guess and config.sub with the latest versions from:
1490 1759
1491 http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD 1760 https://git.savannah.gnu.org/cgit/config.git/plain/config.guess
1492and 1761and
1493 http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD 1762 https://git.savannah.gnu.org/cgit/config.git/plain/config.sub
1763EOF
1494 1764
1495If the version you run ($0) is already up to date, please 1765our_year=`echo $timestamp | sed 's,-.*,,'`
1496send the following data and any information you think might be 1766thisyear=`date +%Y`
1497pertinent to <config-patches@gnu.org> in order to provide the needed 1767# shellcheck disable=SC2003
1498information to handle your system. 1768script_age=`expr "$thisyear" - "$our_year"`
1769if test "$script_age" -lt 3 ; then
1770 cat >&2 <<EOF
1771
1772If $0 has already been updated, send the following data and any
1773information you think might be pertinent to config-patches@gnu.org to
1774provide the necessary information to handle your system.
1499 1775
1500config.guess timestamp = $timestamp 1776config.guess timestamp = $timestamp
1501 1777
@@ -1514,16 +1790,17 @@ hostinfo = `(hostinfo) 2>/dev/null`
1514/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` 1790/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
1515/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` 1791/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
1516 1792
1517UNAME_MACHINE = ${UNAME_MACHINE} 1793UNAME_MACHINE = "$UNAME_MACHINE"
1518UNAME_RELEASE = ${UNAME_RELEASE} 1794UNAME_RELEASE = "$UNAME_RELEASE"
1519UNAME_SYSTEM = ${UNAME_SYSTEM} 1795UNAME_SYSTEM = "$UNAME_SYSTEM"
1520UNAME_VERSION = ${UNAME_VERSION} 1796UNAME_VERSION = "$UNAME_VERSION"
1521EOF 1797EOF
1798fi
1522 1799
1523exit 1 1800exit 1
1524 1801
1525# Local variables: 1802# Local variables:
1526# eval: (add-hook 'write-file-hooks 'time-stamp) 1803# eval: (add-hook 'before-save-hook 'time-stamp)
1527# time-stamp-start: "timestamp='" 1804# time-stamp-start: "timestamp='"
1528# time-stamp-format: "%:y-%02m-%02d" 1805# time-stamp-format: "%:y-%02m-%02d"
1529# time-stamp-end: "'" 1806# time-stamp-end: "'"