2 # Attempt to guess a canonical system name.
3 # Copyright (C) 1992, 1993, 1994, 1995, 1996 Free Software Foundation, Inc.
5 # This file is free software; you can redistribute it and/or modify it
6 # under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2 of the License, or
8 # (at your option) any later version.
10 # This program is distributed in the hope that it will be useful, but
11 # WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 # General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 # As a special exception to the GNU General Public License, if you
20 # distribute this file as part of a program that contains a
21 # configuration script generated by Autoconf, you may include it under
22 # the same distribution terms that you use for the rest of that program.
24 # Written by Per Bothner <bothner@cygnus.com>.
25 # The master version of this file is at the FSF in /home/gd/gnu/lib.
27 # This script attempts to guess a canonical system name similar to
28 # config.sub. If it succeeds, it prints the system name on stdout, and
29 # exits with 0. Otherwise, it exits with 1.
31 # The plan is that this can be called by configure scripts if you
32 # don't specify an explicit system type (host/target name).
34 # Only a few systems have been added to this list; please add others
35 # (but try to keep the structure clean).
38 # Use $HOST_CC if defined. $CC may point to a cross-compiler
39 if test x
"$CC_FOR_BUILD" = x
; then
40 if test x
"$HOST_CC" != x
; then
41 CC_FOR_BUILD
="$HOST_CC"
43 if test x
"$CC" != x
; then
51 # This is needed to find uname on a Pyramid OSx when run in the BSD universe.
52 # (ghazi@noc.rutgers.edu 8/24/94.)
53 if (test -f /.attbin
/uname
) >/dev
/null
2>&1 ; then
54 PATH
=$PATH:/.attbin
; export PATH
55 elif (test -f /usr
/5bin
/uname
) >/dev
/null
2>&1 ; then
59 UNAME
=`(uname) 2>/dev/null` || UNAME
=unknown
60 UNAME_MACHINE
=`(uname -m) 2>/dev/null` || UNAME_MACHINE
=unknown
61 UNAME_RELEASE
=`(uname -r) 2>/dev/null` || UNAME_RELEASE
=unknown
62 UNAME_SYSTEM
=`(uname -s) 2>/dev/null` || UNAME_SYSTEM
=unknown
63 UNAME_VERSION
=`(uname -v) 2>/dev/null` || UNAME_VERSION
=unknown
65 RELEASE
=`expr "$UNAME_RELEASE" : '[^0-9]*\([0-9]*\)'` # 4
68 *) RELEASE
=`expr "$RELEASE" + 0` ;;
70 REL_LEVEL
=`expr "$UNAME_RELEASE" : '[^0-9]*[0-9]*.\([0-9]*\)'` # 1
71 REL_SUBLEVEL
=`expr "$UNAME_RELEASE" : '[^0-9]*[0-9]*.[0-9]*.\([0-9]*\)'` # 2
74 trap 'rm -f $dummy.c $dummy.o $dummy; exit 1' 1 2 15
76 # Some versions of i386 SVR4.2 make `uname' equivalent to `uname -n', which
77 # is contrary to all other versions of uname
78 if [ -n "$UNAME" ] && [ "$UNAME_S" != "$UNAME" ] && [ "$UNAME_S" = UNIX_SV
]; then
82 # Note: order is significant - the case branches are not exclusive.
84 case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
85 # Begin cases added for Bash
87 echo alpha-dec-netbsd
${UNAME_RELEASE}
90 echo alpha-dec-openbsd
${UNAME_RELEASE}
93 echo ${UNAME_MACHINE}-pc-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
96 echo ${UNAME_MACHINE}-pc-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
99 echo sparc-unknown-netbsd
${UNAME_RELEASE}
102 echo sparc-unknown-openbsd
${UNAME_RELEASE}
105 echo vax-dec-netbsd
${UNAME_RELEASE}
108 echo vax-dec-openbsd
${UNAME_RELEASE}
111 echo mac68k-apple-machten
${UNAME_RELEASE}
114 if test "`(/bin/universe) 2>/dev/null`" = att
; then
115 echo concurrent-concurrent-sysv3
117 echo concurrent-concurrent-bsd
121 echo ppc-sun-solaris2
`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
124 echo sparc-unknown-sysv
${UNAME_RELEASE}
127 echo mips-mips-sysv
${UNAME_RELEASE}
133 echo mips-mips-bsd4.4
135 MIServer-S
:SMP_DC.OSx
:*:dcosx
)
136 echo mips-pyramid-sysv4
139 echo mips-sony-newsos
${UNAME_RELEASE}
142 echo i386-next-nextstep
${RELEASE}
145 echo m68k-next-nextstep
${RELEASE}
153 esa
:OSF
*1:*:* | ESA
:OSF
*:*:*)
163 echo i386-qssl-qnx
`echo ${UNAME_VERSION}`
165 Alpha
*:Windows
:NT
:*:SP
*)
171 # end cases added for Bash
173 if test $UNAME_RELEASE = "V4.0"; then
174 UNAME_RELEASE
=`/usr/sbin/sizer -v | awk '{print $3}'`
176 # A Vn.n version is a released version.
177 # A Tn.n version is a released field test version.
178 # A Xn.n version is an unreleased experimental baselevel.
179 # 1.2 uses "1.2" for uname -r.
186 .long 0x47e03d80 # implver $0
188 .long 0x47e20c21 # amask $2,$1
197 $CC_FOR_BUILD $dummy.s
-o $dummy 2>/dev
/null
198 if test "$?" = 0 ; then
202 UNAME_MACHINE
="alpha"
205 UNAME_MACHINE
="alphaev5"
208 UNAME_MACHINE
="alphaev56"
211 UNAME_MACHINE
="alphapca56"
214 UNAME_MACHINE
="alphaev6"
218 rm -f $dummy.s
$dummy
219 echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
221 Alpha\
*:Windows_NT
*:*)
222 # How do we know it's Interix rather than the generic POSIX subsystem?
223 # Should we change UNAME_MACHINE based on the output of uname instead
224 # of the specific Alpha model?
225 echo alpha-pc-interix
227 21064:Windows_NT
:50:3)
228 echo alpha-dec-winnt3.5
230 Amiga
*:UNIX_System_V
:4.0:*)
234 echo m68k-cbm-netbsd
${UNAME_RELEASE}
237 echo m68k-cbm-openbsd
${UNAME_RELEASE}
239 *:[Aa
]miga
[Oo
][Ss
]:*:*)
240 echo ${UNAME_MACHINE}-unknown-amigaos
243 echo mips64el-unknown-openbsd
${UNAME_RELEASE}
246 echo mipsel-unknown-openbsd
${UNAME_RELEASE}
249 echo mips-unknown-openbsd
${UNAME_RELEASE}
252 echo mipsel-unknown-openbsd
${UNAME_RELEASE}
255 echo mips-unknown-openbsd
${UNAME_RELEASE}
258 echo mipsel-unknown-openbsd
${UNAME_RELEASE}
260 arm
:RISC
*:1.
[012]*:*|arm
:riscix
:1.
[012]*:*)
261 echo arm-acorn-riscix
${UNAME_RELEASE}
264 echo arm-unknown-netbsd
`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
266 SR2?
01:HI-UX
/MPP
:*:*)
267 echo hppa1.1
-hitachi-hiuxmpp
269 Pyramid
*:OSx
*:*:* | MIS
*:OSx
*:*:* | MIS
*:SMP_DC-OSx
*:*:*)
270 # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
271 if test "`(/bin/universe) 2>/dev/null`" = att
; then
272 echo pyramid-pyramid-sysv3
274 echo pyramid-pyramid-bsd
278 echo pyramid-pyramid-svr4
281 echo sparc-hal-solaris2
`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
283 sun4
*:SunOS
:5.
*:* | tadpole
*:SunOS
:5.
*:*)
284 echo sparc-sun-solaris2
`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
287 echo i386-pc-solaris2
`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
290 # According to config.sub, this is the proper way to canonicalize
291 # SunOS6. Hard to guess exactly what SunOS6 will be like, but
292 # it's likely to be more like Solaris than SunOS4.
293 echo sparc-sun-solaris3
`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
296 case "`/usr/bin/arch -k`" in
298 UNAME_RELEASE
=`uname -v`
301 # Japanese Language versions have a version number like `4.1.3-JL'.
302 echo sparc-sun-sunos
`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
305 echo m68k-sun-sunos
${UNAME_RELEASE}
308 UNAME_RELEASE
=`(head -1 /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
309 test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE
=3
310 case "`/bin/arch`" in
312 echo m68k-sun-sunos
${UNAME_RELEASE}
315 echo sparc-sun-sunos
${UNAME_RELEASE}
320 echo sparc-auspex-sunos
${UNAME_RELEASE}
323 echo m68k-atari-netbsd
${UNAME_RELEASE}
326 echo m68k-unknown-openbsd
${UNAME_RELEASE}
328 # The situation for MiNT is a little confusing. The machine name
329 # can be virtually everything (everything which is not
330 # "atarist" or "atariste" at least should have a processor
331 # > m68000). The system name ranges from "MiNT" over "FreeMiNT"
332 # to the lowercase version "mint" (or "freemint"). Finally
333 # the system name "TOS" denotes a system which is actually not
334 # MiNT. But MiNT is downward compatible to TOS, so this should
336 atarist
[e
]:*MiNT
:*:* | atarist
[e
]:*mint
:*:* | atarist
[e
]:*TOS
:*:*)
337 echo m68k-atari-mint
${UNAME_RELEASE}
339 atari
*:*MiNT
:*:* | atari
*:*mint
:*:* | atarist
[e
]:*TOS
:*:*)
340 echo m68k-atari-mint
${UNAME_RELEASE}
342 *falcon
*:*MiNT
:*:* |
*falcon
*:*mint
:*:* |
*falcon
*:*TOS
:*:*)
343 echo m68k-atari-mint
${UNAME_RELEASE}
345 milan
*:*MiNT
:*:* | milan
*:*mint
:*:* |
*milan
*:*TOS
:*:*)
346 echo m68k-milan-mint
${UNAME_RELEASE}
348 hades
*:*MiNT
:*:* | hades
*:*mint
:*:* |
*hades
*:*TOS
:*:*)
349 echo m68k-hades-mint
${UNAME_RELEASE}
351 *:*MiNT
:*:* |
*:*mint
:*:* |
*:*TOS
:*:*)
352 echo m68k-unknown-mint
${UNAME_RELEASE}
355 echo m68k-sun-netbsd
${UNAME_RELEASE}
358 echo m68k-unknown-openbsd
${UNAME_RELEASE}
361 echo m68k-apple-netbsd
${UNAME_RELEASE}
364 echo m68k-unknown-openbsd
${UNAME_RELEASE}
367 echo m68k-unknown-openbsd
${UNAME_RELEASE}
370 echo m88k-unknown-openbsd
${UNAME_RELEASE}
373 echo `uname -p`-apple-macos${UNAME_RELEASE}
376 echo powerpc-apple-machten
${UNAME_RELEASE}
379 echo powerpc-apple-netbsd
${UNAME_RELEASE}
382 echo mips-dec-mach_bsd4.3
385 echo mips-dec-ultrix
${UNAME_RELEASE}
388 echo vax-dec-ultrix
${UNAME_RELEASE}
390 2020:CLIX
:*:* |
2430:CLIX
:*:*)
391 echo clipper-intergraph-clix
${UNAME_RELEASE}
393 mips
:*:*:UMIPS | mips
:*:*:RISCos
)
394 sed 's/^ //' << EOF >$dummy.c
396 int main (int argc, char *argv[]) {
398 int main (argc, argv) int argc; char *argv[]; {
400 #if defined (host_mips) && defined (MIPSEB)
401 #if defined (SYSTYPE_SYSV)
402 printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
404 #if defined (SYSTYPE_SVR4)
405 printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
407 #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
408 printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
414 $CC_FOR_BUILD $dummy.c
-o $dummy \
415 && .
/$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
416 && rm $dummy.c
$dummy && exit 0
417 rm -f $dummy.c
$dummy
418 echo mips-mips-riscos
${UNAME_RELEASE}
420 Night_Hawk
:Power_UNIX
:*:*)
421 echo powerpc-harris-powerunix
424 echo m88k-harris-cxux7
427 echo m88k-motorola-sysv4
430 echo m88k-motorola-sysv3
433 # DG/UX returns AViiON for all architectures
434 UNAME_PROCESSOR
=`/usr/bin/uname -p`
435 if [ $UNAME_PROCESSOR = mc88100
-o $UNAME_PROCESSOR = mc88110
] ; then
436 if [ ${TARGET_BINARY_INTERFACE}x
= m88kdguxelfx \
437 -o ${TARGET_BINARY_INTERFACE}x
= x
] ; then
438 echo m88k-dg-dgux
${UNAME_RELEASE}
440 echo m88k-dg-dguxbcs
${UNAME_RELEASE}
443 echo i586-dg-dgux
${UNAME_RELEASE}
446 M88
*:DolphinOS
:*:*) # DolphinOS (SVR3)
447 echo m88k-dolphin-sysv3
450 # Delta 88k system running SVR3
451 echo m88k-motorola-sysv3
453 XD88
*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
454 echo m88k-tektronix-sysv3
456 Tek43
[0-9][0-9]:UTek
:*:*) # Tektronix 4300 system running UTek (BSD)
457 echo m68k-tektronix-bsd
460 echo mips-sgi-irix
`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
462 ????????
:AIX?
:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
463 echo romp-ibm-aix
# uname -m gives an 8 hex-code CPU id
464 exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX '
469 if grep bos325
/usr
/include
/stdio.h
>/dev
/null
2>&1; then
470 sed 's/^ //' << EOF >$dummy.c
471 #include <sys/systemcfg.h>
477 puts("powerpc-ibm-aix3.2.5");
481 $CC_FOR_BUILD $dummy.c
-o $dummy && .
/$dummy && rm $dummy.c
$dummy && exit 0
482 rm -f $dummy.c
$dummy
483 echo rs6000-ibm-aix3.2
.5
484 elif grep bos324
/usr
/include
/stdio.h
>/dev
/null
2>&1; then
485 echo rs6000-ibm-aix3.2
.4
487 echo rs6000-ibm-aix3.2
491 IBM_CPU_ID
=`/usr/sbin/lsdev -C -c processor -S available | head -1 | awk '{ print $1 }'`
492 if /usr
/sbin
/lsattr
-EHl ${IBM_CPU_ID} |
grep POWER
>/dev
/null
2>&1; then
497 if [ -x /usr
/bin
/oslevel
] ; then
498 IBM_REV
=`/usr/bin/oslevel`
499 elif grep bos410
/usr
/include
/stdio.h
>/dev
/null
2>&1; then
501 elif grep bos411
/usr
/include
/stdio.h
>/dev
/null
2>&1; then
504 IBM_REV
=4.
${UNAME_RELEASE}
506 echo ${IBM_ARCH}-ibm-aix${IBM_REV}
511 ibmrt
:4.4BSD
:*|romp-ibm
:BSD
:*)
514 ibmrt
:*BSD
:*|romp-ibm
:BSD
:*) # covers RT/PC NetBSD and
515 echo romp-ibm-bsd
${UNAME_RELEASE} # 4.3 with uname added to
516 exit 0 ;; # report: romp-ibm BSD 4.3
518 echo rs6000-bull-bosx
523 9000/[34]??
:4.3bsd
:1.
*:*)
526 hp300
:4.4BSD
:*:* |
9000/[34]??
:4.3bsd
:2.
*:*)
529 9000/[34678]??
:HP-UX
:*:*)
530 case "${UNAME_MACHINE}" in
531 9000/31?
) HP_ARCH
=m68000
;;
532 9000/[34]??
) HP_ARCH
=m68k
;;
533 9000/[678][0-9][0-9])
534 sed 's/^ //' << EOF >$dummy.c
540 #if defined(_SC_KERNEL_BITS)
541 long bits = sysconf(_SC_KERNEL_BITS);
543 long cpu = sysconf (_SC_CPU_VERSION);
547 case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
548 case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
550 #if defined(_SC_KERNEL_BITS)
553 case 64: puts ("hppa2.0w"); break;
554 case 32: puts ("hppa2.0n"); break;
555 default: puts ("hppa2.0"); break;
557 #else /* !defined(_SC_KERNEL_BITS) */
558 puts ("hppa2.0"); break;
560 default: puts ("hppa1.0"); break;
565 ($CC_FOR_BUILD $dummy.c
-o $dummy 2>/dev
/null
) && HP_ARCH
=`./$dummy`
566 rm -f $dummy.c
$dummy
568 HPUX_REV
=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
569 echo ${HP_ARCH}-hp-hpux${HPUX_REV}
572 sed 's/^ //' << EOF >$dummy.c
577 long cpu = sysconf (_SC_CPU_VERSION);
578 /* The order matters, because CPU_IS_HP_MC68K erroneously returns
579 true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
581 if (CPU_IS_PA_RISC (cpu))
585 case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
586 case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
587 case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
588 default: puts ("hppa-hitachi-hiuxwe2"); break;
591 else if (CPU_IS_HP_MC68K (cpu))
592 puts ("m68k-hitachi-hiuxwe2");
593 else puts ("unknown-hitachi-hiuxwe2");
597 $CC_FOR_BUILD $dummy.c
-o $dummy && .
/$dummy && rm $dummy.c
$dummy && exit 0
598 rm -f $dummy.c
$dummy
599 echo unknown-hitachi-hiuxwe2
601 9000/7??
:4.3bsd
:*:* |
9000/8?
[79]:4.3bsd
:*:* )
608 echo hppa1.0
-hp-mpeix
610 hp7??
:OSF1
:*:* | hp8?
[79]:OSF1
:*:* )
617 if [ -x /usr
/sbin
/sysversion
] ; then
618 echo ${UNAME_MACHINE}-unknown-osf1mk
620 echo ${UNAME_MACHINE}-unknown-osf1
624 echo hppa1.1
-hp-lites
627 echo hppa-unknown-openbsd
629 C1
*:ConvexOS
:*:* | convex
:ConvexOS
:C1
*:*)
632 C2
*:ConvexOS
:*:* | convex
:ConvexOS
:C2
*:*)
633 if getsysinfo
-f scalar_acc
634 then echo c32-convex-bsd
635 else echo c2-convex-bsd
638 C34
*:ConvexOS
:*:* | convex
:ConvexOS
:C34
*:*)
641 C38
*:ConvexOS
:*:* | convex
:ConvexOS
:C38
*:*)
644 C4
*:ConvexOS
:*:* | convex
:ConvexOS
:C4
*:*)
651 echo ymp-cray-unicos
${UNAME_RELEASE}
654 echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
655 |
sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
656 -e y
/ABCDEFGHIJKLMNOPQRSTUVWXYZ
/abcdefghijklmnopqrstuvwxyz
/
659 echo t90-cray-unicos
${UNAME_RELEASE}
662 echo alpha-cray-unicosmk
${UNAME_RELEASE}
665 echo cray2-cray-unicos
667 F300
:UNIX_System_V
:*:*)
668 FUJITSU_SYS
=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
669 FUJITSU_REL
=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
670 echo "f300-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
672 F301
:UNIX_System_V
:*:*)
673 echo f301-fujitsu-uxpv
`echo $UNAME_RELEASE | sed 's/ .*//'`
675 hp3
[0-9][05]:NetBSD
:*:*)
676 echo m68k-hp-netbsd
${UNAME_RELEASE}
679 echo m68k-unknown-openbsd
${UNAME_RELEASE}
681 i?
86:BSD
/386:*:* | i?
86:BSD
/OS
:*:*)
682 echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
685 echo sparc-unknown-bsdi
${UNAME_RELEASE}
688 echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
691 if test -x /usr
/bin
/objformat
; then
692 if test "elf" = "`/usr/bin/objformat`"; then
693 echo ${UNAME_MACHINE}-unknown-freebsdelf`echo ${UNAME_RELEASE}|sed -e 's/[-_].*//'`
697 echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-=(].*//'`
700 echo ${UNAME_MACHINE}-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
703 echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
706 echo ${UNAME_MACHINE}-pc-cygwin32
709 echo ${UNAME_MACHINE}-pc-mingw32
711 i
*:Windows_NT
*:* | Pentium
*:Windows_NT
*:*)
712 # How do we know it's Interix rather than the generic POSIX subsystem?
713 # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
714 # UNAME_MACHINE based on the output of uname instead of i386?
718 echo ${UNAME_MACHINE}-pc-uwin
721 echo powerpcle-unknown-cygwin
724 echo powerpcle-unknown-solaris2
`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
727 echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
730 # uname on the ARM produces all sorts of strangeness, and we need to
732 case "$UNAME_MACHINE" in
733 armv
*) UNAME_MACHINE
=$UNAME_MACHINE ;;
734 arm
* | sa110
*) UNAME_MACHINE
="arm" ;;
737 # The BFD linker knows what the default object file format is, so
738 # first see if it will tell us. cd to the root directory to prevent
739 # problems with other programs or directories called `ld' in the path.
740 ld_help_string
=`cd /; ld --help 2>&1`
741 ld_supported_emulations
=`echo $ld_help_string \
742 | sed -ne '/supported emulations:/!d
744 s/.*supported emulations: *//
747 case "$ld_supported_emulations" in
748 *ia64
) echo "${UNAME_MACHINE}-unknown-linux" ; exit 0 ;;
749 i?
86linux
) echo "${UNAME_MACHINE}-pc-linux-gnuaout" ; exit 0 ;;
750 i?
86coff
) echo "${UNAME_MACHINE}-pc-linux-gnucoff" ; exit 0 ;;
751 sparclinux
) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
752 armlinux
) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
753 m68klinux
) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
754 elf32ppc | elf32ppclinux
)
755 # Determine Lib Version
757 #include <features.h>
758 #if defined(__GLIBC__)
759 extern char __libc_version[];
760 extern char __libc_release[];
766 #if defined(__GLIBC__)
767 printf("%s %s\n", __libc_version, __libc_release);
775 $CC_FOR_BUILD $dummy.c
-o $dummy 2>/dev
/null
776 if test "$?" = 0 ; then
777 .
/$dummy |
grep 1\
.99 > /dev
/null
778 if test "$?" = 0 ; then
782 rm -f $dummy.c
$dummy
783 echo powerpc-unknown-linux-gnu
${LIBC} ; exit 0 ;;
786 if test "${UNAME_MACHINE}" = "alpha" ; then
787 sed 's/^ //' <<EOF >$dummy.s
793 .long 0x47e03d80 # implver $0
795 .long 0x47e20c21 # amask $2,$1
805 $CC_FOR_BUILD $dummy.s
-o $dummy 2>/dev
/null
806 if test "$?" = 0 ; then
810 UNAME_MACHINE
="alpha"
813 UNAME_MACHINE
="alphaev5"
816 UNAME_MACHINE
="alphaev56"
819 UNAME_MACHINE
="alphapca56"
822 UNAME_MACHINE
="alphaev6"
826 objdump
--private-headers $dummy | \
827 grep ld.so
.1 > /dev
/null
828 if test "$?" = 0 ; then
832 rm -f $dummy.s
$dummy
833 echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} ; exit 0
834 elif test "${UNAME_MACHINE}" = "mips" ; then
837 int main (int argc, char *argv[]) {
839 int main (argc, argv) int argc; char *argv[]; {
842 printf ("%s-unknown-linux-gnu\n", argv[1]);
845 printf ("%sel-unknown-linux-gnu\n", argv[1]);
850 $CC_FOR_BUILD $dummy.c
-o $dummy 2>/dev
/null
&& .
/$dummy "${UNAME_MACHINE}" && rm $dummy.c
$dummy && exit 0
851 rm -f $dummy.c
$dummy
853 # Either a pre-BFD a.out linker (linux-gnuoldld)
854 # or one that does not give us useful --help.
855 # GCC wants to distinguish between linux-gnuoldld and linux-gnuaout.
856 # If ld does not provide *any* "supported emulations:"
857 # that means it is gnuoldld.
858 echo "$ld_help_string" |
grep >/dev
/null
2>&1 "supported emulations:"
859 test $?
!= 0 && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0
861 case "${UNAME_MACHINE}" in
869 # Determine whether the default compiler is a.out or elf
871 #include <features.h>
873 int main (int argc, char *argv[]) {
875 int main (argc, argv) int argc; char *argv[]; {
880 printf ("%s-${VENDOR}-linux-gnu\n", argv[1]);
882 printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]);
885 printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]);
888 printf ("%s-${VENDOR}-linux-gnuaout\n", argv[1]);
893 ${CC-cc} $dummy.c
-o $dummy 2>/dev
/null
&& .
/$dummy "${UNAME_MACHINE}" && rm $dummy.c
$dummy && exit 0
894 rm -f $dummy.c
$dummy
896 # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. earlier versions
897 # are messed up and put the nodename in both sysname and nodename.
899 echo i386-sequent-sysv4
901 # added by chet for bash based on usenet posting from <hops@sco.com> and
902 # documentation on SCO's web site -- UnixWare 7 (SVR5)
903 # i?86:UnixWare:5*:*)
904 # echo ${UNAME_MACHINE}-pc-sysv5uw${UNAME_VERSION}
906 i?
86:UNIX_SV
:4.2MP
:2.
*)
907 # Unixware is an offshoot of SVR4, but it has its own version
908 # number series starting with 2...
909 # I am not positive that other SVR4 systems won't match this,
910 # I just have to hope. -- rms.
911 # Use sysv4.2uw... so that sysv4* matches it.
912 echo ${UNAME_MACHINE}-pc-sysv4.2uw
${UNAME_VERSION}
914 i?
86:*:4.
*:* | i?
86:SYSTEM_V
:4.
*:* | i?
86:UNIX_SV
:4.
*:*)
915 if grep Novell
/usr
/include
/link.h
>/dev
/null
2>/dev
/null
; then
916 echo ${UNAME_MACHINE}-univel-sysv${UNAME_RELEASE}
918 echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE}
922 UNAME_REL
=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')`
923 (/bin
/uname
-X|
egrep i80486
>/dev
/null
) && UNAME_MACHINE
=i486
924 (/bin
/uname
-X|
egrep '^Machine.*Pentium' >/dev
/null
) && UNAME_MACHINE
=i586
925 (/bin
/uname
-X|
egrep '^Machine.*Pent.*II' >/dev
/null
) && UNAME_MACHINE
=i686
926 (/bin
/uname
-X|
egrep '^Machine.*Pentium Pro' >/dev
/null
) && UNAME_MACHINE
=i585
927 echo ${UNAME_MACHINE}-${UNAME_SYSTEM}${UNAME_VERSION}-sysv${UNAME_RELEASE}
930 if test -f /usr
/options
/cb.name
; then
931 UNAME_REL
=`sed -n 's/.*Version //p' </usr/options/cb.name`
932 echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
933 elif /bin
/uname
-X 2>/dev
/null
>/dev
/null
; then
934 UNAME_REL
=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')`
935 (/bin
/uname
-X|
egrep i80486
>/dev
/null
) && UNAME_MACHINE
=i486
936 (/bin
/uname
-X|
egrep '^Machine.*Pentium' >/dev
/null
) \
937 && UNAME_MACHINE
=i586
938 (/bin
/uname
-X|
egrep '^Machine.*Pent ?II' >/dev
/null
) \
939 && UNAME_MACHINE
=i686
940 (/bin
/uname
-X|
egrep '^Machine.*Pentium Pro' >/dev
/null
) \
941 && UNAME_MACHINE
=i686
942 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
944 echo ${UNAME_MACHINE}-pc-sysv32
948 # uname -m prints for DJGPP always 'pc', but it prints nothing about
949 # the processor, so we play safe by assuming i386.
950 echo i386-pc-msdosdjgpp
958 i860
:*:4.
*:*) # i860-SVR4
959 if grep Stardent
/usr
/include
/sys
/uadmin.h
>/dev
/null
2>&1 ; then
960 echo i860-stardent-sysv
${UNAME_RELEASE} # Stardent Vistra i860-SVR4
961 else # Add other i860-SVR4 vendors below as they are discovered.
962 echo i860-unknown-sysv
${UNAME_RELEASE} # Unknown i860-SVR4
967 echo m68010-convergent-sysv
970 test -r /sysV68
&& echo 'm68k-motorola-sysv' && exit 0 ;;
971 3[34]??
:*:4.0:3.0 |
3[34]??
,*:*:4.0:3.0 |
4850:*:4.0:3.0)
973 test -r /etc
/.relid \
974 && OS_REL
=.
`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
975 /bin
/uname
-p 2>/dev
/null |
grep 86 >/dev
/null \
976 && echo i486-ncr-sysv4.3
${OS_REL} && exit 0
977 /bin
/uname
-p 2>/dev
/null |
/bin
/grep entium
>/dev
/null \
978 && echo i586-ncr-sysv4.3
${OS_REL} && exit 0 ;;
979 3[34]??
:*:4.0:* |
3[34]??
,*:*:4.0:*)
980 /bin
/uname
-p 2>/dev
/null |
grep 86 >/dev
/null \
981 && echo i486-ncr-sysv4
&& exit 0 ;;
982 mc68030
:UNIX_System_V
:4.
*:*)
983 echo m68k-atari-sysv4
986 echo m68k-unknown-lynxos
${UNAME_RELEASE}
988 i?
86:LynxOS
:2.
*:* | i?
86:LynxOS
:3.
[01]*:*)
989 echo i386-pc-lynxos
${UNAME_RELEASE}
991 TSUNAMI
:LynxOS
:2.
*:*)
992 echo sparc-unknown-lynxos
${UNAME_RELEASE}
994 rs6000
:LynxOS
:2.
*:* | PowerPC
:LynxOS
:2.
*:*)
995 echo rs6000-unknown-lynxos
${UNAME_RELEASE}
998 echo ${UNAME_MACHINE}-unknown-lynxos${UNAME_RELEASE}
1000 SM
[BE
]S
:UNIX_SV
:*:*)
1001 echo mips-dde-sysv
${UNAME_RELEASE}
1003 RM
*:SINIX-
*:*:* | RM
*:ReliantUNIX-
*:*:*)
1007 if uname
-p 2>/dev
/null
>/dev
/null
; then
1008 UNAME_MACHINE
=`(uname -p) 2>/dev/null`
1009 echo ${UNAME_MACHINE}-sni-sysv4
1014 PENTIUM
:CPunix
:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
1015 # says <Richard.M.Bartel@ccMail.Census.GOV>
1016 echo i586-unisys-sysv4
1018 *:UNIX_System_V
:4*:FTX
*)
1019 # From Gerald Hewes <hewes@openmarket.com>.
1020 # How about differentiating between stratus architectures? -djm
1021 echo hppa1.1
-stratus-sysv4
1024 # From seanf@swdc.stratus.com.
1025 echo i860-stratus-sysv4
1028 echo m68k-apple-aux
${UNAME_RELEASE}
1031 echo mips-sony-newsos6
1033 R3000
:*System_V
*:*:* | R4000
:UNIX_SYSV
:*:* | R
*000:UNIX_SV
:*:*)
1034 if [ -d /usr
/nec
]; then
1035 echo mips-nec-sysv
${UNAME_RELEASE}
1037 echo mips-unknown-sysv
${UNAME_RELEASE}
1040 BeBox
:BeOS
:*:*) # BeOS running on hardware made by Be, PPC only.
1041 echo powerpc-apple-beos
1044 echo powerpc-apple-beos
1050 echo sx4-nec-superux
${UNAME_RELEASE}
1053 echo sx5-nec-superux
${UNAME_RELEASE}
1055 Power
*:Rhapsody
:*:*)
1056 echo powerpc-apple-rhapsody
${UNAME_RELEASE}
1059 echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
1063 #echo '(No uname command or uname output not recognized.)' 1>&2
1064 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
1068 # include <sys/types.h>
1069 # include <sys/utsname.h>
1074 #if defined (MIPSEB)
1075 /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
1077 printf ("mips-sony-bsd\n"); exit (0);
1079 #include <sys/param.h>
1080 printf ("m68k-sony-newsos%s\n",
1090 #if defined (__arm) && defined (__acorn) && defined (__unix)
1091 printf ("arm-acorn-riscix\n"); exit (0);
1094 #if defined (hp9000) && !defined (hpux)
1095 printf ("m68k-hp-bsd\n"); exit (0);
1098 #if defined (hp300) && !defined (hpux)
1099 printf ("m68k-hp-bsd\n"); exit (0);
1103 #if !defined (__ARCHITECTURE__)
1104 #define __ARCHITECTURE__ "m68k"
1107 version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
1109 printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
1111 printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
1115 #if defined (MULTIMAX) || defined (n16)
1117 printf ("ns32k-encore-sysv\n"); exit (0);
1120 printf ("ns32k-encore-mach\n"); exit (0);
1122 printf ("ns32k-encore-bsd\n"); exit (0);
1127 #if defined (__386BSD__)
1128 printf ("i386-pc-bsd\n"); exit (0);
1131 #if defined (sequent)
1133 printf ("i386-sequent-dynix\n"); exit (0);
1135 #if defined (ns32000)
1136 printf ("ns32k-sequent-dynix\n"); exit (0);
1140 #if defined (_SEQUENT_)
1145 if (strncmp(un.version, "V2", 2) == 0) {
1146 printf ("i386-sequent-ptx2\n"); exit (0);
1148 if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
1149 printf ("i386-sequent-ptx1\n"); exit (0);
1151 printf ("i386-sequent-ptx\n"); exit (0);
1156 #if !defined (ultrix)
1157 printf ("vax-dec-bsd\n"); exit (0);
1159 printf ("vax-dec-ultrix\n"); exit (0);
1163 #if defined (alliant) && defined (i860)
1164 printf ("i860-alliant-bsd\n"); exit (0);
1167 /* Begin cases added for Bash */
1169 printf ("tahoe-cci-bsd\n"); exit (0);
1172 #if defined (nec_ews)
1173 # if defined (SYSTYPE_SYSV)
1174 printf ("ews4800-nec-sysv4\n"); exit 0;
1176 printf ("ews4800-nec-bsd\n"); exit (0);
1181 # if defined (SYSTYPE_SYSV)
1182 printf ("mips-sony-sysv4\n"); exit 0;
1184 printf ("mips-sony-bsd\n"); exit (0);
1188 #if defined (ardent)
1189 printf ("titan-ardent-bsd\n"); exit (0);
1192 #if defined (stardent)
1193 printf ("stardent-stardent-sysv\n"); exit (0);
1196 #if defined (ibm032)
1197 printf ("ibmrt-ibm-bsd4.3\n"); exit (0);
1200 #if defined (sequent) && defined (i386)
1201 printf ("i386-sequent-bsd\n"); exit (0);
1204 #if defined (qnx) && defined (i386)
1205 printf ("i386-pc-qnx\n"); exit (0);
1209 printf ("gould-gould-bsd\n"); exit (0);
1212 #if defined (unixpc)
1213 printf ("unixpc-att-sysv\n"); exit (0);
1216 #if defined (att386)
1217 printf ("i386-att-sysv3\n"); exit (0);
1220 #if defined (__m88k) && defined (__UMAXV__)
1221 printf ("m88k-encore-sysv3\n"); exit (0);
1224 #if defined (drs6000)
1225 printf ("drs6000-icl-sysv4.2\n"); exit (0);
1228 #if defined (clipper)
1229 printf ("clipper-orion-bsd\n"); exit (0);
1233 printf ("m68k-isi-bsd\n"); exit (0);
1236 #if defined (luna88k)
1237 printf ("luna88k-omron-bsd\n"); exit (0);
1240 #if defined (butterfly) && defined (BFLY1)
1241 printf ("butterfly-bbn-mach\n"); exit (0);
1244 #if defined (tower32)
1245 printf ("tower32-ncr-sysv4\n"); exit (0);
1248 #if defined (MagicStation)
1249 printf ("magicstation-unknown-bsd\n"); exit (0);
1253 printf ("symmetric-scs-bsd4.2\n"); exit (0);
1256 #if defined (tandem)
1257 printf ("tandem-tandem-sysv\n"); exit (0);
1260 #if defined (cadmus)
1261 printf ("cadmus-pcs-sysv\n"); exit (0);
1264 #if defined (masscomp)
1265 printf ("masscomp-masscomp-sysv3\n"); exit (0);
1268 #if defined (hbullx20)
1269 printf ("hbullx20-bull-sysv3\n"); exit (0);
1272 /* End cases added for Bash */
1278 ${CC-cc} $dummy.c
-o $dummy 2>/dev
/null
&& .
/$dummy && rm $dummy.c
$dummy && exit 0
1279 rm -f $dummy.c
$dummy
1281 # Apollos put the system type in the environment.
1283 test -d /usr
/apollo
&& { echo ${ISP}-apollo-${SYSTYPE}; exit 0; }
1285 # Convex versions that predate uname can use getsysinfo(1)
1287 if [ -x /usr
/convex
/getsysinfo
]
1289 case `getsysinfo -f cpu_type` in
1294 if getsysinfo
-f scalar_acc
1295 then echo c32-convex-bsd
1296 else echo c2-convex-bsd
1311 # Begin cases added for Bash
1313 uts
) echo uts-amdahl-sysv
${UNAME_RELEASE}; exit 0 ;;
1316 if [ -d /usr
/amiga
]; then
1317 echo m68k-cbm-sysv
${UNAME_RELEASE}; exit 0;
1320 if [ -f /bin
/fxc.info
]; then
1321 echo fxc-alliant-concentrix
1324 # end cases added for Bash
1326 #echo '(Unable to guess system type)' 1>&2