~ubuntu-branches/ubuntu/natty/expat/natty

« back to all changes in this revision

Viewing changes to conftools/config.guess

  • Committer: Bazaar Package Importer
  • Author(s): Ardo van Rangelrooij
  • Date: 2004-02-29 11:01:15 UTC
  • mto: (2.1.1 warty) (4.1.4 hardy)
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20040229110115-5lvfwtlieqsljx6c
Tags: upstream-1.95.6
ImportĀ upstreamĀ versionĀ 1.95.6

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#! /bin/sh
2
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
 
#
 
3
#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
 
4
#   2000, 2001, 2002 Free Software Foundation, Inc.
 
5
 
 
6
timestamp='2002-03-20'
 
7
 
6
8
# This file is free software; you can redistribute it and/or modify it
7
9
# under the terms of the GNU General Public License as published by
8
10
# the Free Software Foundation; either version 2 of the License, or
22
24
# configuration script generated by Autoconf, you may include it under
23
25
# the same distribution terms that you use for the rest of that program.
24
26
 
25
 
# Written by Per Bothner <bothner@cygnus.com>.
26
 
# Please send patches to <config-patches@gnu.org>.
 
27
#####################################################################
 
28
# This file contains changes for Apache, clearly marked below.
 
29
# These changes are hereby donated to the public domain.
 
30
#####################################################################
 
31
 
 
32
# Originally written by Per Bothner <per@bothner.com>.
 
33
# Please send patches to <config-patches@gnu.org>.  Submit a context
 
34
# diff and a properly formatted ChangeLog entry.
27
35
#
28
36
# This script attempts to guess a canonical system name similar to
29
37
# config.sub.  If it succeeds, it prints the system name on stdout, and
30
38
# exits with 0.  Otherwise, it exits with 1.
31
39
#
32
40
# The plan is that this can be called by configure scripts if you
33
 
# don't specify an explicit system type (host/target name).
34
 
#
35
 
# Only a few systems have been added to this list; please add others
36
 
# (but try to keep the structure clean).
37
 
#
38
 
 
39
 
# Use $HOST_CC if defined. $CC may point to a cross-compiler
40
 
if test x"$CC_FOR_BUILD" = x; then
41
 
  if test x"$HOST_CC" != x; then
42
 
    CC_FOR_BUILD="$HOST_CC"
43
 
  else
44
 
    if test x"$CC" != x; then
45
 
      CC_FOR_BUILD="$CC"
46
 
    else
47
 
      CC_FOR_BUILD=cc
48
 
    fi
49
 
  fi
 
41
# don't specify an explicit build system type.
 
42
 
 
43
me=`echo "$0" | sed -e 's,.*/,,'`
 
44
 
 
45
usage="\
 
46
Usage: $0 [OPTION]
 
47
 
 
48
Output the configuration name of the system \`$me' is run on.
 
49
 
 
50
Operation modes:
 
51
  -h, --help         print this help, then exit
 
52
  -t, --time-stamp   print date of last modification, then exit
 
53
  -v, --version      print version number, then exit
 
54
 
 
55
Report bugs and patches to <config-patches@gnu.org>."
 
56
 
 
57
version="\
 
58
GNU config.guess ($timestamp)
 
59
 
 
60
Originally written by Per Bothner.
 
61
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
 
62
Free Software Foundation, Inc.
 
63
 
 
64
This is free software; see the source for copying conditions.  There is NO
 
65
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
 
66
 
 
67
help="
 
68
Try \`$me --help' for more information."
 
69
 
 
70
# Parse command line
 
71
while test $# -gt 0 ; do
 
72
  case $1 in
 
73
    --time-stamp | --time* | -t )
 
74
       echo "$timestamp" ; exit 0 ;;
 
75
    --version | -v )
 
76
       echo "$version" ; exit 0 ;;
 
77
    --help | --h* | -h )
 
78
       echo "$usage"; exit 0 ;;
 
79
    -- )     # Stop option processing
 
80
       shift; break ;;
 
81
    - ) # Use stdin as input.
 
82
       break ;;
 
83
    -* )
 
84
       echo "$me: invalid option $1$help" >&2
 
85
       exit 1 ;;
 
86
    * )
 
87
       break ;;
 
88
  esac
 
89
done
 
90
 
 
91
if test $# != 0; then
 
92
  echo "$me: too many arguments$help" >&2
 
93
  exit 1
50
94
fi
51
95
 
52
96
 
 
97
dummy=dummy-$$
 
98
trap 'rm -f $dummy.c $dummy.o $dummy.rel $dummy; exit 1' 1 2 15
 
99
 
 
100
# CC_FOR_BUILD -- compiler used by this script.
 
101
# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
 
102
# use `HOST_CC' if defined, but it is deprecated.
 
103
 
 
104
set_cc_for_build='case $CC_FOR_BUILD,$HOST_CC,$CC in
 
105
 ,,)    echo "int dummy(){}" > $dummy.c ;
 
106
        for c in cc gcc c89 c99 ; do
 
107
          ($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1 ;
 
108
          if test $? = 0 ; then
 
109
             CC_FOR_BUILD="$c"; break ;
 
110
          fi ;
 
111
        done ;
 
112
        rm -f $dummy.c $dummy.o $dummy.rel ;
 
113
        if test x"$CC_FOR_BUILD" = x ; then
 
114
          CC_FOR_BUILD=no_compiler_found ;
 
115
        fi
 
116
        ;;
 
117
 ,,*)   CC_FOR_BUILD=$CC ;;
 
118
 ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
 
119
esac'
 
120
 
53
121
# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
54
 
# (ghazi@noc.rutgers.edu 8/24/94.)
 
122
# (ghazi@noc.rutgers.edu 1994-08-24)
55
123
if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
56
124
        PATH=$PATH:/.attbin ; export PATH
57
125
fi
58
126
 
59
127
UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
60
128
UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
61
 
UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
 
129
UNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
62
130
UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
63
131
 
64
 
dummy=dummy-$$
65
 
trap 'rm -f $dummy.c $dummy.o $dummy; exit 1' 1 2 15
66
 
 
67
132
# Note: order is significant - the case branches are not exclusive.
68
133
 
69
134
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
70
135
    *:NetBSD:*:*)
71
 
        # Netbsd (nbsd) targets should (where applicable) match one or
 
136
        # NetBSD (nbsd) targets should (where applicable) match one or
72
137
        # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
73
138
        # *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
74
139
        # switched to ELF, *-*-netbsd* would select the old
75
140
        # object file format.  This provides both forward
76
141
        # compatibility and a consistent mechanism for selecting the
77
142
        # object file format.
78
 
        # Determine the machine/vendor (is the vendor relevant).
79
 
        case "${UNAME_MACHINE}" in
80
 
            amiga) machine=m68k-cbm ;;
81
 
            arm32) machine=arm-unknown ;;
82
 
            atari*) machine=m68k-atari ;;
83
 
            sun3*) machine=m68k-sun ;;
84
 
            mac68k) machine=m68k-apple ;;
85
 
            macppc) machine=powerpc-apple ;;
86
 
            hp3[0-9][05]) machine=m68k-hp ;;
87
 
            ibmrt|romp-ibm) machine=romp-ibm ;;
88
 
            *) machine=${UNAME_MACHINE}-unknown ;;
89
 
        esac
90
 
        # The Operating System including object format.
91
 
        if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
92
 
                | grep __ELF__ >/dev/null
93
 
        then
94
 
            # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
95
 
            # Return netbsd for either.  FIX?
96
 
            os=netbsd
97
 
        else
98
 
            os=netbsdelf
99
 
        fi
 
143
        #
 
144
        # Note: NetBSD doesn't particularly care about the vendor
 
145
        # portion of the name.  We always set it to "unknown".
 
146
        sysctl="sysctl -n hw.machine_arch"
 
147
        UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
 
148
            /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
 
149
        case "${UNAME_MACHINE_ARCH}" in
 
150
            arm*) machine=arm-unknown ;;
 
151
            sh3el) machine=shl-unknown ;;
 
152
            sh3eb) machine=sh-unknown ;;
 
153
            *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
 
154
        esac
 
155
        # The Operating System including object format, if it has switched
 
156
        # to ELF recently, or will in the future.
 
157
        case "${UNAME_MACHINE_ARCH}" in
 
158
            arm*|i386|m68k|ns32k|sh3*|sparc|vax)
 
159
                eval $set_cc_for_build
 
160
                if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
 
161
                        | grep __ELF__ >/dev/null
 
162
                then
 
163
                    # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
 
164
                    # Return netbsd for either.  FIX?
 
165
                    os=netbsd
 
166
                else
 
167
                    os=netbsdelf
 
168
                fi
 
169
                ;;
 
170
            *)
 
171
                os=netbsd
 
172
                ;;
 
173
        esac
100
174
        # The OS release
101
175
        release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
102
176
        # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
104
178
        # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
105
179
        echo "${machine}-${os}${release}"
106
180
        exit 0 ;;
 
181
    amiga:OpenBSD:*:*)
 
182
        echo m68k-unknown-openbsd${UNAME_RELEASE}
 
183
        exit 0 ;;
 
184
    arc:OpenBSD:*:*)
 
185
        echo mipsel-unknown-openbsd${UNAME_RELEASE}
 
186
        exit 0 ;;
 
187
    hp300:OpenBSD:*:*)
 
188
        echo m68k-unknown-openbsd${UNAME_RELEASE}
 
189
        exit 0 ;;
 
190
    mac68k:OpenBSD:*:*)
 
191
        echo m68k-unknown-openbsd${UNAME_RELEASE}
 
192
        exit 0 ;;
 
193
    macppc:OpenBSD:*:*)
 
194
        echo powerpc-unknown-openbsd${UNAME_RELEASE}
 
195
        exit 0 ;;
 
196
    mvme68k:OpenBSD:*:*)
 
197
        echo m68k-unknown-openbsd${UNAME_RELEASE}
 
198
        exit 0 ;;
 
199
    mvme88k:OpenBSD:*:*)
 
200
        echo m88k-unknown-openbsd${UNAME_RELEASE}
 
201
        exit 0 ;;
 
202
    mvmeppc:OpenBSD:*:*)
 
203
        echo powerpc-unknown-openbsd${UNAME_RELEASE}
 
204
        exit 0 ;;
 
205
    pmax:OpenBSD:*:*)
 
206
        echo mipsel-unknown-openbsd${UNAME_RELEASE}
 
207
        exit 0 ;;
 
208
    sgi:OpenBSD:*:*)
 
209
        echo mipseb-unknown-openbsd${UNAME_RELEASE}
 
210
        exit 0 ;;
 
211
    sun3:OpenBSD:*:*)
 
212
        echo m68k-unknown-openbsd${UNAME_RELEASE}
 
213
        exit 0 ;;
 
214
    wgrisc:OpenBSD:*:*)
 
215
        echo mipsel-unknown-openbsd${UNAME_RELEASE}
 
216
        exit 0 ;;
 
217
    *:OpenBSD:*:*)
 
218
        echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE}
 
219
        exit 0 ;;
107
220
    alpha:OSF1:*:*)
108
221
        if test $UNAME_RELEASE = "V4.0"; then
109
222
                UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
137
250
        jsr \$26,exit
138
251
        .end main
139
252
EOF
 
253
        eval $set_cc_for_build
140
254
        $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
141
255
        if test "$?" = 0 ; then
142
256
                case `./$dummy` in
158
272
                        2-307)
159
273
                                UNAME_MACHINE="alphaev67"
160
274
                                ;;
 
275
                        2-1307)
 
276
                                UNAME_MACHINE="alphaev68"
 
277
                                ;;
161
278
                esac
162
279
        fi
163
280
        rm -f $dummy.s $dummy
173
290
        echo alpha-dec-winnt3.5
174
291
        exit 0 ;;
175
292
    Amiga*:UNIX_System_V:4.0:*)
176
 
        echo m68k-cbm-sysv4
 
293
        echo m68k-unknown-sysv4
177
294
        exit 0;;
178
 
    amiga:OpenBSD:*:*)
179
 
        echo m68k-unknown-openbsd${UNAME_RELEASE}
180
 
        exit 0 ;;
181
295
    *:[Aa]miga[Oo][Ss]:*:*)
182
296
        echo ${UNAME_MACHINE}-unknown-amigaos
183
297
        exit 0 ;;
184
 
    arc64:OpenBSD:*:*)
185
 
        echo mips64el-unknown-openbsd${UNAME_RELEASE}
186
 
        exit 0 ;;
187
 
    arc:OpenBSD:*:*)
188
 
        echo mipsel-unknown-openbsd${UNAME_RELEASE}
189
 
        exit 0 ;;
190
 
    hkmips:OpenBSD:*:*)
191
 
        echo mips-unknown-openbsd${UNAME_RELEASE}
192
 
        exit 0 ;;
193
 
    pmax:OpenBSD:*:*)
194
 
        echo mipsel-unknown-openbsd${UNAME_RELEASE}
195
 
        exit 0 ;;
196
 
    sgi:OpenBSD:*:*)
197
 
        echo mips-unknown-openbsd${UNAME_RELEASE}
198
 
        exit 0 ;;
199
 
    wgrisc:OpenBSD:*:*)
200
 
        echo mipsel-unknown-openbsd${UNAME_RELEASE}
201
 
        exit 0 ;;
 
298
    *:[Mm]orph[Oo][Ss]:*:*)
 
299
        echo ${UNAME_MACHINE}-unknown-morphos
 
300
        exit 0 ;;
 
301
#########################
 
302
# Apache changes
 
303
#
 
304
#   *:OS/390:*:*)
 
305
#      echo i370-ibm-openedition
 
306
#      exit 0 ;;
 
307
    *:OS390:*:* | *:OS/390:*:*)
 
308
       echo s390-ibm-os390
 
309
       exit 0 ;; 
 
310
    *:OS400:*:* | *:OS/400:*:*) 
 
311
       echo as400-ibm-os400
 
312
       exit 0 ;;
 
313
    *:OS/2:*:*)
 
314
       echo "i386-pc-os2_emx"
 
315
       exit 0;;
 
316
#
 
317
# end Apache changes
 
318
#########################
202
319
    *:OS/390:*:*)
203
320
        echo i370-ibm-openedition
204
321
        exit 0 ;;
205
322
    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
206
323
        echo arm-acorn-riscix${UNAME_RELEASE}
207
324
        exit 0;;
208
 
    SR2?01:HI-UX/MPP:*:*)
 
325
    SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
209
326
        echo hppa1.1-hitachi-hiuxmpp
210
327
        exit 0;;
211
328
    Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
247
364
        echo m68k-sun-sunos${UNAME_RELEASE}
248
365
        exit 0 ;;
249
366
    sun*:*:4.2BSD:*)
250
 
        UNAME_RELEASE=`(head -1 /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
 
367
        UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
251
368
        test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
252
369
        case "`/bin/arch`" in
253
370
            sun3)
261
378
    aushp:SunOS:*:*)
262
379
        echo sparc-auspex-sunos${UNAME_RELEASE}
263
380
        exit 0 ;;
264
 
    atari*:OpenBSD:*:*)
265
 
        echo m68k-unknown-openbsd${UNAME_RELEASE}
266
 
        exit 0 ;;
267
381
    # The situation for MiNT is a little confusing.  The machine name
268
382
    # can be virtually everything (everything which is not
269
383
    # "atarist" or "atariste" at least should have a processor
290
404
    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
291
405
        echo m68k-unknown-mint${UNAME_RELEASE}
292
406
        exit 0 ;;
293
 
    sun3*:OpenBSD:*:*)
294
 
        echo m68k-unknown-openbsd${UNAME_RELEASE}
295
 
        exit 0 ;;
296
 
    mac68k:OpenBSD:*:*)
297
 
        echo m68k-unknown-openbsd${UNAME_RELEASE}
298
 
        exit 0 ;;
299
 
    mvme68k:OpenBSD:*:*)
300
 
        echo m68k-unknown-openbsd${UNAME_RELEASE}
301
 
        exit 0 ;;
302
 
    mvme88k:OpenBSD:*:*)
303
 
        echo m88k-unknown-openbsd${UNAME_RELEASE}
304
 
        exit 0 ;;
305
407
    powerpc:machten:*:*)
306
408
        echo powerpc-apple-machten${UNAME_RELEASE}
307
409
        exit 0 ;;
318
420
        echo clipper-intergraph-clix${UNAME_RELEASE}
319
421
        exit 0 ;;
320
422
    mips:*:*:UMIPS | mips:*:*:RISCos)
 
423
        eval $set_cc_for_build
321
424
        sed 's/^        //' << EOF >$dummy.c
322
425
#ifdef __cplusplus
323
426
#include <stdio.h>  /* for printf() prototype */
341
444
EOF
342
445
        $CC_FOR_BUILD $dummy.c -o $dummy \
343
446
          && ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
344
 
          && rm $dummy.c $dummy && exit 0
 
447
          && rm -f $dummy.c $dummy && exit 0
345
448
        rm -f $dummy.c $dummy
346
449
        echo mips-mips-riscos${UNAME_RELEASE}
347
450
        exit 0 ;;
 
451
    Motorola:PowerMAX_OS:*:*)
 
452
        echo powerpc-motorola-powermax
 
453
        exit 0 ;;
348
454
    Night_Hawk:Power_UNIX:*:*)
349
455
        echo powerpc-harris-powerunix
350
456
        exit 0 ;;
392
498
    ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
393
499
        echo romp-ibm-aix      # uname -m gives an 8 hex-code CPU id
394
500
        exit 0 ;;              # Note that: echo "'`uname -s`'" gives 'AIX '
395
 
    i?86:AIX:*:*)
 
501
    i*86:AIX:*:*)
396
502
        echo i386-ibm-aix
397
503
        exit 0 ;;
 
504
    ia64:AIX:*:*)
 
505
        if [ -x /usr/bin/oslevel ] ; then
 
506
                IBM_REV=`/usr/bin/oslevel`
 
507
        else
 
508
                IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
 
509
        fi
 
510
        echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
 
511
        exit 0 ;;
398
512
    *:AIX:2:3)
399
513
        if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
 
514
                eval $set_cc_for_build
400
515
                sed 's/^                //' << EOF >$dummy.c
401
516
                #include <sys/systemcfg.h>
402
517
 
408
523
                        exit(0);
409
524
                        }
410
525
EOF
411
 
                $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm $dummy.c $dummy && exit 0
 
526
                $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0
412
527
                rm -f $dummy.c $dummy
413
528
                echo rs6000-ibm-aix3.2.5
414
529
        elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
417
532
                echo rs6000-ibm-aix3.2
418
533
        fi
419
534
        exit 0 ;;
420
 
    *:AIX:*:4)
421
 
        IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | head -1 | awk '{ print $1 }'`
422
 
        if /usr/sbin/lsattr -EHl ${IBM_CPU_ID} | grep POWER >/dev/null 2>&1; then
 
535
    *:AIX:*:[45])
 
536
        IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
 
537
        if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
423
538
                IBM_ARCH=rs6000
424
539
        else
425
540
                IBM_ARCH=powerpc
427
542
        if [ -x /usr/bin/oslevel ] ; then
428
543
                IBM_REV=`/usr/bin/oslevel`
429
544
        else
430
 
                IBM_REV=4.${UNAME_RELEASE}
 
545
                IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
431
546
        fi
432
547
        echo ${IBM_ARCH}-ibm-aix${IBM_REV}
433
548
        exit 0 ;;
453
568
        echo m68k-hp-bsd4.4
454
569
        exit 0 ;;
455
570
    9000/[34678]??:HP-UX:*:*)
 
571
        HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
456
572
        case "${UNAME_MACHINE}" in
457
573
            9000/31? )            HP_ARCH=m68000 ;;
458
574
            9000/[34]?? )         HP_ARCH=m68k ;;
459
575
            9000/[678][0-9][0-9])
460
 
              sed 's/^              //' << EOF >$dummy.c
 
576
                if [ -x /usr/bin/getconf ]; then
 
577
                    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
 
578
                    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
 
579
                    case "${sc_cpu_version}" in
 
580
                      523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
 
581
                      528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
 
582
                      532)                      # CPU_PA_RISC2_0
 
583
                        case "${sc_kernel_bits}" in
 
584
                          32) HP_ARCH="hppa2.0n" ;;
 
585
                          64) HP_ARCH="hppa2.0w" ;;
 
586
                          '') HP_ARCH="hppa2.0" ;;   # HP-UX 10.20
 
587
                        esac ;;
 
588
                    esac
 
589
                fi
 
590
                if [ "${HP_ARCH}" = "" ]; then
 
591
                    eval $set_cc_for_build
 
592
                    sed 's/^              //' << EOF >$dummy.c
461
593
 
462
594
              #define _HPUX_SOURCE
463
595
              #include <stdlib.h>
490
622
                  exit (0);
491
623
              }
492
624
EOF
493
 
        (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy`
494
 
        rm -f $dummy.c $dummy
 
625
                    (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null) && HP_ARCH=`./$dummy`
 
626
                    if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi
 
627
                    rm -f $dummy.c $dummy
 
628
                fi ;;
495
629
        esac
496
 
        HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
497
630
        echo ${HP_ARCH}-hp-hpux${HPUX_REV}
498
631
        exit 0 ;;
 
632
    ia64:HP-UX:*:*)
 
633
        HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
 
634
        echo ia64-hp-hpux${HPUX_REV}
 
635
        exit 0 ;;
499
636
    3050*:HI-UX:*:*)
 
637
        eval $set_cc_for_build
500
638
        sed 's/^        //' << EOF >$dummy.c
501
639
        #include <unistd.h>
502
640
        int
522
660
          exit (0);
523
661
        }
524
662
EOF
525
 
        $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm $dummy.c $dummy && exit 0
 
663
        $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0
526
664
        rm -f $dummy.c $dummy
527
665
        echo unknown-hitachi-hiuxwe2
528
666
        exit 0 ;;
532
670
    9000/8??:4.3bsd:*:*)
533
671
        echo hppa1.0-hp-bsd
534
672
        exit 0 ;;
535
 
    *9??*:MPE/iX:*:*)
 
673
    *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
536
674
        echo hppa1.0-hp-mpeix
537
675
        exit 0 ;;
538
676
    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
541
679
    hp8??:OSF1:*:*)
542
680
        echo hppa1.0-hp-osf
543
681
        exit 0 ;;
544
 
    i?86:OSF1:*:*)
 
682
    i*86:OSF1:*:*)
545
683
        if [ -x /usr/sbin/sysversion ] ; then
546
684
            echo ${UNAME_MACHINE}-unknown-osf1mk
547
685
        else
551
689
    parisc*:Lites*:*:*)
552
690
        echo hppa1.1-hp-lites
553
691
        exit 0 ;;
554
 
    hppa*:OpenBSD:*:*)
555
 
        echo hppa-unknown-openbsd
556
 
        exit 0 ;;
557
692
    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
558
693
        echo c1-convex-bsd
559
694
        exit 0 ;;
572
707
    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
573
708
        echo c4-convex-bsd
574
709
        exit 0 ;;
575
 
    CRAY*X-MP:*:*:*)
576
 
        echo xmp-cray-unicos
577
 
        exit 0 ;;
578
710
    CRAY*Y-MP:*:*:*)
579
 
        echo ymp-cray-unicos${UNAME_RELEASE}
 
711
        echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
580
712
        exit 0 ;;
581
713
    CRAY*[A-Z]90:*:*:*)
582
714
        echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
583
715
        | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
584
 
              -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/
 
716
              -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
 
717
              -e 's/\.[^.]*$/.X/'
585
718
        exit 0 ;;
586
719
    CRAY*TS:*:*:*)
587
720
        echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
588
721
        exit 0 ;;
 
722
    CRAY*T3D:*:*:*)
 
723
        echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
 
724
        exit 0 ;;
589
725
    CRAY*T3E:*:*:*)
590
 
        echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
 
726
        echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
591
727
        exit 0 ;;
592
728
    CRAY*SV1:*:*:*)
593
729
        echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
594
730
        exit 0 ;;
595
 
    CRAY-2:*:*:*)
596
 
        echo cray2-cray-unicos
597
 
        exit 0 ;;
598
 
    F300:UNIX_System_V:*:*)
 
731
    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
 
732
        FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
599
733
        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
600
734
        FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
601
 
        echo "f300-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
 
735
        echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
602
736
        exit 0 ;;
603
 
    F301:UNIX_System_V:*:*)
604
 
       echo f301-fujitsu-uxpv`echo $UNAME_RELEASE | sed 's/ .*//'`
605
 
       exit 0 ;;
606
 
    hp300:OpenBSD:*:*)
607
 
        echo m68k-unknown-openbsd${UNAME_RELEASE}
608
 
        exit 0 ;;
609
 
    i?86:BSD/386:*:* | i?86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
 
737
    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
610
738
        echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
611
739
        exit 0 ;;
612
740
    sparc*:BSD/OS:*:*)
618
746
    *:FreeBSD:*:*)
619
747
        echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
620
748
        exit 0 ;;
621
 
    *:OpenBSD:*:*)
622
 
        echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
623
 
        exit 0 ;;
624
749
    i*:CYGWIN*:*)
625
750
        echo ${UNAME_MACHINE}-pc-cygwin
626
751
        exit 0 ;;
627
752
    i*:MINGW*:*)
628
753
        echo ${UNAME_MACHINE}-pc-mingw32
629
754
        exit 0 ;;
 
755
    i*:PW*:*)
 
756
        echo ${UNAME_MACHINE}-pc-pw32
 
757
        exit 0 ;;
 
758
    x86:Interix*:3*)
 
759
        echo i386-pc-interix3
 
760
        exit 0 ;;
630
761
    i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
631
762
        # How do we know it's Interix rather than the generic POSIX subsystem?
632
763
        # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
645
776
    *:GNU:*:*)
646
777
        echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
647
778
        exit 0 ;;
648
 
    *:Linux:*:*)
649
 
 
 
779
    i*86:Minix:*:*)
 
780
        echo ${UNAME_MACHINE}-pc-minix
 
781
        exit 0 ;;
 
782
    arm*:Linux:*:*)
 
783
        echo ${UNAME_MACHINE}-unknown-linux-gnu
 
784
        exit 0 ;;
 
785
    ia64:Linux:*:*)
 
786
        echo ${UNAME_MACHINE}-unknown-linux-gnu
 
787
        exit 0 ;;
 
788
    m68*:Linux:*:*)
 
789
        echo ${UNAME_MACHINE}-unknown-linux-gnu
 
790
        exit 0 ;;
 
791
    mips:Linux:*:*)
 
792
        eval $set_cc_for_build
 
793
        sed 's/^        //' << EOF >$dummy.c
 
794
        #undef CPU
 
795
        #undef mips
 
796
        #undef mipsel
 
797
        #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
 
798
        CPU=mipsel
 
799
        #else
 
800
        #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
 
801
        CPU=mips
 
802
        #else
 
803
        CPU=
 
804
        #endif
 
805
        #endif
 
806
EOF
 
807
        eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
 
808
        rm -f $dummy.c
 
809
        test x"${CPU}" != x && echo "${CPU}-pc-linux-gnu" && exit 0
 
810
        ;;
 
811
    ppc:Linux:*:*)
 
812
        echo powerpc-unknown-linux-gnu
 
813
        exit 0 ;;
 
814
    ppc64:Linux:*:*)
 
815
        echo powerpc64-unknown-linux-gnu
 
816
        exit 0 ;;
 
817
    alpha:Linux:*:*)
 
818
        case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
 
819
          EV5)   UNAME_MACHINE=alphaev5 ;;
 
820
          EV56)  UNAME_MACHINE=alphaev56 ;;
 
821
          PCA56) UNAME_MACHINE=alphapca56 ;;
 
822
          PCA57) UNAME_MACHINE=alphapca56 ;;
 
823
          EV6)   UNAME_MACHINE=alphaev6 ;;
 
824
          EV67)  UNAME_MACHINE=alphaev67 ;;
 
825
          EV68*) UNAME_MACHINE=alphaev68 ;;
 
826
        esac
 
827
        objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
 
828
        if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
 
829
        echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
 
830
        exit 0 ;;
 
831
    parisc:Linux:*:* | hppa:Linux:*:*)
 
832
        # Look for CPU level
 
833
        case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
 
834
          PA7*) echo hppa1.1-unknown-linux-gnu ;;
 
835
          PA8*) echo hppa2.0-unknown-linux-gnu ;;
 
836
          *)    echo hppa-unknown-linux-gnu ;;
 
837
        esac
 
838
        exit 0 ;;
 
839
    parisc64:Linux:*:* | hppa64:Linux:*:*)
 
840
        echo hppa64-unknown-linux-gnu
 
841
        exit 0 ;;
 
842
    s390:Linux:*:* | s390x:Linux:*:*)
 
843
        echo ${UNAME_MACHINE}-ibm-linux
 
844
        exit 0 ;;
 
845
    sh*:Linux:*:*)
 
846
        echo ${UNAME_MACHINE}-unknown-linux-gnu
 
847
        exit 0 ;;
 
848
    sparc:Linux:*:* | sparc64:Linux:*:*)
 
849
        echo ${UNAME_MACHINE}-unknown-linux-gnu
 
850
        exit 0 ;;
 
851
    x86_64:Linux:*:*)
 
852
        echo x86_64-unknown-linux-gnu
 
853
        exit 0 ;;
 
854
    i*86:Linux:*:*)
650
855
        # The BFD linker knows what the default object file format is, so
651
856
        # first see if it will tell us. cd to the root directory to prevent
652
857
        # problems with other programs or directories called `ld' in the path.
653
 
        ld_help_string=`cd /; ld --help 2>&1`
654
 
        ld_supported_emulations=`echo $ld_help_string \
655
 
                         | sed -ne '/supported emulations:/!d
 
858
        # Set LC_ALL=C to ensure ld outputs messages in English.
 
859
        ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
 
860
                         | sed -ne '/supported targets:/!d
656
861
                                    s/[         ][      ]*/ /g
657
 
                                    s/.*supported emulations: *//
 
862
                                    s/.*supported targets: *//
658
863
                                    s/ .*//
659
864
                                    p'`
660
 
        case "$ld_supported_emulations" in
661
 
          *ia64)
662
 
                echo "${UNAME_MACHINE}-unknown-linux"
663
 
                exit 0
 
865
        case "$ld_supported_targets" in
 
866
          elf32-i386)
 
867
                TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
664
868
                ;;
665
 
          i?86linux)
 
869
          a.out-i386-linux)
666
870
                echo "${UNAME_MACHINE}-pc-linux-gnuaout"
667
 
                exit 0
668
 
                ;;
669
 
          elf_i?86)
670
 
                echo "${UNAME_MACHINE}-pc-linux"
671
 
                exit 0
672
 
                ;;
673
 
          i?86coff)
 
871
                exit 0 ;;               
 
872
          coff-i386)
674
873
                echo "${UNAME_MACHINE}-pc-linux-gnucoff"
675
 
                exit 0
676
 
                ;;
677
 
          sparclinux)
678
 
                echo "${UNAME_MACHINE}-unknown-linux-gnuaout"
679
 
                exit 0
680
 
                ;;
681
 
          armlinux)
682
 
                echo "${UNAME_MACHINE}-unknown-linux-gnuaout"
683
 
                exit 0
684
 
                ;;
685
 
          elf32arm*)
686
 
                echo "${UNAME_MACHINE}-unknown-linux-gnuoldld"
687
 
                exit 0
688
 
                ;;
689
 
          armelf_linux*)
690
 
                echo "${UNAME_MACHINE}-unknown-linux-gnu"
691
 
                exit 0
692
 
                ;;
693
 
          m68klinux)
694
 
                echo "${UNAME_MACHINE}-unknown-linux-gnuaout"
695
 
                exit 0
696
 
                ;;
697
 
          elf32ppc | elf32ppclinux)
698
 
                # Determine Lib Version
699
 
                cat >$dummy.c <<EOF
700
 
#include <features.h>
701
 
#if defined(__GLIBC__)
702
 
extern char __libc_version[];
703
 
extern char __libc_release[];
704
 
#endif
705
 
main(argc, argv)
706
 
     int argc;
707
 
     char *argv[];
708
 
{
709
 
#if defined(__GLIBC__)
710
 
  printf("%s %s\n", __libc_version, __libc_release);
711
 
#else
712
 
  printf("unkown\n");
713
 
#endif
714
 
  return 0;
715
 
}
716
 
EOF
717
 
                LIBC=""
718
 
                $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null
719
 
                if test "$?" = 0 ; then
720
 
                        ./$dummy | grep 1\.99 > /dev/null
721
 
                        if test "$?" = 0 ; then
722
 
                                LIBC="libc1"
723
 
                        fi
724
 
                fi
725
 
                rm -f $dummy.c $dummy
726
 
                echo powerpc-unknown-linux-gnu${LIBC}
727
 
                exit 0
728
 
                ;;
 
874
                exit 0 ;;
 
875
          "")
 
876
                # Either a pre-BFD a.out linker (linux-gnuoldld) or
 
877
                # one that does not give us useful --help.
 
878
                echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
 
879
                exit 0 ;;
729
880
        esac
730
 
 
731
 
        if test "${UNAME_MACHINE}" = "alpha" ; then
732
 
                cat <<EOF >$dummy.s
733
 
                        .data
734
 
                \$Lformat:
735
 
                        .byte 37,100,45,37,120,10,0     # "%d-%x\n"
736
 
 
737
 
                        .text
738
 
                        .globl main
739
 
                        .align 4
740
 
                        .ent main
741
 
                main:
742
 
                        .frame \$30,16,\$26,0
743
 
                        ldgp \$29,0(\$27)
744
 
                        .prologue 1
745
 
                        .long 0x47e03d80 # implver \$0
746
 
                        lda \$2,-1
747
 
                        .long 0x47e20c21 # amask \$2,\$1
748
 
                        lda \$16,\$Lformat
749
 
                        mov \$0,\$17
750
 
                        not \$1,\$18
751
 
                        jsr \$26,printf
752
 
                        ldgp \$29,0(\$26)
753
 
                        mov 0,\$16
754
 
                        jsr \$26,exit
755
 
                        .end main
756
 
EOF
757
 
                LIBC=""
758
 
                $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
759
 
                if test "$?" = 0 ; then
760
 
                        case `./$dummy` in
761
 
                        0-0)
762
 
                                UNAME_MACHINE="alpha"
763
 
                                ;;
764
 
                        1-0)
765
 
                                UNAME_MACHINE="alphaev5"
766
 
                                ;;
767
 
                        1-1)
768
 
                                UNAME_MACHINE="alphaev56"
769
 
                                ;;
770
 
                        1-101)
771
 
                                UNAME_MACHINE="alphapca56"
772
 
                                ;;
773
 
                        2-303)
774
 
                                UNAME_MACHINE="alphaev6"
775
 
                                ;;
776
 
                        2-307)
777
 
                                UNAME_MACHINE="alphaev67"
778
 
                                ;;
779
 
                        esac
780
 
 
781
 
                        objdump --private-headers $dummy | \
782
 
                          grep ld.so.1 > /dev/null
783
 
                        if test "$?" = 0 ; then
784
 
                                LIBC="libc1"
785
 
                        fi
786
 
                fi
787
 
                rm -f $dummy.s $dummy
788
 
                echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} ; exit 0
789
 
        elif test "${UNAME_MACHINE}" = "mips" ; then
790
 
          cat >$dummy.c <<EOF
791
 
#ifdef __cplusplus
792
 
#include <stdio.h>  /* for printf() prototype */
793
 
        int main (int argc, char *argv[]) {
794
 
#else
795
 
        int main (argc, argv) int argc; char *argv[]; {
796
 
#endif
797
 
#ifdef __MIPSEB__
798
 
  printf ("%s-unknown-linux-gnu\n", argv[1]);
799
 
#endif
800
 
#ifdef __MIPSEL__
801
 
  printf ("%sel-unknown-linux-gnu\n", argv[1]);
802
 
#endif
803
 
  return 0;
804
 
}
805
 
EOF
806
 
          $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0
807
 
          rm -f $dummy.c $dummy
808
 
        elif test "${UNAME_MACHINE}" = "s390"; then
809
 
          echo s390-ibm-linux && exit 0
810
 
        else
811
 
          # Either a pre-BFD a.out linker (linux-gnuoldld)
812
 
          # or one that does not give us useful --help.
813
 
          # GCC wants to distinguish between linux-gnuoldld and linux-gnuaout.
814
 
          # If ld does not provide *any* "supported emulations:"
815
 
          # that means it is gnuoldld.
816
 
          echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations:"
817
 
          test $? != 0 && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0
818
 
 
819
 
          case "${UNAME_MACHINE}" in
820
 
          i?86)
821
 
            VENDOR=pc;
822
 
            ;;
823
 
          *)
824
 
            VENDOR=unknown;
825
 
            ;;
826
 
          esac
827
 
          # Determine whether the default compiler is a.out or elf
828
 
          cat >$dummy.c <<EOF
829
 
#include <features.h>
830
 
#ifdef __cplusplus
831
 
#include <stdio.h>  /* for printf() prototype */
832
 
        int main (int argc, char *argv[]) {
833
 
#else
834
 
        int main (argc, argv) int argc; char *argv[]; {
835
 
#endif
836
 
#ifdef __ELF__
837
 
# ifdef __GLIBC__
838
 
#  if __GLIBC__ >= 2
839
 
    printf ("%s-${VENDOR}-linux-gnu\n", argv[1]);
840
 
#  else
841
 
    printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]);
842
 
#  endif
843
 
# else
844
 
   printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]);
845
 
# endif
846
 
#else
847
 
  printf ("%s-${VENDOR}-linux-gnuaout\n", argv[1]);
848
 
#endif
849
 
  return 0;
850
 
}
851
 
EOF
852
 
          $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0
853
 
          rm -f $dummy.c $dummy
854
 
        fi ;;
855
 
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.  earlier versions
856
 
# are messed up and put the nodename in both sysname and nodename.
857
 
    i?86:DYNIX/ptx:4*:*)
 
881
        # Determine whether the default compiler is a.out or elf
 
882
        eval $set_cc_for_build
 
883
        sed 's/^        //' << EOF >$dummy.c
 
884
        #include <features.h>
 
885
        #ifdef __ELF__
 
886
        # ifdef __GLIBC__
 
887
        #  if __GLIBC__ >= 2
 
888
        LIBC=gnu
 
889
        #  else
 
890
        LIBC=gnulibc1
 
891
        #  endif
 
892
        # else
 
893
        LIBC=gnulibc1
 
894
        # endif
 
895
        #else
 
896
        #ifdef __INTEL_COMPILER
 
897
        LIBC=gnu
 
898
        #else
 
899
        LIBC=gnuaout
 
900
        #endif
 
901
        #endif
 
902
EOF
 
903
        eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
 
904
        rm -f $dummy.c
 
905
        test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0
 
906
        test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
 
907
        ;;
 
908
    i*86:DYNIX/ptx:4*:*)
 
909
        # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
 
910
        # earlier versions are messed up and put the nodename in both
 
911
        # sysname and nodename.
858
912
        echo i386-sequent-sysv4
859
913
        exit 0 ;;
860
 
    i?86:UNIX_SV:4.2MP:2.*)
 
914
    i*86:UNIX_SV:4.2MP:2.*)
861
915
        # Unixware is an offshoot of SVR4, but it has its own version
862
916
        # number series starting with 2...
863
917
        # I am not positive that other SVR4 systems won't match this,
865
919
        # Use sysv4.2uw... so that sysv4* matches it.
866
920
        echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
867
921
        exit 0 ;;
868
 
    i?86:*:4.*:* | i?86:SYSTEM_V:4.*:*)
 
922
    i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
869
923
        UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
870
924
        if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
871
925
                echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
873
927
                echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
874
928
        fi
875
929
        exit 0 ;;
876
 
    i?86:*:5:7*)
877
 
        # Fixed at (any) Pentium or better
878
 
        UNAME_MACHINE=i586
879
 
        if [ ${UNAME_SYSTEM} = "UnixWare" ] ; then
880
 
            echo ${UNAME_MACHINE}-sco-sysv${UNAME_RELEASE}uw${UNAME_VERSION}
881
 
        else
882
 
            echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE}
883
 
        fi
 
930
    i*86:*:5:[78]*)
 
931
        case `/bin/uname -X | grep "^Machine"` in
 
932
            *486*)           UNAME_MACHINE=i486 ;;
 
933
            *Pentium)        UNAME_MACHINE=i586 ;;
 
934
            *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
 
935
        esac
 
936
        echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
884
937
        exit 0 ;;
885
 
    i?86:*:3.2:*)
 
938
    i*86:*:3.2:*)
886
939
        if test -f /usr/options/cb.name; then
887
940
                UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
888
941
                echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
900
953
                echo ${UNAME_MACHINE}-pc-sysv32
901
954
        fi
902
955
        exit 0 ;;
903
 
    i?86:*DOS:*:*)
 
956
    i*86:*DOS:*:*)
904
957
        echo ${UNAME_MACHINE}-pc-msdosdjgpp
905
958
        exit 0 ;;
906
959
    pc:*:*:*)
928
981
        exit 0 ;;
929
982
    M68*:*:R3V[567]*:*)
930
983
        test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
931
 
    3[34]??:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0)
 
984
    3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0)
932
985
        OS_REL=''
933
986
        test -r /etc/.relid \
934
987
        && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
939
992
    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
940
993
        /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
941
994
          && echo i486-ncr-sysv4 && exit 0 ;;
942
 
    m68*:LynxOS:2.*:*)
 
995
    m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
943
996
        echo m68k-unknown-lynxos${UNAME_RELEASE}
944
997
        exit 0 ;;
945
998
    mc68030:UNIX_System_V:4.*:*)
946
999
        echo m68k-atari-sysv4
947
1000
        exit 0 ;;
948
 
    i?86:LynxOS:2.*:* | i?86:LynxOS:3.[01]*:*)
 
1001
    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
949
1002
        echo i386-unknown-lynxos${UNAME_RELEASE}
950
1003
        exit 0 ;;
951
1004
    TSUNAMI:LynxOS:2.*:*)
952
1005
        echo sparc-unknown-lynxos${UNAME_RELEASE}
953
1006
        exit 0 ;;
954
 
    rs6000:LynxOS:2.*:* | PowerPC:LynxOS:2.*:*)
 
1007
    rs6000:LynxOS:2.*:*)
955
1008
        echo rs6000-unknown-lynxos${UNAME_RELEASE}
956
1009
        exit 0 ;;
 
1010
    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
 
1011
        echo powerpc-unknown-lynxos${UNAME_RELEASE}
 
1012
        exit 0 ;;
957
1013
    SM[BE]S:UNIX_SV:*:*)
958
1014
        echo mips-dde-sysv${UNAME_RELEASE}
959
1015
        exit 0 ;;
971
1027
                echo ns32k-sni-sysv
972
1028
        fi
973
1029
        exit 0 ;;
974
 
    PENTIUM:CPunix:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
975
 
                           # says <Richard.M.Bartel@ccMail.Census.GOV>
 
1030
    PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
 
1031
                      # says <Richard.M.Bartel@ccMail.Census.GOV>
976
1032
        echo i586-unisys-sysv4
977
1033
        exit 0 ;;
978
1034
    *:UNIX_System_V:4*:FTX*)
984
1040
        # From seanf@swdc.stratus.com.
985
1041
        echo i860-stratus-sysv4
986
1042
        exit 0 ;;
 
1043
    *:VOS:*:*)
 
1044
        # From Paul.Green@stratus.com.
 
1045
        echo hppa1.1-stratus-vos
 
1046
        exit 0 ;;
987
1047
    mc68*:A/UX:*:*)
988
1048
        echo m68k-apple-aux${UNAME_RELEASE}
989
1049
        exit 0 ;;
990
 
    news*:NEWS-OS:*:6*)
 
1050
    news*:NEWS-OS:6*:*)
991
1051
        echo mips-sony-newsos6
992
1052
        exit 0 ;;
993
1053
    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
1022
1082
        echo `uname -p`-apple-darwin${UNAME_RELEASE}
1023
1083
        exit 0 ;;
1024
1084
    *:procnto*:*:* | *:QNX:[0123456789]*:*)
1025
 
        if test "${UNAME_MACHINE}" = "x86pc"; then
 
1085
        UNAME_PROCESSOR=`uname -p`
 
1086
        if test "$UNAME_PROCESSOR" = "x86"; then
 
1087
                UNAME_PROCESSOR=i386
1026
1088
                UNAME_MACHINE=pc
1027
1089
        fi
1028
 
        echo `uname -p`-${UNAME_MACHINE}-nto-qnx
 
1090
        echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
1029
1091
        exit 0 ;;
1030
1092
    *:QNX:*:4*)
1031
1093
        echo i386-pc-qnx
1032
1094
        exit 0 ;;
1033
 
    NSR-W:NONSTOP_KERNEL:*:*)
 
1095
    NSR-[GKLNPTVW]:NONSTOP_KERNEL:*:*)
1034
1096
        echo nsr-tandem-nsk${UNAME_RELEASE}
1035
1097
        exit 0 ;;
 
1098
    *:NonStop-UX:*:*)
 
1099
        echo mips-compaq-nonstopux
 
1100
        exit 0 ;;
1036
1101
    BS2000:POSIX*:*:*)
1037
1102
        echo bs2000-siemens-sysv
1038
1103
        exit 0 ;;
1039
1104
    DS/*:UNIX_System_V:*:*)
1040
1105
        echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
1041
1106
        exit 0 ;;
 
1107
    *:Plan9:*:*)
 
1108
        # "uname -m" is not consistent, so use $cputype instead. 386
 
1109
        # is converted to i386 for consistency with other x86
 
1110
        # operating systems.
 
1111
        if test "$cputype" = "386"; then
 
1112
            UNAME_MACHINE=i386
 
1113
        else
 
1114
            UNAME_MACHINE="$cputype"
 
1115
        fi
 
1116
        echo ${UNAME_MACHINE}-unknown-plan9
 
1117
        exit 0 ;;
 
1118
    i*86:OS/2:*:*)
 
1119
        # If we were able to find `uname', then EMX Unix compatibility
 
1120
        # is probably installed.
 
1121
        echo ${UNAME_MACHINE}-pc-os2-emx
 
1122
        exit 0 ;;
 
1123
    *:TOPS-10:*:*)
 
1124
        echo pdp10-unknown-tops10
 
1125
        exit 0 ;;
 
1126
    *:TENEX:*:*)
 
1127
        echo pdp10-unknown-tenex
 
1128
        exit 0 ;;
 
1129
    KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
 
1130
        echo pdp10-dec-tops20
 
1131
        exit 0 ;;
 
1132
    XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
 
1133
        echo pdp10-xkl-tops20
 
1134
        exit 0 ;;
 
1135
    *:TOPS-20:*:*)
 
1136
        echo pdp10-unknown-tops20
 
1137
        exit 0 ;;
 
1138
    *:ITS:*:*)
 
1139
        echo pdp10-unknown-its
 
1140
        exit 0 ;;
 
1141
    i*86:XTS-300:*:STOP)
 
1142
        echo ${UNAME_MACHINE}-unknown-stop
 
1143
        exit 0 ;;
 
1144
    i*86:atheos:*:*)
 
1145
        echo ${UNAME_MACHINE}-unknown-atheos
 
1146
        exit 0 ;;
1042
1147
esac
1043
1148
 
1044
1149
#echo '(No uname command or uname output not recognized.)' 1>&2
1045
1150
#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
1046
1151
 
 
1152
eval $set_cc_for_build
1047
1153
cat >$dummy.c <<EOF
1048
1154
#ifdef _SEQUENT_
1049
1155
# include <sys/types.h>
1130
1236
#endif
1131
1237
 
1132
1238
#if defined (vax)
1133
 
#if !defined (ultrix)
1134
 
  printf ("vax-dec-bsd\n"); exit (0);
1135
 
#else
1136
 
  printf ("vax-dec-ultrix\n"); exit (0);
1137
 
#endif
 
1239
# if !defined (ultrix)
 
1240
#  include <sys/param.h>
 
1241
#  if defined (BSD)
 
1242
#   if BSD == 43
 
1243
      printf ("vax-dec-bsd4.3\n"); exit (0);
 
1244
#   else
 
1245
#    if BSD == 199006
 
1246
      printf ("vax-dec-bsd4.3reno\n"); exit (0);
 
1247
#    else
 
1248
      printf ("vax-dec-bsd\n"); exit (0);
 
1249
#    endif
 
1250
#   endif
 
1251
#  else
 
1252
    printf ("vax-dec-bsd\n"); exit (0);
 
1253
#  endif
 
1254
# else
 
1255
    printf ("vax-dec-ultrix\n"); exit (0);
 
1256
# endif
1138
1257
#endif
1139
1258
 
1140
1259
#if defined (alliant) && defined (i860)
1145
1264
}
1146
1265
EOF
1147
1266
 
1148
 
$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm $dummy.c $dummy && exit 0
 
1267
$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm -f $dummy.c $dummy && exit 0
1149
1268
rm -f $dummy.c $dummy
1150
1269
 
1151
1270
# Apollos put the system type in the environment.
1178
1297
    esac
1179
1298
fi
1180
1299
 
1181
 
#echo '(Unable to guess system type)' 1>&2
 
1300
cat >&2 <<EOF
 
1301
$0: unable to guess system type
 
1302
 
 
1303
This script, last modified $timestamp, has failed to recognize
 
1304
the operating system you are using. It is advised that you
 
1305
download the most up to date version of the config scripts from
 
1306
 
 
1307
    ftp://ftp.gnu.org/pub/gnu/config/
 
1308
 
 
1309
If the version you run ($0) is already up to date, please
 
1310
send the following data and any information you think might be
 
1311
pertinent to <config-patches@gnu.org> in order to provide the needed
 
1312
information to handle your system.
 
1313
 
 
1314
config.guess timestamp = $timestamp
 
1315
 
 
1316
uname -m = `(uname -m) 2>/dev/null || echo unknown`
 
1317
uname -r = `(uname -r) 2>/dev/null || echo unknown`
 
1318
uname -s = `(uname -s) 2>/dev/null || echo unknown`
 
1319
uname -v = `(uname -v) 2>/dev/null || echo unknown`
 
1320
 
 
1321
/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
 
1322
/bin/uname -X     = `(/bin/uname -X) 2>/dev/null`
 
1323
 
 
1324
hostinfo               = `(hostinfo) 2>/dev/null`
 
1325
/bin/universe          = `(/bin/universe) 2>/dev/null`
 
1326
/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null`
 
1327
/bin/arch              = `(/bin/arch) 2>/dev/null`
 
1328
/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`
 
1329
/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
 
1330
 
 
1331
UNAME_MACHINE = ${UNAME_MACHINE}
 
1332
UNAME_RELEASE = ${UNAME_RELEASE}
 
1333
UNAME_SYSTEM  = ${UNAME_SYSTEM}
 
1334
UNAME_VERSION = ${UNAME_VERSION}
 
1335
EOF
1182
1336
 
1183
1337
exit 1
 
1338
 
 
1339
# Local variables:
 
1340
# eval: (add-hook 'write-file-hooks 'time-stamp)
 
1341
# time-stamp-start: "timestamp='"
 
1342
# time-stamp-format: "%:y-%02m-%02d"
 
1343
# time-stamp-end: "'"
 
1344
# End: