blob: ed69d4ea2de6e5b29c780c6ffdc0ab87e7c1d704 [file] [log] [blame]
lh9ed821d2023-04-07 01:36:19 -07001#! /bin/sh
2#
3# for now we hard code this as not all systems are compatible with the
4# configure scripts in teh tree.
5#
6
7# Attempt to guess a canonical system name.
8# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
9# 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
10
11timestamp='2004-09-07'
12
13# This file is free software; you can redistribute it and/or modify it
14# under the terms of the GNU General Public License as published by
15# the Free Software Foundation; either version 2 of the License, or
16# (at your option) any later version.
17#
18# This program is distributed in the hope that it will be useful, but
19# WITHOUT ANY WARRANTY; without even the implied warranty of
20# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21# General Public License for more details.
22#
23# You should have received a copy of the GNU General Public License
24# along with this program; if not, write to the Free Software
25# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
26#
27# As a special exception to the GNU General Public License, if you
28# distribute this file as part of a program that contains a
29# configuration script generated by Autoconf, you may include it under
30# the same distribution terms that you use for the rest of that program.
31
32# Originally written by Per Bothner <per@bothner.com>.
33# Please send patches to <config-patches@gnu.org>. Submit a context
34# diff and a properly formatted ChangeLog entry.
35#
36# This script attempts to guess a canonical system name similar to
37# config.sub. If it succeeds, it prints the system name on stdout, and
38# exits with 0. Otherwise, it exits with 1.
39#
40# The plan is that this can be called by configure scripts if you
41# don't specify an explicit build system type.
42
43me=`echo "$0" | sed -e 's,.*/,,'`
44
45usage="\
46Usage: $0 [OPTION]
47
48Output the configuration name of the system \`$me' is run on.
49
50Operation modes:
51 -h, --help print this help, then exit
52 -t, --time-stamp print date of last modification, then exit
53 -v, --version print version number, then exit
54
55Report bugs and patches to <config-patches@gnu.org>."
56
57version="\
58GNU config.guess ($timestamp)
59
60Originally written by Per Bothner.
61Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
62Free Software Foundation, Inc.
63
64This is free software; see the source for copying conditions. There is NO
65warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
66
67help="
68Try \`$me --help' for more information."
69
70# Parse command line
71while test $# -gt 0 ; do
72 case $1 in
73 --time-stamp | --time* | -t )
74 echo "$timestamp" ; exit 0 ;;
75 --version | -v )
76 echo "$version" ; exit 0 ;;
77 --help | --h* | -h )
78 echo "$usage"; exit 0 ;;
79 -- ) # Stop option processing
80 shift; break ;;
81 - ) # Use stdin as input.
82 break ;;
83 -* )
84 echo "$me: invalid option $1$help" >&2
85 exit 1 ;;
86 * )
87 break ;;
88 esac
89done
90
91if test $# != 0; then
92 echo "$me: too many arguments$help" >&2
93 exit 1
94fi
95
96trap 'exit 1' 1 2 15
97
98# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
99# compiler to aid in system detection is discouraged as it requires
100# temporary files to be created and, as you can see below, it is a
101# headache to deal with in a portable fashion.
102
103# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
104# use `HOST_CC' if defined, but it is deprecated.
105
106# Portable tmp directory creation inspired by the Autoconf team.
107
108set_cc_for_build='
109trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
110trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
111: ${TMPDIR=/tmp} ;
112 { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
113 { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
114 { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
115 { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
116dummy=$tmp/dummy ;
117tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
118case $CC_FOR_BUILD,$HOST_CC,$CC in
119 ,,) echo "int x;" > $dummy.c ;
120 for c in cc gcc c89 c99 ; do
121 if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
122 CC_FOR_BUILD="$c"; break ;
123 fi ;
124 done ;
125 if test x"$CC_FOR_BUILD" = x ; then
126 CC_FOR_BUILD=no_compiler_found ;
127 fi
128 ;;
129 ,,*) CC_FOR_BUILD=$CC ;;
130 ,*,*) CC_FOR_BUILD=$HOST_CC ;;
131esac ;'
132
133# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
134# (ghazi@noc.rutgers.edu 1994-08-24)
135if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
136 PATH=$PATH:/.attbin ; export PATH
137fi
138
139UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
140UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
141UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
142UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
143
144# Note: order is significant - the case branches are not exclusive.
145
146case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
147 *:NetBSD:*:*)
148 # NetBSD (nbsd) targets should (where applicable) match one or
149 # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
150 # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
151 # switched to ELF, *-*-netbsd* would select the old
152 # object file format. This provides both forward
153 # compatibility and a consistent mechanism for selecting the
154 # object file format.
155 #
156 # Note: NetBSD doesn't particularly care about the vendor
157 # portion of the name. We always set it to "unknown".
158 sysctl="sysctl -n hw.machine_arch"
159 UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
160 /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
161 case "${UNAME_MACHINE_ARCH}" in
162 armeb) machine=armeb-unknown ;;
163 arm*) machine=arm-unknown ;;
164 sh3el) machine=shl-unknown ;;
165 sh3eb) machine=sh-unknown ;;
166 *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
167 esac
168 # The Operating System including object format, if it has switched
169 # to ELF recently, or will in the future.
170 case "${UNAME_MACHINE_ARCH}" in
171 arm*|i386|m68k|ns32k|sh3*|sparc|vax)
172 eval $set_cc_for_build
173 if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
174 | grep __ELF__ >/dev/null
175 then
176 # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
177 # Return netbsd for either. FIX?
178 os=netbsd
179 else
180 os=netbsdelf
181 fi
182 ;;
183 *)
184 os=netbsd
185 ;;
186 esac
187 # The OS release
188 # Debian GNU/NetBSD machines have a different userland, and
189 # thus, need a distinct triplet. However, they do not need
190 # kernel version information, so it can be replaced with a
191 # suitable tag, in the style of linux-gnu.
192 case "${UNAME_VERSION}" in
193 Debian*)
194 release='-gnu'
195 ;;
196 *)
197 release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
198 ;;
199 esac
200 # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
201 # contains redundant information, the shorter form:
202 # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
203 echo "${machine}-${os}${release}"
204 exit 0 ;;
205 amd64:OpenBSD:*:*)
206 echo x86_64-unknown-openbsd${UNAME_RELEASE}
207 exit 0 ;;
208 amiga:OpenBSD:*:*)
209 echo m68k-unknown-openbsd${UNAME_RELEASE}
210 exit 0 ;;
211 cats:OpenBSD:*:*)
212 echo arm-unknown-openbsd${UNAME_RELEASE}
213 exit 0 ;;
214 hp300:OpenBSD:*:*)
215 echo m68k-unknown-openbsd${UNAME_RELEASE}
216 exit 0 ;;
217 luna88k:OpenBSD:*:*)
218 echo m88k-unknown-openbsd${UNAME_RELEASE}
219 exit 0 ;;
220 mac68k:OpenBSD:*:*)
221 echo m68k-unknown-openbsd${UNAME_RELEASE}
222 exit 0 ;;
223 macppc:OpenBSD:*:*)
224 echo powerpc-unknown-openbsd${UNAME_RELEASE}
225 exit 0 ;;
226 mvme68k:OpenBSD:*:*)
227 echo m68k-unknown-openbsd${UNAME_RELEASE}
228 exit 0 ;;
229 mvme88k:OpenBSD:*:*)
230 echo m88k-unknown-openbsd${UNAME_RELEASE}
231 exit 0 ;;
232 mvmeppc:OpenBSD:*:*)
233 echo powerpc-unknown-openbsd${UNAME_RELEASE}
234 exit 0 ;;
235 sgi:OpenBSD:*:*)
236 echo mips64-unknown-openbsd${UNAME_RELEASE}
237 exit 0 ;;
238 sun3:OpenBSD:*:*)
239 echo m68k-unknown-openbsd${UNAME_RELEASE}
240 exit 0 ;;
241 *:OpenBSD:*:*)
242 echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE}
243 exit 0 ;;
244 *:ekkoBSD:*:*)
245 echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
246 exit 0 ;;
247 macppc:MirBSD:*:*)
248 echo powerppc-unknown-mirbsd${UNAME_RELEASE}
249 exit 0 ;;
250 *:MirBSD:*:*)
251 echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
252 exit 0 ;;
253 alpha:OSF1:*:*)
254 case $UNAME_RELEASE in
255 *4.0)
256 UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
257 ;;
258 *5.*)
259 UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
260 ;;
261 esac
262 # According to Compaq, /usr/sbin/psrinfo has been available on
263 # OSF/1 and Tru64 systems produced since 1995. I hope that
264 # covers most systems running today. This code pipes the CPU
265 # types through head -n 1, so we only detect the type of CPU 0.
266 ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
267 case "$ALPHA_CPU_TYPE" in
268 "EV4 (21064)")
269 UNAME_MACHINE="alpha" ;;
270 "EV4.5 (21064)")
271 UNAME_MACHINE="alpha" ;;
272 "LCA4 (21066/21068)")
273 UNAME_MACHINE="alpha" ;;
274 "EV5 (21164)")
275 UNAME_MACHINE="alphaev5" ;;
276 "EV5.6 (21164A)")
277 UNAME_MACHINE="alphaev56" ;;
278 "EV5.6 (21164PC)")
279 UNAME_MACHINE="alphapca56" ;;
280 "EV5.7 (21164PC)")
281 UNAME_MACHINE="alphapca57" ;;
282 "EV6 (21264)")
283 UNAME_MACHINE="alphaev6" ;;
284 "EV6.7 (21264A)")
285 UNAME_MACHINE="alphaev67" ;;
286 "EV6.8CB (21264C)")
287 UNAME_MACHINE="alphaev68" ;;
288 "EV6.8AL (21264B)")
289 UNAME_MACHINE="alphaev68" ;;
290 "EV6.8CX (21264D)")
291 UNAME_MACHINE="alphaev68" ;;
292 "EV6.9A (21264/EV69A)")
293 UNAME_MACHINE="alphaev69" ;;
294 "EV7 (21364)")
295 UNAME_MACHINE="alphaev7" ;;
296 "EV7.9 (21364A)")
297 UNAME_MACHINE="alphaev79" ;;
298 esac
299 # A Pn.n version is a patched version.
300 # A Vn.n version is a released version.
301 # A Tn.n version is a released field test version.
302 # A Xn.n version is an unreleased experimental baselevel.
303 # 1.2 uses "1.2" for uname -r.
304 echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
305 exit 0 ;;
306 Alpha\ *:Windows_NT*:*)
307 # How do we know it's Interix rather than the generic POSIX subsystem?
308 # Should we change UNAME_MACHINE based on the output of uname instead
309 # of the specific Alpha model?
310 echo alpha-pc-interix
311 exit 0 ;;
312 21064:Windows_NT:50:3)
313 echo alpha-dec-winnt3.5
314 exit 0 ;;
315 Amiga*:UNIX_System_V:4.0:*)
316 echo m68k-unknown-sysv4
317 exit 0;;
318 *:[Aa]miga[Oo][Ss]:*:*)
319 echo ${UNAME_MACHINE}-unknown-amigaos
320 exit 0 ;;
321 *:[Mm]orph[Oo][Ss]:*:*)
322 echo ${UNAME_MACHINE}-unknown-morphos
323 exit 0 ;;
324 *:OS/390:*:*)
325 echo i370-ibm-openedition
326 exit 0 ;;
327 *:OS400:*:*)
328 echo powerpc-ibm-os400
329 exit 0 ;;
330 arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
331 echo arm-acorn-riscix${UNAME_RELEASE}
332 exit 0;;
333 SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
334 echo hppa1.1-hitachi-hiuxmpp
335 exit 0;;
336 Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
337 # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
338 if test "`(/bin/universe) 2>/dev/null`" = att ; then
339 echo pyramid-pyramid-sysv3
340 else
341 echo pyramid-pyramid-bsd
342 fi
343 exit 0 ;;
344 NILE*:*:*:dcosx)
345 echo pyramid-pyramid-svr4
346 exit 0 ;;
347 DRS?6000:unix:4.0:6*)
348 echo sparc-icl-nx6
349 exit 0 ;;
350 DRS?6000:UNIX_SV:4.2*:7*)
351 case `/usr/bin/uname -p` in
352 sparc) echo sparc-icl-nx7 && exit 0 ;;
353 esac ;;
354 sun4H:SunOS:5.*:*)
355 echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
356 exit 0 ;;
357 sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
358 echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
359 exit 0 ;;
360 i86pc:SunOS:5.*:*)
361 echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
362 exit 0 ;;
363 sun4*:SunOS:6*:*)
364 # According to config.sub, this is the proper way to canonicalize
365 # SunOS6. Hard to guess exactly what SunOS6 will be like, but
366 # it's likely to be more like Solaris than SunOS4.
367 echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
368 exit 0 ;;
369 sun4*:SunOS:*:*)
370 case "`/usr/bin/arch -k`" in
371 Series*|S4*)
372 UNAME_RELEASE=`uname -v`
373 ;;
374 esac
375 # Japanese Language versions have a version number like `4.1.3-JL'.
376 echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
377 exit 0 ;;
378 sun3*:SunOS:*:*)
379 echo m68k-sun-sunos${UNAME_RELEASE}
380 exit 0 ;;
381 sun*:*:4.2BSD:*)
382 UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
383 test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
384 case "`/bin/arch`" in
385 sun3)
386 echo m68k-sun-sunos${UNAME_RELEASE}
387 ;;
388 sun4)
389 echo sparc-sun-sunos${UNAME_RELEASE}
390 ;;
391 esac
392 exit 0 ;;
393 aushp:SunOS:*:*)
394 echo sparc-auspex-sunos${UNAME_RELEASE}
395 exit 0 ;;
396 # The situation for MiNT is a little confusing. The machine name
397 # can be virtually everything (everything which is not
398 # "atarist" or "atariste" at least should have a processor
399 # > m68000). The system name ranges from "MiNT" over "FreeMiNT"
400 # to the lowercase version "mint" (or "freemint"). Finally
401 # the system name "TOS" denotes a system which is actually not
402 # MiNT. But MiNT is downward compatible to TOS, so this should
403 # be no problem.
404 atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
405 echo m68k-atari-mint${UNAME_RELEASE}
406 exit 0 ;;
407 atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
408 echo m68k-atari-mint${UNAME_RELEASE}
409 exit 0 ;;
410 *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
411 echo m68k-atari-mint${UNAME_RELEASE}
412 exit 0 ;;
413 milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
414 echo m68k-milan-mint${UNAME_RELEASE}
415 exit 0 ;;
416 hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
417 echo m68k-hades-mint${UNAME_RELEASE}
418 exit 0 ;;
419 *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
420 echo m68k-unknown-mint${UNAME_RELEASE}
421 exit 0 ;;
422 m68k:machten:*:*)
423 echo m68k-apple-machten${UNAME_RELEASE}
424 exit 0 ;;
425 powerpc:machten:*:*)
426 echo powerpc-apple-machten${UNAME_RELEASE}
427 exit 0 ;;
428 RISC*:Mach:*:*)
429 echo mips-dec-mach_bsd4.3
430 exit 0 ;;
431 RISC*:ULTRIX:*:*)
432 echo mips-dec-ultrix${UNAME_RELEASE}
433 exit 0 ;;
434 VAX*:ULTRIX*:*:*)
435 echo vax-dec-ultrix${UNAME_RELEASE}
436 exit 0 ;;
437 2020:CLIX:*:* | 2430:CLIX:*:*)
438 echo clipper-intergraph-clix${UNAME_RELEASE}
439 exit 0 ;;
440 mips:*:*:UMIPS | mips:*:*:RISCos)
441 eval $set_cc_for_build
442 sed 's/^ //' << EOF >$dummy.c
443#ifdef __cplusplus
444#include <stdio.h> /* for printf() prototype */
445 int main (int argc, char *argv[]) {
446#else
447 int main (argc, argv) int argc; char *argv[]; {
448#endif
449 #if defined (host_mips) && defined (MIPSEB)
450 #if defined (SYSTYPE_SYSV)
451 printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
452 #endif
453 #if defined (SYSTYPE_SVR4)
454 printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
455 #endif
456 #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
457 printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
458 #endif
459 #endif
460 exit (-1);
461 }
462EOF
463 $CC_FOR_BUILD -o $dummy $dummy.c \
464 && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
465 && exit 0
466 echo mips-mips-riscos${UNAME_RELEASE}
467 exit 0 ;;
468 Motorola:PowerMAX_OS:*:*)
469 echo powerpc-motorola-powermax
470 exit 0 ;;
471 Motorola:*:4.3:PL8-*)
472 echo powerpc-harris-powermax
473 exit 0 ;;
474 Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
475 echo powerpc-harris-powermax
476 exit 0 ;;
477 Night_Hawk:Power_UNIX:*:*)
478 echo powerpc-harris-powerunix
479 exit 0 ;;
480 m88k:CX/UX:7*:*)
481 echo m88k-harris-cxux7
482 exit 0 ;;
483 m88k:*:4*:R4*)
484 echo m88k-motorola-sysv4
485 exit 0 ;;
486 m88k:*:3*:R3*)
487 echo m88k-motorola-sysv3
488 exit 0 ;;
489 AViiON:dgux:*:*)
490 # DG/UX returns AViiON for all architectures
491 UNAME_PROCESSOR=`/usr/bin/uname -p`
492 if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
493 then
494 if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
495 [ ${TARGET_BINARY_INTERFACE}x = x ]
496 then
497 echo m88k-dg-dgux${UNAME_RELEASE}
498 else
499 echo m88k-dg-dguxbcs${UNAME_RELEASE}
500 fi
501 else
502 echo i586-dg-dgux${UNAME_RELEASE}
503 fi
504 exit 0 ;;
505 M88*:DolphinOS:*:*) # DolphinOS (SVR3)
506 echo m88k-dolphin-sysv3
507 exit 0 ;;
508 M88*:*:R3*:*)
509 # Delta 88k system running SVR3
510 echo m88k-motorola-sysv3
511 exit 0 ;;
512 XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
513 echo m88k-tektronix-sysv3
514 exit 0 ;;
515 Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
516 echo m68k-tektronix-bsd
517 exit 0 ;;
518 *:IRIX*:*:*)
519 echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
520 exit 0 ;;
521 ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
522 echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
523 exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX '
524 i*86:AIX:*:*)
525 echo i386-ibm-aix
526 exit 0 ;;
527 ia64:AIX:*:*)
528 if [ -x /usr/bin/oslevel ] ; then
529 IBM_REV=`/usr/bin/oslevel`
530 else
531 IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
532 fi
533 echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
534 exit 0 ;;
535 *:AIX:2:3)
536 if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
537 eval $set_cc_for_build
538 sed 's/^ //' << EOF >$dummy.c
539 #include <sys/systemcfg.h>
540
541 main()
542 {
543 if (!__power_pc())
544 exit(1);
545 puts("powerpc-ibm-aix3.2.5");
546 exit(0);
547 }
548EOF
549 $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
550 echo rs6000-ibm-aix3.2.5
551 elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
552 echo rs6000-ibm-aix3.2.4
553 else
554 echo rs6000-ibm-aix3.2
555 fi
556 exit 0 ;;
557 *:AIX:*:[45])
558 IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
559 if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
560 IBM_ARCH=rs6000
561 else
562 IBM_ARCH=powerpc
563 fi
564 if [ -x /usr/bin/oslevel ] ; then
565 IBM_REV=`/usr/bin/oslevel`
566 else
567 IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
568 fi
569 echo ${IBM_ARCH}-ibm-aix${IBM_REV}
570 exit 0 ;;
571 *:AIX:*:*)
572 echo rs6000-ibm-aix
573 exit 0 ;;
574 ibmrt:4.4BSD:*|romp-ibm:BSD:*)
575 echo romp-ibm-bsd4.4
576 exit 0 ;;
577 ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
578 echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
579 exit 0 ;; # report: romp-ibm BSD 4.3
580 *:BOSX:*:*)
581 echo rs6000-bull-bosx
582 exit 0 ;;
583 DPX/2?00:B.O.S.:*:*)
584 echo m68k-bull-sysv3
585 exit 0 ;;
586 9000/[34]??:4.3bsd:1.*:*)
587 echo m68k-hp-bsd
588 exit 0 ;;
589 hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
590 echo m68k-hp-bsd4.4
591 exit 0 ;;
592 9000/[34678]??:HP-UX:*:*)
593 HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
594 case "${UNAME_MACHINE}" in
595 9000/31? ) HP_ARCH=m68000 ;;
596 9000/[34]?? ) HP_ARCH=m68k ;;
597 9000/[678][0-9][0-9])
598 if [ -x /usr/bin/getconf ]; then
599 sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
600 sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
601 case "${sc_cpu_version}" in
602 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
603 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
604 532) # CPU_PA_RISC2_0
605 case "${sc_kernel_bits}" in
606 32) HP_ARCH="hppa2.0n" ;;
607 64) HP_ARCH="hppa2.0w" ;;
608 '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
609 esac ;;
610 esac
611 fi
612 if [ "${HP_ARCH}" = "" ]; then
613 eval $set_cc_for_build
614 sed 's/^ //' << EOF >$dummy.c
615
616 #define _HPUX_SOURCE
617 #include <stdlib.h>
618 #include <unistd.h>
619
620 int main ()
621 {
622 #if defined(_SC_KERNEL_BITS)
623 long bits = sysconf(_SC_KERNEL_BITS);
624 #endif
625 long cpu = sysconf (_SC_CPU_VERSION);
626
627 switch (cpu)
628 {
629 case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
630 case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
631 case CPU_PA_RISC2_0:
632 #if defined(_SC_KERNEL_BITS)
633 switch (bits)
634 {
635 case 64: puts ("hppa2.0w"); break;
636 case 32: puts ("hppa2.0n"); break;
637 default: puts ("hppa2.0"); break;
638 } break;
639 #else /* !defined(_SC_KERNEL_BITS) */
640 puts ("hppa2.0"); break;
641 #endif
642 default: puts ("hppa1.0"); break;
643 }
644 exit (0);
645 }
646EOF
647 (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
648 test -z "$HP_ARCH" && HP_ARCH=hppa
649 fi ;;
650 esac
651 if [ ${HP_ARCH} = "hppa2.0w" ]
652 then
653 # avoid double evaluation of $set_cc_for_build
654 test -n "$CC_FOR_BUILD" || eval $set_cc_for_build
655 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null
656 then
657 HP_ARCH="hppa2.0w"
658 else
659 HP_ARCH="hppa64"
660 fi
661 fi
662 echo ${HP_ARCH}-hp-hpux${HPUX_REV}
663 exit 0 ;;
664 ia64:HP-UX:*:*)
665 HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
666 echo ia64-hp-hpux${HPUX_REV}
667 exit 0 ;;
668 3050*:HI-UX:*:*)
669 eval $set_cc_for_build
670 sed 's/^ //' << EOF >$dummy.c
671 #include <unistd.h>
672 int
673 main ()
674 {
675 long cpu = sysconf (_SC_CPU_VERSION);
676 /* The order matters, because CPU_IS_HP_MC68K erroneously returns
677 true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
678 results, however. */
679 if (CPU_IS_PA_RISC (cpu))
680 {
681 switch (cpu)
682 {
683 case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
684 case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
685 case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
686 default: puts ("hppa-hitachi-hiuxwe2"); break;
687 }
688 }
689 else if (CPU_IS_HP_MC68K (cpu))
690 puts ("m68k-hitachi-hiuxwe2");
691 else puts ("unknown-hitachi-hiuxwe2");
692 exit (0);
693 }
694EOF
695 $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
696 echo unknown-hitachi-hiuxwe2
697 exit 0 ;;
698 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
699 echo hppa1.1-hp-bsd
700 exit 0 ;;
701 9000/8??:4.3bsd:*:*)
702 echo hppa1.0-hp-bsd
703 exit 0 ;;
704 *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
705 echo hppa1.0-hp-mpeix
706 exit 0 ;;
707 hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
708 echo hppa1.1-hp-osf
709 exit 0 ;;
710 hp8??:OSF1:*:*)
711 echo hppa1.0-hp-osf
712 exit 0 ;;
713 i*86:OSF1:*:*)
714 if [ -x /usr/sbin/sysversion ] ; then
715 echo ${UNAME_MACHINE}-unknown-osf1mk
716 else
717 echo ${UNAME_MACHINE}-unknown-osf1
718 fi
719 exit 0 ;;
720 parisc*:Lites*:*:*)
721 echo hppa1.1-hp-lites
722 exit 0 ;;
723 C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
724 echo c1-convex-bsd
725 exit 0 ;;
726 C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
727 if getsysinfo -f scalar_acc
728 then echo c32-convex-bsd
729 else echo c2-convex-bsd
730 fi
731 exit 0 ;;
732 C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
733 echo c34-convex-bsd
734 exit 0 ;;
735 C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
736 echo c38-convex-bsd
737 exit 0 ;;
738 C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
739 echo c4-convex-bsd
740 exit 0 ;;
741 CRAY*Y-MP:*:*:*)
742 echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
743 exit 0 ;;
744 CRAY*[A-Z]90:*:*:*)
745 echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
746 | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
747 -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
748 -e 's/\.[^.]*$/.X/'
749 exit 0 ;;
750 CRAY*TS:*:*:*)
751 echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
752 exit 0 ;;
753 CRAY*T3E:*:*:*)
754 echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
755 exit 0 ;;
756 CRAY*SV1:*:*:*)
757 echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
758 exit 0 ;;
759 *:UNICOS/mp:*:*)
760 echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
761 exit 0 ;;
762 F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
763 FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
764 FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
765 FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
766 echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
767 exit 0 ;;
768 5000:UNIX_System_V:4.*:*)
769 FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
770 FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
771 echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
772 exit 0 ;;
773 i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
774 echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
775 exit 0 ;;
776 sparc*:BSD/OS:*:*)
777 echo sparc-unknown-bsdi${UNAME_RELEASE}
778 exit 0 ;;
779 *:BSD/OS:*:*)
780 echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
781 exit 0 ;;
782 *:FreeBSD:*:*)
783 echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
784 exit 0 ;;
785 i*:CYGWIN*:*)
786 echo ${UNAME_MACHINE}-pc-cygwin
787 exit 0 ;;
788 i*:MINGW*:*)
789 echo ${UNAME_MACHINE}-pc-mingw32
790 exit 0 ;;
791 i*:PW*:*)
792 echo ${UNAME_MACHINE}-pc-pw32
793 exit 0 ;;
794 x86:Interix*:[34]*)
795 echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//'
796 exit 0 ;;
797 [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
798 echo i${UNAME_MACHINE}-pc-mks
799 exit 0 ;;
800 i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
801 # How do we know it's Interix rather than the generic POSIX subsystem?
802 # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
803 # UNAME_MACHINE based on the output of uname instead of i386?
804 echo i586-pc-interix
805 exit 0 ;;
806 i*:UWIN*:*)
807 echo ${UNAME_MACHINE}-pc-uwin
808 exit 0 ;;
809 p*:CYGWIN*:*)
810 echo powerpcle-unknown-cygwin
811 exit 0 ;;
812 prep*:SunOS:5.*:*)
813 echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
814 exit 0 ;;
815 *:GNU:*:*)
816 # the GNU system
817 echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
818 exit 0 ;;
819 *:GNU/*:*:*)
820 # other systems with GNU libc and userland
821 echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
822 exit 0 ;;
823 i*86:Minix:*:*)
824 echo ${UNAME_MACHINE}-pc-minix
825 exit 0 ;;
826 arm*:Linux:*:*)
827 echo ${UNAME_MACHINE}-unknown-linux-gnu
828 exit 0 ;;
829 cris:Linux:*:*)
830 echo cris-axis-linux-gnu
831 exit 0 ;;
832 crisv32:Linux:*:*)
833 echo crisv32-axis-linux-gnu
834 exit 0 ;;
835 frv:Linux:*:*)
836 echo frv-unknown-linux-gnu
837 exit 0 ;;
838 ia64:Linux:*:*)
839 echo ${UNAME_MACHINE}-unknown-linux-gnu
840 exit 0 ;;
841 m32r*:Linux:*:*)
842 echo ${UNAME_MACHINE}-unknown-linux-gnu
843 exit 0 ;;
844 m68*:Linux:*:*)
845 echo ${UNAME_MACHINE}-unknown-linux-gnu
846 exit 0 ;;
847 mips:Linux:*:*)
848 eval $set_cc_for_build
849 sed 's/^ //' << EOF >$dummy.c
850 #undef CPU
851 #undef mips
852 #undef mipsel
853 #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
854 CPU=mipsel
855 #else
856 #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
857 CPU=mips
858 #else
859 CPU=
860 #endif
861 #endif
862EOF
863 eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
864 test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
865 ;;
866 mips64:Linux:*:*)
867 eval $set_cc_for_build
868 sed 's/^ //' << EOF >$dummy.c
869 #undef CPU
870 #undef mips64
871 #undef mips64el
872 #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
873 CPU=mips64el
874 #else
875 #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
876 CPU=mips64
877 #else
878 CPU=
879 #endif
880 #endif
881EOF
882 eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
883 test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
884 ;;
885 ppc:Linux:*:*)
886 echo powerpc-unknown-linux-gnu
887 exit 0 ;;
888 ppc64:Linux:*:*)
889 echo powerpc64-unknown-linux-gnu
890 exit 0 ;;
891 alpha:Linux:*:*)
892 case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
893 EV5) UNAME_MACHINE=alphaev5 ;;
894 EV56) UNAME_MACHINE=alphaev56 ;;
895 PCA56) UNAME_MACHINE=alphapca56 ;;
896 PCA57) UNAME_MACHINE=alphapca56 ;;
897 EV6) UNAME_MACHINE=alphaev6 ;;
898 EV67) UNAME_MACHINE=alphaev67 ;;
899 EV68*) UNAME_MACHINE=alphaev68 ;;
900 esac
901 objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
902 if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
903 echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
904 exit 0 ;;
905 parisc:Linux:*:* | hppa:Linux:*:*)
906 # Look for CPU level
907 case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
908 PA7*) echo hppa1.1-unknown-linux-gnu ;;
909 PA8*) echo hppa2.0-unknown-linux-gnu ;;
910 *) echo hppa-unknown-linux-gnu ;;
911 esac
912 exit 0 ;;
913 parisc64:Linux:*:* | hppa64:Linux:*:*)
914 echo hppa64-unknown-linux-gnu
915 exit 0 ;;
916 s390:Linux:*:* | s390x:Linux:*:*)
917 echo ${UNAME_MACHINE}-ibm-linux
918 exit 0 ;;
919 sh64*:Linux:*:*)
920 echo ${UNAME_MACHINE}-unknown-linux-gnu
921 exit 0 ;;
922 sh*:Linux:*:*)
923 echo ${UNAME_MACHINE}-unknown-linux-gnu
924 exit 0 ;;
925 sparc:Linux:*:* | sparc64:Linux:*:*)
926 echo ${UNAME_MACHINE}-unknown-linux-gnu
927 exit 0 ;;
928 x86_64:Linux:*:*)
929 echo x86_64-unknown-linux-gnu
930 exit 0 ;;
931 i*86:Linux:*:*)
932 # The BFD linker knows what the default object file format is, so
933 # first see if it will tell us. cd to the root directory to prevent
934 # problems with other programs or directories called `ld' in the path.
935 # Set LC_ALL=C to ensure ld outputs messages in English.
936 ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
937 | sed -ne '/supported targets:/!d
938 s/[ ][ ]*/ /g
939 s/.*supported targets: *//
940 s/ .*//
941 p'`
942 case "$ld_supported_targets" in
943 elf32-i386)
944 TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
945 ;;
946 a.out-i386-linux)
947 echo "${UNAME_MACHINE}-pc-linux-gnuaout"
948 exit 0 ;;
949 coff-i386)
950 echo "${UNAME_MACHINE}-pc-linux-gnucoff"
951 exit 0 ;;
952 "")
953 # Either a pre-BFD a.out linker (linux-gnuoldld) or
954 # one that does not give us useful --help.
955 echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
956 exit 0 ;;
957 esac
958 # Determine whether the default compiler is a.out or elf
959 eval $set_cc_for_build
960 sed 's/^ //' << EOF >$dummy.c
961 #include <features.h>
962 #ifdef __ELF__
963 # ifdef __GLIBC__
964 # if __GLIBC__ >= 2
965 LIBC=gnu
966 # else
967 LIBC=gnulibc1
968 # endif
969 # else
970 LIBC=gnulibc1
971 # endif
972 #else
973 #ifdef __INTEL_COMPILER
974 LIBC=gnu
975 #else
976 LIBC=gnuaout
977 #endif
978 #endif
979 #ifdef __dietlibc__
980 LIBC=dietlibc
981 #endif
982EOF
983 eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
984 test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0
985 test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
986 ;;
987 i*86:DYNIX/ptx:4*:*)
988 # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
989 # earlier versions are messed up and put the nodename in both
990 # sysname and nodename.
991 echo i386-sequent-sysv4
992 exit 0 ;;
993 i*86:UNIX_SV:4.2MP:2.*)
994 # Unixware is an offshoot of SVR4, but it has its own version
995 # number series starting with 2...
996 # I am not positive that other SVR4 systems won't match this,
997 # I just have to hope. -- rms.
998 # Use sysv4.2uw... so that sysv4* matches it.
999 echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
1000 exit 0 ;;
1001 i*86:OS/2:*:*)
1002 # If we were able to find `uname', then EMX Unix compatibility
1003 # is probably installed.
1004 echo ${UNAME_MACHINE}-pc-os2-emx
1005 exit 0 ;;
1006 i*86:XTS-300:*:STOP)
1007 echo ${UNAME_MACHINE}-unknown-stop
1008 exit 0 ;;
1009 i*86:atheos:*:*)
1010 echo ${UNAME_MACHINE}-unknown-atheos
1011 exit 0 ;;
1012 i*86:syllable:*:*)
1013 echo ${UNAME_MACHINE}-pc-syllable
1014 exit 0 ;;
1015 i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
1016 echo i386-unknown-lynxos${UNAME_RELEASE}
1017 exit 0 ;;
1018 i*86:*DOS:*:*)
1019 echo ${UNAME_MACHINE}-pc-msdosdjgpp
1020 exit 0 ;;
1021 i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
1022 UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
1023 if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
1024 echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
1025 else
1026 echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
1027 fi
1028 exit 0 ;;
1029 i*86:*:5:[78]*)
1030 case `/bin/uname -X | grep "^Machine"` in
1031 *486*) UNAME_MACHINE=i486 ;;
1032 *Pentium) UNAME_MACHINE=i586 ;;
1033 *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
1034 esac
1035 echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
1036 exit 0 ;;
1037 i*86:*:3.2:*)
1038 if test -f /usr/options/cb.name; then
1039 UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
1040 echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
1041 elif /bin/uname -X 2>/dev/null >/dev/null ; then
1042 UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
1043 (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
1044 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
1045 && UNAME_MACHINE=i586
1046 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
1047 && UNAME_MACHINE=i686
1048 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
1049 && UNAME_MACHINE=i686
1050 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
1051 else
1052 echo ${UNAME_MACHINE}-pc-sysv32
1053 fi
1054 exit 0 ;;
1055 pc:*:*:*)
1056 # Left here for compatibility:
1057 # uname -m prints for DJGPP always 'pc', but it prints nothing about
1058 # the processor, so we play safe by assuming i386.
1059 echo i386-pc-msdosdjgpp
1060 exit 0 ;;
1061 Intel:Mach:3*:*)
1062 echo i386-pc-mach3
1063 exit 0 ;;
1064 paragon:*:*:*)
1065 echo i860-intel-osf1
1066 exit 0 ;;
1067 i860:*:4.*:*) # i860-SVR4
1068 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
1069 echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
1070 else # Add other i860-SVR4 vendors below as they are discovered.
1071 echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
1072 fi
1073 exit 0 ;;
1074 mini*:CTIX:SYS*5:*)
1075 # "miniframe"
1076 echo m68010-convergent-sysv
1077 exit 0 ;;
1078 mc68k:UNIX:SYSTEM5:3.51m)
1079 echo m68k-convergent-sysv
1080 exit 0 ;;
1081 M680?0:D-NIX:5.3:*)
1082 echo m68k-diab-dnix
1083 exit 0 ;;
1084 M68*:*:R3V[5678]*:*)
1085 test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
1086 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)
1087 OS_REL=''
1088 test -r /etc/.relid \
1089 && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
1090 /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1091 && echo i486-ncr-sysv4.3${OS_REL} && exit 0
1092 /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
1093 && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;;
1094 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
1095 /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1096 && echo i486-ncr-sysv4 && exit 0 ;;
1097 m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
1098 echo m68k-unknown-lynxos${UNAME_RELEASE}
1099 exit 0 ;;
1100 mc68030:UNIX_System_V:4.*:*)
1101 echo m68k-atari-sysv4
1102 exit 0 ;;
1103 TSUNAMI:LynxOS:2.*:*)
1104 echo sparc-unknown-lynxos${UNAME_RELEASE}
1105 exit 0 ;;
1106 rs6000:LynxOS:2.*:*)
1107 echo rs6000-unknown-lynxos${UNAME_RELEASE}
1108 exit 0 ;;
1109 PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
1110 echo powerpc-unknown-lynxos${UNAME_RELEASE}
1111 exit 0 ;;
1112 SM[BE]S:UNIX_SV:*:*)
1113 echo mips-dde-sysv${UNAME_RELEASE}
1114 exit 0 ;;
1115 RM*:ReliantUNIX-*:*:*)
1116 echo mips-sni-sysv4
1117 exit 0 ;;
1118 RM*:SINIX-*:*:*)
1119 echo mips-sni-sysv4
1120 exit 0 ;;
1121 *:SINIX-*:*:*)
1122 if uname -p 2>/dev/null >/dev/null ; then
1123 UNAME_MACHINE=`(uname -p) 2>/dev/null`
1124 echo ${UNAME_MACHINE}-sni-sysv4
1125 else
1126 echo ns32k-sni-sysv
1127 fi
1128 exit 0 ;;
1129 PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
1130 # says <Richard.M.Bartel@ccMail.Census.GOV>
1131 echo i586-unisys-sysv4
1132 exit 0 ;;
1133 *:UNIX_System_V:4*:FTX*)
1134 # From Gerald Hewes <hewes@openmarket.com>.
1135 # How about differentiating between stratus architectures? -djm
1136 echo hppa1.1-stratus-sysv4
1137 exit 0 ;;
1138 *:*:*:FTX*)
1139 # From seanf@swdc.stratus.com.
1140 echo i860-stratus-sysv4
1141 exit 0 ;;
1142 *:VOS:*:*)
1143 # From Paul.Green@stratus.com.
1144 echo hppa1.1-stratus-vos
1145 exit 0 ;;
1146 mc68*:A/UX:*:*)
1147 echo m68k-apple-aux${UNAME_RELEASE}
1148 exit 0 ;;
1149 news*:NEWS-OS:6*:*)
1150 echo mips-sony-newsos6
1151 exit 0 ;;
1152 R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
1153 if [ -d /usr/nec ]; then
1154 echo mips-nec-sysv${UNAME_RELEASE}
1155 else
1156 echo mips-unknown-sysv${UNAME_RELEASE}
1157 fi
1158 exit 0 ;;
1159 BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
1160 echo powerpc-be-beos
1161 exit 0 ;;
1162 BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
1163 echo powerpc-apple-beos
1164 exit 0 ;;
1165 BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
1166 echo i586-pc-beos
1167 exit 0 ;;
1168 SX-4:SUPER-UX:*:*)
1169 echo sx4-nec-superux${UNAME_RELEASE}
1170 exit 0 ;;
1171 SX-5:SUPER-UX:*:*)
1172 echo sx5-nec-superux${UNAME_RELEASE}
1173 exit 0 ;;
1174 SX-6:SUPER-UX:*:*)
1175 echo sx6-nec-superux${UNAME_RELEASE}
1176 exit 0 ;;
1177 Power*:Rhapsody:*:*)
1178 echo powerpc-apple-rhapsody${UNAME_RELEASE}
1179 exit 0 ;;
1180 *:Rhapsody:*:*)
1181 echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
1182 exit 0 ;;
1183 *:Darwin:*:*)
1184 UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
1185 case $UNAME_PROCESSOR in
1186 *86) UNAME_PROCESSOR=i686 ;;
1187 unknown) UNAME_PROCESSOR=powerpc ;;
1188 esac
1189 echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
1190 exit 0 ;;
1191 *:procnto*:*:* | *:QNX:[0123456789]*:*)
1192 UNAME_PROCESSOR=`uname -p`
1193 if test "$UNAME_PROCESSOR" = "x86"; then
1194 UNAME_PROCESSOR=i386
1195 UNAME_MACHINE=pc
1196 fi
1197 echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
1198 exit 0 ;;
1199 *:QNX:*:4*)
1200 echo i386-pc-qnx
1201 exit 0 ;;
1202 NSR-?:NONSTOP_KERNEL:*:*)
1203 echo nsr-tandem-nsk${UNAME_RELEASE}
1204 exit 0 ;;
1205 *:NonStop-UX:*:*)
1206 echo mips-compaq-nonstopux
1207 exit 0 ;;
1208 BS2000:POSIX*:*:*)
1209 echo bs2000-siemens-sysv
1210 exit 0 ;;
1211 DS/*:UNIX_System_V:*:*)
1212 echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
1213 exit 0 ;;
1214 *:Plan9:*:*)
1215 # "uname -m" is not consistent, so use $cputype instead. 386
1216 # is converted to i386 for consistency with other x86
1217 # operating systems.
1218 if test "$cputype" = "386"; then
1219 UNAME_MACHINE=i386
1220 else
1221 UNAME_MACHINE="$cputype"
1222 fi
1223 echo ${UNAME_MACHINE}-unknown-plan9
1224 exit 0 ;;
1225 *:TOPS-10:*:*)
1226 echo pdp10-unknown-tops10
1227 exit 0 ;;
1228 *:TENEX:*:*)
1229 echo pdp10-unknown-tenex
1230 exit 0 ;;
1231 KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
1232 echo pdp10-dec-tops20
1233 exit 0 ;;
1234 XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
1235 echo pdp10-xkl-tops20
1236 exit 0 ;;
1237 *:TOPS-20:*:*)
1238 echo pdp10-unknown-tops20
1239 exit 0 ;;
1240 *:ITS:*:*)
1241 echo pdp10-unknown-its
1242 exit 0 ;;
1243 SEI:*:*:SEIUX)
1244 echo mips-sei-seiux${UNAME_RELEASE}
1245 exit 0 ;;
1246 *:DragonFly:*:*)
1247 echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
1248 exit 0 ;;
1249 *:*VMS:*:*)
1250 UNAME_MACHINE=`(uname -p) 2>/dev/null`
1251 case "${UNAME_MACHINE}" in
1252 A*) echo alpha-dec-vms && exit 0 ;;
1253 I*) echo ia64-dec-vms && exit 0 ;;
1254 V*) echo vax-dec-vms && exit 0 ;;
1255 esac
1256esac
1257
1258#echo '(No uname command or uname output not recognized.)' 1>&2
1259#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
1260
1261eval $set_cc_for_build
1262cat >$dummy.c <<EOF
1263#ifdef _SEQUENT_
1264# include <sys/types.h>
1265# include <sys/utsname.h>
1266#endif
1267main ()
1268{
1269#if defined (sony)
1270#if defined (MIPSEB)
1271 /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
1272 I don't know.... */
1273 printf ("mips-sony-bsd\n"); exit (0);
1274#else
1275#include <sys/param.h>
1276 printf ("m68k-sony-newsos%s\n",
1277#ifdef NEWSOS4
1278 "4"
1279#else
1280 ""
1281#endif
1282 ); exit (0);
1283#endif
1284#endif
1285
1286#if defined (__arm) && defined (__acorn) && defined (__unix)
1287 printf ("arm-acorn-riscix"); exit (0);
1288#endif
1289
1290#if defined (hp300) && !defined (hpux)
1291 printf ("m68k-hp-bsd\n"); exit (0);
1292#endif
1293
1294#if defined (NeXT)
1295#if !defined (__ARCHITECTURE__)
1296#define __ARCHITECTURE__ "m68k"
1297#endif
1298 int version;
1299 version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
1300 if (version < 4)
1301 printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
1302 else
1303 printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
1304 exit (0);
1305#endif
1306
1307#if defined (MULTIMAX) || defined (n16)
1308#if defined (UMAXV)
1309 printf ("ns32k-encore-sysv\n"); exit (0);
1310#else
1311#if defined (CMU)
1312 printf ("ns32k-encore-mach\n"); exit (0);
1313#else
1314 printf ("ns32k-encore-bsd\n"); exit (0);
1315#endif
1316#endif
1317#endif
1318
1319#if defined (__386BSD__)
1320 printf ("i386-pc-bsd\n"); exit (0);
1321#endif
1322
1323#if defined (sequent)
1324#if defined (i386)
1325 printf ("i386-sequent-dynix\n"); exit (0);
1326#endif
1327#if defined (ns32000)
1328 printf ("ns32k-sequent-dynix\n"); exit (0);
1329#endif
1330#endif
1331
1332#if defined (_SEQUENT_)
1333 struct utsname un;
1334
1335 uname(&un);
1336
1337 if (strncmp(un.version, "V2", 2) == 0) {
1338 printf ("i386-sequent-ptx2\n"); exit (0);
1339 }
1340 if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
1341 printf ("i386-sequent-ptx1\n"); exit (0);
1342 }
1343 printf ("i386-sequent-ptx\n"); exit (0);
1344
1345#endif
1346
1347#if defined (vax)
1348# if !defined (ultrix)
1349# include <sys/param.h>
1350# if defined (BSD)
1351# if BSD == 43
1352 printf ("vax-dec-bsd4.3\n"); exit (0);
1353# else
1354# if BSD == 199006
1355 printf ("vax-dec-bsd4.3reno\n"); exit (0);
1356# else
1357 printf ("vax-dec-bsd\n"); exit (0);
1358# endif
1359# endif
1360# else
1361 printf ("vax-dec-bsd\n"); exit (0);
1362# endif
1363# else
1364 printf ("vax-dec-ultrix\n"); exit (0);
1365# endif
1366#endif
1367
1368#if defined (alliant) && defined (i860)
1369 printf ("i860-alliant-bsd\n"); exit (0);
1370#endif
1371
1372 exit (1);
1373}
1374EOF
1375
1376$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0
1377
1378# Apollos put the system type in the environment.
1379
1380test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; }
1381
1382# Convex versions that predate uname can use getsysinfo(1)
1383
1384if [ -x /usr/convex/getsysinfo ]
1385then
1386 case `getsysinfo -f cpu_type` in
1387 c1*)
1388 echo c1-convex-bsd
1389 exit 0 ;;
1390 c2*)
1391 if getsysinfo -f scalar_acc
1392 then echo c32-convex-bsd
1393 else echo c2-convex-bsd
1394 fi
1395 exit 0 ;;
1396 c34*)
1397 echo c34-convex-bsd
1398 exit 0 ;;
1399 c38*)
1400 echo c38-convex-bsd
1401 exit 0 ;;
1402 c4*)
1403 echo c4-convex-bsd
1404 exit 0 ;;
1405 esac
1406fi
1407
1408cat >&2 <<EOF
1409$0: unable to guess system type
1410
1411This script, last modified $timestamp, has failed to recognize
1412the operating system you are using. It is advised that you
1413download the most up to date version of the config scripts from
1414
1415 ftp://ftp.gnu.org/pub/gnu/config/
1416
1417If the version you run ($0) is already up to date, please
1418send the following data and any information you think might be
1419pertinent to <config-patches@gnu.org> in order to provide the needed
1420information to handle your system.
1421
1422config.guess timestamp = $timestamp
1423
1424uname -m = `(uname -m) 2>/dev/null || echo unknown`
1425uname -r = `(uname -r) 2>/dev/null || echo unknown`
1426uname -s = `(uname -s) 2>/dev/null || echo unknown`
1427uname -v = `(uname -v) 2>/dev/null || echo unknown`
1428
1429/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
1430/bin/uname -X = `(/bin/uname -X) 2>/dev/null`
1431
1432hostinfo = `(hostinfo) 2>/dev/null`
1433/bin/universe = `(/bin/universe) 2>/dev/null`
1434/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
1435/bin/arch = `(/bin/arch) 2>/dev/null`
1436/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
1437/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
1438
1439UNAME_MACHINE = ${UNAME_MACHINE}
1440UNAME_RELEASE = ${UNAME_RELEASE}
1441UNAME_SYSTEM = ${UNAME_SYSTEM}
1442UNAME_VERSION = ${UNAME_VERSION}
1443EOF
1444
1445exit 1
1446
1447# Local variables:
1448# eval: (add-hook 'write-file-hooks 'time-stamp)
1449# time-stamp-start: "timestamp='"
1450# time-stamp-format: "%:y-%02m-%02d"
1451# time-stamp-end: "'"
1452# End: