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