Blame SOURCES/lrzsz-0.12.20-aarch64.patch

7b3a8b
diff -urN lrzsz-0.12.20/config.guess lrzsz-0.12.20-aarch64/config.guess
7b3a8b
--- lrzsz-0.12.20/config.guess	1998-04-26 08:20:59.000000000 -0500
7b3a8b
+++ lrzsz-0.12.20-aarch64/config.guess	2013-03-03 06:20:16.398781457 -0600
7b3a8b
@@ -1,7 +1,11 @@
7b3a8b
 #! /bin/sh
7b3a8b
 # Attempt to guess a canonical system name.
7b3a8b
-#   Copyright (C) 1992, 93, 94, 95, 1996 Free Software Foundation, Inc.
7b3a8b
-#
7b3a8b
+#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
7b3a8b
+#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
7b3a8b
+#   2011, 2012 Free Software Foundation, Inc.
7b3a8b
+
7b3a8b
+timestamp='2012-09-25'
7b3a8b
+
7b3a8b
 # This file is free software; you can redistribute it and/or modify it
7b3a8b
 # under the terms of the GNU General Public License as published by
7b3a8b
 # the Free Software Foundation; either version 2 of the License, or
7b3a8b
@@ -13,82 +17,353 @@
7b3a8b
 # General Public License for more details.
7b3a8b
 #
7b3a8b
 # You should have received a copy of the GNU General Public License
7b3a8b
-# along with this program; if not, write to the Free Software
7b3a8b
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
7b3a8b
+# along with this program; if not, see <http://www.gnu.org/licenses/>.
7b3a8b
 #
7b3a8b
 # As a special exception to the GNU General Public License, if you
7b3a8b
 # distribute this file as part of a program that contains a
7b3a8b
 # configuration script generated by Autoconf, you may include it under
7b3a8b
 # the same distribution terms that you use for the rest of that program.
7b3a8b
 
7b3a8b
-# Written by Per Bothner <bothner@cygnus.com>.
7b3a8b
-# The master version of this file is at the FSF in /home/gd/gnu/lib.
7b3a8b
+
7b3a8b
+# Originally written by Per Bothner.  Please send patches (context
7b3a8b
+# diff format) to <config-patches@gnu.org> and include a ChangeLog
7b3a8b
+# entry.
7b3a8b
 #
7b3a8b
 # This script attempts to guess a canonical system name similar to
7b3a8b
 # config.sub.  If it succeeds, it prints the system name on stdout, and
7b3a8b
 # exits with 0.  Otherwise, it exits with 1.
7b3a8b
 #
7b3a8b
-# The plan is that this can be called by configure scripts if you
7b3a8b
-# don't specify an explicit system type (host/target name).
7b3a8b
-#
7b3a8b
-# Only a few systems have been added to this list; please add others
7b3a8b
-# (but try to keep the structure clean).
7b3a8b
-#
7b3a8b
+# You can get the latest version of this script from:
7b3a8b
+# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
7b3a8b
+
7b3a8b
+me=`echo "$0" | sed -e 's,.*/,,'`
7b3a8b
+
7b3a8b
+usage="\
7b3a8b
+Usage: $0 [OPTION]
7b3a8b
+
7b3a8b
+Output the configuration name of the system \`$me' is run on.
7b3a8b
+
7b3a8b
+Operation modes:
7b3a8b
+  -h, --help         print this help, then exit
7b3a8b
+  -t, --time-stamp   print date of last modification, then exit
7b3a8b
+  -v, --version      print version number, then exit
7b3a8b
+
7b3a8b
+Report bugs and patches to <config-patches@gnu.org>."
7b3a8b
+
7b3a8b
+version="\
7b3a8b
+GNU config.guess ($timestamp)
7b3a8b
+
7b3a8b
+Originally written by Per Bothner.
7b3a8b
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
7b3a8b
+2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
7b3a8b
+Free Software Foundation, Inc.
7b3a8b
+
7b3a8b
+This is free software; see the source for copying conditions.  There is NO
7b3a8b
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
7b3a8b
+
7b3a8b
+help="
7b3a8b
+Try \`$me --help' for more information."
7b3a8b
+
7b3a8b
+# Parse command line
7b3a8b
+while test $# -gt 0 ; do
7b3a8b
+  case $1 in
7b3a8b
+    --time-stamp | --time* | -t )
7b3a8b
+       echo "$timestamp" ; exit ;;
7b3a8b
+    --version | -v )
7b3a8b
+       echo "$version" ; exit ;;
7b3a8b
+    --help | --h* | -h )
7b3a8b
+       echo "$usage"; exit ;;
7b3a8b
+    -- )     # Stop option processing
7b3a8b
+       shift; break ;;
7b3a8b
+    - )	# Use stdin as input.
7b3a8b
+       break ;;
7b3a8b
+    -* )
7b3a8b
+       echo "$me: invalid option $1$help" >&2
7b3a8b
+       exit 1 ;;
7b3a8b
+    * )
7b3a8b
+       break ;;
7b3a8b
+  esac
7b3a8b
+done
7b3a8b
+
7b3a8b
+if test $# != 0; then
7b3a8b
+  echo "$me: too many arguments$help" >&2
7b3a8b
+  exit 1
7b3a8b
+fi
7b3a8b
+
7b3a8b
+trap 'exit 1' 1 2 15
7b3a8b
+
7b3a8b
+# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
7b3a8b
+# compiler to aid in system detection is discouraged as it requires
7b3a8b
+# temporary files to be created and, as you can see below, it is a
7b3a8b
+# headache to deal with in a portable fashion.
7b3a8b
+
7b3a8b
+# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
7b3a8b
+# use `HOST_CC' if defined, but it is deprecated.
7b3a8b
+
7b3a8b
+# Portable tmp directory creation inspired by the Autoconf team.
7b3a8b
+
7b3a8b
+set_cc_for_build='
7b3a8b
+trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
7b3a8b
+trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
7b3a8b
+: ${TMPDIR=/tmp} ;
7b3a8b
+ { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
7b3a8b
+ { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
7b3a8b
+ { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
7b3a8b
+ { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
7b3a8b
+dummy=$tmp/dummy ;
7b3a8b
+tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
7b3a8b
+case $CC_FOR_BUILD,$HOST_CC,$CC in
7b3a8b
+ ,,)    echo "int x;" > $dummy.c ;
7b3a8b
+	for c in cc gcc c89 c99 ; do
7b3a8b
+	  if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
7b3a8b
+	     CC_FOR_BUILD="$c"; break ;
7b3a8b
+	  fi ;
7b3a8b
+	done ;
7b3a8b
+	if test x"$CC_FOR_BUILD" = x ; then
7b3a8b
+	  CC_FOR_BUILD=no_compiler_found ;
7b3a8b
+	fi
7b3a8b
+	;;
7b3a8b
+ ,,*)   CC_FOR_BUILD=$CC ;;
7b3a8b
+ ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
7b3a8b
+esac ; set_cc_for_build= ;'
7b3a8b
 
7b3a8b
 # This is needed to find uname on a Pyramid OSx when run in the BSD universe.
7b3a8b
-# (ghazi@noc.rutgers.edu 8/24/94.)
7b3a8b
+# (ghazi@noc.rutgers.edu 1994-08-24)
7b3a8b
 if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
7b3a8b
 	PATH=$PATH:/.attbin ; export PATH
7b3a8b
 fi
7b3a8b
 
7b3a8b
 UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
7b3a8b
 UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
7b3a8b
-UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
7b3a8b
+UNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
7b3a8b
 UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
7b3a8b
 
7b3a8b
-trap 'rm -f dummy.c dummy.o dummy; exit 1' 1 2 15
7b3a8b
-
7b3a8b
 # Note: order is significant - the case branches are not exclusive.
7b3a8b
 
7b3a8b
 case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
7b3a8b
+    *:NetBSD:*:*)
7b3a8b
+	# NetBSD (nbsd) targets should (where applicable) match one or
7b3a8b
+	# more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
7b3a8b
+	# *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
7b3a8b
+	# switched to ELF, *-*-netbsd* would select the old
7b3a8b
+	# object file format.  This provides both forward
7b3a8b
+	# compatibility and a consistent mechanism for selecting the
7b3a8b
+	# object file format.
7b3a8b
+	#
7b3a8b
+	# Note: NetBSD doesn't particularly care about the vendor
7b3a8b
+	# portion of the name.  We always set it to "unknown".
7b3a8b
+	sysctl="sysctl -n hw.machine_arch"
7b3a8b
+	UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
7b3a8b
+	    /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
7b3a8b
+	case "${UNAME_MACHINE_ARCH}" in
7b3a8b
+	    armeb) machine=armeb-unknown ;;
7b3a8b
+	    arm*) machine=arm-unknown ;;
7b3a8b
+	    sh3el) machine=shl-unknown ;;
7b3a8b
+	    sh3eb) machine=sh-unknown ;;
7b3a8b
+	    sh5el) machine=sh5le-unknown ;;
7b3a8b
+	    *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
7b3a8b
+	esac
7b3a8b
+	# The Operating System including object format, if it has switched
7b3a8b
+	# to ELF recently, or will in the future.
7b3a8b
+	case "${UNAME_MACHINE_ARCH}" in
7b3a8b
+	    arm*|i386|m68k|ns32k|sh3*|sparc|vax)
7b3a8b
+		eval $set_cc_for_build
7b3a8b
+		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
7b3a8b
+			| grep -q __ELF__
7b3a8b
+		then
7b3a8b
+		    # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
7b3a8b
+		    # Return netbsd for either.  FIX?
7b3a8b
+		    os=netbsd
7b3a8b
+		else
7b3a8b
+		    os=netbsdelf
7b3a8b
+		fi
7b3a8b
+		;;
7b3a8b
+	    *)
7b3a8b
+		os=netbsd
7b3a8b
+		;;
7b3a8b
+	esac
7b3a8b
+	# The OS release
7b3a8b
+	# Debian GNU/NetBSD machines have a different userland, and
7b3a8b
+	# thus, need a distinct triplet. However, they do not need
7b3a8b
+	# kernel version information, so it can be replaced with a
7b3a8b
+	# suitable tag, in the style of linux-gnu.
7b3a8b
+	case "${UNAME_VERSION}" in
7b3a8b
+	    Debian*)
7b3a8b
+		release='-gnu'
7b3a8b
+		;;
7b3a8b
+	    *)
7b3a8b
+		release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
7b3a8b
+		;;
7b3a8b
+	esac
7b3a8b
+	# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
7b3a8b
+	# contains redundant information, the shorter form:
7b3a8b
+	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
7b3a8b
+	echo "${machine}-${os}${release}"
7b3a8b
+	exit ;;
7b3a8b
+    *:Bitrig:*:*)
7b3a8b
+	UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
7b3a8b
+	echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE}
7b3a8b
+	exit ;;
7b3a8b
+    *:OpenBSD:*:*)
7b3a8b
+	UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
7b3a8b
+	echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
7b3a8b
+	exit ;;
7b3a8b
+    *:ekkoBSD:*:*)
7b3a8b
+	echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
7b3a8b
+	exit ;;
7b3a8b
+    *:SolidBSD:*:*)
7b3a8b
+	echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
7b3a8b
+	exit ;;
7b3a8b
+    macppc:MirBSD:*:*)
7b3a8b
+	echo powerpc-unknown-mirbsd${UNAME_RELEASE}
7b3a8b
+	exit ;;
7b3a8b
+    *:MirBSD:*:*)
7b3a8b
+	echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
7b3a8b
+	exit ;;
7b3a8b
     alpha:OSF1:*:*)
7b3a8b
+	case $UNAME_RELEASE in
7b3a8b
+	*4.0)
7b3a8b
+		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
7b3a8b
+		;;
7b3a8b
+	*5.*)
7b3a8b
+		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
7b3a8b
+		;;
7b3a8b
+	esac
7b3a8b
+	# According to Compaq, /usr/sbin/psrinfo has been available on
7b3a8b
+	# OSF/1 and Tru64 systems produced since 1995.  I hope that
7b3a8b
+	# covers most systems running today.  This code pipes the CPU
7b3a8b
+	# types through head -n 1, so we only detect the type of CPU 0.
7b3a8b
+	ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\) processor.*$/\1/p' | head -n 1`
7b3a8b
+	case "$ALPHA_CPU_TYPE" in
7b3a8b
+	    "EV4 (21064)")
7b3a8b
+		UNAME_MACHINE="alpha" ;;
7b3a8b
+	    "EV4.5 (21064)")
7b3a8b
+		UNAME_MACHINE="alpha" ;;
7b3a8b
+	    "LCA4 (21066/21068)")
7b3a8b
+		UNAME_MACHINE="alpha" ;;
7b3a8b
+	    "EV5 (21164)")
7b3a8b
+		UNAME_MACHINE="alphaev5" ;;
7b3a8b
+	    "EV5.6 (21164A)")
7b3a8b
+		UNAME_MACHINE="alphaev56" ;;
7b3a8b
+	    "EV5.6 (21164PC)")
7b3a8b
+		UNAME_MACHINE="alphapca56" ;;
7b3a8b
+	    "EV5.7 (21164PC)")
7b3a8b
+		UNAME_MACHINE="alphapca57" ;;
7b3a8b
+	    "EV6 (21264)")
7b3a8b
+		UNAME_MACHINE="alphaev6" ;;
7b3a8b
+	    "EV6.7 (21264A)")
7b3a8b
+		UNAME_MACHINE="alphaev67" ;;
7b3a8b
+	    "EV6.8CB (21264C)")
7b3a8b
+		UNAME_MACHINE="alphaev68" ;;
7b3a8b
+	    "EV6.8AL (21264B)")
7b3a8b
+		UNAME_MACHINE="alphaev68" ;;
7b3a8b
+	    "EV6.8CX (21264D)")
7b3a8b
+		UNAME_MACHINE="alphaev68" ;;
7b3a8b
+	    "EV6.9A (21264/EV69A)")
7b3a8b
+		UNAME_MACHINE="alphaev69" ;;
7b3a8b
+	    "EV7 (21364)")
7b3a8b
+		UNAME_MACHINE="alphaev7" ;;
7b3a8b
+	    "EV7.9 (21364A)")
7b3a8b
+		UNAME_MACHINE="alphaev79" ;;
7b3a8b
+	esac
7b3a8b
+	# A Pn.n version is a patched version.
7b3a8b
 	# A Vn.n version is a released version.
7b3a8b
 	# A Tn.n version is a released field test version.
7b3a8b
 	# A Xn.n version is an unreleased experimental baselevel.
7b3a8b
 	# 1.2 uses "1.2" for uname -r.
7b3a8b
-	echo alpha-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//'`
7b3a8b
-	exit 0 ;;
7b3a8b
+	echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
7b3a8b
+	# Reset EXIT trap before exiting to avoid spurious non-zero exit code.
7b3a8b
+	exitcode=$?
7b3a8b
+	trap '' 0
7b3a8b
+	exit $exitcode ;;
7b3a8b
+    Alpha\ *:Windows_NT*:*)
7b3a8b
+	# How do we know it's Interix rather than the generic POSIX subsystem?
7b3a8b
+	# Should we change UNAME_MACHINE based on the output of uname instead
7b3a8b
+	# of the specific Alpha model?
7b3a8b
+	echo alpha-pc-interix
7b3a8b
+	exit ;;
7b3a8b
     21064:Windows_NT:50:3)
7b3a8b
 	echo alpha-dec-winnt3.5
7b3a8b
-	exit 0 ;;
7b3a8b
+	exit ;;
7b3a8b
     Amiga*:UNIX_System_V:4.0:*)
7b3a8b
-	echo m68k-cbm-sysv4
7b3a8b
-	exit 0;;
7b3a8b
-    amiga:NetBSD:*:*)
7b3a8b
-      echo m68k-cbm-netbsd${UNAME_RELEASE}
7b3a8b
-      exit 0 ;;
7b3a8b
+	echo m68k-unknown-sysv4
7b3a8b
+	exit ;;
7b3a8b
+    *:[Aa]miga[Oo][Ss]:*:*)
7b3a8b
+	echo ${UNAME_MACHINE}-unknown-amigaos
7b3a8b
+	exit ;;
7b3a8b
+    *:[Mm]orph[Oo][Ss]:*:*)
7b3a8b
+	echo ${UNAME_MACHINE}-unknown-morphos
7b3a8b
+	exit ;;
7b3a8b
+    *:OS/390:*:*)
7b3a8b
+	echo i370-ibm-openedition
7b3a8b
+	exit ;;
7b3a8b
+    *:z/VM:*:*)
7b3a8b
+	echo s390-ibm-zvmoe
7b3a8b
+	exit ;;
7b3a8b
+    *:OS400:*:*)
7b3a8b
+	echo powerpc-ibm-os400
7b3a8b
+	exit ;;
7b3a8b
     arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
7b3a8b
 	echo arm-acorn-riscix${UNAME_RELEASE}
7b3a8b
-	exit 0;;
7b3a8b
-    Pyramid*:OSx*:*:*)
7b3a8b
+	exit ;;
7b3a8b
+    arm*:riscos:*:*|arm*:RISCOS:*:*)
7b3a8b
+	echo arm-unknown-riscos
7b3a8b
+	exit ;;
7b3a8b
+    SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
7b3a8b
+	echo hppa1.1-hitachi-hiuxmpp
7b3a8b
+	exit ;;
7b3a8b
+    Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
7b3a8b
+	# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
7b3a8b
 	if test "`(/bin/universe) 2>/dev/null`" = att ; then
7b3a8b
 		echo pyramid-pyramid-sysv3
7b3a8b
 	else
7b3a8b
 		echo pyramid-pyramid-bsd
7b3a8b
 	fi
7b3a8b
-	exit 0 ;;
7b3a8b
-    sun4*:SunOS:5.*:*)
7b3a8b
+	exit ;;
7b3a8b
+    NILE*:*:*:dcosx)
7b3a8b
+	echo pyramid-pyramid-svr4
7b3a8b
+	exit ;;
7b3a8b
+    DRS?6000:unix:4.0:6*)
7b3a8b
+	echo sparc-icl-nx6
7b3a8b
+	exit ;;
7b3a8b
+    DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
7b3a8b
+	case `/usr/bin/uname -p` in
7b3a8b
+	    sparc) echo sparc-icl-nx7; exit ;;
7b3a8b
+	esac ;;
7b3a8b
+    s390x:SunOS:*:*)
7b3a8b
+	echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
7b3a8b
+	exit ;;
7b3a8b
+    sun4H:SunOS:5.*:*)
7b3a8b
+	echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
7b3a8b
+	exit ;;
7b3a8b
+    sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
7b3a8b
 	echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
7b3a8b
-	exit 0 ;;
7b3a8b
-    i86pc:SunOS:5.*:*)
7b3a8b
-	echo i386-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
7b3a8b
-	exit 0 ;;
7b3a8b
+	exit ;;
7b3a8b
+    i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
7b3a8b
+	echo i386-pc-auroraux${UNAME_RELEASE}
7b3a8b
+	exit ;;
7b3a8b
+    i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
7b3a8b
+	eval $set_cc_for_build
7b3a8b
+	SUN_ARCH="i386"
7b3a8b
+	# If there is a compiler, see if it is configured for 64-bit objects.
7b3a8b
+	# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
7b3a8b
+	# This test works for both compilers.
7b3a8b
+	if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
7b3a8b
+	    if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
7b3a8b
+		(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
7b3a8b
+		grep IS_64BIT_ARCH >/dev/null
7b3a8b
+	    then
7b3a8b
+		SUN_ARCH="x86_64"
7b3a8b
+	    fi
7b3a8b
+	fi
7b3a8b
+	echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
7b3a8b
+	exit ;;
7b3a8b
     sun4*:SunOS:6*:*)
7b3a8b
 	# According to config.sub, this is the proper way to canonicalize
7b3a8b
 	# SunOS6.  Hard to guess exactly what SunOS6 will be like, but
7b3a8b
 	# it's likely to be more like Solaris than SunOS4.
7b3a8b
 	echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
7b3a8b
-	exit 0 ;;
7b3a8b
+	exit ;;
7b3a8b
     sun4*:SunOS:*:*)
7b3a8b
 	case "`/usr/bin/arch -k`" in
7b3a8b
 	    Series*|S4*)
7b3a8b
@@ -97,81 +372,169 @@
7b3a8b
 	esac
7b3a8b
 	# Japanese Language versions have a version number like `4.1.3-JL'.
7b3a8b
 	echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
7b3a8b
-	exit 0 ;;
7b3a8b
+	exit ;;
7b3a8b
     sun3*:SunOS:*:*)
7b3a8b
 	echo m68k-sun-sunos${UNAME_RELEASE}
7b3a8b
-	exit 0 ;;
7b3a8b
-    atari*:NetBSD:*:*)
7b3a8b
-	echo m68k-atari-netbsd${UNAME_RELEASE}
7b3a8b
-	exit 0 ;;
7b3a8b
-    sun3*:NetBSD:*:*)
7b3a8b
-	echo m68k-sun-netbsd${UNAME_RELEASE}
7b3a8b
-	exit 0 ;;
7b3a8b
-    mac68k:NetBSD:*:*)
7b3a8b
-	echo m68k-apple-netbsd${UNAME_RELEASE}
7b3a8b
-	exit 0 ;;
7b3a8b
+	exit ;;
7b3a8b
+    sun*:*:4.2BSD:*)
7b3a8b
+	UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
7b3a8b
+	test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
7b3a8b
+	case "`/bin/arch`" in
7b3a8b
+	    sun3)
7b3a8b
+		echo m68k-sun-sunos${UNAME_RELEASE}
7b3a8b
+		;;
7b3a8b
+	    sun4)
7b3a8b
+		echo sparc-sun-sunos${UNAME_RELEASE}
7b3a8b
+		;;
7b3a8b
+	esac
7b3a8b
+	exit ;;
7b3a8b
+    aushp:SunOS:*:*)
7b3a8b
+	echo sparc-auspex-sunos${UNAME_RELEASE}
7b3a8b
+	exit ;;
7b3a8b
+    # The situation for MiNT is a little confusing.  The machine name
7b3a8b
+    # can be virtually everything (everything which is not
7b3a8b
+    # "atarist" or "atariste" at least should have a processor
7b3a8b
+    # > m68000).  The system name ranges from "MiNT" over "FreeMiNT"
7b3a8b
+    # to the lowercase version "mint" (or "freemint").  Finally
7b3a8b
+    # the system name "TOS" denotes a system which is actually not
7b3a8b
+    # MiNT.  But MiNT is downward compatible to TOS, so this should
7b3a8b
+    # be no problem.
7b3a8b
+    atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
7b3a8b
+	echo m68k-atari-mint${UNAME_RELEASE}
7b3a8b
+	exit ;;
7b3a8b
+    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
7b3a8b
+	echo m68k-atari-mint${UNAME_RELEASE}
7b3a8b
+	exit ;;
7b3a8b
+    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
7b3a8b
+	echo m68k-atari-mint${UNAME_RELEASE}
7b3a8b
+	exit ;;
7b3a8b
+    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
7b3a8b
+	echo m68k-milan-mint${UNAME_RELEASE}
7b3a8b
+	exit ;;
7b3a8b
+    hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
7b3a8b
+	echo m68k-hades-mint${UNAME_RELEASE}
7b3a8b
+	exit ;;
7b3a8b
+    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
7b3a8b
+	echo m68k-unknown-mint${UNAME_RELEASE}
7b3a8b
+	exit ;;
7b3a8b
+    m68k:machten:*:*)
7b3a8b
+	echo m68k-apple-machten${UNAME_RELEASE}
7b3a8b
+	exit ;;
7b3a8b
+    powerpc:machten:*:*)
7b3a8b
+	echo powerpc-apple-machten${UNAME_RELEASE}
7b3a8b
+	exit ;;
7b3a8b
+    RISC*:Mach:*:*)
7b3a8b
+	echo mips-dec-mach_bsd4.3
7b3a8b
+	exit ;;
7b3a8b
     RISC*:ULTRIX:*:*)
7b3a8b
 	echo mips-dec-ultrix${UNAME_RELEASE}
7b3a8b
-	exit 0 ;;
7b3a8b
+	exit ;;
7b3a8b
     VAX*:ULTRIX*:*:*)
7b3a8b
 	echo vax-dec-ultrix${UNAME_RELEASE}
7b3a8b
-	exit 0 ;;
7b3a8b
-    mips:*:4*:UMIPS)
7b3a8b
-	echo mips-mips-riscos4sysv
7b3a8b
-	exit 0 ;;
7b3a8b
-    mips:*:5*:RISCos)
7b3a8b
+	exit ;;
7b3a8b
+    2020:CLIX:*:* | 2430:CLIX:*:*)
7b3a8b
+	echo clipper-intergraph-clix${UNAME_RELEASE}
7b3a8b
+	exit ;;
7b3a8b
+    mips:*:*:UMIPS | mips:*:*:RISCos)
7b3a8b
+	eval $set_cc_for_build
7b3a8b
+	sed 's/^	//' << EOF >$dummy.c
7b3a8b
+#ifdef __cplusplus
7b3a8b
+#include <stdio.h>  /* for printf() prototype */
7b3a8b
+	int main (int argc, char *argv[]) {
7b3a8b
+#else
7b3a8b
+	int main (argc, argv) int argc; char *argv[]; {
7b3a8b
+#endif
7b3a8b
+	#if defined (host_mips) && defined (MIPSEB)
7b3a8b
+	#if defined (SYSTYPE_SYSV)
7b3a8b
+	  printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
7b3a8b
+	#endif
7b3a8b
+	#if defined (SYSTYPE_SVR4)
7b3a8b
+	  printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
7b3a8b
+	#endif
7b3a8b
+	#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
7b3a8b
+	  printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
7b3a8b
+	#endif
7b3a8b
+	#endif
7b3a8b
+	  exit (-1);
7b3a8b
+	}
7b3a8b
+EOF
7b3a8b
+	$CC_FOR_BUILD -o $dummy $dummy.c &&
7b3a8b
+	  dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
7b3a8b
+	  SYSTEM_NAME=`$dummy $dummyarg` &&
7b3a8b
+	    { echo "$SYSTEM_NAME"; exit; }
7b3a8b
 	echo mips-mips-riscos${UNAME_RELEASE}
7b3a8b
-	exit 0 ;;
7b3a8b
+	exit ;;
7b3a8b
+    Motorola:PowerMAX_OS:*:*)
7b3a8b
+	echo powerpc-motorola-powermax
7b3a8b
+	exit ;;
7b3a8b
+    Motorola:*:4.3:PL8-*)
7b3a8b
+	echo powerpc-harris-powermax
7b3a8b
+	exit ;;
7b3a8b
+    Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
7b3a8b
+	echo powerpc-harris-powermax
7b3a8b
+	exit ;;
7b3a8b
     Night_Hawk:Power_UNIX:*:*)
7b3a8b
 	echo powerpc-harris-powerunix
7b3a8b
-	exit 0 ;;
7b3a8b
+	exit ;;
7b3a8b
     m88k:CX/UX:7*:*)
7b3a8b
 	echo m88k-harris-cxux7
7b3a8b
-	exit 0 ;;
7b3a8b
+	exit ;;
7b3a8b
     m88k:*:4*:R4*)
7b3a8b
 	echo m88k-motorola-sysv4
7b3a8b
-	exit 0 ;;
7b3a8b
+	exit ;;
7b3a8b
     m88k:*:3*:R3*)
7b3a8b
 	echo m88k-motorola-sysv3
7b3a8b
-	exit 0 ;;
7b3a8b
+	exit ;;
7b3a8b
     AViiON:dgux:*:*)
7b3a8b
-        # DG/UX returns AViiON for all architectures
7b3a8b
-        UNAME_PROCESSOR=`/usr/bin/uname -p`
7b3a8b
-        if [ $UNAME_PROCESSOR = mc88100 -o $UNAME_PROCESSOR = mc88100 ] ; then
7b3a8b
-	if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx \
7b3a8b
-	     -o ${TARGET_BINARY_INTERFACE}x = x ] ; then
7b3a8b
+	# DG/UX returns AViiON for all architectures
7b3a8b
+	UNAME_PROCESSOR=`/usr/bin/uname -p`
7b3a8b
+	if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
7b3a8b
+	then
7b3a8b
+	    if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
7b3a8b
+	       [ ${TARGET_BINARY_INTERFACE}x = x ]
7b3a8b
+	    then
7b3a8b
 		echo m88k-dg-dgux${UNAME_RELEASE}
7b3a8b
-	else
7b3a8b
+	    else
7b3a8b
 		echo m88k-dg-dguxbcs${UNAME_RELEASE}
7b3a8b
+	    fi
7b3a8b
+	else
7b3a8b
+	    echo i586-dg-dgux${UNAME_RELEASE}
7b3a8b
 	fi
7b3a8b
-        else echo i586-dg-dgux${UNAME_RELEASE}
7b3a8b
-        fi
7b3a8b
- 	exit 0 ;;
7b3a8b
+	exit ;;
7b3a8b
     M88*:DolphinOS:*:*)	# DolphinOS (SVR3)
7b3a8b
 	echo m88k-dolphin-sysv3
7b3a8b
-	exit 0 ;;
7b3a8b
+	exit ;;
7b3a8b
     M88*:*:R3*:*)
7b3a8b
 	# Delta 88k system running SVR3
7b3a8b
 	echo m88k-motorola-sysv3
7b3a8b
-	exit 0 ;;
7b3a8b
+	exit ;;
7b3a8b
     XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
7b3a8b
 	echo m88k-tektronix-sysv3
7b3a8b
-	exit 0 ;;
7b3a8b
+	exit ;;
7b3a8b
     Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
7b3a8b
 	echo m68k-tektronix-bsd
7b3a8b
-	exit 0 ;;
7b3a8b
+	exit ;;
7b3a8b
     *:IRIX*:*:*)
7b3a8b
 	echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
7b3a8b
-	exit 0 ;;
7b3a8b
-   ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
7b3a8b
-	echo romp-ibm-aix      # uname -m gives an 8 hex-code CPU id
7b3a8b
-	exit 0 ;;              # Note that: echo "'`uname -s`'" gives 'AIX '
7b3a8b
-    i[34]86:AIX:*:*)
7b3a8b
+	exit ;;
7b3a8b
+    ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
7b3a8b
+	echo romp-ibm-aix     # uname -m gives an 8 hex-code CPU id
7b3a8b
+	exit ;;               # Note that: echo "'`uname -s`'" gives 'AIX '
7b3a8b
+    i*86:AIX:*:*)
7b3a8b
 	echo i386-ibm-aix
7b3a8b
-	exit 0 ;;
7b3a8b
+	exit ;;
7b3a8b
+    ia64:AIX:*:*)
7b3a8b
+	if [ -x /usr/bin/oslevel ] ; then
7b3a8b
+		IBM_REV=`/usr/bin/oslevel`
7b3a8b
+	else
7b3a8b
+		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
7b3a8b
+	fi
7b3a8b
+	echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
7b3a8b
+	exit ;;
7b3a8b
     *:AIX:2:3)
7b3a8b
 	if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
7b3a8b
-		sed 's/^		//' << EOF >dummy.c
7b3a8b
+		eval $set_cc_for_build
7b3a8b
+		sed 's/^		//' << EOF >$dummy.c
7b3a8b
 		#include <sys/systemcfg.h>
7b3a8b
 
7b3a8b
 		main()
7b3a8b
@@ -182,17 +545,21 @@
7b3a8b
 			exit(0);
7b3a8b
 			}
7b3a8b
 EOF
7b3a8b
-		${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0
7b3a8b
-		rm -f dummy.c dummy
7b3a8b
-		echo rs6000-ibm-aix3.2.5
7b3a8b
+		if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
7b3a8b
+		then
7b3a8b
+			echo "$SYSTEM_NAME"
7b3a8b
+		else
7b3a8b
+			echo rs6000-ibm-aix3.2.5
7b3a8b
+		fi
7b3a8b
 	elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
7b3a8b
 		echo rs6000-ibm-aix3.2.4
7b3a8b
 	else
7b3a8b
 		echo rs6000-ibm-aix3.2
7b3a8b
 	fi
7b3a8b
-	exit 0 ;;
7b3a8b
-    *:AIX:*:4)
7b3a8b
-	if /usr/sbin/lsattr -EHl proc0 | grep POWER >/dev/null 2>&1; then
7b3a8b
+	exit ;;
7b3a8b
+    *:AIX:*:[4567])
7b3a8b
+	IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
7b3a8b
+	if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
7b3a8b
 		IBM_ARCH=rs6000
7b3a8b
 	else
7b3a8b
 		IBM_ARCH=powerpc
7b3a8b
@@ -200,43 +567,120 @@
7b3a8b
 	if [ -x /usr/bin/oslevel ] ; then
7b3a8b
 		IBM_REV=`/usr/bin/oslevel`
7b3a8b
 	else
7b3a8b
-		IBM_REV=4.${UNAME_RELEASE}
7b3a8b
+		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
7b3a8b
 	fi
7b3a8b
 	echo ${IBM_ARCH}-ibm-aix${IBM_REV}
7b3a8b
-	exit 0 ;;
7b3a8b
+	exit ;;
7b3a8b
     *:AIX:*:*)
7b3a8b
 	echo rs6000-ibm-aix
7b3a8b
-	exit 0 ;;
7b3a8b
+	exit ;;
7b3a8b
     ibmrt:4.4BSD:*|romp-ibm:BSD:*)
7b3a8b
 	echo romp-ibm-bsd4.4
7b3a8b
-	exit 0 ;;
7b3a8b
-    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC NetBSD and
7b3a8b
-	echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to 
7b3a8b
-	exit 0 ;;                           # report: romp-ibm BSD 4.3
7b3a8b
+	exit ;;
7b3a8b
+    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
7b3a8b
+	echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
7b3a8b
+	exit ;;                             # report: romp-ibm BSD 4.3
7b3a8b
     *:BOSX:*:*)
7b3a8b
 	echo rs6000-bull-bosx
7b3a8b
-	exit 0 ;;
7b3a8b
+	exit ;;
7b3a8b
     DPX/2?00:B.O.S.:*:*)
7b3a8b
 	echo m68k-bull-sysv3
7b3a8b
-	exit 0 ;;
7b3a8b
+	exit ;;
7b3a8b
     9000/[34]??:4.3bsd:1.*:*)
7b3a8b
 	echo m68k-hp-bsd
7b3a8b
-	exit 0 ;;
7b3a8b
+	exit ;;
7b3a8b
     hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
7b3a8b
 	echo m68k-hp-bsd4.4
7b3a8b
-	exit 0 ;;
7b3a8b
-    9000/[3478]??:HP-UX:*:*)
7b3a8b
+	exit ;;
7b3a8b
+    9000/[34678]??:HP-UX:*:*)
7b3a8b
+	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
7b3a8b
 	case "${UNAME_MACHINE}" in
7b3a8b
 	    9000/31? )            HP_ARCH=m68000 ;;
7b3a8b
 	    9000/[34]?? )         HP_ARCH=m68k ;;
7b3a8b
-	    9000/7?? | 9000/8?[679] ) HP_ARCH=hppa1.1 ;;
7b3a8b
-	    9000/8?? )            HP_ARCH=hppa1.0 ;;
7b3a8b
+	    9000/[678][0-9][0-9])
7b3a8b
+		if [ -x /usr/bin/getconf ]; then
7b3a8b
+		    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
7b3a8b
+		    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
7b3a8b
+		    case "${sc_cpu_version}" in
7b3a8b
+		      523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
7b3a8b
+		      528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
7b3a8b
+		      532)                      # CPU_PA_RISC2_0
7b3a8b
+			case "${sc_kernel_bits}" in
7b3a8b
+			  32) HP_ARCH="hppa2.0n" ;;
7b3a8b
+			  64) HP_ARCH="hppa2.0w" ;;
7b3a8b
+			  '') HP_ARCH="hppa2.0" ;;   # HP-UX 10.20
7b3a8b
+			esac ;;
7b3a8b
+		    esac
7b3a8b
+		fi
7b3a8b
+		if [ "${HP_ARCH}" = "" ]; then
7b3a8b
+		    eval $set_cc_for_build
7b3a8b
+		    sed 's/^		//' << EOF >$dummy.c
7b3a8b
+
7b3a8b
+		#define _HPUX_SOURCE
7b3a8b
+		#include <stdlib.h>
7b3a8b
+		#include <unistd.h>
7b3a8b
+
7b3a8b
+		int main ()
7b3a8b
+		{
7b3a8b
+		#if defined(_SC_KERNEL_BITS)
7b3a8b
+		    long bits = sysconf(_SC_KERNEL_BITS);
7b3a8b
+		#endif
7b3a8b
+		    long cpu  = sysconf (_SC_CPU_VERSION);
7b3a8b
+
7b3a8b
+		    switch (cpu)
7b3a8b
+			{
7b3a8b
+			case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
7b3a8b
+			case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
7b3a8b
+			case CPU_PA_RISC2_0:
7b3a8b
+		#if defined(_SC_KERNEL_BITS)
7b3a8b
+			    switch (bits)
7b3a8b
+				{
7b3a8b
+				case 64: puts ("hppa2.0w"); break;
7b3a8b
+				case 32: puts ("hppa2.0n"); break;
7b3a8b
+				default: puts ("hppa2.0"); break;
7b3a8b
+				} break;
7b3a8b
+		#else  /* !defined(_SC_KERNEL_BITS) */
7b3a8b
+			    puts ("hppa2.0"); break;
7b3a8b
+		#endif
7b3a8b
+			default: puts ("hppa1.0"); break;
7b3a8b
+			}
7b3a8b
+		    exit (0);
7b3a8b
+		}
7b3a8b
+EOF
7b3a8b
+		    (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
7b3a8b
+		    test -z "$HP_ARCH" && HP_ARCH=hppa
7b3a8b
+		fi ;;
7b3a8b
 	esac
7b3a8b
-	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
7b3a8b
+	if [ ${HP_ARCH} = "hppa2.0w" ]
7b3a8b
+	then
7b3a8b
+	    eval $set_cc_for_build
7b3a8b
+
7b3a8b
+	    # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
7b3a8b
+	    # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler
7b3a8b
+	    # generating 64-bit code.  GNU and HP use different nomenclature:
7b3a8b
+	    #
7b3a8b
+	    # $ CC_FOR_BUILD=cc ./config.guess
7b3a8b
+	    # => hppa2.0w-hp-hpux11.23
7b3a8b
+	    # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
7b3a8b
+	    # => hppa64-hp-hpux11.23
7b3a8b
+
7b3a8b
+	    if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
7b3a8b
+		grep -q __LP64__
7b3a8b
+	    then
7b3a8b
+		HP_ARCH="hppa2.0w"
7b3a8b
+	    else
7b3a8b
+		HP_ARCH="hppa64"
7b3a8b
+	    fi
7b3a8b
+	fi
7b3a8b
 	echo ${HP_ARCH}-hp-hpux${HPUX_REV}
7b3a8b
-	exit 0 ;;
7b3a8b
+	exit ;;
7b3a8b
+    ia64:HP-UX:*:*)
7b3a8b
+	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
7b3a8b
+	echo ia64-hp-hpux${HPUX_REV}
7b3a8b
+	exit ;;
7b3a8b
     3050*:HI-UX:*:*)
7b3a8b
-	sed 's/^	//' << EOF >dummy.c
7b3a8b
+	eval $set_cc_for_build
7b3a8b
+	sed 's/^	//' << EOF >$dummy.c
7b3a8b
 	#include <unistd.h>
7b3a8b
 	int
7b3a8b
 	main ()
7b3a8b
@@ -261,186 +705,455 @@
7b3a8b
 	  exit (0);
7b3a8b
 	}
7b3a8b
 EOF
7b3a8b
-	${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0
7b3a8b
-	rm -f dummy.c dummy
7b3a8b
+	$CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
7b3a8b
+		{ echo "$SYSTEM_NAME"; exit; }
7b3a8b
 	echo unknown-hitachi-hiuxwe2
7b3a8b
-	exit 0 ;;
7b3a8b
+	exit ;;
7b3a8b
     9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
7b3a8b
 	echo hppa1.1-hp-bsd
7b3a8b
-	exit 0 ;;
7b3a8b
+	exit ;;
7b3a8b
     9000/8??:4.3bsd:*:*)
7b3a8b
 	echo hppa1.0-hp-bsd
7b3a8b
-	exit 0 ;;
7b3a8b
+	exit ;;
7b3a8b
+    *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
7b3a8b
+	echo hppa1.0-hp-mpeix
7b3a8b
+	exit ;;
7b3a8b
     hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
7b3a8b
 	echo hppa1.1-hp-osf
7b3a8b
-	exit 0 ;;
7b3a8b
+	exit ;;
7b3a8b
     hp8??:OSF1:*:*)
7b3a8b
 	echo hppa1.0-hp-osf
7b3a8b
-	exit 0 ;;
7b3a8b
+	exit ;;
7b3a8b
+    i*86:OSF1:*:*)
7b3a8b
+	if [ -x /usr/sbin/sysversion ] ; then
7b3a8b
+	    echo ${UNAME_MACHINE}-unknown-osf1mk
7b3a8b
+	else
7b3a8b
+	    echo ${UNAME_MACHINE}-unknown-osf1
7b3a8b
+	fi
7b3a8b
+	exit ;;
7b3a8b
     parisc*:Lites*:*:*)
7b3a8b
 	echo hppa1.1-hp-lites
7b3a8b
-	exit 0 ;;
7b3a8b
+	exit ;;
7b3a8b
     C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
7b3a8b
 	echo c1-convex-bsd
7b3a8b
-        exit 0 ;;
7b3a8b
+	exit ;;
7b3a8b
     C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
7b3a8b
 	if getsysinfo -f scalar_acc
7b3a8b
 	then echo c32-convex-bsd
7b3a8b
 	else echo c2-convex-bsd
7b3a8b
 	fi
7b3a8b
-        exit 0 ;;
7b3a8b
+	exit ;;
7b3a8b
     C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
7b3a8b
 	echo c34-convex-bsd
7b3a8b
-        exit 0 ;;
7b3a8b
+	exit ;;
7b3a8b
     C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
7b3a8b
 	echo c38-convex-bsd
7b3a8b
-        exit 0 ;;
7b3a8b
+	exit ;;
7b3a8b
     C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
7b3a8b
 	echo c4-convex-bsd
7b3a8b
-        exit 0 ;;
7b3a8b
-    CRAY*X-MP:*:*:*)
7b3a8b
-	echo xmp-cray-unicos
7b3a8b
-        exit 0 ;;
7b3a8b
+	exit ;;
7b3a8b
     CRAY*Y-MP:*:*:*)
7b3a8b
-	echo ymp-cray-unicos${UNAME_RELEASE}
7b3a8b
-	exit 0 ;;
7b3a8b
-    CRAY*C90:*:*:*)
7b3a8b
-	echo c90-cray-unicos${UNAME_RELEASE}
7b3a8b
-	exit 0 ;;
7b3a8b
-    CRAY-2:*:*:*)
7b3a8b
-	echo cray2-cray-unicos
7b3a8b
-        exit 0 ;;
7b3a8b
-    hp3[0-9][05]:NetBSD:*:*)
7b3a8b
-	echo m68k-hp-netbsd${UNAME_RELEASE}
7b3a8b
-	exit 0 ;;
7b3a8b
-    i[34]86:BSD/386:*:* | *:BSD/OS:*:*)
7b3a8b
+	echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
7b3a8b
+	exit ;;
7b3a8b
+    CRAY*[A-Z]90:*:*:*)
7b3a8b
+	echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
7b3a8b
+	| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
7b3a8b
+	      -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
7b3a8b
+	      -e 's/\.[^.]*$/.X/'
7b3a8b
+	exit ;;
7b3a8b
+    CRAY*TS:*:*:*)
7b3a8b
+	echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
7b3a8b
+	exit ;;
7b3a8b
+    CRAY*T3E:*:*:*)
7b3a8b
+	echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
7b3a8b
+	exit ;;
7b3a8b
+    CRAY*SV1:*:*:*)
7b3a8b
+	echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
7b3a8b
+	exit ;;
7b3a8b
+    *:UNICOS/mp:*:*)
7b3a8b
+	echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
7b3a8b
+	exit ;;
7b3a8b
+    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
7b3a8b
+	FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
7b3a8b
+	FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
7b3a8b
+	FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
7b3a8b
+	echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
7b3a8b
+	exit ;;
7b3a8b
+    5000:UNIX_System_V:4.*:*)
7b3a8b
+	FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
7b3a8b
+	FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
7b3a8b
+	echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
7b3a8b
+	exit ;;
7b3a8b
+    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
7b3a8b
+	echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
7b3a8b
+	exit ;;
7b3a8b
+    sparc*:BSD/OS:*:*)
7b3a8b
+	echo sparc-unknown-bsdi${UNAME_RELEASE}
7b3a8b
+	exit ;;
7b3a8b
+    *:BSD/OS:*:*)
7b3a8b
 	echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
7b3a8b
-	exit 0 ;;
7b3a8b
+	exit ;;
7b3a8b
     *:FreeBSD:*:*)
7b3a8b
-	echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
7b3a8b
-	exit 0 ;;
7b3a8b
-    *:NetBSD:*:*)
7b3a8b
-	echo ${UNAME_MACHINE}-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
7b3a8b
-	exit 0 ;;
7b3a8b
+	UNAME_PROCESSOR=`/usr/bin/uname -p`
7b3a8b
+	case ${UNAME_PROCESSOR} in
7b3a8b
+	    amd64)
7b3a8b
+		echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
7b3a8b
+	    *)
7b3a8b
+		echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
7b3a8b
+	esac
7b3a8b
+	exit ;;
7b3a8b
     i*:CYGWIN*:*)
7b3a8b
-	echo i386-unknown-cygwin32
7b3a8b
-	exit 0 ;;
7b3a8b
+	echo ${UNAME_MACHINE}-pc-cygwin
7b3a8b
+	exit ;;
7b3a8b
+    *:MINGW64*:*)
7b3a8b
+	echo ${UNAME_MACHINE}-pc-mingw64
7b3a8b
+	exit ;;
7b3a8b
+    *:MINGW*:*)
7b3a8b
+	echo ${UNAME_MACHINE}-pc-mingw32
7b3a8b
+	exit ;;
7b3a8b
+    i*:MSYS*:*)
7b3a8b
+	echo ${UNAME_MACHINE}-pc-msys
7b3a8b
+	exit ;;
7b3a8b
+    i*:windows32*:*)
7b3a8b
+	# uname -m includes "-pc" on this system.
7b3a8b
+	echo ${UNAME_MACHINE}-mingw32
7b3a8b
+	exit ;;
7b3a8b
+    i*:PW*:*)
7b3a8b
+	echo ${UNAME_MACHINE}-pc-pw32
7b3a8b
+	exit ;;
7b3a8b
+    *:Interix*:*)
7b3a8b
+	case ${UNAME_MACHINE} in
7b3a8b
+	    x86)
7b3a8b
+		echo i586-pc-interix${UNAME_RELEASE}
7b3a8b
+		exit ;;
7b3a8b
+	    authenticamd | genuineintel | EM64T)
7b3a8b
+		echo x86_64-unknown-interix${UNAME_RELEASE}
7b3a8b
+		exit ;;
7b3a8b
+	    IA64)
7b3a8b
+		echo ia64-unknown-interix${UNAME_RELEASE}
7b3a8b
+		exit ;;
7b3a8b
+	esac ;;
7b3a8b
+    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
7b3a8b
+	echo i${UNAME_MACHINE}-pc-mks
7b3a8b
+	exit ;;
7b3a8b
+    8664:Windows_NT:*)
7b3a8b
+	echo x86_64-pc-mks
7b3a8b
+	exit ;;
7b3a8b
+    i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
7b3a8b
+	# How do we know it's Interix rather than the generic POSIX subsystem?
7b3a8b
+	# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
7b3a8b
+	# UNAME_MACHINE based on the output of uname instead of i386?
7b3a8b
+	echo i586-pc-interix
7b3a8b
+	exit ;;
7b3a8b
+    i*:UWIN*:*)
7b3a8b
+	echo ${UNAME_MACHINE}-pc-uwin
7b3a8b
+	exit ;;
7b3a8b
+    amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
7b3a8b
+	echo x86_64-unknown-cygwin
7b3a8b
+	exit ;;
7b3a8b
     p*:CYGWIN*:*)
7b3a8b
-	echo powerpcle-unknown-cygwin32
7b3a8b
-	exit 0 ;;
7b3a8b
+	echo powerpcle-unknown-cygwin
7b3a8b
+	exit ;;
7b3a8b
     prep*:SunOS:5.*:*)
7b3a8b
 	echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
7b3a8b
-	exit 0 ;;
7b3a8b
+	exit ;;
7b3a8b
     *:GNU:*:*)
7b3a8b
-	echo `echo ${UNAME_MACHINE}|sed -e 's,/.*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
7b3a8b
-	exit 0 ;;
7b3a8b
-    *:Linux:*:*)
7b3a8b
-	# The BFD linker knows what the default object file format is, so
7b3a8b
-	# first see if it will tell us.
7b3a8b
-	ld_help_string=`ld --help 2>&1`
7b3a8b
-	if echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: elf_i[345]86"; then
7b3a8b
-	  echo "${UNAME_MACHINE}-unknown-linux" ; exit 0
7b3a8b
-	elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: i[345]86linux"; then
7b3a8b
-	  echo "${UNAME_MACHINE}-unknown-linuxaout" ; exit 0
7b3a8b
-	elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: i[345]86coff"; then
7b3a8b
-	  echo "${UNAME_MACHINE}-unknown-linuxcoff" ; exit 0
7b3a8b
-	elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: m68kelf"; then
7b3a8b
-	  echo "${UNAME_MACHINE}-unknown-linux" ; exit 0
7b3a8b
-	elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: m68klinux"; then
7b3a8b
-	  echo "${UNAME_MACHINE}-unknown-linuxaout" ; exit 0
7b3a8b
-	elif test "${UNAME_MACHINE}" = "alpha" ; then
7b3a8b
-	  echo alpha-unknown-linux ; exit 0
7b3a8b
-	else
7b3a8b
-	  # Either a pre-BFD a.out linker (linuxoldld) or one that does not give us
7b3a8b
-	  # useful --help.  Gcc wants to distinguish between linuxoldld and linuxaout.
7b3a8b
-	  test ! -d /usr/lib/ldscripts/. \
7b3a8b
-	    && echo "${UNAME_MACHINE}-unknown-linuxoldld" && exit 0
7b3a8b
-	  # Determine whether the default compiler is a.out or elf
7b3a8b
-	  cat >dummy.c <
7b3a8b
-main(argc, argv)
7b3a8b
-int argc;
7b3a8b
-char *argv[];
7b3a8b
-{
7b3a8b
-#ifdef __ELF__
7b3a8b
-  printf ("%s-unknown-linux\n", argv[1]);
7b3a8b
-#else
7b3a8b
-  printf ("%s-unknown-linuxaout\n", argv[1]);
7b3a8b
-#endif
7b3a8b
-  return 0;
7b3a8b
-}
7b3a8b
+	# the GNU system
7b3a8b
+	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
7b3a8b
+	exit ;;
7b3a8b
+    *:GNU/*:*:*)
7b3a8b
+	# other systems with GNU libc and userland
7b3a8b
+	echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
7b3a8b
+	exit ;;
7b3a8b
+    i*86:Minix:*:*)
7b3a8b
+	echo ${UNAME_MACHINE}-pc-minix
7b3a8b
+	exit ;;
7b3a8b
+    aarch64:Linux:*:*)
7b3a8b
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
7b3a8b
+	exit ;;
7b3a8b
+    aarch64_be:Linux:*:*)
7b3a8b
+	UNAME_MACHINE=aarch64_be
7b3a8b
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
7b3a8b
+	exit ;;
7b3a8b
+    alpha:Linux:*:*)
7b3a8b
+	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
7b3a8b
+	  EV5)   UNAME_MACHINE=alphaev5 ;;
7b3a8b
+	  EV56)  UNAME_MACHINE=alphaev56 ;;
7b3a8b
+	  PCA56) UNAME_MACHINE=alphapca56 ;;
7b3a8b
+	  PCA57) UNAME_MACHINE=alphapca56 ;;
7b3a8b
+	  EV6)   UNAME_MACHINE=alphaev6 ;;
7b3a8b
+	  EV67)  UNAME_MACHINE=alphaev67 ;;
7b3a8b
+	  EV68*) UNAME_MACHINE=alphaev68 ;;
7b3a8b
+	esac
7b3a8b
+	objdump --private-headers /bin/sh | grep -q ld.so.1
7b3a8b
+	if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
7b3a8b
+	echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
7b3a8b
+	exit ;;
7b3a8b
+    arm*:Linux:*:*)
7b3a8b
+	eval $set_cc_for_build
7b3a8b
+	if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
7b3a8b
+	    | grep -q __ARM_EABI__
7b3a8b
+	then
7b3a8b
+	    echo ${UNAME_MACHINE}-unknown-linux-gnu
7b3a8b
+	else
7b3a8b
+	    if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
7b3a8b
+		| grep -q __ARM_PCS_VFP
7b3a8b
+	    then
7b3a8b
+		echo ${UNAME_MACHINE}-unknown-linux-gnueabi
7b3a8b
+	    else
7b3a8b
+		echo ${UNAME_MACHINE}-unknown-linux-gnueabihf
7b3a8b
+	    fi
7b3a8b
+	fi
7b3a8b
+	exit ;;
7b3a8b
+    avr32*:Linux:*:*)
7b3a8b
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
7b3a8b
+	exit ;;
7b3a8b
+    cris:Linux:*:*)
7b3a8b
+	echo ${UNAME_MACHINE}-axis-linux-gnu
7b3a8b
+	exit ;;
7b3a8b
+    crisv32:Linux:*:*)
7b3a8b
+	echo ${UNAME_MACHINE}-axis-linux-gnu
7b3a8b
+	exit ;;
7b3a8b
+    frv:Linux:*:*)
7b3a8b
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
7b3a8b
+	exit ;;
7b3a8b
+    hexagon:Linux:*:*)
7b3a8b
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
7b3a8b
+	exit ;;
7b3a8b
+    i*86:Linux:*:*)
7b3a8b
+	LIBC=gnu
7b3a8b
+	eval $set_cc_for_build
7b3a8b
+	sed 's/^	//' << EOF >$dummy.c
7b3a8b
+	#ifdef __dietlibc__
7b3a8b
+	LIBC=dietlibc
7b3a8b
+	#endif
7b3a8b
+EOF
7b3a8b
+	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
7b3a8b
+	echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
7b3a8b
+	exit ;;
7b3a8b
+    ia64:Linux:*:*)
7b3a8b
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
7b3a8b
+	exit ;;
7b3a8b
+    m32r*:Linux:*:*)
7b3a8b
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
7b3a8b
+	exit ;;
7b3a8b
+    m68*:Linux:*:*)
7b3a8b
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
7b3a8b
+	exit ;;
7b3a8b
+    mips:Linux:*:* | mips64:Linux:*:*)
7b3a8b
+	eval $set_cc_for_build
7b3a8b
+	sed 's/^	//' << EOF >$dummy.c
7b3a8b
+	#undef CPU
7b3a8b
+	#undef ${UNAME_MACHINE}
7b3a8b
+	#undef ${UNAME_MACHINE}el
7b3a8b
+	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
7b3a8b
+	CPU=${UNAME_MACHINE}el
7b3a8b
+	#else
7b3a8b
+	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
7b3a8b
+	CPU=${UNAME_MACHINE}
7b3a8b
+	#else
7b3a8b
+	CPU=
7b3a8b
+	#endif
7b3a8b
+	#endif
7b3a8b
 EOF
7b3a8b
-	  ${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy "${UNAME_MACHINE}" && rm dummy.c dummy && exit 0
7b3a8b
-	  rm -f dummy.c dummy
7b3a8b
-	fi ;;
7b3a8b
-# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.  earlier versions
7b3a8b
-# are messed up and put the nodename in both sysname and nodename.
7b3a8b
-    i[34]86:DYNIX/ptx:4*:*)
7b3a8b
+	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
7b3a8b
+	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
7b3a8b
+	;;
7b3a8b
+    or32:Linux:*:*)
7b3a8b
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
7b3a8b
+	exit ;;
7b3a8b
+    padre:Linux:*:*)
7b3a8b
+	echo sparc-unknown-linux-gnu
7b3a8b
+	exit ;;
7b3a8b
+    parisc64:Linux:*:* | hppa64:Linux:*:*)
7b3a8b
+	echo hppa64-unknown-linux-gnu
7b3a8b
+	exit ;;
7b3a8b
+    parisc:Linux:*:* | hppa:Linux:*:*)
7b3a8b
+	# Look for CPU level
7b3a8b
+	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
7b3a8b
+	  PA7*) echo hppa1.1-unknown-linux-gnu ;;
7b3a8b
+	  PA8*) echo hppa2.0-unknown-linux-gnu ;;
7b3a8b
+	  *)    echo hppa-unknown-linux-gnu ;;
7b3a8b
+	esac
7b3a8b
+	exit ;;
7b3a8b
+    ppc64:Linux:*:*)
7b3a8b
+	echo powerpc64-unknown-linux-gnu
7b3a8b
+	exit ;;
7b3a8b
+    ppc:Linux:*:*)
7b3a8b
+	echo powerpc-unknown-linux-gnu
7b3a8b
+	exit ;;
7b3a8b
+    s390:Linux:*:* | s390x:Linux:*:*)
7b3a8b
+	echo ${UNAME_MACHINE}-ibm-linux
7b3a8b
+	exit ;;
7b3a8b
+    sh64*:Linux:*:*)
7b3a8b
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
7b3a8b
+	exit ;;
7b3a8b
+    sh*:Linux:*:*)
7b3a8b
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
7b3a8b
+	exit ;;
7b3a8b
+    sparc:Linux:*:* | sparc64:Linux:*:*)
7b3a8b
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
7b3a8b
+	exit ;;
7b3a8b
+    tile*:Linux:*:*)
7b3a8b
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
7b3a8b
+	exit ;;
7b3a8b
+    vax:Linux:*:*)
7b3a8b
+	echo ${UNAME_MACHINE}-dec-linux-gnu
7b3a8b
+	exit ;;
7b3a8b
+    x86_64:Linux:*:*)
7b3a8b
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
7b3a8b
+	exit ;;
7b3a8b
+    xtensa*:Linux:*:*)
7b3a8b
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
7b3a8b
+	exit ;;
7b3a8b
+    i*86:DYNIX/ptx:4*:*)
7b3a8b
+	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
7b3a8b
+	# earlier versions are messed up and put the nodename in both
7b3a8b
+	# sysname and nodename.
7b3a8b
 	echo i386-sequent-sysv4
7b3a8b
-	exit 0 ;;
7b3a8b
-    i[34]86:*:4.*:* | i[34]86:SYSTEM_V:4.*:*)
7b3a8b
+	exit ;;
7b3a8b
+    i*86:UNIX_SV:4.2MP:2.*)
7b3a8b
+	# Unixware is an offshoot of SVR4, but it has its own version
7b3a8b
+	# number series starting with 2...
7b3a8b
+	# I am not positive that other SVR4 systems won't match this,
7b3a8b
+	# I just have to hope.  -- rms.
7b3a8b
+	# Use sysv4.2uw... so that sysv4* matches it.
7b3a8b
+	echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
7b3a8b
+	exit ;;
7b3a8b
+    i*86:OS/2:*:*)
7b3a8b
+	# If we were able to find `uname', then EMX Unix compatibility
7b3a8b
+	# is probably installed.
7b3a8b
+	echo ${UNAME_MACHINE}-pc-os2-emx
7b3a8b
+	exit ;;
7b3a8b
+    i*86:XTS-300:*:STOP)
7b3a8b
+	echo ${UNAME_MACHINE}-unknown-stop
7b3a8b
+	exit ;;
7b3a8b
+    i*86:atheos:*:*)
7b3a8b
+	echo ${UNAME_MACHINE}-unknown-atheos
7b3a8b
+	exit ;;
7b3a8b
+    i*86:syllable:*:*)
7b3a8b
+	echo ${UNAME_MACHINE}-pc-syllable
7b3a8b
+	exit ;;
7b3a8b
+    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
7b3a8b
+	echo i386-unknown-lynxos${UNAME_RELEASE}
7b3a8b
+	exit ;;
7b3a8b
+    i*86:*DOS:*:*)
7b3a8b
+	echo ${UNAME_MACHINE}-pc-msdosdjgpp
7b3a8b
+	exit ;;
7b3a8b
+    i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
7b3a8b
+	UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
7b3a8b
 	if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
7b3a8b
-		echo ${UNAME_MACHINE}-univel-sysv${UNAME_RELEASE}
7b3a8b
+		echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
7b3a8b
 	else
7b3a8b
-		echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}
7b3a8b
+		echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
7b3a8b
 	fi
7b3a8b
-	exit 0 ;;
7b3a8b
-    i[34]86:*:3.2:*)
7b3a8b
+	exit ;;
7b3a8b
+    i*86:*:5:[678]*)
7b3a8b
+	# UnixWare 7.x, OpenUNIX and OpenServer 6.
7b3a8b
+	case `/bin/uname -X | grep "^Machine"` in
7b3a8b
+	    *486*)	     UNAME_MACHINE=i486 ;;
7b3a8b
+	    *Pentium)	     UNAME_MACHINE=i586 ;;
7b3a8b
+	    *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
7b3a8b
+	esac
7b3a8b
+	echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
7b3a8b
+	exit ;;
7b3a8b
+    i*86:*:3.2:*)
7b3a8b
 	if test -f /usr/options/cb.name; then
7b3a8b
 		UNAME_REL=`sed -n 's/.*Version //p' 
7b3a8b
-		echo ${UNAME_MACHINE}-unknown-isc$UNAME_REL
7b3a8b
+		echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
7b3a8b
 	elif /bin/uname -X 2>/dev/null >/dev/null ; then
7b3a8b
-		UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')`
7b3a8b
-		(/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
7b3a8b
-		(/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \
7b3a8b
+		UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
7b3a8b
+		(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
7b3a8b
+		(/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
7b3a8b
 			&& UNAME_MACHINE=i586
7b3a8b
-		echo ${UNAME_MACHINE}-unknown-sco$UNAME_REL
7b3a8b
+		(/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
7b3a8b
+			&& UNAME_MACHINE=i686
7b3a8b
+		(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
7b3a8b
+			&& UNAME_MACHINE=i686
7b3a8b
+		echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
7b3a8b
 	else
7b3a8b
-		echo ${UNAME_MACHINE}-unknown-sysv32
7b3a8b
+		echo ${UNAME_MACHINE}-pc-sysv32
7b3a8b
 	fi
7b3a8b
-	exit 0 ;;
7b3a8b
+	exit ;;
7b3a8b
+    pc:*:*:*)
7b3a8b
+	# Left here for compatibility:
7b3a8b
+	# uname -m prints for DJGPP always 'pc', but it prints nothing about
7b3a8b
+	# the processor, so we play safe by assuming i586.
7b3a8b
+	# Note: whatever this is, it MUST be the same as what config.sub
7b3a8b
+	# prints for the "djgpp" host, or else GDB configury will decide that
7b3a8b
+	# this is a cross-build.
7b3a8b
+	echo i586-pc-msdosdjgpp
7b3a8b
+	exit ;;
7b3a8b
     Intel:Mach:3*:*)
7b3a8b
-	echo i386-unknown-mach3
7b3a8b
-	exit 0 ;;
7b3a8b
+	echo i386-pc-mach3
7b3a8b
+	exit ;;
7b3a8b
     paragon:*:*:*)
7b3a8b
 	echo i860-intel-osf1
7b3a8b
-	exit 0 ;;
7b3a8b
+	exit ;;
7b3a8b
     i860:*:4.*:*) # i860-SVR4
7b3a8b
 	if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
7b3a8b
 	  echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
7b3a8b
 	else # Add other i860-SVR4 vendors below as they are discovered.
7b3a8b
 	  echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
7b3a8b
 	fi
7b3a8b
-	exit 0 ;;
7b3a8b
+	exit ;;
7b3a8b
     mini*:CTIX:SYS*5:*)
7b3a8b
 	# "miniframe"
7b3a8b
 	echo m68010-convergent-sysv
7b3a8b
-	exit 0 ;;
7b3a8b
-    M680[234]0:*:R3V[567]*:*)
7b3a8b
-	test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
7b3a8b
-    3[34]??:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0)
7b3a8b
-        uname -p 2>/dev/null | grep 86 >/dev/null \
7b3a8b
-          && echo i486-ncr-sysv4.3 && exit 0 ;;
7b3a8b
+	exit ;;
7b3a8b
+    mc68k:UNIX:SYSTEM5:3.51m)
7b3a8b
+	echo m68k-convergent-sysv
7b3a8b
+	exit ;;
7b3a8b
+    M680?0:D-NIX:5.3:*)
7b3a8b
+	echo m68k-diab-dnix
7b3a8b
+	exit ;;
7b3a8b
+    M68*:*:R3V[5678]*:*)
7b3a8b
+	test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
7b3a8b
+    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)
7b3a8b
+	OS_REL=''
7b3a8b
+	test -r /etc/.relid \
7b3a8b
+	&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
7b3a8b
+	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
7b3a8b
+	  && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
7b3a8b
+	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
7b3a8b
+	  && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
7b3a8b
     3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
7b3a8b
-        uname -p 2>/dev/null | grep 86 >/dev/null \
7b3a8b
-          && echo i486-ncr-sysv4 && exit 0 ;;
7b3a8b
-    m680[234]0:LynxOS:2.[23]*:*)
7b3a8b
-	echo m68k-lynx-lynxos${UNAME_RELEASE}
7b3a8b
-	exit 0 ;;
7b3a8b
+	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
7b3a8b
+	  && { echo i486-ncr-sysv4; exit; } ;;
7b3a8b
+    NCR*:*:4.2:* | MPRAS*:*:4.2:*)
7b3a8b
+	OS_REL='.3'
7b3a8b
+	test -r /etc/.relid \
7b3a8b
+	    && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
7b3a8b
+	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
7b3a8b
+	    && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
7b3a8b
+	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
7b3a8b
+	    && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
7b3a8b
+	/bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
7b3a8b
+	    && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
7b3a8b
+    m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
7b3a8b
+	echo m68k-unknown-lynxos${UNAME_RELEASE}
7b3a8b
+	exit ;;
7b3a8b
     mc68030:UNIX_System_V:4.*:*)
7b3a8b
 	echo m68k-atari-sysv4
7b3a8b
-	exit 0 ;;
7b3a8b
-    i[34]86:LynxOS:2.[23]*:*)
7b3a8b
-	echo i386-lynx-lynxos${UNAME_RELEASE}
7b3a8b
-	exit 0 ;;
7b3a8b
-    TSUNAMI:LynxOS:2.[23]*:*)
7b3a8b
-	echo sparc-lynx-lynxos${UNAME_RELEASE}
7b3a8b
-	exit 0 ;;
7b3a8b
-    rs6000:LynxOS:2.[23]*:*)
7b3a8b
-	echo rs6000-lynx-lynxos${UNAME_RELEASE}
7b3a8b
-	exit 0 ;;
7b3a8b
+	exit ;;
7b3a8b
+    TSUNAMI:LynxOS:2.*:*)
7b3a8b
+	echo sparc-unknown-lynxos${UNAME_RELEASE}
7b3a8b
+	exit ;;
7b3a8b
+    rs6000:LynxOS:2.*:*)
7b3a8b
+	echo rs6000-unknown-lynxos${UNAME_RELEASE}
7b3a8b
+	exit ;;
7b3a8b
+    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
7b3a8b
+	echo powerpc-unknown-lynxos${UNAME_RELEASE}
7b3a8b
+	exit ;;
7b3a8b
+    SM[BE]S:UNIX_SV:*:*)
7b3a8b
+	echo mips-dde-sysv${UNAME_RELEASE}
7b3a8b
+	exit ;;
7b3a8b
+    RM*:ReliantUNIX-*:*:*)
7b3a8b
+	echo mips-sni-sysv4
7b3a8b
+	exit ;;
7b3a8b
     RM*:SINIX-*:*:*)
7b3a8b
 	echo mips-sni-sysv4
7b3a8b
-	exit 0 ;;
7b3a8b
+	exit ;;
7b3a8b
     *:SINIX-*:*:*)
7b3a8b
 	if uname -p 2>/dev/null >/dev/null ; then
7b3a8b
 		UNAME_MACHINE=`(uname -p) 2>/dev/null`
7b3a8b
@@ -448,23 +1161,187 @@
7b3a8b
 	else
7b3a8b
 		echo ns32k-sni-sysv
7b3a8b
 	fi
7b3a8b
-	exit 0 ;;
7b3a8b
+	exit ;;
7b3a8b
+    PENTIUM:*:4.0*:*)	# Unisys `ClearPath HMP IX 4000' SVR4/MP effort
7b3a8b
+			# says <Richard.M.Bartel@ccMail.Census.GOV>
7b3a8b
+	echo i586-unisys-sysv4
7b3a8b
+	exit ;;
7b3a8b
+    *:UNIX_System_V:4*:FTX*)
7b3a8b
+	# From Gerald Hewes <hewes@openmarket.com>.
7b3a8b
+	# How about differentiating between stratus architectures? -djm
7b3a8b
+	echo hppa1.1-stratus-sysv4
7b3a8b
+	exit ;;
7b3a8b
+    *:*:*:FTX*)
7b3a8b
+	# From seanf@swdc.stratus.com.
7b3a8b
+	echo i860-stratus-sysv4
7b3a8b
+	exit ;;
7b3a8b
+    i*86:VOS:*:*)
7b3a8b
+	# From Paul.Green@stratus.com.
7b3a8b
+	echo ${UNAME_MACHINE}-stratus-vos
7b3a8b
+	exit ;;
7b3a8b
+    *:VOS:*:*)
7b3a8b
+	# From Paul.Green@stratus.com.
7b3a8b
+	echo hppa1.1-stratus-vos
7b3a8b
+	exit ;;
7b3a8b
     mc68*:A/UX:*:*)
7b3a8b
 	echo m68k-apple-aux${UNAME_RELEASE}
7b3a8b
-	exit 0 ;;
7b3a8b
-    R3000:*System_V*:*:*)
7b3a8b
+	exit ;;
7b3a8b
+    news*:NEWS-OS:6*:*)
7b3a8b
+	echo mips-sony-newsos6
7b3a8b
+	exit ;;
7b3a8b
+    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
7b3a8b
 	if [ -d /usr/nec ]; then
7b3a8b
-	        echo mips-nec-sysv${UNAME_RELEASE}
7b3a8b
+		echo mips-nec-sysv${UNAME_RELEASE}
7b3a8b
 	else
7b3a8b
-	        echo mips-unknown-sysv${UNAME_RELEASE}
7b3a8b
+		echo mips-unknown-sysv${UNAME_RELEASE}
7b3a8b
+	fi
7b3a8b
+	exit ;;
7b3a8b
+    BeBox:BeOS:*:*)	# BeOS running on hardware made by Be, PPC only.
7b3a8b
+	echo powerpc-be-beos
7b3a8b
+	exit ;;
7b3a8b
+    BeMac:BeOS:*:*)	# BeOS running on Mac or Mac clone, PPC only.
7b3a8b
+	echo powerpc-apple-beos
7b3a8b
+	exit ;;
7b3a8b
+    BePC:BeOS:*:*)	# BeOS running on Intel PC compatible.
7b3a8b
+	echo i586-pc-beos
7b3a8b
+	exit ;;
7b3a8b
+    BePC:Haiku:*:*)	# Haiku running on Intel PC compatible.
7b3a8b
+	echo i586-pc-haiku
7b3a8b
+	exit ;;
7b3a8b
+    x86_64:Haiku:*:*)
7b3a8b
+	echo x86_64-unknown-haiku
7b3a8b
+	exit ;;
7b3a8b
+    SX-4:SUPER-UX:*:*)
7b3a8b
+	echo sx4-nec-superux${UNAME_RELEASE}
7b3a8b
+	exit ;;
7b3a8b
+    SX-5:SUPER-UX:*:*)
7b3a8b
+	echo sx5-nec-superux${UNAME_RELEASE}
7b3a8b
+	exit ;;
7b3a8b
+    SX-6:SUPER-UX:*:*)
7b3a8b
+	echo sx6-nec-superux${UNAME_RELEASE}
7b3a8b
+	exit ;;
7b3a8b
+    SX-7:SUPER-UX:*:*)
7b3a8b
+	echo sx7-nec-superux${UNAME_RELEASE}
7b3a8b
+	exit ;;
7b3a8b
+    SX-8:SUPER-UX:*:*)
7b3a8b
+	echo sx8-nec-superux${UNAME_RELEASE}
7b3a8b
+	exit ;;
7b3a8b
+    SX-8R:SUPER-UX:*:*)
7b3a8b
+	echo sx8r-nec-superux${UNAME_RELEASE}
7b3a8b
+	exit ;;
7b3a8b
+    Power*:Rhapsody:*:*)
7b3a8b
+	echo powerpc-apple-rhapsody${UNAME_RELEASE}
7b3a8b
+	exit ;;
7b3a8b
+    *:Rhapsody:*:*)
7b3a8b
+	echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
7b3a8b
+	exit ;;
7b3a8b
+    *:Darwin:*:*)
7b3a8b
+	UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
7b3a8b
+	case $UNAME_PROCESSOR in
7b3a8b
+	    i386)
7b3a8b
+		eval $set_cc_for_build
7b3a8b
+		if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
7b3a8b
+		  if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
7b3a8b
+		      (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
7b3a8b
+		      grep IS_64BIT_ARCH >/dev/null
7b3a8b
+		  then
7b3a8b
+		      UNAME_PROCESSOR="x86_64"
7b3a8b
+		  fi
7b3a8b
+		fi ;;
7b3a8b
+	    unknown) UNAME_PROCESSOR=powerpc ;;
7b3a8b
+	esac
7b3a8b
+	echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
7b3a8b
+	exit ;;
7b3a8b
+    *:procnto*:*:* | *:QNX:[0123456789]*:*)
7b3a8b
+	UNAME_PROCESSOR=`uname -p`
7b3a8b
+	if test "$UNAME_PROCESSOR" = "x86"; then
7b3a8b
+		UNAME_PROCESSOR=i386
7b3a8b
+		UNAME_MACHINE=pc
7b3a8b
 	fi
7b3a8b
-        exit 0 ;;
7b3a8b
+	echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
7b3a8b
+	exit ;;
7b3a8b
+    *:QNX:*:4*)
7b3a8b
+	echo i386-pc-qnx
7b3a8b
+	exit ;;
7b3a8b
+    NEO-?:NONSTOP_KERNEL:*:*)
7b3a8b
+	echo neo-tandem-nsk${UNAME_RELEASE}
7b3a8b
+	exit ;;
7b3a8b
+    NSE-*:NONSTOP_KERNEL:*:*)
7b3a8b
+	echo nse-tandem-nsk${UNAME_RELEASE}
7b3a8b
+	exit ;;
7b3a8b
+    NSR-?:NONSTOP_KERNEL:*:*)
7b3a8b
+	echo nsr-tandem-nsk${UNAME_RELEASE}
7b3a8b
+	exit ;;
7b3a8b
+    *:NonStop-UX:*:*)
7b3a8b
+	echo mips-compaq-nonstopux
7b3a8b
+	exit ;;
7b3a8b
+    BS2000:POSIX*:*:*)
7b3a8b
+	echo bs2000-siemens-sysv
7b3a8b
+	exit ;;
7b3a8b
+    DS/*:UNIX_System_V:*:*)
7b3a8b
+	echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
7b3a8b
+	exit ;;
7b3a8b
+    *:Plan9:*:*)
7b3a8b
+	# "uname -m" is not consistent, so use $cputype instead. 386
7b3a8b
+	# is converted to i386 for consistency with other x86
7b3a8b
+	# operating systems.
7b3a8b
+	if test "$cputype" = "386"; then
7b3a8b
+	    UNAME_MACHINE=i386
7b3a8b
+	else
7b3a8b
+	    UNAME_MACHINE="$cputype"
7b3a8b
+	fi
7b3a8b
+	echo ${UNAME_MACHINE}-unknown-plan9
7b3a8b
+	exit ;;
7b3a8b
+    *:TOPS-10:*:*)
7b3a8b
+	echo pdp10-unknown-tops10
7b3a8b
+	exit ;;
7b3a8b
+    *:TENEX:*:*)
7b3a8b
+	echo pdp10-unknown-tenex
7b3a8b
+	exit ;;
7b3a8b
+    KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
7b3a8b
+	echo pdp10-dec-tops20
7b3a8b
+	exit ;;
7b3a8b
+    XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
7b3a8b
+	echo pdp10-xkl-tops20
7b3a8b
+	exit ;;
7b3a8b
+    *:TOPS-20:*:*)
7b3a8b
+	echo pdp10-unknown-tops20
7b3a8b
+	exit ;;
7b3a8b
+    *:ITS:*:*)
7b3a8b
+	echo pdp10-unknown-its
7b3a8b
+	exit ;;
7b3a8b
+    SEI:*:*:SEIUX)
7b3a8b
+	echo mips-sei-seiux${UNAME_RELEASE}
7b3a8b
+	exit ;;
7b3a8b
+    *:DragonFly:*:*)
7b3a8b
+	echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
7b3a8b
+	exit ;;
7b3a8b
+    *:*VMS:*:*)
7b3a8b
+	UNAME_MACHINE=`(uname -p) 2>/dev/null`
7b3a8b
+	case "${UNAME_MACHINE}" in
7b3a8b
+	    A*) echo alpha-dec-vms ; exit ;;
7b3a8b
+	    I*) echo ia64-dec-vms ; exit ;;
7b3a8b
+	    V*) echo vax-dec-vms ; exit ;;
7b3a8b
+	esac ;;
7b3a8b
+    *:XENIX:*:SysV)
7b3a8b
+	echo i386-pc-xenix
7b3a8b
+	exit ;;
7b3a8b
+    i*86:skyos:*:*)
7b3a8b
+	echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
7b3a8b
+	exit ;;
7b3a8b
+    i*86:rdos:*:*)
7b3a8b
+	echo ${UNAME_MACHINE}-pc-rdos
7b3a8b
+	exit ;;
7b3a8b
+    i*86:AROS:*:*)
7b3a8b
+	echo ${UNAME_MACHINE}-pc-aros
7b3a8b
+	exit ;;
7b3a8b
+    x86_64:VMkernel:*:*)
7b3a8b
+	echo ${UNAME_MACHINE}-unknown-esx
7b3a8b
+	exit ;;
7b3a8b
 esac
7b3a8b
 
7b3a8b
-#echo '(No uname command or uname output not recognized.)' 1>&2
7b3a8b
-#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
7b3a8b
-
7b3a8b
-cat >dummy.c <
7b3a8b
+eval $set_cc_for_build
7b3a8b
+cat >$dummy.c <
7b3a8b
 #ifdef _SEQUENT_
7b3a8b
 # include <sys/types.h>
7b3a8b
 # include <sys/utsname.h>
7b3a8b
@@ -480,16 +1357,16 @@
7b3a8b
 #include <sys/param.h>
7b3a8b
   printf ("m68k-sony-newsos%s\n",
7b3a8b
 #ifdef NEWSOS4
7b3a8b
-          "4"
7b3a8b
+	"4"
7b3a8b
 #else
7b3a8b
-	  ""
7b3a8b
+	""
7b3a8b
 #endif
7b3a8b
-         ); exit (0);
7b3a8b
+	); exit (0);
7b3a8b
 #endif
7b3a8b
 #endif
7b3a8b
 
7b3a8b
 #if defined (__arm) && defined (__acorn) && defined (__unix)
7b3a8b
-  printf ("arm-acorn-riscix"); exit (0);
7b3a8b
+  printf ("arm-acorn-riscix\n"); exit (0);
7b3a8b
 #endif
7b3a8b
 
7b3a8b
 #if defined (hp300) && !defined (hpux)
7b3a8b
@@ -502,7 +1379,10 @@
7b3a8b
 #endif
7b3a8b
   int version;
7b3a8b
   version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
7b3a8b
-  printf ("%s-next-nextstep%s\n", __ARCHITECTURE__,  version==2 ? "2" : "3");
7b3a8b
+  if (version < 4)
7b3a8b
+    printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
7b3a8b
+  else
7b3a8b
+    printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
7b3a8b
   exit (0);
7b3a8b
 #endif
7b3a8b
 
7b3a8b
@@ -519,7 +1399,7 @@
7b3a8b
 #endif
7b3a8b
 
7b3a8b
 #if defined (__386BSD__)
7b3a8b
-  printf ("i386-unknown-bsd\n"); exit (0);
7b3a8b
+  printf ("i386-pc-bsd\n"); exit (0);
7b3a8b
 #endif
7b3a8b
 
7b3a8b
 #if defined (sequent)
7b3a8b
@@ -547,11 +1427,24 @@
7b3a8b
 #endif
7b3a8b
 
7b3a8b
 #if defined (vax)
7b3a8b
-#if !defined (ultrix)
7b3a8b
-  printf ("vax-dec-bsd\n"); exit (0);
7b3a8b
-#else
7b3a8b
-  printf ("vax-dec-ultrix\n"); exit (0);
7b3a8b
-#endif
7b3a8b
+# if !defined (ultrix)
7b3a8b
+#  include <sys/param.h>
7b3a8b
+#  if defined (BSD)
7b3a8b
+#   if BSD == 43
7b3a8b
+      printf ("vax-dec-bsd4.3\n"); exit (0);
7b3a8b
+#   else
7b3a8b
+#    if BSD == 199006
7b3a8b
+      printf ("vax-dec-bsd4.3reno\n"); exit (0);
7b3a8b
+#    else
7b3a8b
+      printf ("vax-dec-bsd\n"); exit (0);
7b3a8b
+#    endif
7b3a8b
+#   endif
7b3a8b
+#  else
7b3a8b
+    printf ("vax-dec-bsd\n"); exit (0);
7b3a8b
+#  endif
7b3a8b
+# else
7b3a8b
+    printf ("vax-dec-ultrix\n"); exit (0);
7b3a8b
+# endif
7b3a8b
 #endif
7b3a8b
 
7b3a8b
 #if defined (alliant) && defined (i860)
7b3a8b
@@ -562,12 +1455,12 @@
7b3a8b
 }
7b3a8b
 EOF
7b3a8b
 
7b3a8b
-${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy && rm dummy.c dummy && exit 0
7b3a8b
-rm -f dummy.c dummy
7b3a8b
+$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
7b3a8b
+	{ echo "$SYSTEM_NAME"; exit; }
7b3a8b
 
7b3a8b
 # Apollos put the system type in the environment.
7b3a8b
 
7b3a8b
-test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; }
7b3a8b
+test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
7b3a8b
 
7b3a8b
 # Convex versions that predate uname can use getsysinfo(1)
7b3a8b
 
7b3a8b
@@ -576,25 +1469,69 @@
7b3a8b
     case `getsysinfo -f cpu_type` in
7b3a8b
     c1*)
7b3a8b
 	echo c1-convex-bsd
7b3a8b
-	exit 0 ;;
7b3a8b
+	exit ;;
7b3a8b
     c2*)
7b3a8b
 	if getsysinfo -f scalar_acc
7b3a8b
 	then echo c32-convex-bsd
7b3a8b
 	else echo c2-convex-bsd
7b3a8b
 	fi
7b3a8b
-	exit 0 ;;
7b3a8b
+	exit ;;
7b3a8b
     c34*)
7b3a8b
 	echo c34-convex-bsd
7b3a8b
-	exit 0 ;;
7b3a8b
+	exit ;;
7b3a8b
     c38*)
7b3a8b
 	echo c38-convex-bsd
7b3a8b
-	exit 0 ;;
7b3a8b
+	exit ;;
7b3a8b
     c4*)
7b3a8b
 	echo c4-convex-bsd
7b3a8b
-	exit 0 ;;
7b3a8b
+	exit ;;
7b3a8b
     esac
7b3a8b
 fi
7b3a8b
 
7b3a8b
-#echo '(Unable to guess system type)' 1>&2
7b3a8b
+cat >&2 <
7b3a8b
+$0: unable to guess system type
7b3a8b
+
7b3a8b
+This script, last modified $timestamp, has failed to recognize
7b3a8b
+the operating system you are using. It is advised that you
7b3a8b
+download the most up to date version of the config scripts from
7b3a8b
+
7b3a8b
+  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
7b3a8b
+and
7b3a8b
+  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
7b3a8b
+
7b3a8b
+If the version you run ($0) is already up to date, please
7b3a8b
+send the following data and any information you think might be
7b3a8b
+pertinent to <config-patches@gnu.org> in order to provide the needed
7b3a8b
+information to handle your system.
7b3a8b
+
7b3a8b
+config.guess timestamp = $timestamp
7b3a8b
+
7b3a8b
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
7b3a8b
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
7b3a8b
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
7b3a8b
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
7b3a8b
+
7b3a8b
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
7b3a8b
+/bin/uname -X     = `(/bin/uname -X) 2>/dev/null`
7b3a8b
+
7b3a8b
+hostinfo               = `(hostinfo) 2>/dev/null`
7b3a8b
+/bin/universe          = `(/bin/universe) 2>/dev/null`
7b3a8b
+/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null`
7b3a8b
+/bin/arch              = `(/bin/arch) 2>/dev/null`
7b3a8b
+/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`
7b3a8b
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
7b3a8b
+
7b3a8b
+UNAME_MACHINE = ${UNAME_MACHINE}
7b3a8b
+UNAME_RELEASE = ${UNAME_RELEASE}
7b3a8b
+UNAME_SYSTEM  = ${UNAME_SYSTEM}
7b3a8b
+UNAME_VERSION = ${UNAME_VERSION}
7b3a8b
+EOF
7b3a8b
 
7b3a8b
 exit 1
7b3a8b
+
7b3a8b
+# Local variables:
7b3a8b
+# eval: (add-hook 'write-file-hooks 'time-stamp)
7b3a8b
+# time-stamp-start: "timestamp='"
7b3a8b
+# time-stamp-format: "%:y-%02m-%02d"
7b3a8b
+# time-stamp-end: "'"
7b3a8b
+# End:
7b3a8b
diff -urN lrzsz-0.12.20/config.sub lrzsz-0.12.20-aarch64/config.sub
7b3a8b
--- lrzsz-0.12.20/config.sub	1998-04-26 08:20:59.000000000 -0500
7b3a8b
+++ lrzsz-0.12.20-aarch64/config.sub	2013-03-03 06:20:16.433777416 -0600
7b3a8b
@@ -1,9 +1,14 @@
7b3a8b
 #! /bin/sh
7b3a8b
-# Configuration validation subroutine script, version 1.1.
7b3a8b
-#   Copyright (C) 1991, 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
7b3a8b
+# Configuration validation subroutine script.
7b3a8b
+#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
7b3a8b
+#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
7b3a8b
+#   2011, 2012 Free Software Foundation, Inc.
7b3a8b
+
7b3a8b
+timestamp='2012-10-10'
7b3a8b
+
7b3a8b
 # This file is (in principle) common to ALL GNU software.
7b3a8b
 # The presence of a machine in this file suggests that SOME GNU software
7b3a8b
-# can handle that machine.  It does not imply ALL GNU software can. 
7b3a8b
+# can handle that machine.  It does not imply ALL GNU software can.
7b3a8b
 #
7b3a8b
 # This file is free software; you can redistribute it and/or modify
7b3a8b
 # it under the terms of the GNU General Public License as published by
7b3a8b
@@ -16,20 +21,25 @@
7b3a8b
 # GNU General Public License for more details.
7b3a8b
 #
7b3a8b
 # You should have received a copy of the GNU General Public License
7b3a8b
-# along with this program; if not, write to the Free Software
7b3a8b
-# Foundation, Inc., 59 Temple Place - Suite 330,
7b3a8b
-# Boston, MA 02111-1307, USA.
7b3a8b
-
7b3a8b
+# along with this program; if not, see <http://www.gnu.org/licenses/>.
7b3a8b
+#
7b3a8b
 # As a special exception to the GNU General Public License, if you
7b3a8b
 # distribute this file as part of a program that contains a
7b3a8b
 # configuration script generated by Autoconf, you may include it under
7b3a8b
 # the same distribution terms that you use for the rest of that program.
7b3a8b
 
7b3a8b
+
7b3a8b
+# Please send patches to <config-patches@gnu.org>.  Submit a context
7b3a8b
+# diff and a properly formatted GNU ChangeLog entry.
7b3a8b
+#
7b3a8b
 # Configuration subroutine to validate and canonicalize a configuration type.
7b3a8b
 # Supply the specified configuration type as an argument.
7b3a8b
 # If it is invalid, we print an error message on stderr and exit with code 1.
7b3a8b
 # Otherwise, we print the canonical config type on stdout and succeed.
7b3a8b
 
7b3a8b
+# You can get the latest version of this script from:
7b3a8b
+# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
7b3a8b
+
7b3a8b
 # This file is supposed to be the same for all GNU packages
7b3a8b
 # and recognize all the CPU types, system types and aliases
7b3a8b
 # that are meaningful with *any* GNU software.
7b3a8b
@@ -41,32 +51,96 @@
7b3a8b
 # The goal of this file is to map all the various variations of a given
7b3a8b
 # machine specification into a single specification in the form:
7b3a8b
 #	CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
7b3a8b
+# or in some cases, the newer four-part form:
7b3a8b
+#	CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
7b3a8b
 # It is wrong to echo any other type of specification.
7b3a8b
 
7b3a8b
-if [ x$1 = x ]
7b3a8b
-then
7b3a8b
-	echo Configuration name missing. 1>&2
7b3a8b
-	echo "Usage: $0 CPU-MFR-OPSYS" 1>&2
7b3a8b
-	echo "or     $0 ALIAS" 1>&2
7b3a8b
-	echo where ALIAS is a recognized configuration type. 1>&2
7b3a8b
-	exit 1
7b3a8b
-fi
7b3a8b
+me=`echo "$0" | sed -e 's,.*/,,'`
7b3a8b
 
7b3a8b
-# First pass through any local machine types.
7b3a8b
-case $1 in
7b3a8b
-	*local*)
7b3a8b
-		echo $1
7b3a8b
-		exit 0
7b3a8b
-		;;
7b3a8b
-	*)
7b3a8b
-	;;
7b3a8b
+usage="\
7b3a8b
+Usage: $0 [OPTION] CPU-MFR-OPSYS
7b3a8b
+       $0 [OPTION] ALIAS
7b3a8b
+
7b3a8b
+Canonicalize a configuration name.
7b3a8b
+
7b3a8b
+Operation modes:
7b3a8b
+  -h, --help         print this help, then exit
7b3a8b
+  -t, --time-stamp   print date of last modification, then exit
7b3a8b
+  -v, --version      print version number, then exit
7b3a8b
+
7b3a8b
+Report bugs and patches to <config-patches@gnu.org>."
7b3a8b
+
7b3a8b
+version="\
7b3a8b
+GNU config.sub ($timestamp)
7b3a8b
+
7b3a8b
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
7b3a8b
+2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
7b3a8b
+Free Software Foundation, Inc.
7b3a8b
+
7b3a8b
+This is free software; see the source for copying conditions.  There is NO
7b3a8b
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
7b3a8b
+
7b3a8b
+help="
7b3a8b
+Try \`$me --help' for more information."
7b3a8b
+
7b3a8b
+# Parse command line
7b3a8b
+while test $# -gt 0 ; do
7b3a8b
+  case $1 in
7b3a8b
+    --time-stamp | --time* | -t )
7b3a8b
+       echo "$timestamp" ; exit ;;
7b3a8b
+    --version | -v )
7b3a8b
+       echo "$version" ; exit ;;
7b3a8b
+    --help | --h* | -h )
7b3a8b
+       echo "$usage"; exit ;;
7b3a8b
+    -- )     # Stop option processing
7b3a8b
+       shift; break ;;
7b3a8b
+    - )	# Use stdin as input.
7b3a8b
+       break ;;
7b3a8b
+    -* )
7b3a8b
+       echo "$me: invalid option $1$help"
7b3a8b
+       exit 1 ;;
7b3a8b
+
7b3a8b
+    *local*)
7b3a8b
+       # First pass through any local machine types.
7b3a8b
+       echo $1
7b3a8b
+       exit ;;
7b3a8b
+
7b3a8b
+    * )
7b3a8b
+       break ;;
7b3a8b
+  esac
7b3a8b
+done
7b3a8b
+
7b3a8b
+case $# in
7b3a8b
+ 0) echo "$me: missing argument$help" >&2
7b3a8b
+    exit 1;;
7b3a8b
+ 1) ;;
7b3a8b
+ *) echo "$me: too many arguments$help" >&2
7b3a8b
+    exit 1;;
7b3a8b
 esac
7b3a8b
 
7b3a8b
-# Separate what the user gave into CPU-COMPANY and OS (if any).
7b3a8b
-basic_machine=`echo $1 | sed 's/-[^-]*$//'`
7b3a8b
-if [ $basic_machine != $1 ]
7b3a8b
-then os=`echo $1 | sed 's/.*-/-/'`
7b3a8b
-else os=; fi
7b3a8b
+# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
7b3a8b
+# Here we must recognize all the valid KERNEL-OS combinations.
7b3a8b
+maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
7b3a8b
+case $maybe_os in
7b3a8b
+  nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
7b3a8b
+  linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
7b3a8b
+  knetbsd*-gnu* | netbsd*-gnu* | \
7b3a8b
+  kopensolaris*-gnu* | \
7b3a8b
+  storm-chaos* | os2-emx* | rtmk-nova*)
7b3a8b
+    os=-$maybe_os
7b3a8b
+    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
7b3a8b
+    ;;
7b3a8b
+  android-linux)
7b3a8b
+    os=-linux-android
7b3a8b
+    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
7b3a8b
+    ;;
7b3a8b
+  *)
7b3a8b
+    basic_machine=`echo $1 | sed 's/-[^-]*$//'`
7b3a8b
+    if [ $basic_machine != $1 ]
7b3a8b
+    then os=`echo $1 | sed 's/.*-/-/'`
7b3a8b
+    else os=; fi
7b3a8b
+    ;;
7b3a8b
+esac
7b3a8b
 
7b3a8b
 ### Let's recognize common machines as not being operating systems so
7b3a8b
 ### that things like config.sub decstation-3100 work.  We also
7b3a8b
@@ -81,38 +155,81 @@
7b3a8b
 	-unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
7b3a8b
 	-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
7b3a8b
 	-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
7b3a8b
-	-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp )
7b3a8b
+	-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
7b3a8b
+	-apple | -axis | -knuth | -cray | -microblaze*)
7b3a8b
+		os=
7b3a8b
+		basic_machine=$1
7b3a8b
+		;;
7b3a8b
+	-bluegene*)
7b3a8b
+		os=-cnk
7b3a8b
+		;;
7b3a8b
+	-sim | -cisco | -oki | -wec | -winbond)
7b3a8b
 		os=
7b3a8b
 		basic_machine=$1
7b3a8b
 		;;
7b3a8b
+	-scout)
7b3a8b
+		;;
7b3a8b
+	-wrs)
7b3a8b
+		os=-vxworks
7b3a8b
+		basic_machine=$1
7b3a8b
+		;;
7b3a8b
+	-chorusos*)
7b3a8b
+		os=-chorusos
7b3a8b
+		basic_machine=$1
7b3a8b
+		;;
7b3a8b
+	-chorusrdb)
7b3a8b
+		os=-chorusrdb
7b3a8b
+		basic_machine=$1
7b3a8b
+		;;
7b3a8b
 	-hiux*)
7b3a8b
 		os=-hiuxwe2
7b3a8b
 		;;
7b3a8b
+	-sco6)
7b3a8b
+		os=-sco5v6
7b3a8b
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
7b3a8b
+		;;
7b3a8b
+	-sco5)
7b3a8b
+		os=-sco3.2v5
7b3a8b
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
7b3a8b
+		;;
7b3a8b
 	-sco4)
7b3a8b
 		os=-sco3.2v4
7b3a8b
-		basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'`
7b3a8b
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
7b3a8b
 		;;
7b3a8b
 	-sco3.2.[4-9]*)
7b3a8b
 		os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
7b3a8b
-		basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'`
7b3a8b
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
7b3a8b
 		;;
7b3a8b
 	-sco3.2v[4-9]*)
7b3a8b
 		# Don't forget version if it is 3.2v4 or newer.
7b3a8b
-		basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'`
7b3a8b
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
7b3a8b
+		;;
7b3a8b
+	-sco5v6*)
7b3a8b
+		# Don't forget version if it is 3.2v4 or newer.
7b3a8b
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
7b3a8b
 		;;
7b3a8b
 	-sco*)
7b3a8b
 		os=-sco3.2v2
7b3a8b
-		basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'`
7b3a8b
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
7b3a8b
+		;;
7b3a8b
+	-udk*)
7b3a8b
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
7b3a8b
 		;;
7b3a8b
 	-isc)
7b3a8b
 		os=-isc2.2
7b3a8b
-		basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'`
7b3a8b
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
7b3a8b
 		;;
7b3a8b
 	-clix*)
7b3a8b
 		basic_machine=clipper-intergraph
7b3a8b
 		;;
7b3a8b
 	-isc*)
7b3a8b
-		basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'`
7b3a8b
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
7b3a8b
+		;;
7b3a8b
+	-lynx*178)
7b3a8b
+		os=-lynxos178
7b3a8b
+		;;
7b3a8b
+	-lynx*5)
7b3a8b
+		os=-lynxos5
7b3a8b
 		;;
7b3a8b
 	-lynx*)
7b3a8b
 		os=-lynxos
7b3a8b
@@ -123,44 +240,232 @@
7b3a8b
 	-windowsnt*)
7b3a8b
 		os=`echo $os | sed -e 's/windowsnt/winnt/'`
7b3a8b
 		;;
7b3a8b
+	-psos*)
7b3a8b
+		os=-psos
7b3a8b
+		;;
7b3a8b
+	-mint | -mint[0-9]*)
7b3a8b
+		basic_machine=m68k-atari
7b3a8b
+		os=-mint
7b3a8b
+		;;
7b3a8b
 esac
7b3a8b
 
7b3a8b
 # Decode aliases for certain CPU-COMPANY combinations.
7b3a8b
 case $basic_machine in
7b3a8b
 	# Recognize the basic CPU types without company name.
7b3a8b
 	# Some are omitted here because they have special meanings below.
7b3a8b
-	tahoe | i[345]86 | i860 | m68k | m68000 | m88k | ns32k | arm \
7b3a8b
-		| arme[lb] | pyramid \
7b3a8b
-		| tron | a29k | 580 | i960 | h8300 | hppa1.0 | hppa1.1 \
7b3a8b
-		| alpha | we32k | ns16k | clipper | sparclite | i370 | sh \
7b3a8b
-		| powerpc | powerpcle | sparc64 | 1750a | dsp16xx | mips64 | mipsel \
7b3a8b
-		| pdp11 | mips64el | mips64orion | mips64orionel \
7b3a8b
-		| sparc)
7b3a8b
+	1750a | 580 \
7b3a8b
+	| a29k \
7b3a8b
+	| aarch64 | aarch64_be \
7b3a8b
+	| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
7b3a8b
+	| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
7b3a8b
+	| am33_2.0 \
7b3a8b
+	| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
7b3a8b
+        | be32 | be64 \
7b3a8b
+	| bfin \
7b3a8b
+	| c4x | clipper \
7b3a8b
+	| d10v | d30v | dlx | dsp16xx \
7b3a8b
+	| epiphany \
7b3a8b
+	| fido | fr30 | frv \
7b3a8b
+	| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
7b3a8b
+	| hexagon \
7b3a8b
+	| i370 | i860 | i960 | ia64 \
7b3a8b
+	| ip2k | iq2000 \
7b3a8b
+	| le32 | le64 \
7b3a8b
+	| lm32 \
7b3a8b
+	| m32c | m32r | m32rle | m68000 | m68k | m88k \
7b3a8b
+	| maxq | mb | microblaze | microblazeel | mcore | mep | metag \
7b3a8b
+	| mips | mipsbe | mipseb | mipsel | mipsle \
7b3a8b
+	| mips16 \
7b3a8b
+	| mips64 | mips64el \
7b3a8b
+	| mips64octeon | mips64octeonel \
7b3a8b
+	| mips64orion | mips64orionel \
7b3a8b
+	| mips64r5900 | mips64r5900el \
7b3a8b
+	| mips64vr | mips64vrel \
7b3a8b
+	| mips64vr4100 | mips64vr4100el \
7b3a8b
+	| mips64vr4300 | mips64vr4300el \
7b3a8b
+	| mips64vr5000 | mips64vr5000el \
7b3a8b
+	| mips64vr5900 | mips64vr5900el \
7b3a8b
+	| mipsisa32 | mipsisa32el \
7b3a8b
+	| mipsisa32r2 | mipsisa32r2el \
7b3a8b
+	| mipsisa64 | mipsisa64el \
7b3a8b
+	| mipsisa64r2 | mipsisa64r2el \
7b3a8b
+	| mipsisa64sb1 | mipsisa64sb1el \
7b3a8b
+	| mipsisa64sr71k | mipsisa64sr71kel \
7b3a8b
+	| mipstx39 | mipstx39el \
7b3a8b
+	| mn10200 | mn10300 \
7b3a8b
+	| moxie \
7b3a8b
+	| mt \
7b3a8b
+	| msp430 \
7b3a8b
+	| nds32 | nds32le | nds32be \
7b3a8b
+	| nios | nios2 \
7b3a8b
+	| ns16k | ns32k \
7b3a8b
+	| open8 \
7b3a8b
+	| or32 \
7b3a8b
+	| pdp10 | pdp11 | pj | pjl \
7b3a8b
+	| powerpc | powerpc64 | powerpc64le | powerpcle \
7b3a8b
+	| pyramid \
7b3a8b
+	| rl78 | rx \
7b3a8b
+	| score \
7b3a8b
+	| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
7b3a8b
+	| sh64 | sh64le \
7b3a8b
+	| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
7b3a8b
+	| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
7b3a8b
+	| spu \
7b3a8b
+	| tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
7b3a8b
+	| ubicom32 \
7b3a8b
+	| v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
7b3a8b
+	| we32k \
7b3a8b
+	| x86 | xc16x | xstormy16 | xtensa \
7b3a8b
+	| z8k | z80)
7b3a8b
+		basic_machine=$basic_machine-unknown
7b3a8b
+		;;
7b3a8b
+	c54x)
7b3a8b
+		basic_machine=tic54x-unknown
7b3a8b
+		;;
7b3a8b
+	c55x)
7b3a8b
+		basic_machine=tic55x-unknown
7b3a8b
+		;;
7b3a8b
+	c6x)
7b3a8b
+		basic_machine=tic6x-unknown
7b3a8b
+		;;
7b3a8b
+	m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip)
7b3a8b
 		basic_machine=$basic_machine-unknown
7b3a8b
+		os=-none
7b3a8b
+		;;
7b3a8b
+	m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
7b3a8b
+		;;
7b3a8b
+	ms1)
7b3a8b
+		basic_machine=mt-unknown
7b3a8b
+		;;
7b3a8b
+
7b3a8b
+	strongarm | thumb | xscale)
7b3a8b
+		basic_machine=arm-unknown
7b3a8b
 		;;
7b3a8b
+	xgate)
7b3a8b
+		basic_machine=$basic_machine-unknown
7b3a8b
+		os=-none
7b3a8b
+		;;
7b3a8b
+	xscaleeb)
7b3a8b
+		basic_machine=armeb-unknown
7b3a8b
+		;;
7b3a8b
+
7b3a8b
+	xscaleel)
7b3a8b
+		basic_machine=armel-unknown
7b3a8b
+		;;
7b3a8b
+
7b3a8b
+	# We use `pc' rather than `unknown'
7b3a8b
+	# because (1) that's what they normally are, and
7b3a8b
+	# (2) the word "unknown" tends to confuse beginning users.
7b3a8b
+	i*86 | x86_64)
7b3a8b
+	  basic_machine=$basic_machine-pc
7b3a8b
+	  ;;
7b3a8b
 	# Object if more than one company name word.
7b3a8b
 	*-*-*)
7b3a8b
 		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
7b3a8b
 		exit 1
7b3a8b
 		;;
7b3a8b
 	# Recognize the basic CPU types with company name.
7b3a8b
-	vax-* | tahoe-* | i[345]86-* | i860-* | m68k-* | m68000-* | m88k-* \
7b3a8b
-	      | sparc-* | ns32k-* | fx80-* | arm-* | c[123]* \
7b3a8b
-	      | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* | power-* \
7b3a8b
-	      | none-* | 580-* | cray2-* | h8300-* | i960-* | xmp-* | ymp-* \
7b3a8b
-	      | hppa1.0-* | hppa1.1-* | alpha-* | we32k-* | cydra-* | ns16k-* \
7b3a8b
-	      | pn-* | np1-* | xps100-* | clipper-* | orion-* | sparclite-* \
7b3a8b
-	      | pdp11-* | sh-* | powerpc-* | powerpcle-* | sparc64-* | mips64-* | mipsel-* \
7b3a8b
-	      | mips64el-* | mips64orion-* | mips64orionel-*)
7b3a8b
+	580-* \
7b3a8b
+	| a29k-* \
7b3a8b
+	| aarch64-* | aarch64_be-* \
7b3a8b
+	| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
7b3a8b
+	| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
7b3a8b
+	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
7b3a8b
+	| arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
7b3a8b
+	| avr-* | avr32-* \
7b3a8b
+	| be32-* | be64-* \
7b3a8b
+	| bfin-* | bs2000-* \
7b3a8b
+	| c[123]* | c30-* | [cjt]90-* | c4x-* \
7b3a8b
+	| clipper-* | craynv-* | cydra-* \
7b3a8b
+	| d10v-* | d30v-* | dlx-* \
7b3a8b
+	| elxsi-* \
7b3a8b
+	| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
7b3a8b
+	| h8300-* | h8500-* \
7b3a8b
+	| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
7b3a8b
+	| hexagon-* \
7b3a8b
+	| i*86-* | i860-* | i960-* | ia64-* \
7b3a8b
+	| ip2k-* | iq2000-* \
7b3a8b
+	| le32-* | le64-* \
7b3a8b
+	| lm32-* \
7b3a8b
+	| m32c-* | m32r-* | m32rle-* \
7b3a8b
+	| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
7b3a8b
+	| m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
7b3a8b
+	| microblaze-* | microblazeel-* \
7b3a8b
+	| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
7b3a8b
+	| mips16-* \
7b3a8b
+	| mips64-* | mips64el-* \
7b3a8b
+	| mips64octeon-* | mips64octeonel-* \
7b3a8b
+	| mips64orion-* | mips64orionel-* \
7b3a8b
+	| mips64r5900-* | mips64r5900el-* \
7b3a8b
+	| mips64vr-* | mips64vrel-* \
7b3a8b
+	| mips64vr4100-* | mips64vr4100el-* \
7b3a8b
+	| mips64vr4300-* | mips64vr4300el-* \
7b3a8b
+	| mips64vr5000-* | mips64vr5000el-* \
7b3a8b
+	| mips64vr5900-* | mips64vr5900el-* \
7b3a8b
+	| mipsisa32-* | mipsisa32el-* \
7b3a8b
+	| mipsisa32r2-* | mipsisa32r2el-* \
7b3a8b
+	| mipsisa64-* | mipsisa64el-* \
7b3a8b
+	| mipsisa64r2-* | mipsisa64r2el-* \
7b3a8b
+	| mipsisa64sb1-* | mipsisa64sb1el-* \
7b3a8b
+	| mipsisa64sr71k-* | mipsisa64sr71kel-* \
7b3a8b
+	| mipstx39-* | mipstx39el-* \
7b3a8b
+	| mmix-* \
7b3a8b
+	| mt-* \
7b3a8b
+	| msp430-* \
7b3a8b
+	| nds32-* | nds32le-* | nds32be-* \
7b3a8b
+	| nios-* | nios2-* \
7b3a8b
+	| none-* | np1-* | ns16k-* | ns32k-* \
7b3a8b
+	| open8-* \
7b3a8b
+	| orion-* \
7b3a8b
+	| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
7b3a8b
+	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
7b3a8b
+	| pyramid-* \
7b3a8b
+	| rl78-* | romp-* | rs6000-* | rx-* \
7b3a8b
+	| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
7b3a8b
+	| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
7b3a8b
+	| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
7b3a8b
+	| sparclite-* \
7b3a8b
+	| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \
7b3a8b
+	| tahoe-* \
7b3a8b
+	| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
7b3a8b
+	| tile*-* \
7b3a8b
+	| tron-* \
7b3a8b
+	| ubicom32-* \
7b3a8b
+	| v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
7b3a8b
+	| vax-* \
7b3a8b
+	| we32k-* \
7b3a8b
+	| x86-* | x86_64-* | xc16x-* | xps100-* \
7b3a8b
+	| xstormy16-* | xtensa*-* \
7b3a8b
+	| ymp-* \
7b3a8b
+	| z8k-* | z80-*)
7b3a8b
+		;;
7b3a8b
+	# Recognize the basic CPU types without company name, with glob match.
7b3a8b
+	xtensa*)
7b3a8b
+		basic_machine=$basic_machine-unknown
7b3a8b
 		;;
7b3a8b
 	# Recognize the various machine names and aliases which stand
7b3a8b
 	# for a CPU type and a company and sometimes even an OS.
7b3a8b
+	386bsd)
7b3a8b
+		basic_machine=i386-unknown
7b3a8b
+		os=-bsd
7b3a8b
+		;;
7b3a8b
 	3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
7b3a8b
 		basic_machine=m68000-att
7b3a8b
 		;;
7b3a8b
 	3b*)
7b3a8b
 		basic_machine=we32k-att
7b3a8b
 		;;
7b3a8b
+	a29khif)
7b3a8b
+		basic_machine=a29k-amd
7b3a8b
+		os=-udi
7b3a8b
+		;;
7b3a8b
+	abacus)
7b3a8b
+		basic_machine=abacus-unknown
7b3a8b
+		;;
7b3a8b
+	adobe68k)
7b3a8b
+		basic_machine=m68010-adobe
7b3a8b
+		os=-scout
7b3a8b
+		;;
7b3a8b
 	alliant | fx80)
7b3a8b
 		basic_machine=fx80-alliant
7b3a8b
 		;;
7b3a8b
@@ -171,29 +476,76 @@
7b3a8b
 		basic_machine=a29k-none
7b3a8b
 		os=-bsd
7b3a8b
 		;;
7b3a8b
+	amd64)
7b3a8b
+		basic_machine=x86_64-pc
7b3a8b
+		;;
7b3a8b
+	amd64-*)
7b3a8b
+		basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
7b3a8b
+		;;
7b3a8b
 	amdahl)
7b3a8b
 		basic_machine=580-amdahl
7b3a8b
 		os=-sysv
7b3a8b
 		;;
7b3a8b
 	amiga | amiga-*)
7b3a8b
-		basic_machine=m68k-cbm
7b3a8b
+		basic_machine=m68k-unknown
7b3a8b
 		;;
7b3a8b
-	amigados)
7b3a8b
-		basic_machine=m68k-cbm
7b3a8b
-		os=-amigados
7b3a8b
+	amigaos | amigados)
7b3a8b
+		basic_machine=m68k-unknown
7b3a8b
+		os=-amigaos
7b3a8b
 		;;
7b3a8b
 	amigaunix | amix)
7b3a8b
-		basic_machine=m68k-cbm
7b3a8b
+		basic_machine=m68k-unknown
7b3a8b
 		os=-sysv4
7b3a8b
 		;;
7b3a8b
 	apollo68)
7b3a8b
 		basic_machine=m68k-apollo
7b3a8b
 		os=-sysv
7b3a8b
 		;;
7b3a8b
+	apollo68bsd)
7b3a8b
+		basic_machine=m68k-apollo
7b3a8b
+		os=-bsd
7b3a8b
+		;;
7b3a8b
+	aros)
7b3a8b
+		basic_machine=i386-pc
7b3a8b
+		os=-aros
7b3a8b
+		;;
7b3a8b
+	aux)
7b3a8b
+		basic_machine=m68k-apple
7b3a8b
+		os=-aux
7b3a8b
+		;;
7b3a8b
 	balance)
7b3a8b
 		basic_machine=ns32k-sequent
7b3a8b
 		os=-dynix
7b3a8b
 		;;
7b3a8b
+	blackfin)
7b3a8b
+		basic_machine=bfin-unknown
7b3a8b
+		os=-linux
7b3a8b
+		;;
7b3a8b
+	blackfin-*)
7b3a8b
+		basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
7b3a8b
+		os=-linux
7b3a8b
+		;;
7b3a8b
+	bluegene*)
7b3a8b
+		basic_machine=powerpc-ibm
7b3a8b
+		os=-cnk
7b3a8b
+		;;
7b3a8b
+	c54x-*)
7b3a8b
+		basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
7b3a8b
+		;;
7b3a8b
+	c55x-*)
7b3a8b
+		basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
7b3a8b
+		;;
7b3a8b
+	c6x-*)
7b3a8b
+		basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
7b3a8b
+		;;
7b3a8b
+	c90)
7b3a8b
+		basic_machine=c90-cray
7b3a8b
+		os=-unicos
7b3a8b
+		;;
7b3a8b
+	cegcc)
7b3a8b
+		basic_machine=arm-unknown
7b3a8b
+		os=-cegcc
7b3a8b
+		;;
7b3a8b
 	convex-c1)
7b3a8b
 		basic_machine=c1-convex
7b3a8b
 		os=-bsd
7b3a8b
@@ -214,23 +566,45 @@
7b3a8b
 		basic_machine=c38-convex
7b3a8b
 		os=-bsd
7b3a8b
 		;;
7b3a8b
-	cray | ymp)
7b3a8b
-		basic_machine=ymp-cray
7b3a8b
+	cray | j90)
7b3a8b
+		basic_machine=j90-cray
7b3a8b
 		os=-unicos
7b3a8b
 		;;
7b3a8b
-	cray2)
7b3a8b
-		basic_machine=cray2-cray
7b3a8b
-		os=-unicos
7b3a8b
+	craynv)
7b3a8b
+		basic_machine=craynv-cray
7b3a8b
+		os=-unicosmp
7b3a8b
+		;;
7b3a8b
+	cr16 | cr16-*)
7b3a8b
+		basic_machine=cr16-unknown
7b3a8b
+		os=-elf
7b3a8b
 		;;
7b3a8b
 	crds | unos)
7b3a8b
 		basic_machine=m68k-crds
7b3a8b
 		;;
7b3a8b
+	crisv32 | crisv32-* | etraxfs*)
7b3a8b
+		basic_machine=crisv32-axis
7b3a8b
+		;;
7b3a8b
+	cris | cris-* | etrax*)
7b3a8b
+		basic_machine=cris-axis
7b3a8b
+		;;
7b3a8b
+	crx)
7b3a8b
+		basic_machine=crx-unknown
7b3a8b
+		os=-elf
7b3a8b
+		;;
7b3a8b
 	da30 | da30-*)
7b3a8b
 		basic_machine=m68k-da30
7b3a8b
 		;;
7b3a8b
 	decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
7b3a8b
 		basic_machine=mips-dec
7b3a8b
 		;;
7b3a8b
+	decsystem10* | dec10*)
7b3a8b
+		basic_machine=pdp10-dec
7b3a8b
+		os=-tops10
7b3a8b
+		;;
7b3a8b
+	decsystem20* | dec20*)
7b3a8b
+		basic_machine=pdp10-dec
7b3a8b
+		os=-tops20
7b3a8b
+		;;
7b3a8b
 	delta | 3300 | motorola-3300 | motorola-delta \
7b3a8b
 	      | 3300-motorola | delta-motorola)
7b3a8b
 		basic_machine=m68k-motorola
7b3a8b
@@ -239,6 +613,14 @@
7b3a8b
 		basic_machine=m88k-motorola
7b3a8b
 		os=-sysv3
7b3a8b
 		;;
7b3a8b
+	dicos)
7b3a8b
+		basic_machine=i686-pc
7b3a8b
+		os=-dicos
7b3a8b
+		;;
7b3a8b
+	djgpp)
7b3a8b
+		basic_machine=i586-pc
7b3a8b
+		os=-msdosdjgpp
7b3a8b
+		;;
7b3a8b
 	dpx20 | dpx20-*)
7b3a8b
 		basic_machine=rs6000-bull
7b3a8b
 		os=-bosx
7b3a8b
@@ -258,6 +640,10 @@
7b3a8b
 	encore | umax | mmax)
7b3a8b
 		basic_machine=ns32k-encore
7b3a8b
 		;;
7b3a8b
+	es1800 | OSE68k | ose68k | ose | OSE)
7b3a8b
+		basic_machine=m68k-ericsson
7b3a8b
+		os=-ose
7b3a8b
+		;;
7b3a8b
 	fx2800)
7b3a8b
 		basic_machine=i860-alliant
7b3a8b
 		;;
7b3a8b
@@ -268,6 +654,10 @@
7b3a8b
 		basic_machine=tron-gmicro
7b3a8b
 		os=-sysv
7b3a8b
 		;;
7b3a8b
+	go32)
7b3a8b
+		basic_machine=i386-pc
7b3a8b
+		os=-go32
7b3a8b
+		;;
7b3a8b
 	h3050r* | hiux*)
7b3a8b
 		basic_machine=hppa1.1-hitachi
7b3a8b
 		os=-hiuxwe2
7b3a8b
@@ -276,6 +666,14 @@
7b3a8b
 		basic_machine=h8300-hitachi
7b3a8b
 		os=-hms
7b3a8b
 		;;
7b3a8b
+	h8300xray)
7b3a8b
+		basic_machine=h8300-hitachi
7b3a8b
+		os=-xray
7b3a8b
+		;;
7b3a8b
+	h8500hms)
7b3a8b
+		basic_machine=h8500-hitachi
7b3a8b
+		os=-hms
7b3a8b
+		;;
7b3a8b
 	harris)
7b3a8b
 		basic_machine=m88k-harris
7b3a8b
 		os=-sysv3
7b3a8b
@@ -291,39 +689,73 @@
7b3a8b
 		basic_machine=m68k-hp
7b3a8b
 		os=-hpux
7b3a8b
 		;;
7b3a8b
+	hp3k9[0-9][0-9] | hp9[0-9][0-9])
7b3a8b
+		basic_machine=hppa1.0-hp
7b3a8b
+		;;
7b3a8b
 	hp9k2[0-9][0-9] | hp9k31[0-9])
7b3a8b
 		basic_machine=m68000-hp
7b3a8b
 		;;
7b3a8b
 	hp9k3[2-9][0-9])
7b3a8b
 		basic_machine=m68k-hp
7b3a8b
 		;;
7b3a8b
-	hp9k7[0-9][0-9] | hp7[0-9][0-9] | hp9k8[0-9]7 | hp8[0-9]7)
7b3a8b
+	hp9k6[0-9][0-9] | hp6[0-9][0-9])
7b3a8b
+		basic_machine=hppa1.0-hp
7b3a8b
+		;;
7b3a8b
+	hp9k7[0-79][0-9] | hp7[0-79][0-9])
7b3a8b
+		basic_machine=hppa1.1-hp
7b3a8b
+		;;
7b3a8b
+	hp9k78[0-9] | hp78[0-9])
7b3a8b
+		# FIXME: really hppa2.0-hp
7b3a8b
+		basic_machine=hppa1.1-hp
7b3a8b
+		;;
7b3a8b
+	hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
7b3a8b
+		# FIXME: really hppa2.0-hp
7b3a8b
+		basic_machine=hppa1.1-hp
7b3a8b
+		;;
7b3a8b
+	hp9k8[0-9][13679] | hp8[0-9][13679])
7b3a8b
 		basic_machine=hppa1.1-hp
7b3a8b
 		;;
7b3a8b
 	hp9k8[0-9][0-9] | hp8[0-9][0-9])
7b3a8b
 		basic_machine=hppa1.0-hp
7b3a8b
 		;;
7b3a8b
+	hppa-next)
7b3a8b
+		os=-nextstep3
7b3a8b
+		;;
7b3a8b
+	hppaosf)
7b3a8b
+		basic_machine=hppa1.1-hp
7b3a8b
+		os=-osf
7b3a8b
+		;;
7b3a8b
+	hppro)
7b3a8b
+		basic_machine=hppa1.1-hp
7b3a8b
+		os=-proelf
7b3a8b
+		;;
7b3a8b
 	i370-ibm* | ibm*)
7b3a8b
 		basic_machine=i370-ibm
7b3a8b
-		os=-mvs
7b3a8b
 		;;
7b3a8b
-# I'm not sure what "Sysv32" means.  Should this be sysv3.2?
7b3a8b
-	i[345]86v32)
7b3a8b
-		basic_machine=`echo $1 | sed -e 's/86.*/86-unknown/'`
7b3a8b
+	i*86v32)
7b3a8b
+		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
7b3a8b
 		os=-sysv32
7b3a8b
 		;;
7b3a8b
-	i[345]86v4*)
7b3a8b
-		basic_machine=`echo $1 | sed -e 's/86.*/86-unknown/'`
7b3a8b
+	i*86v4*)
7b3a8b
+		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
7b3a8b
 		os=-sysv4
7b3a8b
 		;;
7b3a8b
-	i[345]86v)
7b3a8b
-		basic_machine=`echo $1 | sed -e 's/86.*/86-unknown/'`
7b3a8b
+	i*86v)
7b3a8b
+		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
7b3a8b
 		os=-sysv
7b3a8b
 		;;
7b3a8b
-	i[345]86sol2)
7b3a8b
-		basic_machine=`echo $1 | sed -e 's/86.*/86-unknown/'`
7b3a8b
+	i*86sol2)
7b3a8b
+		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
7b3a8b
 		os=-solaris2
7b3a8b
 		;;
7b3a8b
+	i386mach)
7b3a8b
+		basic_machine=i386-mach
7b3a8b
+		os=-mach
7b3a8b
+		;;
7b3a8b
+	i386-vsta | vsta)
7b3a8b
+		basic_machine=i386-unknown
7b3a8b
+		os=-vsta
7b3a8b
+		;;
7b3a8b
 	iris | iris4d)
7b3a8b
 		basic_machine=mips-sgi
7b3a8b
 		case $os in
7b3a8b
@@ -338,6 +770,14 @@
7b3a8b
 		basic_machine=m68k-isi
7b3a8b
 		os=-sysv
7b3a8b
 		;;
7b3a8b
+	m68knommu)
7b3a8b
+		basic_machine=m68k-unknown
7b3a8b
+		os=-linux
7b3a8b
+		;;
7b3a8b
+	m68knommu-*)
7b3a8b
+		basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
7b3a8b
+		os=-linux
7b3a8b
+		;;
7b3a8b
 	m88k-omron*)
7b3a8b
 		basic_machine=m88k-omron
7b3a8b
 		;;
7b3a8b
@@ -349,19 +789,73 @@
7b3a8b
 		basic_machine=ns32k-utek
7b3a8b
 		os=-sysv
7b3a8b
 		;;
7b3a8b
+	microblaze*)
7b3a8b
+		basic_machine=microblaze-xilinx
7b3a8b
+		;;
7b3a8b
+	mingw64)
7b3a8b
+		basic_machine=x86_64-pc
7b3a8b
+		os=-mingw64
7b3a8b
+		;;
7b3a8b
+	mingw32)
7b3a8b
+		basic_machine=i386-pc
7b3a8b
+		os=-mingw32
7b3a8b
+		;;
7b3a8b
+	mingw32ce)
7b3a8b
+		basic_machine=arm-unknown
7b3a8b
+		os=-mingw32ce
7b3a8b
+		;;
7b3a8b
 	miniframe)
7b3a8b
 		basic_machine=m68000-convergent
7b3a8b
 		;;
7b3a8b
+	*mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
7b3a8b
+		basic_machine=m68k-atari
7b3a8b
+		os=-mint
7b3a8b
+		;;
7b3a8b
 	mips3*-*)
7b3a8b
 		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
7b3a8b
 		;;
7b3a8b
 	mips3*)
7b3a8b
 		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
7b3a8b
 		;;
7b3a8b
+	monitor)
7b3a8b
+		basic_machine=m68k-rom68k
7b3a8b
+		os=-coff
7b3a8b
+		;;
7b3a8b
+	morphos)
7b3a8b
+		basic_machine=powerpc-unknown
7b3a8b
+		os=-morphos
7b3a8b
+		;;
7b3a8b
+	msdos)
7b3a8b
+		basic_machine=i386-pc
7b3a8b
+		os=-msdos
7b3a8b
+		;;
7b3a8b
+	ms1-*)
7b3a8b
+		basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
7b3a8b
+		;;
7b3a8b
+	msys)
7b3a8b
+		basic_machine=i386-pc
7b3a8b
+		os=-msys
7b3a8b
+		;;
7b3a8b
+	mvs)
7b3a8b
+		basic_machine=i370-ibm
7b3a8b
+		os=-mvs
7b3a8b
+		;;
7b3a8b
+	nacl)
7b3a8b
+		basic_machine=le32-unknown
7b3a8b
+		os=-nacl
7b3a8b
+		;;
7b3a8b
 	ncr3000)
7b3a8b
 		basic_machine=i486-ncr
7b3a8b
 		os=-sysv4
7b3a8b
 		;;
7b3a8b
+	netbsd386)
7b3a8b
+		basic_machine=i386-unknown
7b3a8b
+		os=-netbsd
7b3a8b
+		;;
7b3a8b
+	netwinder)
7b3a8b
+		basic_machine=armv4l-rebel
7b3a8b
+		os=-linux
7b3a8b
+		;;
7b3a8b
 	news | news700 | news800 | news900)
7b3a8b
 		basic_machine=m68k-sony
7b3a8b
 		os=-newsos
7b3a8b
@@ -374,6 +868,10 @@
7b3a8b
 		basic_machine=mips-sony
7b3a8b
 		os=-newsos
7b3a8b
 		;;
7b3a8b
+	necv70)
7b3a8b
+		basic_machine=v70-nec
7b3a8b
+		os=-sysv
7b3a8b
+		;;
7b3a8b
 	next | m*-next )
7b3a8b
 		basic_machine=m68k-next
7b3a8b
 		case $os in
7b3a8b
@@ -399,9 +897,45 @@
7b3a8b
 		basic_machine=i960-intel
7b3a8b
 		os=-nindy
7b3a8b
 		;;
7b3a8b
+	mon960)
7b3a8b
+		basic_machine=i960-intel
7b3a8b
+		os=-mon960
7b3a8b
+		;;
7b3a8b
+	nonstopux)
7b3a8b
+		basic_machine=mips-compaq
7b3a8b
+		os=-nonstopux
7b3a8b
+		;;
7b3a8b
 	np1)
7b3a8b
 		basic_machine=np1-gould
7b3a8b
 		;;
7b3a8b
+	neo-tandem)
7b3a8b
+		basic_machine=neo-tandem
7b3a8b
+		;;
7b3a8b
+	nse-tandem)
7b3a8b
+		basic_machine=nse-tandem
7b3a8b
+		;;
7b3a8b
+	nsr-tandem)
7b3a8b
+		basic_machine=nsr-tandem
7b3a8b
+		;;
7b3a8b
+	op50n-* | op60c-*)
7b3a8b
+		basic_machine=hppa1.1-oki
7b3a8b
+		os=-proelf
7b3a8b
+		;;
7b3a8b
+	openrisc | openrisc-*)
7b3a8b
+		basic_machine=or32-unknown
7b3a8b
+		;;
7b3a8b
+	os400)
7b3a8b
+		basic_machine=powerpc-ibm
7b3a8b
+		os=-os400
7b3a8b
+		;;
7b3a8b
+	OSE68000 | ose68000)
7b3a8b
+		basic_machine=m68000-ericsson
7b3a8b
+		os=-ose
7b3a8b
+		;;
7b3a8b
+	os68k)
7b3a8b
+		basic_machine=m68k-none
7b3a8b
+		os=-os68k
7b3a8b
+		;;
7b3a8b
 	pa-hitachi)
7b3a8b
 		basic_machine=hppa1.1-hitachi
7b3a8b
 		os=-hiuxwe2
7b3a8b
@@ -410,55 +944,124 @@
7b3a8b
 		basic_machine=i860-intel
7b3a8b
 		os=-osf
7b3a8b
 		;;
7b3a8b
+	parisc)
7b3a8b
+		basic_machine=hppa-unknown
7b3a8b
+		os=-linux
7b3a8b
+		;;
7b3a8b
+	parisc-*)
7b3a8b
+		basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
7b3a8b
+		os=-linux
7b3a8b
+		;;
7b3a8b
 	pbd)
7b3a8b
 		basic_machine=sparc-tti
7b3a8b
 		;;
7b3a8b
 	pbb)
7b3a8b
 		basic_machine=m68k-tti
7b3a8b
 		;;
7b3a8b
-        pc532 | pc532-*)
7b3a8b
+	pc532 | pc532-*)
7b3a8b
 		basic_machine=ns32k-pc532
7b3a8b
 		;;
7b3a8b
-	pentium | p5 | p6)
7b3a8b
-		# We don't have specific support for the Intel Pentium (p6) followon yet, so just call it a Pentium
7b3a8b
-		basic_machine=i586-intel
7b3a8b
+	pc98)
7b3a8b
+		basic_machine=i386-pc
7b3a8b
+		;;
7b3a8b
+	pc98-*)
7b3a8b
+		basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
7b3a8b
+		;;
7b3a8b
+	pentium | p5 | k5 | k6 | nexgen | viac3)
7b3a8b
+		basic_machine=i586-pc
7b3a8b
+		;;
7b3a8b
+	pentiumpro | p6 | 6x86 | athlon | athlon_*)
7b3a8b
+		basic_machine=i686-pc
7b3a8b
+		;;
7b3a8b
+	pentiumii | pentium2 | pentiumiii | pentium3)
7b3a8b
+		basic_machine=i686-pc
7b3a8b
 		;;
7b3a8b
-	pentium-* | p5-* | p6-*)
7b3a8b
-		# We don't have specific support for the Intel Pentium (p6) followon yet, so just call it a Pentium
7b3a8b
+	pentium4)
7b3a8b
+		basic_machine=i786-pc
7b3a8b
+		;;
7b3a8b
+	pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
7b3a8b
 		basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
7b3a8b
 		;;
7b3a8b
-	k5)
7b3a8b
-		# We don't have specific support for AMD's K5 yet, so just call it a Pentium
7b3a8b
-		basic_machine=i586-amd
7b3a8b
-		;;
7b3a8b
-	nexen)
7b3a8b
-		# We don't have specific support for Nexgen yet, so just call it a Pentium
7b3a8b
-		basic_machine=i586-nexgen
7b3a8b
+	pentiumpro-* | p6-* | 6x86-* | athlon-*)
7b3a8b
+		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
7b3a8b
+		;;
7b3a8b
+	pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
7b3a8b
+		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
7b3a8b
+		;;
7b3a8b
+	pentium4-*)
7b3a8b
+		basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
7b3a8b
 		;;
7b3a8b
 	pn)
7b3a8b
 		basic_machine=pn-gould
7b3a8b
 		;;
7b3a8b
-	power)	basic_machine=rs6000-ibm
7b3a8b
+	power)	basic_machine=power-ibm
7b3a8b
+		;;
7b3a8b
+	ppc | ppcbe)	basic_machine=powerpc-unknown
7b3a8b
 		;;
7b3a8b
-	ppc)	basic_machine=powerpc-unknown
7b3a8b
-	        ;;
7b3a8b
-	ppc-*)	basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
7b3a8b
+	ppc-* | ppcbe-*)
7b3a8b
+		basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
7b3a8b
 		;;
7b3a8b
 	ppcle | powerpclittle | ppc-le | powerpc-little)
7b3a8b
 		basic_machine=powerpcle-unknown
7b3a8b
-	        ;;
7b3a8b
+		;;
7b3a8b
 	ppcle-* | powerpclittle-*)
7b3a8b
 		basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
7b3a8b
 		;;
7b3a8b
+	ppc64)	basic_machine=powerpc64-unknown
7b3a8b
+		;;
7b3a8b
+	ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
7b3a8b
+		;;
7b3a8b
+	ppc64le | powerpc64little | ppc64-le | powerpc64-little)
7b3a8b
+		basic_machine=powerpc64le-unknown
7b3a8b
+		;;
7b3a8b
+	ppc64le-* | powerpc64little-*)
7b3a8b
+		basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
7b3a8b
+		;;
7b3a8b
 	ps2)
7b3a8b
 		basic_machine=i386-ibm
7b3a8b
 		;;
7b3a8b
+	pw32)
7b3a8b
+		basic_machine=i586-unknown
7b3a8b
+		os=-pw32
7b3a8b
+		;;
7b3a8b
+	rdos)
7b3a8b
+		basic_machine=i386-pc
7b3a8b
+		os=-rdos
7b3a8b
+		;;
7b3a8b
+	rom68k)
7b3a8b
+		basic_machine=m68k-rom68k
7b3a8b
+		os=-coff
7b3a8b
+		;;
7b3a8b
 	rm[46]00)
7b3a8b
 		basic_machine=mips-siemens
7b3a8b
 		;;
7b3a8b
 	rtpc | rtpc-*)
7b3a8b
 		basic_machine=romp-ibm
7b3a8b
 		;;
7b3a8b
+	s390 | s390-*)
7b3a8b
+		basic_machine=s390-ibm
7b3a8b
+		;;
7b3a8b
+	s390x | s390x-*)
7b3a8b
+		basic_machine=s390x-ibm
7b3a8b
+		;;
7b3a8b
+	sa29200)
7b3a8b
+		basic_machine=a29k-amd
7b3a8b
+		os=-udi
7b3a8b
+		;;
7b3a8b
+	sb1)
7b3a8b
+		basic_machine=mipsisa64sb1-unknown
7b3a8b
+		;;
7b3a8b
+	sb1el)
7b3a8b
+		basic_machine=mipsisa64sb1el-unknown
7b3a8b
+		;;
7b3a8b
+	sde)
7b3a8b
+		basic_machine=mipsisa32-sde
7b3a8b
+		os=-elf
7b3a8b
+		;;
7b3a8b
+	sei)
7b3a8b
+		basic_machine=mips-sei
7b3a8b
+		os=-seiux
7b3a8b
+		;;
7b3a8b
 	sequent)
7b3a8b
 		basic_machine=i386-sequent
7b3a8b
 		;;
7b3a8b
@@ -466,6 +1069,16 @@
7b3a8b
 		basic_machine=sh-hitachi
7b3a8b
 		os=-hms
7b3a8b
 		;;
7b3a8b
+	sh5el)
7b3a8b
+		basic_machine=sh5le-unknown
7b3a8b
+		;;
7b3a8b
+	sh64)
7b3a8b
+		basic_machine=sh64-unknown
7b3a8b
+		;;
7b3a8b
+	sparclite-wrs | simso-wrs)
7b3a8b
+		basic_machine=sparclite-wrs
7b3a8b
+		os=-vxworks
7b3a8b
+		;;
7b3a8b
 	sps7)
7b3a8b
 		basic_machine=m68k-bull
7b3a8b
 		os=-sysv2
7b3a8b
@@ -473,6 +1086,16 @@
7b3a8b
 	spur)
7b3a8b
 		basic_machine=spur-unknown
7b3a8b
 		;;
7b3a8b
+	st2000)
7b3a8b
+		basic_machine=m68k-tandem
7b3a8b
+		;;
7b3a8b
+	stratus)
7b3a8b
+		basic_machine=i860-stratus
7b3a8b
+		os=-sysv4
7b3a8b
+		;;
7b3a8b
+	strongarm-* | thumb-*)
7b3a8b
+		basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
7b3a8b
+		;;
7b3a8b
 	sun2)
7b3a8b
 		basic_machine=m68000-sun
7b3a8b
 		;;
7b3a8b
@@ -513,13 +1136,43 @@
7b3a8b
 	sun386 | sun386i | roadrunner)
7b3a8b
 		basic_machine=i386-sun
7b3a8b
 		;;
7b3a8b
+	sv1)
7b3a8b
+		basic_machine=sv1-cray
7b3a8b
+		os=-unicos
7b3a8b
+		;;
7b3a8b
 	symmetry)
7b3a8b
 		basic_machine=i386-sequent
7b3a8b
 		os=-dynix
7b3a8b
 		;;
7b3a8b
+	t3e)
7b3a8b
+		basic_machine=alphaev5-cray
7b3a8b
+		os=-unicos
7b3a8b
+		;;
7b3a8b
+	t90)
7b3a8b
+		basic_machine=t90-cray
7b3a8b
+		os=-unicos
7b3a8b
+		;;
7b3a8b
+	tile*)
7b3a8b
+		basic_machine=$basic_machine-unknown
7b3a8b
+		os=-linux-gnu
7b3a8b
+		;;
7b3a8b
+	tx39)
7b3a8b
+		basic_machine=mipstx39-unknown
7b3a8b
+		;;
7b3a8b
+	tx39el)
7b3a8b
+		basic_machine=mipstx39el-unknown
7b3a8b
+		;;
7b3a8b
+	toad1)
7b3a8b
+		basic_machine=pdp10-xkl
7b3a8b
+		os=-tops20
7b3a8b
+		;;
7b3a8b
 	tower | tower-32)
7b3a8b
 		basic_machine=m68k-ncr
7b3a8b
 		;;
7b3a8b
+	tpf)
7b3a8b
+		basic_machine=s390x-ibm
7b3a8b
+		os=-tpf
7b3a8b
+		;;
7b3a8b
 	udi29k)
7b3a8b
 		basic_machine=a29k-amd
7b3a8b
 		os=-udi
7b3a8b
@@ -528,6 +1181,10 @@
7b3a8b
 		basic_machine=a29k-nyu
7b3a8b
 		os=-sym1
7b3a8b
 		;;
7b3a8b
+	v810 | necv810)
7b3a8b
+		basic_machine=v810-nec
7b3a8b
+		os=-none
7b3a8b
+		;;
7b3a8b
 	vaxv)
7b3a8b
 		basic_machine=vax-dec
7b3a8b
 		os=-sysv
7b3a8b
@@ -536,6 +1193,9 @@
7b3a8b
 		basic_machine=vax-dec
7b3a8b
 		os=-vms
7b3a8b
 		;;
7b3a8b
+	vpp*|vx|vx-*)
7b3a8b
+		basic_machine=f301-fujitsu
7b3a8b
+		;;
7b3a8b
 	vxworks960)
7b3a8b
 		basic_machine=i960-wrs
7b3a8b
 		os=-vxworks
7b3a8b
@@ -548,13 +1208,36 @@
7b3a8b
 		basic_machine=a29k-wrs
7b3a8b
 		os=-vxworks
7b3a8b
 		;;
7b3a8b
-	xmp)
7b3a8b
-		basic_machine=xmp-cray
7b3a8b
-		os=-unicos
7b3a8b
+	w65*)
7b3a8b
+		basic_machine=w65-wdc
7b3a8b
+		os=-none
7b3a8b
 		;;
7b3a8b
-        xps | xps100)
7b3a8b
+	w89k-*)
7b3a8b
+		basic_machine=hppa1.1-winbond
7b3a8b
+		os=-proelf
7b3a8b
+		;;
7b3a8b
+	xbox)
7b3a8b
+		basic_machine=i686-pc
7b3a8b
+		os=-mingw32
7b3a8b
+		;;
7b3a8b
+	xps | xps100)
7b3a8b
 		basic_machine=xps100-honeywell
7b3a8b
 		;;
7b3a8b
+	xscale-* | xscalee[bl]-*)
7b3a8b
+		basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
7b3a8b
+		;;
7b3a8b
+	ymp)
7b3a8b
+		basic_machine=ymp-cray
7b3a8b
+		os=-unicos
7b3a8b
+		;;
7b3a8b
+	z8k-*-coff)
7b3a8b
+		basic_machine=z8k-unknown
7b3a8b
+		os=-sim
7b3a8b
+		;;
7b3a8b
+	z80-*-coff)
7b3a8b
+		basic_machine=z80-unknown
7b3a8b
+		os=-sim
7b3a8b
+		;;
7b3a8b
 	none)
7b3a8b
 		basic_machine=none-none
7b3a8b
 		os=-none
7b3a8b
@@ -562,28 +1245,44 @@
7b3a8b
 
7b3a8b
 # Here we handle the default manufacturer of certain CPU types.  It is in
7b3a8b
 # some cases the only manufacturer, in others, it is the most popular.
7b3a8b
-	mips)
7b3a8b
-		basic_machine=mips-mips
7b3a8b
+	w89k)
7b3a8b
+		basic_machine=hppa1.1-winbond
7b3a8b
+		;;
7b3a8b
+	op50n)
7b3a8b
+		basic_machine=hppa1.1-oki
7b3a8b
+		;;
7b3a8b
+	op60c)
7b3a8b
+		basic_machine=hppa1.1-oki
7b3a8b
 		;;
7b3a8b
 	romp)
7b3a8b
 		basic_machine=romp-ibm
7b3a8b
 		;;
7b3a8b
+	mmix)
7b3a8b
+		basic_machine=mmix-knuth
7b3a8b
+		;;
7b3a8b
 	rs6000)
7b3a8b
 		basic_machine=rs6000-ibm
7b3a8b
 		;;
7b3a8b
 	vax)
7b3a8b
 		basic_machine=vax-dec
7b3a8b
 		;;
7b3a8b
+	pdp10)
7b3a8b
+		# there are many clones, so DEC is not a safe bet
7b3a8b
+		basic_machine=pdp10-unknown
7b3a8b
+		;;
7b3a8b
 	pdp11)
7b3a8b
 		basic_machine=pdp11-dec
7b3a8b
 		;;
7b3a8b
 	we32k)
7b3a8b
 		basic_machine=we32k-att
7b3a8b
 		;;
7b3a8b
-	sparc)
7b3a8b
+	sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
7b3a8b
+		basic_machine=sh-unknown
7b3a8b
+		;;
7b3a8b
+	sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
7b3a8b
 		basic_machine=sparc-sun
7b3a8b
 		;;
7b3a8b
-        cydra)
7b3a8b
+	cydra)
7b3a8b
 		basic_machine=cydra-cydrome
7b3a8b
 		;;
7b3a8b
 	orion)
7b3a8b
@@ -592,6 +1291,15 @@
7b3a8b
 	orion105)
7b3a8b
 		basic_machine=clipper-highlevel
7b3a8b
 		;;
7b3a8b
+	mac | mpw | mac-mpw)
7b3a8b
+		basic_machine=m68k-apple
7b3a8b
+		;;
7b3a8b
+	pmac | pmac-mpw)
7b3a8b
+		basic_machine=powerpc-apple
7b3a8b
+		;;
7b3a8b
+	*-unknown)
7b3a8b
+		# Make sure to match an already-canonicalized machine name.
7b3a8b
+		;;
7b3a8b
 	*)
7b3a8b
 		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
7b3a8b
 		exit 1
7b3a8b
@@ -615,41 +1323,101 @@
7b3a8b
 if [ x"$os" != x"" ]
7b3a8b
 then
7b3a8b
 case $os in
7b3a8b
+	# First match some system type aliases
7b3a8b
+	# that might get confused with valid system types.
7b3a8b
 	# -solaris* is a basic system type, with this one exception.
7b3a8b
+	-auroraux)
7b3a8b
+		os=-auroraux
7b3a8b
+		;;
7b3a8b
 	-solaris1 | -solaris1.*)
7b3a8b
 		os=`echo $os | sed -e 's|solaris1|sunos4|'`
7b3a8b
 		;;
7b3a8b
 	-solaris)
7b3a8b
 		os=-solaris2
7b3a8b
 		;;
7b3a8b
-	-unixware* | svr4*)
7b3a8b
+	-svr4*)
7b3a8b
 		os=-sysv4
7b3a8b
 		;;
7b3a8b
+	-unixware*)
7b3a8b
+		os=-sysv4.2uw
7b3a8b
+		;;
7b3a8b
 	-gnu/linux*)
7b3a8b
-		os=`echo $os | sed -e 's|gnu/linux|linux|'`
7b3a8b
+		os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
7b3a8b
 		;;
7b3a8b
 	# First accept the basic system types.
7b3a8b
 	# The portable systems comes first.
7b3a8b
 	# Each alternative MUST END IN A *, to match a version number.
7b3a8b
 	# -sysv* is not here because it comes later, after sysvr4.
7b3a8b
 	-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
7b3a8b
-	      | -vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[345]* \
7b3a8b
-	      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
7b3a8b
-	      | -amigados* | -msdos* | -newsos* | -unicos* | -aos* \
7b3a8b
-	      | -nindy* | -vxworks* | -ebmon* | -hms* | -mvs* | -clix* \
7b3a8b
-	      | -riscos* | -linux* | -uniplus* | -iris* | -rtu* | -xenix* \
7b3a8b
-	      | -hiux* | -386bsd* | -netbsd* | -freebsd* | -riscix* \
7b3a8b
-	      | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* \
7b3a8b
+	      | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
7b3a8b
+	      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
7b3a8b
+	      | -sym* | -kopensolaris* \
7b3a8b
+	      | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
7b3a8b
+	      | -aos* | -aros* \
7b3a8b
+	      | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
7b3a8b
+	      | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
7b3a8b
+	      | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
7b3a8b
+	      | -bitrig* | -openbsd* | -solidbsd* \
7b3a8b
+	      | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
7b3a8b
+	      | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
7b3a8b
 	      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
7b3a8b
-	      | -udi* | -eabi* | -lites* )
7b3a8b
+	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
7b3a8b
+	      | -chorusos* | -chorusrdb* | -cegcc* \
7b3a8b
+	      | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
7b3a8b
+	      | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
7b3a8b
+	      | -linux-newlib* | -linux-musl* | -linux-uclibc* \
7b3a8b
+	      | -uxpv* | -beos* | -mpeix* | -udk* \
7b3a8b
+	      | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
7b3a8b
+	      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
7b3a8b
+	      | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
7b3a8b
+	      | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
7b3a8b
+	      | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
7b3a8b
+	      | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
7b3a8b
+	      | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*)
7b3a8b
 	# Remember, each alternative MUST END IN *, to match a version number.
7b3a8b
 		;;
7b3a8b
+	-qnx*)
7b3a8b
+		case $basic_machine in
7b3a8b
+		    x86-* | i*86-*)
7b3a8b
+			;;
7b3a8b
+		    *)
7b3a8b
+			os=-nto$os
7b3a8b
+			;;
7b3a8b
+		esac
7b3a8b
+		;;
7b3a8b
+	-nto-qnx*)
7b3a8b
+		;;
7b3a8b
+	-nto*)
7b3a8b
+		os=`echo $os | sed -e 's|nto|nto-qnx|'`
7b3a8b
+		;;
7b3a8b
+	-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
7b3a8b
+	      | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
7b3a8b
+	      | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
7b3a8b
+		;;
7b3a8b
+	-mac*)
7b3a8b
+		os=`echo $os | sed -e 's|mac|macos|'`
7b3a8b
+		;;
7b3a8b
+	-linux-dietlibc)
7b3a8b
+		os=-linux-dietlibc
7b3a8b
+		;;
7b3a8b
+	-linux*)
7b3a8b
+		os=`echo $os | sed -e 's|linux|linux-gnu|'`
7b3a8b
+		;;
7b3a8b
 	-sunos5*)
7b3a8b
 		os=`echo $os | sed -e 's|sunos5|solaris2|'`
7b3a8b
 		;;
7b3a8b
 	-sunos6*)
7b3a8b
 		os=`echo $os | sed -e 's|sunos6|solaris3|'`
7b3a8b
 		;;
7b3a8b
+	-opened*)
7b3a8b
+		os=-openedition
7b3a8b
+		;;
7b3a8b
+	-os400*)
7b3a8b
+		os=-os400
7b3a8b
+		;;
7b3a8b
+	-wince*)
7b3a8b
+		os=-wince
7b3a8b
+		;;
7b3a8b
 	-osfrose*)
7b3a8b
 		os=-osfrose
7b3a8b
 		;;
7b3a8b
@@ -665,9 +1433,27 @@
7b3a8b
 	-acis*)
7b3a8b
 		os=-aos
7b3a8b
 		;;
7b3a8b
+	-atheos*)
7b3a8b
+		os=-atheos
7b3a8b
+		;;
7b3a8b
+	-syllable*)
7b3a8b
+		os=-syllable
7b3a8b
+		;;
7b3a8b
+	-386bsd)
7b3a8b
+		os=-bsd
7b3a8b
+		;;
7b3a8b
 	-ctix* | -uts*)
7b3a8b
 		os=-sysv
7b3a8b
 		;;
7b3a8b
+	-nova*)
7b3a8b
+		os=-rtmk-nova
7b3a8b
+		;;
7b3a8b
+	-ns2 )
7b3a8b
+		os=-nextstep2
7b3a8b
+		;;
7b3a8b
+	-nsk*)
7b3a8b
+		os=-nsk
7b3a8b
+		;;
7b3a8b
 	# Preserve the version number of sinix5.
7b3a8b
 	-sinix5.*)
7b3a8b
 		os=`echo $os | sed -e 's|sinix|sysv|'`
7b3a8b
@@ -675,6 +1461,9 @@
7b3a8b
 	-sinix*)
7b3a8b
 		os=-sysv4
7b3a8b
 		;;
7b3a8b
+	-tpf*)
7b3a8b
+		os=-tpf
7b3a8b
+		;;
7b3a8b
 	-triton*)
7b3a8b
 		os=-sysv3
7b3a8b
 		;;
7b3a8b
@@ -693,9 +1482,32 @@
7b3a8b
 	# This must come after -sysvr4.
7b3a8b
 	-sysv*)
7b3a8b
 		;;
7b3a8b
+	-ose*)
7b3a8b
+		os=-ose
7b3a8b
+		;;
7b3a8b
+	-es1800*)
7b3a8b
+		os=-ose
7b3a8b
+		;;
7b3a8b
 	-xenix)
7b3a8b
 		os=-xenix
7b3a8b
 		;;
7b3a8b
+	-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
7b3a8b
+		os=-mint
7b3a8b
+		;;
7b3a8b
+	-aros*)
7b3a8b
+		os=-aros
7b3a8b
+		;;
7b3a8b
+	-kaos*)
7b3a8b
+		os=-kaos
7b3a8b
+		;;
7b3a8b
+	-zvmoe)
7b3a8b
+		os=-zvmoe
7b3a8b
+		;;
7b3a8b
+	-dicos*)
7b3a8b
+		os=-dicos
7b3a8b
+		;;
7b3a8b
+	-nacl*)
7b3a8b
+		;;
7b3a8b
 	-none)
7b3a8b
 		;;
7b3a8b
 	*)
7b3a8b
@@ -718,13 +1530,41 @@
7b3a8b
 # system, and we'll never get to this point.
7b3a8b
 
7b3a8b
 case $basic_machine in
7b3a8b
+	score-*)
7b3a8b
+		os=-elf
7b3a8b
+		;;
7b3a8b
+	spu-*)
7b3a8b
+		os=-elf
7b3a8b
+		;;
7b3a8b
 	*-acorn)
7b3a8b
 		os=-riscix1.2
7b3a8b
 		;;
7b3a8b
+	arm*-rebel)
7b3a8b
+		os=-linux
7b3a8b
+		;;
7b3a8b
 	arm*-semi)
7b3a8b
 		os=-aout
7b3a8b
 		;;
7b3a8b
-        pdp11-*)
7b3a8b
+	c4x-* | tic4x-*)
7b3a8b
+		os=-coff
7b3a8b
+		;;
7b3a8b
+	hexagon-*)
7b3a8b
+		os=-elf
7b3a8b
+		;;
7b3a8b
+	tic54x-*)
7b3a8b
+		os=-coff
7b3a8b
+		;;
7b3a8b
+	tic55x-*)
7b3a8b
+		os=-coff
7b3a8b
+		;;
7b3a8b
+	tic6x-*)
7b3a8b
+		os=-coff
7b3a8b
+		;;
7b3a8b
+	# This must come before the *-dec entry.
7b3a8b
+	pdp10-*)
7b3a8b
+		os=-tops20
7b3a8b
+		;;
7b3a8b
+	pdp11-*)
7b3a8b
 		os=-none
7b3a8b
 		;;
7b3a8b
 	*-dec | vax-*)
7b3a8b
@@ -738,9 +1578,21 @@
7b3a8b
 		;;
7b3a8b
 	m68000-sun)
7b3a8b
 		os=-sunos3
7b3a8b
-		# This also exists in the configure program, but was not the
7b3a8b
-		# default.
7b3a8b
-		# os=-sunos4
7b3a8b
+		;;
7b3a8b
+	m68*-cisco)
7b3a8b
+		os=-aout
7b3a8b
+		;;
7b3a8b
+	mep-*)
7b3a8b
+		os=-elf
7b3a8b
+		;;
7b3a8b
+	mips*-cisco)
7b3a8b
+		os=-elf
7b3a8b
+		;;
7b3a8b
+	mips*-*)
7b3a8b
+		os=-elf
7b3a8b
+		;;
7b3a8b
+	or32-*)
7b3a8b
+		os=-coff
7b3a8b
 		;;
7b3a8b
 	*-tti)	# must be before sparc entry or we get the wrong os.
7b3a8b
 		os=-sysv3
7b3a8b
@@ -748,9 +1600,27 @@
7b3a8b
 	sparc-* | *-sun)
7b3a8b
 		os=-sunos4.1.1
7b3a8b
 		;;
7b3a8b
+	*-be)
7b3a8b
+		os=-beos
7b3a8b
+		;;
7b3a8b
+	*-haiku)
7b3a8b
+		os=-haiku
7b3a8b
+		;;
7b3a8b
 	*-ibm)
7b3a8b
 		os=-aix
7b3a8b
 		;;
7b3a8b
+	*-knuth)
7b3a8b
+		os=-mmixware
7b3a8b
+		;;
7b3a8b
+	*-wec)
7b3a8b
+		os=-proelf
7b3a8b
+		;;
7b3a8b
+	*-winbond)
7b3a8b
+		os=-proelf
7b3a8b
+		;;
7b3a8b
+	*-oki)
7b3a8b
+		os=-proelf
7b3a8b
+		;;
7b3a8b
 	*-hp)
7b3a8b
 		os=-hpux
7b3a8b
 		;;
7b3a8b
@@ -761,7 +1631,7 @@
7b3a8b
 		os=-sysv
7b3a8b
 		;;
7b3a8b
 	*-cbm)
7b3a8b
-		os=-amigados
7b3a8b
+		os=-amigaos
7b3a8b
 		;;
7b3a8b
 	*-dg)
7b3a8b
 		os=-dgux
7b3a8b
@@ -775,6 +1645,9 @@
7b3a8b
 	m88k-omron*)
7b3a8b
 		os=-luna
7b3a8b
 		;;
7b3a8b
+	*-next )
7b3a8b
+		os=-nextstep
7b3a8b
+		;;
7b3a8b
 	*-sequent)
7b3a8b
 		os=-ptx
7b3a8b
 		;;
7b3a8b
@@ -790,24 +1663,39 @@
7b3a8b
 	*-next)
7b3a8b
 		os=-nextstep3
7b3a8b
 		;;
7b3a8b
-        *-gould)
7b3a8b
+	*-gould)
7b3a8b
 		os=-sysv
7b3a8b
 		;;
7b3a8b
-        *-highlevel)
7b3a8b
+	*-highlevel)
7b3a8b
 		os=-bsd
7b3a8b
 		;;
7b3a8b
 	*-encore)
7b3a8b
 		os=-bsd
7b3a8b
 		;;
7b3a8b
-        *-sgi)
7b3a8b
+	*-sgi)
7b3a8b
 		os=-irix
7b3a8b
 		;;
7b3a8b
-        *-siemens)
7b3a8b
+	*-siemens)
7b3a8b
 		os=-sysv4
7b3a8b
 		;;
7b3a8b
 	*-masscomp)
7b3a8b
 		os=-rtu
7b3a8b
 		;;
7b3a8b
+	f30[01]-fujitsu | f700-fujitsu)
7b3a8b
+		os=-uxpv
7b3a8b
+		;;
7b3a8b
+	*-rom68k)
7b3a8b
+		os=-coff
7b3a8b
+		;;
7b3a8b
+	*-*bug)
7b3a8b
+		os=-coff
7b3a8b
+		;;
7b3a8b
+	*-apple)
7b3a8b
+		os=-macos
7b3a8b
+		;;
7b3a8b
+	*-atari*)
7b3a8b
+		os=-mint
7b3a8b
+		;;
7b3a8b
 	*)
7b3a8b
 		os=-none
7b3a8b
 		;;
7b3a8b
@@ -826,15 +1714,18 @@
7b3a8b
 			-sunos*)
7b3a8b
 				vendor=sun
7b3a8b
 				;;
7b3a8b
-			-lynxos*)
7b3a8b
-				vendor=lynx
7b3a8b
-				;;
7b3a8b
-			-aix*)
7b3a8b
+			-cnk*|-aix*)
7b3a8b
 				vendor=ibm
7b3a8b
 				;;
7b3a8b
+			-beos*)
7b3a8b
+				vendor=be
7b3a8b
+				;;
7b3a8b
 			-hpux*)
7b3a8b
 				vendor=hp
7b3a8b
 				;;
7b3a8b
+			-mpeix*)
7b3a8b
+				vendor=hp
7b3a8b
+				;;
7b3a8b
 			-hiux*)
7b3a8b
 				vendor=hitachi
7b3a8b
 				;;
7b3a8b
@@ -850,18 +1741,47 @@
7b3a8b
 			-genix*)
7b3a8b
 				vendor=ns
7b3a8b
 				;;
7b3a8b
-			-mvs*)
7b3a8b
+			-mvs* | -opened*)
7b3a8b
+				vendor=ibm
7b3a8b
+				;;
7b3a8b
+			-os400*)
7b3a8b
 				vendor=ibm
7b3a8b
 				;;
7b3a8b
 			-ptx*)
7b3a8b
 				vendor=sequent
7b3a8b
 				;;
7b3a8b
-			-vxworks*)
7b3a8b
+			-tpf*)
7b3a8b
+				vendor=ibm
7b3a8b
+				;;
7b3a8b
+			-vxsim* | -vxworks* | -windiss*)
7b3a8b
 				vendor=wrs
7b3a8b
 				;;
7b3a8b
+			-aux*)
7b3a8b
+				vendor=apple
7b3a8b
+				;;
7b3a8b
+			-hms*)
7b3a8b
+				vendor=hitachi
7b3a8b
+				;;
7b3a8b
+			-mpw* | -macos*)
7b3a8b
+				vendor=apple
7b3a8b
+				;;
7b3a8b
+			-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
7b3a8b
+				vendor=atari
7b3a8b
+				;;
7b3a8b
+			-vos*)
7b3a8b
+				vendor=stratus
7b3a8b
+				;;
7b3a8b
 		esac
7b3a8b
 		basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
7b3a8b
 		;;
7b3a8b
 esac
7b3a8b
 
7b3a8b
 echo $basic_machine$os
7b3a8b
+exit
7b3a8b
+
7b3a8b
+# Local variables:
7b3a8b
+# eval: (add-hook 'write-file-hooks 'time-stamp)
7b3a8b
+# time-stamp-start: "timestamp='"
7b3a8b
+# time-stamp-format: "%:y-%02m-%02d"
7b3a8b
+# time-stamp-end: "'"
7b3a8b
+# End: