source: trunk/third/cns/config.guess @ 8789

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