OpenCores
URL https://opencores.org/ocsvn/or1k_old/or1k_old/trunk

Subversion Repositories or1k_old

[/] [or1k_old/] [tags/] [start/] [insight/] [itcl/] [config/] [config.guess] - Blame information for rev 1782

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 578 markom
#!/bin/sh
2
# Attempt to guess a canonical system name.
3
#   Copyright (C) 1992, 1993, 1994 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., 675 Mass Ave, Cambridge, MA 02139, 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 .
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
    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
63
        echo arm-acorn-riscix${UNAME_RELEASE}
64
        exit 0;;
65
    Pyramid*:OSx*:*:*)
66
        if test "`(/bin/universe) 2>/dev/null`" = att ; then
67
                echo pyramid-pyramid-sysv3
68
        else
69
                echo pyramid-pyramid-bsd
70
        fi
71
        exit 0 ;;
72
    i86pc:SunOS:5.*:*)
73
        echo i486-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
74
        exit 0 ;;
75
    sun4*:SunOS:5.*:*)
76
        echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
77
        exit 0 ;;
78
    sun4*:SunOS:6*:*)
79
        # According to config.sub, this is the proper way to canonicalize
80
        # SunOS6.  Hard to guess exactly what SunOS6 will be like, but
81
        # it's likely to be more like Solaris than SunOS4.
82
        echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
83
        exit 0 ;;
84
    sun4*:SunOS:*:*)
85
        # Japanese Language versions have a version number like `4.1.3-JL'.
86
        echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
87
        exit 0 ;;
88
    sun3*:SunOS:*:*)
89
        echo m68k-sun-sunos${UNAME_RELEASE}
90
        exit 0 ;;
91
    tp_s2*:SunOS:*:*)
92
        # Tadpole Sparcbook 2 running a modified 4.1.3
93
        echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
94
        exit 0 ;;
95
    RISC*:ULTRIX:*:*)
96
        echo mips-dec-ultrix${UNAME_RELEASE}
97
        exit 0 ;;
98
    VAX*:ULTRIX*:*:*)
99
        echo vax-dec-ultrix${UNAME_RELEASE}
100
        exit 0 ;;
101
    mips:*:5*:RISCos)
102
        echo mips-mips-riscos${UNAME_RELEASE}
103
        exit 0 ;;
104
    m88k:CX/UX:7*:*)
105
        echo m88k-harris-cxux7
106
        exit 0 ;;
107
    m88k:*:4*:R4*)
108
        echo m88k-motorola-sysv4
109
        exit 0 ;;
110
    m88k:*:3*:R3*)
111
        echo m88k-motorola-sysv3
112
        exit 0 ;;
113
    AViiON:dgux:*:*)
114
        if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx \
115
             -o ${TARGET_BINARY_INTERFACE}x = x ] ; then
116
                echo m88k-dg-dgux${UNAME_RELEASE}
117
        else
118
                echo m88k-dg-dguxbcs${UNAME_RELEASE}
119
        fi
120
        exit 0 ;;
121
    M88*:DolphinOS:*:*) # DolphinOS (SVR3)
122
        echo m88k-dolphin-sysv3
123
        exit 0 ;;
124
    M88*:*:R3*:*)
125
        # Delta 88k system running SVR3
126
        echo m88k-motorola-sysv3
127
        exit 0 ;;
128
    XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
129
        echo m88k-tektronix-sysv3
130
        exit 0 ;;
131
    Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
132
        echo m68k-tektronix-bsd
133
        exit 0 ;;
134
    *:IRIX:*:*)
135
        echo mips-sgi-irix${UNAME_RELEASE}
136
        exit 0 ;;
137
    i[34]86:AIX:*:*)
138
        echo i386-ibm-aix
139
        exit 0 ;;
140
    *:AIX:2:3)
141
        if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
142
                sed 's/^                //' << EOF >dummy.c
143
                #include 
144
 
145
                main()
146
                        {
147
                        if (!__power_pc())
148
                                exit(1);
149
                        puts("powerpc-ibm-aix3.2.5");
150
                        exit(0);
151
                        }
152
EOF
153
                ${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0
154
                rm -f dummy.c dummy
155
                echo rs6000-ibm-aix3.2.5
156
        elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
157
                echo rs6000-ibm-aix3.2.4
158
        else
159
                echo rs6000-ibm-aix3.2
160
        fi
161
        exit 0 ;;
162
    *:AIX:*:4)
163
        if /usr/sbin/lsattr -EHl proc0 | grep POWER >/dev/null 2>&1; then
164
                IBM_ARCH=rs6000
165
        else
166
                IBM_ARCH=powerpc
167
        fi
168
        if grep bos410 /usr/include/stdio.h >/dev/null 2>&1; then
169
                IBM_REV=4.1
170
        elif grep bos411 /usr/include/stdio.h >/dev/null 2>&1; then
171
                IBM_REV=4.1.1
172
        else
173
                IBM_REV=4.${UNAME_RELEASE}
174
        fi
175
        echo ${IBM_ARCH}-ibm-aix${IBM_REV}
176
        exit 0 ;;
177
    *:AIX:*:*)
178
        echo rs6000-ibm-aix
179
        exit 0 ;;
180
    *:BOSX:*:*)
181
        echo rs6000-bull-bosx
182
        exit 0 ;;
183
    DPX/2?00:B.O.S.:*:*)
184
        echo m68k-bull-sysv3
185
        exit 0 ;;
186
    9000/[34]??:4.3bsd:1.*:*)
187
        echo m68k-hp-bsd
188
        exit 0 ;;
189
    hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
190
        echo m68k-hp-bsd4.4
191
        exit 0 ;;
192
    9000/[3478]??:HP-UX:*:*)
193
        case "${UNAME_MACHINE}" in
194
            9000/31? )            HP_ARCH=m68000 ;;
195
            9000/[34]?? )         HP_ARCH=m68k ;;
196
            9000/7?? | 9000/8?7 ) HP_ARCH=hppa1.1 ;;
197
            9000/8?? )            HP_ARCH=hppa1.0 ;;
198
        esac
199
        HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
200
        echo ${HP_ARCH}-hp-hpux${HPUX_REV}
201
        exit 0 ;;
202
    3050*:HI-UX:*:*)
203
        sed 's/^        //' << EOF >dummy.c
204
        #include 
205
        int
206
        main ()
207
        {
208
          long cpu = sysconf (_SC_CPU_VERSION);
209
          /* The order matters, because CPU_IS_HP_MC68K erroneously returns
210
             true for CPU_PA_RISC1_0.  CPU_IS_PA_RISC returns correct
211
             results, however.  */
212
          if (CPU_IS_PA_RISC (cpu))
213
            {
214
              switch (cpu)
215
                {
216
                  case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
217
                  case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
218
                  case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
219
                  default: puts ("hppa-hitachi-hiuxwe2"); break;
220
                }
221
            }
222
          else if (CPU_IS_HP_MC68K (cpu))
223
            puts ("m68k-hitachi-hiuxwe2");
224
          else puts ("unknown-hitachi-hiuxwe2");
225
          exit (0);
226
        }
227
EOF
228
        ${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0
229
        rm -f dummy.c dummy
230
        echo unknown-hitachi-hiuxwe2
231
        exit 0 ;;
232
    9000/7??:4.3bsd:*:* | 9000/8?7:4.3bsd:*:* )
233
        echo hppa1.1-hp-bsd
234
        exit 0 ;;
235
    9000/8??:4.3bsd:*:*)
236
        echo hppa1.0-hp-bsd
237
        exit 0 ;;
238
    hp7??:OSF1:*:* | hp8?7:OSF1:*:* )
239
        echo hppa1.1-hp-osf
240
        exit 0 ;;
241
    hp8??:OSF1:*:*)
242
        echo hppa1.0-hp-osf
243
        exit 0 ;;
244
    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
245
        echo c1-convex-bsd
246
        exit 0 ;;
247
    C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
248
        if getsysinfo -f scalar_acc
249
        then echo c32-convex-bsd
250
        else echo c2-convex-bsd
251
        fi
252
        exit 0 ;;
253
    C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
254
        echo c34-convex-bsd
255
        exit 0 ;;
256
    C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
257
        echo c38-convex-bsd
258
        exit 0 ;;
259
    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
260
        echo c4-convex-bsd
261
        exit 0 ;;
262
    CRAY*X-MP:UNICOS:*:*)
263
        echo xmp-cray-unicos
264
        exit 0 ;;
265
    CRAY*Y-MP:UNICOS:*:*)
266
        echo ymp-cray-unicos
267
        exit 0 ;;
268
    CRAY-2:UNICOS:*:*)
269
        echo cray2-cray-unicos
270
        exit 0 ;;
271
    hp3[0-9][05]:NetBSD:*:*)
272
        echo m68k-hp-netbsd${UNAME_RELEASE}
273
        exit 0 ;;
274
    i[34]86:BSD/386:*:*)
275
        echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
276
        exit 0 ;;
277
    i[34]86:BSD/OS:*:*)
278
        echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
279
        exit 0 ;;
280
    *:FreeBSD:*:*)
281
        echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
282
        exit 0 ;;
283
    *:NetBSD:*:*)
284
        echo ${UNAME_MACHINE}-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
285
        exit 0 ;;
286
    *:GNU:*:*)
287
        echo `echo ${UNAME_MACHINE}|sed -e 's,/.*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
288
        exit 0 ;;
289
    *:Linux:*:*)
290
        echo ${UNAME_MACHINE}-unknown-linux
291
        exit 0 ;;
292
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.  earlier versions
293
# are messed up and put the nodename in both sysname and nodename.
294
    i[34]86:DYNIX/ptx:4*:*)
295
        echo i386-sequent-sysv4
296
        exit 0 ;;
297
    i[34]86:*:4.*:* | i[34]86:SYSTEM_V:4.*:*)
298
        if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
299
                echo ${UNAME_MACHINE}-univel-sysv${UNAME_RELEASE}
300
        else
301
                echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}
302
        fi
303
        exit 0 ;;
304
    i[34]86:*:3.2:*)
305
        if /bin/uname -X 2>/dev/null >/dev/null ; then
306
                UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')`
307
                (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
308
                echo ${UNAME_MACHINE}-unknown-sco$UNAME_REL
309
        elif test -f /usr/options/cb.name; then
310
                UNAME_REL=`sed -n 's/.*Version //p' 
311
                echo ${UNAME_MACHINE}-unknown-isc$UNAME_REL
312
        else
313
                echo ${UNAME_MACHINE}-unknown-sysv32
314
        fi
315
        exit 0 ;;
316
    Intel:Mach:3*:*)
317
        echo i386-unknown-mach3
318
        exit 0 ;;
319
    i860:*:4.*:*) # i860-SVR4
320
        if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
321
          echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
322
        else # Add other i860-SVR4 vendors below as they are discovered.
323
          echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
324
        fi
325
        exit 0 ;;
326
    mini*:CTIX:SYS*5:*)
327
        # "miniframe"
328
        echo m68010-convergent-sysv
329
        exit 0 ;;
330
    M680[234]0:*:R3V[567]*:*)
331
        test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
332
    3[34]??:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0)
333
        uname -p 2>/dev/null | grep 86 >/dev/null \
334
          && echo i486-ncr-sysv4.3 && exit 0 ;;
335
    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
336
        uname -p 2>/dev/null | grep 86 >/dev/null \
337
          && echo i486-ncr-sysv4 && exit 0 ;;
338
    m680[234]0:LynxOS:2.2*:*)
339
        echo m68k-lynx-lynxos${UNAME_RELEASE}
340
        exit 0 ;;
341
    PowerPC:LynxOS:2.2*:*)
342
        echo powerpc-lynx-lynxos${UNAME_RELEASE}
343
        exit 0 ;;
344
    mc68030:UNIX_System_V:4.*:*)
345
        echo m68k-atari-sysv4
346
        exit 0 ;;
347
    i[34]86:LynxOS:2.2*:*)
348
        echo i386-lynx-lynxos${UNAME_RELEASE}
349
        exit 0 ;;
350
    TSUNAMI:LynxOS:2.2*:*)
351
        echo sparc-lynx-lynxos${UNAME_RELEASE}
352
        exit 0 ;;
353
    rs6000:LynxOS:2.2*:*)
354
        echo rs6000-lynx-lynxos${UNAME_RELEASE}
355
        exit 0 ;;
356
    RM*:SINIX-*:*:*)
357
        echo mips-sni-sysv4
358
        exit 0 ;;
359
    *:SINIX-*:*:*)
360
        if uname -p 2>/dev/null >/dev/null ; then
361
                UNAME_MACHINE=`(uname -p) 2>/dev/null`
362
                echo ${UNAME_MACHINE}-sni-sysv4
363
        else
364
                echo ns32k-sni-sysv
365
        fi
366
        exit 0 ;;
367
esac
368
 
369
#echo '(No uname command or uname output not recognized.)' 1>&2
370
#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
371
 
372
cat >dummy.c <
373
main ()
374
{
375
#if defined (sony)
376
#if defined (MIPSEB)
377
  /* BFD wants "bsd" instead of "newsos".  Perhaps BFD should be changed,
378
     I don't know....  */
379
  printf ("mips-sony-bsd\n"); exit (0);
380
#else
381
  printf ("m68k-sony-newsos\n"); exit (0);
382
#endif
383
#endif
384
 
385
#if defined (__arm) && defined (__acorn) && defined (__unix)
386
  printf ("arm-acorn-riscix"); exit (0);
387
#endif
388
 
389
#if defined (hp300) && !defined (hpux)
390
  printf ("m68k-hp-bsd\n"); exit (0);
391
#endif
392
 
393
#if defined (NeXT)
394
#if !defined (__ARCHITECTURE__)
395
#define __ARCHITECTURE__ "m68k"
396
#endif
397
  int version;
398
  version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
399
  printf ("%s-next-nextstep%s\n", __ARCHITECTURE__,  version==2 ? "2" : "3");
400
  exit (0);
401
#endif
402
 
403
#if defined (MULTIMAX) || defined (n16)
404
#if defined (UMAXV)
405
  printf ("ns32k-encore-sysv\n"); exit (0);
406
#else
407
#if defined (CMU)
408
  printf ("ns32k-encore-mach\n"); exit (0);
409
#else
410
  printf ("ns32k-encore-bsd\n"); exit (0);
411
#endif
412
#endif
413
#endif
414
 
415
#if defined (__386BSD__)
416
  printf ("i386-unknown-bsd\n"); exit (0);
417
#endif
418
 
419
#if defined (sequent)
420
#if defined (i386)
421
  printf ("i386-sequent-dynix\n"); exit (0);
422
#endif
423
#if defined (ns32000)
424
  printf ("ns32k-sequent-dynix\n"); exit (0);
425
#endif
426
#endif
427
 
428
#if defined (_SEQUENT_)
429
  printf ("i386-sequent-ptx\n"); exit (0);
430
#endif
431
 
432
#if defined (vax)
433
#if !defined (ultrix)
434
  printf ("vax-dec-bsd\n"); exit (0);
435
#else
436
  printf ("vax-dec-ultrix\n"); exit (0);
437
#endif
438
#endif
439
 
440
#if defined (alliant) && defined (i860)
441
  printf ("i860-alliant-bsd\n"); exit (0);
442
#endif
443
 
444
  exit (1);
445
}
446
EOF
447
 
448
${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy && rm dummy.c dummy && exit 0
449
rm -f dummy.c dummy
450
 
451
# Apollos put the system type in the environment.
452
 
453
test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; }
454
 
455
# Convex versions that predate uname can use getsysinfo(1)
456
 
457
if [ -x /usr/convex/getsysinfo ]
458
then
459
    case `getsysinfo -f cpu_type` in
460
    c1*)
461
        echo c1-convex-bsd
462
        exit 0 ;;
463
    c2*)
464
        if getsysinfo -f scalar_acc
465
        then echo c32-convex-bsd
466
        else echo c2-convex-bsd
467
        fi
468
        exit 0 ;;
469
    c34*)
470
        echo c34-convex-bsd
471
        exit 0 ;;
472
    c38*)
473
        echo c38-convex-bsd
474
        exit 0 ;;
475
    c4*)
476
        echo c4-convex-bsd
477
        exit 0 ;;
478
    esac
479
fi
480
 
481
#echo '(Unable to guess system type)' 1>&2
482
 
483
exit 1

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.