source: trunk/src/gmake/config/config.guess@ 512

Last change on this file since 512 was 503, checked in by bird, 19 years ago

Untested merge with GNU Make v3.81 (vendor/gnumake/2005-05-16 -> vendor/gnumake/current).

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