]> git.sesse.net Git - vlc/blob - extras/contrib/src/Patches/tiff.patch
* fix x264 compilation
[vlc] / extras / contrib / src / Patches / tiff.patch
1 diff -ru tiff.old/config.guess tiff/config.guess
2 --- tiff.old/config.guess       1996-04-30 00:16:18.000000000 +0200
3 +++ tiff/config.guess   2005-08-02 16:27:00.000000000 +0200
4 @@ -1,7 +1,10 @@
5 -#!/bin/sh
6 +#! /bin/sh
7  # Attempt to guess a canonical system name.
8 -#   Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc.
9 -#
10 +#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
11 +#   2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
12 +
13 +timestamp='2004-08-13'
14 +
15  # This file is free software; you can redistribute it and/or modify it
16  # under the terms of the GNU General Public License as published by
17  # the Free Software Foundation; either version 2 of the License, or
18 @@ -14,64 +17,344 @@
19  #
20  # You should have received a copy of the GNU General Public License
21  # along with this program; if not, write to the Free Software
22 -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24  #
25  # As a special exception to the GNU General Public License, if you
26  # distribute this file as part of a program that contains a
27  # configuration script generated by Autoconf, you may include it under
28  # the same distribution terms that you use for the rest of that program.
29  
30 -# Written by Per Bothner <bothner@cygnus.com>.
31 -# The master version of this file is at the FSF in /home/gd/gnu/lib.
32 +# Originally written by Per Bothner <per@bothner.com>.
33 +# Please send patches to <config-patches@gnu.org>.  Submit a context
34 +# diff and a properly formatted ChangeLog entry.
35  #
36  # This script attempts to guess a canonical system name similar to
37  # config.sub.  If it succeeds, it prints the system name on stdout, and
38  # exits with 0.  Otherwise, it exits with 1.
39  #
40  # The plan is that this can be called by configure scripts if you
41 -# don't specify an explicit system type (host/target name).
42 -#
43 -# Only a few systems have been added to this list; please add others
44 -# (but try to keep the structure clean).
45 -#
46 +# don't specify an explicit build system type.
47 +
48 +me=`echo "$0" | sed -e 's,.*/,,'`
49 +
50 +usage="\
51 +Usage: $0 [OPTION]
52 +
53 +Output the configuration name of the system \`$me' is run on.
54 +
55 +Operation modes:
56 +  -h, --help         print this help, then exit
57 +  -t, --time-stamp   print date of last modification, then exit
58 +  -v, --version      print version number, then exit
59 +
60 +Report bugs and patches to <config-patches@gnu.org>."
61 +
62 +version="\
63 +GNU config.guess ($timestamp)
64 +
65 +Originally written by Per Bothner.
66 +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
67 +Free Software Foundation, Inc.
68 +
69 +This is free software; see the source for copying conditions.  There is NO
70 +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
71 +
72 +help="
73 +Try \`$me --help' for more information."
74 +
75 +# Parse command line
76 +while test $# -gt 0 ; do
77 +  case $1 in
78 +    --time-stamp | --time* | -t )
79 +       echo "$timestamp" ; exit 0 ;;
80 +    --version | -v )
81 +       echo "$version" ; exit 0 ;;
82 +    --help | --h* | -h )
83 +       echo "$usage"; exit 0 ;;
84 +    -- )     # Stop option processing
85 +       shift; break ;;
86 +    - )        # Use stdin as input.
87 +       break ;;
88 +    -* )
89 +       echo "$me: invalid option $1$help" >&2
90 +       exit 1 ;;
91 +    * )
92 +       break ;;
93 +  esac
94 +done
95 +
96 +if test $# != 0; then
97 +  echo "$me: too many arguments$help" >&2
98 +  exit 1
99 +fi
100 +
101 +trap 'exit 1' 1 2 15
102 +
103 +# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
104 +# compiler to aid in system detection is discouraged as it requires
105 +# temporary files to be created and, as you can see below, it is a
106 +# headache to deal with in a portable fashion.
107 +
108 +# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
109 +# use `HOST_CC' if defined, but it is deprecated.
110 +
111 +# Portable tmp directory creation inspired by the Autoconf team.
112 +
113 +set_cc_for_build='
114 +trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
115 +trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
116 +: ${TMPDIR=/tmp} ;
117 + { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
118 + { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
119 + { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
120 + { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
121 +dummy=$tmp/dummy ;
122 +tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
123 +case $CC_FOR_BUILD,$HOST_CC,$CC in
124 + ,,)    echo "int x;" > $dummy.c ;
125 +       for c in cc gcc c89 c99 ; do
126 +         if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
127 +            CC_FOR_BUILD="$c"; break ;
128 +         fi ;
129 +       done ;
130 +       if test x"$CC_FOR_BUILD" = x ; then
131 +         CC_FOR_BUILD=no_compiler_found ;
132 +       fi
133 +       ;;
134 + ,,*)   CC_FOR_BUILD=$CC ;;
135 + ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
136 +esac ;'
137  
138  # This is needed to find uname on a Pyramid OSx when run in the BSD universe.
139 -# (ghazi@noc.rutgers.edu 8/24/94.)
140 +# (ghazi@noc.rutgers.edu 1994-08-24)
141  if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
142         PATH=$PATH:/.attbin ; export PATH
143  fi
144  
145  UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
146  UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
147 -UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
148 +UNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
149  UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
150  
151 -trap 'rm -f dummy.c dummy.o dummy; exit 1' 1 2 15
152 -
153  # Note: order is significant - the case branches are not exclusive.
154  
155  case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
156 -    alpha:OSF1:V*:*)
157 -       # After 1.2, OSF1 uses "V1.3" for uname -r.
158 -       echo alpha-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^V//'`
159 +    *:NetBSD:*:*)
160 +       # NetBSD (nbsd) targets should (where applicable) match one or
161 +       # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
162 +       # *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
163 +       # switched to ELF, *-*-netbsd* would select the old
164 +       # object file format.  This provides both forward
165 +       # compatibility and a consistent mechanism for selecting the
166 +       # object file format.
167 +       #
168 +       # Note: NetBSD doesn't particularly care about the vendor
169 +       # portion of the name.  We always set it to "unknown".
170 +       sysctl="sysctl -n hw.machine_arch"
171 +       UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
172 +           /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
173 +       case "${UNAME_MACHINE_ARCH}" in
174 +           armeb) machine=armeb-unknown ;;
175 +           arm*) machine=arm-unknown ;;
176 +           sh3el) machine=shl-unknown ;;
177 +           sh3eb) machine=sh-unknown ;;
178 +           *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
179 +       esac
180 +       # The Operating System including object format, if it has switched
181 +       # to ELF recently, or will in the future.
182 +       case "${UNAME_MACHINE_ARCH}" in
183 +           arm*|i386|m68k|ns32k|sh3*|sparc|vax)
184 +               eval $set_cc_for_build
185 +               if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
186 +                       | grep __ELF__ >/dev/null
187 +               then
188 +                   # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
189 +                   # Return netbsd for either.  FIX?
190 +                   os=netbsd
191 +               else
192 +                   os=netbsdelf
193 +               fi
194 +               ;;
195 +           *)
196 +               os=netbsd
197 +               ;;
198 +       esac
199 +       # The OS release
200 +       # Debian GNU/NetBSD machines have a different userland, and
201 +       # thus, need a distinct triplet. However, they do not need
202 +       # kernel version information, so it can be replaced with a
203 +       # suitable tag, in the style of linux-gnu.
204 +       case "${UNAME_VERSION}" in
205 +           Debian*)
206 +               release='-gnu'
207 +               ;;
208 +           *)
209 +               release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
210 +               ;;
211 +       esac
212 +       # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
213 +       # contains redundant information, the shorter form:
214 +       # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
215 +       echo "${machine}-${os}${release}"
216 +       exit 0 ;;
217 +    amd64:OpenBSD:*:*)
218 +       echo x86_64-unknown-openbsd${UNAME_RELEASE}
219 +       exit 0 ;;
220 +    amiga:OpenBSD:*:*)
221 +       echo m68k-unknown-openbsd${UNAME_RELEASE}
222 +       exit 0 ;;
223 +    cats:OpenBSD:*:*)
224 +       echo arm-unknown-openbsd${UNAME_RELEASE}
225 +       exit 0 ;;
226 +    hp300:OpenBSD:*:*)
227 +       echo m68k-unknown-openbsd${UNAME_RELEASE}
228 +       exit 0 ;;
229 +    luna88k:OpenBSD:*:*)
230 +       echo m88k-unknown-openbsd${UNAME_RELEASE}
231 +       exit 0 ;;
232 +    mac68k:OpenBSD:*:*)
233 +       echo m68k-unknown-openbsd${UNAME_RELEASE}
234 +       exit 0 ;;
235 +    macppc:OpenBSD:*:*)
236 +       echo powerpc-unknown-openbsd${UNAME_RELEASE}
237 +       exit 0 ;;
238 +    mvme68k:OpenBSD:*:*)
239 +       echo m68k-unknown-openbsd${UNAME_RELEASE}
240 +       exit 0 ;;
241 +    mvme88k:OpenBSD:*:*)
242 +       echo m88k-unknown-openbsd${UNAME_RELEASE}
243 +       exit 0 ;;
244 +    mvmeppc:OpenBSD:*:*)
245 +       echo powerpc-unknown-openbsd${UNAME_RELEASE}
246 +       exit 0 ;;
247 +    sgi:OpenBSD:*:*)
248 +       echo mips64-unknown-openbsd${UNAME_RELEASE}
249 +       exit 0 ;;
250 +    sun3:OpenBSD:*:*)
251 +       echo m68k-unknown-openbsd${UNAME_RELEASE}
252 +       exit 0 ;;
253 +    *:OpenBSD:*:*)
254 +       echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE}
255 +       exit 0 ;;
256 +    *:ekkoBSD:*:*)
257 +       echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
258 +       exit 0 ;;
259 +    macppc:MirBSD:*:*)
260 +       echo powerppc-unknown-mirbsd${UNAME_RELEASE}
261 +       exit 0 ;;
262 +    *:MirBSD:*:*)
263 +       echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
264         exit 0 ;;
265      alpha:OSF1:*:*)
266 +       case $UNAME_RELEASE in
267 +       *4.0)
268 +               UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
269 +               ;;
270 +       *5.*)
271 +               UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
272 +               ;;
273 +       esac
274 +       # According to Compaq, /usr/sbin/psrinfo has been available on
275 +       # OSF/1 and Tru64 systems produced since 1995.  I hope that
276 +       # covers most systems running today.  This code pipes the CPU
277 +       # types through head -n 1, so we only detect the type of CPU 0.
278 +       ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\) processor.*$/\1/p' | head -n 1`
279 +       case "$ALPHA_CPU_TYPE" in
280 +           "EV4 (21064)")
281 +               UNAME_MACHINE="alpha" ;;
282 +           "EV4.5 (21064)")
283 +               UNAME_MACHINE="alpha" ;;
284 +           "LCA4 (21066/21068)")
285 +               UNAME_MACHINE="alpha" ;;
286 +           "EV5 (21164)")
287 +               UNAME_MACHINE="alphaev5" ;;
288 +           "EV5.6 (21164A)")
289 +               UNAME_MACHINE="alphaev56" ;;
290 +           "EV5.6 (21164PC)")
291 +               UNAME_MACHINE="alphapca56" ;;
292 +           "EV5.7 (21164PC)")
293 +               UNAME_MACHINE="alphapca57" ;;
294 +           "EV6 (21264)")
295 +               UNAME_MACHINE="alphaev6" ;;
296 +           "EV6.7 (21264A)")
297 +               UNAME_MACHINE="alphaev67" ;;
298 +           "EV6.8CB (21264C)")
299 +               UNAME_MACHINE="alphaev68" ;;
300 +           "EV6.8AL (21264B)")
301 +               UNAME_MACHINE="alphaev68" ;;
302 +           "EV6.8CX (21264D)")
303 +               UNAME_MACHINE="alphaev68" ;;
304 +           "EV6.9A (21264/EV69A)")
305 +               UNAME_MACHINE="alphaev69" ;;
306 +           "EV7 (21364)")
307 +               UNAME_MACHINE="alphaev7" ;;
308 +           "EV7.9 (21364A)")
309 +               UNAME_MACHINE="alphaev79" ;;
310 +       esac
311 +       # A Pn.n version is a patched version.
312 +       # A Vn.n version is a released version.
313 +       # A Tn.n version is a released field test version.
314 +       # A Xn.n version is an unreleased experimental baselevel.
315         # 1.2 uses "1.2" for uname -r.
316 -       echo alpha-dec-osf${UNAME_RELEASE}
317 -        exit 0 ;;
318 +       echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
319 +       exit 0 ;;
320 +    Alpha\ *:Windows_NT*:*)
321 +       # How do we know it's Interix rather than the generic POSIX subsystem?
322 +       # Should we change UNAME_MACHINE based on the output of uname instead
323 +       # of the specific Alpha model?
324 +       echo alpha-pc-interix
325 +       exit 0 ;;
326 +    21064:Windows_NT:50:3)
327 +       echo alpha-dec-winnt3.5
328 +       exit 0 ;;
329 +    Amiga*:UNIX_System_V:4.0:*)
330 +       echo m68k-unknown-sysv4
331 +       exit 0;;
332 +    *:[Aa]miga[Oo][Ss]:*:*)
333 +       echo ${UNAME_MACHINE}-unknown-amigaos
334 +       exit 0 ;;
335 +    *:[Mm]orph[Oo][Ss]:*:*)
336 +       echo ${UNAME_MACHINE}-unknown-morphos
337 +       exit 0 ;;
338 +    *:OS/390:*:*)
339 +       echo i370-ibm-openedition
340 +       exit 0 ;;
341 +    *:OS400:*:*)
342 +        echo powerpc-ibm-os400
343 +       exit 0 ;;
344      arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
345         echo arm-acorn-riscix${UNAME_RELEASE}
346         exit 0;;
347 -    Pyramid*:OSx*:*:*)
348 +    SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
349 +       echo hppa1.1-hitachi-hiuxmpp
350 +       exit 0;;
351 +    Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
352 +       # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
353         if test "`(/bin/universe) 2>/dev/null`" = att ; then
354                 echo pyramid-pyramid-sysv3
355         else
356                 echo pyramid-pyramid-bsd
357         fi
358         exit 0 ;;
359 -    sun4*:SunOS:5.*:*)
360 +    NILE*:*:*:dcosx)
361 +       echo pyramid-pyramid-svr4
362 +       exit 0 ;;
363 +    DRS?6000:unix:4.0:6*)
364 +       echo sparc-icl-nx6
365 +       exit 0 ;;
366 +    DRS?6000:UNIX_SV:4.2*:7*)
367 +       case `/usr/bin/uname -p` in
368 +           sparc) echo sparc-icl-nx7 && exit 0 ;;
369 +       esac ;;
370 +    sun4H:SunOS:5.*:*)
371 +       echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
372 +       exit 0 ;;
373 +    sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
374         echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
375         exit 0 ;;
376 +    i86pc:SunOS:5.*:*)
377 +       echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
378 +       exit 0 ;;
379      sun4*:SunOS:6*:*)
380         # According to config.sub, this is the proper way to canonicalize
381         # SunOS6.  Hard to guess exactly what SunOS6 will be like, but
382 @@ -79,21 +362,116 @@
383         echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
384         exit 0 ;;
385      sun4*:SunOS:*:*)
386 +       case "`/usr/bin/arch -k`" in
387 +           Series*|S4*)
388 +               UNAME_RELEASE=`uname -v`
389 +               ;;
390 +       esac
391         # Japanese Language versions have a version number like `4.1.3-JL'.
392         echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
393         exit 0 ;;
394      sun3*:SunOS:*:*)
395         echo m68k-sun-sunos${UNAME_RELEASE}
396         exit 0 ;;
397 +    sun*:*:4.2BSD:*)
398 +       UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
399 +       test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
400 +       case "`/bin/arch`" in
401 +           sun3)
402 +               echo m68k-sun-sunos${UNAME_RELEASE}
403 +               ;;
404 +           sun4)
405 +               echo sparc-sun-sunos${UNAME_RELEASE}
406 +               ;;
407 +       esac
408 +       exit 0 ;;
409 +    aushp:SunOS:*:*)
410 +       echo sparc-auspex-sunos${UNAME_RELEASE}
411 +       exit 0 ;;
412 +    # The situation for MiNT is a little confusing.  The machine name
413 +    # can be virtually everything (everything which is not
414 +    # "atarist" or "atariste" at least should have a processor
415 +    # > m68000).  The system name ranges from "MiNT" over "FreeMiNT"
416 +    # to the lowercase version "mint" (or "freemint").  Finally
417 +    # the system name "TOS" denotes a system which is actually not
418 +    # MiNT.  But MiNT is downward compatible to TOS, so this should
419 +    # be no problem.
420 +    atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
421 +        echo m68k-atari-mint${UNAME_RELEASE}
422 +       exit 0 ;;
423 +    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
424 +       echo m68k-atari-mint${UNAME_RELEASE}
425 +        exit 0 ;;
426 +    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
427 +        echo m68k-atari-mint${UNAME_RELEASE}
428 +       exit 0 ;;
429 +    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
430 +        echo m68k-milan-mint${UNAME_RELEASE}
431 +        exit 0 ;;
432 +    hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
433 +        echo m68k-hades-mint${UNAME_RELEASE}
434 +        exit 0 ;;
435 +    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
436 +        echo m68k-unknown-mint${UNAME_RELEASE}
437 +        exit 0 ;;
438 +    m68k:machten:*:*)
439 +       echo m68k-apple-machten${UNAME_RELEASE}
440 +       exit 0 ;;
441 +    powerpc:machten:*:*)
442 +       echo powerpc-apple-machten${UNAME_RELEASE}
443 +       exit 0 ;;
444 +    RISC*:Mach:*:*)
445 +       echo mips-dec-mach_bsd4.3
446 +       exit 0 ;;
447      RISC*:ULTRIX:*:*)
448         echo mips-dec-ultrix${UNAME_RELEASE}
449         exit 0 ;;
450      VAX*:ULTRIX*:*:*)
451         echo vax-dec-ultrix${UNAME_RELEASE}
452         exit 0 ;;
453 -    mips:*:5*:RISCos)
454 +    2020:CLIX:*:* | 2430:CLIX:*:*)
455 +       echo clipper-intergraph-clix${UNAME_RELEASE}
456 +       exit 0 ;;
457 +    mips:*:*:UMIPS | mips:*:*:RISCos)
458 +       eval $set_cc_for_build
459 +       sed 's/^        //' << EOF >$dummy.c
460 +#ifdef __cplusplus
461 +#include <stdio.h>  /* for printf() prototype */
462 +       int main (int argc, char *argv[]) {
463 +#else
464 +       int main (argc, argv) int argc; char *argv[]; {
465 +#endif
466 +       #if defined (host_mips) && defined (MIPSEB)
467 +       #if defined (SYSTYPE_SYSV)
468 +         printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
469 +       #endif
470 +       #if defined (SYSTYPE_SVR4)
471 +         printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
472 +       #endif
473 +       #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
474 +         printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
475 +       #endif
476 +       #endif
477 +         exit (-1);
478 +       }
479 +EOF
480 +       $CC_FOR_BUILD -o $dummy $dummy.c \
481 +         && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
482 +         && exit 0
483         echo mips-mips-riscos${UNAME_RELEASE}
484         exit 0 ;;
485 +    Motorola:PowerMAX_OS:*:*)
486 +       echo powerpc-motorola-powermax
487 +       exit 0 ;;
488 +    Motorola:*:4.3:PL8-*)
489 +       echo powerpc-harris-powermax
490 +       exit 0 ;;
491 +    Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
492 +       echo powerpc-harris-powermax
493 +       exit 0 ;;
494 +    Night_Hawk:Power_UNIX:*:*)
495 +       echo powerpc-harris-powerunix
496 +       exit 0 ;;
497      m88k:CX/UX:7*:*)
498         echo m88k-harris-cxux7
499         exit 0 ;;
500 @@ -104,11 +482,19 @@
501         echo m88k-motorola-sysv3
502         exit 0 ;;
503      AViiON:dgux:*:*)
504 -       if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx \
505 -            -o ${TARGET_BINARY_INTERFACE}x = x ] ; then
506 +        # DG/UX returns AViiON for all architectures
507 +        UNAME_PROCESSOR=`/usr/bin/uname -p`
508 +       if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
509 +       then
510 +           if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
511 +              [ ${TARGET_BINARY_INTERFACE}x = x ]
512 +           then
513                 echo m88k-dg-dgux${UNAME_RELEASE}
514 -       else
515 +           else
516                 echo m88k-dg-dguxbcs${UNAME_RELEASE}
517 +           fi
518 +       else
519 +           echo i586-dg-dgux${UNAME_RELEASE}
520         fi
521         exit 0 ;;
522      M88*:DolphinOS:*:*)        # DolphinOS (SVR3)
523 @@ -125,14 +511,26 @@
524         echo m68k-tektronix-bsd
525         exit 0 ;;
526      *:IRIX*:*:*)
527 -       echo mips-sgi-irix${UNAME_RELEASE}
528 +       echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
529         exit 0 ;;
530 -    i[34]86:AIX:*:*)
531 +    ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
532 +       echo romp-ibm-aix      # uname -m gives an 8 hex-code CPU id
533 +       exit 0 ;;              # Note that: echo "'`uname -s`'" gives 'AIX '
534 +    i*86:AIX:*:*)
535         echo i386-ibm-aix
536         exit 0 ;;
537 +    ia64:AIX:*:*)
538 +       if [ -x /usr/bin/oslevel ] ; then
539 +               IBM_REV=`/usr/bin/oslevel`
540 +       else
541 +               IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
542 +       fi
543 +       echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
544 +       exit 0 ;;
545      *:AIX:2:3)
546         if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
547 -               sed 's/^                //' << EOF >dummy.c
548 +               eval $set_cc_for_build
549 +               sed 's/^                //' << EOF >$dummy.c
550                 #include <sys/systemcfg.h>
551  
552                 main()
553 @@ -143,8 +541,7 @@
554                         exit(0);
555                         }
556  EOF
557 -               ${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0
558 -               rm -f dummy.c dummy
559 +               $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
560                 echo rs6000-ibm-aix3.2.5
561         elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
562                 echo rs6000-ibm-aix3.2.4
563 @@ -152,24 +549,29 @@
564                 echo rs6000-ibm-aix3.2
565         fi
566         exit 0 ;;
567 -    *:AIX:*:4)
568 -       if /usr/sbin/lsattr -EHl proc0 | grep POWER >/dev/null 2>&1; then
569 +    *:AIX:*:[45])
570 +       IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
571 +       if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
572                 IBM_ARCH=rs6000
573         else
574                 IBM_ARCH=powerpc
575         fi
576 -       if grep bos410 /usr/include/stdio.h >/dev/null 2>&1; then
577 -               IBM_REV=4.1
578 -       elif grep bos411 /usr/include/stdio.h >/dev/null 2>&1; then
579 -               IBM_REV=4.1.1
580 +       if [ -x /usr/bin/oslevel ] ; then
581 +               IBM_REV=`/usr/bin/oslevel`
582         else
583 -               IBM_REV=4.${UNAME_RELEASE}
584 +               IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
585         fi
586         echo ${IBM_ARCH}-ibm-aix${IBM_REV}
587         exit 0 ;;
588      *:AIX:*:*)
589         echo rs6000-ibm-aix
590         exit 0 ;;
591 +    ibmrt:4.4BSD:*|romp-ibm:BSD:*)
592 +       echo romp-ibm-bsd4.4
593 +       exit 0 ;;
594 +    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
595 +       echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
596 +       exit 0 ;;                           # report: romp-ibm BSD 4.3
597      *:BOSX:*:*)
598         echo rs6000-bull-bosx
599         exit 0 ;;
600 @@ -182,18 +584,85 @@
601      hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
602         echo m68k-hp-bsd4.4
603         exit 0 ;;
604 -    9000/[3478]??:HP-UX:*:*)
605 +    9000/[34678]??:HP-UX:*:*)
606 +       HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
607         case "${UNAME_MACHINE}" in
608             9000/31? )            HP_ARCH=m68000 ;;
609             9000/[34]?? )         HP_ARCH=m68k ;;
610 -           9000/7?? | 9000/8?7 ) HP_ARCH=hppa1.1 ;;
611 -           9000/8?? )            HP_ARCH=hppa1.0 ;;
612 +           9000/[678][0-9][0-9])
613 +               if [ -x /usr/bin/getconf ]; then
614 +                   sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
615 +                    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
616 +                    case "${sc_cpu_version}" in
617 +                      523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
618 +                      528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
619 +                      532)                      # CPU_PA_RISC2_0
620 +                        case "${sc_kernel_bits}" in
621 +                          32) HP_ARCH="hppa2.0n" ;;
622 +                          64) HP_ARCH="hppa2.0w" ;;
623 +                         '') HP_ARCH="hppa2.0" ;;   # HP-UX 10.20
624 +                        esac ;;
625 +                    esac
626 +               fi
627 +               if [ "${HP_ARCH}" = "" ]; then
628 +                   eval $set_cc_for_build
629 +                   sed 's/^              //' << EOF >$dummy.c
630 +
631 +              #define _HPUX_SOURCE
632 +              #include <stdlib.h>
633 +              #include <unistd.h>
634 +
635 +              int main ()
636 +              {
637 +              #if defined(_SC_KERNEL_BITS)
638 +                  long bits = sysconf(_SC_KERNEL_BITS);
639 +              #endif
640 +                  long cpu  = sysconf (_SC_CPU_VERSION);
641 +
642 +                  switch (cpu)
643 +               {
644 +               case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
645 +               case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
646 +               case CPU_PA_RISC2_0:
647 +              #if defined(_SC_KERNEL_BITS)
648 +                   switch (bits)
649 +                       {
650 +                       case 64: puts ("hppa2.0w"); break;
651 +                       case 32: puts ("hppa2.0n"); break;
652 +                       default: puts ("hppa2.0"); break;
653 +                       } break;
654 +              #else  /* !defined(_SC_KERNEL_BITS) */
655 +                   puts ("hppa2.0"); break;
656 +              #endif
657 +               default: puts ("hppa1.0"); break;
658 +               }
659 +                  exit (0);
660 +              }
661 +EOF
662 +                   (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
663 +                   test -z "$HP_ARCH" && HP_ARCH=hppa
664 +               fi ;;
665         esac
666 -       HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
667 +       if [ ${HP_ARCH} = "hppa2.0w" ]
668 +       then
669 +           # avoid double evaluation of $set_cc_for_build
670 +           test -n "$CC_FOR_BUILD" || eval $set_cc_for_build
671 +           if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null
672 +           then
673 +               HP_ARCH="hppa2.0w"
674 +           else
675 +               HP_ARCH="hppa64"
676 +           fi
677 +       fi
678         echo ${HP_ARCH}-hp-hpux${HPUX_REV}
679         exit 0 ;;
680 +    ia64:HP-UX:*:*)
681 +       HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
682 +       echo ia64-hp-hpux${HPUX_REV}
683 +       exit 0 ;;
684      3050*:HI-UX:*:*)
685 -       sed 's/^        //' << EOF >dummy.c
686 +       eval $set_cc_for_build
687 +       sed 's/^        //' << EOF >$dummy.c
688         #include <unistd.h>
689         int
690         main ()
691 @@ -218,22 +687,34 @@
692           exit (0);
693         }
694  EOF
695 -       ${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0
696 -       rm -f dummy.c dummy
697 +       $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
698         echo unknown-hitachi-hiuxwe2
699         exit 0 ;;
700 -    9000/7??:4.3bsd:*:* | 9000/8?7:4.3bsd:*:* )
701 +    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
702         echo hppa1.1-hp-bsd
703         exit 0 ;;
704      9000/8??:4.3bsd:*:*)
705         echo hppa1.0-hp-bsd
706         exit 0 ;;
707 -    hp7??:OSF1:*:* | hp8?7:OSF1:*:* )
708 +    *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
709 +       echo hppa1.0-hp-mpeix
710 +       exit 0 ;;
711 +    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
712         echo hppa1.1-hp-osf
713         exit 0 ;;
714      hp8??:OSF1:*:*)
715         echo hppa1.0-hp-osf
716         exit 0 ;;
717 +    i*86:OSF1:*:*)
718 +       if [ -x /usr/sbin/sysversion ] ; then
719 +           echo ${UNAME_MACHINE}-unknown-osf1mk
720 +       else
721 +           echo ${UNAME_MACHINE}-unknown-osf1
722 +       fi
723 +       exit 0 ;;
724 +    parisc*:Lites*:*:*)
725 +       echo hppa1.1-hp-lites
726 +       exit 0 ;;
727      C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
728         echo c1-convex-bsd
729          exit 0 ;;
730 @@ -252,20 +733,43 @@
731      C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
732         echo c4-convex-bsd
733          exit 0 ;;
734 -    CRAY*X-MP:UNICOS:*:*)
735 -       echo xmp-cray-unicos
736 -        exit 0 ;;
737 -    CRAY*Y-MP:UNICOS:*:*)
738 -       echo ymp-cray-unicos
739 -        exit 0 ;;
740 -    CRAY-2:UNICOS:*:*)
741 -       echo cray2-cray-unicos
742 +    CRAY*Y-MP:*:*:*)
743 +       echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
744 +       exit 0 ;;
745 +    CRAY*[A-Z]90:*:*:*)
746 +       echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
747 +       | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
748 +             -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
749 +             -e 's/\.[^.]*$/.X/'
750 +       exit 0 ;;
751 +    CRAY*TS:*:*:*)
752 +       echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
753 +       exit 0 ;;
754 +    CRAY*T3E:*:*:*)
755 +       echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
756 +       exit 0 ;;
757 +    CRAY*SV1:*:*:*)
758 +       echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
759 +       exit 0 ;;
760 +    *:UNICOS/mp:*:*)
761 +       echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
762 +       exit 0 ;;
763 +    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
764 +       FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
765 +        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
766 +        FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
767 +        echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
768          exit 0 ;;
769 -    hp3[0-9][05]:NetBSD:*:*)
770 -       echo m68k-hp-netbsd${UNAME_RELEASE}
771 +    5000:UNIX_System_V:4.*:*)
772 +        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
773 +        FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
774 +        echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
775         exit 0 ;;
776 -    i[34]86:BSD/386:*:*)
777 -       echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
778 +    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
779 +       echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
780 +       exit 0 ;;
781 +    sparc*:BSD/OS:*:*)
782 +       echo sparc-unknown-bsdi${UNAME_RELEASE}
783         exit 0 ;;
784      *:BSD/OS:*:*)
785         echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
786 @@ -273,41 +777,281 @@
787      *:FreeBSD:*:*)
788         echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
789         exit 0 ;;
790 -    *:NetBSD:*:*)
791 -       echo ${UNAME_MACHINE}-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
792 +    i*:CYGWIN*:*)
793 +       echo ${UNAME_MACHINE}-pc-cygwin
794 +       exit 0 ;;
795 +    i*:MINGW*:*)
796 +       echo ${UNAME_MACHINE}-pc-mingw32
797 +       exit 0 ;;
798 +    i*:PW*:*)
799 +       echo ${UNAME_MACHINE}-pc-pw32
800 +       exit 0 ;;
801 +    x86:Interix*:[34]*)
802 +       echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//'
803 +       exit 0 ;;
804 +    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
805 +       echo i${UNAME_MACHINE}-pc-mks
806 +       exit 0 ;;
807 +    i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
808 +       # How do we know it's Interix rather than the generic POSIX subsystem?
809 +       # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
810 +       # UNAME_MACHINE based on the output of uname instead of i386?
811 +       echo i586-pc-interix
812 +       exit 0 ;;
813 +    i*:UWIN*:*)
814 +       echo ${UNAME_MACHINE}-pc-uwin
815 +       exit 0 ;;
816 +    p*:CYGWIN*:*)
817 +       echo powerpcle-unknown-cygwin
818 +       exit 0 ;;
819 +    prep*:SunOS:5.*:*)
820 +       echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
821         exit 0 ;;
822      *:GNU:*:*)
823 -       echo `echo ${UNAME_MACHINE}|sed -e 's,/.*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
824 +       # the GNU system
825 +       echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
826 +       exit 0 ;;
827 +    *:GNU/*:*:*)
828 +       # other systems with GNU libc and userland
829 +       echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
830 +       exit 0 ;;
831 +    i*86:Minix:*:*)
832 +       echo ${UNAME_MACHINE}-pc-minix
833 +       exit 0 ;;
834 +    arm*:Linux:*:*)
835 +       echo ${UNAME_MACHINE}-unknown-linux-gnu
836 +       exit 0 ;;
837 +    cris:Linux:*:*)
838 +       echo cris-axis-linux-gnu
839 +       exit 0 ;;
840 +    ia64:Linux:*:*)
841 +       echo ${UNAME_MACHINE}-unknown-linux-gnu
842 +       exit 0 ;;
843 +    m32r*:Linux:*:*)
844 +       echo ${UNAME_MACHINE}-unknown-linux-gnu
845 +       exit 0 ;;
846 +    m68*:Linux:*:*)
847 +       echo ${UNAME_MACHINE}-unknown-linux-gnu
848 +       exit 0 ;;
849 +    mips:Linux:*:*)
850 +       eval $set_cc_for_build
851 +       sed 's/^        //' << EOF >$dummy.c
852 +       #undef CPU
853 +       #undef mips
854 +       #undef mipsel
855 +       #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
856 +       CPU=mipsel
857 +       #else
858 +       #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
859 +       CPU=mips
860 +       #else
861 +       CPU=
862 +       #endif
863 +       #endif
864 +EOF
865 +       eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
866 +       test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
867 +       ;;
868 +    mips64:Linux:*:*)
869 +       eval $set_cc_for_build
870 +       sed 's/^        //' << EOF >$dummy.c
871 +       #undef CPU
872 +       #undef mips64
873 +       #undef mips64el
874 +       #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
875 +       CPU=mips64el
876 +       #else
877 +       #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
878 +       CPU=mips64
879 +       #else
880 +       CPU=
881 +       #endif
882 +       #endif
883 +EOF
884 +       eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
885 +       test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
886 +       ;;
887 +    ppc:Linux:*:*)
888 +       echo powerpc-unknown-linux-gnu
889 +       exit 0 ;;
890 +    ppc64:Linux:*:*)
891 +       echo powerpc64-unknown-linux-gnu
892 +       exit 0 ;;
893 +    alpha:Linux:*:*)
894 +       case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
895 +         EV5)   UNAME_MACHINE=alphaev5 ;;
896 +         EV56)  UNAME_MACHINE=alphaev56 ;;
897 +         PCA56) UNAME_MACHINE=alphapca56 ;;
898 +         PCA57) UNAME_MACHINE=alphapca56 ;;
899 +         EV6)   UNAME_MACHINE=alphaev6 ;;
900 +         EV67)  UNAME_MACHINE=alphaev67 ;;
901 +         EV68*) UNAME_MACHINE=alphaev68 ;;
902 +        esac
903 +       objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
904 +       if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
905 +       echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
906 +       exit 0 ;;
907 +    parisc:Linux:*:* | hppa:Linux:*:*)
908 +       # Look for CPU level
909 +       case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
910 +         PA7*) echo hppa1.1-unknown-linux-gnu ;;
911 +         PA8*) echo hppa2.0-unknown-linux-gnu ;;
912 +         *)    echo hppa-unknown-linux-gnu ;;
913 +       esac
914 +       exit 0 ;;
915 +    parisc64:Linux:*:* | hppa64:Linux:*:*)
916 +       echo hppa64-unknown-linux-gnu
917         exit 0 ;;
918 -    *:Linux:*:*)
919 -       echo ${UNAME_MACHINE}-unknown-linux
920 +    s390:Linux:*:* | s390x:Linux:*:*)
921 +       echo ${UNAME_MACHINE}-ibm-linux
922         exit 0 ;;
923 -# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.  earlier versions
924 -# are messed up and put the nodename in both sysname and nodename.
925 -    i[34]86:DYNIX/ptx:4*:*)
926 +    sh64*:Linux:*:*)
927 +       echo ${UNAME_MACHINE}-unknown-linux-gnu
928 +       exit 0 ;;
929 +    sh*:Linux:*:*)
930 +       echo ${UNAME_MACHINE}-unknown-linux-gnu
931 +       exit 0 ;;
932 +    sparc:Linux:*:* | sparc64:Linux:*:*)
933 +       echo ${UNAME_MACHINE}-unknown-linux-gnu
934 +       exit 0 ;;
935 +    x86_64:Linux:*:*)
936 +       echo x86_64-unknown-linux-gnu
937 +       exit 0 ;;
938 +    i*86:Linux:*:*)
939 +       # The BFD linker knows what the default object file format is, so
940 +       # first see if it will tell us. cd to the root directory to prevent
941 +       # problems with other programs or directories called `ld' in the path.
942 +       # Set LC_ALL=C to ensure ld outputs messages in English.
943 +       ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
944 +                        | sed -ne '/supported targets:/!d
945 +                                   s/[         ][      ]*/ /g
946 +                                   s/.*supported targets: *//
947 +                                   s/ .*//
948 +                                   p'`
949 +        case "$ld_supported_targets" in
950 +         elf32-i386)
951 +               TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
952 +               ;;
953 +         a.out-i386-linux)
954 +               echo "${UNAME_MACHINE}-pc-linux-gnuaout"
955 +               exit 0 ;;
956 +         coff-i386)
957 +               echo "${UNAME_MACHINE}-pc-linux-gnucoff"
958 +               exit 0 ;;
959 +         "")
960 +               # Either a pre-BFD a.out linker (linux-gnuoldld) or
961 +               # one that does not give us useful --help.
962 +               echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
963 +               exit 0 ;;
964 +       esac
965 +       # Determine whether the default compiler is a.out or elf
966 +       eval $set_cc_for_build
967 +       sed 's/^        //' << EOF >$dummy.c
968 +       #include <features.h>
969 +       #ifdef __ELF__
970 +       # ifdef __GLIBC__
971 +       #  if __GLIBC__ >= 2
972 +       LIBC=gnu
973 +       #  else
974 +       LIBC=gnulibc1
975 +       #  endif
976 +       # else
977 +       LIBC=gnulibc1
978 +       # endif
979 +       #else
980 +       #ifdef __INTEL_COMPILER
981 +       LIBC=gnu
982 +       #else
983 +       LIBC=gnuaout
984 +       #endif
985 +       #endif
986 +       #ifdef __dietlibc__
987 +       LIBC=dietlibc
988 +       #endif
989 +EOF
990 +       eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
991 +       test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0
992 +       test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
993 +       ;;
994 +    i*86:DYNIX/ptx:4*:*)
995 +       # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
996 +       # earlier versions are messed up and put the nodename in both
997 +       # sysname and nodename.
998         echo i386-sequent-sysv4
999         exit 0 ;;
1000 -    i[34]86:*:4.*:* | i[34]86:SYSTEM_V:4.*:*)
1001 +    i*86:UNIX_SV:4.2MP:2.*)
1002 +        # Unixware is an offshoot of SVR4, but it has its own version
1003 +        # number series starting with 2...
1004 +        # I am not positive that other SVR4 systems won't match this,
1005 +       # I just have to hope.  -- rms.
1006 +        # Use sysv4.2uw... so that sysv4* matches it.
1007 +       echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
1008 +       exit 0 ;;
1009 +    i*86:OS/2:*:*)
1010 +       # If we were able to find `uname', then EMX Unix compatibility
1011 +       # is probably installed.
1012 +       echo ${UNAME_MACHINE}-pc-os2-emx
1013 +       exit 0 ;;
1014 +    i*86:XTS-300:*:STOP)
1015 +       echo ${UNAME_MACHINE}-unknown-stop
1016 +       exit 0 ;;
1017 +    i*86:atheos:*:*)
1018 +       echo ${UNAME_MACHINE}-unknown-atheos
1019 +       exit 0 ;;
1020 +       i*86:syllable:*:*)
1021 +       echo ${UNAME_MACHINE}-pc-syllable
1022 +       exit 0 ;;
1023 +    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
1024 +       echo i386-unknown-lynxos${UNAME_RELEASE}
1025 +       exit 0 ;;
1026 +    i*86:*DOS:*:*)
1027 +       echo ${UNAME_MACHINE}-pc-msdosdjgpp
1028 +       exit 0 ;;
1029 +    i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
1030 +       UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
1031         if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
1032 -               echo ${UNAME_MACHINE}-univel-sysv${UNAME_RELEASE}
1033 +               echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
1034         else
1035 -               echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}
1036 +               echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
1037         fi
1038         exit 0 ;;
1039 -    i[34]86:*:3.2:*)
1040 -       if test -d /etc/conf/cf.d -a -f /usr/options/cb.name; then
1041 +    i*86:*:5:[78]*)
1042 +       case `/bin/uname -X | grep "^Machine"` in
1043 +           *486*)           UNAME_MACHINE=i486 ;;
1044 +           *Pentium)        UNAME_MACHINE=i586 ;;
1045 +           *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
1046 +       esac
1047 +       echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
1048 +       exit 0 ;;
1049 +    i*86:*:3.2:*)
1050 +       if test -f /usr/options/cb.name; then
1051                 UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
1052 -               echo ${UNAME_MACHINE}-unknown-isc$UNAME_REL
1053 +               echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
1054         elif /bin/uname -X 2>/dev/null >/dev/null ; then
1055 -               UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')`
1056 -               (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
1057 -               echo ${UNAME_MACHINE}-unknown-sco$UNAME_REL
1058 +               UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
1059 +               (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
1060 +               (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
1061 +                       && UNAME_MACHINE=i586
1062 +               (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
1063 +                       && UNAME_MACHINE=i686
1064 +               (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
1065 +                       && UNAME_MACHINE=i686
1066 +               echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
1067         else
1068 -               echo ${UNAME_MACHINE}-unknown-sysv32
1069 +               echo ${UNAME_MACHINE}-pc-sysv32
1070         fi
1071         exit 0 ;;
1072 +    pc:*:*:*)
1073 +       # Left here for compatibility:
1074 +        # uname -m prints for DJGPP always 'pc', but it prints nothing about
1075 +        # the processor, so we play safe by assuming i386.
1076 +       echo i386-pc-msdosdjgpp
1077 +        exit 0 ;;
1078      Intel:Mach:3*:*)
1079 -       echo i386-unknown-mach3
1080 +       echo i386-pc-mach3
1081 +       exit 0 ;;
1082 +    paragon:*:*:*)
1083 +       echo i860-intel-osf1
1084         exit 0 ;;
1085      i860:*:4.*:*) # i860-SVR4
1086         if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
1087 @@ -320,28 +1064,45 @@
1088         # "miniframe"
1089         echo m68010-convergent-sysv
1090         exit 0 ;;
1091 -    M680[234]0:*:R3V[567]*:*)
1092 +    mc68k:UNIX:SYSTEM5:3.51m)
1093 +       echo m68k-convergent-sysv
1094 +       exit 0 ;;
1095 +    M680?0:D-NIX:5.3:*)
1096 +       echo m68k-diab-dnix
1097 +       exit 0 ;;
1098 +    M68*:*:R3V[5678]*:*)
1099         test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
1100 -    3[34]??:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0)
1101 -        uname -p 2>/dev/null | grep 86 >/dev/null \
1102 -          && echo i486-ncr-sysv4.3 && exit 0 ;;
1103 +    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)
1104 +       OS_REL=''
1105 +       test -r /etc/.relid \
1106 +       && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
1107 +       /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1108 +         && echo i486-ncr-sysv4.3${OS_REL} && exit 0
1109 +       /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
1110 +         && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;;
1111      3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
1112 -        uname -p 2>/dev/null | grep 86 >/dev/null \
1113 +        /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1114            && echo i486-ncr-sysv4 && exit 0 ;;
1115 -    m680[234]0:LynxOS:2.2*:*)
1116 -       echo m68k-lynx-lynxos${UNAME_RELEASE}
1117 +    m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
1118 +       echo m68k-unknown-lynxos${UNAME_RELEASE}
1119         exit 0 ;;
1120      mc68030:UNIX_System_V:4.*:*)
1121         echo m68k-atari-sysv4
1122         exit 0 ;;
1123 -    i[34]86:LynxOS:2.2*:*)
1124 -       echo i386-lynx-lynxos${UNAME_RELEASE}
1125 +    TSUNAMI:LynxOS:2.*:*)
1126 +       echo sparc-unknown-lynxos${UNAME_RELEASE}
1127 +       exit 0 ;;
1128 +    rs6000:LynxOS:2.*:*)
1129 +       echo rs6000-unknown-lynxos${UNAME_RELEASE}
1130         exit 0 ;;
1131 -    TSUNAMI:LynxOS:2.2*:*)
1132 -       echo sparc-lynx-lynxos${UNAME_RELEASE}
1133 +    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
1134 +       echo powerpc-unknown-lynxos${UNAME_RELEASE}
1135         exit 0 ;;
1136 -    rs6000:LynxOS:2.2*:*)
1137 -       echo rs6000-lynx-lynxos${UNAME_RELEASE}
1138 +    SM[BE]S:UNIX_SV:*:*)
1139 +       echo mips-dde-sysv${UNAME_RELEASE}
1140 +       exit 0 ;;
1141 +    RM*:ReliantUNIX-*:*:*)
1142 +       echo mips-sni-sysv4
1143         exit 0 ;;
1144      RM*:SINIX-*:*:*)
1145         echo mips-sni-sysv4
1146 @@ -354,12 +1115,144 @@
1147                 echo ns32k-sni-sysv
1148         fi
1149         exit 0 ;;
1150 +    PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
1151 +                      # says <Richard.M.Bartel@ccMail.Census.GOV>
1152 +        echo i586-unisys-sysv4
1153 +        exit 0 ;;
1154 +    *:UNIX_System_V:4*:FTX*)
1155 +       # From Gerald Hewes <hewes@openmarket.com>.
1156 +       # How about differentiating between stratus architectures? -djm
1157 +       echo hppa1.1-stratus-sysv4
1158 +       exit 0 ;;
1159 +    *:*:*:FTX*)
1160 +       # From seanf@swdc.stratus.com.
1161 +       echo i860-stratus-sysv4
1162 +       exit 0 ;;
1163 +    *:VOS:*:*)
1164 +       # From Paul.Green@stratus.com.
1165 +       echo hppa1.1-stratus-vos
1166 +       exit 0 ;;
1167 +    mc68*:A/UX:*:*)
1168 +       echo m68k-apple-aux${UNAME_RELEASE}
1169 +       exit 0 ;;
1170 +    news*:NEWS-OS:6*:*)
1171 +       echo mips-sony-newsos6
1172 +       exit 0 ;;
1173 +    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
1174 +       if [ -d /usr/nec ]; then
1175 +               echo mips-nec-sysv${UNAME_RELEASE}
1176 +       else
1177 +               echo mips-unknown-sysv${UNAME_RELEASE}
1178 +       fi
1179 +        exit 0 ;;
1180 +    BeBox:BeOS:*:*)    # BeOS running on hardware made by Be, PPC only.
1181 +       echo powerpc-be-beos
1182 +       exit 0 ;;
1183 +    BeMac:BeOS:*:*)    # BeOS running on Mac or Mac clone, PPC only.
1184 +       echo powerpc-apple-beos
1185 +       exit 0 ;;
1186 +    BePC:BeOS:*:*)     # BeOS running on Intel PC compatible.
1187 +       echo i586-pc-beos
1188 +       exit 0 ;;
1189 +    SX-4:SUPER-UX:*:*)
1190 +       echo sx4-nec-superux${UNAME_RELEASE}
1191 +       exit 0 ;;
1192 +    SX-5:SUPER-UX:*:*)
1193 +       echo sx5-nec-superux${UNAME_RELEASE}
1194 +       exit 0 ;;
1195 +    SX-6:SUPER-UX:*:*)
1196 +       echo sx6-nec-superux${UNAME_RELEASE}
1197 +       exit 0 ;;
1198 +    Power*:Rhapsody:*:*)
1199 +       echo powerpc-apple-rhapsody${UNAME_RELEASE}
1200 +       exit 0 ;;
1201 +    *:Rhapsody:*:*)
1202 +       echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
1203 +       exit 0 ;;
1204 +    *:Darwin:*:*)
1205 +       UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
1206 +       case $UNAME_PROCESSOR in
1207 +           *86) UNAME_PROCESSOR=i686 ;;
1208 +           unknown) UNAME_PROCESSOR=powerpc ;;
1209 +       esac
1210 +       echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
1211 +       exit 0 ;;
1212 +    *:procnto*:*:* | *:QNX:[0123456789]*:*)
1213 +       UNAME_PROCESSOR=`uname -p`
1214 +       if test "$UNAME_PROCESSOR" = "x86"; then
1215 +               UNAME_PROCESSOR=i386
1216 +               UNAME_MACHINE=pc
1217 +       fi
1218 +       echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
1219 +       exit 0 ;;
1220 +    *:QNX:*:4*)
1221 +       echo i386-pc-qnx
1222 +       exit 0 ;;
1223 +    NSR-?:NONSTOP_KERNEL:*:*)
1224 +       echo nsr-tandem-nsk${UNAME_RELEASE}
1225 +       exit 0 ;;
1226 +    *:NonStop-UX:*:*)
1227 +       echo mips-compaq-nonstopux
1228 +       exit 0 ;;
1229 +    BS2000:POSIX*:*:*)
1230 +       echo bs2000-siemens-sysv
1231 +       exit 0 ;;
1232 +    DS/*:UNIX_System_V:*:*)
1233 +       echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
1234 +       exit 0 ;;
1235 +    *:Plan9:*:*)
1236 +       # "uname -m" is not consistent, so use $cputype instead. 386
1237 +       # is converted to i386 for consistency with other x86
1238 +       # operating systems.
1239 +       if test "$cputype" = "386"; then
1240 +           UNAME_MACHINE=i386
1241 +       else
1242 +           UNAME_MACHINE="$cputype"
1243 +       fi
1244 +       echo ${UNAME_MACHINE}-unknown-plan9
1245 +       exit 0 ;;
1246 +    *:TOPS-10:*:*)
1247 +       echo pdp10-unknown-tops10
1248 +       exit 0 ;;
1249 +    *:TENEX:*:*)
1250 +       echo pdp10-unknown-tenex
1251 +       exit 0 ;;
1252 +    KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
1253 +       echo pdp10-dec-tops20
1254 +       exit 0 ;;
1255 +    XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
1256 +       echo pdp10-xkl-tops20
1257 +       exit 0 ;;
1258 +    *:TOPS-20:*:*)
1259 +       echo pdp10-unknown-tops20
1260 +       exit 0 ;;
1261 +    *:ITS:*:*)
1262 +       echo pdp10-unknown-its
1263 +       exit 0 ;;
1264 +    SEI:*:*:SEIUX)
1265 +        echo mips-sei-seiux${UNAME_RELEASE}
1266 +       exit 0 ;;
1267 +    *:DragonFly:*:*)
1268 +       echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
1269 +       exit 0 ;;
1270 +    *:*VMS:*:*)
1271 +       UNAME_MACHINE=`(uname -p) 2>/dev/null`
1272 +       case "${UNAME_MACHINE}" in
1273 +           A*) echo alpha-dec-vms && exit 0 ;;
1274 +           I*) echo ia64-dec-vms && exit 0 ;;
1275 +           V*) echo vax-dec-vms && exit 0 ;;
1276 +       esac
1277  esac
1278  
1279  #echo '(No uname command or uname output not recognized.)' 1>&2
1280  #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
1281  
1282 -cat >dummy.c <<EOF
1283 +eval $set_cc_for_build
1284 +cat >$dummy.c <<EOF
1285 +#ifdef _SEQUENT_
1286 +# include <sys/types.h>
1287 +# include <sys/utsname.h>
1288 +#endif
1289  main ()
1290  {
1291  #if defined (sony)
1292 @@ -368,7 +1261,14 @@
1293       I don't know....  */
1294    printf ("mips-sony-bsd\n"); exit (0);
1295  #else
1296 -  printf ("m68k-sony-newsos\n"); exit (0);
1297 +#include <sys/param.h>
1298 +  printf ("m68k-sony-newsos%s\n",
1299 +#ifdef NEWSOS4
1300 +          "4"
1301 +#else
1302 +         ""
1303 +#endif
1304 +         ); exit (0);
1305  #endif
1306  #endif
1307  
1308 @@ -386,7 +1286,10 @@
1309  #endif
1310    int version;
1311    version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
1312 -  printf ("%s-next-nextstep%s\n", __ARCHITECTURE__,  version==2 ? "2" : "3");
1313 +  if (version < 4)
1314 +    printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
1315 +  else
1316 +    printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
1317    exit (0);
1318  #endif
1319  
1320 @@ -403,7 +1306,7 @@
1321  #endif
1322  
1323  #if defined (__386BSD__)
1324 -  printf ("i386-unknown-bsd\n"); exit (0);
1325 +  printf ("i386-pc-bsd\n"); exit (0);
1326  #endif
1327  
1328  #if defined (sequent)
1329 @@ -416,15 +1319,39 @@
1330  #endif
1331  
1332  #if defined (_SEQUENT_)
1333 -  printf ("i386-sequent-ptx\n"); exit (0);
1334 +    struct utsname un;
1335 +
1336 +    uname(&un);
1337 +
1338 +    if (strncmp(un.version, "V2", 2) == 0) {
1339 +       printf ("i386-sequent-ptx2\n"); exit (0);
1340 +    }
1341 +    if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
1342 +       printf ("i386-sequent-ptx1\n"); exit (0);
1343 +    }
1344 +    printf ("i386-sequent-ptx\n"); exit (0);
1345 +
1346  #endif
1347  
1348  #if defined (vax)
1349 -#if !defined (ultrix)
1350 -  printf ("vax-dec-bsd\n"); exit (0);
1351 -#else
1352 -  printf ("vax-dec-ultrix\n"); exit (0);
1353 -#endif
1354 +# if !defined (ultrix)
1355 +#  include <sys/param.h>
1356 +#  if defined (BSD)
1357 +#   if BSD == 43
1358 +      printf ("vax-dec-bsd4.3\n"); exit (0);
1359 +#   else
1360 +#    if BSD == 199006
1361 +      printf ("vax-dec-bsd4.3reno\n"); exit (0);
1362 +#    else
1363 +      printf ("vax-dec-bsd\n"); exit (0);
1364 +#    endif
1365 +#   endif
1366 +#  else
1367 +    printf ("vax-dec-bsd\n"); exit (0);
1368 +#  endif
1369 +# else
1370 +    printf ("vax-dec-ultrix\n"); exit (0);
1371 +# endif
1372  #endif
1373  
1374  #if defined (alliant) && defined (i860)
1375 @@ -435,8 +1362,7 @@
1376  }
1377  EOF
1378  
1379 -${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy && rm dummy.c dummy && exit 0
1380 -rm -f dummy.c dummy
1381 +$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0
1382  
1383  # Apollos put the system type in the environment.
1384  
1385 @@ -468,6 +1394,48 @@
1386      esac
1387  fi
1388  
1389 -#echo '(Unable to guess system type)' 1>&2
1390 +cat >&2 <<EOF
1391 +$0: unable to guess system type
1392 +
1393 +This script, last modified $timestamp, has failed to recognize
1394 +the operating system you are using. It is advised that you
1395 +download the most up to date version of the config scripts from
1396 +
1397 +    ftp://ftp.gnu.org/pub/gnu/config/
1398 +
1399 +If the version you run ($0) is already up to date, please
1400 +send the following data and any information you think might be
1401 +pertinent to <config-patches@gnu.org> in order to provide the needed
1402 +information to handle your system.
1403 +
1404 +config.guess timestamp = $timestamp
1405 +
1406 +uname -m = `(uname -m) 2>/dev/null || echo unknown`
1407 +uname -r = `(uname -r) 2>/dev/null || echo unknown`
1408 +uname -s = `(uname -s) 2>/dev/null || echo unknown`
1409 +uname -v = `(uname -v) 2>/dev/null || echo unknown`
1410 +
1411 +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
1412 +/bin/uname -X     = `(/bin/uname -X) 2>/dev/null`
1413 +
1414 +hostinfo               = `(hostinfo) 2>/dev/null`
1415 +/bin/universe          = `(/bin/universe) 2>/dev/null`
1416 +/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null`
1417 +/bin/arch              = `(/bin/arch) 2>/dev/null`
1418 +/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`
1419 +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
1420 +
1421 +UNAME_MACHINE = ${UNAME_MACHINE}
1422 +UNAME_RELEASE = ${UNAME_RELEASE}
1423 +UNAME_SYSTEM  = ${UNAME_SYSTEM}
1424 +UNAME_VERSION = ${UNAME_VERSION}
1425 +EOF
1426  
1427  exit 1
1428 +
1429 +# Local variables:
1430 +# eval: (add-hook 'write-file-hooks 'time-stamp)
1431 +# time-stamp-start: "timestamp='"
1432 +# time-stamp-format: "%:y-%02m-%02d"
1433 +# time-stamp-end: "'"
1434 +# End:
1435 diff -ru tiff.old/config.sub tiff/config.sub
1436 --- tiff.old/config.sub 1996-04-30 00:16:18.000000000 +0200
1437 +++ tiff/config.sub     2005-08-02 16:27:06.000000000 +0200
1438 @@ -1,9 +1,13 @@
1439 -#!/bin/sh
1440 -# Configuration validation subroutine script, version 1.1.
1441 -#   Copyright (C) 1991, 1992, 1993, 1994 Free Software Foundation, Inc.
1442 +#! /bin/sh
1443 +# Configuration validation subroutine script.
1444 +#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
1445 +#   2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
1446 +
1447 +timestamp='2004-06-24'
1448 +
1449  # This file is (in principle) common to ALL GNU software.
1450  # The presence of a machine in this file suggests that SOME GNU software
1451 -# can handle that machine.  It does not imply ALL GNU software can. 
1452 +# can handle that machine.  It does not imply ALL GNU software can.
1453  #
1454  # This file is free software; you can redistribute it and/or modify
1455  # it under the terms of the GNU General Public License as published by
1456 @@ -17,13 +21,17 @@
1457  #
1458  # You should have received a copy of the GNU General Public License
1459  # along with this program; if not, write to the Free Software
1460 -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
1461 +# Foundation, Inc., 59 Temple Place - Suite 330,
1462 +# Boston, MA 02111-1307, USA.
1463  
1464  # As a special exception to the GNU General Public License, if you
1465  # distribute this file as part of a program that contains a
1466  # configuration script generated by Autoconf, you may include it under
1467  # the same distribution terms that you use for the rest of that program.
1468  
1469 +# Please send patches to <config-patches@gnu.org>.  Submit a context
1470 +# diff and a properly formatted ChangeLog entry.
1471 +#
1472  # Configuration subroutine to validate and canonicalize a configuration type.
1473  # Supply the specified configuration type as an argument.
1474  # If it is invalid, we print an error message on stderr and exit with code 1.
1475 @@ -40,23 +48,88 @@
1476  # The goal of this file is to map all the various variations of a given
1477  # machine specification into a single specification in the form:
1478  #      CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
1479 +# or in some cases, the newer four-part form:
1480 +#      CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
1481  # It is wrong to echo any other type of specification.
1482  
1483 -# First pass through any local machine types.
1484 -case $1 in
1485 -       *local*)
1486 -               echo $1
1487 -               exit 0
1488 -               ;;
1489 -       *)
1490 -       ;;
1491 +me=`echo "$0" | sed -e 's,.*/,,'`
1492 +
1493 +usage="\
1494 +Usage: $0 [OPTION] CPU-MFR-OPSYS
1495 +       $0 [OPTION] ALIAS
1496 +
1497 +Canonicalize a configuration name.
1498 +
1499 +Operation modes:
1500 +  -h, --help         print this help, then exit
1501 +  -t, --time-stamp   print date of last modification, then exit
1502 +  -v, --version      print version number, then exit
1503 +
1504 +Report bugs and patches to <config-patches@gnu.org>."
1505 +
1506 +version="\
1507 +GNU config.sub ($timestamp)
1508 +
1509 +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
1510 +Free Software Foundation, Inc.
1511 +
1512 +This is free software; see the source for copying conditions.  There is NO
1513 +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
1514 +
1515 +help="
1516 +Try \`$me --help' for more information."
1517 +
1518 +# Parse command line
1519 +while test $# -gt 0 ; do
1520 +  case $1 in
1521 +    --time-stamp | --time* | -t )
1522 +       echo "$timestamp" ; exit 0 ;;
1523 +    --version | -v )
1524 +       echo "$version" ; exit 0 ;;
1525 +    --help | --h* | -h )
1526 +       echo "$usage"; exit 0 ;;
1527 +    -- )     # Stop option processing
1528 +       shift; break ;;
1529 +    - )        # Use stdin as input.
1530 +       break ;;
1531 +    -* )
1532 +       echo "$me: invalid option $1$help"
1533 +       exit 1 ;;
1534 +
1535 +    *local*)
1536 +       # First pass through any local machine types.
1537 +       echo $1
1538 +       exit 0;;
1539 +
1540 +    * )
1541 +       break ;;
1542 +  esac
1543 +done
1544 +
1545 +case $# in
1546 + 0) echo "$me: missing argument$help" >&2
1547 +    exit 1;;
1548 + 1) ;;
1549 + *) echo "$me: too many arguments$help" >&2
1550 +    exit 1;;
1551  esac
1552  
1553 -# Separate what the user gave into CPU-COMPANY and OS (if any).
1554 -basic_machine=`echo $1 | sed 's/-[^-]*$//'`
1555 -if [ $basic_machine != $1 ]
1556 -then os=`echo $1 | sed 's/.*-/-/'`
1557 -else os=; fi
1558 +# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
1559 +# Here we must recognize all the valid KERNEL-OS combinations.
1560 +maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
1561 +case $maybe_os in
1562 +  nto-qnx* | linux-gnu* | linux-dietlibc | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | \
1563 +  kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
1564 +    os=-$maybe_os
1565 +    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
1566 +    ;;
1567 +  *)
1568 +    basic_machine=`echo $1 | sed 's/-[^-]*$//'`
1569 +    if [ $basic_machine != $1 ]
1570 +    then os=`echo $1 | sed 's/.*-/-/'`
1571 +    else os=; fi
1572 +    ;;
1573 +esac
1574  
1575  ### Let's recognize common machines as not being operating systems so
1576  ### that things like config.sub decstation-3100 work.  We also
1577 @@ -71,40 +144,66 @@
1578         -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
1579         -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
1580         -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
1581 -       -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp )
1582 +       -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
1583 +       -apple | -axis | -knuth | -cray)
1584                 os=
1585                 basic_machine=$1
1586                 ;;
1587 +       -sim | -cisco | -oki | -wec | -winbond)
1588 +               os=
1589 +               basic_machine=$1
1590 +               ;;
1591 +       -scout)
1592 +               ;;
1593 +       -wrs)
1594 +               os=-vxworks
1595 +               basic_machine=$1
1596 +               ;;
1597 +       -chorusos*)
1598 +               os=-chorusos
1599 +               basic_machine=$1
1600 +               ;;
1601 +       -chorusrdb)
1602 +               os=-chorusrdb
1603 +               basic_machine=$1
1604 +               ;;
1605         -hiux*)
1606                 os=-hiuxwe2
1607                 ;;
1608 +       -sco5)
1609 +               os=-sco3.2v5
1610 +               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
1611 +               ;;
1612         -sco4)
1613                 os=-sco3.2v4
1614 -               basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'`
1615 +               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
1616                 ;;
1617         -sco3.2.[4-9]*)
1618                 os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
1619 -               basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'`
1620 +               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
1621                 ;;
1622         -sco3.2v[4-9]*)
1623                 # Don't forget version if it is 3.2v4 or newer.
1624 -               basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'`
1625 +               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
1626                 ;;
1627         -sco*)
1628                 os=-sco3.2v2
1629 -               basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'`
1630 +               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
1631 +               ;;
1632 +       -udk*)
1633 +               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
1634                 ;;
1635         -isc)
1636                 os=-isc2.2
1637 -               basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'`
1638 +               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
1639                 ;;
1640         -clix*)
1641                 basic_machine=clipper-intergraph
1642                 ;;
1643         -isc*)
1644 -               basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'`
1645 +               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
1646                 ;;
1647 -       -lynx)
1648 +       -lynx*)
1649                 os=-lynxos
1650                 ;;
1651         -ptx*)
1652 @@ -113,42 +212,165 @@
1653         -windowsnt*)
1654                 os=`echo $os | sed -e 's/windowsnt/winnt/'`
1655                 ;;
1656 +       -psos*)
1657 +               os=-psos
1658 +               ;;
1659 +       -mint | -mint[0-9]*)
1660 +               basic_machine=m68k-atari
1661 +               os=-mint
1662 +               ;;
1663  esac
1664  
1665  # Decode aliases for certain CPU-COMPANY combinations.
1666  case $basic_machine in
1667         # Recognize the basic CPU types without company name.
1668         # Some are omitted here because they have special meanings below.
1669 -       tahoe | i[345]86 | i860 | m68k | m68000 | m88k | ns32k | arm | pyramid \
1670 -               | tron | a29k | 580 | i960 | h8300 | hppa1.0 | hppa1.1 \
1671 -               | alpha | we32k | ns16k | clipper | sparclite | i370 | sh \
1672 -               | powerpc | sparc64 | 1750a | dsp16xx | mips64 | mipsel \
1673 -               | pdp11 | mips64el | mips64orion | mips64orionel )
1674 +       1750a | 580 \
1675 +       | a29k \
1676 +       | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
1677 +       | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
1678 +       | am33_2.0 \
1679 +       | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
1680 +       | c4x | clipper \
1681 +       | d10v | d30v | dlx | dsp16xx \
1682 +       | fr30 | frv \
1683 +       | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
1684 +       | i370 | i860 | i960 | ia64 \
1685 +       | ip2k | iq2000 \
1686 +       | m32r | m32rle | m68000 | m68k | m88k | mcore \
1687 +       | mips | mipsbe | mipseb | mipsel | mipsle \
1688 +       | mips16 \
1689 +       | mips64 | mips64el \
1690 +       | mips64vr | mips64vrel \
1691 +       | mips64orion | mips64orionel \
1692 +       | mips64vr4100 | mips64vr4100el \
1693 +       | mips64vr4300 | mips64vr4300el \
1694 +       | mips64vr5000 | mips64vr5000el \
1695 +       | mipsisa32 | mipsisa32el \
1696 +       | mipsisa32r2 | mipsisa32r2el \
1697 +       | mipsisa64 | mipsisa64el \
1698 +       | mipsisa64r2 | mipsisa64r2el \
1699 +       | mipsisa64sb1 | mipsisa64sb1el \
1700 +       | mipsisa64sr71k | mipsisa64sr71kel \
1701 +       | mipstx39 | mipstx39el \
1702 +       | mn10200 | mn10300 \
1703 +       | msp430 \
1704 +       | ns16k | ns32k \
1705 +       | openrisc | or32 \
1706 +       | pdp10 | pdp11 | pj | pjl \
1707 +       | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
1708 +       | pyramid \
1709 +       | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
1710 +       | sh64 | sh64le \
1711 +       | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv8 | sparcv9 | sparcv9b \
1712 +       | strongarm \
1713 +       | tahoe | thumb | tic4x | tic80 | tron \
1714 +       | v850 | v850e \
1715 +       | we32k \
1716 +       | x86 | xscale | xstormy16 | xtensa \
1717 +       | z8k)
1718 +               basic_machine=$basic_machine-unknown
1719 +               ;;
1720 +       m6811 | m68hc11 | m6812 | m68hc12)
1721 +               # Motorola 68HC11/12.
1722                 basic_machine=$basic_machine-unknown
1723 +               os=-none
1724                 ;;
1725 +       m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
1726 +               ;;
1727 +
1728 +       # We use `pc' rather than `unknown'
1729 +       # because (1) that's what they normally are, and
1730 +       # (2) the word "unknown" tends to confuse beginning users.
1731 +       i*86 | x86_64)
1732 +         basic_machine=$basic_machine-pc
1733 +         ;;
1734         # Object if more than one company name word.
1735         *-*-*)
1736                 echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
1737                 exit 1
1738                 ;;
1739         # Recognize the basic CPU types with company name.
1740 -       vax-* | tahoe-* | i[345]86-* | i860-* | m68k-* | m68000-* | m88k-* \
1741 -             | sparc-* | ns32k-* | fx80-* | arm-* | c[123]* \
1742 -             | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \
1743 -             | none-* | 580-* | cray2-* | h8300-* | i960-* | xmp-* | ymp-* \
1744 -             | hppa1.0-* | hppa1.1-* | alpha-* | we32k-* | cydra-* | ns16k-* \
1745 -             | pn-* | np1-* | xps100-* | clipper-* | orion-* | sparclite-* \
1746 -             | pdp11-* | sh-* | powerpc-* | sparc64-* | mips64-* | mipsel-* \
1747 -             | mips64el-* | mips64orion-* | mips64orionel-* )
1748 +       580-* \
1749 +       | a29k-* \
1750 +       | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
1751 +       | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
1752 +       | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
1753 +       | arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
1754 +       | avr-* \
1755 +       | bs2000-* \
1756 +       | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
1757 +       | clipper-* | craynv-* | cydra-* \
1758 +       | d10v-* | d30v-* | dlx-* \
1759 +       | elxsi-* \
1760 +       | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \
1761 +       | h8300-* | h8500-* \
1762 +       | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
1763 +       | i*86-* | i860-* | i960-* | ia64-* \
1764 +       | ip2k-* | iq2000-* \
1765 +       | m32r-* | m32rle-* \
1766 +       | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
1767 +       | m88110-* | m88k-* | mcore-* \
1768 +       | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
1769 +       | mips16-* \
1770 +       | mips64-* | mips64el-* \
1771 +       | mips64vr-* | mips64vrel-* \
1772 +       | mips64orion-* | mips64orionel-* \
1773 +       | mips64vr4100-* | mips64vr4100el-* \
1774 +       | mips64vr4300-* | mips64vr4300el-* \
1775 +       | mips64vr5000-* | mips64vr5000el-* \
1776 +       | mipsisa32-* | mipsisa32el-* \
1777 +       | mipsisa32r2-* | mipsisa32r2el-* \
1778 +       | mipsisa64-* | mipsisa64el-* \
1779 +       | mipsisa64r2-* | mipsisa64r2el-* \
1780 +       | mipsisa64sb1-* | mipsisa64sb1el-* \
1781 +       | mipsisa64sr71k-* | mipsisa64sr71kel-* \
1782 +       | mipstx39-* | mipstx39el-* \
1783 +       | mmix-* \
1784 +       | msp430-* \
1785 +       | none-* | np1-* | ns16k-* | ns32k-* \
1786 +       | orion-* \
1787 +       | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
1788 +       | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
1789 +       | pyramid-* \
1790 +       | romp-* | rs6000-* \
1791 +       | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \
1792 +       | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
1793 +       | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \
1794 +       | sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
1795 +       | tahoe-* | thumb-* \
1796 +       | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
1797 +       | tron-* \
1798 +       | v850-* | v850e-* | vax-* \
1799 +       | we32k-* \
1800 +       | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \
1801 +       | xtensa-* \
1802 +       | ymp-* \
1803 +       | z8k-*)
1804                 ;;
1805         # Recognize the various machine names and aliases which stand
1806         # for a CPU type and a company and sometimes even an OS.
1807 +       386bsd)
1808 +               basic_machine=i386-unknown
1809 +               os=-bsd
1810 +               ;;
1811         3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
1812                 basic_machine=m68000-att
1813                 ;;
1814         3b*)
1815                 basic_machine=we32k-att
1816                 ;;
1817 +       a29khif)
1818 +               basic_machine=a29k-amd
1819 +               os=-udi
1820 +               ;;
1821 +       abacus)
1822 +               basic_machine=abacus-unknown
1823 +               ;;
1824 +       adobe68k)
1825 +               basic_machine=m68010-adobe
1826 +               os=-scout
1827 +               ;;
1828         alliant | fx80)
1829                 basic_machine=fx80-alliant
1830                 ;;
1831 @@ -159,29 +381,47 @@
1832                 basic_machine=a29k-none
1833                 os=-bsd
1834                 ;;
1835 +       amd64)
1836 +               basic_machine=x86_64-pc
1837 +               ;;
1838 +       amd64-*)
1839 +               basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
1840 +               ;;
1841         amdahl)
1842                 basic_machine=580-amdahl
1843                 os=-sysv
1844                 ;;
1845         amiga | amiga-*)
1846 -               basic_machine=m68k-cbm
1847 +               basic_machine=m68k-unknown
1848                 ;;
1849 -       amigados)
1850 -               basic_machine=m68k-cbm
1851 -               os=-amigados
1852 +       amigaos | amigados)
1853 +               basic_machine=m68k-unknown
1854 +               os=-amigaos
1855                 ;;
1856         amigaunix | amix)
1857 -               basic_machine=m68k-cbm
1858 +               basic_machine=m68k-unknown
1859                 os=-sysv4
1860                 ;;
1861         apollo68)
1862                 basic_machine=m68k-apollo
1863                 os=-sysv
1864                 ;;
1865 +       apollo68bsd)
1866 +               basic_machine=m68k-apollo
1867 +               os=-bsd
1868 +               ;;
1869 +       aux)
1870 +               basic_machine=m68k-apple
1871 +               os=-aux
1872 +               ;;
1873         balance)
1874                 basic_machine=ns32k-sequent
1875                 os=-dynix
1876                 ;;
1877 +       c90)
1878 +               basic_machine=c90-cray
1879 +               os=-unicos
1880 +               ;;
1881         convex-c1)
1882                 basic_machine=c1-convex
1883                 os=-bsd
1884 @@ -202,23 +442,42 @@
1885                 basic_machine=c38-convex
1886                 os=-bsd
1887                 ;;
1888 -       cray | ymp)
1889 -               basic_machine=ymp-cray
1890 +       cray | j90)
1891 +               basic_machine=j90-cray
1892                 os=-unicos
1893                 ;;
1894 -       cray2)
1895 -               basic_machine=cray2-cray
1896 -               os=-unicos
1897 +       craynv)
1898 +               basic_machine=craynv-cray
1899 +               os=-unicosmp
1900 +               ;;
1901 +       cr16c)
1902 +               basic_machine=cr16c-unknown
1903 +               os=-elf
1904                 ;;
1905         crds | unos)
1906                 basic_machine=m68k-crds
1907                 ;;
1908 +       cris | cris-* | etrax*)
1909 +               basic_machine=cris-axis
1910 +               ;;
1911 +       crx)
1912 +               basic_machine=crx-unknown
1913 +               os=-elf
1914 +               ;;
1915         da30 | da30-*)
1916                 basic_machine=m68k-da30
1917                 ;;
1918         decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
1919                 basic_machine=mips-dec
1920                 ;;
1921 +       decsystem10* | dec10*)
1922 +               basic_machine=pdp10-dec
1923 +               os=-tops10
1924 +               ;;
1925 +       decsystem20* | dec20*)
1926 +               basic_machine=pdp10-dec
1927 +               os=-tops20
1928 +               ;;
1929         delta | 3300 | motorola-3300 | motorola-delta \
1930               | 3300-motorola | delta-motorola)
1931                 basic_machine=m68k-motorola
1932 @@ -246,6 +505,10 @@
1933         encore | umax | mmax)
1934                 basic_machine=ns32k-encore
1935                 ;;
1936 +       es1800 | OSE68k | ose68k | ose | OSE)
1937 +               basic_machine=m68k-ericsson
1938 +               os=-ose
1939 +               ;;
1940         fx2800)
1941                 basic_machine=i860-alliant
1942                 ;;
1943 @@ -256,6 +519,10 @@
1944                 basic_machine=tron-gmicro
1945                 os=-sysv
1946                 ;;
1947 +       go32)
1948 +               basic_machine=i386-pc
1949 +               os=-go32
1950 +               ;;
1951         h3050r* | hiux*)
1952                 basic_machine=hppa1.1-hitachi
1953                 os=-hiuxwe2
1954 @@ -264,6 +531,14 @@
1955                 basic_machine=h8300-hitachi
1956                 os=-hms
1957                 ;;
1958 +       h8300xray)
1959 +               basic_machine=h8300-hitachi
1960 +               os=-xray
1961 +               ;;
1962 +       h8500hms)
1963 +               basic_machine=h8500-hitachi
1964 +               os=-hms
1965 +               ;;
1966         harris)
1967                 basic_machine=m88k-harris
1968                 os=-sysv3
1969 @@ -279,39 +554,74 @@
1970                 basic_machine=m68k-hp
1971                 os=-hpux
1972                 ;;
1973 +       hp3k9[0-9][0-9] | hp9[0-9][0-9])
1974 +               basic_machine=hppa1.0-hp
1975 +               ;;
1976         hp9k2[0-9][0-9] | hp9k31[0-9])
1977                 basic_machine=m68000-hp
1978                 ;;
1979         hp9k3[2-9][0-9])
1980                 basic_machine=m68k-hp
1981                 ;;
1982 -       hp9k7[0-9][0-9] | hp7[0-9][0-9] | hp9k8[0-9]7 | hp8[0-9]7)
1983 +       hp9k6[0-9][0-9] | hp6[0-9][0-9])
1984 +               basic_machine=hppa1.0-hp
1985 +               ;;
1986 +       hp9k7[0-79][0-9] | hp7[0-79][0-9])
1987 +               basic_machine=hppa1.1-hp
1988 +               ;;
1989 +       hp9k78[0-9] | hp78[0-9])
1990 +               # FIXME: really hppa2.0-hp
1991 +               basic_machine=hppa1.1-hp
1992 +               ;;
1993 +       hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
1994 +               # FIXME: really hppa2.0-hp
1995 +               basic_machine=hppa1.1-hp
1996 +               ;;
1997 +       hp9k8[0-9][13679] | hp8[0-9][13679])
1998                 basic_machine=hppa1.1-hp
1999                 ;;
2000         hp9k8[0-9][0-9] | hp8[0-9][0-9])
2001                 basic_machine=hppa1.0-hp
2002                 ;;
2003 +       hppa-next)
2004 +               os=-nextstep3
2005 +               ;;
2006 +       hppaosf)
2007 +               basic_machine=hppa1.1-hp
2008 +               os=-osf
2009 +               ;;
2010 +       hppro)
2011 +               basic_machine=hppa1.1-hp
2012 +               os=-proelf
2013 +               ;;
2014         i370-ibm* | ibm*)
2015                 basic_machine=i370-ibm
2016 -               os=-mvs
2017                 ;;
2018  # I'm not sure what "Sysv32" means.  Should this be sysv3.2?
2019 -       i[345]86v32)
2020 -               basic_machine=`echo $1 | sed -e 's/86.*/86-unknown/'`
2021 +       i*86v32)
2022 +               basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
2023                 os=-sysv32
2024                 ;;
2025 -       i[345]86v4*)
2026 -               basic_machine=`echo $1 | sed -e 's/86.*/86-unknown/'`
2027 +       i*86v4*)
2028 +               basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
2029                 os=-sysv4
2030                 ;;
2031 -       i[345]86v)
2032 -               basic_machine=`echo $1 | sed -e 's/86.*/86-unknown/'`
2033 +       i*86v)
2034 +               basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
2035                 os=-sysv
2036                 ;;
2037 -       i[345]86sol2)
2038 -               basic_machine=`echo $1 | sed -e 's/86.*/86-unknown/'`
2039 +       i*86sol2)
2040 +               basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
2041                 os=-solaris2
2042                 ;;
2043 +       i386mach)
2044 +               basic_machine=i386-mach
2045 +               os=-mach
2046 +               ;;
2047 +       i386-vsta | vsta)
2048 +               basic_machine=i386-unknown
2049 +               os=-vsta
2050 +               ;;
2051         iris | iris4d)
2052                 basic_machine=mips-sgi
2053                 case $os in
2054 @@ -337,19 +647,51 @@
2055                 basic_machine=ns32k-utek
2056                 os=-sysv
2057                 ;;
2058 +       mingw32)
2059 +               basic_machine=i386-pc
2060 +               os=-mingw32
2061 +               ;;
2062         miniframe)
2063                 basic_machine=m68000-convergent
2064                 ;;
2065 +       *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
2066 +               basic_machine=m68k-atari
2067 +               os=-mint
2068 +               ;;
2069         mips3*-*)
2070                 basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
2071                 ;;
2072         mips3*)
2073                 basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
2074                 ;;
2075 +       monitor)
2076 +               basic_machine=m68k-rom68k
2077 +               os=-coff
2078 +               ;;
2079 +       morphos)
2080 +               basic_machine=powerpc-unknown
2081 +               os=-morphos
2082 +               ;;
2083 +       msdos)
2084 +               basic_machine=i386-pc
2085 +               os=-msdos
2086 +               ;;
2087 +       mvs)
2088 +               basic_machine=i370-ibm
2089 +               os=-mvs
2090 +               ;;
2091         ncr3000)
2092                 basic_machine=i486-ncr
2093                 os=-sysv4
2094                 ;;
2095 +       netbsd386)
2096 +               basic_machine=i386-unknown
2097 +               os=-netbsd
2098 +               ;;
2099 +       netwinder)
2100 +               basic_machine=armv4l-rebel
2101 +               os=-linux
2102 +               ;;
2103         news | news700 | news800 | news900)
2104                 basic_machine=m68k-sony
2105                 os=-newsos
2106 @@ -362,6 +704,10 @@
2107                 basic_machine=mips-sony
2108                 os=-newsos
2109                 ;;
2110 +       necv70)
2111 +               basic_machine=v70-nec
2112 +               os=-sysv
2113 +               ;;
2114         next | m*-next )
2115                 basic_machine=m68k-next
2116                 case $os in
2117 @@ -387,9 +733,40 @@
2118                 basic_machine=i960-intel
2119                 os=-nindy
2120                 ;;
2121 +       mon960)
2122 +               basic_machine=i960-intel
2123 +               os=-mon960
2124 +               ;;
2125 +       nonstopux)
2126 +               basic_machine=mips-compaq
2127 +               os=-nonstopux
2128 +               ;;
2129         np1)
2130                 basic_machine=np1-gould
2131                 ;;
2132 +       nsr-tandem)
2133 +               basic_machine=nsr-tandem
2134 +               ;;
2135 +       op50n-* | op60c-*)
2136 +               basic_machine=hppa1.1-oki
2137 +               os=-proelf
2138 +               ;;
2139 +       or32 | or32-*)
2140 +               basic_machine=or32-unknown
2141 +               os=-coff
2142 +               ;;
2143 +       os400)
2144 +               basic_machine=powerpc-ibm
2145 +               os=-os400
2146 +               ;;
2147 +       OSE68000 | ose68000)
2148 +               basic_machine=m68000-ericsson
2149 +               os=-ose
2150 +               ;;
2151 +       os68k)
2152 +               basic_machine=m68k-none
2153 +               os=-os68k
2154 +               ;;
2155         pa-hitachi)
2156                 basic_machine=hppa1.1-hitachi
2157                 os=-hiuxwe2
2158 @@ -404,23 +781,95 @@
2159         pbb)
2160                 basic_machine=m68k-tti
2161                 ;;
2162 -        pc532 | pc532-*)
2163 +       pc532 | pc532-*)
2164                 basic_machine=ns32k-pc532
2165                 ;;
2166 -       pentium-*)
2167 -               # We will change tis to say i586 once there has been
2168 -               # time for various packages to start to recognize that.
2169 -               basic_machine=i486-`echo $basic_machine | sed 's/^[^-]*-//'`
2170 +       pentium | p5 | k5 | k6 | nexgen | viac3)
2171 +               basic_machine=i586-pc
2172 +               ;;
2173 +       pentiumpro | p6 | 6x86 | athlon | athlon_*)
2174 +               basic_machine=i686-pc
2175 +               ;;
2176 +       pentiumii | pentium2 | pentiumiii | pentium3)
2177 +               basic_machine=i686-pc
2178 +               ;;
2179 +       pentium4)
2180 +               basic_machine=i786-pc
2181 +               ;;
2182 +       pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
2183 +               basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
2184 +               ;;
2185 +       pentiumpro-* | p6-* | 6x86-* | athlon-*)
2186 +               basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
2187 +               ;;
2188 +       pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
2189 +               basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
2190 +               ;;
2191 +       pentium4-*)
2192 +               basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
2193                 ;;
2194         pn)
2195                 basic_machine=pn-gould
2196                 ;;
2197 +       power)  basic_machine=power-ibm
2198 +               ;;
2199 +       ppc)    basic_machine=powerpc-unknown
2200 +               ;;
2201 +       ppc-*)  basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
2202 +               ;;
2203 +       ppcle | powerpclittle | ppc-le | powerpc-little)
2204 +               basic_machine=powerpcle-unknown
2205 +               ;;
2206 +       ppcle-* | powerpclittle-*)
2207 +               basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
2208 +               ;;
2209 +       ppc64)  basic_machine=powerpc64-unknown
2210 +               ;;
2211 +       ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
2212 +               ;;
2213 +       ppc64le | powerpc64little | ppc64-le | powerpc64-little)
2214 +               basic_machine=powerpc64le-unknown
2215 +               ;;
2216 +       ppc64le-* | powerpc64little-*)
2217 +               basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
2218 +               ;;
2219         ps2)
2220                 basic_machine=i386-ibm
2221                 ;;
2222 +       pw32)
2223 +               basic_machine=i586-unknown
2224 +               os=-pw32
2225 +               ;;
2226 +       rom68k)
2227 +               basic_machine=m68k-rom68k
2228 +               os=-coff
2229 +               ;;
2230 +       rm[46]00)
2231 +               basic_machine=mips-siemens
2232 +               ;;
2233         rtpc | rtpc-*)
2234                 basic_machine=romp-ibm
2235                 ;;
2236 +       s390 | s390-*)
2237 +               basic_machine=s390-ibm
2238 +               ;;
2239 +       s390x | s390x-*)
2240 +               basic_machine=s390x-ibm
2241 +               ;;
2242 +       sa29200)
2243 +               basic_machine=a29k-amd
2244 +               os=-udi
2245 +               ;;
2246 +       sb1)
2247 +               basic_machine=mipsisa64sb1-unknown
2248 +               ;;
2249 +       sb1el)
2250 +               basic_machine=mipsisa64sb1el-unknown
2251 +               ;;
2252 +       sei)
2253 +               basic_machine=mips-sei
2254 +               os=-seiux
2255 +               ;;
2256         sequent)
2257                 basic_machine=i386-sequent
2258                 ;;
2259 @@ -428,6 +877,13 @@
2260                 basic_machine=sh-hitachi
2261                 os=-hms
2262                 ;;
2263 +       sh64)
2264 +               basic_machine=sh64-unknown
2265 +               ;;
2266 +       sparclite-wrs | simso-wrs)
2267 +               basic_machine=sparclite-wrs
2268 +               os=-vxworks
2269 +               ;;
2270         sps7)
2271                 basic_machine=m68k-bull
2272                 os=-sysv2
2273 @@ -435,6 +891,13 @@
2274         spur)
2275                 basic_machine=spur-unknown
2276                 ;;
2277 +       st2000)
2278 +               basic_machine=m68k-tandem
2279 +               ;;
2280 +       stratus)
2281 +               basic_machine=i860-stratus
2282 +               os=-sysv4
2283 +               ;;
2284         sun2)
2285                 basic_machine=m68000-sun
2286                 ;;
2287 @@ -462,6 +925,10 @@
2288                 basic_machine=sparc-sun
2289                 os=-sunos4
2290                 ;;
2291 +       sun4sol2)
2292 +               basic_machine=sparc-sun
2293 +               os=-solaris2
2294 +               ;;
2295         sun3 | sun3-*)
2296                 basic_machine=m68k-sun
2297                 ;;
2298 @@ -471,17 +938,63 @@
2299         sun386 | sun386i | roadrunner)
2300                 basic_machine=i386-sun
2301                 ;;
2302 +       sv1)
2303 +               basic_machine=sv1-cray
2304 +               os=-unicos
2305 +               ;;
2306         symmetry)
2307                 basic_machine=i386-sequent
2308                 os=-dynix
2309                 ;;
2310 +       t3e)
2311 +               basic_machine=alphaev5-cray
2312 +               os=-unicos
2313 +               ;;
2314 +       t90)
2315 +               basic_machine=t90-cray
2316 +               os=-unicos
2317 +               ;;
2318 +       tic54x | c54x*)
2319 +               basic_machine=tic54x-unknown
2320 +               os=-coff
2321 +               ;;
2322 +       tic55x | c55x*)
2323 +               basic_machine=tic55x-unknown
2324 +               os=-coff
2325 +               ;;
2326 +       tic6x | c6x*)
2327 +               basic_machine=tic6x-unknown
2328 +               os=-coff
2329 +               ;;
2330 +       tx39)
2331 +               basic_machine=mipstx39-unknown
2332 +               ;;
2333 +       tx39el)
2334 +               basic_machine=mipstx39el-unknown
2335 +               ;;
2336 +       toad1)
2337 +               basic_machine=pdp10-xkl
2338 +               os=-tops20
2339 +               ;;
2340         tower | tower-32)
2341                 basic_machine=m68k-ncr
2342                 ;;
2343 +       tpf)
2344 +               basic_machine=s390x-ibm
2345 +               os=-tpf
2346 +               ;;
2347 +       udi29k)
2348 +               basic_machine=a29k-amd
2349 +               os=-udi
2350 +               ;;
2351         ultra3)
2352                 basic_machine=a29k-nyu
2353                 os=-sym1
2354                 ;;
2355 +       v810 | necv810)
2356 +               basic_machine=v810-nec
2357 +               os=-none
2358 +               ;;
2359         vaxv)
2360                 basic_machine=vax-dec
2361                 os=-sysv
2362 @@ -490,6 +1003,9 @@
2363                 basic_machine=vax-dec
2364                 os=-vms
2365                 ;;
2366 +       vpp*|vx|vx-*)
2367 +               basic_machine=f301-fujitsu
2368 +               ;;
2369         vxworks960)
2370                 basic_machine=i960-wrs
2371                 os=-vxworks
2372 @@ -498,13 +1014,29 @@
2373                 basic_machine=m68k-wrs
2374                 os=-vxworks
2375                 ;;
2376 -       xmp)
2377 -               basic_machine=xmp-cray
2378 -               os=-unicos
2379 +       vxworks29k)
2380 +               basic_machine=a29k-wrs
2381 +               os=-vxworks
2382 +               ;;
2383 +       w65*)
2384 +               basic_machine=w65-wdc
2385 +               os=-none
2386 +               ;;
2387 +       w89k-*)
2388 +               basic_machine=hppa1.1-winbond
2389 +               os=-proelf
2390                 ;;
2391 -        xps | xps100)
2392 +       xps | xps100)
2393                 basic_machine=xps100-honeywell
2394                 ;;
2395 +       ymp)
2396 +               basic_machine=ymp-cray
2397 +               os=-unicos
2398 +               ;;
2399 +       z8k-*-coff)
2400 +               basic_machine=z8k-unknown
2401 +               os=-sim
2402 +               ;;
2403         none)
2404                 basic_machine=none-none
2405                 os=-none
2406 @@ -512,28 +1044,47 @@
2407  
2408  # Here we handle the default manufacturer of certain CPU types.  It is in
2409  # some cases the only manufacturer, in others, it is the most popular.
2410 -       mips)
2411 -               basic_machine=mips-mips
2412 +       w89k)
2413 +               basic_machine=hppa1.1-winbond
2414 +               ;;
2415 +       op50n)
2416 +               basic_machine=hppa1.1-oki
2417 +               ;;
2418 +       op60c)
2419 +               basic_machine=hppa1.1-oki
2420                 ;;
2421         romp)
2422                 basic_machine=romp-ibm
2423                 ;;
2424 +       mmix)
2425 +               basic_machine=mmix-knuth
2426 +               ;;
2427         rs6000)
2428                 basic_machine=rs6000-ibm
2429                 ;;
2430         vax)
2431                 basic_machine=vax-dec
2432                 ;;
2433 +       pdp10)
2434 +               # there are many clones, so DEC is not a safe bet
2435 +               basic_machine=pdp10-unknown
2436 +               ;;
2437         pdp11)
2438                 basic_machine=pdp11-dec
2439                 ;;
2440         we32k)
2441                 basic_machine=we32k-att
2442                 ;;
2443 -       sparc)
2444 +       sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele)
2445 +               basic_machine=sh-unknown
2446 +               ;;
2447 +       sh64)
2448 +               basic_machine=sh64-unknown
2449 +               ;;
2450 +       sparc | sparcv8 | sparcv9 | sparcv9b)
2451                 basic_machine=sparc-sun
2452                 ;;
2453 -        cydra)
2454 +       cydra)
2455                 basic_machine=cydra-cydrome
2456                 ;;
2457         orion)
2458 @@ -542,6 +1093,15 @@
2459         orion105)
2460                 basic_machine=clipper-highlevel
2461                 ;;
2462 +       mac | mpw | mac-mpw)
2463 +               basic_machine=m68k-apple
2464 +               ;;
2465 +       pmac | pmac-mpw)
2466 +               basic_machine=powerpc-apple
2467 +               ;;
2468 +       *-unknown)
2469 +               # Make sure to match an already-canonicalized machine name.
2470 +               ;;
2471         *)
2472                 echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
2473                 exit 1
2474 @@ -565,6 +1125,8 @@
2475  if [ x"$os" != x"" ]
2476  then
2477  case $os in
2478 +        # First match some system type aliases
2479 +        # that might get confused with valid system types.
2480         # -solaris* is a basic system type, with this one exception.
2481         -solaris1 | -solaris1.*)
2482                 os=`echo $os | sed -e 's|solaris1|sunos4|'`
2483 @@ -572,22 +1134,68 @@
2484         -solaris)
2485                 os=-solaris2
2486                 ;;
2487 +       -svr4*)
2488 +               os=-sysv4
2489 +               ;;
2490 +       -unixware*)
2491 +               os=-sysv4.2uw
2492 +               ;;
2493         -gnu/linux*)
2494 -               os=`echo $os | sed -e 's|gnu/linux|linux|'`
2495 +               os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
2496                 ;;
2497         # First accept the basic system types.
2498         # The portable systems comes first.
2499 -       # Each alternative must end in a *, to match a version number.
2500 +       # Each alternative MUST END IN A *, to match a version number.
2501         # -sysv* is not here because it comes later, after sysvr4.
2502         -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
2503 -             | -vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[345]* \
2504 +             | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
2505               | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
2506 -             | -amigados* | -msdos* | -newsos* | -unicos* | -aos* \
2507 -             | -nindy* | -vxworks* | -ebmon* | -hms* | -mvs* | -clix* \
2508 -             | -riscos* | -linux* | -uniplus* | -iris* | -rtu* | -xenix* \
2509 -             | -hiux* | -386bsd* | -netbsd* | -freebsd* | -riscix* \
2510 -             | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* \
2511 -             | -ptx* | -coff* | -winnt*)
2512 +             | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
2513 +             | -aos* \
2514 +             | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
2515 +             | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
2516 +             | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* | -openbsd* \
2517 +             | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
2518 +             | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
2519 +             | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
2520 +             | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
2521 +             | -chorusos* | -chorusrdb* \
2522 +             | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
2523 +             | -mingw32* | -linux-gnu* | -linux-uclibc* | -uxpv* | -beos* | -mpeix* | -udk* \
2524 +             | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
2525 +             | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
2526 +             | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
2527 +             | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
2528 +             | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
2529 +             | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly*)
2530 +       # Remember, each alternative MUST END IN *, to match a version number.
2531 +               ;;
2532 +       -qnx*)
2533 +               case $basic_machine in
2534 +                   x86-* | i*86-*)
2535 +                       ;;
2536 +                   *)
2537 +                       os=-nto$os
2538 +                       ;;
2539 +               esac
2540 +               ;;
2541 +       -nto-qnx*)
2542 +               ;;
2543 +       -nto*)
2544 +               os=`echo $os | sed -e 's|nto|nto-qnx|'`
2545 +               ;;
2546 +       -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
2547 +             | -windows* | -osx | -abug | -netware* | -os9* | -beos* \
2548 +             | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
2549 +               ;;
2550 +       -mac*)
2551 +               os=`echo $os | sed -e 's|mac|macos|'`
2552 +               ;;
2553 +       -linux-dietlibc)
2554 +               os=-linux-dietlibc
2555 +               ;;
2556 +       -linux*)
2557 +               os=`echo $os | sed -e 's|linux|linux-gnu|'`
2558                 ;;
2559         -sunos5*)
2560                 os=`echo $os | sed -e 's|sunos5|solaris2|'`
2561 @@ -595,6 +1203,15 @@
2562         -sunos6*)
2563                 os=`echo $os | sed -e 's|sunos6|solaris3|'`
2564                 ;;
2565 +       -opened*)
2566 +               os=-openedition
2567 +               ;;
2568 +        -os400*)
2569 +               os=-os400
2570 +               ;;
2571 +       -wince*)
2572 +               os=-wince
2573 +               ;;
2574         -osfrose*)
2575                 os=-osfrose
2576                 ;;
2577 @@ -610,9 +1227,37 @@
2578         -acis*)
2579                 os=-aos
2580                 ;;
2581 +       -atheos*)
2582 +               os=-atheos
2583 +               ;;
2584 +       -syllable*)
2585 +               os=-syllable
2586 +               ;;
2587 +       -386bsd)
2588 +               os=-bsd
2589 +               ;;
2590         -ctix* | -uts*)
2591                 os=-sysv
2592                 ;;
2593 +       -nova*)
2594 +               os=-rtmk-nova
2595 +               ;;
2596 +       -ns2 )
2597 +               os=-nextstep2
2598 +               ;;
2599 +       -nsk*)
2600 +               os=-nsk
2601 +               ;;
2602 +       # Preserve the version number of sinix5.
2603 +       -sinix5.*)
2604 +               os=`echo $os | sed -e 's|sinix|sysv|'`
2605 +               ;;
2606 +       -sinix*)
2607 +               os=-sysv4
2608 +               ;;
2609 +        -tpf*)
2610 +               os=-tpf
2611 +               ;;
2612         -triton*)
2613                 os=-sysv3
2614                 ;;
2615 @@ -631,9 +1276,24 @@
2616         # This must come after -sysvr4.
2617         -sysv*)
2618                 ;;
2619 +       -ose*)
2620 +               os=-ose
2621 +               ;;
2622 +       -es1800*)
2623 +               os=-ose
2624 +               ;;
2625         -xenix)
2626                 os=-xenix
2627                 ;;
2628 +       -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
2629 +               os=-mint
2630 +               ;;
2631 +       -aros*)
2632 +               os=-aros
2633 +               ;;
2634 +       -kaos*)
2635 +               os=-kaos
2636 +               ;;
2637         -none)
2638                 ;;
2639         *)
2640 @@ -659,12 +1319,28 @@
2641         *-acorn)
2642                 os=-riscix1.2
2643                 ;;
2644 -        pdp11-*)
2645 +       arm*-rebel)
2646 +               os=-linux
2647 +               ;;
2648 +       arm*-semi)
2649 +               os=-aout
2650 +               ;;
2651 +    c4x-* | tic4x-*)
2652 +        os=-coff
2653 +        ;;
2654 +       # This must come before the *-dec entry.
2655 +       pdp10-*)
2656 +               os=-tops20
2657 +               ;;
2658 +       pdp11-*)
2659                 os=-none
2660                 ;;
2661         *-dec | vax-*)
2662                 os=-ultrix4.2
2663                 ;;
2664 +       m68*-apollo)
2665 +               os=-domain
2666 +               ;;
2667         i386-sun)
2668                 os=-sunos4.0.2
2669                 ;;
2670 @@ -674,15 +1350,42 @@
2671                 # default.
2672                 # os=-sunos4
2673                 ;;
2674 +       m68*-cisco)
2675 +               os=-aout
2676 +               ;;
2677 +       mips*-cisco)
2678 +               os=-elf
2679 +               ;;
2680 +       mips*-*)
2681 +               os=-elf
2682 +               ;;
2683 +       or32-*)
2684 +               os=-coff
2685 +               ;;
2686         *-tti)  # must be before sparc entry or we get the wrong os.
2687                 os=-sysv3
2688                 ;;
2689         sparc-* | *-sun)
2690                 os=-sunos4.1.1
2691                 ;;
2692 +       *-be)
2693 +               os=-beos
2694 +               ;;
2695         *-ibm)
2696                 os=-aix
2697                 ;;
2698 +       *-knuth)
2699 +               os=-mmixware
2700 +               ;;
2701 +       *-wec)
2702 +               os=-proelf
2703 +               ;;
2704 +       *-winbond)
2705 +               os=-proelf
2706 +               ;;
2707 +       *-oki)
2708 +               os=-proelf
2709 +               ;;
2710         *-hp)
2711                 os=-hpux
2712                 ;;
2713 @@ -693,7 +1396,7 @@
2714                 os=-sysv
2715                 ;;
2716         *-cbm)
2717 -               os=-amigados
2718 +               os=-amigaos
2719                 ;;
2720         *-dg)
2721                 os=-dgux
2722 @@ -707,6 +1410,9 @@
2723         m88k-omron*)
2724                 os=-luna
2725                 ;;
2726 +       *-next )
2727 +               os=-nextstep
2728 +               ;;
2729         *-sequent)
2730                 os=-ptx
2731                 ;;
2732 @@ -722,21 +1428,39 @@
2733         *-next)
2734                 os=-nextstep3
2735                 ;;
2736 -        *-gould)
2737 +       *-gould)
2738                 os=-sysv
2739                 ;;
2740 -        *-highlevel)
2741 +       *-highlevel)
2742                 os=-bsd
2743                 ;;
2744         *-encore)
2745                 os=-bsd
2746                 ;;
2747 -        *-sgi)
2748 +       *-sgi)
2749                 os=-irix
2750                 ;;
2751 +       *-siemens)
2752 +               os=-sysv4
2753 +               ;;
2754         *-masscomp)
2755                 os=-rtu
2756                 ;;
2757 +       f30[01]-fujitsu | f700-fujitsu)
2758 +               os=-uxpv
2759 +               ;;
2760 +       *-rom68k)
2761 +               os=-coff
2762 +               ;;
2763 +       *-*bug)
2764 +               os=-coff
2765 +               ;;
2766 +       *-apple)
2767 +               os=-macos
2768 +               ;;
2769 +       *-atari*)
2770 +               os=-mint
2771 +               ;;
2772         *)
2773                 os=-none
2774                 ;;
2775 @@ -755,15 +1479,18 @@
2776                         -sunos*)
2777                                 vendor=sun
2778                                 ;;
2779 -                       -lynxos*)
2780 -                               vendor=lynx
2781 -                               ;;
2782                         -aix*)
2783                                 vendor=ibm
2784                                 ;;
2785 +                       -beos*)
2786 +                               vendor=be
2787 +                               ;;
2788                         -hpux*)
2789                                 vendor=hp
2790                                 ;;
2791 +                       -mpeix*)
2792 +                               vendor=hp
2793 +                               ;;
2794                         -hiux*)
2795                                 vendor=hitachi
2796                                 ;;
2797 @@ -779,15 +1506,47 @@
2798                         -genix*)
2799                                 vendor=ns
2800                                 ;;
2801 -                       -mvs*)
2802 +                       -mvs* | -opened*)
2803 +                               vendor=ibm
2804 +                               ;;
2805 +                       -os400*)
2806                                 vendor=ibm
2807                                 ;;
2808                         -ptx*)
2809                                 vendor=sequent
2810                                 ;;
2811 +                       -tpf*)
2812 +                               vendor=ibm
2813 +                               ;;
2814 +                       -vxsim* | -vxworks* | -windiss*)
2815 +                               vendor=wrs
2816 +                               ;;
2817 +                       -aux*)
2818 +                               vendor=apple
2819 +                               ;;
2820 +                       -hms*)
2821 +                               vendor=hitachi
2822 +                               ;;
2823 +                       -mpw* | -macos*)
2824 +                               vendor=apple
2825 +                               ;;
2826 +                       -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
2827 +                               vendor=atari
2828 +                               ;;
2829 +                       -vos*)
2830 +                               vendor=stratus
2831 +                               ;;
2832                 esac
2833                 basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
2834                 ;;
2835  esac
2836  
2837  echo $basic_machine$os
2838 +exit 0
2839 +
2840 +# Local variables:
2841 +# eval: (add-hook 'write-file-hooks 'time-stamp)
2842 +# time-stamp-start: "timestamp='"
2843 +# time-stamp-format: "%:y-%02m-%02d"
2844 +# time-stamp-end: "'"
2845 +# End: