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"
45 if test x"$CC" != x; then
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
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
70 *) RELEASE=`expr "$RELEASE" + 0` ;;
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
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
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
89 echo alpha-dec-netbsd${UNAME_RELEASE}
92 echo alpha-dec-openbsd${UNAME_RELEASE}
95 echo ${UNAME_MACHINE}-pc-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
98 echo ${UNAME_MACHINE}-pc-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
101 echo sparc-unknown-netbsd${UNAME_RELEASE}
104 echo sparc-unknown-openbsd${UNAME_RELEASE}
107 echo vax-dec-netbsd${UNAME_RELEASE}
110 echo vax-dec-openbsd${UNAME_RELEASE}
113 echo mac68k-apple-machten${UNAME_RELEASE}
116 if test "`(/bin/universe) 2>/dev/null`" = att ; then
117 echo concurrent-concurrent-sysv3
119 echo concurrent-concurrent-bsd
123 echo ppc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
126 echo sparc-unknown-sysv${UNAME_RELEASE}
129 echo mips-mips-sysv${UNAME_RELEASE}
135 echo mips-mips-bsd4.4
137 MIServer-S:SMP_DC.OSx:*:dcosx)
138 echo mips-pyramid-sysv4
141 echo mips-sony-newsos${UNAME_RELEASE}
144 echo i386-next-nextstep${RELEASE}
147 echo m68k-next-nextstep${RELEASE}
155 esa:OSF*1:*:* | ESA:OSF*:*:*)
165 echo i386-qssl-qnx`echo ${UNAME_VERSION}`
167 Alpha*:Windows:NT:*:SP*)
173 # end cases added for Bash
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.
188 .long 0x47e03d80 # implver $0
190 .long 0x47e20c21 # amask $2,$1
199 $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
200 if test "$?" = 0 ; then
204 UNAME_MACHINE="alpha"
207 UNAME_MACHINE="alphaev5"
210 UNAME_MACHINE="alphaev56"
213 UNAME_MACHINE="alphapca56"
216 UNAME_MACHINE="alphaev6"
220 rm -f $dummy.s $dummy
221 echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
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
229 21064:Windows_NT:50:3)
230 echo alpha-dec-winnt3.5
232 Amiga*:UNIX_System_V:4.0:*)
236 echo m68k-cbm-netbsd${UNAME_RELEASE}
239 echo m68k-cbm-openbsd${UNAME_RELEASE}
241 *:[Aa]miga[Oo][Ss]:*:*)
242 echo ${UNAME_MACHINE}-unknown-amigaos
245 echo mips64el-unknown-openbsd${UNAME_RELEASE}
248 echo mipsel-unknown-openbsd${UNAME_RELEASE}
251 echo mips-unknown-openbsd${UNAME_RELEASE}
254 echo mipsel-unknown-openbsd${UNAME_RELEASE}
257 echo mips-unknown-openbsd${UNAME_RELEASE}
260 echo mipsel-unknown-openbsd${UNAME_RELEASE}
262 arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
263 echo arm-acorn-riscix${UNAME_RELEASE}
266 echo arm-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
268 SR2?01:HI-UX/MPP:*:*)
269 echo hppa1.1-hitachi-hiuxmpp
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
276 echo pyramid-pyramid-bsd
280 echo pyramid-pyramid-svr4
283 echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
285 sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
286 echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
289 echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
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/[^.]*//'`
298 case "`/usr/bin/arch -k`" in
300 UNAME_RELEASE=`uname -v`
303 # Japanese Language versions have a version number like `4.1.3-JL'.
304 echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
307 echo m68k-sun-sunos${UNAME_RELEASE}
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
314 echo m68k-sun-sunos${UNAME_RELEASE}
317 echo sparc-sun-sunos${UNAME_RELEASE}
322 echo sparc-auspex-sunos${UNAME_RELEASE}
325 echo m68k-atari-netbsd${UNAME_RELEASE}
328 echo m68k-unknown-openbsd${UNAME_RELEASE}
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
338 atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
339 echo m68k-atari-mint${UNAME_RELEASE}
341 atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
342 echo m68k-atari-mint${UNAME_RELEASE}
344 *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
345 echo m68k-atari-mint${UNAME_RELEASE}
347 milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
348 echo m68k-milan-mint${UNAME_RELEASE}
350 hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
351 echo m68k-hades-mint${UNAME_RELEASE}
353 *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
354 echo m68k-unknown-mint${UNAME_RELEASE}
357 echo m68k-sun-netbsd${UNAME_RELEASE}
360 echo m68k-unknown-openbsd${UNAME_RELEASE}
363 echo m68k-apple-netbsd${UNAME_RELEASE}
366 echo m68k-unknown-openbsd${UNAME_RELEASE}
369 echo m68k-unknown-openbsd${UNAME_RELEASE}
372 echo m88k-unknown-openbsd${UNAME_RELEASE}
375 echo `uname -p`-apple-macos${UNAME_RELEASE}
378 echo powerpc-apple-machten${UNAME_RELEASE}
381 echo powerpc-apple-netbsd${UNAME_RELEASE}
384 echo mips-dec-mach_bsd4.3
387 echo mips-dec-ultrix${UNAME_RELEASE}
390 echo vax-dec-ultrix${UNAME_RELEASE}
392 2020:CLIX:*:* | 2430:CLIX:*:*)
393 echo clipper-intergraph-clix${UNAME_RELEASE}
395 mips:*:*:UMIPS | mips:*:*:RISCos)
396 sed 's/^ //' << EOF >$dummy.c
398 int main (int argc, char *argv[]) {
400 int main (argc, argv) int argc; char *argv[]; {
402 #if defined (host_mips) && defined (MIPSEB)
403 #if defined (SYSTYPE_SYSV)
404 printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
406 #if defined (SYSTYPE_SVR4)
407 printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
409 #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
410 printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
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}
422 Night_Hawk:Power_UNIX:*:*)
423 echo powerpc-harris-powerunix
426 echo m88k-harris-cxux7
429 echo m88k-motorola-sysv4
432 echo m88k-motorola-sysv3
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}
442 echo m88k-dg-dguxbcs${UNAME_RELEASE}
445 echo i586-dg-dgux${UNAME_RELEASE}
448 M88*:DolphinOS:*:*) # DolphinOS (SVR3)
449 echo m88k-dolphin-sysv3
452 # Delta 88k system running SVR3
453 echo m88k-motorola-sysv3
455 XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
456 echo m88k-tektronix-sysv3
458 Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
459 echo m68k-tektronix-bsd
462 echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
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 '
471 if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
472 sed 's/^ //' << EOF >$dummy.c
473 #include <sys/systemcfg.h>
479 puts("powerpc-ibm-aix3.2.5");
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
489 echo rs6000-ibm-aix3.2
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
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
503 elif grep bos411 /usr/include/stdio.h >/dev/null 2>&1; then
506 IBM_REV=4.${UNAME_RELEASE}
508 echo ${IBM_ARCH}-ibm-aix${IBM_REV}
513 ibmrt:4.4BSD:*|romp-ibm:BSD:*)
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
520 echo rs6000-bull-bosx
525 9000/[34]??:4.3bsd:1.*:*)
528 hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
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
542 #if defined(_SC_KERNEL_BITS)
543 long bits = sysconf(_SC_KERNEL_BITS);
545 long cpu = sysconf (_SC_CPU_VERSION);
549 case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
550 case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
552 #if defined(_SC_KERNEL_BITS)
555 case 64: puts ("hppa2.0w"); break;
556 case 32: puts ("hppa2.0n"); break;
557 default: puts ("hppa2.0"); break;
559 #else /* !defined(_SC_KERNEL_BITS) */
560 puts ("hppa2.0"); break;
562 default: puts ("hppa1.0"); break;
567 ($CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy`
568 rm -f $dummy.c $dummy
570 HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
571 echo ${HP_ARCH}-hp-hpux${HPUX_REV}
574 sed 's/^ //' << EOF >$dummy.c
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
583 if (CPU_IS_PA_RISC (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");
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
603 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
610 echo hppa1.0-hp-mpeix
612 hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
619 if [ -x /usr/sbin/sysversion ] ; then
620 echo ${UNAME_MACHINE}-unknown-osf1mk
622 echo ${UNAME_MACHINE}-unknown-osf1
626 echo hppa1.1-hp-lites
629 echo hppa-unknown-openbsd
631 C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
634 C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
635 if getsysinfo -f scalar_acc
636 then echo c32-convex-bsd
637 else echo c2-convex-bsd
640 C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
643 C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
646 C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
653 echo ymp-cray-unicos${UNAME_RELEASE}
656 echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
657 | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
658 -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/
661 echo t90-cray-unicos${UNAME_RELEASE}
664 echo alpha-cray-unicosmk${UNAME_RELEASE}
667 echo cray2-cray-unicos
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}"
674 F301:UNIX_System_V:*:*)
675 echo f301-fujitsu-uxpv`echo $UNAME_RELEASE | sed 's/ .*//'`
677 hp3[0-9][05]:NetBSD:*:*)
678 echo m68k-hp-netbsd${UNAME_RELEASE}
681 echo m68k-unknown-openbsd${UNAME_RELEASE}
683 i?86:BSD/386:*:* | i?86:BSD/OS:*:*)
684 echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
687 echo sparc-unknown-bsdi${UNAME_RELEASE}
690 echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
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/[-_].*//'`
699 echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-=(].*//'`
702 echo ${UNAME_MACHINE}-unknown-dragonflyelf`echo ${UNAME_RELEASE}|sed -e 's/[-_].*//'`
705 echo ${UNAME_MACHINE}-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
708 echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
711 echo ${UNAME_MACHINE}-pc-cygwin32
714 echo ${UNAME_MACHINE}-pc-mingw32
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?
723 echo ${UNAME_MACHINE}-pc-uwin
726 echo powerpcle-unknown-cygwin
729 echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
732 echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
735 # uname on the ARM produces all sorts of strangeness, and we need to
737 case "$UNAME_MACHINE" in
738 armv*) UNAME_MACHINE=$UNAME_MACHINE ;;
739 arm* | sa110*) UNAME_MACHINE="arm" ;;
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
749 s/.*supported emulations: *//
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
762 #include <features.h>
763 #if defined(__GLIBC__)
764 extern char __libc_version[];
765 extern char __libc_release[];
771 #if defined(__GLIBC__)
772 printf("%s %s\n", __libc_version, __libc_release);
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
787 rm -f $dummy.c $dummy
788 echo powerpc-unknown-linux-gnu${LIBC} ; exit 0 ;;
791 if test "${UNAME_MACHINE}" = "alpha" ; then
792 sed 's/^ //' <<EOF >$dummy.s
798 .long 0x47e03d80 # implver $0
800 .long 0x47e20c21 # amask $2,$1
810 $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
811 if test "$?" = 0 ; then
815 UNAME_MACHINE="alpha"
818 UNAME_MACHINE="alphaev5"
821 UNAME_MACHINE="alphaev56"
824 UNAME_MACHINE="alphapca56"
827 UNAME_MACHINE="alphaev6"
831 objdump --private-headers $dummy | \
832 grep ld.so.1 > /dev/null
833 if test "$?" = 0 ; then
837 rm -f $dummy.s $dummy
838 echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} ; exit 0
839 elif test "${UNAME_MACHINE}" = "mips" ; then
842 int main (int argc, char *argv[]) {
844 int main (argc, argv) int argc; char *argv[]; {
847 printf ("%s-unknown-linux-gnu\n", argv[1]);
850 printf ("%sel-unknown-linux-gnu\n", argv[1]);
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
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
874 # Determine whether the default compiler is a.out or elf
876 #include <features.h>
878 int main (int argc, char *argv[]) {
880 int main (argc, argv) int argc; char *argv[]; {
885 printf ("%s-${VENDOR}-linux-gnu\n", argv[1]);
887 printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]);
890 printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]);
893 printf ("%s-${VENDOR}-linux-gnuaout\n", argv[1]);
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
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.
904 echo i386-sequent-sysv4
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}
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}
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}
923 echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE}
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}
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
949 echo ${UNAME_MACHINE}-pc-sysv32
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
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
972 echo m68010-convergent-sysv
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)
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
991 echo m68k-unknown-lynxos${UNAME_RELEASE}
993 i?86:LynxOS:2.*:* | i?86:LynxOS:3.[01]*:*)
994 echo i386-pc-lynxos${UNAME_RELEASE}
996 TSUNAMI:LynxOS:2.*:*)
997 echo sparc-unknown-lynxos${UNAME_RELEASE}
999 rs6000:LynxOS:2.*:* | PowerPC:LynxOS:2.*:*)
1000 echo rs6000-unknown-lynxos${UNAME_RELEASE}
1003 echo ${UNAME_MACHINE}-unknown-lynxos${UNAME_RELEASE}
1005 SM[BE]S:UNIX_SV:*:*)
1006 echo mips-dde-sysv${UNAME_RELEASE}
1008 RM*:SINIX-*:*:* | RM*:ReliantUNIX-*:*:*)
1012 if uname -p 2>/dev/null >/dev/null ; then
1013 UNAME_MACHINE=`(uname -p) 2>/dev/null`
1014 echo ${UNAME_MACHINE}-sni-sysv4
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
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
1029 # From seanf@swdc.stratus.com.
1030 echo i860-stratus-sysv4
1033 echo m68k-apple-aux${UNAME_RELEASE}
1036 echo mips-sony-newsos6
1038 R3000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
1039 if [ -d /usr/nec ]; then
1040 echo mips-nec-sysv${UNAME_RELEASE}
1042 echo mips-unknown-sysv${UNAME_RELEASE}
1045 BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
1046 echo powerpc-apple-beos
1049 echo powerpc-apple-beos
1055 echo sx4-nec-superux${UNAME_RELEASE}
1058 echo sx5-nec-superux${UNAME_RELEASE}
1060 Power*:Rhapsody:*:*)
1061 echo powerpc-apple-rhapsody${UNAME_RELEASE}
1064 echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
1068 #echo '(No uname command or uname output not recognized.)' 1>&2
1069 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
1073 # include <sys/types.h>
1074 # include <sys/utsname.h>
1079 #if defined (MIPSEB)
1080 /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
1082 printf ("mips-sony-bsd\n"); exit (0);
1084 #include <sys/param.h>
1085 printf ("m68k-sony-newsos%s\n",
1095 #if defined (__arm) && defined (__acorn) && defined (__unix)
1096 printf ("arm-acorn-riscix\n"); exit (0);
1099 #if defined (hp9000) && !defined (hpux)
1100 printf ("m68k-hp-bsd\n"); exit (0);
1103 #if defined (hp300) && !defined (hpux)
1104 printf ("m68k-hp-bsd\n"); exit (0);
1108 #if !defined (__ARCHITECTURE__)
1109 #define __ARCHITECTURE__ "m68k"
1112 version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
1114 printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
1116 printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
1120 #if defined (MULTIMAX) || defined (n16)
1122 printf ("ns32k-encore-sysv\n"); exit (0);
1125 printf ("ns32k-encore-mach\n"); exit (0);
1127 printf ("ns32k-encore-bsd\n"); exit (0);
1132 #if defined (__386BSD__)
1133 printf ("i386-pc-bsd\n"); exit (0);
1136 #if defined (sequent)
1138 printf ("i386-sequent-dynix\n"); exit (0);
1140 #if defined (ns32000)
1141 printf ("ns32k-sequent-dynix\n"); exit (0);
1145 #if defined (_SEQUENT_)
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);
1161 #if !defined (ultrix)
1162 printf ("vax-dec-bsd\n"); exit (0);
1164 printf ("vax-dec-ultrix\n"); exit (0);
1168 #if defined (alliant) && defined (i860)
1169 printf ("i860-alliant-bsd\n"); exit (0);
1172 /* Begin cases added for Bash */
1174 printf ("tahoe-cci-bsd\n"); exit (0);
1177 #if defined (nec_ews)
1178 # if defined (SYSTYPE_SYSV)
1179 printf ("ews4800-nec-sysv4\n"); exit 0;
1181 printf ("ews4800-nec-bsd\n"); exit (0);
1186 # if defined (SYSTYPE_SYSV)
1187 printf ("mips-sony-sysv4\n"); exit 0;
1189 printf ("mips-sony-bsd\n"); exit (0);
1193 #if defined (ardent)
1194 printf ("titan-ardent-bsd\n"); exit (0);
1197 #if defined (stardent)
1198 printf ("stardent-stardent-sysv\n"); exit (0);
1201 #if defined (ibm032)
1202 printf ("ibmrt-ibm-bsd4.3\n"); exit (0);
1205 #if defined (sequent) && defined (i386)
1206 printf ("i386-sequent-bsd\n"); exit (0);
1209 #if defined (qnx) && defined (i386)
1210 printf ("i386-pc-qnx\n"); exit (0);
1214 printf ("gould-gould-bsd\n"); exit (0);
1217 #if defined (unixpc)
1218 printf ("unixpc-att-sysv\n"); exit (0);
1221 #if defined (att386)
1222 printf ("i386-att-sysv3\n"); exit (0);
1225 #if defined (__m88k) && defined (__UMAXV__)
1226 printf ("m88k-encore-sysv3\n"); exit (0);
1229 #if defined (drs6000)
1230 printf ("drs6000-icl-sysv4.2\n"); exit (0);
1233 #if defined (clipper)
1234 printf ("clipper-orion-bsd\n"); exit (0);
1238 printf ("m68k-isi-bsd\n"); exit (0);
1241 #if defined (luna88k)
1242 printf ("luna88k-omron-bsd\n"); exit (0);
1245 #if defined (butterfly) && defined (BFLY1)
1246 printf ("butterfly-bbn-mach\n"); exit (0);
1249 #if defined (tower32)
1250 printf ("tower32-ncr-sysv4\n"); exit (0);
1253 #if defined (MagicStation)
1254 printf ("magicstation-unknown-bsd\n"); exit (0);
1258 printf ("symmetric-scs-bsd4.2\n"); exit (0);
1261 #if defined (tandem)
1262 printf ("tandem-tandem-sysv\n"); exit (0);
1265 #if defined (cadmus)
1266 printf ("cadmus-pcs-sysv\n"); exit (0);
1269 #if defined (masscomp)
1270 printf ("masscomp-masscomp-sysv3\n"); exit (0);
1273 #if defined (hbullx20)
1274 printf ("hbullx20-bull-sysv3\n"); exit (0);
1277 /* End cases added for Bash */
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 ]
1294 case `getsysinfo -f cpu_type` in
1299 if getsysinfo -f scalar_acc
1300 then echo c32-convex-bsd
1301 else echo c2-convex-bsd
1316 # Begin cases added for Bash
1318 uts) echo uts-amdahl-sysv${UNAME_RELEASE}; exit 0 ;;
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
1329 # end cases added for Bash
1331 #echo '(Unable to guess system type)' 1>&2