OSDN Git Service

* config.guess: Support m68k-cbm-sysv4.
[pf3gnuchains/gcc-fork.git] / gcc / config.guess
1 #! /bin/sh
2 # Attempt to guess a canonical system name.
3 #   Copyright (C) 1992, 93, 94, 95, 1996 Free Software Foundation, Inc.
4 #
5 # This file is free software; you can redistribute it and/or modify it
6 # under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2 of the License, or
8 # (at your option) any later version.
9 #
10 # This program is distributed in the hope that it will be useful, but
11 # WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13 # General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 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 # Written by Per Bothner <bothner@cygnus.com>.
25 # The master version of this file is at the FSF in /home/gd/gnu/lib.
26 #
27 # This script attempts to guess a canonical system name similar to
28 # config.sub.  If it succeeds, it prints the system name on stdout, and
29 # exits with 0.  Otherwise, it exits with 1.
30 #
31 # The plan is that this can be called by configure scripts if you
32 # don't specify an explicit system type (host/target name).
33 #
34 # Only a few systems have been added to this list; please add others
35 # (but try to keep the structure clean).
36 #
37
38 # This is needed to find uname on a Pyramid OSx when run in the BSD universe.
39 # (ghazi@noc.rutgers.edu 8/24/94.)
40 if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
41         PATH=$PATH:/.attbin ; export PATH
42 fi
43
44 UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
45 UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
46 UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
47 UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
48
49 trap 'rm -f dummy.c dummy.o dummy; exit 1' 1 2 15
50
51 # Note: order is significant - the case branches are not exclusive.
52
53 case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
54     alpha:OSF1:V*:*)
55         # After 1.2, OSF1 uses "V1.3" for uname -r.
56         echo alpha-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^V//'`
57         exit 0 ;;
58     alpha:OSF1:*:*)
59         # 1.2 uses "1.2" for uname -r.
60         echo alpha-dec-osf${UNAME_RELEASE}
61         exit 0 ;;
62     21064:Windows_NT:50:3)
63         echo alpha-dec-winnt3.5
64         exit 0 ;;
65     Amiga*:UNIX_System_V:4.0:*)
66         echo m68k-cbm-sysv4
67         exit 0;;
68     amiga:NetBSD:*:*)
69       echo m68k-cbm-netbsd${UNAME_RELEASE}
70       exit 0 ;;
71     arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
72         echo arm-acorn-riscix${UNAME_RELEASE}
73         exit 0;;
74     Pyramid*:OSx*:*:*)
75         if test "`(/bin/universe) 2>/dev/null`" = att ; then
76                 echo pyramid-pyramid-sysv3
77         else
78                 echo pyramid-pyramid-bsd
79         fi
80         exit 0 ;;
81     sun4*:SunOS:5.*:*)
82         echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
83         exit 0 ;;
84     i86pc:SunOS:5.*:*)
85         echo i386-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
86         exit 0 ;;
87     sun4*:SunOS:6*:*)
88         # According to config.sub, this is the proper way to canonicalize
89         # SunOS6.  Hard to guess exactly what SunOS6 will be like, but
90         # it's likely to be more like Solaris than SunOS4.
91         echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
92         exit 0 ;;
93     sun4*:SunOS:*:*)
94         case "`/usr/bin/arch -k`" in
95             Series*|S4*)
96                 UNAME_RELEASE=`uname -v`
97                 ;;
98         esac
99         # Japanese Language versions have a version number like `4.1.3-JL'.
100         echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
101         exit 0 ;;
102     sun3*:SunOS:*:*)
103         echo m68k-sun-sunos${UNAME_RELEASE}
104         exit 0 ;;
105     atari*:NetBSD:*:*)
106         echo m68k-atari-netbsd${UNAME_RELEASE}
107         exit 0 ;;
108     sun3*:NetBSD:*:*)
109         echo m68k-sun-netbsd${UNAME_RELEASE}
110         exit 0 ;;
111     mac68k:NetBSD:*:*)
112         echo m68k-apple-netbsd${UNAME_RELEASE}
113         exit 0 ;;
114     RISC*:ULTRIX:*:*)
115         echo mips-dec-ultrix${UNAME_RELEASE}
116         exit 0 ;;
117     VAX*:ULTRIX*:*:*)
118         echo vax-dec-ultrix${UNAME_RELEASE}
119         exit 0 ;;
120     mips:*:4*:UMIPS)
121         echo mips-mips-riscos4sysv
122         exit 0 ;;
123     mips:*:5*:RISCos)
124         echo mips-mips-riscos${UNAME_RELEASE}
125         exit 0 ;;
126     Night_Hawk:Power_UNIX:*:*)
127         echo powerpc-harris-powerunix
128         exit 0 ;;
129     m88k:CX/UX:7*:*)
130         echo m88k-harris-cxux7
131         exit 0 ;;
132     m88k:*:4*:R4*)
133         echo m88k-motorola-sysv4
134         exit 0 ;;
135     m88k:*:3*:R3*)
136         echo m88k-motorola-sysv3
137         exit 0 ;;
138     AViiON:dgux:*:*)
139         # DG/UX returns AViiON for all architectures
140         UNAME_PROCESSOR=`uname -p`
141         if [ $UNAME_PROCESSOR = mc88100 -o $UNAME_PROCESSOR = mc88100 ] ; then
142         if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx \
143              -o ${TARGET_BINARY_INTERFACE}x = x ] ; then
144                 echo m88k-dg-dgux${UNAME_RELEASE}
145         else
146                 echo m88k-dg-dguxbcs${UNAME_RELEASE}
147         fi
148         else echo i586-dg-dgux${UNAME_RELEASE}
149         fi
150         exit 0 ;;
151     M88*:DolphinOS:*:*) # DolphinOS (SVR3)
152         echo m88k-dolphin-sysv3
153         exit 0 ;;
154     M88*:*:R3*:*)
155         # Delta 88k system running SVR3
156         echo m88k-motorola-sysv3
157         exit 0 ;;
158     XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
159         echo m88k-tektronix-sysv3
160         exit 0 ;;
161     Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
162         echo m68k-tektronix-bsd
163         exit 0 ;;
164     *:IRIX*:*:*)
165         echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
166         exit 0 ;;
167    ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
168         echo romp-ibm-aix      # uname -m gives an 8 hex-code CPU id
169         exit 0 ;;              # Note that: echo "'`uname -s`'" gives 'AIX '
170     i[34]86:AIX:*:*)
171         echo i386-ibm-aix
172         exit 0 ;;
173     *:AIX:2:3)
174         if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
175                 sed 's/^                //' << EOF >dummy.c
176                 #include <sys/systemcfg.h>
177
178                 main()
179                         {
180                         if (!__power_pc())
181                                 exit(1);
182                         puts("powerpc-ibm-aix3.2.5");
183                         exit(0);
184                         }
185 EOF
186                 ${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0
187                 rm -f dummy.c dummy
188                 echo rs6000-ibm-aix3.2.5
189         elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
190                 echo rs6000-ibm-aix3.2.4
191         else
192                 echo rs6000-ibm-aix3.2
193         fi
194         exit 0 ;;
195     *:AIX:*:4)
196         if /usr/sbin/lsattr -EHl proc0 | grep POWER >/dev/null 2>&1; then
197                 IBM_ARCH=rs6000
198         else
199                 IBM_ARCH=powerpc
200         fi
201         if [ -x /usr/bin/oslevel ] ; then
202                 IBM_REV=`/usr/bin/oslevel`
203         else
204                 IBM_REV=4.${UNAME_RELEASE}
205         fi
206         echo ${IBM_ARCH}-ibm-aix${IBM_REV}
207         exit 0 ;;
208     *:AIX:*:*)
209         echo rs6000-ibm-aix
210         exit 0 ;;
211     ibmrt:4.4BSD:*|romp-ibm:BSD:*)
212         echo romp-ibm-bsd4.4
213         exit 0 ;;
214     ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC NetBSD and
215         echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to 
216         exit 0 ;;                           # report: romp-ibm BSD 4.3
217     *:BOSX:*:*)
218         echo rs6000-bull-bosx
219         exit 0 ;;
220     DPX/2?00:B.O.S.:*:*)
221         echo m68k-bull-sysv3
222         exit 0 ;;
223     9000/[34]??:4.3bsd:1.*:*)
224         echo m68k-hp-bsd
225         exit 0 ;;
226     hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
227         echo m68k-hp-bsd4.4
228         exit 0 ;;
229     9000/[3478]??:HP-UX:*:*)
230         case "${UNAME_MACHINE}" in
231             9000/31? )            HP_ARCH=m68000 ;;
232             9000/[34]?? )         HP_ARCH=m68k ;;
233             9000/7?? | 9000/8?[679] ) HP_ARCH=hppa1.1 ;;
234             9000/8?? )            HP_ARCH=hppa1.0 ;;
235         esac
236         HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
237         echo ${HP_ARCH}-hp-hpux${HPUX_REV}
238         exit 0 ;;
239     3050*:HI-UX:*:*)
240         sed 's/^        //' << EOF >dummy.c
241         #include <unistd.h>
242         int
243         main ()
244         {
245           long cpu = sysconf (_SC_CPU_VERSION);
246           /* The order matters, because CPU_IS_HP_MC68K erroneously returns
247              true for CPU_PA_RISC1_0.  CPU_IS_PA_RISC returns correct
248              results, however.  */
249           if (CPU_IS_PA_RISC (cpu))
250             {
251               switch (cpu)
252                 {
253                   case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
254                   case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
255                   case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
256                   default: puts ("hppa-hitachi-hiuxwe2"); break;
257                 }
258             }
259           else if (CPU_IS_HP_MC68K (cpu))
260             puts ("m68k-hitachi-hiuxwe2");
261           else puts ("unknown-hitachi-hiuxwe2");
262           exit (0);
263         }
264 EOF
265         ${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0
266         rm -f dummy.c dummy
267         echo unknown-hitachi-hiuxwe2
268         exit 0 ;;
269     9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
270         echo hppa1.1-hp-bsd
271         exit 0 ;;
272     9000/8??:4.3bsd:*:*)
273         echo hppa1.0-hp-bsd
274         exit 0 ;;
275     hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
276         echo hppa1.1-hp-osf
277         exit 0 ;;
278     hp8??:OSF1:*:*)
279         echo hppa1.0-hp-osf
280         exit 0 ;;
281     parisc*:Lites*:*:*)
282         echo hppa1.1-hp-lites
283         exit 0 ;;
284     C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
285         echo c1-convex-bsd
286         exit 0 ;;
287     C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
288         if getsysinfo -f scalar_acc
289         then echo c32-convex-bsd
290         else echo c2-convex-bsd
291         fi
292         exit 0 ;;
293     C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
294         echo c34-convex-bsd
295         exit 0 ;;
296     C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
297         echo c38-convex-bsd
298         exit 0 ;;
299     C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
300         echo c4-convex-bsd
301         exit 0 ;;
302     CRAY*X-MP:*:*:*)
303         echo xmp-cray-unicos
304         exit 0 ;;
305     CRAY*Y-MP:*:*:*)
306         echo ymp-cray-unicos${UNAME_RELEASE}
307         exit 0 ;;
308     CRAY*C90:*:*:*)
309         echo c90-cray-unicos${UNAME_RELEASE}
310         exit 0 ;;
311     CRAY-2:*:*:*)
312         echo cray2-cray-unicos
313         exit 0 ;;
314     hp3[0-9][05]:NetBSD:*:*)
315         echo m68k-hp-netbsd${UNAME_RELEASE}
316         exit 0 ;;
317     i[34]86:BSD/386:*:* | *:BSD/OS:*:*)
318         echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
319         exit 0 ;;
320     *:FreeBSD:*:*)
321         echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
322         exit 0 ;;
323     *:NetBSD:*:*)
324         echo ${UNAME_MACHINE}-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
325         exit 0 ;;
326     *:GNU:*:*)
327         echo `echo ${UNAME_MACHINE}|sed -e 's,/.*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
328         exit 0 ;;
329     *:Linux:*:*)
330         # The BFD linker knows what the default object file format is, so
331         # first see if it will tell us.
332         ld_help_string=`ld --help 2>&1`
333         if echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: elf_i[345]86"; then
334           echo "${UNAME_MACHINE}-unknown-linux" ; exit 0
335         elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: i[345]86linux"; then
336           echo "${UNAME_MACHINE}-unknown-linuxaout" ; exit 0
337         elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: i[345]86coff"; then
338           echo "${UNAME_MACHINE}-unknown-linuxcoff" ; exit 0
339         elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: m68kelf"; then
340           echo "${UNAME_MACHINE}-unknown-linux" ; exit 0
341         elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: m68klinux"; then
342           echo "${UNAME_MACHINE}-unknown-linuxaout" ; exit 0
343         elif test "${UNAME_MACHINE}" = "alpha" ; then
344           echo alpha-unknown-linux ; exit 0
345         else
346           # Either a pre-BFD a.out linker (linuxoldld) or one that does not give us
347           # useful --help.  Gcc wants to distinguish between linuxoldld and linuxaout.
348           test ! -d /usr/lib/ldscripts/. \
349             && echo "${UNAME_MACHINE}-unknown-linuxoldld" && exit 0
350           # Determine whether the default compiler is a.out or elf
351           cat >dummy.c <<EOF
352 main(argc, argv)
353 int argc;
354 char *argv[];
355 {
356 #ifdef __ELF__
357   printf ("%s-unknown-linux\n", argv[1]);
358 #else
359   printf ("%s-unknown-linuxaout\n", argv[1]);
360 #endif
361   return 0;
362 }
363 EOF
364           ${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy "${UNAME_MACHINE}" && rm dummy.c dummy && exit 0
365           rm -f dummy.c dummy
366         fi ;;
367 # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.  earlier versions
368 # are messed up and put the nodename in both sysname and nodename.
369     i[34]86:DYNIX/ptx:4*:*)
370         echo i386-sequent-sysv4
371         exit 0 ;;
372     i[34]86:*:4.*:* | i[34]86:SYSTEM_V:4.*:*)
373         if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
374                 echo ${UNAME_MACHINE}-univel-sysv${UNAME_RELEASE}
375         else
376                 echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}
377         fi
378         exit 0 ;;
379     i[34]86:*:3.2:*)
380         if test -f /usr/options/cb.name; then
381                 UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
382                 echo ${UNAME_MACHINE}-unknown-isc$UNAME_REL
383         elif /bin/uname -X 2>/dev/null >/dev/null ; then
384                 UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')`
385                 (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
386                 (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \
387                         && UNAME_MACHINE=i586
388                 echo ${UNAME_MACHINE}-unknown-sco$UNAME_REL
389         else
390                 echo ${UNAME_MACHINE}-unknown-sysv32
391         fi
392         exit 0 ;;
393     Intel:Mach:3*:*)
394         echo i386-unknown-mach3
395         exit 0 ;;
396     paragon:*:*:*)
397         echo i860-intel-osf1
398         exit 0 ;;
399     i860:*:4.*:*) # i860-SVR4
400         if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
401           echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
402         else # Add other i860-SVR4 vendors below as they are discovered.
403           echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
404         fi
405         exit 0 ;;
406     mini*:CTIX:SYS*5:*)
407         # "miniframe"
408         echo m68010-convergent-sysv
409         exit 0 ;;
410     M680[234]0:*:R3V[567]*:*)
411         test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
412     3[34]??:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0)
413         uname -p 2>/dev/null | grep 86 >/dev/null \
414           && echo i486-ncr-sysv4.3 && exit 0 ;;
415     3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
416         uname -p 2>/dev/null | grep 86 >/dev/null \
417           && echo i486-ncr-sysv4 && exit 0 ;;
418     m680[234]0:LynxOS:2.[23]*:*)
419         echo m68k-lynx-lynxos${UNAME_RELEASE}
420         exit 0 ;;
421     mc68030:UNIX_System_V:4.*:*)
422         echo m68k-atari-sysv4
423         exit 0 ;;
424     i[34]86:LynxOS:2.[23]*:*)
425         echo i386-lynx-lynxos${UNAME_RELEASE}
426         exit 0 ;;
427     TSUNAMI:LynxOS:2.[23]*:*)
428         echo sparc-lynx-lynxos${UNAME_RELEASE}
429         exit 0 ;;
430     rs6000:LynxOS:2.[23]*:*)
431         echo rs6000-lynx-lynxos${UNAME_RELEASE}
432         exit 0 ;;
433     RM*:SINIX-*:*:*)
434         echo mips-sni-sysv4
435         exit 0 ;;
436     *:SINIX-*:*:*)
437         if uname -p 2>/dev/null >/dev/null ; then
438                 UNAME_MACHINE=`(uname -p) 2>/dev/null`
439                 echo ${UNAME_MACHINE}-sni-sysv4
440         else
441                 echo ns32k-sni-sysv
442         fi
443         exit 0 ;;
444     mc68*:A/UX:*:*)
445         echo m68k-apple-aux${UNAME_RELEASE}
446         exit 0 ;;
447 esac
448
449 #echo '(No uname command or uname output not recognized.)' 1>&2
450 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
451
452 cat >dummy.c <<EOF
453 #ifdef _SEQUENT_
454 # include <sys/types.h>
455 # include <sys/utsname.h>
456 #endif
457 main ()
458 {
459 #if defined (sony)
460 #if defined (MIPSEB)
461   /* BFD wants "bsd" instead of "newsos".  Perhaps BFD should be changed,
462      I don't know....  */
463   printf ("mips-sony-bsd\n"); exit (0);
464 #else
465 #include <sys/param.h>
466   printf ("m68k-sony-newsos%s\n",
467 #ifdef NEWSOS4
468           "4"
469 #else
470           ""
471 #endif
472          ); exit (0);
473 #endif
474 #endif
475
476 #if defined (__arm) && defined (__acorn) && defined (__unix)
477   printf ("arm-acorn-riscix"); exit (0);
478 #endif
479
480 #if defined (hp300) && !defined (hpux)
481   printf ("m68k-hp-bsd\n"); exit (0);
482 #endif
483
484 #if defined (NeXT)
485 #if !defined (__ARCHITECTURE__)
486 #define __ARCHITECTURE__ "m68k"
487 #endif
488   int version;
489   version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
490   printf ("%s-next-nextstep%s\n", __ARCHITECTURE__,  version==2 ? "2" : "3");
491   exit (0);
492 #endif
493
494 #if defined (MULTIMAX) || defined (n16)
495 #if defined (UMAXV)
496   printf ("ns32k-encore-sysv\n"); exit (0);
497 #else
498 #if defined (CMU)
499   printf ("ns32k-encore-mach\n"); exit (0);
500 #else
501   printf ("ns32k-encore-bsd\n"); exit (0);
502 #endif
503 #endif
504 #endif
505
506 #if defined (__386BSD__)
507   printf ("i386-unknown-bsd\n"); exit (0);
508 #endif
509
510 #if defined (sequent)
511 #if defined (i386)
512   printf ("i386-sequent-dynix\n"); exit (0);
513 #endif
514 #if defined (ns32000)
515   printf ("ns32k-sequent-dynix\n"); exit (0);
516 #endif
517 #endif
518
519 #if defined (_SEQUENT_)
520     struct utsname un;
521
522     uname(&un);
523
524     if (strncmp(un.version, "V2", 2) == 0) {
525         printf ("i386-sequent-ptx2\n"); exit (0);
526     }
527     if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
528         printf ("i386-sequent-ptx1\n"); exit (0);
529     }
530     printf ("i386-sequent-ptx\n"); exit (0);
531
532 #endif
533
534 #if defined (vax)
535 #if !defined (ultrix)
536   printf ("vax-dec-bsd\n"); exit (0);
537 #else
538   printf ("vax-dec-ultrix\n"); exit (0);
539 #endif
540 #endif
541
542 #if defined (alliant) && defined (i860)
543   printf ("i860-alliant-bsd\n"); exit (0);
544 #endif
545
546   exit (1);
547 }
548 EOF
549
550 ${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy && rm dummy.c dummy && exit 0
551 rm -f dummy.c dummy
552
553 # Apollos put the system type in the environment.
554
555 test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; }
556
557 # Convex versions that predate uname can use getsysinfo(1)
558
559 if [ -x /usr/convex/getsysinfo ]
560 then
561     case `getsysinfo -f cpu_type` in
562     c1*)
563         echo c1-convex-bsd
564         exit 0 ;;
565     c2*)
566         if getsysinfo -f scalar_acc
567         then echo c32-convex-bsd
568         else echo c2-convex-bsd
569         fi
570         exit 0 ;;
571     c34*)
572         echo c34-convex-bsd
573         exit 0 ;;
574     c38*)
575         echo c38-convex-bsd
576         exit 0 ;;
577     c4*)
578         echo c4-convex-bsd
579         exit 0 ;;
580     esac
581 fi
582
583 #echo '(Unable to guess system type)' 1>&2
584
585 exit 1