2 # Attempt to guess a canonical system name.
3 # Copyright 1998-2004 The OpenLDAP Foundation.
4 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
5 # 2000, 2001, 2002 Free Software Foundation, Inc.
7 timestamp='2002-10-21-OpenLDAP'
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.
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.
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.
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.
29 # This file is distributed with OpenLDAP Software, which contains a
30 # configuration script generated by Autoconf, and is distributable
31 # under the same distributions terms as OpenLDAP inself.
33 ## Copyright 1998-2004 The OpenLDAP Foundation.
34 ## All rights reserved.
36 ## Redistribution and use in source and binary forms, with or without
37 ## modification, are permitted only as authorized by the OpenLDAP
40 ## A copy of this license is available in the file LICENSE in the
41 ## top-level directory of the distribution or, alternatively, at
42 ## <http://www.OpenLDAP.org/license.html>.
44 # Originally written by Per Bothner <per@bothner.com>.
45 # Please send patches to <config-patches@gnu.org>. Submit a context
46 # diff and a properly formatted ChangeLog entry.
48 # This script attempts to guess a canonical system name similar to
49 # config.sub. If it succeeds, it prints the system name on stdout, and
50 # exits with 0. Otherwise, it exits with 1.
52 # The plan is that this can be called by configure scripts if you
53 # don't specify an explicit build system type.
55 me=`echo "$0" | sed -e 's,.*/,,'`
60 Output the configuration name of the system \`$me' is run on.
63 -h, --help print this help, then exit
64 -t, --time-stamp print date of last modification, then exit
65 -v, --version print version number, then exit
67 Report bugs and patches to <config-patches@gnu.org>."
70 GNU config.guess ($timestamp)
72 Originally written by Per Bothner.
73 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
74 Free Software Foundation, Inc.
76 This is free software; see the source for copying conditions. There is NO
77 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
80 Try \`$me --help' for more information."
83 while test $# -gt 0 ; do
85 --time-stamp | --time* | -t )
86 echo "$timestamp" ; exit 0 ;;
88 echo "$version" ; exit 0 ;;
90 echo "$usage"; exit 0 ;;
91 -- ) # Stop option processing
93 - ) # Use stdin as input.
96 echo "$me: invalid option $1$help" >&2
103 if test $# != 0; then
104 echo "$me: too many arguments$help" >&2
110 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a
111 # compiler to aid in system detection is discouraged as it requires
112 # temporary files to be created and, as you can see below, it is a
113 # headache to deal with in a portable fashion.
115 # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
116 # use `HOST_CC' if defined, but it is deprecated.
118 # This shell variable is my proudest work .. or something. --bje
120 set_cc_for_build='tmpdir=${TMPDIR-/tmp}/config-guess-$$ ;
121 (old=`umask` && umask 077 && mkdir $tmpdir && umask $old && unset old)
122 || (echo "$me: cannot create $tmpdir" >&2 && exit 1) ;
123 dummy=$tmpdir/dummy ;
124 files="$dummy.c $dummy.o $dummy.rel $dummy" ;
125 trap '"'"'rm -f $files; rmdir $tmpdir; exit 1'"'"' 1 2 15 ;
126 case $CC_FOR_BUILD,$HOST_CC,$CC in
127 ,,) echo "int x;" > $dummy.c ;
128 for c in cc gcc c89 c99 ; do
129 if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
130 CC_FOR_BUILD="$c"; break ;
134 if test x"$CC_FOR_BUILD" = x ; then
135 CC_FOR_BUILD=no_compiler_found ;
138 ,,*) CC_FOR_BUILD=$CC ;;
139 ,*,*) CC_FOR_BUILD=$HOST_CC ;;
143 # This is needed to find uname on a Pyramid OSx when run in the BSD universe.
144 # (ghazi@noc.rutgers.edu 1994-08-24)
145 if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
146 PATH=$PATH:/.attbin ; export PATH
149 UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
150 UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
151 UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
152 UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
154 # Note: order is significant - the case branches are not exclusive.
156 case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
158 # NetBSD (nbsd) targets should (where applicable) match one or
159 # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
160 # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
161 # switched to ELF, *-*-netbsd* would select the old
162 # object file format. This provides both forward
163 # compatibility and a consistent mechanism for selecting the
164 # object file format.
166 # Note: NetBSD doesn't particularly care about the vendor
167 # portion of the name. We always set it to "unknown".
168 sysctl="sysctl -n hw.machine_arch"
169 UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
170 /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
171 case "${UNAME_MACHINE_ARCH}" in
172 armeb) machine=armeb-unknown ;;
173 arm*) machine=arm-unknown ;;
174 sh3el) machine=shl-unknown ;;
175 sh3eb) machine=sh-unknown ;;
176 *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
178 # The Operating System including object format, if it has switched
179 # to ELF recently, or will in the future.
180 case "${UNAME_MACHINE_ARCH}" in
181 arm*|i386|m68k|ns32k|sh3*|sparc|vax)
182 eval $set_cc_for_build
183 if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
184 | grep __ELF__ >/dev/null
186 # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
187 # Return netbsd for either. FIX?
198 release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
199 # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
200 # contains redundant information, the shorter form:
201 # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
202 echo "${machine}-${os}${release}"
205 echo m68k-unknown-openbsd${UNAME_RELEASE}
208 echo mipsel-unknown-openbsd${UNAME_RELEASE}
211 echo m68k-unknown-openbsd${UNAME_RELEASE}
214 echo m68k-unknown-openbsd${UNAME_RELEASE}
217 echo powerpc-unknown-openbsd${UNAME_RELEASE}
220 echo m68k-unknown-openbsd${UNAME_RELEASE}
223 echo m88k-unknown-openbsd${UNAME_RELEASE}
226 echo powerpc-unknown-openbsd${UNAME_RELEASE}
229 echo mipsel-unknown-openbsd${UNAME_RELEASE}
232 echo mipseb-unknown-openbsd${UNAME_RELEASE}
235 echo m68k-unknown-openbsd${UNAME_RELEASE}
238 echo mipsel-unknown-openbsd${UNAME_RELEASE}
241 echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE}
244 if test $UNAME_RELEASE = "V4.0"; then
245 UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
247 # A Vn.n version is a released version.
248 # A Tn.n version is a released field test version.
249 # A Xn.n version is an unreleased experimental baselevel.
250 # 1.2 uses "1.2" for uname -r.
251 eval $set_cc_for_build
255 .byte 37,100,45,37,120,10,0 # "%d-%x\n"
262 .frame \$30,16,\$26,0
265 .long 0x47e03d80 # implver \$0
267 .long 0x47e20c21 # amask \$2,\$1
277 $CC_FOR_BUILD -o $dummy $dummy.s 2>/dev/null
278 if test "$?" = 0 ; then
281 UNAME_MACHINE="alpha"
284 UNAME_MACHINE="alphaev5"
287 UNAME_MACHINE="alphaev56"
290 UNAME_MACHINE="alphapca56"
293 UNAME_MACHINE="alphaev6"
296 UNAME_MACHINE="alphaev67"
299 UNAME_MACHINE="alphaev68"
302 UNAME_MACHINE="alphaev7"
306 rm -f $dummy.s $dummy && rmdir $tmpdir
307 echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
309 Alpha\ *:Windows_NT*:*)
310 # How do we know it's Interix rather than the generic POSIX subsystem?
311 # Should we change UNAME_MACHINE based on the output of uname instead
312 # of the specific Alpha model?
313 echo alpha-pc-interix
315 21064:Windows_NT:50:3)
316 echo alpha-dec-winnt3.5
318 Amiga*:UNIX_System_V:4.0:*)
319 echo m68k-unknown-sysv4
321 *:[Aa]miga[Oo][Ss]:*:*)
322 echo ${UNAME_MACHINE}-unknown-amigaos
324 *:[Mm]orph[Oo][Ss]:*:*)
325 echo ${UNAME_MACHINE}-unknown-morphos
328 echo i370-ibm-openedition
330 arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
331 echo arm-acorn-riscix${UNAME_RELEASE}
333 SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
334 echo hppa1.1-hitachi-hiuxmpp
336 Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
337 # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
338 if test "`(/bin/universe) 2>/dev/null`" = att ; then
339 echo pyramid-pyramid-sysv3
341 echo pyramid-pyramid-bsd
345 echo pyramid-pyramid-svr4
347 DRS?6000:UNIX_SV:4.2*:7*)
348 case `/usr/bin/uname -p` in
349 sparc) echo sparc-icl-nx7 && exit 0 ;;
352 echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
354 sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
355 echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
358 echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
361 # According to config.sub, this is the proper way to canonicalize
362 # SunOS6. Hard to guess exactly what SunOS6 will be like, but
363 # it's likely to be more like Solaris than SunOS4.
364 echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
367 case "`/usr/bin/arch -k`" in
369 UNAME_RELEASE=`uname -v`
372 # Japanese Language versions have a version number like `4.1.3-JL'.
373 echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
376 echo m68k-sun-sunos${UNAME_RELEASE}
379 UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
380 test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
381 case "`/bin/arch`" in
383 echo m68k-sun-sunos${UNAME_RELEASE}
386 echo sparc-sun-sunos${UNAME_RELEASE}
391 echo sparc-auspex-sunos${UNAME_RELEASE}
393 # The situation for MiNT is a little confusing. The machine name
394 # can be virtually everything (everything which is not
395 # "atarist" or "atariste" at least should have a processor
396 # > m68000). The system name ranges from "MiNT" over "FreeMiNT"
397 # to the lowercase version "mint" (or "freemint"). Finally
398 # the system name "TOS" denotes a system which is actually not
399 # MiNT. But MiNT is downward compatible to TOS, so this should
401 atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
402 echo m68k-atari-mint${UNAME_RELEASE}
404 atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
405 echo m68k-atari-mint${UNAME_RELEASE}
407 *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
408 echo m68k-atari-mint${UNAME_RELEASE}
410 milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
411 echo m68k-milan-mint${UNAME_RELEASE}
413 hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
414 echo m68k-hades-mint${UNAME_RELEASE}
416 *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
417 echo m68k-unknown-mint${UNAME_RELEASE}
420 echo powerpc-apple-machten${UNAME_RELEASE}
423 echo mips-dec-mach_bsd4.3
426 echo mips-dec-ultrix${UNAME_RELEASE}
429 echo vax-dec-ultrix${UNAME_RELEASE}
431 2020:CLIX:*:* | 2430:CLIX:*:*)
432 echo clipper-intergraph-clix${UNAME_RELEASE}
434 mips:*:*:UMIPS | mips:*:*:RISCos)
435 eval $set_cc_for_build
436 sed 's/^ //' << EOF >$dummy.c
438 #include <stdio.h> /* for printf() prototype */
439 int main (int argc, char *argv[]) {
441 int main (argc, argv) int argc; char *argv[]; {
443 #if defined (host_mips) && defined (MIPSEB)
444 #if defined (SYSTYPE_SYSV)
445 printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
447 #if defined (SYSTYPE_SVR4)
448 printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
450 #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
451 printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
457 $CC_FOR_BUILD -o $dummy $dummy.c \
458 && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
459 && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0
460 rm -f $dummy.c $dummy && rmdir $tmpdir
461 echo mips-mips-riscos${UNAME_RELEASE}
463 Motorola:PowerMAX_OS:*:*)
464 echo powerpc-motorola-powermax
466 Motorola:*:4.3:PL8-*)
467 echo powerpc-harris-powermax
469 Night_Hawk:*:*:PowerMAX_OS)
470 echo powerpc-harris-powermax
472 Night_Hawk:Power_UNIX:*:*)
473 echo powerpc-harris-powerunix
476 echo m88k-harris-cxux7
479 echo m88k-motorola-sysv4
482 echo m88k-motorola-sysv3
485 # DG/UX returns AViiON for all architectures
486 UNAME_PROCESSOR=`/usr/bin/uname -p`
487 if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
489 if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
490 [ ${TARGET_BINARY_INTERFACE}x = x ]
492 echo m88k-dg-dgux${UNAME_RELEASE}
494 echo m88k-dg-dguxbcs${UNAME_RELEASE}
497 echo i586-dg-dgux${UNAME_RELEASE}
500 M88*:DolphinOS:*:*) # DolphinOS (SVR3)
501 echo m88k-dolphin-sysv3
504 # Delta 88k system running SVR3
505 echo m88k-motorola-sysv3
507 XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
508 echo m88k-tektronix-sysv3
510 Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
511 echo m68k-tektronix-bsd
514 echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
516 ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
517 echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
518 exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX '
523 if [ -x /usr/bin/oslevel ] ; then
524 IBM_REV=`/usr/bin/oslevel`
526 IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
528 echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
531 if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
532 eval $set_cc_for_build
533 sed 's/^ //' << EOF >$dummy.c
534 #include <sys/systemcfg.h>
540 puts("powerpc-ibm-aix3.2.5");
544 $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0
545 rm -f $dummy.c $dummy && rmdir $tmpdir
546 echo rs6000-ibm-aix3.2.5
547 elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
548 echo rs6000-ibm-aix3.2.4
550 echo rs6000-ibm-aix3.2
554 IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
555 if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
560 if [ -x /usr/bin/oslevel ] ; then
561 IBM_REV=`/usr/bin/oslevel`
563 IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
565 echo ${IBM_ARCH}-ibm-aix${IBM_REV}
570 ibmrt:4.4BSD:*|romp-ibm:BSD:*)
573 ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
574 echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
575 exit 0 ;; # report: romp-ibm BSD 4.3
577 echo rs6000-bull-bosx
582 9000/[34]??:4.3bsd:1.*:*)
585 hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
588 9000/[34678]??:HP-UX:*:*)
589 HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
590 case "${UNAME_MACHINE}" in
591 9000/31? ) HP_ARCH=m68000 ;;
592 9000/[34]?? ) HP_ARCH=m68k ;;
593 9000/[678][0-9][0-9])
594 if [ -x /usr/bin/getconf ]; then
595 sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
596 sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
597 case "${sc_cpu_version}" in
598 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
599 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
600 532) # CPU_PA_RISC2_0
601 case "${sc_kernel_bits}" in
602 32) HP_ARCH="hppa2.0n" ;;
603 64) HP_ARCH="hppa2.0w" ;;
604 '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
608 if [ "${HP_ARCH}" = "" ]; then
609 eval $set_cc_for_build
610 sed 's/^ //' << EOF >$dummy.c
618 #if defined(_SC_KERNEL_BITS)
619 long bits = sysconf(_SC_KERNEL_BITS);
621 long cpu = sysconf (_SC_CPU_VERSION);
625 case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
626 case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
628 #if defined(_SC_KERNEL_BITS)
631 case 64: puts ("hppa2.0w"); break;
632 case 32: puts ("hppa2.0n"); break;
633 default: puts ("hppa2.0"); break;
635 #else /* !defined(_SC_KERNEL_BITS) */
636 puts ("hppa2.0"); break;
638 default: puts ("hppa1.0"); break;
643 (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
644 if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi
645 rm -f $dummy.c $dummy && rmdir $tmpdir
648 echo ${HP_ARCH}-hp-hpux${HPUX_REV}
651 HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
652 echo ia64-hp-hpux${HPUX_REV}
655 eval $set_cc_for_build
656 sed 's/^ //' << EOF >$dummy.c
661 long cpu = sysconf (_SC_CPU_VERSION);
662 /* The order matters, because CPU_IS_HP_MC68K erroneously returns
663 true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
665 if (CPU_IS_PA_RISC (cpu))
669 case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
670 case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
671 case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
672 default: puts ("hppa-hitachi-hiuxwe2"); break;
675 else if (CPU_IS_HP_MC68K (cpu))
676 puts ("m68k-hitachi-hiuxwe2");
677 else puts ("unknown-hitachi-hiuxwe2");
681 $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0
682 rm -f $dummy.c $dummy && rmdir $tmpdir
683 echo unknown-hitachi-hiuxwe2
685 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
691 *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
692 echo hppa1.0-hp-mpeix
694 hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
701 if [ -x /usr/sbin/sysversion ] ; then
702 echo ${UNAME_MACHINE}-unknown-osf1mk
704 echo ${UNAME_MACHINE}-unknown-osf1
708 echo hppa1.1-hp-lites
710 C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
713 C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
714 if getsysinfo -f scalar_acc
715 then echo c32-convex-bsd
716 else echo c2-convex-bsd
719 C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
722 C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
725 C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
729 echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
732 echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
733 | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
734 -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
738 echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
741 echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
744 echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
747 echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
749 F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
750 FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
751 FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
752 FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
753 echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
755 i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
756 echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
759 echo sparc-unknown-bsdi${UNAME_RELEASE}
762 echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
765 # Determine whether the default compiler uses glibc.
766 eval $set_cc_for_build
767 sed 's/^ //' << EOF >$dummy.c
768 #include <features.h>
775 eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
776 rm -f $dummy.c && rmdir $tmpdir
777 echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC}
780 echo ${UNAME_MACHINE}-pc-cygwin
783 echo ${UNAME_MACHINE}-pc-mingw32
786 echo ${UNAME_MACHINE}-pc-pw32
789 echo i386-pc-interix3
791 i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
792 # How do we know it's Interix rather than the generic POSIX subsystem?
793 # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
794 # UNAME_MACHINE based on the output of uname instead of i386?
798 echo ${UNAME_MACHINE}-pc-uwin
801 echo powerpcle-unknown-cygwin
804 echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
807 echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
810 echo ${UNAME_MACHINE}-pc-minix
813 echo ${UNAME_MACHINE}-unknown-linux-gnu
816 echo ${UNAME_MACHINE}-unknown-linux-gnu
819 echo ${UNAME_MACHINE}-unknown-linux-gnu
822 eval $set_cc_for_build
823 sed 's/^ //' << EOF >$dummy.c
827 #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
830 #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
837 eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
838 rm -f $dummy.c && rmdir $tmpdir
839 test x"${CPU}" != x && echo "${CPU}-pc-linux-gnu" && exit 0
842 echo powerpc-unknown-linux-gnu
845 echo powerpc64-unknown-linux-gnu
848 case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
849 EV5) UNAME_MACHINE=alphaev5 ;;
850 EV56) UNAME_MACHINE=alphaev56 ;;
851 PCA56) UNAME_MACHINE=alphapca56 ;;
852 PCA57) UNAME_MACHINE=alphapca56 ;;
853 EV6) UNAME_MACHINE=alphaev6 ;;
854 EV67) UNAME_MACHINE=alphaev67 ;;
855 EV68*) UNAME_MACHINE=alphaev68 ;;
857 objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
858 if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
859 echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
861 parisc:Linux:*:* | hppa:Linux:*:*)
863 case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
864 PA7*) echo hppa1.1-unknown-linux-gnu ;;
865 PA8*) echo hppa2.0-unknown-linux-gnu ;;
866 *) echo hppa-unknown-linux-gnu ;;
869 parisc64:Linux:*:* | hppa64:Linux:*:*)
870 echo hppa64-unknown-linux-gnu
872 s390:Linux:*:* | s390x:Linux:*:*)
873 echo ${UNAME_MACHINE}-ibm-linux
876 echo ${UNAME_MACHINE}-unknown-linux-gnu
878 sparc:Linux:*:* | sparc64:Linux:*:*)
879 echo ${UNAME_MACHINE}-unknown-linux-gnu
882 echo x86_64-unknown-linux-gnu
885 # The BFD linker knows what the default object file format is, so
886 # first see if it will tell us. cd to the root directory to prevent
887 # problems with other programs or directories called `ld' in the path.
888 # Set LC_ALL=C to ensure ld outputs messages in English.
889 ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
890 | sed -ne '/supported targets:/!d
892 s/.*supported targets: *//
895 case "$ld_supported_targets" in
897 TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
900 echo "${UNAME_MACHINE}-pc-linux-gnuaout"
903 echo "${UNAME_MACHINE}-pc-linux-gnucoff"
906 # Either a pre-BFD a.out linker (linux-gnuoldld) or
907 # one that does not give us useful --help.
908 echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
911 # Determine whether the default compiler is a.out or elf
912 eval $set_cc_for_build
913 sed 's/^ //' << EOF >$dummy.c
914 #include <features.h>
926 #ifdef __INTEL_COMPILER
933 eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
934 rm -f $dummy.c && rmdir $tmpdir
935 test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0
936 test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
939 # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
940 # earlier versions are messed up and put the nodename in both
941 # sysname and nodename.
942 echo i386-sequent-sysv4
944 i*86:UNIX_SV:4.2MP:2.*)
945 # Unixware is an offshoot of SVR4, but it has its own version
946 # number series starting with 2...
947 # I am not positive that other SVR4 systems won't match this,
948 # I just have to hope. -- rms.
949 # Use sysv4.2uw... so that sysv4* matches it.
950 echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
952 i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
953 UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
954 if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
955 echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
957 echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
961 case `/bin/uname -X | grep "^Machine"` in
962 *486*) UNAME_MACHINE=i486 ;;
963 *Pentium) UNAME_MACHINE=i586 ;;
964 *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
966 echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
969 if test -f /usr/options/cb.name; then
970 UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
971 echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
972 elif /bin/uname -X 2>/dev/null >/dev/null ; then
973 UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
974 (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
975 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
976 && UNAME_MACHINE=i586
977 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
978 && UNAME_MACHINE=i686
979 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
980 && UNAME_MACHINE=i686
981 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
983 echo ${UNAME_MACHINE}-pc-sysv32
987 echo ${UNAME_MACHINE}-pc-msdosdjgpp
990 # Left here for compatibility:
991 # uname -m prints for DJGPP always 'pc', but it prints nothing about
992 # the processor, so we play safe by assuming i386.
993 echo i386-pc-msdosdjgpp
1001 i860:*:4.*:*) # i860-SVR4
1002 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
1003 echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
1004 else # Add other i860-SVR4 vendors below as they are discovered.
1005 echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
1010 echo m68010-convergent-sysv
1012 mc68k:UNIX:SYSTEM5:3.51m)
1013 echo m68k-convergent-sysv
1016 test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
1017 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)
1019 test -r /etc/.relid \
1020 && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
1021 /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1022 && echo i486-ncr-sysv4.3${OS_REL} && exit 0
1023 /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
1024 && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;;
1025 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
1026 /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1027 && echo i486-ncr-sysv4 && exit 0 ;;
1028 m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
1029 echo m68k-unknown-lynxos${UNAME_RELEASE}
1031 mc68030:UNIX_System_V:4.*:*)
1032 echo m68k-atari-sysv4
1034 i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
1035 echo i386-unknown-lynxos${UNAME_RELEASE}
1037 TSUNAMI:LynxOS:2.*:*)
1038 echo sparc-unknown-lynxos${UNAME_RELEASE}
1040 rs6000:LynxOS:2.*:*)
1041 echo rs6000-unknown-lynxos${UNAME_RELEASE}
1043 PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
1044 echo powerpc-unknown-lynxos${UNAME_RELEASE}
1046 SM[BE]S:UNIX_SV:*:*)
1047 echo mips-dde-sysv${UNAME_RELEASE}
1049 RM*:ReliantUNIX-*:*:*)
1056 if uname -p 2>/dev/null >/dev/null ; then
1057 UNAME_MACHINE=`(uname -p) 2>/dev/null`
1058 echo ${UNAME_MACHINE}-sni-sysv4
1063 PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
1064 # says <Richard.M.Bartel@ccMail.Census.GOV>
1065 echo i586-unisys-sysv4
1067 *:UNIX_System_V:4*:FTX*)
1068 # From Gerald Hewes <hewes@openmarket.com>.
1069 # How about differentiating between stratus architectures? -djm
1070 echo hppa1.1-stratus-sysv4
1073 # From seanf@swdc.stratus.com.
1074 echo i860-stratus-sysv4
1077 # From Paul.Green@stratus.com.
1078 echo hppa1.1-stratus-vos
1081 echo m68k-apple-aux${UNAME_RELEASE}
1084 echo mips-sony-newsos6
1086 R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
1087 if [ -d /usr/nec ]; then
1088 echo mips-nec-sysv${UNAME_RELEASE}
1090 echo mips-unknown-sysv${UNAME_RELEASE}
1093 BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
1094 echo powerpc-be-beos
1096 BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
1097 echo powerpc-apple-beos
1099 BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
1103 echo sx4-nec-superux${UNAME_RELEASE}
1106 echo sx5-nec-superux${UNAME_RELEASE}
1109 echo sx6-nec-superux${UNAME_RELEASE}
1111 Power*:Rhapsody:*:*)
1112 echo powerpc-apple-rhapsody${UNAME_RELEASE}
1115 echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
1118 echo `uname -p`-apple-darwin${UNAME_RELEASE}
1120 *:procnto*:*:* | *:QNX:[0123456789]*:*)
1121 UNAME_PROCESSOR=`uname -p`
1122 if test "$UNAME_PROCESSOR" = "x86"; then
1123 UNAME_PROCESSOR=i386
1126 echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
1131 NSR-[DGKLNPTVW]:NONSTOP_KERNEL:*:*)
1132 echo nsr-tandem-nsk${UNAME_RELEASE}
1135 echo mips-compaq-nonstopux
1138 echo bs2000-siemens-sysv
1140 DS/*:UNIX_System_V:*:*)
1141 echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
1144 # "uname -m" is not consistent, so use $cputype instead. 386
1145 # is converted to i386 for consistency with other x86
1146 # operating systems.
1147 if test "$cputype" = "386"; then
1150 UNAME_MACHINE="$cputype"
1152 echo ${UNAME_MACHINE}-unknown-plan9
1155 # If we were able to find `uname', then EMX Unix compatibility
1156 # is probably installed.
1157 echo ${UNAME_MACHINE}-pc-os2-emx
1160 echo pdp10-unknown-tops10
1163 echo pdp10-unknown-tenex
1165 KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
1166 echo pdp10-dec-tops20
1168 XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
1169 echo pdp10-xkl-tops20
1172 echo pdp10-unknown-tops20
1175 echo pdp10-unknown-its
1177 i*86:XTS-300:*:STOP)
1178 echo ${UNAME_MACHINE}-unknown-stop
1181 echo ${UNAME_MACHINE}-unknown-atheos
1185 #echo '(No uname command or uname output not recognized.)' 1>&2
1186 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
1188 eval $set_cc_for_build
1191 # include <sys/types.h>
1192 # include <sys/utsname.h>
1197 #if defined (MIPSEB)
1198 /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
1200 printf ("mips-sony-bsd\n"); exit (0);
1202 #include <sys/param.h>
1203 printf ("m68k-sony-newsos%s\n",
1213 #if defined (__arm) && defined (__acorn) && defined (__unix)
1214 printf ("arm-acorn-riscix"); exit (0);
1217 #if defined (hp300) && !defined (hpux)
1218 printf ("m68k-hp-bsd\n"); exit (0);
1222 #if !defined (__ARCHITECTURE__)
1223 #define __ARCHITECTURE__ "m68k"
1226 version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
1228 printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
1230 printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
1234 #if defined (MULTIMAX) || defined (n16)
1236 printf ("ns32k-encore-sysv\n"); exit (0);
1239 printf ("ns32k-encore-mach\n"); exit (0);
1241 printf ("ns32k-encore-bsd\n"); exit (0);
1246 #if defined (__386BSD__)
1247 printf ("i386-pc-bsd\n"); exit (0);
1250 #if defined (sequent)
1252 printf ("i386-sequent-dynix\n"); exit (0);
1254 #if defined (ns32000)
1255 printf ("ns32k-sequent-dynix\n"); exit (0);
1259 #if defined (_SEQUENT_)
1264 if (strncmp(un.version, "V2", 2) == 0) {
1265 printf ("i386-sequent-ptx2\n"); exit (0);
1267 if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
1268 printf ("i386-sequent-ptx1\n"); exit (0);
1270 printf ("i386-sequent-ptx\n"); exit (0);
1275 # if !defined (ultrix)
1276 # include <sys/param.h>
1279 printf ("vax-dec-bsd4.3\n"); exit (0);
1282 printf ("vax-dec-bsd4.3reno\n"); exit (0);
1284 printf ("vax-dec-bsd\n"); exit (0);
1288 printf ("vax-dec-bsd\n"); exit (0);
1291 printf ("vax-dec-ultrix\n"); exit (0);
1295 #if defined (alliant) && defined (i860)
1296 printf ("i860-alliant-bsd\n"); exit (0);
1303 $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0
1304 rm -f $dummy.c $dummy && rmdir $tmpdir
1306 # Apollos put the system type in the environment.
1308 test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; }
1310 # Convex versions that predate uname can use getsysinfo(1)
1312 if [ -x /usr/convex/getsysinfo ]
1314 case `getsysinfo -f cpu_type` in
1319 if getsysinfo -f scalar_acc
1320 then echo c32-convex-bsd
1321 else echo c2-convex-bsd
1337 $0: unable to guess system type
1339 This script, last modified $timestamp, has failed to recognize
1340 the operating system you are using. It is advised that you
1341 download the most up to date version of the config scripts from
1343 ftp://ftp.gnu.org/pub/gnu/config/
1345 If the version you run ($0) is already up to date, please
1346 send the following data and any information you think might be
1347 pertinent to <config-patches@gnu.org> in order to provide the needed
1348 information to handle your system.
1350 config.guess timestamp = $timestamp
1352 uname -m = `(uname -m) 2>/dev/null || echo unknown`
1353 uname -r = `(uname -r) 2>/dev/null || echo unknown`
1354 uname -s = `(uname -s) 2>/dev/null || echo unknown`
1355 uname -v = `(uname -v) 2>/dev/null || echo unknown`
1357 /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
1358 /bin/uname -X = `(/bin/uname -X) 2>/dev/null`
1360 hostinfo = `(hostinfo) 2>/dev/null`
1361 /bin/universe = `(/bin/universe) 2>/dev/null`
1362 /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
1363 /bin/arch = `(/bin/arch) 2>/dev/null`
1364 /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
1365 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
1367 UNAME_MACHINE = ${UNAME_MACHINE}
1368 UNAME_RELEASE = ${UNAME_RELEASE}
1369 UNAME_SYSTEM = ${UNAME_SYSTEM}
1370 UNAME_VERSION = ${UNAME_VERSION}
1376 # eval: (add-hook 'write-file-hooks 'time-stamp)
1377 # time-stamp-start: "timestamp='"
1378 # time-stamp-format: "%:y-%02m-%02d"
1379 # time-stamp-end: "'"