Blame SOURCES/lrzsz-0.12.20-aarch64.patch

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