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