GC old libarchive/bsdtar.
[dragonfly/port-amd64.git] / contrib / libreadline / support / config.guess
blob46bf06b16af8abfec5a0686ce9996cb6a218af5b
1 #! /bin/sh
2 # Attempt to guess a canonical system name.
3 # Copyright (C) 1992, 1993, 1994, 1995, 1996 Free Software Foundation, Inc.
5 # $DragonFly: src/contrib/libreadline/support/Attic/config.guess,v 1.2 2003/11/19 00:51:33 dillon Exp $
7 # This file is free software; you can redistribute it and/or modify it
8 # under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 2 of the License, or
10 # (at your option) any later version.
12 # This program is distributed in the hope that it will be useful, but
13 # WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 # General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with this program; if not, write to the Free Software
19 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 # As a special exception to the GNU General Public License, if you
22 # distribute this file as part of a program that contains a
23 # configuration script generated by Autoconf, you may include it under
24 # the same distribution terms that you use for the rest of that program.
26 # Written by Per Bothner <bothner@cygnus.com>.
27 # The master version of this file is at the FSF in /home/gd/gnu/lib.
29 # This script attempts to guess a canonical system name similar to
30 # config.sub. If it succeeds, it prints the system name on stdout, and
31 # exits with 0. Otherwise, it exits with 1.
33 # The plan is that this can be called by configure scripts if you
34 # don't specify an explicit system type (host/target name).
36 # Only a few systems have been added to this list; please add others
37 # (but try to keep the structure clean).
40 # Use $HOST_CC if defined. $CC may point to a cross-compiler
41 if test x"$CC_FOR_BUILD" = x; then
42 if test x"$HOST_CC" != x; then
43 CC_FOR_BUILD="$HOST_CC"
44 else
45 if test x"$CC" != x; then
46 CC_FOR_BUILD="$CC"
47 else
48 CC_FOR_BUILD=cc
53 # This is needed to find uname on a Pyramid OSx when run in the BSD universe.
54 # (ghazi@noc.rutgers.edu 8/24/94.)
55 if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
56 PATH=$PATH:/.attbin ; export PATH
57 elif (test -f /usr/5bin/uname) >/dev/null 2>&1 ; then
58 PATH=$PATH:/usr/5bin
61 UNAME=`(uname) 2>/dev/null` || UNAME=unknown
62 UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
63 UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
64 UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
65 UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
67 RELEASE=`expr "$UNAME_RELEASE" : '[^0-9]*\([0-9]*\)'` # 4
68 case "$RELEASE" in
69 "") RELEASE=0 ;;
70 *) RELEASE=`expr "$RELEASE" + 0` ;;
71 esac
72 REL_LEVEL=`expr "$UNAME_RELEASE" : '[^0-9]*[0-9]*.\([0-9]*\)'` # 1
73 REL_SUBLEVEL=`expr "$UNAME_RELEASE" : '[^0-9]*[0-9]*.[0-9]*.\([0-9]*\)'` # 2
75 dummy=dummy-$$
76 trap 'rm -f $dummy.c $dummy.o $dummy; exit 1' 1 2 15
78 # Some versions of i386 SVR4.2 make `uname' equivalent to `uname -n', which
79 # is contrary to all other versions of uname
80 if [ -n "$UNAME" ] && [ "$UNAME_S" != "$UNAME" ] && [ "$UNAME_S" = UNIX_SV ]; then
81 UNAME=UNIX_SV
84 # Note: order is significant - the case branches are not exclusive.
86 case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
87 # Begin cases added for Bash
88 alpha:NetBSD:*:*)
89 echo alpha-dec-netbsd${UNAME_RELEASE}
90 exit 0 ;;
91 alpha:OpenBSD:*:*)
92 echo alpha-dec-openbsd${UNAME_RELEASE}
93 exit 0 ;;
94 i?86:NetBSD:*:*)
95 echo ${UNAME_MACHINE}-pc-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
96 exit 0 ;;
97 i?86:OpenBSD:*:*)
98 echo ${UNAME_MACHINE}-pc-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
99 exit 0 ;;
100 sparc:NetBSD:*:*)
101 echo sparc-unknown-netbsd${UNAME_RELEASE}
102 exit 0 ;;
103 sparc:OpenBSD:*:*)
104 echo sparc-unknown-openbsd${UNAME_RELEASE}
105 exit 0 ;;
106 vax:NetBSD:*:*)
107 echo vax-dec-netbsd${UNAME_RELEASE}
108 exit 0 ;;
109 vax:OpenBSD:*:*)
110 echo vax-dec-openbsd${UNAME_RELEASE}
111 exit 0 ;;
112 mac68k:machten:*:*)
113 echo mac68k-apple-machten${UNAME_RELEASE}
114 exit 0 ;;
115 concurrent*:*:*:*)
116 if test "`(/bin/universe) 2>/dev/null`" = att ; then
117 echo concurrent-concurrent-sysv3
118 else
119 echo concurrent-concurrent-bsd
121 exit 0 ;;
122 ppc*:SunOS:5.*:*)
123 echo ppc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
124 exit 0 ;;
125 sparc:UNIX_SV:4.*:*)
126 echo sparc-unknown-sysv${UNAME_RELEASE}
127 exit 0 ;;
128 mips:UNIX_SV:4.*:*)
129 echo mips-mips-sysv${UNAME_RELEASE}
130 exit 0 ;;
131 mips:OSF*1:*:*)
132 echo mips-mips-osf1
133 exit 0 ;;
134 mips:4.4BSD:*:*)
135 echo mips-mips-bsd4.4
136 exit 0 ;;
137 MIServer-S:SMP_DC.OSx:*:dcosx)
138 echo mips-pyramid-sysv4
139 exit 0 ;;
140 news*:NEWS*:*:*)
141 echo mips-sony-newsos${UNAME_RELEASE}
142 exit 0 ;;
143 i?86:NEXTSTEP:*:*)
144 echo i386-next-nextstep${RELEASE}
145 exit 0 ;;
146 *680?0:NEXTSTEP:*:*)
147 echo m68k-next-nextstep${RELEASE}
148 exit 0 ;;
149 *370:AIX:*:*)
150 echo ibm370-ibm-aix
151 exit 0 ;;
152 ksr1:OSF*1:*:*)
153 echo ksr1-ksr-osf1
154 exit 0 ;;
155 esa:OSF*1:*:* | ESA:OSF*:*:*)
156 echo esa-ibm-osf1
157 exit 0 ;;
158 DNP*:DNIX:*:*)
159 echo m68k-dnix-sysv
160 exit 0 ;;
161 *3b2*:*:*:*)
162 echo we32k-att-sysv3
163 exit 0 ;;
164 *:QNX:*:42*)
165 echo i386-qssl-qnx`echo ${UNAME_VERSION}`
166 exit 0 ;;
167 Alpha*:Windows:NT:*:SP*)
168 echo alpha-pc-opennt
169 exit 0 ;;
170 *:Windows:NT:*:SP*)
171 echo intel-pc-opennt
172 exit 0 ;;
173 # end cases added for Bash
174 alpha:OSF1:*:*)
175 if test $UNAME_RELEASE = "V4.0"; then
176 UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
178 # A Vn.n version is a released version.
179 # A Tn.n version is a released field test version.
180 # A Xn.n version is an unreleased experimental baselevel.
181 # 1.2 uses "1.2" for uname -r.
182 cat <<EOF >$dummy.s
183 .globl main
184 .ent main
185 main:
186 .frame \$30,0,\$26,0
187 .prologue 0
188 .long 0x47e03d80 # implver $0
189 lda \$2,259
190 .long 0x47e20c21 # amask $2,$1
191 srl \$1,8,\$2
192 sll \$2,2,\$2
193 sll \$0,3,\$0
194 addl \$1,\$0,\$0
195 addl \$2,\$0,\$0
196 ret \$31,(\$26),1
197 .end main
199 $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
200 if test "$?" = 0 ; then
201 ./$dummy
202 case "$?" in
204 UNAME_MACHINE="alpha"
207 UNAME_MACHINE="alphaev5"
210 UNAME_MACHINE="alphaev56"
213 UNAME_MACHINE="alphapca56"
216 UNAME_MACHINE="alphaev6"
218 esac
220 rm -f $dummy.s $dummy
221 echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
222 exit 0 ;;
223 Alpha\ *:Windows_NT*:*)
224 # How do we know it's Interix rather than the generic POSIX subsystem?
225 # Should we change UNAME_MACHINE based on the output of uname instead
226 # of the specific Alpha model?
227 echo alpha-pc-interix
228 exit 0 ;;
229 21064:Windows_NT:50:3)
230 echo alpha-dec-winnt3.5
231 exit 0 ;;
232 Amiga*:UNIX_System_V:4.0:*)
233 echo m68k-cbm-sysv4
234 exit 0;;
235 amiga:NetBSD:*:*)
236 echo m68k-cbm-netbsd${UNAME_RELEASE}
237 exit 0 ;;
238 amiga:OpenBSD:*:*)
239 echo m68k-cbm-openbsd${UNAME_RELEASE}
240 exit 0 ;;
241 *:[Aa]miga[Oo][Ss]:*:*)
242 echo ${UNAME_MACHINE}-unknown-amigaos
243 exit 0 ;;
244 arc64:OpenBSD:*:*)
245 echo mips64el-unknown-openbsd${UNAME_RELEASE}
246 exit 0 ;;
247 arc:OpenBSD:*:*)
248 echo mipsel-unknown-openbsd${UNAME_RELEASE}
249 exit 0 ;;
250 hkmips:OpenBSD:*:*)
251 echo mips-unknown-openbsd${UNAME_RELEASE}
252 exit 0 ;;
253 pmax:OpenBSD:*:*)
254 echo mipsel-unknown-openbsd${UNAME_RELEASE}
255 exit 0 ;;
256 sgi:OpenBSD:*:*)
257 echo mips-unknown-openbsd${UNAME_RELEASE}
258 exit 0 ;;
259 wgrisc:OpenBSD:*:*)
260 echo mipsel-unknown-openbsd${UNAME_RELEASE}
261 exit 0 ;;
262 arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
263 echo arm-acorn-riscix${UNAME_RELEASE}
264 exit 0;;
265 arm32:NetBSD:*:*)
266 echo arm-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
267 exit 0 ;;
268 SR2?01:HI-UX/MPP:*:*)
269 echo hppa1.1-hitachi-hiuxmpp
270 exit 0;;
271 Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
272 # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
273 if test "`(/bin/universe) 2>/dev/null`" = att ; then
274 echo pyramid-pyramid-sysv3
275 else
276 echo pyramid-pyramid-bsd
278 exit 0 ;;
279 NILE:*:*:*:dcosx)
280 echo pyramid-pyramid-svr4
281 exit 0 ;;
282 sun4H:SunOS:5.*:*)
283 echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
284 exit 0 ;;
285 sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
286 echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
287 exit 0 ;;
288 i86pc:SunOS:5.*:*)
289 echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
290 exit 0 ;;
291 sun4*:SunOS:6*:*)
292 # According to config.sub, this is the proper way to canonicalize
293 # SunOS6. Hard to guess exactly what SunOS6 will be like, but
294 # it's likely to be more like Solaris than SunOS4.
295 echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
296 exit 0 ;;
297 sun4*:SunOS:*:*)
298 case "`/usr/bin/arch -k`" in
299 Series*|S4*)
300 UNAME_RELEASE=`uname -v`
302 esac
303 # Japanese Language versions have a version number like `4.1.3-JL'.
304 echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
305 exit 0 ;;
306 sun3*:SunOS:*:*)
307 echo m68k-sun-sunos${UNAME_RELEASE}
308 exit 0 ;;
309 sun*:*:4.2BSD:*)
310 UNAME_RELEASE=`(head -1 /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
311 test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
312 case "`/bin/arch`" in
313 sun3)
314 echo m68k-sun-sunos${UNAME_RELEASE}
316 sun4)
317 echo sparc-sun-sunos${UNAME_RELEASE}
319 esac
320 exit 0 ;;
321 aushp:SunOS:*:*)
322 echo sparc-auspex-sunos${UNAME_RELEASE}
323 exit 0 ;;
324 atari*:NetBSD:*:*)
325 echo m68k-atari-netbsd${UNAME_RELEASE}
326 exit 0 ;;
327 atari*:OpenBSD:*:*)
328 echo m68k-unknown-openbsd${UNAME_RELEASE}
329 exit 0 ;;
330 # The situation for MiNT is a little confusing. The machine name
331 # can be virtually everything (everything which is not
332 # "atarist" or "atariste" at least should have a processor
333 # > m68000). The system name ranges from "MiNT" over "FreeMiNT"
334 # to the lowercase version "mint" (or "freemint"). Finally
335 # the system name "TOS" denotes a system which is actually not
336 # MiNT. But MiNT is downward compatible to TOS, so this should
337 # be no problem.
338 atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
339 echo m68k-atari-mint${UNAME_RELEASE}
340 exit 0 ;;
341 atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
342 echo m68k-atari-mint${UNAME_RELEASE}
343 exit 0 ;;
344 *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
345 echo m68k-atari-mint${UNAME_RELEASE}
346 exit 0 ;;
347 milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
348 echo m68k-milan-mint${UNAME_RELEASE}
349 exit 0 ;;
350 hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
351 echo m68k-hades-mint${UNAME_RELEASE}
352 exit 0 ;;
353 *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
354 echo m68k-unknown-mint${UNAME_RELEASE}
355 exit 0 ;;
356 sun3*:NetBSD:*:*)
357 echo m68k-sun-netbsd${UNAME_RELEASE}
358 exit 0 ;;
359 sun3*:OpenBSD:*:*)
360 echo m68k-unknown-openbsd${UNAME_RELEASE}
361 exit 0 ;;
362 mac68k:NetBSD:*:*)
363 echo m68k-apple-netbsd${UNAME_RELEASE}
364 exit 0 ;;
365 mac68k:OpenBSD:*:*)
366 echo m68k-unknown-openbsd${UNAME_RELEASE}
367 exit 0 ;;
368 mvme68k:OpenBSD:*:*)
369 echo m68k-unknown-openbsd${UNAME_RELEASE}
370 exit 0 ;;
371 mvme88k:OpenBSD:*:*)
372 echo m88k-unknown-openbsd${UNAME_RELEASE}
373 exit 0 ;;
374 *:"Mac OS":*:*)
375 echo `uname -p`-apple-macos${UNAME_RELEASE}
376 exit 0 ;;
377 powerpc:machten:*:*)
378 echo powerpc-apple-machten${UNAME_RELEASE}
379 exit 0 ;;
380 macppc:NetBSD:*:*)
381 echo powerpc-apple-netbsd${UNAME_RELEASE}
382 exit 0 ;;
383 RISC*:Mach:*:*)
384 echo mips-dec-mach_bsd4.3
385 exit 0 ;;
386 RISC*:ULTRIX:*:*)
387 echo mips-dec-ultrix${UNAME_RELEASE}
388 exit 0 ;;
389 VAX*:ULTRIX*:*:*)
390 echo vax-dec-ultrix${UNAME_RELEASE}
391 exit 0 ;;
392 2020:CLIX:*:* | 2430:CLIX:*:*)
393 echo clipper-intergraph-clix${UNAME_RELEASE}
394 exit 0 ;;
395 mips:*:*:UMIPS | mips:*:*:RISCos)
396 sed 's/^ //' << EOF >$dummy.c
397 #ifdef __cplusplus
398 int main (int argc, char *argv[]) {
399 #else
400 int main (argc, argv) int argc; char *argv[]; {
401 #endif
402 #if defined (host_mips) && defined (MIPSEB)
403 #if defined (SYSTYPE_SYSV)
404 printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
405 #endif
406 #if defined (SYSTYPE_SVR4)
407 printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
408 #endif
409 #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
410 printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
411 #endif
412 #endif
413 exit (-1);
416 $CC_FOR_BUILD $dummy.c -o $dummy \
417 && ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
418 && rm $dummy.c $dummy && exit 0
419 rm -f $dummy.c $dummy
420 echo mips-mips-riscos${UNAME_RELEASE}
421 exit 0 ;;
422 Night_Hawk:Power_UNIX:*:*)
423 echo powerpc-harris-powerunix
424 exit 0 ;;
425 m88k:CX/UX:7*:*)
426 echo m88k-harris-cxux7
427 exit 0 ;;
428 m88k:*:4*:R4*)
429 echo m88k-motorola-sysv4
430 exit 0 ;;
431 m88k:*:3*:R3*)
432 echo m88k-motorola-sysv3
433 exit 0 ;;
434 AViiON:dgux:*:*)
435 # DG/UX returns AViiON for all architectures
436 UNAME_PROCESSOR=`/usr/bin/uname -p`
437 if [ $UNAME_PROCESSOR = mc88100 -o $UNAME_PROCESSOR = mc88110 ] ; then
438 if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx \
439 -o ${TARGET_BINARY_INTERFACE}x = x ] ; then
440 echo m88k-dg-dgux${UNAME_RELEASE}
441 else
442 echo m88k-dg-dguxbcs${UNAME_RELEASE}
444 else
445 echo i586-dg-dgux${UNAME_RELEASE}
447 exit 0 ;;
448 M88*:DolphinOS:*:*) # DolphinOS (SVR3)
449 echo m88k-dolphin-sysv3
450 exit 0 ;;
451 M88*:*:R3*:*)
452 # Delta 88k system running SVR3
453 echo m88k-motorola-sysv3
454 exit 0 ;;
455 XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
456 echo m88k-tektronix-sysv3
457 exit 0 ;;
458 Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
459 echo m68k-tektronix-bsd
460 exit 0 ;;
461 *:IRIX*:*:*)
462 echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
463 exit 0 ;;
464 ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
465 echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
466 exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX '
467 i?86:AIX:*:*)
468 echo i386-ibm-aix
469 exit 0 ;;
470 *:AIX:2:3)
471 if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
472 sed 's/^ //' << EOF >$dummy.c
473 #include <sys/systemcfg.h>
475 main()
477 if (!__power_pc())
478 exit(1);
479 puts("powerpc-ibm-aix3.2.5");
480 exit(0);
483 $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm $dummy.c $dummy && exit 0
484 rm -f $dummy.c $dummy
485 echo rs6000-ibm-aix3.2.5
486 elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
487 echo rs6000-ibm-aix3.2.4
488 else
489 echo rs6000-ibm-aix3.2
491 exit 0 ;;
492 *:AIX:*:4)
493 IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | head -1 | awk '{ print $1 }'`
494 if /usr/sbin/lsattr -EHl ${IBM_CPU_ID} | grep POWER >/dev/null 2>&1; then
495 IBM_ARCH=rs6000
496 else
497 IBM_ARCH=powerpc
499 if [ -x /usr/bin/oslevel ] ; then
500 IBM_REV=`/usr/bin/oslevel`
501 elif grep bos410 /usr/include/stdio.h >/dev/null 2>&1; then
502 IBM_REV=4.1
503 elif grep bos411 /usr/include/stdio.h >/dev/null 2>&1; then
504 IBM_REV=4.1.1
505 else
506 IBM_REV=4.${UNAME_RELEASE}
508 echo ${IBM_ARCH}-ibm-aix${IBM_REV}
509 exit 0 ;;
510 *:AIX:*:*)
511 echo rs6000-ibm-aix
512 exit 0 ;;
513 ibmrt:4.4BSD:*|romp-ibm:BSD:*)
514 echo romp-ibm-bsd4.4
515 exit 0 ;;
516 ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC NetBSD and
517 echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
518 exit 0 ;; # report: romp-ibm BSD 4.3
519 *:BOSX:*:*)
520 echo rs6000-bull-bosx
521 exit 0 ;;
522 DPX/2?00:B.O.S.:*:*)
523 echo m68k-bull-sysv3
524 exit 0 ;;
525 9000/[34]??:4.3bsd:1.*:*)
526 echo m68k-hp-bsd
527 exit 0 ;;
528 hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
529 echo m68k-hp-bsd4.4
530 exit 0 ;;
531 9000/[34678]??:HP-UX:*:*)
532 case "${UNAME_MACHINE}" in
533 9000/31? ) HP_ARCH=m68000 ;;
534 9000/[34]?? ) HP_ARCH=m68k ;;
535 9000/[678][0-9][0-9])
536 sed 's/^ //' << EOF >$dummy.c
537 #include <stdlib.h>
538 #include <unistd.h>
540 int main ()
542 #if defined(_SC_KERNEL_BITS)
543 long bits = sysconf(_SC_KERNEL_BITS);
544 #endif
545 long cpu = sysconf (_SC_CPU_VERSION);
547 switch (cpu)
549 case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
550 case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
551 case CPU_PA_RISC2_0:
552 #if defined(_SC_KERNEL_BITS)
553 switch (bits)
555 case 64: puts ("hppa2.0w"); break;
556 case 32: puts ("hppa2.0n"); break;
557 default: puts ("hppa2.0"); break;
558 } break;
559 #else /* !defined(_SC_KERNEL_BITS) */
560 puts ("hppa2.0"); break;
561 #endif
562 default: puts ("hppa1.0"); break;
564 exit (0);
567 ($CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy`
568 rm -f $dummy.c $dummy
569 esac
570 HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
571 echo ${HP_ARCH}-hp-hpux${HPUX_REV}
572 exit 0 ;;
573 3050*:HI-UX:*:*)
574 sed 's/^ //' << EOF >$dummy.c
575 #include <unistd.h>
577 main ()
579 long cpu = sysconf (_SC_CPU_VERSION);
580 /* The order matters, because CPU_IS_HP_MC68K erroneously returns
581 true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
582 results, however. */
583 if (CPU_IS_PA_RISC (cpu))
585 switch (cpu)
587 case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
588 case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
589 case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
590 default: puts ("hppa-hitachi-hiuxwe2"); break;
593 else if (CPU_IS_HP_MC68K (cpu))
594 puts ("m68k-hitachi-hiuxwe2");
595 else puts ("unknown-hitachi-hiuxwe2");
596 exit (0);
599 $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm $dummy.c $dummy && exit 0
600 rm -f $dummy.c $dummy
601 echo unknown-hitachi-hiuxwe2
602 exit 0 ;;
603 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
604 echo hppa1.1-hp-bsd
605 exit 0 ;;
606 9000/8??:4.3bsd:*:*)
607 echo hppa1.0-hp-bsd
608 exit 0 ;;
609 *9??*:MPE/iX:*:*)
610 echo hppa1.0-hp-mpeix
611 exit 0 ;;
612 hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
613 echo hppa1.1-hp-osf
614 exit 0 ;;
615 hp8??:OSF1:*:*)
616 echo hppa1.0-hp-osf
617 exit 0 ;;
618 i?86:OSF1:*:*)
619 if [ -x /usr/sbin/sysversion ] ; then
620 echo ${UNAME_MACHINE}-unknown-osf1mk
621 else
622 echo ${UNAME_MACHINE}-unknown-osf1
624 exit 0 ;;
625 parisc*:Lites*:*:*)
626 echo hppa1.1-hp-lites
627 exit 0 ;;
628 hppa*:OpenBSD:*:*)
629 echo hppa-unknown-openbsd
630 exit 0 ;;
631 C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
632 echo c1-convex-bsd
633 exit 0 ;;
634 C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
635 if getsysinfo -f scalar_acc
636 then echo c32-convex-bsd
637 else echo c2-convex-bsd
639 exit 0 ;;
640 C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
641 echo c34-convex-bsd
642 exit 0 ;;
643 C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
644 echo c38-convex-bsd
645 exit 0 ;;
646 C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
647 echo c4-convex-bsd
648 exit 0 ;;
649 CRAY*X-MP:*:*:*)
650 echo xmp-cray-unicos
651 exit 0 ;;
652 CRAY*Y-MP:*:*:*)
653 echo ymp-cray-unicos${UNAME_RELEASE}
654 exit 0 ;;
655 CRAY*[A-Z]90:*:*:*)
656 echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
657 | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
658 -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/
659 exit 0 ;;
660 CRAY*TS:*:*:*)
661 echo t90-cray-unicos${UNAME_RELEASE}
662 exit 0 ;;
663 CRAY*T3E:*:*:*)
664 echo alpha-cray-unicosmk${UNAME_RELEASE}
665 exit 0 ;;
666 CRAY-2:*:*:*)
667 echo cray2-cray-unicos
668 exit 0 ;;
669 F300:UNIX_System_V:*:*)
670 FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
671 FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
672 echo "f300-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
673 exit 0 ;;
674 F301:UNIX_System_V:*:*)
675 echo f301-fujitsu-uxpv`echo $UNAME_RELEASE | sed 's/ .*//'`
676 exit 0 ;;
677 hp3[0-9][05]:NetBSD:*:*)
678 echo m68k-hp-netbsd${UNAME_RELEASE}
679 exit 0 ;;
680 hp300:OpenBSD:*:*)
681 echo m68k-unknown-openbsd${UNAME_RELEASE}
682 exit 0 ;;
683 i?86:BSD/386:*:* | i?86:BSD/OS:*:*)
684 echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
685 exit 0 ;;
686 sparc*:BSD/OS:*:*)
687 echo sparc-unknown-bsdi${UNAME_RELEASE}
688 exit 0 ;;
689 *:BSD/OS:*:*)
690 echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
691 exit 0 ;;
692 *:FreeBSD:*:*)
693 if test -x /usr/bin/objformat; then
694 if test "elf" = "`/usr/bin/objformat`"; then
695 echo ${UNAME_MACHINE}-unknown-freebsdelf`echo ${UNAME_RELEASE}|sed -e 's/[-_].*//'`
696 exit 0
699 echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-=(].*//'`
700 exit 0 ;;
701 *:DragonFly:*:*)
702 echo ${UNAME_MACHINE}-unknown-dragonflyelf`echo ${UNAME_RELEASE}|sed -e 's/[-_].*//'`
703 exit 0 ;;
704 *:NetBSD:*:*)
705 echo ${UNAME_MACHINE}-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
706 exit 0 ;;
707 *:OpenBSD:*:*)
708 echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
709 exit 0 ;;
710 i*:CYGWIN*:*)
711 echo ${UNAME_MACHINE}-pc-cygwin32
712 exit 0 ;;
713 i*:MINGW*:*)
714 echo ${UNAME_MACHINE}-pc-mingw32
715 exit 0 ;;
716 i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
717 # How do we know it's Interix rather than the generic POSIX subsystem?
718 # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
719 # UNAME_MACHINE based on the output of uname instead of i386?
720 echo i386-pc-interix
721 exit 0 ;;
722 i*:UWIN*:*)
723 echo ${UNAME_MACHINE}-pc-uwin
724 exit 0 ;;
725 p*:CYGWIN*:*)
726 echo powerpcle-unknown-cygwin
727 exit 0 ;;
728 prep*:SunOS:5.*:*)
729 echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
730 exit 0 ;;
731 *:GNU:*:*)
732 echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
733 exit 0 ;;
734 *:Linux:*:*)
735 # uname on the ARM produces all sorts of strangeness, and we need to
736 # filter it out.
737 case "$UNAME_MACHINE" in
738 armv*) UNAME_MACHINE=$UNAME_MACHINE ;;
739 arm* | sa110*) UNAME_MACHINE="arm" ;;
740 esac
742 # The BFD linker knows what the default object file format is, so
743 # first see if it will tell us. cd to the root directory to prevent
744 # problems with other programs or directories called `ld' in the path.
745 ld_help_string=`cd /; ld --help 2>&1`
746 ld_supported_emulations=`echo $ld_help_string \
747 | sed -ne '/supported emulations:/!d
748 s/[ ][ ]*/ /g
749 s/.*supported emulations: *//
750 s/ .*//
752 case "$ld_supported_emulations" in
753 *ia64) echo "${UNAME_MACHINE}-unknown-linux" ; exit 0 ;;
754 i?86linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" ; exit 0 ;;
755 i?86coff) echo "${UNAME_MACHINE}-pc-linux-gnucoff" ; exit 0 ;;
756 sparclinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
757 armlinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
758 m68klinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
759 elf32ppc | elf32ppclinux)
760 # Determine Lib Version
761 cat >$dummy.c <<EOF
762 #include <features.h>
763 #if defined(__GLIBC__)
764 extern char __libc_version[];
765 extern char __libc_release[];
766 #endif
767 main(argc, argv)
768 int argc;
769 char *argv[];
771 #if defined(__GLIBC__)
772 printf("%s %s\n", __libc_version, __libc_release);
773 #else
774 printf("unkown\n");
775 #endif
776 return 0;
779 LIBC=""
780 $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null
781 if test "$?" = 0 ; then
782 ./$dummy | grep 1\.99 > /dev/null
783 if test "$?" = 0 ; then
784 LIBC="libc1"
787 rm -f $dummy.c $dummy
788 echo powerpc-unknown-linux-gnu${LIBC} ; exit 0 ;;
789 esac
791 if test "${UNAME_MACHINE}" = "alpha" ; then
792 sed 's/^ //' <<EOF >$dummy.s
793 .globl main
794 .ent main
795 main:
796 .frame \$30,0,\$26,0
797 .prologue 0
798 .long 0x47e03d80 # implver $0
799 lda \$2,259
800 .long 0x47e20c21 # amask $2,$1
801 srl \$1,8,\$2
802 sll \$2,2,\$2
803 sll \$0,3,\$0
804 addl \$1,\$0,\$0
805 addl \$2,\$0,\$0
806 ret \$31,(\$26),1
807 .end main
809 LIBC=""
810 $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
811 if test "$?" = 0 ; then
812 ./$dummy
813 case "$?" in
815 UNAME_MACHINE="alpha"
818 UNAME_MACHINE="alphaev5"
821 UNAME_MACHINE="alphaev56"
824 UNAME_MACHINE="alphapca56"
827 UNAME_MACHINE="alphaev6"
829 esac
831 objdump --private-headers $dummy | \
832 grep ld.so.1 > /dev/null
833 if test "$?" = 0 ; then
834 LIBC="libc1"
837 rm -f $dummy.s $dummy
838 echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} ; exit 0
839 elif test "${UNAME_MACHINE}" = "mips" ; then
840 cat >$dummy.c <<EOF
841 #ifdef __cplusplus
842 int main (int argc, char *argv[]) {
843 #else
844 int main (argc, argv) int argc; char *argv[]; {
845 #endif
846 #ifdef __MIPSEB__
847 printf ("%s-unknown-linux-gnu\n", argv[1]);
848 #endif
849 #ifdef __MIPSEL__
850 printf ("%sel-unknown-linux-gnu\n", argv[1]);
851 #endif
852 return 0;
855 $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0
856 rm -f $dummy.c $dummy
857 else
858 # Either a pre-BFD a.out linker (linux-gnuoldld)
859 # or one that does not give us useful --help.
860 # GCC wants to distinguish between linux-gnuoldld and linux-gnuaout.
861 # If ld does not provide *any* "supported emulations:"
862 # that means it is gnuoldld.
863 echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations:"
864 test $? != 0 && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0
866 case "${UNAME_MACHINE}" in
867 i?86)
868 VENDOR=pc;
871 VENDOR=unknown;
873 esac
874 # Determine whether the default compiler is a.out or elf
875 cat >$dummy.c <<EOF
876 #include <features.h>
877 #ifdef __cplusplus
878 int main (int argc, char *argv[]) {
879 #else
880 int main (argc, argv) int argc; char *argv[]; {
881 #endif
882 #ifdef __ELF__
883 # ifdef __GLIBC__
884 # if __GLIBC__ >= 2
885 printf ("%s-${VENDOR}-linux-gnu\n", argv[1]);
886 # else
887 printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]);
888 # endif
889 # else
890 printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]);
891 # endif
892 #else
893 printf ("%s-${VENDOR}-linux-gnuaout\n", argv[1]);
894 #endif
895 return 0;
898 ${CC-cc} $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0
899 rm -f $dummy.c $dummy
900 fi ;;
901 # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. earlier versions
902 # are messed up and put the nodename in both sysname and nodename.
903 i?86:DYNIX/ptx:4*:*)
904 echo i386-sequent-sysv4
905 exit 0 ;;
906 # added by chet for bash based on usenet posting from <hops@sco.com> and
907 # documentation on SCO's web site -- UnixWare 7 (SVR5)
908 # i?86:UnixWare:5*:*)
909 # echo ${UNAME_MACHINE}-pc-sysv5uw${UNAME_VERSION}
910 # exit 0 ;;
911 i?86:UNIX_SV:4.2MP:2.*)
912 # Unixware is an offshoot of SVR4, but it has its own version
913 # number series starting with 2...
914 # I am not positive that other SVR4 systems won't match this,
915 # I just have to hope. -- rms.
916 # Use sysv4.2uw... so that sysv4* matches it.
917 echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
918 exit 0 ;;
919 i?86:*:4.*:* | i?86:SYSTEM_V:4.*:* | i?86:UNIX_SV:4.*:*)
920 if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
921 echo ${UNAME_MACHINE}-univel-sysv${UNAME_RELEASE}
922 else
923 echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE}
925 exit 0 ;;
926 i?86:*:5:7*)
927 UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')`
928 (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
929 (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) && UNAME_MACHINE=i586
930 (/bin/uname -X|egrep '^Machine.*Pent.*II' >/dev/null) && UNAME_MACHINE=i686
931 (/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) && UNAME_MACHINE=i585
932 echo ${UNAME_MACHINE}-${UNAME_SYSTEM}${UNAME_VERSION}-sysv${UNAME_RELEASE}
933 exit 0 ;;
934 i?86:*:3.2:*)
935 if test -f /usr/options/cb.name; then
936 UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
937 echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
938 elif /bin/uname -X 2>/dev/null >/dev/null ; then
939 UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')`
940 (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
941 (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \
942 && UNAME_MACHINE=i586
943 (/bin/uname -X|egrep '^Machine.*Pent ?II' >/dev/null) \
944 && UNAME_MACHINE=i686
945 (/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \
946 && UNAME_MACHINE=i686
947 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
948 else
949 echo ${UNAME_MACHINE}-pc-sysv32
951 exit 0 ;;
952 pc:*:*:*)
953 # uname -m prints for DJGPP always 'pc', but it prints nothing about
954 # the processor, so we play safe by assuming i386.
955 echo i386-pc-msdosdjgpp
956 exit 0 ;;
957 Intel:Mach:3*:*)
958 echo i386-pc-mach3
959 exit 0 ;;
960 paragon:*:*:*)
961 echo i860-intel-osf1
962 exit 0 ;;
963 i860:*:4.*:*) # i860-SVR4
964 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
965 echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
966 else # Add other i860-SVR4 vendors below as they are discovered.
967 echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
969 exit 0 ;;
970 mini*:CTIX:SYS*5:*)
971 # "miniframe"
972 echo m68010-convergent-sysv
973 exit 0 ;;
974 M68*:*:R3V[567]*:*)
975 test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
976 3[34]??:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0)
977 OS_REL=''
978 test -r /etc/.relid \
979 && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
980 /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
981 && echo i486-ncr-sysv4.3${OS_REL} && exit 0
982 /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
983 && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;;
984 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
985 /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
986 && echo i486-ncr-sysv4 && exit 0 ;;
987 mc68030:UNIX_System_V:4.*:*)
988 echo m68k-atari-sysv4
989 exit 0 ;;
990 m68*:LynxOS:2.*:*)
991 echo m68k-unknown-lynxos${UNAME_RELEASE}
992 exit 0 ;;
993 i?86:LynxOS:2.*:* | i?86:LynxOS:3.[01]*:*)
994 echo i386-pc-lynxos${UNAME_RELEASE}
995 exit 0 ;;
996 TSUNAMI:LynxOS:2.*:*)
997 echo sparc-unknown-lynxos${UNAME_RELEASE}
998 exit 0 ;;
999 rs6000:LynxOS:2.*:* | PowerPC:LynxOS:2.*:*)
1000 echo rs6000-unknown-lynxos${UNAME_RELEASE}
1001 exit 0 ;;
1002 *:LynxOS:*:*)
1003 echo ${UNAME_MACHINE}-unknown-lynxos${UNAME_RELEASE}
1004 exit 0 ;;
1005 SM[BE]S:UNIX_SV:*:*)
1006 echo mips-dde-sysv${UNAME_RELEASE}
1007 exit 0 ;;
1008 RM*:SINIX-*:*:* | RM*:ReliantUNIX-*:*:*)
1009 echo mips-sni-sysv4
1010 exit 0 ;;
1011 *:SINIX-*:*:*)
1012 if uname -p 2>/dev/null >/dev/null ; then
1013 UNAME_MACHINE=`(uname -p) 2>/dev/null`
1014 echo ${UNAME_MACHINE}-sni-sysv4
1015 else
1016 echo ns32k-sni-sysv
1018 exit 0 ;;
1019 PENTIUM:CPunix:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
1020 # says <Richard.M.Bartel@ccMail.Census.GOV>
1021 echo i586-unisys-sysv4
1022 exit 0 ;;
1023 *:UNIX_System_V:4*:FTX*)
1024 # From Gerald Hewes <hewes@openmarket.com>.
1025 # How about differentiating between stratus architectures? -djm
1026 echo hppa1.1-stratus-sysv4
1027 exit 0 ;;
1028 *:*:*:FTX*)
1029 # From seanf@swdc.stratus.com.
1030 echo i860-stratus-sysv4
1031 exit 0 ;;
1032 mc68*:A/UX:*:*)
1033 echo m68k-apple-aux${UNAME_RELEASE}
1034 exit 0 ;;
1035 news*:NEWS-OS:*:6*)
1036 echo mips-sony-newsos6
1037 exit 0 ;;
1038 R3000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
1039 if [ -d /usr/nec ]; then
1040 echo mips-nec-sysv${UNAME_RELEASE}
1041 else
1042 echo mips-unknown-sysv${UNAME_RELEASE}
1044 exit 0 ;;
1045 BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
1046 echo powerpc-apple-beos
1047 exit 0 ;;
1048 BeMac:BeOS:*:*)
1049 echo powerpc-apple-beos
1050 exit 0 ;;
1051 BePC:BeOS:*:*)
1052 echo i586-pc-beos
1053 exit 0 ;;
1054 SX-4:SUPER-UX:*:*)
1055 echo sx4-nec-superux${UNAME_RELEASE}
1056 exit 0 ;;
1057 SX-5:SUPER-UX:*:*)
1058 echo sx5-nec-superux${UNAME_RELEASE}
1059 exit 0 ;;
1060 Power*:Rhapsody:*:*)
1061 echo powerpc-apple-rhapsody${UNAME_RELEASE}
1062 exit 0 ;;
1063 *:Rhapsody:*:*)
1064 echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
1065 exit 0 ;;
1066 esac
1068 #echo '(No uname command or uname output not recognized.)' 1>&2
1069 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
1071 cat >$dummy.c <<EOF
1072 #ifdef _SEQUENT_
1073 # include <sys/types.h>
1074 # include <sys/utsname.h>
1075 #endif
1076 main ()
1078 #if defined (sony)
1079 #if defined (MIPSEB)
1080 /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
1081 I don't know.... */
1082 printf ("mips-sony-bsd\n"); exit (0);
1083 #else
1084 #include <sys/param.h>
1085 printf ("m68k-sony-newsos%s\n",
1086 #ifdef NEWSOS4
1088 #else
1090 #endif
1091 ); exit (0);
1092 #endif
1093 #endif
1095 #if defined (__arm) && defined (__acorn) && defined (__unix)
1096 printf ("arm-acorn-riscix\n"); exit (0);
1097 #endif
1099 #if defined (hp9000) && !defined (hpux)
1100 printf ("m68k-hp-bsd\n"); exit (0);
1101 #endif
1103 #if defined (hp300) && !defined (hpux)
1104 printf ("m68k-hp-bsd\n"); exit (0);
1105 #endif
1107 #if defined (NeXT)
1108 #if !defined (__ARCHITECTURE__)
1109 #define __ARCHITECTURE__ "m68k"
1110 #endif
1111 int version;
1112 version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
1113 if (version < 4)
1114 printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
1115 else
1116 printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
1117 exit (0);
1118 #endif
1120 #if defined (MULTIMAX) || defined (n16)
1121 #if defined (UMAXV)
1122 printf ("ns32k-encore-sysv\n"); exit (0);
1123 #else
1124 #if defined (CMU)
1125 printf ("ns32k-encore-mach\n"); exit (0);
1126 #else
1127 printf ("ns32k-encore-bsd\n"); exit (0);
1128 #endif
1129 #endif
1130 #endif
1132 #if defined (__386BSD__)
1133 printf ("i386-pc-bsd\n"); exit (0);
1134 #endif
1136 #if defined (sequent)
1137 #if defined (i386)
1138 printf ("i386-sequent-dynix\n"); exit (0);
1139 #endif
1140 #if defined (ns32000)
1141 printf ("ns32k-sequent-dynix\n"); exit (0);
1142 #endif
1143 #endif
1145 #if defined (_SEQUENT_)
1146 struct utsname un;
1148 uname(&un);
1150 if (strncmp(un.version, "V2", 2) == 0) {
1151 printf ("i386-sequent-ptx2\n"); exit (0);
1153 if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
1154 printf ("i386-sequent-ptx1\n"); exit (0);
1156 printf ("i386-sequent-ptx\n"); exit (0);
1158 #endif
1160 #if defined (vax)
1161 #if !defined (ultrix)
1162 printf ("vax-dec-bsd\n"); exit (0);
1163 #else
1164 printf ("vax-dec-ultrix\n"); exit (0);
1165 #endif
1166 #endif
1168 #if defined (alliant) && defined (i860)
1169 printf ("i860-alliant-bsd\n"); exit (0);
1170 #endif
1172 /* Begin cases added for Bash */
1173 #if defined (tahoe)
1174 printf ("tahoe-cci-bsd\n"); exit (0);
1175 #endif
1177 #if defined (nec_ews)
1178 # if defined (SYSTYPE_SYSV)
1179 printf ("ews4800-nec-sysv4\n"); exit 0;
1180 # else
1181 printf ("ews4800-nec-bsd\n"); exit (0);
1182 # endif
1183 #endif
1185 #if defined (sony)
1186 # if defined (SYSTYPE_SYSV)
1187 printf ("mips-sony-sysv4\n"); exit 0;
1188 # else
1189 printf ("mips-sony-bsd\n"); exit (0);
1190 # endif
1191 #endif
1193 #if defined (ardent)
1194 printf ("titan-ardent-bsd\n"); exit (0);
1195 #endif
1197 #if defined (stardent)
1198 printf ("stardent-stardent-sysv\n"); exit (0);
1199 #endif
1201 #if defined (ibm032)
1202 printf ("ibmrt-ibm-bsd4.3\n"); exit (0);
1203 #endif
1205 #if defined (sequent) && defined (i386)
1206 printf ("i386-sequent-bsd\n"); exit (0);
1207 #endif
1209 #if defined (qnx) && defined (i386)
1210 printf ("i386-pc-qnx\n"); exit (0);
1211 #endif
1213 #if defined (gould)
1214 printf ("gould-gould-bsd\n"); exit (0);
1215 #endif
1217 #if defined (unixpc)
1218 printf ("unixpc-att-sysv\n"); exit (0);
1219 #endif
1221 #if defined (att386)
1222 printf ("i386-att-sysv3\n"); exit (0);
1223 #endif
1225 #if defined (__m88k) && defined (__UMAXV__)
1226 printf ("m88k-encore-sysv3\n"); exit (0);
1227 #endif
1229 #if defined (drs6000)
1230 printf ("drs6000-icl-sysv4.2\n"); exit (0);
1231 #endif
1233 #if defined (clipper)
1234 printf ("clipper-orion-bsd\n"); exit (0);
1235 #endif
1237 #if defined (is68k)
1238 printf ("m68k-isi-bsd\n"); exit (0);
1239 #endif
1241 #if defined (luna88k)
1242 printf ("luna88k-omron-bsd\n"); exit (0);
1243 #endif
1245 #if defined (butterfly) && defined (BFLY1)
1246 printf ("butterfly-bbn-mach\n"); exit (0);
1247 #endif
1249 #if defined (tower32)
1250 printf ("tower32-ncr-sysv4\n"); exit (0);
1251 #endif
1253 #if defined (MagicStation)
1254 printf ("magicstation-unknown-bsd\n"); exit (0);
1255 #endif
1257 #if defined (scs)
1258 printf ("symmetric-scs-bsd4.2\n"); exit (0);
1259 #endif
1261 #if defined (tandem)
1262 printf ("tandem-tandem-sysv\n"); exit (0);
1263 #endif
1265 #if defined (cadmus)
1266 printf ("cadmus-pcs-sysv\n"); exit (0);
1267 #endif
1269 #if defined (masscomp)
1270 printf ("masscomp-masscomp-sysv3\n"); exit (0);
1271 #endif
1273 #if defined (hbullx20)
1274 printf ("hbullx20-bull-sysv3\n"); exit (0);
1275 #endif
1277 /* End cases added for Bash */
1279 exit (1);
1283 ${CC-cc} $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm $dummy.c $dummy && exit 0
1284 rm -f $dummy.c $dummy
1286 # Apollos put the system type in the environment.
1288 test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; }
1290 # Convex versions that predate uname can use getsysinfo(1)
1292 if [ -x /usr/convex/getsysinfo ]
1293 then
1294 case `getsysinfo -f cpu_type` in
1295 c1*)
1296 echo c1-convex-bsd
1297 exit 0 ;;
1298 c2*)
1299 if getsysinfo -f scalar_acc
1300 then echo c32-convex-bsd
1301 else echo c2-convex-bsd
1303 exit 0 ;;
1304 c34*)
1305 echo c34-convex-bsd
1306 exit 0 ;;
1307 c38*)
1308 echo c38-convex-bsd
1309 exit 0 ;;
1310 c4*)
1311 echo c4-convex-bsd
1312 exit 0 ;;
1313 esac
1316 # Begin cases added for Bash
1317 case "$UNAME" in
1318 uts) echo uts-amdahl-sysv${UNAME_RELEASE}; exit 0 ;;
1319 esac
1321 if [ -d /usr/amiga ]; then
1322 echo m68k-cbm-sysv${UNAME_RELEASE}; exit 0;
1325 if [ -f /bin/fxc.info ]; then
1326 echo fxc-alliant-concentrix
1327 exit 0
1329 # end cases added for Bash
1331 #echo '(Unable to guess system type)' 1>&2
1333 exit 1