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