~ubuntu-branches/ubuntu/edgy/rxtx/edgy-201105201527

« back to all changes in this revision

Viewing changes to config.guess

  • Committer: Bazaar Package Importer
  • Author(s): Mario Joussen
  • Date: 2006-03-01 18:56:52 UTC
  • mfrom: (1.1.2 upstream) (2.1.1 etch)
  • Revision ID: james.westby@ubuntu.com-20060301185652-ri9941gi01goklvz
Tags: 2.1.7-2
Fixed stupid bug in clean target.
(closes: Bug#354859)

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, 2001
4
 
#   Free Software Foundation, Inc.
 
3
#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
 
4
#   2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
5
5
 
6
 
timestamp='2001-09-04'
 
6
timestamp='2005-05-15'
7
7
 
8
8
# This file is free software; you can redistribute it and/or modify it
9
9
# under the terms of the GNU General Public License as published by
17
17
#
18
18
# You should have received a copy of the GNU General Public License
19
19
# along with this program; if not, write to the Free Software
20
 
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
20
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
 
21
# 02110-1301, USA.
21
22
#
22
23
# As a special exception to the GNU General Public License, if you
23
24
# distribute this file as part of a program that contains a
24
25
# configuration script generated by Autoconf, you may include it under
25
26
# the same distribution terms that you use for the rest of that program.
26
27
 
27
 
# Written by Per Bothner <bothner@cygnus.com>.
28
 
# Please send patches to <config-patches@gnu.org>.
 
28
 
 
29
# Originally written by Per Bothner <per@bothner.com>.
 
30
# Please send patches to <config-patches@gnu.org>.  Submit a context
 
31
# diff and a properly formatted ChangeLog entry.
29
32
#
30
33
# This script attempts to guess a canonical system name similar to
31
34
# config.sub.  If it succeeds, it prints the system name on stdout, and
52
55
GNU config.guess ($timestamp)
53
56
 
54
57
Originally written by Per Bothner.
55
 
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
 
58
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
56
59
Free Software Foundation, Inc.
57
60
 
58
61
This is free software; see the source for copying conditions.  There is NO
65
68
while test $# -gt 0 ; do
66
69
  case $1 in
67
70
    --time-stamp | --time* | -t )
68
 
       echo "$timestamp" ; exit 0 ;;
 
71
       echo "$timestamp" ; exit ;;
69
72
    --version | -v )
70
 
       echo "$version" ; exit 0 ;;
 
73
       echo "$version" ; exit ;;
71
74
    --help | --h* | -h )
72
 
       echo "$usage"; exit 0 ;;
 
75
       echo "$usage"; exit ;;
73
76
    -- )     # Stop option processing
74
77
       shift; break ;;
75
78
    - ) # Use stdin as input.
87
90
  exit 1
88
91
fi
89
92
 
90
 
 
91
 
dummy=dummy-$$
92
 
trap 'rm -f $dummy.c $dummy.o $dummy.rel $dummy; exit 1' 1 2 15
93
 
 
94
 
# CC_FOR_BUILD -- compiler used by this script.
 
93
trap 'exit 1' 1 2 15
 
94
 
 
95
# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
 
96
# compiler to aid in system detection is discouraged as it requires
 
97
# temporary files to be created and, as you can see below, it is a
 
98
# headache to deal with in a portable fashion.
 
99
 
95
100
# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
96
101
# use `HOST_CC' if defined, but it is deprecated.
97
102
 
98
 
set_cc_for_build='case $CC_FOR_BUILD,$HOST_CC,$CC in
99
 
 ,,)    echo "int dummy(){}" > $dummy.c ;
100
 
        for c in cc gcc c89 ; do
101
 
          ($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1 ;
102
 
          if test $? = 0 ; then
 
103
# Portable tmp directory creation inspired by the Autoconf team.
 
104
 
 
105
set_cc_for_build='
 
106
trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
 
107
trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
 
108
: ${TMPDIR=/tmp} ;
 
109
 { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
 
110
 { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
 
111
 { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
 
112
 { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
 
113
dummy=$tmp/dummy ;
 
114
tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
 
115
case $CC_FOR_BUILD,$HOST_CC,$CC in
 
116
 ,,)    echo "int x;" > $dummy.c ;
 
117
        for c in cc gcc c89 c99 ; do
 
118
          if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
103
119
             CC_FOR_BUILD="$c"; break ;
104
120
          fi ;
105
121
        done ;
106
 
        rm -f $dummy.c $dummy.o $dummy.rel ;
107
122
        if test x"$CC_FOR_BUILD" = x ; then
108
123
          CC_FOR_BUILD=no_compiler_found ;
109
124
        fi
110
125
        ;;
111
126
 ,,*)   CC_FOR_BUILD=$CC ;;
112
127
 ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
113
 
esac'
 
128
esac ;'
114
129
 
115
130
# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
116
131
# (ghazi@noc.rutgers.edu 1994-08-24)
127
142
 
128
143
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
129
144
    *:NetBSD:*:*)
130
 
        # Netbsd (nbsd) targets should (where applicable) match one or
 
145
        # NetBSD (nbsd) targets should (where applicable) match one or
131
146
        # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
132
147
        # *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
133
148
        # switched to ELF, *-*-netbsd* would select the old
134
149
        # object file format.  This provides both forward
135
150
        # compatibility and a consistent mechanism for selecting the
136
151
        # object file format.
137
 
        # Determine the machine/vendor (is the vendor relevant).
138
 
        case "${UNAME_MACHINE}" in
139
 
            amiga) machine=m68k-unknown ;;
140
 
            arm32) machine=arm-unknown ;;
141
 
            atari*) machine=m68k-atari ;;
142
 
            sun3*) machine=m68k-sun ;;
143
 
            mac68k) machine=m68k-apple ;;
144
 
            macppc) machine=powerpc-apple ;;
145
 
            hp3[0-9][05]) machine=m68k-hp ;;
146
 
            ibmrt|romp-ibm) machine=romp-ibm ;;
147
 
            *) machine=${UNAME_MACHINE}-unknown ;;
 
152
        #
 
153
        # Note: NetBSD doesn't particularly care about the vendor
 
154
        # portion of the name.  We always set it to "unknown".
 
155
        sysctl="sysctl -n hw.machine_arch"
 
156
        UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
 
157
            /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
 
158
        case "${UNAME_MACHINE_ARCH}" in
 
159
            armeb) machine=armeb-unknown ;;
 
160
            arm*) machine=arm-unknown ;;
 
161
            sh3el) machine=shl-unknown ;;
 
162
            sh3eb) machine=sh-unknown ;;
 
163
            *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
148
164
        esac
149
165
        # The Operating System including object format, if it has switched
150
166
        # to ELF recently, or will in the future.
151
 
        case "${UNAME_MACHINE}" in
152
 
            i386|sparc|amiga|arm*|hp300|mvme68k|vax|atari|luna68k|mac68k|news68k|next68k|pc532|sun3*|x68k)
 
167
        case "${UNAME_MACHINE_ARCH}" in
 
168
            arm*|i386|m68k|ns32k|sh3*|sparc|vax)
153
169
                eval $set_cc_for_build
154
170
                if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
155
171
                        | grep __ELF__ >/dev/null
166
182
                ;;
167
183
        esac
168
184
        # The OS release
169
 
        release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
 
185
        # Debian GNU/NetBSD machines have a different userland, and
 
186
        # thus, need a distinct triplet. However, they do not need
 
187
        # kernel version information, so it can be replaced with a
 
188
        # suitable tag, in the style of linux-gnu.
 
189
        case "${UNAME_VERSION}" in
 
190
            Debian*)
 
191
                release='-gnu'
 
192
                ;;
 
193
            *)
 
194
                release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
 
195
                ;;
 
196
        esac
170
197
        # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
171
198
        # contains redundant information, the shorter form:
172
199
        # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
173
200
        echo "${machine}-${os}${release}"
174
 
        exit 0 ;;
 
201
        exit ;;
 
202
    amd64:OpenBSD:*:*)
 
203
        echo x86_64-unknown-openbsd${UNAME_RELEASE}
 
204
        exit ;;
 
205
    amiga:OpenBSD:*:*)
 
206
        echo m68k-unknown-openbsd${UNAME_RELEASE}
 
207
        exit ;;
 
208
    cats:OpenBSD:*:*)
 
209
        echo arm-unknown-openbsd${UNAME_RELEASE}
 
210
        exit ;;
 
211
    hp300:OpenBSD:*:*)
 
212
        echo m68k-unknown-openbsd${UNAME_RELEASE}
 
213
        exit ;;
 
214
    luna88k:OpenBSD:*:*)
 
215
        echo m88k-unknown-openbsd${UNAME_RELEASE}
 
216
        exit ;;
 
217
    mac68k:OpenBSD:*:*)
 
218
        echo m68k-unknown-openbsd${UNAME_RELEASE}
 
219
        exit ;;
 
220
    macppc:OpenBSD:*:*)
 
221
        echo powerpc-unknown-openbsd${UNAME_RELEASE}
 
222
        exit ;;
 
223
    mvme68k:OpenBSD:*:*)
 
224
        echo m68k-unknown-openbsd${UNAME_RELEASE}
 
225
        exit ;;
 
226
    mvme88k:OpenBSD:*:*)
 
227
        echo m88k-unknown-openbsd${UNAME_RELEASE}
 
228
        exit ;;
 
229
    mvmeppc:OpenBSD:*:*)
 
230
        echo powerpc-unknown-openbsd${UNAME_RELEASE}
 
231
        exit ;;
 
232
    sgi:OpenBSD:*:*)
 
233
        echo mips64-unknown-openbsd${UNAME_RELEASE}
 
234
        exit ;;
 
235
    sun3:OpenBSD:*:*)
 
236
        echo m68k-unknown-openbsd${UNAME_RELEASE}
 
237
        exit ;;
 
238
    *:OpenBSD:*:*)
 
239
        echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE}
 
240
        exit ;;
 
241
    *:ekkoBSD:*:*)
 
242
        echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
 
243
        exit ;;
 
244
    macppc:MirBSD:*:*)
 
245
        echo powerppc-unknown-mirbsd${UNAME_RELEASE}
 
246
        exit ;;
 
247
    *:MirBSD:*:*)
 
248
        echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
 
249
        exit ;;
175
250
    alpha:OSF1:*:*)
176
 
        if test $UNAME_RELEASE = "V4.0"; then
 
251
        case $UNAME_RELEASE in
 
252
        *4.0)
177
253
                UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
178
 
        fi
 
254
                ;;
 
255
        *5.*)
 
256
                UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
 
257
                ;;
 
258
        esac
 
259
        # According to Compaq, /usr/sbin/psrinfo has been available on
 
260
        # OSF/1 and Tru64 systems produced since 1995.  I hope that
 
261
        # covers most systems running today.  This code pipes the CPU
 
262
        # types through head -n 1, so we only detect the type of CPU 0.
 
263
        ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\) processor.*$/\1/p' | head -n 1`
 
264
        case "$ALPHA_CPU_TYPE" in
 
265
            "EV4 (21064)")
 
266
                UNAME_MACHINE="alpha" ;;
 
267
            "EV4.5 (21064)")
 
268
                UNAME_MACHINE="alpha" ;;
 
269
            "LCA4 (21066/21068)")
 
270
                UNAME_MACHINE="alpha" ;;
 
271
            "EV5 (21164)")
 
272
                UNAME_MACHINE="alphaev5" ;;
 
273
            "EV5.6 (21164A)")
 
274
                UNAME_MACHINE="alphaev56" ;;
 
275
            "EV5.6 (21164PC)")
 
276
                UNAME_MACHINE="alphapca56" ;;
 
277
            "EV5.7 (21164PC)")
 
278
                UNAME_MACHINE="alphapca57" ;;
 
279
            "EV6 (21264)")
 
280
                UNAME_MACHINE="alphaev6" ;;
 
281
            "EV6.7 (21264A)")
 
282
                UNAME_MACHINE="alphaev67" ;;
 
283
            "EV6.8CB (21264C)")
 
284
                UNAME_MACHINE="alphaev68" ;;
 
285
            "EV6.8AL (21264B)")
 
286
                UNAME_MACHINE="alphaev68" ;;
 
287
            "EV6.8CX (21264D)")
 
288
                UNAME_MACHINE="alphaev68" ;;
 
289
            "EV6.9A (21264/EV69A)")
 
290
                UNAME_MACHINE="alphaev69" ;;
 
291
            "EV7 (21364)")
 
292
                UNAME_MACHINE="alphaev7" ;;
 
293
            "EV7.9 (21364A)")
 
294
                UNAME_MACHINE="alphaev79" ;;
 
295
        esac
 
296
        # A Pn.n version is a patched version.
179
297
        # A Vn.n version is a released version.
180
298
        # A Tn.n version is a released field test version.
181
299
        # A Xn.n version is an unreleased experimental baselevel.
182
300
        # 1.2 uses "1.2" for uname -r.
183
 
        cat <<EOF >$dummy.s
184
 
        .data
185
 
\$Lformat:
186
 
        .byte 37,100,45,37,120,10,0     # "%d-%x\n"
187
 
 
188
 
        .text
189
 
        .globl main
190
 
        .align 4
191
 
        .ent main
192
 
main:
193
 
        .frame \$30,16,\$26,0
194
 
        ldgp \$29,0(\$27)
195
 
        .prologue 1
196
 
        .long 0x47e03d80 # implver \$0
197
 
        lda \$2,-1
198
 
        .long 0x47e20c21 # amask \$2,\$1
199
 
        lda \$16,\$Lformat
200
 
        mov \$0,\$17
201
 
        not \$1,\$18
202
 
        jsr \$26,printf
203
 
        ldgp \$29,0(\$26)
204
 
        mov 0,\$16
205
 
        jsr \$26,exit
206
 
        .end main
207
 
EOF
208
 
        eval $set_cc_for_build
209
 
        $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
210
 
        if test "$?" = 0 ; then
211
 
                case `./$dummy` in
212
 
                        0-0)
213
 
                                UNAME_MACHINE="alpha"
214
 
                                ;;
215
 
                        1-0)
216
 
                                UNAME_MACHINE="alphaev5"
217
 
                                ;;
218
 
                        1-1)
219
 
                                UNAME_MACHINE="alphaev56"
220
 
                                ;;
221
 
                        1-101)
222
 
                                UNAME_MACHINE="alphapca56"
223
 
                                ;;
224
 
                        2-303)
225
 
                                UNAME_MACHINE="alphaev6"
226
 
                                ;;
227
 
                        2-307)
228
 
                                UNAME_MACHINE="alphaev67"
229
 
                                ;;
230
 
                        2-1307)
231
 
                                UNAME_MACHINE="alphaev68"
232
 
                                ;;
233
 
                esac
234
 
        fi
235
 
        rm -f $dummy.s $dummy
236
 
        echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
237
 
        exit 0 ;;
 
301
        echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
 
302
        exit ;;
238
303
    Alpha\ *:Windows_NT*:*)
239
304
        # How do we know it's Interix rather than the generic POSIX subsystem?
240
305
        # Should we change UNAME_MACHINE based on the output of uname instead
241
306
        # of the specific Alpha model?
242
307
        echo alpha-pc-interix
243
 
        exit 0 ;;
 
308
        exit ;;
244
309
    21064:Windows_NT:50:3)
245
310
        echo alpha-dec-winnt3.5
246
 
        exit 0 ;;
 
311
        exit ;;
247
312
    Amiga*:UNIX_System_V:4.0:*)
248
313
        echo m68k-unknown-sysv4
249
 
        exit 0;;
250
 
    amiga:OpenBSD:*:*)
251
 
        echo m68k-unknown-openbsd${UNAME_RELEASE}
252
 
        exit 0 ;;
 
314
        exit ;;
253
315
    *:[Aa]miga[Oo][Ss]:*:*)
254
316
        echo ${UNAME_MACHINE}-unknown-amigaos
255
 
        exit 0 ;;
256
 
    arc64:OpenBSD:*:*)
257
 
        echo mips64el-unknown-openbsd${UNAME_RELEASE}
258
 
        exit 0 ;;
259
 
    arc:OpenBSD:*:*)
260
 
        echo mipsel-unknown-openbsd${UNAME_RELEASE}
261
 
        exit 0 ;;
262
 
    hkmips:OpenBSD:*:*)
263
 
        echo mips-unknown-openbsd${UNAME_RELEASE}
264
 
        exit 0 ;;
265
 
    pmax:OpenBSD:*:*)
266
 
        echo mipsel-unknown-openbsd${UNAME_RELEASE}
267
 
        exit 0 ;;
268
 
    sgi:OpenBSD:*:*)
269
 
        echo mips-unknown-openbsd${UNAME_RELEASE}
270
 
        exit 0 ;;
271
 
    wgrisc:OpenBSD:*:*)
272
 
        echo mipsel-unknown-openbsd${UNAME_RELEASE}
273
 
        exit 0 ;;
 
317
        exit ;;
 
318
    *:[Mm]orph[Oo][Ss]:*:*)
 
319
        echo ${UNAME_MACHINE}-unknown-morphos
 
320
        exit ;;
274
321
    *:OS/390:*:*)
275
322
        echo i370-ibm-openedition
276
 
        exit 0 ;;
 
323
        exit ;;
 
324
    *:z/VM:*:*)
 
325
        echo s390-ibm-zvmoe
 
326
        exit ;;
 
327
    *:OS400:*:*)
 
328
        echo powerpc-ibm-os400
 
329
        exit ;;
277
330
    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
278
331
        echo arm-acorn-riscix${UNAME_RELEASE}
279
 
        exit 0;;
 
332
        exit ;;
 
333
    arm:riscos:*:*|arm:RISCOS:*:*)
 
334
        echo arm-unknown-riscos
 
335
        exit ;;
280
336
    SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
281
337
        echo hppa1.1-hitachi-hiuxmpp
282
 
        exit 0;;
 
338
        exit ;;
283
339
    Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
284
340
        # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
285
341
        if test "`(/bin/universe) 2>/dev/null`" = att ; then
287
343
        else
288
344
                echo pyramid-pyramid-bsd
289
345
        fi
290
 
        exit 0 ;;
 
346
        exit ;;
291
347
    NILE*:*:*:dcosx)
292
348
        echo pyramid-pyramid-svr4
293
 
        exit 0 ;;
 
349
        exit ;;
 
350
    DRS?6000:unix:4.0:6*)
 
351
        echo sparc-icl-nx6
 
352
        exit ;;
 
353
    DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
 
354
        case `/usr/bin/uname -p` in
 
355
            sparc) echo sparc-icl-nx7; exit ;;
 
356
        esac ;;
294
357
    sun4H:SunOS:5.*:*)
295
358
        echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
296
 
        exit 0 ;;
 
359
        exit ;;
297
360
    sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
298
361
        echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
299
 
        exit 0 ;;
 
362
        exit ;;
300
363
    i86pc:SunOS:5.*:*)
301
364
        echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
302
 
        exit 0 ;;
 
365
        exit ;;
303
366
    sun4*:SunOS:6*:*)
304
367
        # According to config.sub, this is the proper way to canonicalize
305
368
        # SunOS6.  Hard to guess exactly what SunOS6 will be like, but
306
369
        # it's likely to be more like Solaris than SunOS4.
307
370
        echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
308
 
        exit 0 ;;
 
371
        exit ;;
309
372
    sun4*:SunOS:*:*)
310
373
        case "`/usr/bin/arch -k`" in
311
374
            Series*|S4*)
314
377
        esac
315
378
        # Japanese Language versions have a version number like `4.1.3-JL'.
316
379
        echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
317
 
        exit 0 ;;
 
380
        exit ;;
318
381
    sun3*:SunOS:*:*)
319
382
        echo m68k-sun-sunos${UNAME_RELEASE}
320
 
        exit 0 ;;
 
383
        exit ;;
321
384
    sun*:*:4.2BSD:*)
322
 
        UNAME_RELEASE=`(head -1 /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
 
385
        UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
323
386
        test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
324
387
        case "`/bin/arch`" in
325
388
            sun3)
329
392
                echo sparc-sun-sunos${UNAME_RELEASE}
330
393
                ;;
331
394
        esac
332
 
        exit 0 ;;
 
395
        exit ;;
333
396
    aushp:SunOS:*:*)
334
397
        echo sparc-auspex-sunos${UNAME_RELEASE}
335
 
        exit 0 ;;
336
 
    sparc*:NetBSD:*)
337
 
        echo `uname -p`-unknown-netbsd${UNAME_RELEASE}
338
 
        exit 0 ;;
339
 
    atari*:OpenBSD:*:*)
340
 
        echo m68k-unknown-openbsd${UNAME_RELEASE}
341
 
        exit 0 ;;
 
398
        exit ;;
342
399
    # The situation for MiNT is a little confusing.  The machine name
343
400
    # can be virtually everything (everything which is not
344
401
    # "atarist" or "atariste" at least should have a processor
349
406
    # be no problem.
350
407
    atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
351
408
        echo m68k-atari-mint${UNAME_RELEASE}
352
 
        exit 0 ;;
 
409
        exit ;;
353
410
    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
354
411
        echo m68k-atari-mint${UNAME_RELEASE}
355
 
        exit 0 ;;
 
412
        exit ;;
356
413
    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
357
414
        echo m68k-atari-mint${UNAME_RELEASE}
358
 
        exit 0 ;;
 
415
        exit ;;
359
416
    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
360
417
        echo m68k-milan-mint${UNAME_RELEASE}
361
 
        exit 0 ;;
 
418
        exit ;;
362
419
    hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
363
420
        echo m68k-hades-mint${UNAME_RELEASE}
364
 
        exit 0 ;;
 
421
        exit ;;
365
422
    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
366
423
        echo m68k-unknown-mint${UNAME_RELEASE}
367
 
        exit 0 ;;
368
 
    sun3*:OpenBSD:*:*)
369
 
        echo m68k-unknown-openbsd${UNAME_RELEASE}
370
 
        exit 0 ;;
371
 
    mac68k:OpenBSD:*:*)
372
 
        echo m68k-unknown-openbsd${UNAME_RELEASE}
373
 
        exit 0 ;;
374
 
    mvme68k:OpenBSD:*:*)
375
 
        echo m68k-unknown-openbsd${UNAME_RELEASE}
376
 
        exit 0 ;;
377
 
    mvme88k:OpenBSD:*:*)
378
 
        echo m88k-unknown-openbsd${UNAME_RELEASE}
379
 
        exit 0 ;;
 
424
        exit ;;
 
425
    m68k:machten:*:*)
 
426
        echo m68k-apple-machten${UNAME_RELEASE}
 
427
        exit ;;
380
428
    powerpc:machten:*:*)
381
429
        echo powerpc-apple-machten${UNAME_RELEASE}
382
 
        exit 0 ;;
 
430
        exit ;;
383
431
    RISC*:Mach:*:*)
384
432
        echo mips-dec-mach_bsd4.3
385
 
        exit 0 ;;
 
433
        exit ;;
386
434
    RISC*:ULTRIX:*:*)
387
435
        echo mips-dec-ultrix${UNAME_RELEASE}
388
 
        exit 0 ;;
 
436
        exit ;;
389
437
    VAX*:ULTRIX*:*:*)
390
438
        echo vax-dec-ultrix${UNAME_RELEASE}
391
 
        exit 0 ;;
 
439
        exit ;;
392
440
    2020:CLIX:*:* | 2430:CLIX:*:*)
393
441
        echo clipper-intergraph-clix${UNAME_RELEASE}
394
 
        exit 0 ;;
 
442
        exit ;;
395
443
    mips:*:*:UMIPS | mips:*:*:RISCos)
396
444
        eval $set_cc_for_build
397
445
        sed 's/^        //' << EOF >$dummy.c
415
463
          exit (-1);
416
464
        }
417
465
EOF
418
 
        $CC_FOR_BUILD $dummy.c -o $dummy \
419
 
          && ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
420
 
          && rm -f $dummy.c $dummy && exit 0
421
 
        rm -f $dummy.c $dummy
 
466
        $CC_FOR_BUILD -o $dummy $dummy.c &&
 
467
          dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
 
468
          SYSTEM_NAME=`$dummy $dummyarg` &&
 
469
            { echo "$SYSTEM_NAME"; exit; }
422
470
        echo mips-mips-riscos${UNAME_RELEASE}
423
 
        exit 0 ;;
 
471
        exit ;;
424
472
    Motorola:PowerMAX_OS:*:*)
425
473
        echo powerpc-motorola-powermax
426
 
        exit 0 ;;
 
474
        exit ;;
 
475
    Motorola:*:4.3:PL8-*)
 
476
        echo powerpc-harris-powermax
 
477
        exit ;;
 
478
    Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
 
479
        echo powerpc-harris-powermax
 
480
        exit ;;
427
481
    Night_Hawk:Power_UNIX:*:*)
428
482
        echo powerpc-harris-powerunix
429
 
        exit 0 ;;
 
483
        exit ;;
430
484
    m88k:CX/UX:7*:*)
431
485
        echo m88k-harris-cxux7
432
 
        exit 0 ;;
 
486
        exit ;;
433
487
    m88k:*:4*:R4*)
434
488
        echo m88k-motorola-sysv4
435
 
        exit 0 ;;
 
489
        exit ;;
436
490
    m88k:*:3*:R3*)
437
491
        echo m88k-motorola-sysv3
438
 
        exit 0 ;;
 
492
        exit ;;
439
493
    AViiON:dgux:*:*)
440
494
        # DG/UX returns AViiON for all architectures
441
495
        UNAME_PROCESSOR=`/usr/bin/uname -p`
451
505
        else
452
506
            echo i586-dg-dgux${UNAME_RELEASE}
453
507
        fi
454
 
        exit 0 ;;
 
508
        exit ;;
455
509
    M88*:DolphinOS:*:*) # DolphinOS (SVR3)
456
510
        echo m88k-dolphin-sysv3
457
 
        exit 0 ;;
 
511
        exit ;;
458
512
    M88*:*:R3*:*)
459
513
        # Delta 88k system running SVR3
460
514
        echo m88k-motorola-sysv3
461
 
        exit 0 ;;
 
515
        exit ;;
462
516
    XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
463
517
        echo m88k-tektronix-sysv3
464
 
        exit 0 ;;
 
518
        exit ;;
465
519
    Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
466
520
        echo m68k-tektronix-bsd
467
 
        exit 0 ;;
 
521
        exit ;;
468
522
    *:IRIX*:*:*)
469
523
        echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
470
 
        exit 0 ;;
 
524
        exit ;;
471
525
    ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
472
 
        echo romp-ibm-aix      # uname -m gives an 8 hex-code CPU id
473
 
        exit 0 ;;              # Note that: echo "'`uname -s`'" gives 'AIX '
 
526
        echo romp-ibm-aix     # uname -m gives an 8 hex-code CPU id
 
527
        exit ;;               # Note that: echo "'`uname -s`'" gives 'AIX '
474
528
    i*86:AIX:*:*)
475
529
        echo i386-ibm-aix
476
 
        exit 0 ;;
 
530
        exit ;;
477
531
    ia64:AIX:*:*)
478
532
        if [ -x /usr/bin/oslevel ] ; then
479
533
                IBM_REV=`/usr/bin/oslevel`
481
535
                IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
482
536
        fi
483
537
        echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
484
 
        exit 0 ;;
 
538
        exit ;;
485
539
    *:AIX:2:3)
486
540
        if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
487
541
                eval $set_cc_for_build
496
550
                        exit(0);
497
551
                        }
498
552
EOF
499
 
                $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0
500
 
                rm -f $dummy.c $dummy
501
 
                echo rs6000-ibm-aix3.2.5
 
553
                if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
 
554
                then
 
555
                        echo "$SYSTEM_NAME"
 
556
                else
 
557
                        echo rs6000-ibm-aix3.2.5
 
558
                fi
502
559
        elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
503
560
                echo rs6000-ibm-aix3.2.4
504
561
        else
505
562
                echo rs6000-ibm-aix3.2
506
563
        fi
507
 
        exit 0 ;;
 
564
        exit ;;
508
565
    *:AIX:*:[45])
509
 
        IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | head -1 | awk '{ print $1 }'`
 
566
        IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
510
567
        if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
511
568
                IBM_ARCH=rs6000
512
569
        else
518
575
                IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
519
576
        fi
520
577
        echo ${IBM_ARCH}-ibm-aix${IBM_REV}
521
 
        exit 0 ;;
 
578
        exit ;;
522
579
    *:AIX:*:*)
523
580
        echo rs6000-ibm-aix
524
 
        exit 0 ;;
 
581
        exit ;;
525
582
    ibmrt:4.4BSD:*|romp-ibm:BSD:*)
526
583
        echo romp-ibm-bsd4.4
527
 
        exit 0 ;;
 
584
        exit ;;
528
585
    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
529
586
        echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
530
 
        exit 0 ;;                           # report: romp-ibm BSD 4.3
 
587
        exit ;;                             # report: romp-ibm BSD 4.3
531
588
    *:BOSX:*:*)
532
589
        echo rs6000-bull-bosx
533
 
        exit 0 ;;
 
590
        exit ;;
534
591
    DPX/2?00:B.O.S.:*:*)
535
592
        echo m68k-bull-sysv3
536
 
        exit 0 ;;
 
593
        exit ;;
537
594
    9000/[34]??:4.3bsd:1.*:*)
538
595
        echo m68k-hp-bsd
539
 
        exit 0 ;;
 
596
        exit ;;
540
597
    hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
541
598
        echo m68k-hp-bsd4.4
542
 
        exit 0 ;;
 
599
        exit ;;
543
600
    9000/[34678]??:HP-UX:*:*)
544
601
        HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
545
602
        case "${UNAME_MACHINE}" in
546
603
            9000/31? )            HP_ARCH=m68000 ;;
547
604
            9000/[34]?? )         HP_ARCH=m68k ;;
548
605
            9000/[678][0-9][0-9])
549
 
              case "${HPUX_REV}" in
550
 
                11.[0-9][0-9])
551
 
                  if [ -x /usr/bin/getconf ]; then
552
 
                    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
 
606
                if [ -x /usr/bin/getconf ]; then
 
607
                    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
553
608
                    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
554
609
                    case "${sc_cpu_version}" in
555
610
                      523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
558
613
                        case "${sc_kernel_bits}" in
559
614
                          32) HP_ARCH="hppa2.0n" ;;
560
615
                          64) HP_ARCH="hppa2.0w" ;;
 
616
                          '') HP_ARCH="hppa2.0" ;;   # HP-UX 10.20
561
617
                        esac ;;
562
618
                    esac
563
 
                  fi ;;
564
 
              esac
565
 
              if [ "${HP_ARCH}" = "" ]; then
566
 
              eval $set_cc_for_build
567
 
              sed 's/^              //' << EOF >$dummy.c
 
619
                fi
 
620
                if [ "${HP_ARCH}" = "" ]; then
 
621
                    eval $set_cc_for_build
 
622
                    sed 's/^              //' << EOF >$dummy.c
568
623
 
569
624
              #define _HPUX_SOURCE
570
625
              #include <stdlib.h>
597
652
                  exit (0);
598
653
              }
599
654
EOF
600
 
            (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy`
601
 
            if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi
602
 
            rm -f $dummy.c $dummy
603
 
        fi ;;
 
655
                    (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
 
656
                    test -z "$HP_ARCH" && HP_ARCH=hppa
 
657
                fi ;;
604
658
        esac
 
659
        if [ ${HP_ARCH} = "hppa2.0w" ]
 
660
        then
 
661
            # avoid double evaluation of $set_cc_for_build
 
662
            test -n "$CC_FOR_BUILD" || eval $set_cc_for_build
 
663
 
 
664
            # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
 
665
            # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler
 
666
            # generating 64-bit code.  GNU and HP use different nomenclature:
 
667
            #
 
668
            # $ CC_FOR_BUILD=cc ./config.guess
 
669
            # => hppa2.0w-hp-hpux11.23
 
670
            # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
 
671
            # => hppa64-hp-hpux11.23
 
672
 
 
673
            if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
 
674
                grep __LP64__ >/dev/null
 
675
            then
 
676
                HP_ARCH="hppa2.0w"
 
677
            else
 
678
                HP_ARCH="hppa64"
 
679
            fi
 
680
        fi
605
681
        echo ${HP_ARCH}-hp-hpux${HPUX_REV}
606
 
        exit 0 ;;
 
682
        exit ;;
607
683
    ia64:HP-UX:*:*)
608
684
        HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
609
685
        echo ia64-hp-hpux${HPUX_REV}
610
 
        exit 0 ;;
 
686
        exit ;;
611
687
    3050*:HI-UX:*:*)
612
688
        eval $set_cc_for_build
613
689
        sed 's/^        //' << EOF >$dummy.c
635
711
          exit (0);
636
712
        }
637
713
EOF
638
 
        $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0
639
 
        rm -f $dummy.c $dummy
 
714
        $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
 
715
                { echo "$SYSTEM_NAME"; exit; }
640
716
        echo unknown-hitachi-hiuxwe2
641
 
        exit 0 ;;
 
717
        exit ;;
642
718
    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
643
719
        echo hppa1.1-hp-bsd
644
 
        exit 0 ;;
 
720
        exit ;;
645
721
    9000/8??:4.3bsd:*:*)
646
722
        echo hppa1.0-hp-bsd
647
 
        exit 0 ;;
 
723
        exit ;;
648
724
    *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
649
725
        echo hppa1.0-hp-mpeix
650
 
        exit 0 ;;
 
726
        exit ;;
651
727
    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
652
728
        echo hppa1.1-hp-osf
653
 
        exit 0 ;;
 
729
        exit ;;
654
730
    hp8??:OSF1:*:*)
655
731
        echo hppa1.0-hp-osf
656
 
        exit 0 ;;
 
732
        exit ;;
657
733
    i*86:OSF1:*:*)
658
734
        if [ -x /usr/sbin/sysversion ] ; then
659
735
            echo ${UNAME_MACHINE}-unknown-osf1mk
660
736
        else
661
737
            echo ${UNAME_MACHINE}-unknown-osf1
662
738
        fi
663
 
        exit 0 ;;
 
739
        exit ;;
664
740
    parisc*:Lites*:*:*)
665
741
        echo hppa1.1-hp-lites
666
 
        exit 0 ;;
667
 
    hppa*:OpenBSD:*:*)
668
 
        echo hppa-unknown-openbsd
669
 
        exit 0 ;;
 
742
        exit ;;
670
743
    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
671
744
        echo c1-convex-bsd
672
 
        exit 0 ;;
 
745
        exit ;;
673
746
    C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
674
747
        if getsysinfo -f scalar_acc
675
748
        then echo c32-convex-bsd
676
749
        else echo c2-convex-bsd
677
750
        fi
678
 
        exit 0 ;;
 
751
        exit ;;
679
752
    C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
680
753
        echo c34-convex-bsd
681
 
        exit 0 ;;
 
754
        exit ;;
682
755
    C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
683
756
        echo c38-convex-bsd
684
 
        exit 0 ;;
 
757
        exit ;;
685
758
    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
686
759
        echo c4-convex-bsd
687
 
        exit 0 ;;
688
 
    CRAY*X-MP:*:*:*)
689
 
        echo xmp-cray-unicos
690
 
        exit 0 ;;
 
760
        exit ;;
691
761
    CRAY*Y-MP:*:*:*)
692
762
        echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
693
 
        exit 0 ;;
 
763
        exit ;;
694
764
    CRAY*[A-Z]90:*:*:*)
695
765
        echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
696
766
        | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
697
767
              -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
698
768
              -e 's/\.[^.]*$/.X/'
699
 
        exit 0 ;;
 
769
        exit ;;
700
770
    CRAY*TS:*:*:*)
701
771
        echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
702
 
        exit 0 ;;
703
 
    CRAY*T3D:*:*:*)
704
 
        echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
705
 
        exit 0 ;;
 
772
        exit ;;
706
773
    CRAY*T3E:*:*:*)
707
774
        echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
708
 
        exit 0 ;;
 
775
        exit ;;
709
776
    CRAY*SV1:*:*:*)
710
777
        echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
711
 
        exit 0 ;;
712
 
    CRAY-2:*:*:*)
713
 
        echo cray2-cray-unicos
714
 
        exit 0 ;;
 
778
        exit ;;
 
779
    *:UNICOS/mp:*:*)
 
780
        echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
 
781
        exit ;;
715
782
    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
716
783
        FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
717
784
        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
718
785
        FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
719
786
        echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
720
 
        exit 0 ;;
721
 
    hp300:OpenBSD:*:*)
722
 
        echo m68k-unknown-openbsd${UNAME_RELEASE}
723
 
        exit 0 ;;
 
787
        exit ;;
 
788
    5000:UNIX_System_V:4.*:*)
 
789
        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
 
790
        FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
 
791
        echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
 
792
        exit ;;
724
793
    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
725
794
        echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
726
 
        exit 0 ;;
 
795
        exit ;;
727
796
    sparc*:BSD/OS:*:*)
728
797
        echo sparc-unknown-bsdi${UNAME_RELEASE}
729
 
        exit 0 ;;
 
798
        exit ;;
730
799
    *:BSD/OS:*:*)
731
800
        echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
732
 
        exit 0 ;;
 
801
        exit ;;
733
802
    *:FreeBSD:*:*)
734
803
        echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
735
 
        exit 0 ;;
736
 
    *:OpenBSD:*:*)
737
 
        echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
738
 
        exit 0 ;;
 
804
        exit ;;
739
805
    i*:CYGWIN*:*)
740
806
        echo ${UNAME_MACHINE}-pc-cygwin
741
 
        exit 0 ;;
742
 
    i*:MINGW*:*)
 
807
        exit ;;
 
808
    i*:MINGW*:* | i*:windows32*:*)
743
809
        echo ${UNAME_MACHINE}-pc-mingw32
744
 
        exit 0 ;;
 
810
        exit ;;
745
811
    i*:PW*:*)
746
812
        echo ${UNAME_MACHINE}-pc-pw32
747
 
        exit 0 ;;
 
813
        exit ;;
 
814
    x86:Interix*:[34]*)
 
815
        echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//'
 
816
        exit ;;
 
817
    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
 
818
        echo i${UNAME_MACHINE}-pc-mks
 
819
        exit ;;
748
820
    i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
749
821
        # How do we know it's Interix rather than the generic POSIX subsystem?
750
822
        # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
751
823
        # UNAME_MACHINE based on the output of uname instead of i386?
752
 
        echo i386-pc-interix
753
 
        exit 0 ;;
 
824
        echo i586-pc-interix
 
825
        exit ;;
754
826
    i*:UWIN*:*)
755
827
        echo ${UNAME_MACHINE}-pc-uwin
756
 
        exit 0 ;;
 
828
        exit ;;
 
829
    amd64:CYGWIN*:*:*)
 
830
        echo x86_64-unknown-cygwin
 
831
        exit ;;
757
832
    p*:CYGWIN*:*)
758
833
        echo powerpcle-unknown-cygwin
759
 
        exit 0 ;;
 
834
        exit ;;
760
835
    prep*:SunOS:5.*:*)
761
836
        echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
762
 
        exit 0 ;;
 
837
        exit ;;
763
838
    *:GNU:*:*)
 
839
        # the GNU system
764
840
        echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
765
 
        exit 0 ;;
 
841
        exit ;;
 
842
    *:GNU/*:*:*)
 
843
        # other systems with GNU libc and userland
 
844
        echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
 
845
        exit ;;
766
846
    i*86:Minix:*:*)
767
847
        echo ${UNAME_MACHINE}-pc-minix
768
 
        exit 0 ;;
 
848
        exit ;;
769
849
    arm*:Linux:*:*)
770
850
        echo ${UNAME_MACHINE}-unknown-linux-gnu
771
 
        exit 0 ;;
 
851
        exit ;;
 
852
    cris:Linux:*:*)
 
853
        echo cris-axis-linux-gnu
 
854
        exit ;;
 
855
    crisv32:Linux:*:*)
 
856
        echo crisv32-axis-linux-gnu
 
857
        exit ;;
 
858
    frv:Linux:*:*)
 
859
        echo frv-unknown-linux-gnu
 
860
        exit ;;
772
861
    ia64:Linux:*:*)
773
 
        echo ${UNAME_MACHINE}-unknown-linux
774
 
        exit 0 ;;
 
862
        echo ${UNAME_MACHINE}-unknown-linux-gnu
 
863
        exit ;;
 
864
    m32r*:Linux:*:*)
 
865
        echo ${UNAME_MACHINE}-unknown-linux-gnu
 
866
        exit ;;
775
867
    m68*:Linux:*:*)
776
868
        echo ${UNAME_MACHINE}-unknown-linux-gnu
777
 
        exit 0 ;;
 
869
        exit ;;
778
870
    mips:Linux:*:*)
779
 
        case `sed -n '/^byte/s/^.*: \(.*\) endian/\1/p' < /proc/cpuinfo` in
780
 
          big)    echo mips-unknown-linux-gnu && exit 0 ;;
781
 
          little) echo mipsel-unknown-linux-gnu && exit 0 ;;
782
 
        esac
 
871
        eval $set_cc_for_build
 
872
        sed 's/^        //' << EOF >$dummy.c
 
873
        #undef CPU
 
874
        #undef mips
 
875
        #undef mipsel
 
876
        #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
 
877
        CPU=mipsel
 
878
        #else
 
879
        #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
 
880
        CPU=mips
 
881
        #else
 
882
        CPU=
 
883
        #endif
 
884
        #endif
 
885
EOF
 
886
        eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
 
887
        test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
 
888
        ;;
 
889
    mips64:Linux:*:*)
 
890
        eval $set_cc_for_build
 
891
        sed 's/^        //' << EOF >$dummy.c
 
892
        #undef CPU
 
893
        #undef mips64
 
894
        #undef mips64el
 
895
        #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
 
896
        CPU=mips64el
 
897
        #else
 
898
        #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
 
899
        CPU=mips64
 
900
        #else
 
901
        CPU=
 
902
        #endif
 
903
        #endif
 
904
EOF
 
905
        eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
 
906
        test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
783
907
        ;;
784
908
    ppc:Linux:*:*)
785
909
        echo powerpc-unknown-linux-gnu
786
 
        exit 0 ;;
 
910
        exit ;;
787
911
    ppc64:Linux:*:*)
788
912
        echo powerpc64-unknown-linux-gnu
789
 
        exit 0 ;;
 
913
        exit ;;
790
914
    alpha:Linux:*:*)
791
915
        case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
792
916
          EV5)   UNAME_MACHINE=alphaev5 ;;
800
924
        objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
801
925
        if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
802
926
        echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
803
 
        exit 0 ;;
 
927
        exit ;;
804
928
    parisc:Linux:*:* | hppa:Linux:*:*)
805
929
        # Look for CPU level
806
930
        case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
808
932
          PA8*) echo hppa2.0-unknown-linux-gnu ;;
809
933
          *)    echo hppa-unknown-linux-gnu ;;
810
934
        esac
811
 
        exit 0 ;;
 
935
        exit ;;
812
936
    parisc64:Linux:*:* | hppa64:Linux:*:*)
813
937
        echo hppa64-unknown-linux-gnu
814
 
        exit 0 ;;
 
938
        exit ;;
815
939
    s390:Linux:*:* | s390x:Linux:*:*)
816
940
        echo ${UNAME_MACHINE}-ibm-linux
817
 
        exit 0 ;;
 
941
        exit ;;
 
942
    sh64*:Linux:*:*)
 
943
        echo ${UNAME_MACHINE}-unknown-linux-gnu
 
944
        exit ;;
818
945
    sh*:Linux:*:*)
819
946
        echo ${UNAME_MACHINE}-unknown-linux-gnu
820
 
        exit 0 ;;
 
947
        exit ;;
821
948
    sparc:Linux:*:* | sparc64:Linux:*:*)
822
949
        echo ${UNAME_MACHINE}-unknown-linux-gnu
823
 
        exit 0 ;;
 
950
        exit ;;
824
951
    x86_64:Linux:*:*)
825
952
        echo x86_64-unknown-linux-gnu
826
 
        exit 0 ;;
 
953
        exit ;;
827
954
    i*86:Linux:*:*)
828
955
        # The BFD linker knows what the default object file format is, so
829
956
        # first see if it will tell us. cd to the root directory to prevent
830
957
        # problems with other programs or directories called `ld' in the path.
831
 
        ld_supported_targets=`cd /; ld --help 2>&1 \
 
958
        # Set LC_ALL=C to ensure ld outputs messages in English.
 
959
        ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
832
960
                         | sed -ne '/supported targets:/!d
833
961
                                    s/[         ][      ]*/ /g
834
962
                                    s/.*supported targets: *//
840
968
                ;;
841
969
          a.out-i386-linux)
842
970
                echo "${UNAME_MACHINE}-pc-linux-gnuaout"
843
 
                exit 0 ;;               
 
971
                exit ;;
844
972
          coff-i386)
845
973
                echo "${UNAME_MACHINE}-pc-linux-gnucoff"
846
 
                exit 0 ;;
 
974
                exit ;;
847
975
          "")
848
976
                # Either a pre-BFD a.out linker (linux-gnuoldld) or
849
977
                # one that does not give us useful --help.
850
978
                echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
851
 
                exit 0 ;;
 
979
                exit ;;
852
980
        esac
853
981
        # Determine whether the default compiler is a.out or elf
854
982
        eval $set_cc_for_build
855
 
        cat >$dummy.c <<EOF
856
 
#include <features.h>
857
 
#ifdef __cplusplus
858
 
#include <stdio.h>  /* for printf() prototype */
859
 
        int main (int argc, char *argv[]) {
860
 
#else
861
 
        int main (argc, argv) int argc; char *argv[]; {
862
 
#endif
863
 
#ifdef __ELF__
864
 
# ifdef __GLIBC__
865
 
#  if __GLIBC__ >= 2
866
 
    printf ("%s-pc-linux-gnu\n", argv[1]);
867
 
#  else
868
 
    printf ("%s-pc-linux-gnulibc1\n", argv[1]);
869
 
#  endif
870
 
# else
871
 
   printf ("%s-pc-linux-gnulibc1\n", argv[1]);
872
 
# endif
873
 
#else
874
 
  printf ("%s-pc-linux-gnuaout\n", argv[1]);
875
 
#endif
876
 
  return 0;
877
 
}
 
983
        sed 's/^        //' << EOF >$dummy.c
 
984
        #include <features.h>
 
985
        #ifdef __ELF__
 
986
        # ifdef __GLIBC__
 
987
        #  if __GLIBC__ >= 2
 
988
        LIBC=gnu
 
989
        #  else
 
990
        LIBC=gnulibc1
 
991
        #  endif
 
992
        # else
 
993
        LIBC=gnulibc1
 
994
        # endif
 
995
        #else
 
996
        #ifdef __INTEL_COMPILER
 
997
        LIBC=gnu
 
998
        #else
 
999
        LIBC=gnuaout
 
1000
        #endif
 
1001
        #endif
 
1002
        #ifdef __dietlibc__
 
1003
        LIBC=dietlibc
 
1004
        #endif
878
1005
EOF
879
 
        $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm -f $dummy.c $dummy && exit 0
880
 
        rm -f $dummy.c $dummy
881
 
        test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
 
1006
        eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
 
1007
        test x"${LIBC}" != x && {
 
1008
                echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
 
1009
                exit
 
1010
        }
 
1011
        test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
882
1012
        ;;
883
1013
    i*86:DYNIX/ptx:4*:*)
884
1014
        # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
885
1015
        # earlier versions are messed up and put the nodename in both
886
1016
        # sysname and nodename.
887
1017
        echo i386-sequent-sysv4
888
 
        exit 0 ;;
 
1018
        exit ;;
889
1019
    i*86:UNIX_SV:4.2MP:2.*)
890
1020
        # Unixware is an offshoot of SVR4, but it has its own version
891
1021
        # number series starting with 2...
893
1023
        # I just have to hope.  -- rms.
894
1024
        # Use sysv4.2uw... so that sysv4* matches it.
895
1025
        echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
896
 
        exit 0 ;;
 
1026
        exit ;;
 
1027
    i*86:OS/2:*:*)
 
1028
        # If we were able to find `uname', then EMX Unix compatibility
 
1029
        # is probably installed.
 
1030
        echo ${UNAME_MACHINE}-pc-os2-emx
 
1031
        exit ;;
 
1032
    i*86:XTS-300:*:STOP)
 
1033
        echo ${UNAME_MACHINE}-unknown-stop
 
1034
        exit ;;
 
1035
    i*86:atheos:*:*)
 
1036
        echo ${UNAME_MACHINE}-unknown-atheos
 
1037
        exit ;;
 
1038
    i*86:syllable:*:*)
 
1039
        echo ${UNAME_MACHINE}-pc-syllable
 
1040
        exit ;;
 
1041
    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
 
1042
        echo i386-unknown-lynxos${UNAME_RELEASE}
 
1043
        exit ;;
 
1044
    i*86:*DOS:*:*)
 
1045
        echo ${UNAME_MACHINE}-pc-msdosdjgpp
 
1046
        exit ;;
897
1047
    i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
898
1048
        UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
899
1049
        if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
901
1051
        else
902
1052
                echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
903
1053
        fi
904
 
        exit 0 ;;
905
 
    i*86:*:5:[78]*)
 
1054
        exit ;;
 
1055
    i*86:*:5:[678]*)
 
1056
        # UnixWare 7.x, OpenUNIX and OpenServer 6.
906
1057
        case `/bin/uname -X | grep "^Machine"` in
907
1058
            *486*)           UNAME_MACHINE=i486 ;;
908
1059
            *Pentium)        UNAME_MACHINE=i586 ;;
909
1060
            *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
910
1061
        esac
911
1062
        echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
912
 
        exit 0 ;;
 
1063
        exit ;;
913
1064
    i*86:*:3.2:*)
914
1065
        if test -f /usr/options/cb.name; then
915
1066
                UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
916
1067
                echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
917
1068
        elif /bin/uname -X 2>/dev/null >/dev/null ; then
918
 
                UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')`
919
 
                (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
920
 
                (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \
 
1069
                UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
 
1070
                (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
 
1071
                (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
921
1072
                        && UNAME_MACHINE=i586
922
 
                (/bin/uname -X|egrep '^Machine.*Pent ?II' >/dev/null) \
 
1073
                (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
923
1074
                        && UNAME_MACHINE=i686
924
 
                (/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \
 
1075
                (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
925
1076
                        && UNAME_MACHINE=i686
926
1077
                echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
927
1078
        else
928
1079
                echo ${UNAME_MACHINE}-pc-sysv32
929
1080
        fi
930
 
        exit 0 ;;
931
 
    i*86:*DOS:*:*)
932
 
        echo ${UNAME_MACHINE}-pc-msdosdjgpp
933
 
        exit 0 ;;
 
1081
        exit ;;
934
1082
    pc:*:*:*)
935
1083
        # Left here for compatibility:
936
1084
        # uname -m prints for DJGPP always 'pc', but it prints nothing about
937
1085
        # the processor, so we play safe by assuming i386.
938
1086
        echo i386-pc-msdosdjgpp
939
 
        exit 0 ;;
 
1087
        exit ;;
940
1088
    Intel:Mach:3*:*)
941
1089
        echo i386-pc-mach3
942
 
        exit 0 ;;
 
1090
        exit ;;
943
1091
    paragon:*:*:*)
944
1092
        echo i860-intel-osf1
945
 
        exit 0 ;;
 
1093
        exit ;;
946
1094
    i860:*:4.*:*) # i860-SVR4
947
1095
        if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
948
1096
          echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
949
1097
        else # Add other i860-SVR4 vendors below as they are discovered.
950
1098
          echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
951
1099
        fi
952
 
        exit 0 ;;
 
1100
        exit ;;
953
1101
    mini*:CTIX:SYS*5:*)
954
1102
        # "miniframe"
955
1103
        echo m68010-convergent-sysv
956
 
        exit 0 ;;
957
 
    M68*:*:R3V[567]*:*)
958
 
        test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
959
 
    3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0)
 
1104
        exit ;;
 
1105
    mc68k:UNIX:SYSTEM5:3.51m)
 
1106
        echo m68k-convergent-sysv
 
1107
        exit ;;
 
1108
    M680?0:D-NIX:5.3:*)
 
1109
        echo m68k-diab-dnix
 
1110
        exit ;;
 
1111
    M68*:*:R3V[5678]*:*)
 
1112
        test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
 
1113
    3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
960
1114
        OS_REL=''
961
1115
        test -r /etc/.relid \
962
1116
        && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
963
1117
        /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
964
 
          && echo i486-ncr-sysv4.3${OS_REL} && exit 0
 
1118
          && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
965
1119
        /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
966
 
          && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;;
 
1120
          && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
967
1121
    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
968
1122
        /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
969
 
          && echo i486-ncr-sysv4 && exit 0 ;;
 
1123
          && { echo i486-ncr-sysv4; exit; } ;;
970
1124
    m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
971
1125
        echo m68k-unknown-lynxos${UNAME_RELEASE}
972
 
        exit 0 ;;
 
1126
        exit ;;
973
1127
    mc68030:UNIX_System_V:4.*:*)
974
1128
        echo m68k-atari-sysv4
975
 
        exit 0 ;;
976
 
    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
977
 
        echo i386-unknown-lynxos${UNAME_RELEASE}
978
 
        exit 0 ;;
 
1129
        exit ;;
979
1130
    TSUNAMI:LynxOS:2.*:*)
980
1131
        echo sparc-unknown-lynxos${UNAME_RELEASE}
981
 
        exit 0 ;;
 
1132
        exit ;;
982
1133
    rs6000:LynxOS:2.*:*)
983
1134
        echo rs6000-unknown-lynxos${UNAME_RELEASE}
984
 
        exit 0 ;;
 
1135
        exit ;;
985
1136
    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
986
1137
        echo powerpc-unknown-lynxos${UNAME_RELEASE}
987
 
        exit 0 ;;
 
1138
        exit ;;
988
1139
    SM[BE]S:UNIX_SV:*:*)
989
1140
        echo mips-dde-sysv${UNAME_RELEASE}
990
 
        exit 0 ;;
 
1141
        exit ;;
991
1142
    RM*:ReliantUNIX-*:*:*)
992
1143
        echo mips-sni-sysv4
993
 
        exit 0 ;;
 
1144
        exit ;;
994
1145
    RM*:SINIX-*:*:*)
995
1146
        echo mips-sni-sysv4
996
 
        exit 0 ;;
 
1147
        exit ;;
997
1148
    *:SINIX-*:*:*)
998
1149
        if uname -p 2>/dev/null >/dev/null ; then
999
1150
                UNAME_MACHINE=`(uname -p) 2>/dev/null`
1001
1152
        else
1002
1153
                echo ns32k-sni-sysv
1003
1154
        fi
1004
 
        exit 0 ;;
 
1155
        exit ;;
1005
1156
    PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
1006
1157
                      # says <Richard.M.Bartel@ccMail.Census.GOV>
1007
1158
        echo i586-unisys-sysv4
1008
 
        exit 0 ;;
 
1159
        exit ;;
1009
1160
    *:UNIX_System_V:4*:FTX*)
1010
1161
        # From Gerald Hewes <hewes@openmarket.com>.
1011
1162
        # How about differentiating between stratus architectures? -djm
1012
1163
        echo hppa1.1-stratus-sysv4
1013
 
        exit 0 ;;
 
1164
        exit ;;
1014
1165
    *:*:*:FTX*)
1015
1166
        # From seanf@swdc.stratus.com.
1016
1167
        echo i860-stratus-sysv4
1017
 
        exit 0 ;;
 
1168
        exit ;;
 
1169
    i*86:VOS:*:*)
 
1170
        # From Paul.Green@stratus.com.
 
1171
        echo ${UNAME_MACHINE}-stratus-vos
 
1172
        exit ;;
1018
1173
    *:VOS:*:*)
1019
1174
        # From Paul.Green@stratus.com.
1020
1175
        echo hppa1.1-stratus-vos
1021
 
        exit 0 ;;
 
1176
        exit ;;
1022
1177
    mc68*:A/UX:*:*)
1023
1178
        echo m68k-apple-aux${UNAME_RELEASE}
1024
 
        exit 0 ;;
 
1179
        exit ;;
1025
1180
    news*:NEWS-OS:6*:*)
1026
1181
        echo mips-sony-newsos6
1027
 
        exit 0 ;;
 
1182
        exit ;;
1028
1183
    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
1029
1184
        if [ -d /usr/nec ]; then
1030
1185
                echo mips-nec-sysv${UNAME_RELEASE}
1031
1186
        else
1032
1187
                echo mips-unknown-sysv${UNAME_RELEASE}
1033
1188
        fi
1034
 
        exit 0 ;;
 
1189
        exit ;;
1035
1190
    BeBox:BeOS:*:*)     # BeOS running on hardware made by Be, PPC only.
1036
1191
        echo powerpc-be-beos
1037
 
        exit 0 ;;
 
1192
        exit ;;
1038
1193
    BeMac:BeOS:*:*)     # BeOS running on Mac or Mac clone, PPC only.
1039
1194
        echo powerpc-apple-beos
1040
 
        exit 0 ;;
 
1195
        exit ;;
1041
1196
    BePC:BeOS:*:*)      # BeOS running on Intel PC compatible.
1042
1197
        echo i586-pc-beos
1043
 
        exit 0 ;;
 
1198
        exit ;;
1044
1199
    SX-4:SUPER-UX:*:*)
1045
1200
        echo sx4-nec-superux${UNAME_RELEASE}
1046
 
        exit 0 ;;
 
1201
        exit ;;
1047
1202
    SX-5:SUPER-UX:*:*)
1048
1203
        echo sx5-nec-superux${UNAME_RELEASE}
1049
 
        exit 0 ;;
 
1204
        exit ;;
 
1205
    SX-6:SUPER-UX:*:*)
 
1206
        echo sx6-nec-superux${UNAME_RELEASE}
 
1207
        exit ;;
1050
1208
    Power*:Rhapsody:*:*)
1051
1209
        echo powerpc-apple-rhapsody${UNAME_RELEASE}
1052
 
        exit 0 ;;
 
1210
        exit ;;
1053
1211
    *:Rhapsody:*:*)
1054
1212
        echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
1055
 
        exit 0 ;;
 
1213
        exit ;;
1056
1214
    *:Darwin:*:*)
1057
 
        echo `uname -p`-apple-darwin${UNAME_RELEASE}
1058
 
        exit 0 ;;
 
1215
        UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
 
1216
        case $UNAME_PROCESSOR in
 
1217
            *86) UNAME_PROCESSOR=i686 ;;
 
1218
            unknown) UNAME_PROCESSOR=powerpc ;;
 
1219
        esac
 
1220
        echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
 
1221
        exit ;;
1059
1222
    *:procnto*:*:* | *:QNX:[0123456789]*:*)
1060
 
        if test "${UNAME_MACHINE}" = "x86pc"; then
 
1223
        UNAME_PROCESSOR=`uname -p`
 
1224
        if test "$UNAME_PROCESSOR" = "x86"; then
 
1225
                UNAME_PROCESSOR=i386
1061
1226
                UNAME_MACHINE=pc
1062
1227
        fi
1063
 
        echo `uname -p`-${UNAME_MACHINE}-nto-qnx
1064
 
        exit 0 ;;
 
1228
        echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
 
1229
        exit ;;
1065
1230
    *:QNX:*:4*)
1066
1231
        echo i386-pc-qnx
1067
 
        exit 0 ;;
1068
 
    NSR-[KW]:NONSTOP_KERNEL:*:*)
 
1232
        exit ;;
 
1233
    NSE-?:NONSTOP_KERNEL:*:*)
 
1234
        echo nse-tandem-nsk${UNAME_RELEASE}
 
1235
        exit ;;
 
1236
    NSR-?:NONSTOP_KERNEL:*:*)
1069
1237
        echo nsr-tandem-nsk${UNAME_RELEASE}
1070
 
        exit 0 ;;
 
1238
        exit ;;
1071
1239
    *:NonStop-UX:*:*)
1072
1240
        echo mips-compaq-nonstopux
1073
 
        exit 0 ;;
 
1241
        exit ;;
1074
1242
    BS2000:POSIX*:*:*)
1075
1243
        echo bs2000-siemens-sysv
1076
 
        exit 0 ;;
 
1244
        exit ;;
1077
1245
    DS/*:UNIX_System_V:*:*)
1078
1246
        echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
1079
 
        exit 0 ;;
 
1247
        exit ;;
1080
1248
    *:Plan9:*:*)
1081
1249
        # "uname -m" is not consistent, so use $cputype instead. 386
1082
1250
        # is converted to i386 for consistency with other x86
1087
1255
            UNAME_MACHINE="$cputype"
1088
1256
        fi
1089
1257
        echo ${UNAME_MACHINE}-unknown-plan9
1090
 
        exit 0 ;;
1091
 
    i*86:OS/2:*:*)
1092
 
        # If we were able to find `uname', then EMX Unix compatibility
1093
 
        # is probably installed.
1094
 
        echo ${UNAME_MACHINE}-pc-os2-emx
1095
 
        exit 0 ;;
 
1258
        exit ;;
1096
1259
    *:TOPS-10:*:*)
1097
1260
        echo pdp10-unknown-tops10
1098
 
        exit 0 ;;
 
1261
        exit ;;
1099
1262
    *:TENEX:*:*)
1100
1263
        echo pdp10-unknown-tenex
1101
 
        exit 0 ;;
 
1264
        exit ;;
1102
1265
    KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
1103
1266
        echo pdp10-dec-tops20
1104
 
        exit 0 ;;
 
1267
        exit ;;
1105
1268
    XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
1106
1269
        echo pdp10-xkl-tops20
1107
 
        exit 0 ;;
 
1270
        exit ;;
1108
1271
    *:TOPS-20:*:*)
1109
1272
        echo pdp10-unknown-tops20
1110
 
        exit 0 ;;
 
1273
        exit ;;
1111
1274
    *:ITS:*:*)
1112
1275
        echo pdp10-unknown-its
1113
 
        exit 0 ;;
1114
 
    i*86:XTS-300:*:STOP)
1115
 
        echo ${UNAME_MACHINE}-unknown-stop
1116
 
        exit 0 ;;
1117
 
    i*86:atheos:*:*)
1118
 
        echo ${UNAME_MACHINE}-unknown-atheos
1119
 
        exit 0 ;;
 
1276
        exit ;;
 
1277
    SEI:*:*:SEIUX)
 
1278
        echo mips-sei-seiux${UNAME_RELEASE}
 
1279
        exit ;;
 
1280
    *:DragonFly:*:*)
 
1281
        echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
 
1282
        exit ;;
 
1283
    *:*VMS:*:*)
 
1284
        UNAME_MACHINE=`(uname -p) 2>/dev/null`
 
1285
        case "${UNAME_MACHINE}" in
 
1286
            A*) echo alpha-dec-vms ; exit ;;
 
1287
            I*) echo ia64-dec-vms ; exit ;;
 
1288
            V*) echo vax-dec-vms ; exit ;;
 
1289
        esac ;;
 
1290
    *:XENIX:*:SysV)
 
1291
        echo i386-pc-xenix
 
1292
        exit ;;
 
1293
    i*86:skyos:*:*)
 
1294
        echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
 
1295
        exit ;;
1120
1296
esac
1121
1297
 
1122
1298
#echo '(No uname command or uname output not recognized.)' 1>&2
1148
1324
#endif
1149
1325
 
1150
1326
#if defined (__arm) && defined (__acorn) && defined (__unix)
1151
 
  printf ("arm-acorn-riscix"); exit (0);
 
1327
  printf ("arm-acorn-riscix\n"); exit (0);
1152
1328
#endif
1153
1329
 
1154
1330
#if defined (hp300) && !defined (hpux)
1237
1413
}
1238
1414
EOF
1239
1415
 
1240
 
$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm -f $dummy.c $dummy && exit 0
1241
 
rm -f $dummy.c $dummy
 
1416
$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
 
1417
        { echo "$SYSTEM_NAME"; exit; }
1242
1418
 
1243
1419
# Apollos put the system type in the environment.
1244
1420
 
1245
 
test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; }
 
1421
test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
1246
1422
 
1247
1423
# Convex versions that predate uname can use getsysinfo(1)
1248
1424
 
1251
1427
    case `getsysinfo -f cpu_type` in
1252
1428
    c1*)
1253
1429
        echo c1-convex-bsd
1254
 
        exit 0 ;;
 
1430
        exit ;;
1255
1431
    c2*)
1256
1432
        if getsysinfo -f scalar_acc
1257
1433
        then echo c32-convex-bsd
1258
1434
        else echo c2-convex-bsd
1259
1435
        fi
1260
 
        exit 0 ;;
 
1436
        exit ;;
1261
1437
    c34*)
1262
1438
        echo c34-convex-bsd
1263
 
        exit 0 ;;
 
1439
        exit ;;
1264
1440
    c38*)
1265
1441
        echo c38-convex-bsd
1266
 
        exit 0 ;;
 
1442
        exit ;;
1267
1443
    c4*)
1268
1444
        echo c4-convex-bsd
1269
 
        exit 0 ;;
 
1445
        exit ;;
1270
1446
    esac
1271
1447
fi
1272
1448
 
1277
1453
the operating system you are using. It is advised that you
1278
1454
download the most up to date version of the config scripts from
1279
1455
 
1280
 
    ftp://ftp.gnu.org/pub/gnu/config/
 
1456
  http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess
 
1457
and
 
1458
  http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub
1281
1459
 
1282
1460
If the version you run ($0) is already up to date, please
1283
1461
send the following data and any information you think might be