~ubuntu-branches/ubuntu/trusty/bash/trusty-security

« back to all changes in this revision

Viewing changes to support/config.guess

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2002-04-08 20:51:41 UTC
  • Revision ID: james.westby@ubuntu.com-20020408205141-p16ukpd93kg6ce7g
Tags: 2.05a-11
* Don't mishandle negative pid in `kill' builtin (closes: #133927, #137742).
* builtins(1) doesn't document `for' (closes: #118755).
* Add /usr/share/bash_completion directory to source package specific
  completion files.
* Update to bash_completion 20020408 (v1.264).
  Closes: #133109, #139375, #139675, #134713, #141134.
* Add completion to /etc/skel/.bashrc (commented out). Closes: #138921.

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 Free Software Foundation, Inc.
4
 
#
 
3
#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
 
4
#   2000, 2001, 2002 Free Software Foundation, Inc.
 
5
 
 
6
timestamp='2002-01-02'
 
7
 
5
8
# This file is free software; you can redistribute it and/or modify it
6
9
# under the terms of the GNU General Public License as published by
7
10
# the Free Software Foundation; either version 2 of the License, or
21
24
# configuration script generated by Autoconf, you may include it under
22
25
# the same distribution terms that you use for the rest of that program.
23
26
 
24
 
# Written by Per Bothner <bothner@cygnus.com>.
25
 
# The master version of this file is at the FSF in /home/gd/gnu/lib.
 
27
# Originally written by Per Bothner <bothner@cygnus.com>.
 
28
# Please send patches to <config-patches@gnu.org>.  Submit a context
 
29
# diff and a properly formatted ChangeLog entry.
26
30
#
27
31
# This script attempts to guess a canonical system name similar to
28
32
# config.sub.  If it succeeds, it prints the system name on stdout, and
29
33
# exits with 0.  Otherwise, it exits with 1.
30
34
#
31
35
# The plan is that this can be called by configure scripts if you
32
 
# don't specify an explicit system type (host/target name).
33
 
#
34
 
# Only a few systems have been added to this list; please add others
35
 
# (but try to keep the structure clean).
36
 
#
37
 
 
38
 
# Use $HOST_CC if defined. $CC may point to a cross-compiler
39
 
if test x"$CC_FOR_BUILD" = x; then
40
 
  if test x"$HOST_CC" != x; then
41
 
    CC_FOR_BUILD="$HOST_CC"
42
 
  else
43
 
    if test x"$CC" != x; then
44
 
      CC_FOR_BUILD="$CC"
45
 
    else
46
 
      CC_FOR_BUILD=cc
47
 
    fi
48
 
  fi
 
36
# don't specify an explicit build system type.
 
37
 
 
38
me=`echo "$0" | sed -e 's,.*/,,'`
 
39
 
 
40
usage="\
 
41
Usage: $0 [OPTION]
 
42
 
 
43
Output the configuration name of the system \`$me' is run on.
 
44
 
 
45
Operation modes:
 
46
  -h, --help         print this help, then exit
 
47
  -t, --time-stamp   print date of last modification, then exit
 
48
  -v, --version      print version number, then exit
 
49
 
 
50
Report bugs and patches to <config-patches@gnu.org>."
 
51
 
 
52
version="\
 
53
GNU config.guess ($timestamp)
 
54
 
 
55
Originally written by Per Bothner.
 
56
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
 
57
Free Software Foundation, Inc.
 
58
 
 
59
This is free software; see the source for copying conditions.  There is NO
 
60
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
 
61
 
 
62
help="
 
63
Try \`$me --help' for more information."
 
64
 
 
65
# Parse command line
 
66
while test $# -gt 0 ; do
 
67
  case $1 in
 
68
    --time-stamp | --time* | -t )
 
69
       echo "$timestamp" ; exit 0 ;;
 
70
    --version | -v )
 
71
       echo "$version" ; exit 0 ;;
 
72
    --help | --h* | -h )
 
73
       echo "$usage"; exit 0 ;;
 
74
    -- )     # Stop option processing
 
75
       shift; break ;;
 
76
    - ) # Use stdin as input.
 
77
       break ;;
 
78
    -* )
 
79
       echo "$me: invalid option $1$help" >&2
 
80
       exit 1 ;;
 
81
    * )
 
82
       break ;;
 
83
  esac
 
84
done
 
85
 
 
86
if test $# != 0; then
 
87
  echo "$me: too many arguments$help" >&2
 
88
  exit 1
49
89
fi
50
90
 
 
91
 
 
92
dummy=dummy-$$
 
93
trap 'rm -f $dummy.c $dummy.o $dummy.rel $dummy; exit 1' 1 2 15
 
94
 
 
95
# CC_FOR_BUILD -- compiler used by this script.
 
96
# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
 
97
# use `HOST_CC' if defined, but it is deprecated.
 
98
 
 
99
set_cc_for_build='case $CC_FOR_BUILD,$HOST_CC,$CC in
 
100
 ,,)    echo "int dummy(){}" > $dummy.c ;
 
101
        for c in cc gcc c89 ; do
 
102
          ($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1 ;
 
103
          if test $? = 0 ; then
 
104
             CC_FOR_BUILD="$c"; break ;
 
105
          fi ;
 
106
        done ;
 
107
        rm -f $dummy.c $dummy.o $dummy.rel ;
 
108
        if test x"$CC_FOR_BUILD" = x ; then
 
109
          CC_FOR_BUILD=no_compiler_found ;
 
110
        fi
 
111
        ;;
 
112
 ,,*)   CC_FOR_BUILD=$CC ;;
 
113
 ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
 
114
esac'
 
115
 
51
116
# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
52
 
# (ghazi@noc.rutgers.edu 8/24/94.)
 
117
# (ghazi@noc.rutgers.edu 1994-08-24)
53
118
if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
54
119
        PATH=$PATH:/.attbin ; export PATH
55
 
elif (test -f /usr/5bin/uname) >/dev/null 2>&1 ; then
56
 
        PATH=$PATH:/usr/5bin
57
120
fi
58
121
 
59
 
UNAME=`(uname) 2>/dev/null` || UNAME=unknown
60
122
UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
61
123
UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
62
 
UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
 
124
UNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
63
125
UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
64
126
 
65
 
RELEASE=`expr "$UNAME_RELEASE" : '[^0-9]*\([0-9]*\)'` # 4
66
 
case "$RELEASE" in
67
 
"")     RELEASE=0 ;;
68
 
*)      RELEASE=`expr "$RELEASE" + 0` ;;
69
 
esac
70
 
REL_LEVEL=`expr "$UNAME_RELEASE" : '[^0-9]*[0-9]*.\([0-9]*\)'`    # 1
71
 
REL_SUBLEVEL=`expr "$UNAME_RELEASE" : '[^0-9]*[0-9]*.[0-9]*.\([0-9]*\)'` # 2
72
 
 
73
 
dummy=dummy-$$
74
 
trap 'rm -f $dummy.c $dummy.o $dummy; exit 1' 1 2 15
75
 
 
76
 
# Some versions of i386 SVR4.2 make `uname' equivalent to `uname -n', which
77
 
# is contrary to all other versions of uname
78
 
if [ -n "$UNAME" ] && [ "$UNAME_S" != "$UNAME" ] && [ "$UNAME_S" = UNIX_SV ]; then
79
 
        UNAME=UNIX_SV
80
 
fi
81
 
 
82
127
# Note: order is significant - the case branches are not exclusive.
83
128
 
84
129
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
85
 
    # Begin cases added for Bash
86
 
    alpha:NetBSD:*:*)
87
 
        echo alpha-dec-netbsd${UNAME_RELEASE}
88
 
        exit 0 ;;
89
 
    alpha:OpenBSD:*:*)
90
 
        echo alpha-dec-openbsd${UNAME_RELEASE}
91
 
        exit 0 ;;
92
 
    i?86:NetBSD:*:*)
93
 
        echo ${UNAME_MACHINE}-pc-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
94
 
        exit 0 ;;
95
 
    i?86:OpenBSD:*:*)
96
 
        echo ${UNAME_MACHINE}-pc-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
97
 
        exit 0 ;;
98
 
    sparc:NetBSD:*:*)
99
 
        echo sparc-unknown-netbsd${UNAME_RELEASE}
100
 
        exit 0 ;;
101
 
    sparc:OpenBSD:*:*)
102
 
        echo sparc-unknown-openbsd${UNAME_RELEASE}
103
 
        exit 0 ;;
104
 
    vax:NetBSD:*:*)
105
 
        echo vax-dec-netbsd${UNAME_RELEASE}
106
 
        exit 0 ;;
107
 
    vax:OpenBSD:*:*)
108
 
        echo vax-dec-openbsd${UNAME_RELEASE}
109
 
        exit 0 ;;
110
 
    mac68k:machten:*:*)
111
 
        echo mac68k-apple-machten${UNAME_RELEASE}
112
 
        exit 0 ;;
113
 
    concurrent*:*:*:*)
114
 
        if test "`(/bin/universe) 2>/dev/null`" = att ; then
115
 
                echo concurrent-concurrent-sysv3
116
 
        else
117
 
                echo concurrent-concurrent-bsd
118
 
        fi
119
 
        exit 0 ;;
120
 
    ppc*:SunOS:5.*:*)
121
 
        echo ppc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
122
 
        exit 0 ;;
123
 
    sparc:UNIX_SV:4.*:*)
124
 
        echo sparc-unknown-sysv${UNAME_RELEASE}
125
 
        exit 0 ;;
126
 
    mips:UNIX_SV:4.*:*)
127
 
        echo mips-mips-sysv${UNAME_RELEASE}
128
 
        exit 0 ;;
129
 
    mips:OSF*1:*:*)
130
 
        echo mips-mips-osf1
131
 
        exit 0 ;;
132
 
    mips:4.4BSD:*:*)
133
 
        echo mips-mips-bsd4.4
134
 
        exit 0 ;;
135
 
    MIServer-S:SMP_DC.OSx:*:dcosx)
136
 
        echo mips-pyramid-sysv4
137
 
        exit 0 ;;
138
 
    news*:NEWS*:*:*)
139
 
        echo mips-sony-newsos${UNAME_RELEASE}
140
 
        exit 0 ;;
141
 
    i?86:NEXTSTEP:*:*)
142
 
        echo i386-next-nextstep${RELEASE}
143
 
        exit 0 ;;
144
 
    *680?0:NEXTSTEP:*:*)
145
 
        echo m68k-next-nextstep${RELEASE}
146
 
        exit 0 ;;    
147
 
    *370:AIX:*:*)
148
 
        echo ibm370-ibm-aix
149
 
        exit 0 ;;
150
 
    ksr1:OSF*1:*:*)
151
 
        echo ksr1-ksr-osf1
152
 
        exit 0 ;;
153
 
    esa:OSF*1:*:* | ESA:OSF*:*:*)
154
 
        echo esa-ibm-osf1
155
 
        exit 0 ;;
156
 
    DNP*:DNIX:*:*)
157
 
        echo m68k-dnix-sysv
158
 
        exit 0 ;;
159
 
    *3b2*:*:*:*)
160
 
        echo we32k-att-sysv3
161
 
        exit 0 ;;
162
 
    *:QNX:*:42*)
163
 
        echo i386-qssl-qnx`echo ${UNAME_VERSION}`
164
 
        exit 0 ;;
165
 
    Alpha*:Windows:NT:*:SP*)
166
 
        echo alpha-pc-opennt
167
 
        exit 0 ;;
168
 
    *:Windows:NT:*:SP*)
169
 
        echo intel-pc-opennt
170
 
        exit 0 ;;
171
 
    *:NonStop-UX:*:*)
172
 
        echo mips-compaq-nonstopux
173
 
        exit 0 ;;
174
 
    # end cases added for Bash
 
130
    *:NetBSD:*:*)
 
131
        # NetBSD (nbsd) targets should (where applicable) match one or
 
132
        # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
 
133
        # *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
 
134
        # switched to ELF, *-*-netbsd* would select the old
 
135
        # object file format.  This provides both forward
 
136
        # compatibility and a consistent mechanism for selecting the
 
137
        # object file format.
 
138
        #
 
139
        # Note: NetBSD doesn't particularly care about the vendor
 
140
        # portion of the name.  We always set it to "unknown".
 
141
        UNAME_MACHINE_ARCH=`(uname -p) 2>/dev/null` || \
 
142
            UNAME_MACHINE_ARCH=unknown
 
143
        case "${UNAME_MACHINE_ARCH}" in
 
144
            arm*) machine=arm-unknown ;;
 
145
            sh3el) machine=shl-unknown ;;
 
146
            sh3eb) machine=sh-unknown ;;
 
147
            *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
 
148
        esac
 
149
        # The Operating System including object format, if it has switched
 
150
        # to ELF recently, or will in the future.
 
151
        case "${UNAME_MACHINE_ARCH}" in
 
152
            arm*|i386|m68k|ns32k|sh3*|sparc|vax)
 
153
                eval $set_cc_for_build
 
154
                if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
 
155
                        | grep __ELF__ >/dev/null
 
156
                then
 
157
                    # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
 
158
                    # Return netbsd for either.  FIX?
 
159
                    os=netbsd
 
160
                else
 
161
                    os=netbsdelf
 
162
                fi
 
163
                ;;
 
164
            *)
 
165
                os=netbsd
 
166
                ;;
 
167
        esac
 
168
        # The OS release
 
169
        release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
 
170
        # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
 
171
        # contains redundant information, the shorter form:
 
172
        # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
 
173
        echo "${machine}-${os}${release}"
 
174
        exit 0 ;;
 
175
    amiga:OpenBSD:*:*)
 
176
        echo m68k-unknown-openbsd${UNAME_RELEASE}
 
177
        exit 0 ;;
 
178
    arc:OpenBSD:*:*)
 
179
        echo mipsel-unknown-openbsd${UNAME_RELEASE}
 
180
        exit 0 ;;
 
181
    hp300:OpenBSD:*:*)
 
182
        echo m68k-unknown-openbsd${UNAME_RELEASE}
 
183
        exit 0 ;;
 
184
    mac68k:OpenBSD:*:*)
 
185
        echo m68k-unknown-openbsd${UNAME_RELEASE}
 
186
        exit 0 ;;
 
187
    macppc:OpenBSD:*:*)
 
188
        echo powerpc-unknown-openbsd${UNAME_RELEASE}
 
189
        exit 0 ;;
 
190
    mvme68k:OpenBSD:*:*)
 
191
        echo m68k-unknown-openbsd${UNAME_RELEASE}
 
192
        exit 0 ;;
 
193
    mvme88k:OpenBSD:*:*)
 
194
        echo m88k-unknown-openbsd${UNAME_RELEASE}
 
195
        exit 0 ;;
 
196
    mvmeppc:OpenBSD:*:*)
 
197
        echo powerpc-unknown-openbsd${UNAME_RELEASE}
 
198
        exit 0 ;;
 
199
    pmax:OpenBSD:*:*)
 
200
        echo mipsel-unknown-openbsd${UNAME_RELEASE}
 
201
        exit 0 ;;
 
202
    sgi:OpenBSD:*:*)
 
203
        echo mipseb-unknown-openbsd${UNAME_RELEASE}
 
204
        exit 0 ;;
 
205
    sun3:OpenBSD:*:*)
 
206
        echo m68k-unknown-openbsd${UNAME_RELEASE}
 
207
        exit 0 ;;
 
208
    wgrisc:OpenBSD:*:*)
 
209
        echo mipsel-unknown-openbsd${UNAME_RELEASE}
 
210
        exit 0 ;;
 
211
    *:OpenBSD:*:*)
 
212
        echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE}
 
213
        exit 0 ;;
175
214
    alpha:OSF1:*:*)
176
 
        # TEST CHANGED FOR BASH to handle `letter version' releases
177
 
        UNAME_MAJOR=`echo "$UNAME_RELEASE" | sed -e 's/^.\([0-9]\).*/\1/'`
178
 
        if test X"$UNAME_MAJOR" != X"" && test $UNAME_MAJOR = 4 ; then
 
215
        if test $UNAME_RELEASE = "V4.0"; then
179
216
                UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
180
 
        elif test X"$UNAME_MAJOR" != X"" && test $UNAME_MAJOR -gt 4 ; then
181
 
                UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`           
182
217
        fi
183
218
        # A Vn.n version is a released version.
184
219
        # A Tn.n version is a released field test version.
185
220
        # A Xn.n version is an unreleased experimental baselevel.
186
221
        # 1.2 uses "1.2" for uname -r.
187
222
        cat <<EOF >$dummy.s
 
223
        .data
 
224
\$Lformat:
 
225
        .byte 37,100,45,37,120,10,0     # "%d-%x\n"
 
226
 
 
227
        .text
188
228
        .globl main
 
229
        .align 4
189
230
        .ent main
190
231
main:
191
 
        .frame \$30,0,\$26,0
192
 
        .prologue 0
193
 
        .long 0x47e03d80 # implver $0
194
 
        lda \$2,259
195
 
        .long 0x47e20c21 # amask $2,$1
196
 
        srl \$1,8,\$2
197
 
        sll \$2,2,\$2
198
 
        sll \$0,3,\$0
199
 
        addl \$1,\$0,\$0
200
 
        addl \$2,\$0,\$0
201
 
        ret \$31,(\$26),1
 
232
        .frame \$30,16,\$26,0
 
233
        ldgp \$29,0(\$27)
 
234
        .prologue 1
 
235
        .long 0x47e03d80 # implver \$0
 
236
        lda \$2,-1
 
237
        .long 0x47e20c21 # amask \$2,\$1
 
238
        lda \$16,\$Lformat
 
239
        mov \$0,\$17
 
240
        not \$1,\$18
 
241
        jsr \$26,printf
 
242
        ldgp \$29,0(\$26)
 
243
        mov 0,\$16
 
244
        jsr \$26,exit
202
245
        .end main
203
246
EOF
 
247
        eval $set_cc_for_build
204
248
        $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
205
249
        if test "$?" = 0 ; then
206
 
                ./$dummy
207
 
                case "$?" in
208
 
                        7)
 
250
                case `./$dummy` in
 
251
                        0-0)
209
252
                                UNAME_MACHINE="alpha"
210
253
                                ;;
211
 
                        15)
 
254
                        1-0)
212
255
                                UNAME_MACHINE="alphaev5"
213
256
                                ;;
214
 
                        14)
 
257
                        1-1)
215
258
                                UNAME_MACHINE="alphaev56"
216
259
                                ;;
217
 
                        10)
 
260
                        1-101)
218
261
                                UNAME_MACHINE="alphapca56"
219
262
                                ;;
220
 
                        16)
 
263
                        2-303)
221
264
                                UNAME_MACHINE="alphaev6"
222
265
                                ;;
 
266
                        2-307)
 
267
                                UNAME_MACHINE="alphaev67"
 
268
                                ;;
 
269
                        2-1307)
 
270
                                UNAME_MACHINE="alphaev68"
 
271
                                ;;
223
272
                esac
224
273
        fi
225
274
        rm -f $dummy.s $dummy
226
275
        echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
227
276
        exit 0 ;;
228
277
    Alpha\ *:Windows_NT*:*)
229
 
        # How do we know it's Interix rather than the generic POSIX subsystem?
230
 
        # Should we change UNAME_MACHINE based on the output of uname instead
231
 
        # of the specific Alpha model?
232
 
        echo alpha-pc-interix
233
 
        exit 0 ;;
 
278
        # How do we know it's Interix rather than the generic POSIX subsystem?
 
279
        # Should we change UNAME_MACHINE based on the output of uname instead
 
280
        # of the specific Alpha model?
 
281
        echo alpha-pc-interix
 
282
        exit 0 ;;
234
283
    21064:Windows_NT:50:3)
235
284
        echo alpha-dec-winnt3.5
236
285
        exit 0 ;;
237
286
    Amiga*:UNIX_System_V:4.0:*)
238
 
        echo m68k-cbm-sysv4
 
287
        echo m68k-unknown-sysv4
239
288
        exit 0;;
240
 
    amiga:NetBSD:*:*)
241
 
        echo m68k-cbm-netbsd${UNAME_RELEASE}
242
 
        exit 0 ;;
243
 
    amiga:OpenBSD:*:*)
244
 
        echo m68k-cbm-openbsd${UNAME_RELEASE}
245
 
        exit 0 ;;
246
289
    *:[Aa]miga[Oo][Ss]:*:*)
247
290
        echo ${UNAME_MACHINE}-unknown-amigaos
248
291
        exit 0 ;;
249
 
    arc64:OpenBSD:*:*)
250
 
        echo mips64el-unknown-openbsd${UNAME_RELEASE}
251
 
        exit 0 ;;
252
 
    arc:OpenBSD:*:*)
253
 
        echo mipsel-unknown-openbsd${UNAME_RELEASE}
254
 
        exit 0 ;;
255
 
    hkmips:OpenBSD:*:*)
256
 
        echo mips-unknown-openbsd${UNAME_RELEASE}
257
 
        exit 0 ;;
258
 
    pmax:OpenBSD:*:*)
259
 
        echo mipsel-unknown-openbsd${UNAME_RELEASE}
260
 
        exit 0 ;;
261
 
    sgi:OpenBSD:*:*)
262
 
        echo mips-unknown-openbsd${UNAME_RELEASE}
263
 
        exit 0 ;;
264
 
    wgrisc:OpenBSD:*:*)
265
 
        echo mipsel-unknown-openbsd${UNAME_RELEASE}
 
292
    *:[Mm]orph[Oo][Ss]:*:*)
 
293
        echo ${UNAME_MACHINE}-unknown-morphos
 
294
        exit 0 ;;
 
295
    *:OS/390:*:*)
 
296
        echo i370-ibm-openedition
266
297
        exit 0 ;;
267
298
    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
268
299
        echo arm-acorn-riscix${UNAME_RELEASE}
269
300
        exit 0;;
270
 
    arm32:NetBSD:*:*)
271
 
        echo arm-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
272
 
        exit 0 ;;
273
 
    SR2?01:HI-UX/MPP:*:*)
 
301
    SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
274
302
        echo hppa1.1-hitachi-hiuxmpp
275
303
        exit 0;;
276
304
    Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
281
309
                echo pyramid-pyramid-bsd
282
310
        fi
283
311
        exit 0 ;;
284
 
    NILE:*:*:*:dcosx)
 
312
    NILE*:*:*:dcosx)
285
313
        echo pyramid-pyramid-svr4
286
314
        exit 0 ;;
287
315
    sun4H:SunOS:5.*:*)
288
 
        echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
289
 
        exit 0 ;;
 
316
        echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
 
317
        exit 0 ;;
290
318
    sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
291
319
        echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
292
320
        exit 0 ;;
326
354
    aushp:SunOS:*:*)
327
355
        echo sparc-auspex-sunos${UNAME_RELEASE}
328
356
        exit 0 ;;
329
 
    atari*:NetBSD:*:*)
330
 
        echo m68k-atari-netbsd${UNAME_RELEASE}
331
 
        exit 0 ;;
332
 
    atari*:OpenBSD:*:*)
333
 
        echo m68k-unknown-openbsd${UNAME_RELEASE}
334
 
        exit 0 ;;
335
357
    # The situation for MiNT is a little confusing.  The machine name
336
358
    # can be virtually everything (everything which is not
337
 
    # "atarist" or "atariste" at least should have a processor 
 
359
    # "atarist" or "atariste" at least should have a processor
338
360
    # > m68000).  The system name ranges from "MiNT" over "FreeMiNT"
339
361
    # to the lowercase version "mint" (or "freemint").  Finally
340
362
    # the system name "TOS" denotes a system which is actually not
341
363
    # MiNT.  But MiNT is downward compatible to TOS, so this should
342
364
    # be no problem.
343
365
    atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
344
 
       echo m68k-atari-mint${UNAME_RELEASE}
345
 
       exit 0 ;;
 
366
        echo m68k-atari-mint${UNAME_RELEASE}
 
367
        exit 0 ;;
346
368
    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
347
 
       echo m68k-atari-mint${UNAME_RELEASE}
348
 
       exit 0 ;;
 
369
        echo m68k-atari-mint${UNAME_RELEASE}
 
370
        exit 0 ;;
349
371
    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
350
 
       echo m68k-atari-mint${UNAME_RELEASE}
351
 
       exit 0 ;;
 
372
        echo m68k-atari-mint${UNAME_RELEASE}
 
373
        exit 0 ;;
352
374
    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
353
375
        echo m68k-milan-mint${UNAME_RELEASE}
354
376
        exit 0 ;;
358
380
    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
359
381
        echo m68k-unknown-mint${UNAME_RELEASE}
360
382
        exit 0 ;;
361
 
    sun3*:NetBSD:*:*)
362
 
        echo m68k-sun-netbsd${UNAME_RELEASE}
363
 
        exit 0 ;;
364
 
    sun3*:OpenBSD:*:*)
365
 
        echo m68k-unknown-openbsd${UNAME_RELEASE}
366
 
        exit 0 ;;
367
 
    mac68k:NetBSD:*:*)
368
 
        echo m68k-apple-netbsd${UNAME_RELEASE}
369
 
        exit 0 ;;
370
 
    mac68k:OpenBSD:*:*)
371
 
        echo m68k-unknown-openbsd${UNAME_RELEASE}
372
 
        exit 0 ;;
373
 
    mvme68k:OpenBSD:*:*)
374
 
        echo m68k-unknown-openbsd${UNAME_RELEASE}
375
 
        exit 0 ;;
376
 
    mvme88k:OpenBSD:*:*)
377
 
        echo m88k-unknown-openbsd${UNAME_RELEASE}
378
 
        exit 0 ;;
379
 
    *:"Mac OS":*:*)
380
 
        echo `uname -p`-apple-macos${UNAME_RELEASE}
381
 
        exit 0 ;;
382
383
    powerpc:machten:*:*)
383
384
        echo powerpc-apple-machten${UNAME_RELEASE}
384
385
        exit 0 ;;
385
 
    macppc:NetBSD:*:*)
386
 
        echo powerpc-apple-netbsd${UNAME_RELEASE}
387
 
        exit 0 ;;
388
386
    RISC*:Mach:*:*)
389
387
        echo mips-dec-mach_bsd4.3
390
388
        exit 0 ;;
398
396
        echo clipper-intergraph-clix${UNAME_RELEASE}
399
397
        exit 0 ;;
400
398
    mips:*:*:UMIPS | mips:*:*:RISCos)
 
399
        eval $set_cc_for_build
401
400
        sed 's/^        //' << EOF >$dummy.c
402
401
#ifdef __cplusplus
 
402
#include <stdio.h>  /* for printf() prototype */
403
403
        int main (int argc, char *argv[]) {
404
404
#else
405
405
        int main (argc, argv) int argc; char *argv[]; {
420
420
EOF
421
421
        $CC_FOR_BUILD $dummy.c -o $dummy \
422
422
          && ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
423
 
          && rm $dummy.c $dummy && exit 0
 
423
          && rm -f $dummy.c $dummy && exit 0
424
424
        rm -f $dummy.c $dummy
425
425
        echo mips-mips-riscos${UNAME_RELEASE}
426
426
        exit 0 ;;
 
427
    Motorola:PowerMAX_OS:*:*)
 
428
        echo powerpc-motorola-powermax
 
429
        exit 0 ;;
427
430
    Night_Hawk:Power_UNIX:*:*)
428
431
        echo powerpc-harris-powerunix
429
432
        exit 0 ;;
437
440
        echo m88k-motorola-sysv3
438
441
        exit 0 ;;
439
442
    AViiON:dgux:*:*)
440
 
        # DG/UX returns AViiON for all architectures
441
 
        UNAME_PROCESSOR=`/usr/bin/uname -p`
442
 
        if [ $UNAME_PROCESSOR = mc88100 -o $UNAME_PROCESSOR = mc88110 ] ; then
443
 
          if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx \
444
 
             -o ${TARGET_BINARY_INTERFACE}x = x ] ; then
 
443
        # DG/UX returns AViiON for all architectures
 
444
        UNAME_PROCESSOR=`/usr/bin/uname -p`
 
445
        if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
 
446
        then
 
447
            if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
 
448
               [ ${TARGET_BINARY_INTERFACE}x = x ]
 
449
            then
445
450
                echo m88k-dg-dgux${UNAME_RELEASE}
446
 
          else
 
451
            else
447
452
                echo m88k-dg-dguxbcs${UNAME_RELEASE}
448
 
          fi
 
453
            fi
449
454
        else
450
 
          echo i586-dg-dgux${UNAME_RELEASE}
 
455
            echo i586-dg-dgux${UNAME_RELEASE}
451
456
        fi
452
457
        exit 0 ;;
453
458
    M88*:DolphinOS:*:*) # DolphinOS (SVR3)
469
474
    ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
470
475
        echo romp-ibm-aix      # uname -m gives an 8 hex-code CPU id
471
476
        exit 0 ;;              # Note that: echo "'`uname -s`'" gives 'AIX '
472
 
    i?86:AIX:*:*)
 
477
    i*86:AIX:*:*)
473
478
        echo i386-ibm-aix
474
479
        exit 0 ;;
 
480
    ia64:AIX:*:*)
 
481
        if [ -x /usr/bin/oslevel ] ; then
 
482
                IBM_REV=`/usr/bin/oslevel`
 
483
        else
 
484
                IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
 
485
        fi
 
486
        echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
 
487
        exit 0 ;;
475
488
    *:AIX:2:3)
476
489
        if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
 
490
                eval $set_cc_for_build
477
491
                sed 's/^                //' << EOF >$dummy.c
478
492
                #include <sys/systemcfg.h>
479
493
 
485
499
                        exit(0);
486
500
                        }
487
501
EOF
488
 
                $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm $dummy.c $dummy && exit 0
 
502
                $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0
489
503
                rm -f $dummy.c $dummy
490
504
                echo rs6000-ibm-aix3.2.5
491
505
        elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
494
508
                echo rs6000-ibm-aix3.2
495
509
        fi
496
510
        exit 0 ;;
497
 
    *:AIX:*:4)
 
511
    *:AIX:*:[45])
498
512
        IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | head -1 | awk '{ print $1 }'`
499
 
        if /usr/sbin/lsattr -EHl ${IBM_CPU_ID} | grep POWER >/dev/null 2>&1; then
 
513
        if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
500
514
                IBM_ARCH=rs6000
501
515
        else
502
516
                IBM_ARCH=powerpc
503
517
        fi
504
518
        if [ -x /usr/bin/oslevel ] ; then
505
519
                IBM_REV=`/usr/bin/oslevel`
506
 
        elif grep bos410 /usr/include/stdio.h >/dev/null 2>&1; then
507
 
                IBM_REV=4.1
508
 
        elif grep bos411 /usr/include/stdio.h >/dev/null 2>&1; then
509
 
                IBM_REV=4.1.1
510
520
        else
511
 
                IBM_REV=4.${UNAME_RELEASE}
 
521
                IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
512
522
        fi
513
523
        echo ${IBM_ARCH}-ibm-aix${IBM_REV}
514
524
        exit 0 ;;
518
528
    ibmrt:4.4BSD:*|romp-ibm:BSD:*)
519
529
        echo romp-ibm-bsd4.4
520
530
        exit 0 ;;
521
 
    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC NetBSD and
 
531
    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
522
532
        echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
523
533
        exit 0 ;;                           # report: romp-ibm BSD 4.3
524
534
    *:BOSX:*:*)
534
544
        echo m68k-hp-bsd4.4
535
545
        exit 0 ;;
536
546
    9000/[34678]??:HP-UX:*:*)
 
547
        HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
537
548
        case "${UNAME_MACHINE}" in
538
 
            9000/31? )          HP_ARCH=m68000 ;;
539
 
            9000/[34]?? )       HP_ARCH=m68k ;;
 
549
            9000/31? )            HP_ARCH=m68000 ;;
 
550
            9000/[34]?? )         HP_ARCH=m68k ;;
540
551
            9000/[678][0-9][0-9])
541
 
              sed 's/^              //' << EOF >$dummy.c
 
552
                if [ -x /usr/bin/getconf ]; then
 
553
                    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
 
554
                    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
 
555
                    case "${sc_cpu_version}" in
 
556
                      523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
 
557
                      528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
 
558
                      532)                      # CPU_PA_RISC2_0
 
559
                        case "${sc_kernel_bits}" in
 
560
                          32) HP_ARCH="hppa2.0n" ;;
 
561
                          64) HP_ARCH="hppa2.0w" ;;
 
562
                          '') HP_ARCH="hppa2.0" ;;   # HP-UX 10.20
 
563
                        esac ;;
 
564
                    esac
 
565
                fi
 
566
                if [ "${HP_ARCH}" = "" ]; then
 
567
                    eval $set_cc_for_build
 
568
                    sed 's/^              //' << EOF >$dummy.c
 
569
 
 
570
              #define _HPUX_SOURCE
542
571
              #include <stdlib.h>
543
572
              #include <unistd.h>
544
573
 
569
598
                  exit (0);
570
599
              }
571
600
EOF
572
 
        ($CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy`
573
 
        rm -f $dummy.c $dummy
 
601
                    (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null) && HP_ARCH=`./$dummy`
 
602
                    if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi
 
603
                    rm -f $dummy.c $dummy
 
604
                fi ;;
574
605
        esac
575
 
        HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
576
606
        echo ${HP_ARCH}-hp-hpux${HPUX_REV}
577
607
        exit 0 ;;
 
608
    ia64:HP-UX:*:*)
 
609
        HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
 
610
        echo ia64-hp-hpux${HPUX_REV}
 
611
        exit 0 ;;
578
612
    3050*:HI-UX:*:*)
 
613
        eval $set_cc_for_build
579
614
        sed 's/^        //' << EOF >$dummy.c
580
615
        #include <unistd.h>
581
616
        int
601
636
          exit (0);
602
637
        }
603
638
EOF
604
 
        $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm $dummy.c $dummy && exit 0
 
639
        $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0
605
640
        rm -f $dummy.c $dummy
606
641
        echo unknown-hitachi-hiuxwe2
607
642
        exit 0 ;;
611
646
    9000/8??:4.3bsd:*:*)
612
647
        echo hppa1.0-hp-bsd
613
648
        exit 0 ;;
614
 
    *9??*:MPE/iX:*:*)
615
 
        echo hppa1.0-hp-mpeix
616
 
        exit 0 ;;
 
649
    *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
 
650
        echo hppa1.0-hp-mpeix
 
651
        exit 0 ;;
617
652
    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
618
653
        echo hppa1.1-hp-osf
619
654
        exit 0 ;;
620
655
    hp8??:OSF1:*:*)
621
656
        echo hppa1.0-hp-osf
622
657
        exit 0 ;;
623
 
    i?86:OSF1:*:*)
 
658
    i*86:OSF1:*:*)
624
659
        if [ -x /usr/sbin/sysversion ] ; then
625
660
            echo ${UNAME_MACHINE}-unknown-osf1mk
626
661
        else
630
665
    parisc*:Lites*:*:*)
631
666
        echo hppa1.1-hp-lites
632
667
        exit 0 ;;
633
 
    hppa*:OpenBSD:*:*)
634
 
        echo hppa-unknown-openbsd
635
 
        exit 0 ;;
636
668
    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
637
669
        echo c1-convex-bsd
638
670
        exit 0 ;;
655
687
        echo xmp-cray-unicos
656
688
        exit 0 ;;
657
689
    CRAY*Y-MP:*:*:*)
658
 
        echo ymp-cray-unicos${UNAME_RELEASE}
 
690
        echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
659
691
        exit 0 ;;
660
692
    CRAY*[A-Z]90:*:*:*)
661
693
        echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
662
694
        | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
663
 
              -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/
 
695
              -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
 
696
              -e 's/\.[^.]*$/.X/'
664
697
        exit 0 ;;
665
698
    CRAY*TS:*:*:*)
666
 
        echo t90-cray-unicos${UNAME_RELEASE}
 
699
        echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
 
700
        exit 0 ;;
 
701
    CRAY*T3D:*:*:*)
 
702
        echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
667
703
        exit 0 ;;
668
704
    CRAY*T3E:*:*:*)
669
 
        echo alpha-cray-unicosmk${UNAME_RELEASE}
670
 
        exit 0 ;;
 
705
        echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
 
706
        exit 0 ;;
 
707
    CRAY*SV1:*:*:*)
 
708
        echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
 
709
        exit 0 ;;
671
710
    CRAY-2:*:*:*)
672
711
        echo cray2-cray-unicos
673
712
        exit 0 ;;
674
 
    F300:UNIX_System_V:*:*)
675
 
        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
676
 
        FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
677
 
        echo "f300-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
678
 
        exit 0 ;;
679
 
    F301:UNIX_System_V:*:*)
680
 
        echo f301-fujitsu-uxpv`echo $UNAME_RELEASE | sed 's/ .*//'`
681
 
        exit 0 ;;
682
 
    hp3[0-9][05]:NetBSD:*:*)
683
 
        echo m68k-hp-netbsd${UNAME_RELEASE}
684
 
        exit 0 ;;
685
 
    hp300:OpenBSD:*:*)
686
 
        echo m68k-unknown-openbsd${UNAME_RELEASE}
 
713
    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
 
714
        FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
 
715
        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
 
716
        FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
 
717
        echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
687
718
        exit 0 ;;
688
 
    i?86:BSD/386:*:* | i?86:BSD/OS:*:*)
 
719
    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
689
720
        echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
690
721
        exit 0 ;;
691
722
    sparc*:BSD/OS:*:*)
692
 
        echo sparc-unknown-bsdi${UNAME_RELEASE}
693
 
        exit 0 ;;
 
723
        echo sparc-unknown-bsdi${UNAME_RELEASE}
 
724
        exit 0 ;;
694
725
    *:BSD/OS:*:*)
695
 
        echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
696
 
        exit 0 ;;
 
726
        echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
 
727
        exit 0 ;;
697
728
    *:FreeBSD:*:*)
698
 
#       if test -x /usr/bin/objformat; then
699
 
#           if test "elf" = "`/usr/bin/objformat`"; then
700
 
#               echo ${UNAME_MACHINE}-unknown-freebsdelf`echo ${UNAME_RELEASE}|sed -e 's/[-_].*//'`
701
 
#               exit 0
702
 
#           fi
703
 
#       fi
704
 
        echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-=(].*//'`
705
 
        exit 0 ;;
706
 
    *:NetBSD:*:*)
707
 
        echo ${UNAME_MACHINE}-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
708
 
        exit 0 ;;
709
 
    *:OpenBSD:*:*)
710
 
        echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
 
729
        echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
711
730
        exit 0 ;;
712
731
    i*:CYGWIN*:*)
713
732
        echo ${UNAME_MACHINE}-pc-cygwin
715
734
    i*:MINGW*:*)
716
735
        echo ${UNAME_MACHINE}-pc-mingw32
717
736
        exit 0 ;;
 
737
    i*:PW*:*)
 
738
        echo ${UNAME_MACHINE}-pc-pw32
 
739
        exit 0 ;;
 
740
    x86:Interix*:3*)
 
741
        echo i386-pc-interix3
 
742
        exit 0 ;;
718
743
    i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
719
 
        # How do we know it's Interix rather than the generic POSIX subsystem?
720
 
        # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
721
 
        # UNAME_MACHINE based on the output of uname instead of i386?
722
 
        echo i386-pc-interix
723
 
        exit 0 ;;
 
744
        # How do we know it's Interix rather than the generic POSIX subsystem?
 
745
        # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
 
746
        # UNAME_MACHINE based on the output of uname instead of i386?
 
747
        echo i386-pc-interix
 
748
        exit 0 ;;
724
749
    i*:UWIN*:*)
725
 
        echo ${UNAME_MACHINE}-pc-uwin
726
 
        exit 0 ;;
 
750
        echo ${UNAME_MACHINE}-pc-uwin
 
751
        exit 0 ;;
727
752
    p*:CYGWIN*:*)
728
753
        echo powerpcle-unknown-cygwin
729
 
        exit 0 ;;    
 
754
        exit 0 ;;
730
755
    prep*:SunOS:5.*:*)
731
756
        echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
732
757
        exit 0 ;;
733
758
    *:GNU:*:*)
734
759
        echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
735
760
        exit 0 ;;
736
 
    *:Linux:*:*)
737
 
        # uname on the ARM produces all sorts of strangeness, and we need to
738
 
        # filter it out.
739
 
        case "$UNAME_MACHINE" in
740
 
          armv*)                      UNAME_MACHINE=$UNAME_MACHINE ;;
741
 
          arm* | sa110*)              UNAME_MACHINE="arm" ;;
 
761
    i*86:Minix:*:*)
 
762
        echo ${UNAME_MACHINE}-pc-minix
 
763
        exit 0 ;;
 
764
    arm*:Linux:*:*)
 
765
        echo ${UNAME_MACHINE}-unknown-linux-gnu
 
766
        exit 0 ;;
 
767
    ia64:Linux:*:*)
 
768
        echo ${UNAME_MACHINE}-unknown-linux
 
769
        exit 0 ;;
 
770
    m68*:Linux:*:*)
 
771
        echo ${UNAME_MACHINE}-unknown-linux-gnu
 
772
        exit 0 ;;
 
773
    mips:Linux:*:*)
 
774
        eval $set_cc_for_build
 
775
        sed 's/^        //' << EOF >$dummy.c
 
776
        #undef CPU
 
777
        #undef mips
 
778
        #undef mipsel
 
779
        #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) 
 
780
        CPU=mipsel 
 
781
        #else
 
782
        #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) 
 
783
        CPU=mips
 
784
        #else
 
785
        CPU=
 
786
        #endif
 
787
        #endif 
 
788
EOF
 
789
        eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
 
790
        rm -f $dummy.c
 
791
        test x"${CPU}" != x && echo "${CPU}-pc-linux-gnu" && exit 0
 
792
        ;;
 
793
    ppc:Linux:*:*)
 
794
        echo powerpc-unknown-linux-gnu
 
795
        exit 0 ;;
 
796
    ppc64:Linux:*:*)
 
797
        echo powerpc64-unknown-linux-gnu
 
798
        exit 0 ;;
 
799
    alpha:Linux:*:*)
 
800
        case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
 
801
          EV5)   UNAME_MACHINE=alphaev5 ;;
 
802
          EV56)  UNAME_MACHINE=alphaev56 ;;
 
803
          PCA56) UNAME_MACHINE=alphapca56 ;;
 
804
          PCA57) UNAME_MACHINE=alphapca56 ;;
 
805
          EV6)   UNAME_MACHINE=alphaev6 ;;
 
806
          EV67)  UNAME_MACHINE=alphaev67 ;;
 
807
          EV68*) UNAME_MACHINE=alphaev68 ;;
742
808
        esac
743
 
 
 
809
        objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
 
810
        if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
 
811
        echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
 
812
        exit 0 ;;
 
813
    parisc:Linux:*:* | hppa:Linux:*:*)
 
814
        # Look for CPU level
 
815
        case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
 
816
          PA7*) echo hppa1.1-unknown-linux-gnu ;;
 
817
          PA8*) echo hppa2.0-unknown-linux-gnu ;;
 
818
          *)    echo hppa-unknown-linux-gnu ;;
 
819
        esac
 
820
        exit 0 ;;
 
821
    parisc64:Linux:*:* | hppa64:Linux:*:*)
 
822
        echo hppa64-unknown-linux-gnu
 
823
        exit 0 ;;
 
824
    s390:Linux:*:* | s390x:Linux:*:*)
 
825
        echo ${UNAME_MACHINE}-ibm-linux
 
826
        exit 0 ;;
 
827
    sh*:Linux:*:*)
 
828
        echo ${UNAME_MACHINE}-unknown-linux-gnu
 
829
        exit 0 ;;
 
830
    sparc:Linux:*:* | sparc64:Linux:*:*)
 
831
        echo ${UNAME_MACHINE}-unknown-linux-gnu
 
832
        exit 0 ;;
 
833
    x86_64:Linux:*:*)
 
834
        echo x86_64-unknown-linux-gnu
 
835
        exit 0 ;;
 
836
    i*86:Linux:*:*)
744
837
        # The BFD linker knows what the default object file format is, so
745
 
        # first see if it will tell us.  cd to the root directory to prevent
 
838
        # first see if it will tell us. cd to the root directory to prevent
746
839
        # problems with other programs or directories called `ld' in the path.
747
 
        ld_help_string=`cd /; ld --help 2>&1`
748
 
        ld_supported_emulations=`echo $ld_help_string \
749
 
                         | sed -ne '/supported emulations:/!d
 
840
        ld_supported_targets=`cd /; ld --help 2>&1 \
 
841
                         | sed -ne '/supported targets:/!d
750
842
                                    s/[         ][      ]*/ /g
751
 
                                    s/.*supported emulations: *//
 
843
                                    s/.*supported targets: *//
752
844
                                    s/ .*//
753
845
                                    p'`
754
 
        case "$ld_supported_emulations" in
755
 
          *ia64)      echo "${UNAME_MACHINE}-unknown-linux"         ; exit 0 ;;
756
 
          i?86linux)  echo "${UNAME_MACHINE}-pc-linux-gnuaout"      ; exit 0 ;;
757
 
          i?86coff)   echo "${UNAME_MACHINE}-pc-linux-gnucoff"      ; exit 0 ;;
758
 
          sparclinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
759
 
          armlinux)   echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
760
 
          m68klinux)  echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
761
 
          elf32ppc | elf32ppclinux)
762
 
                # Determine Lib Version
763
 
                cat >$dummy.c <<EOF
764
 
#include <features.h>
765
 
#if defined(__GLIBC__)
766
 
extern char __libc_version[];
767
 
extern char __libc_release[];
768
 
#endif
769
 
main(argc, argv)
770
 
     int argc;
771
 
     char *argv[];
772
 
{
773
 
#if defined(__GLIBC__)
774
 
  printf("%s %s\n", __libc_version, __libc_release);
775
 
#else
776
 
  printf("unkown\n");
777
 
#endif
778
 
  return 0;
779
 
}
780
 
EOF
781
 
                LIBC=""
782
 
                $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null
783
 
                if test "$?" = 0 ; then
784
 
                        ./$dummy | grep 1\.99 > /dev/null
785
 
                        if test "$?" = 0 ; then
786
 
                                LIBC="libc1"
787
 
                        fi
788
 
                fi      
789
 
                rm -f $dummy.c $dummy
790
 
                echo powerpc-unknown-linux-gnu${LIBC} ; exit 0 ;;
791
 
        esac
792
 
 
793
 
        if test "${UNAME_MACHINE}" = "alpha" ; then
794
 
                sed 's/^        //'  <<EOF >$dummy.s
795
 
                .globl main
796
 
                .ent main
797
 
        main:
798
 
                .frame \$30,0,\$26,0
799
 
                .prologue 0
800
 
                .long 0x47e03d80 # implver $0
801
 
                lda \$2,259
802
 
                .long 0x47e20c21 # amask $2,$1
803
 
                srl \$1,8,\$2
804
 
                sll \$2,2,\$2
805
 
                sll \$0,3,\$0
806
 
                addl \$1,\$0,\$0
807
 
                addl \$2,\$0,\$0
808
 
                ret \$31,(\$26),1
809
 
                .end main
810
 
EOF
811
 
                LIBC=""
812
 
                $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
813
 
                if test "$?" = 0 ; then
814
 
                        ./$dummy
815
 
                        case "$?" in
816
 
                        7)
817
 
                                UNAME_MACHINE="alpha"
818
 
                                ;;
819
 
                        15)
820
 
                                UNAME_MACHINE="alphaev5"
821
 
                                ;;
822
 
                        14)
823
 
                                UNAME_MACHINE="alphaev56"
824
 
                                ;;
825
 
                        10)
826
 
                                UNAME_MACHINE="alphapca56"
827
 
                                ;;
828
 
                        16)
829
 
                                UNAME_MACHINE="alphaev6"
830
 
                                ;;
831
 
                        esac
832
 
 
833
 
                        objdump --private-headers $dummy | \
834
 
                          grep ld.so.1 > /dev/null
835
 
                        if test "$?" = 0 ; then
836
 
                                LIBC="libc1"
837
 
                        fi
838
 
                fi
839
 
                rm -f $dummy.s $dummy
840
 
                echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} ; exit 0
841
 
        elif test "${UNAME_MACHINE}" = "mips" ; then
842
 
          cat >$dummy.c <<EOF
843
 
#ifdef __cplusplus
844
 
int main (int argc, char *argv[]) {
845
 
#else
846
 
int main (argc, argv) int argc; char *argv[]; {
847
 
#endif
848
 
#ifdef __MIPSEB__
849
 
  printf ("%s-unknown-linux-gnu\n", argv[1]);
850
 
#endif
851
 
#ifdef __MIPSEL__
852
 
  printf ("%sel-unknown-linux-gnu\n", argv[1]);
853
 
#endif
854
 
  return 0;
855
 
}
856
 
EOF
857
 
          $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0
858
 
          rm -f $dummy.c $dummy
859
 
        else
860
 
          # Either a pre-BFD a.out linker (linux-gnuoldld)
861
 
          # or one that does not give us useful --help.
862
 
          # GCC wants to distinguish between linux-gnuoldld and linux-gnuaout.
863
 
          # If ld does not provide *any* "supported emulations:"
864
 
          # that means it is gnuoldld.
865
 
          echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations:"
866
 
          test $? != 0 && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0
867
 
 
868
 
          case "${UNAME_MACHINE}" in
869
 
          i?86)
870
 
            VENDOR=pc;
871
 
            ;;
872
 
          *)
873
 
            VENDOR=unknown;
874
 
            ;;
875
 
          esac
876
 
          # Determine whether the default compiler is a.out or elf
877
 
          cat >$dummy.c <<EOF
878
 
#include <features.h>
879
 
#ifdef __cplusplus
880
 
        int main (int argc, char *argv[]) {
881
 
#else
882
 
        int main (argc, argv) int argc; char *argv[]; {
883
 
#endif
884
 
#ifdef __ELF__
885
 
# ifdef __GLIBC__
886
 
#  if __GLIBC__ >= 2
887
 
    printf ("%s-${VENDOR}-linux-gnu\n", argv[1]);
888
 
#  else
889
 
    printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]);
890
 
#  endif
891
 
# else
892
 
   printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]);
893
 
# endif
894
 
#else
895
 
  printf ("%s-${VENDOR}-linux-gnuaout\n", argv[1]);
896
 
#endif
897
 
  return 0;
898
 
}
899
 
EOF
900
 
          ${CC-cc} $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0
901
 
          rm -f $dummy.c $dummy
902
 
        fi ;;
903
 
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.  earlier versions
904
 
# are messed up and put the nodename in both sysname and nodename.
905
 
    i?86:DYNIX/ptx:4*:*)
 
846
        case "$ld_supported_targets" in
 
847
          elf32-i386)
 
848
                TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
 
849
                ;;
 
850
          a.out-i386-linux)
 
851
                echo "${UNAME_MACHINE}-pc-linux-gnuaout"
 
852
                exit 0 ;;               
 
853
          coff-i386)
 
854
                echo "${UNAME_MACHINE}-pc-linux-gnucoff"
 
855
                exit 0 ;;
 
856
          "")
 
857
                # Either a pre-BFD a.out linker (linux-gnuoldld) or
 
858
                # one that does not give us useful --help.
 
859
                echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
 
860
                exit 0 ;;
 
861
        esac
 
862
        # Determine whether the default compiler is a.out or elf
 
863
        eval $set_cc_for_build
 
864
        sed 's/^        //' << EOF >$dummy.c
 
865
        #include <features.h>
 
866
        #ifdef __ELF__
 
867
        # ifdef __GLIBC__
 
868
        #  if __GLIBC__ >= 2
 
869
        LIBC=gnu
 
870
        #  else
 
871
        LIBC=gnulibc1
 
872
        #  endif
 
873
        # else
 
874
        LIBC=gnulibc1
 
875
        # endif
 
876
        #else
 
877
        LIBC=gnuaout
 
878
        #endif
 
879
EOF
 
880
        eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
 
881
        rm -f $dummy.c
 
882
        test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0
 
883
        test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
 
884
        ;;
 
885
    i*86:DYNIX/ptx:4*:*)
 
886
        # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
 
887
        # earlier versions are messed up and put the nodename in both
 
888
        # sysname and nodename.
906
889
        echo i386-sequent-sysv4
907
890
        exit 0 ;;
908
 
# added by chet for bash based on usenet posting from <hops@sco.com> and
909
 
# documentation on SCO's web site -- UnixWare 7 (SVR5)
910
 
#    i?86:UnixWare:5*:*)
911
 
#       echo ${UNAME_MACHINE}-pc-sysv5uw${UNAME_VERSION}
912
 
#       exit 0 ;;
913
 
    i?86:UNIX_SV:4.2MP:2.*)
914
 
        # Unixware is an offshoot of SVR4, but it has its own version
915
 
        # number series starting with 2...
916
 
        # I am not positive that other SVR4 systems won't match this,
 
891
    i*86:UNIX_SV:4.2MP:2.*)
 
892
        # Unixware is an offshoot of SVR4, but it has its own version
 
893
        # number series starting with 2...
 
894
        # I am not positive that other SVR4 systems won't match this,
917
895
        # I just have to hope.  -- rms.
918
 
        # Use sysv4.2uw... so that sysv4* matches it.
 
896
        # Use sysv4.2uw... so that sysv4* matches it.
919
897
        echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
920
898
        exit 0 ;;
921
 
    i?86:*:4.*:* | i?86:SYSTEM_V:4.*:* | i?86:UNIX_SV:4.*:*)
 
899
    i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
 
900
        UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
922
901
        if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
923
 
                echo ${UNAME_MACHINE}-univel-sysv${UNAME_RELEASE}
 
902
                echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
924
903
        else
925
 
                echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE}
 
904
                echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
926
905
        fi
927
906
        exit 0 ;;
928
 
    i?86:*:5:7*)
929
 
        UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')`
930
 
        (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
931
 
        (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) && UNAME_MACHINE=i586
932
 
        (/bin/uname -X|egrep '^Machine.*Pent.*II' >/dev/null) && UNAME_MACHINE=i686
933
 
        (/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) && UNAME_MACHINE=i585
934
 
        echo ${UNAME_MACHINE}-${UNAME_SYSTEM}${UNAME_VERSION}-sysv${UNAME_RELEASE}
935
 
        exit 0 ;;
936
 
    i?86:*:3.2:*)
 
907
    i*86:*:5:[78]*)
 
908
        case `/bin/uname -X | grep "^Machine"` in
 
909
            *486*)           UNAME_MACHINE=i486 ;;
 
910
            *Pentium)        UNAME_MACHINE=i586 ;;
 
911
            *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
 
912
        esac
 
913
        echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
 
914
        exit 0 ;;
 
915
    i*86:*:3.2:*)
937
916
        if test -f /usr/options/cb.name; then
938
917
                UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
939
918
                echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
951
930
                echo ${UNAME_MACHINE}-pc-sysv32
952
931
        fi
953
932
        exit 0 ;;
 
933
    i*86:*DOS:*:*)
 
934
        echo ${UNAME_MACHINE}-pc-msdosdjgpp
 
935
        exit 0 ;;
954
936
    pc:*:*:*)
955
 
        # uname -m prints for DJGPP always 'pc', but it prints nothing about
956
 
        # the processor, so we play safe by assuming i386.
 
937
        # Left here for compatibility:
 
938
        # uname -m prints for DJGPP always 'pc', but it prints nothing about
 
939
        # the processor, so we play safe by assuming i386.
957
940
        echo i386-pc-msdosdjgpp
958
 
        exit 0 ;;
 
941
        exit 0 ;;
959
942
    Intel:Mach:3*:*)
960
943
        echo i386-pc-mach3
961
944
        exit 0 ;;
975
958
        exit 0 ;;
976
959
    M68*:*:R3V[567]*:*)
977
960
        test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
978
 
    3[34]??:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0)
 
961
    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)
979
962
        OS_REL=''
980
963
        test -r /etc/.relid \
981
964
        && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
984
967
        /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
985
968
          && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;;
986
969
    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
987
 
        /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
988
 
          && echo i486-ncr-sysv4 && exit 0 ;;
 
970
        /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
 
971
          && echo i486-ncr-sysv4 && exit 0 ;;
 
972
    m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
 
973
        echo m68k-unknown-lynxos${UNAME_RELEASE}
 
974
        exit 0 ;;
989
975
    mc68030:UNIX_System_V:4.*:*)
990
976
        echo m68k-atari-sysv4
991
977
        exit 0 ;;
992
 
    m68*:LynxOS:2.*:*)
993
 
        echo m68k-unknown-lynxos${UNAME_RELEASE}
994
 
        exit 0 ;;
995
 
    i?86:LynxOS:2.*:* | i?86:LynxOS:3.[01]*:*)
996
 
        echo i386-pc-lynxos${UNAME_RELEASE}
 
978
    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
 
979
        echo i386-unknown-lynxos${UNAME_RELEASE}
997
980
        exit 0 ;;
998
981
    TSUNAMI:LynxOS:2.*:*)
999
982
        echo sparc-unknown-lynxos${UNAME_RELEASE}
1000
983
        exit 0 ;;
1001
 
    rs6000:LynxOS:2.*:* | PowerPC:LynxOS:2.*:*)
 
984
    rs6000:LynxOS:2.*:*)
1002
985
        echo rs6000-unknown-lynxos${UNAME_RELEASE}
1003
986
        exit 0 ;;
1004
 
    *:LynxOS:*:*)
1005
 
        echo ${UNAME_MACHINE}-unknown-lynxos${UNAME_RELEASE}
 
987
    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
 
988
        echo powerpc-unknown-lynxos${UNAME_RELEASE}
1006
989
        exit 0 ;;
1007
990
    SM[BE]S:UNIX_SV:*:*)
1008
991
        echo mips-dde-sysv${UNAME_RELEASE}
1009
992
        exit 0 ;;
1010
 
    RM*:SINIX-*:*:* | RM*:ReliantUNIX-*:*:*)
 
993
    RM*:ReliantUNIX-*:*:*)
 
994
        echo mips-sni-sysv4
 
995
        exit 0 ;;
 
996
    RM*:SINIX-*:*:*)
1011
997
        echo mips-sni-sysv4
1012
998
        exit 0 ;;
1013
999
    *:SINIX-*:*:*)
1018
1004
                echo ns32k-sni-sysv
1019
1005
        fi
1020
1006
        exit 0 ;;
1021
 
    PENTIUM:CPunix:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
1022
 
                           # says <Richard.M.Bartel@ccMail.Census.GOV>
1023
 
        echo i586-unisys-sysv4
1024
 
        exit 0 ;;
 
1007
    PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
 
1008
                      # says <Richard.M.Bartel@ccMail.Census.GOV>
 
1009
        echo i586-unisys-sysv4
 
1010
        exit 0 ;;
1025
1011
    *:UNIX_System_V:4*:FTX*)
1026
1012
        # From Gerald Hewes <hewes@openmarket.com>.
1027
1013
        # How about differentiating between stratus architectures? -djm
1030
1016
    *:*:*:FTX*)
1031
1017
        # From seanf@swdc.stratus.com.
1032
1018
        echo i860-stratus-sysv4
1033
 
        exit 0 ;;              
 
1019
        exit 0 ;;
 
1020
    *:VOS:*:*)
 
1021
        # From Paul.Green@stratus.com.
 
1022
        echo hppa1.1-stratus-vos
 
1023
        exit 0 ;;
1034
1024
    mc68*:A/UX:*:*)
1035
1025
        echo m68k-apple-aux${UNAME_RELEASE}
1036
1026
        exit 0 ;;
1037
 
    news*:NEWS-OS:*:6*)
 
1027
    news*:NEWS-OS:6*:*)
1038
1028
        echo mips-sony-newsos6
1039
1029
        exit 0 ;;
1040
 
    R3000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
 
1030
    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
1041
1031
        if [ -d /usr/nec ]; then
1042
 
                echo mips-nec-sysv${UNAME_RELEASE}
 
1032
                echo mips-nec-sysv${UNAME_RELEASE}
1043
1033
        else
1044
 
                echo mips-unknown-sysv${UNAME_RELEASE}
 
1034
                echo mips-unknown-sysv${UNAME_RELEASE}
1045
1035
        fi
1046
 
        exit 0 ;;
1047
 
    BeBox:BeOS:*:*)    # BeOS running on hardware made by Be, PPC only.
1048
 
        echo powerpc-apple-beos
1049
 
        exit 0 ;;
1050
 
    BeMac:BeOS:*:*)
1051
 
        echo powerpc-apple-beos
1052
 
        exit 0 ;;
1053
 
    BePC:BeOS:*:*)
 
1036
        exit 0 ;;
 
1037
    BeBox:BeOS:*:*)     # BeOS running on hardware made by Be, PPC only.
 
1038
        echo powerpc-be-beos
 
1039
        exit 0 ;;
 
1040
    BeMac:BeOS:*:*)     # BeOS running on Mac or Mac clone, PPC only.
 
1041
        echo powerpc-apple-beos
 
1042
        exit 0 ;;
 
1043
    BePC:BeOS:*:*)      # BeOS running on Intel PC compatible.
1054
1044
        echo i586-pc-beos
1055
1045
        exit 0 ;;
1056
1046
    SX-4:SUPER-UX:*:*)
1065
1055
    *:Rhapsody:*:*)
1066
1056
        echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
1067
1057
        exit 0 ;;
1068
 
    Power*:Darwin:*:*)
1069
 
        echo powerpc-apple-darwin${UNAME_RELEASE}
1070
 
        exit 0 ;;
1071
1058
    *:Darwin:*:*)
1072
 
        echo ${UNAME_MACHINE}-apple-darwin${UNAME_RELEASE}
 
1059
        echo `uname -p`-apple-darwin${UNAME_RELEASE}
 
1060
        exit 0 ;;
 
1061
    *:procnto*:*:* | *:QNX:[0123456789]*:*)
 
1062
        if test "${UNAME_MACHINE}" = "x86pc"; then
 
1063
                UNAME_MACHINE=pc
 
1064
        fi
 
1065
        echo `uname -p`-${UNAME_MACHINE}-nto-qnx
 
1066
        exit 0 ;;
 
1067
    *:QNX:*:4*)
 
1068
        echo i386-pc-qnx
 
1069
        exit 0 ;;
 
1070
    NSR-[GKLNPTVW]:NONSTOP_KERNEL:*:*)
 
1071
        echo nsr-tandem-nsk${UNAME_RELEASE}
 
1072
        exit 0 ;;
 
1073
    *:NonStop-UX:*:*)
 
1074
        echo mips-compaq-nonstopux
 
1075
        exit 0 ;;
 
1076
    BS2000:POSIX*:*:*)
 
1077
        echo bs2000-siemens-sysv
 
1078
        exit 0 ;;
 
1079
    DS/*:UNIX_System_V:*:*)
 
1080
        echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
 
1081
        exit 0 ;;
 
1082
    *:Plan9:*:*)
 
1083
        # "uname -m" is not consistent, so use $cputype instead. 386
 
1084
        # is converted to i386 for consistency with other x86
 
1085
        # operating systems.
 
1086
        if test "$cputype" = "386"; then
 
1087
            UNAME_MACHINE=i386
 
1088
        else
 
1089
            UNAME_MACHINE="$cputype"
 
1090
        fi
 
1091
        echo ${UNAME_MACHINE}-unknown-plan9
 
1092
        exit 0 ;;
 
1093
    i*86:OS/2:*:*)
 
1094
        # If we were able to find `uname', then EMX Unix compatibility
 
1095
        # is probably installed.
 
1096
        echo ${UNAME_MACHINE}-pc-os2-emx
 
1097
        exit 0 ;;
 
1098
    *:TOPS-10:*:*)
 
1099
        echo pdp10-unknown-tops10
 
1100
        exit 0 ;;
 
1101
    *:TENEX:*:*)
 
1102
        echo pdp10-unknown-tenex
 
1103
        exit 0 ;;
 
1104
    KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
 
1105
        echo pdp10-dec-tops20
 
1106
        exit 0 ;;
 
1107
    XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
 
1108
        echo pdp10-xkl-tops20
 
1109
        exit 0 ;;
 
1110
    *:TOPS-20:*:*)
 
1111
        echo pdp10-unknown-tops20
 
1112
        exit 0 ;;
 
1113
    *:ITS:*:*)
 
1114
        echo pdp10-unknown-its
 
1115
        exit 0 ;;
 
1116
    i*86:XTS-300:*:STOP)
 
1117
        echo ${UNAME_MACHINE}-unknown-stop
 
1118
        exit 0 ;;
 
1119
    i*86:atheos:*:*)
 
1120
        echo ${UNAME_MACHINE}-unknown-atheos
1073
1121
        exit 0 ;;
1074
1122
esac
1075
1123
 
1076
1124
#echo '(No uname command or uname output not recognized.)' 1>&2
1077
1125
#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
1078
1126
 
 
1127
eval $set_cc_for_build
1079
1128
cat >$dummy.c <<EOF
1080
1129
#ifdef _SEQUENT_
1081
1130
# include <sys/types.h>
1101
1150
#endif
1102
1151
 
1103
1152
#if defined (__arm) && defined (__acorn) && defined (__unix)
1104
 
  printf ("arm-acorn-riscix\n"); exit (0);
1105
 
#endif
1106
 
 
1107
 
#if defined (hp9000) && !defined (hpux)
1108
 
  printf ("m68k-hp-bsd\n"); exit (0);
 
1153
  printf ("arm-acorn-riscix"); exit (0);
1109
1154
#endif
1110
1155
 
1111
1156
#if defined (hp300) && !defined (hpux)
1166
1211
#endif
1167
1212
 
1168
1213
#if defined (vax)
1169
 
#if !defined (ultrix)
1170
 
  printf ("vax-dec-bsd\n"); exit (0);
1171
 
#else
1172
 
  printf ("vax-dec-ultrix\n"); exit (0);
1173
 
#endif
 
1214
# if !defined (ultrix)
 
1215
#  include <sys/param.h>
 
1216
#  if defined (BSD)
 
1217
#   if BSD == 43
 
1218
      printf ("vax-dec-bsd4.3\n"); exit (0);
 
1219
#   else
 
1220
#    if BSD == 199006
 
1221
      printf ("vax-dec-bsd4.3reno\n"); exit (0);
 
1222
#    else
 
1223
      printf ("vax-dec-bsd\n"); exit (0);
 
1224
#    endif
 
1225
#   endif
 
1226
#  else
 
1227
    printf ("vax-dec-bsd\n"); exit (0);
 
1228
#  endif
 
1229
# else
 
1230
    printf ("vax-dec-ultrix\n"); exit (0);
 
1231
# endif
1174
1232
#endif
1175
1233
 
1176
1234
#if defined (alliant) && defined (i860)
1177
1235
  printf ("i860-alliant-bsd\n"); exit (0);
1178
1236
#endif
1179
1237
 
1180
 
/* Begin cases added for Bash */
1181
 
#if defined (tahoe)
1182
 
  printf ("tahoe-cci-bsd\n"); exit (0);
1183
 
#endif
1184
 
 
1185
 
#if defined (nec_ews)
1186
 
#  if defined (SYSTYPE_SYSV)
1187
 
  printf ("ews4800-nec-sysv4\n"); exit 0;
1188
 
#  else
1189
 
  printf ("ews4800-nec-bsd\n"); exit (0);
1190
 
#  endif
1191
 
#endif
1192
 
 
1193
 
#if defined (sony)
1194
 
#  if defined (SYSTYPE_SYSV)
1195
 
  printf ("mips-sony-sysv4\n"); exit 0;
1196
 
#  else
1197
 
  printf ("mips-sony-bsd\n"); exit (0);
1198
 
#  endif
1199
 
#endif
1200
 
 
1201
 
#if defined (ardent)
1202
 
  printf ("titan-ardent-bsd\n"); exit (0);
1203
 
#endif
1204
 
 
1205
 
#if defined (stardent)
1206
 
  printf ("stardent-stardent-sysv\n"); exit (0);
1207
 
#endif
1208
 
 
1209
 
#if defined (ibm032)
1210
 
  printf ("ibmrt-ibm-bsd4.3\n"); exit (0);
1211
 
#endif
1212
 
 
1213
 
#if defined (sequent) && defined (i386)
1214
 
  printf ("i386-sequent-bsd\n"); exit (0);
1215
 
#endif
1216
 
 
1217
 
#if defined (qnx) && defined (i386)
1218
 
  printf ("i386-pc-qnx\n"); exit (0);
1219
 
#endif
1220
 
 
1221
 
#if defined (gould)
1222
 
  printf ("gould-gould-bsd\n"); exit (0);
1223
 
#endif
1224
 
 
1225
 
#if defined (unixpc)
1226
 
  printf ("unixpc-att-sysv\n"); exit (0);
1227
 
#endif
1228
 
 
1229
 
#if defined (att386)
1230
 
  printf ("i386-att-sysv3\n"); exit (0);
1231
 
#endif
1232
 
 
1233
 
#if defined (__m88k) && defined (__UMAXV__)
1234
 
  printf ("m88k-encore-sysv3\n"); exit (0);
1235
 
#endif
1236
 
 
1237
 
#if defined (drs6000)
1238
 
  printf ("drs6000-icl-sysv4.2\n"); exit (0);
1239
 
#endif
1240
 
 
1241
 
#if defined (clipper)
1242
 
  printf ("clipper-orion-bsd\n"); exit (0);
1243
 
#endif
1244
 
 
1245
 
#if defined (is68k)
1246
 
  printf ("m68k-isi-bsd\n"); exit (0);
1247
 
#endif
1248
 
 
1249
 
#if defined (luna88k)
1250
 
  printf ("luna88k-omron-bsd\n"); exit (0);
1251
 
#endif
1252
 
 
1253
 
#if defined (butterfly) && defined (BFLY1)
1254
 
  printf ("butterfly-bbn-mach\n"); exit (0);
1255
 
#endif
1256
 
 
1257
 
#if defined (tower32)
1258
 
  printf ("tower32-ncr-sysv4\n"); exit (0);
1259
 
#endif
1260
 
 
1261
 
#if defined (MagicStation)
1262
 
  printf ("magicstation-unknown-bsd\n"); exit (0);
1263
 
#endif
1264
 
 
1265
 
#if defined (scs)
1266
 
  printf ("symmetric-scs-bsd4.2\n"); exit (0);
1267
 
#endif
1268
 
 
1269
 
#if defined (tandem)
1270
 
  printf ("tandem-tandem-sysv\n"); exit (0);
1271
 
#endif
1272
 
 
1273
 
#if defined (cadmus)
1274
 
  printf ("cadmus-pcs-sysv\n"); exit (0);
1275
 
#endif
1276
 
 
1277
 
#if defined (masscomp)
1278
 
  printf ("masscomp-masscomp-sysv3\n"); exit (0);
1279
 
#endif
1280
 
 
1281
 
#if defined (hbullx20)
1282
 
  printf ("hbullx20-bull-sysv3\n"); exit (0);
1283
 
#endif
1284
 
 
1285
 
/* End cases added for Bash */
1286
 
 
1287
1238
  exit (1);
1288
1239
}
1289
1240
EOF
1290
1241
 
1291
 
${CC-cc} $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm $dummy.c $dummy && exit 0
 
1242
$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm -f $dummy.c $dummy && exit 0
1292
1243
rm -f $dummy.c $dummy
1293
1244
 
1294
1245
# Apollos put the system type in the environment.
1321
1272
    esac
1322
1273
fi
1323
1274
 
1324
 
# Begin cases added for Bash
1325
 
case "$UNAME" in
1326
 
uts) echo uts-amdahl-sysv${UNAME_RELEASE}; exit 0 ;;
1327
 
esac
1328
 
 
1329
 
if [ -d /usr/amiga ]; then
1330
 
        echo m68k-cbm-sysv${UNAME_RELEASE}; exit 0;
1331
 
fi
1332
 
 
1333
 
if [ -f /bin/fxc.info ]; then
1334
 
        echo fxc-alliant-concentrix
1335
 
        exit 0
1336
 
fi
1337
 
# end cases added for Bash
1338
 
 
1339
 
#echo '(Unable to guess system type)' 1>&2
 
1275
cat >&2 <<EOF
 
1276
$0: unable to guess system type
 
1277
 
 
1278
This script, last modified $timestamp, has failed to recognize
 
1279
the operating system you are using. It is advised that you
 
1280
download the most up to date version of the config scripts from
 
1281
 
 
1282
    ftp://ftp.gnu.org/pub/gnu/config/
 
1283
 
 
1284
If the version you run ($0) is already up to date, please
 
1285
send the following data and any information you think might be
 
1286
pertinent to <config-patches@gnu.org> in order to provide the needed
 
1287
information to handle your system.
 
1288
 
 
1289
config.guess timestamp = $timestamp
 
1290
 
 
1291
uname -m = `(uname -m) 2>/dev/null || echo unknown`
 
1292
uname -r = `(uname -r) 2>/dev/null || echo unknown`
 
1293
uname -s = `(uname -s) 2>/dev/null || echo unknown`
 
1294
uname -v = `(uname -v) 2>/dev/null || echo unknown`
 
1295
 
 
1296
/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
 
1297
/bin/uname -X     = `(/bin/uname -X) 2>/dev/null`
 
1298
 
 
1299
hostinfo               = `(hostinfo) 2>/dev/null`
 
1300
/bin/universe          = `(/bin/universe) 2>/dev/null`
 
1301
/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null`
 
1302
/bin/arch              = `(/bin/arch) 2>/dev/null`
 
1303
/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`
 
1304
/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
 
1305
 
 
1306
UNAME_MACHINE = ${UNAME_MACHINE}
 
1307
UNAME_RELEASE = ${UNAME_RELEASE}
 
1308
UNAME_SYSTEM  = ${UNAME_SYSTEM}
 
1309
UNAME_VERSION = ${UNAME_VERSION}
 
1310
EOF
1340
1311
 
1341
1312
exit 1
 
1313
 
 
1314
# Local variables:
 
1315
# eval: (add-hook 'write-file-hooks 'time-stamp)
 
1316
# time-stamp-start: "timestamp='"
 
1317
# time-stamp-format: "%:y-%02m-%02d"
 
1318
# time-stamp-end: "'"
 
1319
# End: