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