Browse Source

Update config.guess and config.sub

tags/REL_12_BETA1
Peter Eisentraut 2 months ago
parent
commit
ddcaa59672
2 changed files with 780 additions and 621 deletions
  1. 221
    52
      config/config.guess
  2. 559
    569
      config/config.sub

+ 221
- 52
config/config.guess View File

@@ -1,8 +1,8 @@
1 1
 #! /bin/sh
2 2
 # Attempt to guess a canonical system name.
3
-#   Copyright 1992-2018 Free Software Foundation, Inc.
3
+#   Copyright 1992-2019 Free Software Foundation, Inc.
4 4
 
5
-timestamp='2018-05-19'
5
+timestamp='2019-03-04'
6 6
 
7 7
 # This file is free software; you can redistribute it and/or modify it
8 8
 # under the terms of the GNU General Public License as published by
@@ -50,7 +50,7 @@ version="\
50 50
 GNU config.guess ($timestamp)
51 51
 
52 52
 Originally written by Per Bothner.
53
-Copyright 1992-2018 Free Software Foundation, Inc.
53
+Copyright 1992-2019 Free Software Foundation, Inc.
54 54
 
55 55
 This is free software; see the source for copying conditions.  There is NO
56 56
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -84,8 +84,6 @@ if test $# != 0; then
84 84
   exit 1
85 85
 fi
86 86
 
87
-trap 'exit 1' 1 2 15
88
-
89 87
 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a
90 88
 # compiler to aid in system detection is discouraged as it requires
91 89
 # temporary files to be created and, as you can see below, it is a
@@ -96,34 +94,38 @@ trap 'exit 1' 1 2 15
96 94
 
97 95
 # Portable tmp directory creation inspired by the Autoconf team.
98 96
 
99
-set_cc_for_build='
100
-trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
101
-trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
102
-: ${TMPDIR=/tmp} ;
103
- { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
104
- { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
105
- { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
106
- { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
107
-dummy=$tmp/dummy ;
108
-tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
109
-case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in
110
- ,,)    echo "int x;" > "$dummy.c" ;
111
-	for c in cc gcc c89 c99 ; do
112
-	  if ($c -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then
113
-	     CC_FOR_BUILD="$c"; break ;
114
-	  fi ;
115
-	done ;
116
-	if test x"$CC_FOR_BUILD" = x ; then
117
-	  CC_FOR_BUILD=no_compiler_found ;
118
-	fi
119
-	;;
120
- ,,*)   CC_FOR_BUILD=$CC ;;
121
- ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
122
-esac ; set_cc_for_build= ;'
97
+tmp=
98
+# shellcheck disable=SC2172
99
+trap 'test -z "$tmp" || rm -fr "$tmp"' 0 1 2 13 15
100
+
101
+set_cc_for_build() {
102
+    : "${TMPDIR=/tmp}"
103
+    # shellcheck disable=SC2039
104
+    { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
105
+	{ test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } ||
106
+	{ tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } ||
107
+	{ echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; }
108
+    dummy=$tmp/dummy
109
+    case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in
110
+	,,)    echo "int x;" > "$dummy.c"
111
+	       for driver in cc gcc c89 c99 ; do
112
+		   if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then
113
+		       CC_FOR_BUILD="$driver"
114
+		       break
115
+		   fi
116
+	       done
117
+	       if test x"$CC_FOR_BUILD" = x ; then
118
+		   CC_FOR_BUILD=no_compiler_found
119
+	       fi
120
+	       ;;
121
+	,,*)   CC_FOR_BUILD=$CC ;;
122
+	,*,*)  CC_FOR_BUILD=$HOST_CC ;;
123
+    esac
124
+}
123 125
 
124 126
 # This is needed to find uname on a Pyramid OSx when run in the BSD universe.
125 127
 # (ghazi@noc.rutgers.edu 1994-08-24)
126
-if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
128
+if test -f /.attbin/uname ; then
127 129
 	PATH=$PATH:/.attbin ; export PATH
128 130
 fi
129 131
 
@@ -138,7 +140,7 @@ Linux|GNU|GNU/*)
138 140
 	# We could probably try harder.
139 141
 	LIBC=gnu
140 142
 
141
-	eval "$set_cc_for_build"
143
+	set_cc_for_build
142 144
 	cat <<-EOF > "$dummy.c"
143 145
 	#include <features.h>
144 146
 	#if defined(__UCLIBC__)
@@ -199,7 +201,7 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
199 201
 		os=netbsdelf
200 202
 		;;
201 203
 	    arm*|i386|m68k|ns32k|sh3*|sparc|vax)
202
-		eval "$set_cc_for_build"
204
+		set_cc_for_build
203 205
 		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
204 206
 			| grep -q __ELF__
205 207
 		then
@@ -389,7 +391,7 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
389 391
 	echo i386-pc-auroraux"$UNAME_RELEASE"
390 392
 	exit ;;
391 393
     i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
392
-	eval "$set_cc_for_build"
394
+	set_cc_for_build
393 395
 	SUN_ARCH=i386
394 396
 	# If there is a compiler, see if it is configured for 64-bit objects.
395 397
 	# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
@@ -482,7 +484,7 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
482 484
 	echo clipper-intergraph-clix"$UNAME_RELEASE"
483 485
 	exit ;;
484 486
     mips:*:*:UMIPS | mips:*:*:RISCos)
485
-	eval "$set_cc_for_build"
487
+	set_cc_for_build
486 488
 	sed 's/^	//' << EOF > "$dummy.c"
487 489
 #ifdef __cplusplus
488 490
 #include <stdio.h>  /* for printf() prototype */
@@ -579,7 +581,7 @@ EOF
579 581
 	exit ;;
580 582
     *:AIX:2:3)
581 583
 	if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
582
-		eval "$set_cc_for_build"
584
+		set_cc_for_build
583 585
 		sed 's/^		//' << EOF > "$dummy.c"
584 586
 		#include <sys/systemcfg.h>
585 587
 
@@ -660,7 +662,7 @@ EOF
660 662
 		    esac
661 663
 		fi
662 664
 		if [ "$HP_ARCH" = "" ]; then
663
-		    eval "$set_cc_for_build"
665
+		    set_cc_for_build
664 666
 		    sed 's/^		//' << EOF > "$dummy.c"
665 667
 
666 668
 		#define _HPUX_SOURCE
@@ -700,7 +702,7 @@ EOF
700 702
 	esac
701 703
 	if [ "$HP_ARCH" = hppa2.0w ]
702 704
 	then
703
-	    eval "$set_cc_for_build"
705
+	    set_cc_for_build
704 706
 
705 707
 	    # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
706 708
 	    # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler
@@ -726,7 +728,7 @@ EOF
726 728
 	echo ia64-hp-hpux"$HPUX_REV"
727 729
 	exit ;;
728 730
     3050*:HI-UX:*:*)
729
-	eval "$set_cc_for_build"
731
+	set_cc_for_build
730 732
 	sed 's/^	//' << EOF > "$dummy.c"
731 733
 	#include <unistd.h>
732 734
 	int
@@ -840,6 +842,17 @@ EOF
840 842
     *:BSD/OS:*:*)
841 843
 	echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE"
842 844
 	exit ;;
845
+    arm:FreeBSD:*:*)
846
+	UNAME_PROCESSOR=`uname -p`
847
+	set_cc_for_build
848
+	if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
849
+	    | grep -q __ARM_PCS_VFP
850
+	then
851
+	    echo "${UNAME_PROCESSOR}"-unknown-freebsd"`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`"-gnueabi
852
+	else
853
+	    echo "${UNAME_PROCESSOR}"-unknown-freebsd"`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`"-gnueabihf
854
+	fi
855
+	exit ;;
843 856
     *:FreeBSD:*:*)
844 857
 	UNAME_PROCESSOR=`/usr/bin/uname -p`
845 858
 	case "$UNAME_PROCESSOR" in
@@ -881,7 +894,7 @@ EOF
881 894
 	echo "$UNAME_MACHINE"-pc-uwin
882 895
 	exit ;;
883 896
     amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
884
-	echo x86_64-unknown-cygwin
897
+	echo x86_64-pc-cygwin
885 898
 	exit ;;
886 899
     prep*:SunOS:5.*:*)
887 900
 	echo powerpcle-unknown-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
@@ -894,8 +907,8 @@ EOF
894 907
 	# other systems with GNU libc and userland
895 908
 	echo "$UNAME_MACHINE-unknown-`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`-$LIBC"
896 909
 	exit ;;
897
-    i*86:Minix:*:*)
898
-	echo "$UNAME_MACHINE"-pc-minix
910
+    *:Minix:*:*)
911
+	echo "$UNAME_MACHINE"-unknown-minix
899 912
 	exit ;;
900 913
     aarch64:Linux:*:*)
901 914
 	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
@@ -922,7 +935,7 @@ EOF
922 935
 	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
923 936
 	exit ;;
924 937
     arm*:Linux:*:*)
925
-	eval "$set_cc_for_build"
938
+	set_cc_for_build
926 939
 	if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
927 940
 	    | grep -q __ARM_EABI__
928 941
 	then
@@ -971,23 +984,51 @@ EOF
971 984
 	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
972 985
 	exit ;;
973 986
     mips:Linux:*:* | mips64:Linux:*:*)
974
-	eval "$set_cc_for_build"
987
+	set_cc_for_build
988
+	IS_GLIBC=0
989
+	test x"${LIBC}" = xgnu && IS_GLIBC=1
975 990
 	sed 's/^	//' << EOF > "$dummy.c"
976 991
 	#undef CPU
977
-	#undef ${UNAME_MACHINE}
978
-	#undef ${UNAME_MACHINE}el
992
+	#undef mips
993
+	#undef mipsel
994
+	#undef mips64
995
+	#undef mips64el
996
+	#if ${IS_GLIBC} && defined(_ABI64)
997
+	LIBCABI=gnuabi64
998
+	#else
999
+	#if ${IS_GLIBC} && defined(_ABIN32)
1000
+	LIBCABI=gnuabin32
1001
+	#else
1002
+	LIBCABI=${LIBC}
1003
+	#endif
1004
+	#endif
1005
+
1006
+	#if ${IS_GLIBC} && defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6
1007
+	CPU=mipsisa64r6
1008
+	#else
1009
+	#if ${IS_GLIBC} && !defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6
1010
+	CPU=mipsisa32r6
1011
+	#else
1012
+	#if defined(__mips64)
1013
+	CPU=mips64
1014
+	#else
1015
+	CPU=mips
1016
+	#endif
1017
+	#endif
1018
+	#endif
1019
+
979 1020
 	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
980
-	CPU=${UNAME_MACHINE}el
1021
+	MIPS_ENDIAN=el
981 1022
 	#else
982 1023
 	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
983
-	CPU=${UNAME_MACHINE}
1024
+	MIPS_ENDIAN=
984 1025
 	#else
985
-	CPU=
1026
+	MIPS_ENDIAN=
986 1027
 	#endif
987 1028
 	#endif
988 1029
 EOF
989
-	eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU'`"
990
-	test "x$CPU" != x && { echo "$CPU-unknown-linux-$LIBC"; exit; }
1030
+	eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI'`"
1031
+	test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; }
991 1032
 	;;
992 1033
     mips64el:Linux:*:*)
993 1034
 	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
@@ -1100,7 +1141,7 @@ EOF
1100 1141
 	    *Pentium)	     UNAME_MACHINE=i586 ;;
1101 1142
 	    *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
1102 1143
 	esac
1103
-	echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}{$UNAME_VERSION}"
1144
+	echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}"
1104 1145
 	exit ;;
1105 1146
     i*86:*:3.2:*)
1106 1147
 	if test -f /usr/options/cb.name; then
@@ -1285,7 +1326,7 @@ EOF
1285 1326
 	exit ;;
1286 1327
     *:Darwin:*:*)
1287 1328
 	UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
1288
-	eval "$set_cc_for_build"
1329
+	set_cc_for_build
1289 1330
 	if test "$UNAME_PROCESSOR" = unknown ; then
1290 1331
 	    UNAME_PROCESSOR=powerpc
1291 1332
 	fi
@@ -1358,6 +1399,7 @@ EOF
1358 1399
 	# "uname -m" is not consistent, so use $cputype instead. 386
1359 1400
 	# is converted to i386 for consistency with other x86
1360 1401
 	# operating systems.
1402
+	# shellcheck disable=SC2154
1361 1403
 	if test "$cputype" = 386; then
1362 1404
 	    UNAME_MACHINE=i386
1363 1405
 	else
@@ -1414,8 +1456,135 @@ EOF
1414 1456
     amd64:Isilon\ OneFS:*:*)
1415 1457
 	echo x86_64-unknown-onefs
1416 1458
 	exit ;;
1459
+    *:Unleashed:*:*)
1460
+	echo "$UNAME_MACHINE"-unknown-unleashed"$UNAME_RELEASE"
1461
+	exit ;;
1417 1462
 esac
1418 1463
 
1464
+# No uname command or uname output not recognized.
1465
+set_cc_for_build
1466
+cat > "$dummy.c" <<EOF
1467
+#ifdef _SEQUENT_
1468
+#include <sys/types.h>
1469
+#include <sys/utsname.h>
1470
+#endif
1471
+main ()
1472
+{
1473
+#if defined (sony)
1474
+#if defined (MIPSEB)
1475
+  /* BFD wants "bsd" instead of "newsos".  Perhaps BFD should be changed,
1476
+     I don't know....  */
1477
+  printf ("mips-sony-bsd\n"); exit (0);
1478
+#else
1479
+#include <sys/param.h>
1480
+  printf ("m68k-sony-newsos%s\n",
1481
+#ifdef NEWSOS4
1482
+  "4"
1483
+#else
1484
+  ""
1485
+#endif
1486
+  ); exit (0);
1487
+#endif
1488
+#endif
1489
+
1490
+#if defined (NeXT)
1491
+#if !defined (__ARCHITECTURE__)
1492
+#define __ARCHITECTURE__ "m68k"
1493
+#endif
1494
+  int version;
1495
+  version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
1496
+  if (version < 4)
1497
+    printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
1498
+  else
1499
+    printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
1500
+  exit (0);
1501
+#endif
1502
+
1503
+#if defined (MULTIMAX) || defined (n16)
1504
+#if defined (UMAXV)
1505
+  printf ("ns32k-encore-sysv\n"); exit (0);
1506
+#else
1507
+#if defined (CMU)
1508
+  printf ("ns32k-encore-mach\n"); exit (0);
1509
+#else
1510
+  printf ("ns32k-encore-bsd\n"); exit (0);
1511
+#endif
1512
+#endif
1513
+#endif
1514
+
1515
+#if defined (__386BSD__)
1516
+  printf ("i386-pc-bsd\n"); exit (0);
1517
+#endif
1518
+
1519
+#if defined (sequent)
1520
+#if defined (i386)
1521
+  printf ("i386-sequent-dynix\n"); exit (0);
1522
+#endif
1523
+#if defined (ns32000)
1524
+  printf ("ns32k-sequent-dynix\n"); exit (0);
1525
+#endif
1526
+#endif
1527
+
1528
+#if defined (_SEQUENT_)
1529
+  struct utsname un;
1530
+
1531
+  uname(&un);
1532
+  if (strncmp(un.version, "V2", 2) == 0) {
1533
+    printf ("i386-sequent-ptx2\n"); exit (0);
1534
+  }
1535
+  if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
1536
+    printf ("i386-sequent-ptx1\n"); exit (0);
1537
+  }
1538
+  printf ("i386-sequent-ptx\n"); exit (0);
1539
+#endif
1540
+
1541
+#if defined (vax)
1542
+#if !defined (ultrix)
1543
+#include <sys/param.h>
1544
+#if defined (BSD)
1545
+#if BSD == 43
1546
+  printf ("vax-dec-bsd4.3\n"); exit (0);
1547
+#else
1548
+#if BSD == 199006
1549
+  printf ("vax-dec-bsd4.3reno\n"); exit (0);
1550
+#else
1551
+  printf ("vax-dec-bsd\n"); exit (0);
1552
+#endif
1553
+#endif
1554
+#else
1555
+  printf ("vax-dec-bsd\n"); exit (0);
1556
+#endif
1557
+#else
1558
+  printf ("vax-dec-ultrix\n"); exit (0);
1559
+#endif
1560
+#endif
1561
+#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__)
1562
+#if defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__)
1563
+#include <signal.h>
1564
+#if defined(_SIZE_T_) /* >= ULTRIX4 */
1565
+  printf ("mips-dec-ultrix4\n"); exit (0);
1566
+#else
1567
+#if defined(ULTRIX3) || defined(ultrix3) || defined(SIGLOST)
1568
+  printf ("mips-dec-ultrix3\n"); exit (0);
1569
+#endif
1570
+#endif
1571
+#endif
1572
+#endif
1573
+
1574
+#if defined (alliant) && defined (i860)
1575
+  printf ("i860-alliant-bsd\n"); exit (0);
1576
+#endif
1577
+
1578
+  exit (1);
1579
+}
1580
+EOF
1581
+
1582
+$CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=`$dummy` &&
1583
+	{ echo "$SYSTEM_NAME"; exit; }
1584
+
1585
+# Apollos put the system type in the environment.
1586
+test -d /usr/apollo && { echo "$ISP-apollo-$SYSTYPE"; exit; }
1587
+
1419 1588
 echo "$0: unable to guess system type" >&2
1420 1589
 
1421 1590
 case "$UNAME_MACHINE:$UNAME_SYSTEM" in

+ 559
- 569
config/config.sub View File

@@ -1,8 +1,8 @@
1 1
 #! /bin/sh
2 2
 # Configuration validation subroutine script.
3
-#   Copyright 1992-2018 Free Software Foundation, Inc.
3
+#   Copyright 1992-2019 Free Software Foundation, Inc.
4 4
 
5
-timestamp='2018-05-24'
5
+timestamp='2019-01-05'
6 6
 
7 7
 # This file is free software; you can redistribute it and/or modify it
8 8
 # under the terms of the GNU General Public License as published by
@@ -67,7 +67,7 @@ Report bugs and patches to <config-patches@gnu.org>."
67 67
 version="\
68 68
 GNU config.sub ($timestamp)
69 69
 
70
-Copyright 1992-2018 Free Software Foundation, Inc.
70
+Copyright 1992-2019 Free Software Foundation, Inc.
71 71
 
72 72
 This is free software; see the source for copying conditions.  There is NO
73 73
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -89,7 +89,7 @@ while test $# -gt 0 ; do
89 89
     - )	# Use stdin as input.
90 90
        break ;;
91 91
     -* )
92
-       echo "$me: invalid option $1$help"
92
+       echo "$me: invalid option $1$help" >&2
93 93
        exit 1 ;;
94 94
 
95 95
     *local*)
@@ -111,7 +111,8 @@ case $# in
111 111
 esac
112 112
 
113 113
 # Split fields of configuration type
114
-IFS="-" read -r field1 field2 field3 field4 <<EOF
114
+# shellcheck disable=SC2162
115
+IFS="-" read field1 field2 field3 field4 <<EOF
115 116
 $1
116 117
 EOF
117 118
 
@@ -149,29 +150,39 @@ case $1 in
149 150
 		esac
150 151
 		;;
151 152
 	*-*)
152
-		# Second component is usually, but not always the OS
153
-		case $field2 in
154
-			# Prevent following clause from handling this valid os
155
-			sun*os*)
156
-				basic_machine=$field1
157
-				os=$field2
158
-				;;
159
-			# Manufacturers
160
-			dec* | mips* | sequent* | encore* | pc532* | sgi* | sony* \
161
-			| att* | 7300* | 3300* | delta* | motorola* | sun[234]* \
162
-			| unicom* | ibm* | next | hp | isi* | apollo | altos* \
163
-			| convergent* | ncr* | news | 32* | 3600* | 3100* | hitachi* \
164
-			| c[123]* | convex* | sun | crds | omron* | dg | ultra | tti* \
165
-			| harris | dolphin | highlevel | gould | cbm | ns | masscomp \
166
-			| apple | axis | knuth | cray | microblaze* \
167
-			| sim | cisco | oki | wec | wrs | winbond)
168
-				basic_machine=$field1-$field2
153
+		# A lone config we happen to match not fitting any pattern
154
+		case $field1-$field2 in
155
+			decstation-3100)
156
+				basic_machine=mips-dec
169 157
 				os=
170 158
 				;;
171
-			*)
172
-				basic_machine=$field1
173
-				os=$field2
174
-				;;
159
+			*-*)
160
+				# Second component is usually, but not always the OS
161
+				case $field2 in
162
+					# Prevent following clause from handling this valid os
163
+					sun*os*)
164
+						basic_machine=$field1
165
+						os=$field2
166
+						;;
167
+					# Manufacturers
168
+					dec* | mips* | sequent* | encore* | pc533* | sgi* | sony* \
169
+					| att* | 7300* | 3300* | delta* | motorola* | sun[234]* \
170
+					| unicom* | ibm* | next | hp | isi* | apollo | altos* \
171
+					| convergent* | ncr* | news | 32* | 3600* | 3100* \
172
+					| hitachi* | c[123]* | convex* | sun | crds | omron* | dg \
173
+					| ultra | tti* | harris | dolphin | highlevel | gould \
174
+					| cbm | ns | masscomp | apple | axis | knuth | cray \
175
+					| microblaze* | sim | cisco \
176
+					| oki | wec | wrs | winbond)
177
+						basic_machine=$field1-$field2
178
+						os=
179
+						;;
180
+					*)
181
+						basic_machine=$field1
182
+						os=$field2
183
+						;;
184
+				esac
185
+			;;
175 186
 		esac
176 187
 		;;
177 188
 	*)
@@ -190,6 +201,14 @@ case $1 in
190 201
 				basic_machine=m68010-adobe
191 202
 				os=scout
192 203
 				;;
204
+			alliant)
205
+				basic_machine=fx80-alliant
206
+				os=
207
+				;;
208
+			altos | altos3068)
209
+				basic_machine=m68k-altos
210
+				os=
211
+				;;
193 212
 			am29k)
194 213
 				basic_machine=a29k-none
195 214
 				os=bsd
@@ -198,6 +217,10 @@ case $1 in
198 217
 				basic_machine=580-amdahl
199 218
 				os=sysv
200 219
 				;;
220
+			amiga)
221
+				basic_machine=m68k-unknown
222
+				os=
223
+				;;
201 224
 			amigaos | amigados)
202 225
 				basic_machine=m68k-unknown
203 226
 				os=amigaos
@@ -234,13 +257,41 @@ case $1 in
234 257
 				basic_machine=arm-unknown
235 258
 				os=cegcc
236 259
 				;;
260
+			convex-c1)
261
+				basic_machine=c1-convex
262
+				os=bsd
263
+				;;
264
+			convex-c2)
265
+				basic_machine=c2-convex
266
+				os=bsd
267
+				;;
268
+			convex-c32)
269
+				basic_machine=c32-convex
270
+				os=bsd
271
+				;;
272
+			convex-c34)
273
+				basic_machine=c34-convex
274
+				os=bsd
275
+				;;
276
+			convex-c38)
277
+				basic_machine=c38-convex
278
+				os=bsd
279
+				;;
237 280
 			cray)
238 281
 				basic_machine=j90-cray
239 282
 				os=unicos
240 283
 				;;
241
-			craynv)
242
-				basic_machine=craynv-cray
243
-				os=unicosmp
284
+			crds | unos)
285
+				basic_machine=m68k-crds
286
+				os=
287
+				;;
288
+			da30)
289
+				basic_machine=m68k-da30
290
+				os=
291
+				;;
292
+			decstation | pmax | pmin | dec3100 | decstatn)
293
+				basic_machine=mips-dec
294
+				os=
244 295
 				;;
245 296
 			delta88)
246 297
 				basic_machine=m88k-motorola
@@ -286,6 +337,9 @@ case $1 in
286 337
 				basic_machine=m88k-harris
287 338
 				os=sysv3
288 339
 				;;
340
+			hp300)
341
+				basic_machine=m68k-hp
342
+				;;
289 343
 			hp300bsd)
290 344
 				basic_machine=m68k-hp
291 345
 				os=bsd
@@ -307,7 +361,7 @@ case $1 in
307 361
 				os=mach
308 362
 				;;
309 363
 			vsta)
310
-				basic_machine=i386-unknown
364
+				basic_machine=i386-pc
311 365
 				os=vsta
312 366
 				;;
313 367
 			isi68 | isi)
@@ -371,7 +425,7 @@ case $1 in
371 425
 				os=sysv4
372 426
 				;;
373 427
 			netbsd386)
374
-				basic_machine=i386-unknown
428
+				basic_machine=i386-pc
375 429
 				os=netbsd
376 430
 				;;
377 431
 			netwinder)
@@ -454,14 +508,26 @@ case $1 in
454 508
 				basic_machine=mips-sei
455 509
 				os=seiux
456 510
 				;;
511
+			sequent)
512
+				basic_machine=i386-sequent
513
+				os=
514
+				;;
457 515
 			sps7)
458 516
 				basic_machine=m68k-bull
459 517
 				os=sysv2
460 518
 				;;
519
+			st2000)
520
+				basic_machine=m68k-tandem
521
+				os=
522
+				;;
461 523
 			stratus)
462 524
 				basic_machine=i860-stratus
463 525
 				os=sysv4
464 526
 				;;
527
+			sun2)
528
+				basic_machine=m68000-sun
529
+				os=
530
+				;;
465 531
 			sun2os3)
466 532
 				basic_machine=m68000-sun
467 533
 				os=sunos3
@@ -470,6 +536,10 @@ case $1 in
470 536
 				basic_machine=m68000-sun
471 537
 				os=sunos4
472 538
 				;;
539
+			sun3)
540
+				basic_machine=m68k-sun
541
+				os=
542
+				;;
473 543
 			sun3os3)
474 544
 				basic_machine=m68k-sun
475 545
 				os=sunos3
@@ -478,6 +548,10 @@ case $1 in
478 548
 				basic_machine=m68k-sun
479 549
 				os=sunos4
480 550
 				;;
551
+			sun4)
552
+				basic_machine=sparc-sun
553
+				os=
554
+				;;
481 555
 			sun4os3)
482 556
 				basic_machine=sparc-sun
483 557
 				os=sunos3
@@ -490,6 +564,10 @@ case $1 in
490 564
 				basic_machine=sparc-sun
491 565
 				os=solaris2
492 566
 				;;
567
+			sun386 | sun386i | roadrunner)
568
+				basic_machine=i386-sun
569
+				os=
570
+				;;
493 571
 			sv1)
494 572
 				basic_machine=sv1-cray
495 573
 				os=unicos
@@ -562,417 +640,162 @@ case $1 in
562 640
 		;;
563 641
 esac
564 642
 
565
-# Decode aliases for certain CPU-COMPANY combinations.
643
+# Decode 1-component or ad-hoc basic machines
566 644
 case $basic_machine in
567
-	# Recognize the basic CPU types without company name.
568
-	# Some are omitted here because they have special meanings below.
569
-	1750a | 580 \
570
-	| a29k \
571
-	| aarch64 | aarch64_be \
572
-	| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
573
-	| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
574
-	| am33_2.0 \
575
-	| arc | arceb \
576
-	| arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv6m | armv[78][arm] \
577
-	| avr | avr32 \
578
-	| ba \
579
-	| be32 | be64 \
580
-	| bfin \
581
-	| c4x | c8051 | clipper | csky \
582
-	| d10v | d30v | dlx | dsp16xx \
583
-	| e2k | epiphany \
584
-	| fido | fr30 | frv | ft32 \
585
-	| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
586
-	| hexagon \
587
-	| i370 | i860 | i960 | ia16 | ia64 \
588
-	| ip2k | iq2000 \
589
-	| k1om \
590
-	| le32 | le64 \
591
-	| lm32 \
592
-	| m32c | m32r | m32rle | m68000 | m68k | m88k \
593
-	| maxq | mb | microblaze | microblazeel | mcore | mep | metag \
594
-	| mips | mipsbe | mipseb | mipsel | mipsle \
595
-	| mips16 \
596
-	| mips64 | mips64el \
597
-	| mips64octeon | mips64octeonel \
598
-	| mips64orion | mips64orionel \
599
-	| mips64r5900 | mips64r5900el \
600
-	| mips64vr | mips64vrel \
601
-	| mips64vr4100 | mips64vr4100el \
602
-	| mips64vr4300 | mips64vr4300el \
603
-	| mips64vr5000 | mips64vr5000el \
604
-	| mips64vr5900 | mips64vr5900el \
605
-	| mipsisa32 | mipsisa32el \
606
-	| mipsisa32r2 | mipsisa32r2el \
607
-	| mipsisa32r6 | mipsisa32r6el \
608
-	| mipsisa64 | mipsisa64el \
609
-	| mipsisa64r2 | mipsisa64r2el \
610
-	| mipsisa64r6 | mipsisa64r6el \
611
-	| mipsisa64sb1 | mipsisa64sb1el \
612
-	| mipsisa64sr71k | mipsisa64sr71kel \
613
-	| mipsr5900 | mipsr5900el \
614
-	| mipstx39 | mipstx39el \
615
-	| mn10200 | mn10300 \
616
-	| moxie \
617
-	| mt \
618
-	| msp430 \
619
-	| nds32 | nds32le | nds32be \
620
-	| nfp \
621
-	| nios | nios2 | nios2eb | nios2el \
622
-	| ns16k | ns32k \
623
-	| open8 | or1k | or1knd | or32 \
624
-	| pdp10 | pj | pjl \
625
-	| powerpc | powerpc64 | powerpc64le | powerpcle \
626
-	| pru \
627
-	| pyramid \
628
-	| riscv32 | riscv64 \
629
-	| rl78 | rx \
630
-	| score \
631
-	| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
632
-	| sh64 | sh64le \
633
-	| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
634
-	| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
635
-	| spu \
636
-	| tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
637
-	| ubicom32 \
638
-	| v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
639
-	| visium \
640
-	| wasm32 \
641
-	| x86 | xc16x | xstormy16 | xtensa \
642
-	| z8k | z80)
643
-		basic_machine=$basic_machine-unknown
644
-		;;
645
-	c54x)
646
-		basic_machine=tic54x-unknown
647
-		;;
648
-	c55x)
649
-		basic_machine=tic55x-unknown
650
-		;;
651
-	c6x)
652
-		basic_machine=tic6x-unknown
653
-		;;
654
-	leon|leon[3-9])
655
-		basic_machine=sparc-$basic_machine
656
-		;;
657
-	m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
658
-		basic_machine=$basic_machine-unknown
659
-		os=${os:-none}
660
-		;;
661
-	m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65)
645
+	# Here we handle the default manufacturer of certain CPU types.  It is in
646
+	# some cases the only manufacturer, in others, it is the most popular.
647
+	w89k)
648
+		cpu=hppa1.1
649
+		vendor=winbond
662 650
 		;;
663
-	m9s12z | m68hcs12z | hcs12z | s12z)
664
-		basic_machine=s12z-unknown
665
-		os=${os:-none}
651
+	op50n)
652
+		cpu=hppa1.1
653
+		vendor=oki
666 654
 		;;
667
-	ms1)
668
-		basic_machine=mt-unknown
655
+	op60c)
656
+		cpu=hppa1.1
657
+		vendor=oki
669 658
 		;;
670
-	strongarm | thumb | xscale)
671
-		basic_machine=arm-unknown
659
+	ibm*)
660
+		cpu=i370
661
+		vendor=ibm
672 662
 		;;
673
-	xgate)
674
-		basic_machine=$basic_machine-unknown
675
-		os=${os:-none}
663
+	orion105)
664
+		cpu=clipper
665
+		vendor=highlevel
676 666
 		;;
677
-	xscaleeb)
678
-		basic_machine=armeb-unknown
667
+	mac | mpw | mac-mpw)
668
+		cpu=m68k
669
+		vendor=apple
679 670
 		;;
680
-
681
-	xscaleel)
682
-		basic_machine=armel-unknown
671
+	pmac | pmac-mpw)
672
+		cpu=powerpc
673
+		vendor=apple
683 674
 		;;
684 675
 
685
-	# We use `pc' rather than `unknown'
686
-	# because (1) that's what they normally are, and
687
-	# (2) the word "unknown" tends to confuse beginning users.
688
-	i*86 | x86_64)
689
-	  basic_machine=$basic_machine-pc
690
-	  ;;
691
-	# Recognize the basic CPU types with company name.
692
-	580-* \
693
-	| a29k-* \
694
-	| aarch64-* | aarch64_be-* \
695
-	| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
696
-	| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
697
-	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
698
-	| arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
699
-	| avr-* | avr32-* \
700
-	| ba-* \
701
-	| be32-* | be64-* \
702
-	| bfin-* | bs2000-* \
703
-	| c[123]* | c30-* | [cjt]90-* | c4x-* \
704
-	| c8051-* | clipper-* | craynv-* | csky-* | cydra-* \
705
-	| d10v-* | d30v-* | dlx-* \
706
-	| e2k-* | elxsi-* \
707
-	| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
708
-	| h8300-* | h8500-* \
709
-	| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
710
-	| hexagon-* \
711
-	| i*86-* | i860-* | i960-* | ia16-* | ia64-* \
712
-	| ip2k-* | iq2000-* \
713
-	| k1om-* \
714
-	| le32-* | le64-* \
715
-	| lm32-* \
716
-	| m32c-* | m32r-* | m32rle-* \
717
-	| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
718
-	| m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
719
-	| microblaze-* | microblazeel-* \
720
-	| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
721
-	| mips16-* \
722
-	| mips64-* | mips64el-* \
723
-	| mips64octeon-* | mips64octeonel-* \
724
-	| mips64orion-* | mips64orionel-* \
725
-	| mips64r5900-* | mips64r5900el-* \
726
-	| mips64vr-* | mips64vrel-* \
727
-	| mips64vr4100-* | mips64vr4100el-* \
728
-	| mips64vr4300-* | mips64vr4300el-* \
729
-	| mips64vr5000-* | mips64vr5000el-* \
730
-	| mips64vr5900-* | mips64vr5900el-* \
731
-	| mipsisa32-* | mipsisa32el-* \
732
-	| mipsisa32r2-* | mipsisa32r2el-* \
733
-	| mipsisa32r6-* | mipsisa32r6el-* \
734
-	| mipsisa64-* | mipsisa64el-* \
735
-	| mipsisa64r2-* | mipsisa64r2el-* \
736
-	| mipsisa64r6-* | mipsisa64r6el-* \
737
-	| mipsisa64sb1-* | mipsisa64sb1el-* \
738
-	| mipsisa64sr71k-* | mipsisa64sr71kel-* \
739
-	| mipsr5900-* | mipsr5900el-* \
740
-	| mipstx39-* | mipstx39el-* \
741
-	| mmix-* \
742
-	| mt-* \
743
-	| msp430-* \
744
-	| nds32-* | nds32le-* | nds32be-* \
745
-	| nfp-* \
746
-	| nios-* | nios2-* | nios2eb-* | nios2el-* \
747
-	| none-* | np1-* | ns16k-* | ns32k-* \
748
-	| open8-* \
749
-	| or1k*-* \
750
-	| orion-* \
751
-	| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
752
-	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
753
-	| pru-* \
754
-	| pyramid-* \
755
-	| riscv32-* | riscv64-* \
756
-	| rl78-* | romp-* | rs6000-* | rx-* \
757
-	| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
758
-	| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
759
-	| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
760
-	| sparclite-* \
761
-	| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \
762
-	| tahoe-* \
763
-	| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
764
-	| tile*-* \
765
-	| tron-* \
766
-	| ubicom32-* \
767
-	| v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
768
-	| vax-* \
769
-	| visium-* \
770
-	| wasm32-* \
771
-	| we32k-* \
772
-	| x86-* | x86_64-* | xc16x-* | xps100-* \
773
-	| xstormy16-* | xtensa*-* \
774
-	| ymp-* \
775
-	| z8k-* | z80-*)
776
-		;;
777
-	# Recognize the basic CPU types without company name, with glob match.
778
-	xtensa*)
779
-		basic_machine=$basic_machine-unknown
780
-		;;
781 676
 	# Recognize the various machine names and aliases which stand
782 677
 	# for a CPU type and a company and sometimes even an OS.
783 678
 	3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
784
-		basic_machine=m68000-att
679
+		cpu=m68000
680
+		vendor=att
785 681
 		;;
786 682
 	3b*)
787
-		basic_machine=we32k-att
788
-		;;
789
-	abacus)
790
-		basic_machine=abacus-unknown
791
-		;;
792
-	alliant | fx80)
793
-		basic_machine=fx80-alliant
794
-		;;
795
-	altos | altos3068)
796
-		basic_machine=m68k-altos
797
-		;;
798
-	amd64)
799
-		basic_machine=x86_64-pc
800
-		;;
801
-	amd64-*)
802
-		basic_machine=x86_64-`echo "$basic_machine" | sed 's/^[^-]*-//'`
803
-		;;
804
-	amiga | amiga-*)
805
-		basic_machine=m68k-unknown
806
-		;;
807
-	asmjs)
808
-		basic_machine=asmjs-unknown
809
-		;;
810
-	blackfin-*)
811
-		basic_machine=bfin-`echo "$basic_machine" | sed 's/^[^-]*-//'`
812
-		os=linux
683
+		cpu=we32k
684
+		vendor=att
813 685
 		;;
814 686
 	bluegene*)
815
-		basic_machine=powerpc-ibm
687
+		cpu=powerpc
688
+		vendor=ibm
816 689
 		os=cnk
817 690
 		;;
818
-	c54x-*)
819
-		basic_machine=tic54x-`echo "$basic_machine" | sed 's/^[^-]*-//'`
820
-		;;
821
-	c55x-*)
822
-		basic_machine=tic55x-`echo "$basic_machine" | sed 's/^[^-]*-//'`
823
-		;;
824
-	c6x-*)
825
-		basic_machine=tic6x-`echo "$basic_machine" | sed 's/^[^-]*-//'`
826
-		;;
827
-	c90)
828
-		basic_machine=c90-cray
829
-		os=${os:-unicos}
830
-		;;
831
-	convex-c1)
832
-		basic_machine=c1-convex
833
-		os=bsd
834
-		;;
835
-	convex-c2)
836
-		basic_machine=c2-convex
837
-		os=bsd
838
-		;;
839
-	convex-c32)
840
-		basic_machine=c32-convex
841
-		os=bsd
842
-		;;
843
-	convex-c34)
844
-		basic_machine=c34-convex
845
-		os=bsd
846
-		;;
847
-	convex-c38)
848
-		basic_machine=c38-convex
849
-		os=bsd
850
-		;;
851
-	cr16 | cr16-*)
852
-		basic_machine=cr16-unknown
853
-		os=${os:-elf}
854
-		;;
855
-	crds | unos)
856
-		basic_machine=m68k-crds
857
-		;;
858
-	crisv32 | crisv32-* | etraxfs*)
859
-		basic_machine=crisv32-axis
860
-		;;
861
-	cris | cris-* | etrax*)
862
-		basic_machine=cris-axis
863
-		;;
864
-	crx)
865
-		basic_machine=crx-unknown
866
-		os=${os:-elf}
867
-		;;
868
-	da30 | da30-*)
869
-		basic_machine=m68k-da30
870
-		;;
871
-	decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
872
-		basic_machine=mips-dec
873
-		;;
874 691
 	decsystem10* | dec10*)
875
-		basic_machine=pdp10-dec
692
+		cpu=pdp10
693
+		vendor=dec
876 694
 		os=tops10
877 695
 		;;
878 696
 	decsystem20* | dec20*)
879
-		basic_machine=pdp10-dec
697
+		cpu=pdp10
698
+		vendor=dec
880 699
 		os=tops20
881 700
 		;;
882 701
 	delta | 3300 | motorola-3300 | motorola-delta \
883 702
 	      | 3300-motorola | delta-motorola)
884
-		basic_machine=m68k-motorola
885
-		;;
886
-	dpx20 | dpx20-*)
887
-		basic_machine=rs6000-bull
888
-		os=${os:-bosx}
703
+		cpu=m68k
704
+		vendor=motorola
889 705
 		;;
890 706
 	dpx2*)
891
-		basic_machine=m68k-bull
707
+		cpu=m68k
708
+		vendor=bull
892 709
 		os=sysv3
893 710
 		;;
894
-	e500v[12])
895
-		basic_machine=powerpc-unknown
896
-		os=$os"spe"
897
-		;;
898
-	e500v[12]-*)
899
-		basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'`
900
-		os=$os"spe"
901
-		;;
902 711
 	encore | umax | mmax)
903
-		basic_machine=ns32k-encore
712
+		cpu=ns32k
713
+		vendor=encore
904 714
 		;;
905 715
 	elxsi)
906
-		basic_machine=elxsi-elxsi
716
+		cpu=elxsi
717
+		vendor=elxsi
907 718
 		os=${os:-bsd}
908 719
 		;;
909 720
 	fx2800)
910
-		basic_machine=i860-alliant
721
+		cpu=i860
722
+		vendor=alliant
911 723
 		;;
912 724
 	genix)
913
-		basic_machine=ns32k-ns
725
+		cpu=ns32k
726
+		vendor=ns
914 727
 		;;
915 728
 	h3050r* | hiux*)
916
-		basic_machine=hppa1.1-hitachi
729
+		cpu=hppa1.1
730
+		vendor=hitachi
917 731
 		os=hiuxwe2
918 732
 		;;
919
-	hp300-*)
920
-		basic_machine=m68k-hp
921
-		;;
922 733
 	hp3k9[0-9][0-9] | hp9[0-9][0-9])
923
-		basic_machine=hppa1.0-hp
734
+		cpu=hppa1.0
735
+		vendor=hp
924 736
 		;;
925 737
 	hp9k2[0-9][0-9] | hp9k31[0-9])
926
-		basic_machine=m68000-hp
738
+		cpu=m68000
739
+		vendor=hp
927 740
 		;;
928 741
 	hp9k3[2-9][0-9])
929
-		basic_machine=m68k-hp
742
+		cpu=m68k
743
+		vendor=hp
930 744
 		;;
931 745
 	hp9k6[0-9][0-9] | hp6[0-9][0-9])
932
-		basic_machine=hppa1.0-hp
746
+		cpu=hppa1.0
747
+		vendor=hp
933 748
 		;;
934 749
 	hp9k7[0-79][0-9] | hp7[0-79][0-9])
935
-		basic_machine=hppa1.1-hp
750
+		cpu=hppa1.1
751
+		vendor=hp
936 752
 		;;
937 753
 	hp9k78[0-9] | hp78[0-9])
938 754
 		# FIXME: really hppa2.0-hp
939
-		basic_machine=hppa1.1-hp
755
+		cpu=hppa1.1
756
+		vendor=hp
940 757
 		;;
941 758
 	hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
942 759
 		# FIXME: really hppa2.0-hp
943
-		basic_machine=hppa1.1-hp
760
+		cpu=hppa1.1
761
+		vendor=hp
944 762
 		;;
945 763
 	hp9k8[0-9][13679] | hp8[0-9][13679])
946
-		basic_machine=hppa1.1-hp
764
+		cpu=hppa1.1
765
+		vendor=hp
947 766
 		;;
948 767
 	hp9k8[0-9][0-9] | hp8[0-9][0-9])
949
-		basic_machine=hppa1.0-hp
950
-		;;
951
-	i370-ibm* | ibm*)
952
-		basic_machine=i370-ibm
768
+		cpu=hppa1.0
769
+		vendor=hp
953 770
 		;;
954 771
 	i*86v32)
955
-		basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'`
772
+		cpu=`echo "$1" | sed -e 's/86.*/86/'`
773
+		vendor=pc
956 774
 		os=sysv32
957 775
 		;;
958 776
 	i*86v4*)
959
-		basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'`
777
+		cpu=`echo "$1" | sed -e 's/86.*/86/'`
778
+		vendor=pc
960 779
 		os=sysv4
961 780
 		;;
962 781
 	i*86v)
963
-		basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'`
782
+		cpu=`echo "$1" | sed -e 's/86.*/86/'`
783
+		vendor=pc
964 784
 		os=sysv
965 785
 		;;
966 786
 	i*86sol2)
967
-		basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'`
787
+		cpu=`echo "$1" | sed -e 's/86.*/86/'`
788
+		vendor=pc
968 789
 		os=solaris2
969 790
 		;;
970 791
 	j90 | j90-cray)
971
-		basic_machine=j90-cray
792
+		cpu=j90
793
+		vendor=cray
972 794
 		os=${os:-unicos}
973 795
 		;;
974 796
 	iris | iris4d)
975
-		basic_machine=mips-sgi
797
+		cpu=mips
798
+		vendor=sgi
976 799
 		case $os in
977 800
 		    irix*)
978 801
 			;;
@@ -981,40 +804,27 @@ case $basic_machine in
981 804
 			;;
982 805
 		esac
983 806
 		;;
984
-	leon-*|leon[3-9]-*)
985
-		basic_machine=sparc-`echo "$basic_machine" | sed 's/-.*//'`
986
-		;;
987
-	m68knommu-*)
988
-		basic_machine=m68k-`echo "$basic_machine" | sed 's/^[^-]*-//'`
989
-		os=linux
990
-		;;
991
-	microblaze*)
992
-		basic_machine=microblaze-xilinx
993
-		;;
994 807
 	miniframe)
995
-		basic_machine=m68000-convergent
808
+		cpu=m68000
809
+		vendor=convergent
996 810
 		;;
997 811
 	*mint | mint[0-9]* | *MiNT | *MiNT[0-9]*)
998
-		basic_machine=m68k-atari
812
+		cpu=m68k
813
+		vendor=atari
999 814
 		os=mint
1000 815
 		;;
1001
-	mips3*-*)
1002
-		basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'`
1003
-		;;
1004
-	mips3*)
1005
-		basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'`-unknown
1006
-		;;
1007
-	ms1-*)
1008
-		basic_machine=`echo "$basic_machine" | sed -e 's/ms1-/mt-/'`
1009
-		;;
1010 816
 	news-3600 | risc-news)
1011
-		basic_machine=mips-sony
817
+		cpu=mips
818
+		vendor=sony
1012 819
 		os=newsos
1013 820
 		;;
1014 821
 	next | m*-next)
1015
-		basic_machine=m68k-next
822
+		cpu=m68k
823
+		vendor=next
1016 824
 		case $os in
1017
-		    nextstep* )
825
+		    openstep*)
826
+		        ;;
827
+		    nextstep*)
1018 828
 			;;
1019 829
 		    ns2*)
1020 830
 		      os=nextstep2
@@ -1025,260 +835,442 @@ case $basic_machine in
1025 835
 		esac
1026 836
 		;;
1027 837
 	np1)
1028
-		basic_machine=np1-gould
838
+		cpu=np1
839
+		vendor=gould
1029 840
 		;;
1030
-	neo-tandem)
1031
-		basic_machine=neo-tandem
841
+	op50n-* | op60c-*)
842
+		cpu=hppa1.1
843
+		vendor=oki
844
+		os=proelf
1032 845
 		;;
1033
-	nse-tandem)
1034
-		basic_machine=nse-tandem
846
+	pa-hitachi)
847
+		cpu=hppa1.1
848
+		vendor=hitachi
849
+		os=hiuxwe2
1035 850
 		;;
1036
-	nsr-tandem)
1037
-		basic_machine=nsr-tandem
851
+	pbd)
852
+		cpu=sparc
853
+		vendor=tti
1038 854
 		;;
1039
-	nsv-tandem)
1040
-		basic_machine=nsv-tandem
855
+	pbb)
856
+		cpu=m68k
857
+		vendor=tti
1041 858
 		;;
1042
-	nsx-tandem)
1043
-		basic_machine=nsx-tandem
859
+	pc532)
860
+		cpu=ns32k
861
+		vendor=pc532
1044 862
 		;;
1045
-	op50n-* | op60c-*)
1046
-		basic_machine=hppa1.1-oki
1047
-		os=proelf
863
+	pn)
864
+		cpu=pn
865
+		vendor=gould
1048 866
 		;;
1049
-	openrisc | openrisc-*)
1050
-		basic_machine=or32-unknown
867
+	power)
868
+		cpu=power
869
+		vendor=ibm
1051 870
 		;;
1052
-	pa-hitachi)
1053
-		basic_machine=hppa1.1-hitachi
1054
-		os=hiuxwe2
871
+	ps2)
872
+		cpu=i386
873
+		vendor=ibm
1055 874
 		;;
1056
-	parisc-*)
1057
-		basic_machine=hppa-`echo "$basic_machine" | sed 's/^[^-]*-//'`
1058
-		os=linux
875
+	rm[46]00)
876
+		cpu=mips
877
+		vendor=siemens
1059 878
 		;;
1060
-	pbd)
1061
-		basic_machine=sparc-tti
879
+	rtpc | rtpc-*)
880
+		cpu=romp
881
+		vendor=ibm
1062 882
 		;;
1063
-	pbb)
1064
-		basic_machine=m68k-tti
883
+	sde)
884
+		cpu=mipsisa32
885
+		vendor=sde
886
+		os=${os:-elf}
1065 887
 		;;
1066
-	pc532 | pc532-*)
1067
-		basic_machine=ns32k-pc532
888
+	simso-wrs)
889
+		cpu=sparclite
890
+		vendor=wrs
891
+		os=vxworks
1068 892
 		;;
1069
-	pc98)
1070
-		basic_machine=i386-pc
893
+	tower | tower-32)
894
+		cpu=m68k
895
+		vendor=ncr
1071 896
 		;;
1072
-	pc98-*)
1073
-		basic_machine=i386-`echo "$basic_machine" | sed 's/^[^-]*-//'`
897
+	vpp*|vx|vx-*)
898
+		cpu=f301
899
+		vendor=fujitsu
900
+		;;
901
+	w65)
902
+		cpu=w65
903
+		vendor=wdc
904
+		;;
905
+	w89k-*)
906
+		cpu=hppa1.1
907
+		vendor=winbond
908
+		os=proelf
1074 909
 		;;
1075
-	pentium | p5 | k5 | k6 | nexgen | viac3)
1076
-		basic_machine=i586-pc
910
+	none)
911
+		cpu=none
912
+		vendor=none
1077 913
 		;;
1078
-	pentiumpro | p6 | 6x86 | athlon | athlon_*)
1079
-		basic_machine=i686-pc
914
+	leon|leon[3-9])
915
+		cpu=sparc
916
+		vendor=$basic_machine
1080 917
 		;;
1081
-	pentiumii | pentium2 | pentiumiii | pentium3)
1082
-		basic_machine=i686-pc
918
+	leon-*|leon[3-9]-*)
919
+		cpu=sparc
920
+		vendor=`echo "$basic_machine" | sed 's/-.*//'`
1083 921
 		;;
1084
-	pentium4)
1085
-		basic_machine=i786-pc
922
+
923
+	*-*)
924
+		# shellcheck disable=SC2162
925
+		IFS="-" read cpu vendor <<EOF
926
+$basic_machine
927
+EOF
1086 928
 		;;
1087
-	pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
1088
-		basic_machine=i586-`echo "$basic_machine" | sed 's/^[^-]*-//'`
929
+	# We use `pc' rather than `unknown'
930
+	# because (1) that's what they normally are, and
931
+	# (2) the word "unknown" tends to confuse beginning users.
932
+	i*86 | x86_64)
933
+		cpu=$basic_machine
934
+		vendor=pc
1089 935
 		;;
1090
-	pentiumpro-* | p6-* | 6x86-* | athlon-*)
1091
-		basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'`
936
+	# These rules are duplicated from below for sake of the special case above;
937
+	# i.e. things that normalized to x86 arches should also default to "pc"
938
+	pc98)
939
+		cpu=i386
940
+		vendor=pc
1092 941
 		;;
1093
-	pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
1094
-		basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'`
942
+	x64 | amd64)
943
+		cpu=x86_64
944
+		vendor=pc
1095 945
 		;;
1096
-	pentium4-*)
1097
-		basic_machine=i786-`echo "$basic_machine" | sed 's/^[^-]*-//'`
946
+	# Recognize the basic CPU types without company name.
947
+	*)
948
+		cpu=$basic_machine
949
+		vendor=unknown
1098 950
 		;;
1099
-	pn)
1100
-		basic_machine=pn-gould
951
+esac
952
+
953
+unset -v basic_machine
954
+
955
+# Decode basic machines in the full and proper CPU-Company form.
956
+case $cpu-$vendor in
957
+	# Here we handle the default manufacturer of certain CPU types in canonical form. It is in
958
+	# some cases the only manufacturer, in others, it is the most popular.
959
+	craynv-unknown)
960
+		vendor=cray
961
+		os=${os:-unicosmp}
962
+		;;
963
+	c90-unknown | c90-cray)
964
+		vendor=cray
965
+		os=${os:-unicos}
1101 966
 		;;
1102
-	power)	basic_machine=power-ibm
967
+	fx80-unknown)
968
+		vendor=alliant
1103 969
 		;;
1104
-	ppc | ppcbe)	basic_machine=powerpc-unknown
970
+	romp-unknown)
971
+		vendor=ibm
1105 972
 		;;
1106
-	ppc-* | ppcbe-*)
1107
-		basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'`
973
+	mmix-unknown)
974
+		vendor=knuth
1108 975
 		;;
1109
-	ppcle | powerpclittle)
1110
-		basic_machine=powerpcle-unknown
976
+	microblaze-unknown | microblazeel-unknown)
977
+		vendor=xilinx
1111 978
 		;;
1112
-	ppcle-* | powerpclittle-*)
1113
-		basic_machine=powerpcle-`echo "$basic_machine" | sed 's/^[^-]*-//'`
979
+	rs6000-unknown)
980
+		vendor=ibm
1114 981
 		;;
1115
-	ppc64)	basic_machine=powerpc64-unknown
982
+	vax-unknown)
983
+		vendor=dec
1116 984
 		;;
1117
-	ppc64-*) basic_machine=powerpc64-`echo "$basic_machine" | sed 's/^[^-]*-//'`
985
+	pdp11-unknown)
986
+		vendor=dec
1118 987
 		;;
1119
-	ppc64le | powerpc64little)
1120
-		basic_machine=powerpc64le-unknown
988
+	we32k-unknown)
989
+		vendor=att
1121 990
 		;;
1122
-	ppc64le-* | powerpc64little-*)
1123
-		basic_machine=powerpc64le-`echo "$basic_machine" | sed 's/^[^-]*-//'`
991
+	cydra-unknown)
992
+		vendor=cydrome
1124 993
 		;;
1125
-	ps2)
1126
-		basic_machine=i386-ibm
994
+	i370-ibm*)
995
+		vendor=ibm
1127 996
 		;;
1128
-	rm[46]00)
1129
-		basic_machine=mips-siemens
997
+	orion-unknown)
998
+		vendor=highlevel
1130 999
 		;;
1131
-	rtpc | rtpc-*)
1132
-		basic_machine=romp-ibm
1000
+	xps-unknown | xps100-unknown)
1001
+		cpu=xps100
1002
+		vendor=honeywell
1003
+		;;
1004
+
1005
+	# Here we normalize CPU types with a missing or matching vendor
1006
+	dpx20-unknown | dpx20-bull)
1007
+		cpu=rs6000
1008
+		vendor=bull
1009
+		os=${os:-bosx}
1133 1010
 		;;
1134
-	s390 | s390-*)
1135
-		basic_machine=s390-ibm
1011
+
1012
+	# Here we normalize CPU types irrespective of the vendor
1013
+	amd64-*)
1014
+		cpu=x86_64
1136 1015
 		;;
1137
-	s390x | s390x-*)
1138
-		basic_machine=s390x-ibm
1016
+	blackfin-*)
1017
+		cpu=bfin
1018
+		os=linux
1139 1019
 		;;
1140
-	sb1)
1141
-		basic_machine=mipsisa64sb1-unknown
1020
+	c54x-*)
1021
+		cpu=tic54x
1142 1022
 		;;
1143
-	sb1el)
1144
-		basic_machine=mipsisa64sb1el-unknown
1023
+	c55x-*)
1024
+		cpu=tic55x
1145 1025
 		;;
1146
-	sde)
1147
-		basic_machine=mipsisa32-sde
1148
-		os=${os:-elf}
1026
+	c6x-*)
1027
+		cpu=tic6x
1149 1028
 		;;
1150
-	sequent)
1151
-		basic_machine=i386-sequent
1029
+	e500v[12]-*)
1030
+		cpu=powerpc
1031
+		os=$os"spe"
1152 1032
 		;;
1153
-	sh5el)
1154
-		basic_machine=sh5le-unknown
1033
+	mips3*-*)
1034
+		cpu=mips64
1155 1035
 		;;
1156
-	simso-wrs)
1157
-		basic_machine=sparclite-wrs
1158
-		os=vxworks
1036
+	ms1-*)
1037
+		cpu=mt
1159 1038
 		;;
1160
-	spur)
1161
-		basic_machine=spur-unknown
1039
+	m68knommu-*)
1040
+		cpu=m68k
1041
+		os=linux
1162 1042
 		;;
1163
-	st2000)
1164
-		basic_machine=m68k-tandem
1043
+	m9s12z-* | m68hcs12z-* | hcs12z-* | s12z-*)
1044
+		cpu=s12z
1165 1045
 		;;
1166
-	strongarm-* | thumb-*)
1167
-		basic_machine=arm-`echo "$basic_machine" | sed 's/^[^-]*-//'`
1046
+	openrisc-*)
1047
+		cpu=or32
1168 1048
 		;;
1169
-	sun2)
1170
-		basic_machine=m68000-sun
1049
+	parisc-*)
1050
+		cpu=hppa
1051
+		os=linux
1171 1052
 		;;
1172
-	sun3 | sun3-*)
1173
-		basic_machine=m68k-sun
1053
+	pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
1054
+		cpu=i586
1174 1055
 		;;
1175
-	sun4)
1176
-		basic_machine=sparc-sun
1056
+	pentiumpro-* | p6-* | 6x86-* | athlon-* | athalon_*-*)
1057
+		cpu=i686
1177 1058
 		;;
1178
-	sun386 | sun386i | roadrunner)
1179
-		basic_machine=i386-sun
1059
+	pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
1060
+		cpu=i686
1180 1061
 		;;
1181
-	tile*)
1182
-		basic_machine=$basic_machine-unknown
1183
-		os=linux-gnu
1062
+	pentium4-*)
1063
+		cpu=i786
1184 1064
 		;;
1185
-	tx39)
1186
-		basic_machine=mipstx39-unknown
1065
+	pc98-*)
1066
+		cpu=i386
1187 1067
 		;;
1188
-	tx39el)
1189
-		basic_machine=mipstx39el-unknown
1068
+	ppc-* | ppcbe-*)
1069
+		cpu=powerpc
1190 1070
 		;;
1191
-	tower | tower-32)
1192
-		basic_machine=m68k-ncr
1071
+	ppcle-* | powerpclittle-*)
1072
+		cpu=powerpcle
1193 1073
 		;;
1194
-	vpp*|vx|vx-*)
1195
-		basic_machine=f301-fujitsu
1074
+	ppc64-*)
1075
+		cpu=powerpc64
1196 1076
 		;;
1197
-	w65*)
1198
-		basic_machine=w65-wdc
1199
-		os=none
1077
+	ppc64le-* | powerpc64little-*)
1078
+		cpu=powerpc64le
1200 1079
 		;;
1201
-	w89k-*)
1202
-		basic_machine=hppa1.1-winbond
1203
-		os=proelf
1080
+	sb1-*)
1081
+		cpu=mipsisa64sb1
1204 1082
 		;;
1205
-	x64)
1206
-		basic_machine=x86_64-pc
1083
+	sb1el-*)
1084
+		cpu=mipsisa64sb1el
1207 1085
 		;;
1208
-	xps | xps100)
1209
-		basic_machine=xps100-honeywell
1086
+	sh5e[lb]-*)
1087
+		cpu=`echo "$cpu" | sed 's/^\(sh.\)e\(.\)$/\1\2e/'`
1210 1088
 		;;
1211
-	xscale-* | xscalee[bl]-*)
1212
-		basic_machine=`echo "$basic_machine" | sed 's/^xscale/arm/'`
1089
+	spur-*)
1090
+		cpu=spur
1213 1091
 		;;
1214
-	none)
1215
-		basic_machine=none-none
1216
-		os=${os:-none}
1092
+	strongarm-* | thumb-*)
1093
+		cpu=arm
1217 1094
 		;;
1218
-
1219
-# Here we handle the default manufacturer of certain CPU types.  It is in
1220
-# some cases the only manufacturer, in others, it is the most popular.
1221
-	w89k)
1222
-		basic_machine=hppa1.1-winbond
1095
+	tx39-*)
1096
+		cpu=mipstx39
1223 1097
 		;;
1224
-	op50n)
1225
-		basic_machine=hppa1.1-oki
1098
+	tx39el-*)
1099
+		cpu=mipstx39el
1226 1100
 		;;
1227
-	op60c)
1228
-		basic_machine=hppa1.1-oki
1101
+	x64-*)
1102
+		cpu=x86_64
1229 1103
 		;;
1230
-	romp)
1231
-		basic_machine=romp-ibm
1104
+	xscale-* | xscalee[bl]-*)
1105
+		cpu=`echo "$cpu" | sed 's/^xscale/arm/'`
1232 1106
 		;;
1233
-	mmix)
1234
-		basic_machine=mmix-knuth
1107
+
1108
+	# Recognize the canonical CPU Types that limit and/or modify the
1109
+	# company names they are paired with.
1110
+	cr16-*)
1111
+		os=${os:-elf}
1235 1112
 		;;
1236
-	rs6000)
1237
-		basic_machine=rs6000-ibm
1113
+	crisv32-* | etraxfs*-*)
1114
+		cpu=crisv32
1115
+		vendor=axis
1238 1116
 		;;
1239
-	vax)
1240
-		basic_machine=vax-dec
1117
+	cris-* | etrax*-*)
1118
+		cpu=cris
1119
+		vendor=axis
1241 1120
 		;;
1242
-	pdp11)
1243
-		basic_machine=pdp11-dec
1121
+	crx-*)
1122
+		os=${os:-elf}
1244 1123
 		;;
1245
-	we32k)
1246
-		basic_machine=we32k-att
1124
+	neo-tandem)
1125
+		cpu=neo
1126
+		vendor=tandem
1247 1127
 		;;
1248
-	sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
1249
-		basic_machine=sh-unknown
1128
+	nse-tandem)
1129
+		cpu=nse
1130
+		vendor=tandem
1250 1131
 		;;
1251
-	cydra)
1252
-		basic_machine=cydra-cydrome
1132
+	nsr-tandem)
1133
+		cpu=nsr
1134
+		vendor=tandem
1253 1135
 		;;
1254
-	orion)
1255
-		basic_machine=orion-highlevel
1136
+	nsv-tandem)
1137
+		cpu=nsv
1138
+		vendor=tandem
1256 1139
 		;;
1257
-	orion105)
1258
-		basic_machine=clipper-highlevel
1140
+	nsx-tandem)
1141
+		cpu=nsx
1142
+		vendor=tandem
1259 1143
 		;;
1260
-	mac | mpw | mac-mpw)
1261
-		basic_machine=m68k-apple
1144
+	s390-*)
1145
+		cpu=s390
1146
+		vendor=ibm
1262 1147
 		;;
1263
-	pmac | pmac-mpw)
1264
-		basic_machine=powerpc-apple
1148
+	s390x-*)
1149
+		cpu=s390x
1150
+		vendor=ibm
1265 1151
 		;;
1266
-	*-unknown)
1267
-		# Make sure to match an already-canonicalized machine name.
1152
+	tile*-*)
1153
+		os=${os:-linux-gnu}
1268 1154
 		;;
1155
+
1269 1156
 	*)
1270
-		echo Invalid configuration \`"$1"\': machine \`"$basic_machine"\' not recognized 1>&2
1271
-		exit 1
1157
+		# Recognize the canonical CPU types that are allowed with any
1158
+		# company name.
1159
+		case $cpu in
1160
+			1750a | 580 \
1161
+			| a29k \
1162
+			| aarch64 | aarch64_be \
1163
+			| abacus \
1164
+			| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] \
1165
+			| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] \
1166
+			| alphapca5[67] | alpha64pca5[67] \
1167
+			| am33_2.0 \
1168
+			| amdgcn \
1169
+			| arc | arceb \
1170
+			| arm  | arm[lb]e | arme[lb] | armv* \
1171
+			| avr | avr32 \
1172
+			| asmjs \
1173
+			| ba \
1174
+			| be32 | be64 \
1175
+			| bfin | bs2000 \
1176
+			| c[123]* | c30 | [cjt]90 | c4x \
1177
+			| c8051 | clipper | craynv | csky | cydra \
1178
+			| d10v | d30v | dlx | dsp16xx \
1179
+			| e2k | elxsi | epiphany \
1180
+			| f30[01] | f700 | fido | fr30 | frv | ft32 | fx80 \
1181
+			| h8300 | h8500 \
1182
+			| hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
1183
+			| hexagon \
1184
+			| i370 | i*86 | i860 | i960 | ia16 | ia64 \
1185
+			| ip2k | iq2000 \
1186
+			| k1om \
1187
+			| le32 | le64 \
1188
+			| lm32 \
1189
+			| m32c | m32r | m32rle \
1190
+			| m5200 | m68000 | m680[012346]0 | m68360 | m683?2 | m68k \
1191
+			| m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x \
1192
+			| m88110 | m88k | maxq | mb | mcore | mep | metag \
1193
+			| microblaze | microblazeel \
1194
+			| mips | mipsbe | mipseb | mipsel | mipsle \
1195
+			| mips16 \
1196
+			| mips64 | mips64eb | mips64el \
1197
+			| mips64octeon | mips64octeonel \
1198
+			| mips64orion | mips64orionel \
1199
+			| mips64r5900 | mips64r5900el \
1200
+			| mips64vr | mips64vrel \
1201
+			| mips64vr4100 | mips64vr4100el \
1202
+			| mips64vr4300 | mips64vr4300el \
1203
+			| mips64vr5000 | mips64vr5000el \
1204
+			| mips64vr5900 | mips64vr5900el \
1205
+			| mipsisa32 | mipsisa32el \
1206
+			| mipsisa32r2 | mipsisa32r2el \
1207
+			| mipsisa32r6 | mipsisa32r6el \
1208
+			| mipsisa64 | mipsisa64el \
1209
+			| mipsisa64r2 | mipsisa64r2el \
1210
+			| mipsisa64r6 | mipsisa64r6el \
1211
+			| mipsisa64sb1 | mipsisa64sb1el \
1212
+			| mipsisa64sr71k | mipsisa64sr71kel \
1213
+			| mipsr5900 | mipsr5900el \
1214
+			| mipstx39 | mipstx39el \
1215
+			| mmix \
1216
+			| mn10200 | mn10300 \
1217
+			| moxie \
1218
+			| mt \
1219
+			| msp430 \
1220
+			| nds32 | nds32le | nds32be \
1221
+			| nfp \
1222
+			| nios | nios2 | nios2eb | nios2el \
1223
+			| none | np1 | ns16k | ns32k | nvptx \
1224
+			| open8 \
1225
+			| or1k* \
1226
+			| or32 \
1227
+			| orion \
1228
+			| picochip \
1229
+			| pdp10 | pdp11 | pj | pjl | pn | power \
1230
+			| powerpc | powerpc64 | powerpc64le | powerpcle | powerpcspe \
1231
+			| pru \
1232
+			| pyramid \
1233
+			| riscv | riscv32 | riscv64 \
1234
+			| rl78 | romp | rs6000 | rx \
1235
+			| score \
1236
+			| sh | shl \
1237
+			| sh[1234] | sh[24]a | sh[24]ae[lb] | sh[23]e | she[lb] | sh[lb]e \
1238
+			| sh[1234]e[lb] |  sh[12345][lb]e | sh[23]ele | sh64 | sh64le \
1239
+			| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet \
1240
+			| sparclite \
1241
+			| sparcv8 | sparcv9 | sparcv9b | sparcv9v | sv1 | sx* \
1242
+			| spu \
1243
+			| tahoe \
1244
+			| tic30 | tic4x | tic54x | tic55x | tic6x | tic80 \
1245
+			| tron \
1246
+			| ubicom32 \
1247
+			| v70 | v850 | v850e | v850e1 | v850es | v850e2 | v850e2v3 \
1248
+			| vax \
1249
+			| visium \
1250
+			| w65 \
1251
+			| wasm32 | wasm64 \
1252
+			| we32k \
1253
+			| x86 | x86_64 | xc16x | xgate | xps100 \
1254
+			| xstormy16 | xtensa* \
1255
+			| ymp \
1256
+			| z8k | z80)
1257
+				;;
1258
+
1259
+			*)
1260
+				echo Invalid configuration \`"$1"\': machine \`"$cpu-$vendor"\' not recognized 1>&2
1261
+				exit 1
1262
+				;;
1263
+		esac
1272 1264
 		;;
1273 1265
 esac
1274 1266
 
1275 1267
 # Here we canonicalize certain aliases for manufacturers.
1276
-case $basic_machine in
1277
-	*-digital*)
1278
-		basic_machine=`echo "$basic_machine" | sed 's/digital.*/dec/'`
1268
+case $vendor in
1269
+	digital*)
1270
+		vendor=dec
1279 1271
 		;;
1280
-	*-commodore*)
1281
-		basic_machine=`echo "$basic_machine" | sed 's/commodore.*/cbm/'`
1272
+	commodore*)
1273
+		vendor=cbm
1282 1274
 		;;
1283 1275
 	*)
1284 1276
 		;;
@@ -1356,7 +1348,7 @@ case $os in
1356 1348
 	     | amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \
1357 1349
 	     | aos* | aros* | cloudabi* | sortix* \
1358 1350
 	     | nindy* | vxsim* | vxworks* | ebmon* | hms* | mvs* \
1359
-	     | clix* | riscos* | uniplus* | iris* | rtu* | xenix* \
1351
+	     | clix* | riscos* | uniplus* | iris* | isc* | rtu* | xenix* \
1360 1352
 	     | knetbsd* | mirbsd* | netbsd* \
1361 1353
 	     | bitrig* | openbsd* | solidbsd* | libertybsd* \
1362 1354
 	     | ekkobsd* | kfreebsd* | freebsd* | riscix* | lynxos* \
@@ -1376,12 +1368,12 @@ case $os in
1376 1368
 	     | powermax* | dnix* | nx6 | nx7 | sei* | dragonfly* \
1377 1369
 	     | skyos* | haiku* | rdos* | toppers* | drops* | es* \
1378 1370
 	     | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \
1379
-	     | midnightbsd*)
1371
+	     | midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi*)
1380 1372
 	# Remember, each alternative MUST END IN *, to match a version number.
1381 1373
 		;;
1382 1374
 	qnx*)
1383
-		case $basic_machine in
1384
-		    x86-* | i*86-*)
1375
+		case $cpu in
1376
+		    x86 | i*86)
1385 1377
 			;;
1386 1378
 		    *)
1387 1379
 			os=nto-$os
@@ -1507,7 +1499,7 @@ case $os in
1507 1499
 		# Until real need of OS specific support for
1508 1500
 		# particular features comes up, bare metal
1509 1501
 		# configurations are quite functional.
1510
-		case $basic_machine in
1502
+		case $cpu in
1511 1503
 		    arm*)
1512 1504
 			os=eabi
1513 1505
 			;;
@@ -1541,7 +1533,7 @@ else
1541 1533
 # will signal an error saying that MANUFACTURER isn't an operating
1542 1534
 # system, and we'll never get to this point.
1543 1535
 
1544
-case $basic_machine in
1536
+case $cpu-$vendor in
1545 1537
 	score-*)
1546 1538
 		os=elf
1547 1539
 		;;
@@ -1722,9 +1714,8 @@ fi
1722 1714
 
1723 1715
 # Here we handle the case where we know the os, and the CPU type, but not the
1724 1716
 # manufacturer.  We pick the logical manufacturer.
1725
-vendor=unknown
1726
-case $basic_machine in
1727
-	*-unknown)
1717
+case $vendor in
1718
+	unknown)
1728 1719
 		case $os in
1729 1720
 			riscix*)
1730 1721
 				vendor=acorn
@@ -1793,11 +1784,10 @@ case $basic_machine in
1793 1784
 				vendor=stratus
1794 1785
 				;;
1795 1786
 		esac
1796
-		basic_machine=`echo "$basic_machine" | sed "s/unknown/$vendor/"`
1797 1787
 		;;
1798 1788
 esac
1799 1789
 
1800
-echo "$basic_machine-$os"
1790
+echo "$cpu-$vendor-$os"
1801 1791
 exit
1802 1792
 
1803 1793
 # Local variables:

Loading…
Cancel
Save