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