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