root/trunk/ports/net/libhesiod/files/patch-config.guess

Revision 2, 54.6 kB (checked in by broder, 17 years ago)

Adding the ports that I've built so far - libhesiod, hesiod, and moira.

Hesiod and libhesiod should probably be submitted upstream to the MacPorts repository instead of ours.

Also, libhesiod doesn't compile as a universal library because libtool hates people

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