head	1.2;
access;
symbols
	perseant-exfatfs-base-20261102:1.2
	netbsd-11-1-RELEASE:1.1
	netbsd-10-2-RELEASE:1.1
	netbsd-9-5-RELEASE:1.1
	netbsd-11-0-RELEASE:1.1
	netbsd-11-0-RC7:1.1
	netbsd-11-0-RC6:1.1
	netbsd-11-0-RC5:1.1
	netbsd-11-0-RC4:1.1
	netbsd-11-0-RC3:1.1
	netbsd-11-0-RC2:1.1
	netbsd-11-0-RC1:1.1
	nsd-4-14-0:1.1.1.1
	NLNETLABS:1.1.1
	perseant-exfatfs-base-20250801:1.1
	netbsd-11:1.1.0.16
	netbsd-11-base:1.1
	netbsd-10-1-RELEASE:1.1
	perseant-exfatfs-base-20240630:1.1
	perseant-exfatfs:1.1.0.14
	perseant-exfatfs-base:1.1
	netbsd-9-4-RELEASE:1.1
	netbsd-10-0-RELEASE:1.1
	netbsd-10-0-RC6:1.1
	netbsd-10-0-RC5:1.1
	netbsd-10-0-RC4:1.1
	netbsd-10-0-RC3:1.1
	netbsd-10-0-RC2:1.1
	netbsd-10-0-RC1:1.1
	netbsd-10:1.1.0.12
	netbsd-10-base:1.1
	netbsd-9-3-RELEASE:1.1
	cjep_sun2x-base1:1.1
	cjep_sun2x:1.1.0.10
	cjep_sun2x-base:1.1
	cjep_staticlib_x-base1:1.1
	netbsd-9-2-RELEASE:1.1
	cjep_staticlib_x:1.1.0.8
	cjep_staticlib_x-base:1.1
	netbsd-9-1-RELEASE:1.1
	phil-wifi-20200421:1.1
	phil-wifi-20200411:1.1
	is-mlppp:1.1.0.6
	is-mlppp-base:1.1
	phil-wifi-20200406:1.1
	netbsd-9-0-RELEASE:1.1
	netbsd-9-0-RC2:1.1
	netbsd-9-0-RC1:1.1
	phil-wifi-20191119:1.1
	netbsd-9:1.1.0.4
	netbsd-9-base:1.1
	phil-wifi:1.1.0.2
	phil-wifi-20190609:1.1;
locks; strict;
comment	@# @;


1.2
date	2026.01.15.21.35.17;	author christos;	state Exp;
branches;
next	1.1;
commitid	OUSWSLJXBJWxfxqG;

1.1
date	2019.05.25.20.10.22;	author christos;	state Exp;
branches
	1.1.1.1
	1.1.2.1;
next	;
commitid	aGDEFdDz3IbXMCoB;

1.1.1.1
date	2026.01.15.21.02.27;	author christos;	state Exp;
branches;
next	;
commitid	eP3mMjgnyB4G2xqG;

1.1.2.1
date	2019.05.25.20.10.22;	author christos;	state dead;
branches;
next	1.1.2.2;
commitid	jtc8rnCzWiEEHGqB;

1.1.2.2
date	2019.06.10.21.51.11;	author christos;	state Exp;
branches;
next	;
commitid	jtc8rnCzWiEEHGqB;


desc
@@


1.2
log
@merge changes between nsd-4.8.0 and 4.14.0
@
text
@#! /bin/sh
# Configuration validation subroutine script.
#   Copyright 1992-2023 Free Software Foundation, Inc.

# shellcheck disable=SC2006,SC2268 # see below for rationale

timestamp='2023-09-19'

# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, see <https://www.gnu.org/licenses/>.
#
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that
# program.  This Exception is an additional permission under section 7
# of the GNU General Public License, version 3 ("GPLv3").


# Please send patches to <config-patches@@gnu.org>.
#
# Configuration subroutine to validate and canonicalize a configuration type.
# Supply the specified configuration type as an argument.
# If it is invalid, we print an error message on stderr and exit with code 1.
# Otherwise, we print the canonical config type on stdout and succeed.

# You can get the latest version of this script from:
# https://git.savannah.gnu.org/cgit/config.git/plain/config.sub

# This file is supposed to be the same for all GNU packages
# and recognize all the CPU types, system types and aliases
# that are meaningful with *any* GNU software.
# Each package is responsible for reporting which valid configurations
# it does not support.  The user should be able to distinguish
# a failure to support a valid configuration from a meaningless
# configuration.

# The goal of this file is to map all the various variations of a given
# machine specification into a single specification in the form:
#	CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
# or in some cases, the newer four-part form:
#	CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
# It is wrong to echo any other type of specification.

# The "shellcheck disable" line above the timestamp inhibits complaints
# about features and limitations of the classic Bourne shell that were
# superseded or lifted in POSIX.  However, this script identifies a wide
# variety of pre-POSIX systems that do not have POSIX shells at all, and
# even some reasonably current systems (Solaris 10 as case-in-point) still
# have a pre-POSIX /bin/sh.

me=`echo "$0" | sed -e 's,.*/,,'`

usage="\
Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS

Canonicalize a configuration name.

Options:
  -h, --help         print this help, then exit
  -t, --time-stamp   print date of last modification, then exit
  -v, --version      print version number, then exit

Report bugs and patches to <config-patches@@gnu.org>."

version="\
GNU config.sub ($timestamp)

Copyright 1992-2023 Free Software Foundation, Inc.

This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."

help="
Try '$me --help' for more information."

# Parse command line
while test $# -gt 0 ; do
  case $1 in
    --time-stamp | --time* | -t )
       echo "$timestamp" ; exit ;;
    --version | -v )
       echo "$version" ; exit ;;
    --help | --h* | -h )
       echo "$usage"; exit ;;
    -- )     # Stop option processing
       shift; break ;;
    - )	# Use stdin as input.
       break ;;
    -* )
       echo "$me: invalid option $1$help" >&2
       exit 1 ;;

    *local*)
       # First pass through any local machine types.
       echo "$1"
       exit ;;

    * )
       break ;;
  esac
done

case $# in
 0) echo "$me: missing argument$help" >&2
    exit 1;;
 1) ;;
 *) echo "$me: too many arguments$help" >&2
    exit 1;;
esac

# Split fields of configuration type
# shellcheck disable=SC2162
saved_IFS=$IFS
IFS="-" read field1 field2 field3 field4 <<EOF
$1
EOF
IFS=$saved_IFS

# Separate into logical components for further validation
case $1 in
	*-*-*-*-*)
		echo "Invalid configuration '$1': more than four components" >&2
		exit 1
		;;
	*-*-*-*)
		basic_machine=$field1-$field2
		basic_os=$field3-$field4
		;;
	*-*-*)
		# Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two
		# parts
		maybe_os=$field2-$field3
		case $maybe_os in
			nto-qnx* | linux-* | uclinux-uclibc* \
			| uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \
			| netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \
			| storm-chaos* | os2-emx* | rtmk-nova* | managarm-* \
			| windows-* )
				basic_machine=$field1
				basic_os=$maybe_os
				;;
			android-linux)
				basic_machine=$field1-unknown
				basic_os=linux-android
				;;
			*)
				basic_machine=$field1-$field2
				basic_os=$field3
				;;
		esac
		;;
	*-*)
		# A lone config we happen to match not fitting any pattern
		case $field1-$field2 in
			decstation-3100)
				basic_machine=mips-dec
				basic_os=
				;;
			*-*)
				# Second component is usually, but not always the OS
				case $field2 in
					# Prevent following clause from handling this valid os
					sun*os*)
						basic_machine=$field1
						basic_os=$field2
						;;
					zephyr*)
						basic_machine=$field1-unknown
						basic_os=$field2
						;;
					# Manufacturers
					dec* | mips* | sequent* | encore* | pc533* | sgi* | sony* \
					| att* | 7300* | 3300* | delta* | motorola* | sun[234]* \
					| unicom* | ibm* | next | hp | isi* | apollo | altos* \
					| convergent* | ncr* | news | 32* | 3600* | 3100* \
					| hitachi* | c[123]* | convex* | sun | crds | omron* | dg \
					| ultra | tti* | harris | dolphin | highlevel | gould \
					| cbm | ns | masscomp | apple | axis | knuth | cray \
					| microblaze* | sim | cisco \
					| oki | wec | wrs | winbond)
						basic_machine=$field1-$field2
						basic_os=
						;;
					*)
						basic_machine=$field1
						basic_os=$field2
						;;
				esac
			;;
		esac
		;;
	*)
		# Convert single-component short-hands not valid as part of
		# multi-component configurations.
		case $field1 in
			386bsd)
				basic_machine=i386-pc
				basic_os=bsd
				;;
			a29khif)
				basic_machine=a29k-amd
				basic_os=udi
				;;
			adobe68k)
				basic_machine=m68010-adobe
				basic_os=scout
				;;
			alliant)
				basic_machine=fx80-alliant
				basic_os=
				;;
			altos | altos3068)
				basic_machine=m68k-altos
				basic_os=
				;;
			am29k)
				basic_machine=a29k-none
				basic_os=bsd
				;;
			amdahl)
				basic_machine=580-amdahl
				basic_os=sysv
				;;
			amiga)
				basic_machine=m68k-unknown
				basic_os=
				;;
			amigaos | amigados)
				basic_machine=m68k-unknown
				basic_os=amigaos
				;;
			amigaunix | amix)
				basic_machine=m68k-unknown
				basic_os=sysv4
				;;
			apollo68)
				basic_machine=m68k-apollo
				basic_os=sysv
				;;
			apollo68bsd)
				basic_machine=m68k-apollo
				basic_os=bsd
				;;
			aros)
				basic_machine=i386-pc
				basic_os=aros
				;;
			aux)
				basic_machine=m68k-apple
				basic_os=aux
				;;
			balance)
				basic_machine=ns32k-sequent
				basic_os=dynix
				;;
			blackfin)
				basic_machine=bfin-unknown
				basic_os=linux
				;;
			cegcc)
				basic_machine=arm-unknown
				basic_os=cegcc
				;;
			convex-c1)
				basic_machine=c1-convex
				basic_os=bsd
				;;
			convex-c2)
				basic_machine=c2-convex
				basic_os=bsd
				;;
			convex-c32)
				basic_machine=c32-convex
				basic_os=bsd
				;;
			convex-c34)
				basic_machine=c34-convex
				basic_os=bsd
				;;
			convex-c38)
				basic_machine=c38-convex
				basic_os=bsd
				;;
			cray)
				basic_machine=j90-cray
				basic_os=unicos
				;;
			crds | unos)
				basic_machine=m68k-crds
				basic_os=
				;;
			da30)
				basic_machine=m68k-da30
				basic_os=
				;;
			decstation | pmax | pmin | dec3100 | decstatn)
				basic_machine=mips-dec
				basic_os=
				;;
			delta88)
				basic_machine=m88k-motorola
				basic_os=sysv3
				;;
			dicos)
				basic_machine=i686-pc
				basic_os=dicos
				;;
			djgpp)
				basic_machine=i586-pc
				basic_os=msdosdjgpp
				;;
			ebmon29k)
				basic_machine=a29k-amd
				basic_os=ebmon
				;;
			es1800 | OSE68k | ose68k | ose | OSE)
				basic_machine=m68k-ericsson
				basic_os=ose
				;;
			gmicro)
				basic_machine=tron-gmicro
				basic_os=sysv
				;;
			go32)
				basic_machine=i386-pc
				basic_os=go32
				;;
			h8300hms)
				basic_machine=h8300-hitachi
				basic_os=hms
				;;
			h8300xray)
				basic_machine=h8300-hitachi
				basic_os=xray
				;;
			h8500hms)
				basic_machine=h8500-hitachi
				basic_os=hms
				;;
			harris)
				basic_machine=m88k-harris
				basic_os=sysv3
				;;
			hp300 | hp300hpux)
				basic_machine=m68k-hp
				basic_os=hpux
				;;
			hp300bsd)
				basic_machine=m68k-hp
				basic_os=bsd
				;;
			hppaosf)
				basic_machine=hppa1.1-hp
				basic_os=osf
				;;
			hppro)
				basic_machine=hppa1.1-hp
				basic_os=proelf
				;;
			i386mach)
				basic_machine=i386-mach
				basic_os=mach
				;;
			isi68 | isi)
				basic_machine=m68k-isi
				basic_os=sysv
				;;
			m68knommu)
				basic_machine=m68k-unknown
				basic_os=linux
				;;
			magnum | m3230)
				basic_machine=mips-mips
				basic_os=sysv
				;;
			merlin)
				basic_machine=ns32k-utek
				basic_os=sysv
				;;
			mingw64)
				basic_machine=x86_64-pc
				basic_os=mingw64
				;;
			mingw32)
				basic_machine=i686-pc
				basic_os=mingw32
				;;
			mingw32ce)
				basic_machine=arm-unknown
				basic_os=mingw32ce
				;;
			monitor)
				basic_machine=m68k-rom68k
				basic_os=coff
				;;
			morphos)
				basic_machine=powerpc-unknown
				basic_os=morphos
				;;
			moxiebox)
				basic_machine=moxie-unknown
				basic_os=moxiebox
				;;
			msdos)
				basic_machine=i386-pc
				basic_os=msdos
				;;
			msys)
				basic_machine=i686-pc
				basic_os=msys
				;;
			mvs)
				basic_machine=i370-ibm
				basic_os=mvs
				;;
			nacl)
				basic_machine=le32-unknown
				basic_os=nacl
				;;
			ncr3000)
				basic_machine=i486-ncr
				basic_os=sysv4
				;;
			netbsd386)
				basic_machine=i386-pc
				basic_os=netbsd
				;;
			netwinder)
				basic_machine=armv4l-rebel
				basic_os=linux
				;;
			news | news700 | news800 | news900)
				basic_machine=m68k-sony
				basic_os=newsos
				;;
			news1000)
				basic_machine=m68030-sony
				basic_os=newsos
				;;
			necv70)
				basic_machine=v70-nec
				basic_os=sysv
				;;
			nh3000)
				basic_machine=m68k-harris
				basic_os=cxux
				;;
			nh[45]000)
				basic_machine=m88k-harris
				basic_os=cxux
				;;
			nindy960)
				basic_machine=i960-intel
				basic_os=nindy
				;;
			mon960)
				basic_machine=i960-intel
				basic_os=mon960
				;;
			nonstopux)
				basic_machine=mips-compaq
				basic_os=nonstopux
				;;
			os400)
				basic_machine=powerpc-ibm
				basic_os=os400
				;;
			OSE68000 | ose68000)
				basic_machine=m68000-ericsson
				basic_os=ose
				;;
			os68k)
				basic_machine=m68k-none
				basic_os=os68k
				;;
			paragon)
				basic_machine=i860-intel
				basic_os=osf
				;;
			parisc)
				basic_machine=hppa-unknown
				basic_os=linux
				;;
			psp)
				basic_machine=mipsallegrexel-sony
				basic_os=psp
				;;
			pw32)
				basic_machine=i586-unknown
				basic_os=pw32
				;;
			rdos | rdos64)
				basic_machine=x86_64-pc
				basic_os=rdos
				;;
			rdos32)
				basic_machine=i386-pc
				basic_os=rdos
				;;
			rom68k)
				basic_machine=m68k-rom68k
				basic_os=coff
				;;
			sa29200)
				basic_machine=a29k-amd
				basic_os=udi
				;;
			sei)
				basic_machine=mips-sei
				basic_os=seiux
				;;
			sequent)
				basic_machine=i386-sequent
				basic_os=
				;;
			sps7)
				basic_machine=m68k-bull
				basic_os=sysv2
				;;
			st2000)
				basic_machine=m68k-tandem
				basic_os=
				;;
			stratus)
				basic_machine=i860-stratus
				basic_os=sysv4
				;;
			sun2)
				basic_machine=m68000-sun
				basic_os=
				;;
			sun2os3)
				basic_machine=m68000-sun
				basic_os=sunos3
				;;
			sun2os4)
				basic_machine=m68000-sun
				basic_os=sunos4
				;;
			sun3)
				basic_machine=m68k-sun
				basic_os=
				;;
			sun3os3)
				basic_machine=m68k-sun
				basic_os=sunos3
				;;
			sun3os4)
				basic_machine=m68k-sun
				basic_os=sunos4
				;;
			sun4)
				basic_machine=sparc-sun
				basic_os=
				;;
			sun4os3)
				basic_machine=sparc-sun
				basic_os=sunos3
				;;
			sun4os4)
				basic_machine=sparc-sun
				basic_os=sunos4
				;;
			sun4sol2)
				basic_machine=sparc-sun
				basic_os=solaris2
				;;
			sun386 | sun386i | roadrunner)
				basic_machine=i386-sun
				basic_os=
				;;
			sv1)
				basic_machine=sv1-cray
				basic_os=unicos
				;;
			symmetry)
				basic_machine=i386-sequent
				basic_os=dynix
				;;
			t3e)
				basic_machine=alphaev5-cray
				basic_os=unicos
				;;
			t90)
				basic_machine=t90-cray
				basic_os=unicos
				;;
			toad1)
				basic_machine=pdp10-xkl
				basic_os=tops20
				;;
			tpf)
				basic_machine=s390x-ibm
				basic_os=tpf
				;;
			udi29k)
				basic_machine=a29k-amd
				basic_os=udi
				;;
			ultra3)
				basic_machine=a29k-nyu
				basic_os=sym1
				;;
			v810 | necv810)
				basic_machine=v810-nec
				basic_os=none
				;;
			vaxv)
				basic_machine=vax-dec
				basic_os=sysv
				;;
			vms)
				basic_machine=vax-dec
				basic_os=vms
				;;
			vsta)
				basic_machine=i386-pc
				basic_os=vsta
				;;
			vxworks960)
				basic_machine=i960-wrs
				basic_os=vxworks
				;;
			vxworks68)
				basic_machine=m68k-wrs
				basic_os=vxworks
				;;
			vxworks29k)
				basic_machine=a29k-wrs
				basic_os=vxworks
				;;
			xbox)
				basic_machine=i686-pc
				basic_os=mingw32
				;;
			ymp)
				basic_machine=ymp-cray
				basic_os=unicos
				;;
			*)
				basic_machine=$1
				basic_os=
				;;
		esac
		;;
esac

# Decode 1-component or ad-hoc basic machines
case $basic_machine in
	# Here we handle the default manufacturer of certain CPU types.  It is in
	# some cases the only manufacturer, in others, it is the most popular.
	w89k)
		cpu=hppa1.1
		vendor=winbond
		;;
	op50n)
		cpu=hppa1.1
		vendor=oki
		;;
	op60c)
		cpu=hppa1.1
		vendor=oki
		;;
	ibm*)
		cpu=i370
		vendor=ibm
		;;
	orion105)
		cpu=clipper
		vendor=highlevel
		;;
	mac | mpw | mac-mpw)
		cpu=m68k
		vendor=apple
		;;
	pmac | pmac-mpw)
		cpu=powerpc
		vendor=apple
		;;

	# Recognize the various machine names and aliases which stand
	# for a CPU type and a company and sometimes even an OS.
	3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
		cpu=m68000
		vendor=att
		;;
	3b*)
		cpu=we32k
		vendor=att
		;;
	bluegene*)
		cpu=powerpc
		vendor=ibm
		basic_os=cnk
		;;
	decsystem10* | dec10*)
		cpu=pdp10
		vendor=dec
		basic_os=tops10
		;;
	decsystem20* | dec20*)
		cpu=pdp10
		vendor=dec
		basic_os=tops20
		;;
	delta | 3300 | motorola-3300 | motorola-delta \
	      | 3300-motorola | delta-motorola)
		cpu=m68k
		vendor=motorola
		;;
	dpx2*)
		cpu=m68k
		vendor=bull
		basic_os=sysv3
		;;
	encore | umax | mmax)
		cpu=ns32k
		vendor=encore
		;;
	elxsi)
		cpu=elxsi
		vendor=elxsi
		basic_os=${basic_os:-bsd}
		;;
	fx2800)
		cpu=i860
		vendor=alliant
		;;
	genix)
		cpu=ns32k
		vendor=ns
		;;
	h3050r* | hiux*)
		cpu=hppa1.1
		vendor=hitachi
		basic_os=hiuxwe2
		;;
	hp3k9[0-9][0-9] | hp9[0-9][0-9])
		cpu=hppa1.0
		vendor=hp
		;;
	hp9k2[0-9][0-9] | hp9k31[0-9])
		cpu=m68000
		vendor=hp
		;;
	hp9k3[2-9][0-9])
		cpu=m68k
		vendor=hp
		;;
	hp9k6[0-9][0-9] | hp6[0-9][0-9])
		cpu=hppa1.0
		vendor=hp
		;;
	hp9k7[0-79][0-9] | hp7[0-79][0-9])
		cpu=hppa1.1
		vendor=hp
		;;
	hp9k78[0-9] | hp78[0-9])
		# FIXME: really hppa2.0-hp
		cpu=hppa1.1
		vendor=hp
		;;
	hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
		# FIXME: really hppa2.0-hp
		cpu=hppa1.1
		vendor=hp
		;;
	hp9k8[0-9][13679] | hp8[0-9][13679])
		cpu=hppa1.1
		vendor=hp
		;;
	hp9k8[0-9][0-9] | hp8[0-9][0-9])
		cpu=hppa1.0
		vendor=hp
		;;
	i*86v32)
		cpu=`echo "$1" | sed -e 's/86.*/86/'`
		vendor=pc
		basic_os=sysv32
		;;
	i*86v4*)
		cpu=`echo "$1" | sed -e 's/86.*/86/'`
		vendor=pc
		basic_os=sysv4
		;;
	i*86v)
		cpu=`echo "$1" | sed -e 's/86.*/86/'`
		vendor=pc
		basic_os=sysv
		;;
	i*86sol2)
		cpu=`echo "$1" | sed -e 's/86.*/86/'`
		vendor=pc
		basic_os=solaris2
		;;
	j90 | j90-cray)
		cpu=j90
		vendor=cray
		basic_os=${basic_os:-unicos}
		;;
	iris | iris4d)
		cpu=mips
		vendor=sgi
		case $basic_os in
		    irix*)
			;;
		    *)
			basic_os=irix4
			;;
		esac
		;;
	miniframe)
		cpu=m68000
		vendor=convergent
		;;
	*mint | mint[0-9]* | *MiNT | *MiNT[0-9]*)
		cpu=m68k
		vendor=atari
		basic_os=mint
		;;
	news-3600 | risc-news)
		cpu=mips
		vendor=sony
		basic_os=newsos
		;;
	next | m*-next)
		cpu=m68k
		vendor=next
		case $basic_os in
		    openstep*)
		        ;;
		    nextstep*)
			;;
		    ns2*)
		      basic_os=nextstep2
			;;
		    *)
		      basic_os=nextstep3
			;;
		esac
		;;
	np1)
		cpu=np1
		vendor=gould
		;;
	op50n-* | op60c-*)
		cpu=hppa1.1
		vendor=oki
		basic_os=proelf
		;;
	pa-hitachi)
		cpu=hppa1.1
		vendor=hitachi
		basic_os=hiuxwe2
		;;
	pbd)
		cpu=sparc
		vendor=tti
		;;
	pbb)
		cpu=m68k
		vendor=tti
		;;
	pc532)
		cpu=ns32k
		vendor=pc532
		;;
	pn)
		cpu=pn
		vendor=gould
		;;
	power)
		cpu=power
		vendor=ibm
		;;
	ps2)
		cpu=i386
		vendor=ibm
		;;
	rm[46]00)
		cpu=mips
		vendor=siemens
		;;
	rtpc | rtpc-*)
		cpu=romp
		vendor=ibm
		;;
	sde)
		cpu=mipsisa32
		vendor=sde
		basic_os=${basic_os:-elf}
		;;
	simso-wrs)
		cpu=sparclite
		vendor=wrs
		basic_os=vxworks
		;;
	tower | tower-32)
		cpu=m68k
		vendor=ncr
		;;
	vpp*|vx|vx-*)
		cpu=f301
		vendor=fujitsu
		;;
	w65)
		cpu=w65
		vendor=wdc
		;;
	w89k-*)
		cpu=hppa1.1
		vendor=winbond
		basic_os=proelf
		;;
	none)
		cpu=none
		vendor=none
		;;
	leon|leon[3-9])
		cpu=sparc
		vendor=$basic_machine
		;;
	leon-*|leon[3-9]-*)
		cpu=sparc
		vendor=`echo "$basic_machine" | sed 's/-.*//'`
		;;

	*-*)
		# shellcheck disable=SC2162
		saved_IFS=$IFS
		IFS="-" read cpu vendor <<EOF
$basic_machine
EOF
		IFS=$saved_IFS
		;;
	# We use 'pc' rather than 'unknown'
	# because (1) that's what they normally are, and
	# (2) the word "unknown" tends to confuse beginning users.
	i*86 | x86_64)
		cpu=$basic_machine
		vendor=pc
		;;
	# These rules are duplicated from below for sake of the special case above;
	# i.e. things that normalized to x86 arches should also default to "pc"
	pc98)
		cpu=i386
		vendor=pc
		;;
	x64 | amd64)
		cpu=x86_64
		vendor=pc
		;;
	# Recognize the basic CPU types without company name.
	*)
		cpu=$basic_machine
		vendor=unknown
		;;
esac

unset -v basic_machine

# Decode basic machines in the full and proper CPU-Company form.
case $cpu-$vendor in
	# Here we handle the default manufacturer of certain CPU types in canonical form. It is in
	# some cases the only manufacturer, in others, it is the most popular.
	craynv-unknown)
		vendor=cray
		basic_os=${basic_os:-unicosmp}
		;;
	c90-unknown | c90-cray)
		vendor=cray
		basic_os=${Basic_os:-unicos}
		;;
	fx80-unknown)
		vendor=alliant
		;;
	romp-unknown)
		vendor=ibm
		;;
	mmix-unknown)
		vendor=knuth
		;;
	microblaze-unknown | microblazeel-unknown)
		vendor=xilinx
		;;
	rs6000-unknown)
		vendor=ibm
		;;
	vax-unknown)
		vendor=dec
		;;
	pdp11-unknown)
		vendor=dec
		;;
	we32k-unknown)
		vendor=att
		;;
	cydra-unknown)
		vendor=cydrome
		;;
	i370-ibm*)
		vendor=ibm
		;;
	orion-unknown)
		vendor=highlevel
		;;
	xps-unknown | xps100-unknown)
		cpu=xps100
		vendor=honeywell
		;;

	# Here we normalize CPU types with a missing or matching vendor
	armh-unknown | armh-alt)
		cpu=armv7l
		vendor=alt
		basic_os=${basic_os:-linux-gnueabihf}
		;;
	dpx20-unknown | dpx20-bull)
		cpu=rs6000
		vendor=bull
		basic_os=${basic_os:-bosx}
		;;

	# Here we normalize CPU types irrespective of the vendor
	amd64-*)
		cpu=x86_64
		;;
	blackfin-*)
		cpu=bfin
		basic_os=linux
		;;
	c54x-*)
		cpu=tic54x
		;;
	c55x-*)
		cpu=tic55x
		;;
	c6x-*)
		cpu=tic6x
		;;
	e500v[12]-*)
		cpu=powerpc
		basic_os=${basic_os}"spe"
		;;
	mips3*-*)
		cpu=mips64
		;;
	ms1-*)
		cpu=mt
		;;
	m68knommu-*)
		cpu=m68k
		basic_os=linux
		;;
	m9s12z-* | m68hcs12z-* | hcs12z-* | s12z-*)
		cpu=s12z
		;;
	openrisc-*)
		cpu=or32
		;;
	parisc-*)
		cpu=hppa
		basic_os=linux
		;;
	pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
		cpu=i586
		;;
	pentiumpro-* | p6-* | 6x86-* | athlon-* | athlon_*-*)
		cpu=i686
		;;
	pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
		cpu=i686
		;;
	pentium4-*)
		cpu=i786
		;;
	pc98-*)
		cpu=i386
		;;
	ppc-* | ppcbe-*)
		cpu=powerpc
		;;
	ppcle-* | powerpclittle-*)
		cpu=powerpcle
		;;
	ppc64-*)
		cpu=powerpc64
		;;
	ppc64le-* | powerpc64little-*)
		cpu=powerpc64le
		;;
	sb1-*)
		cpu=mipsisa64sb1
		;;
	sb1el-*)
		cpu=mipsisa64sb1el
		;;
	sh5e[lb]-*)
		cpu=`echo "$cpu" | sed 's/^\(sh.\)e\(.\)$/\1\2e/'`
		;;
	spur-*)
		cpu=spur
		;;
	strongarm-* | thumb-*)
		cpu=arm
		;;
	tx39-*)
		cpu=mipstx39
		;;
	tx39el-*)
		cpu=mipstx39el
		;;
	x64-*)
		cpu=x86_64
		;;
	xscale-* | xscalee[bl]-*)
		cpu=`echo "$cpu" | sed 's/^xscale/arm/'`
		;;
	arm64-* | aarch64le-*)
		cpu=aarch64
		;;

	# Recognize the canonical CPU Types that limit and/or modify the
	# company names they are paired with.
	cr16-*)
		basic_os=${basic_os:-elf}
		;;
	crisv32-* | etraxfs*-*)
		cpu=crisv32
		vendor=axis
		;;
	cris-* | etrax*-*)
		cpu=cris
		vendor=axis
		;;
	crx-*)
		basic_os=${basic_os:-elf}
		;;
	neo-tandem)
		cpu=neo
		vendor=tandem
		;;
	nse-tandem)
		cpu=nse
		vendor=tandem
		;;
	nsr-tandem)
		cpu=nsr
		vendor=tandem
		;;
	nsv-tandem)
		cpu=nsv
		vendor=tandem
		;;
	nsx-tandem)
		cpu=nsx
		vendor=tandem
		;;
	mipsallegrexel-sony)
		cpu=mipsallegrexel
		vendor=sony
		;;
	tile*-*)
		basic_os=${basic_os:-linux-gnu}
		;;

	*)
		# Recognize the canonical CPU types that are allowed with any
		# company name.
		case $cpu in
			1750a | 580 \
			| a29k \
			| aarch64 | aarch64_be | aarch64c | arm64ec \
			| abacus \
			| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] \
			| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] \
			| alphapca5[67] | alpha64pca5[67] \
			| am33_2.0 \
			| amdgcn \
			| arc | arceb | arc32 | arc64 \
			| arm | arm[lb]e | arme[lb] | armv* \
			| avr | avr32 \
			| asmjs \
			| ba \
			| be32 | be64 \
			| bfin | bpf | bs2000 \
			| c[123]* | c30 | [cjt]90 | c4x \
			| c8051 | clipper | craynv | csky | cydra \
			| d10v | d30v | dlx | dsp16xx \
			| e2k | elxsi | epiphany \
			| f30[01] | f700 | fido | fr30 | frv | ft32 | fx80 \
			| javascript \
			| h8300 | h8500 \
			| hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
			| hexagon \
			| i370 | i*86 | i860 | i960 | ia16 | ia64 \
			| ip2k | iq2000 \
			| k1om \
			| kvx \
			| le32 | le64 \
			| lm32 \
			| loongarch32 | loongarch64 \
			| m32c | m32r | m32rle \
			| m5200 | m68000 | m680[012346]0 | m68360 | m683?2 | m68k \
			| m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x \
			| m88110 | m88k | maxq | mb | mcore | mep | metag \
			| microblaze | microblazeel \
			| mips* \
			| mmix \
			| mn10200 | mn10300 \
			| moxie \
			| mt \
			| msp430 \
			| nds32 | nds32le | nds32be \
			| nfp \
			| nios | nios2 | nios2eb | nios2el \
			| none | np1 | ns16k | ns32k | nvptx \
			| open8 \
			| or1k* \
			| or32 \
			| orion \
			| picochip \
			| pdp10 | pdp11 | pj | pjl | pn | power \
			| powerpc | powerpc64 | powerpc64le | powerpcle | powerpcspe \
			| pru \
			| pyramid \
			| riscv | riscv32 | riscv32be | riscv64 | riscv64be \
			| rl78 | romp | rs6000 | rx \
			| s390 | s390x \
			| score \
			| sh | shl \
			| sh[1234] | sh[24]a | sh[24]ae[lb] | sh[23]e | she[lb] | sh[lb]e \
			| sh[1234]e[lb] |  sh[12345][lb]e | sh[23]ele | sh64 | sh64le \
			| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet \
			| sparclite \
			| sparcv8 | sparcv9 | sparcv9b | sparcv9v | sv1 | sx* \
			| spu \
			| tahoe \
			| thumbv7* \
			| tic30 | tic4x | tic54x | tic55x | tic6x | tic80 \
			| tron \
			| ubicom32 \
			| v70 | v850 | v850e | v850e1 | v850es | v850e2 | v850e2v3 \
			| vax \
			| visium \
			| w65 \
			| wasm32 | wasm64 \
			| we32k \
			| x86 | x86_64 | xc16x | xgate | xps100 \
			| xstormy16 | xtensa* \
			| ymp \
			| z8k | z80)
				;;

			*)
				echo "Invalid configuration '$1': machine '$cpu-$vendor' not recognized" 1>&2
				exit 1
				;;
		esac
		;;
esac

# Here we canonicalize certain aliases for manufacturers.
case $vendor in
	digital*)
		vendor=dec
		;;
	commodore*)
		vendor=cbm
		;;
	*)
		;;
esac

# Decode manufacturer-specific aliases for certain operating systems.

if test x"$basic_os" != x
then

# First recognize some ad-hoc cases, or perhaps split kernel-os, or else just
# set os.
obj=
case $basic_os in
	gnu/linux*)
		kernel=linux
		os=`echo "$basic_os" | sed -e 's|gnu/linux|gnu|'`
		;;
	os2-emx)
		kernel=os2
		os=`echo "$basic_os" | sed -e 's|os2-emx|emx|'`
		;;
	nto-qnx*)
		kernel=nto
		os=`echo "$basic_os" | sed -e 's|nto-qnx|qnx|'`
		;;
	*-*)
		# shellcheck disable=SC2162
		saved_IFS=$IFS
		IFS="-" read kernel os <<EOF
$basic_os
EOF
		IFS=$saved_IFS
		;;
	# Default OS when just kernel was specified
	nto*)
		kernel=nto
		os=`echo "$basic_os" | sed -e 's|nto|qnx|'`
		;;
	linux*)
		kernel=linux
		os=`echo "$basic_os" | sed -e 's|linux|gnu|'`
		;;
	managarm*)
		kernel=managarm
		os=`echo "$basic_os" | sed -e 's|managarm|mlibc|'`
		;;
	*)
		kernel=
		os=$basic_os
		;;
esac

# Now, normalize the OS (knowing we just have one component, it's not a kernel,
# etc.)
case $os in
	# First match some system type aliases that might get confused
	# with valid system types.
	# solaris* is a basic system type, with this one exception.
	auroraux)
		os=auroraux
		;;
	bluegene*)
		os=cnk
		;;
	solaris1 | solaris1.*)
		os=`echo "$os" | sed -e 's|solaris1|sunos4|'`
		;;
	solaris)
		os=solaris2
		;;
	unixware*)
		os=sysv4.2uw
		;;
	# es1800 is here to avoid being matched by es* (a different OS)
	es1800*)
		os=ose
		;;
	# Some version numbers need modification
	chorusos*)
		os=chorusos
		;;
	isc)
		os=isc2.2
		;;
	sco6)
		os=sco5v6
		;;
	sco5)
		os=sco3.2v5
		;;
	sco4)
		os=sco3.2v4
		;;
	sco3.2.[4-9]*)
		os=`echo "$os" | sed -e 's/sco3.2./sco3.2v/'`
		;;
	sco*v* | scout)
		# Don't match below
		;;
	sco*)
		os=sco3.2v2
		;;
	psos*)
		os=psos
		;;
	qnx*)
		os=qnx
		;;
	hiux*)
		os=hiuxwe2
		;;
	lynx*178)
		os=lynxos178
		;;
	lynx*5)
		os=lynxos5
		;;
	lynxos*)
		# don't get caught up in next wildcard
		;;
	lynx*)
		os=lynxos
		;;
	mac[0-9]*)
		os=`echo "$os" | sed -e 's|mac|macos|'`
		;;
	opened*)
		os=openedition
		;;
	os400*)
		os=os400
		;;
	sunos5*)
		os=`echo "$os" | sed -e 's|sunos5|solaris2|'`
		;;
	sunos6*)
		os=`echo "$os" | sed -e 's|sunos6|solaris3|'`
		;;
	wince*)
		os=wince
		;;
	utek*)
		os=bsd
		;;
	dynix*)
		os=bsd
		;;
	acis*)
		os=aos
		;;
	atheos*)
		os=atheos
		;;
	syllable*)
		os=syllable
		;;
	386bsd)
		os=bsd
		;;
	ctix* | uts*)
		os=sysv
		;;
	nova*)
		os=rtmk-nova
		;;
	ns2)
		os=nextstep2
		;;
	# Preserve the version number of sinix5.
	sinix5.*)
		os=`echo "$os" | sed -e 's|sinix|sysv|'`
		;;
	sinix*)
		os=sysv4
		;;
	tpf*)
		os=tpf
		;;
	triton*)
		os=sysv3
		;;
	oss*)
		os=sysv3
		;;
	svr4*)
		os=sysv4
		;;
	svr3)
		os=sysv3
		;;
	sysvr4)
		os=sysv4
		;;
	ose*)
		os=ose
		;;
	*mint | mint[0-9]* | *MiNT | MiNT[0-9]*)
		os=mint
		;;
	dicos*)
		os=dicos
		;;
	pikeos*)
		# Until real need of OS specific support for
		# particular features comes up, bare metal
		# configurations are quite functional.
		case $cpu in
		    arm*)
			os=eabi
			;;
		    *)
			os=
			obj=elf
			;;
		esac
		;;
	aout* | coff* | elf* | pe*)
		# These are machine code file formats, not OSes
		obj=$os
		os=
		;;
	*)
		# No normalization, but not necessarily accepted, that comes below.
		;;
esac

else

# Here we handle the default operating systems that come with various machines.
# The value should be what the vendor currently ships out the door with their
# machine or put another way, the most popular os provided with the machine.

# Note that if you're going to try to match "-MANUFACTURER" here (say,
# "-sun"), then you have to tell the case statement up towards the top
# that MANUFACTURER isn't an operating system.  Otherwise, code above
# will signal an error saying that MANUFACTURER isn't an operating
# system, and we'll never get to this point.

kernel=
obj=
case $cpu-$vendor in
	score-*)
		os=
		obj=elf
		;;
	spu-*)
		os=
		obj=elf
		;;
	*-acorn)
		os=riscix1.2
		;;
	arm*-rebel)
		kernel=linux
		os=gnu
		;;
	arm*-semi)
		os=
		obj=aout
		;;
	c4x-* | tic4x-*)
		os=
		obj=coff
		;;
	c8051-*)
		os=
		obj=elf
		;;
	clipper-intergraph)
		os=clix
		;;
	hexagon-*)
		os=
		obj=elf
		;;
	tic54x-*)
		os=
		obj=coff
		;;
	tic55x-*)
		os=
		obj=coff
		;;
	tic6x-*)
		os=
		obj=coff
		;;
	# This must come before the *-dec entry.
	pdp10-*)
		os=tops20
		;;
	pdp11-*)
		os=none
		;;
	*-dec | vax-*)
		os=ultrix4.2
		;;
	m68*-apollo)
		os=domain
		;;
	i386-sun)
		os=sunos4.0.2
		;;
	m68000-sun)
		os=sunos3
		;;
	m68*-cisco)
		os=
		obj=aout
		;;
	mep-*)
		os=
		obj=elf
		;;
	mips*-cisco)
		os=
		obj=elf
		;;
	mips*-*)
		os=
		obj=elf
		;;
	or32-*)
		os=
		obj=coff
		;;
	*-tti)	# must be before sparc entry or we get the wrong os.
		os=sysv3
		;;
	sparc-* | *-sun)
		os=sunos4.1.1
		;;
	pru-*)
		os=
		obj=elf
		;;
	*-be)
		os=beos
		;;
	*-ibm)
		os=aix
		;;
	*-knuth)
		os=mmixware
		;;
	*-wec)
		os=proelf
		;;
	*-winbond)
		os=proelf
		;;
	*-oki)
		os=proelf
		;;
	*-hp)
		os=hpux
		;;
	*-hitachi)
		os=hiux
		;;
	i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
		os=sysv
		;;
	*-cbm)
		os=amigaos
		;;
	*-dg)
		os=dgux
		;;
	*-dolphin)
		os=sysv3
		;;
	m68k-ccur)
		os=rtu
		;;
	m88k-omron*)
		os=luna
		;;
	*-next)
		os=nextstep
		;;
	*-sequent)
		os=ptx
		;;
	*-crds)
		os=unos
		;;
	*-ns)
		os=genix
		;;
	i370-*)
		os=mvs
		;;
	*-gould)
		os=sysv
		;;
	*-highlevel)
		os=bsd
		;;
	*-encore)
		os=bsd
		;;
	*-sgi)
		os=irix
		;;
	*-siemens)
		os=sysv4
		;;
	*-masscomp)
		os=rtu
		;;
	f30[01]-fujitsu | f700-fujitsu)
		os=uxpv
		;;
	*-rom68k)
		os=
		obj=coff
		;;
	*-*bug)
		os=
		obj=coff
		;;
	*-apple)
		os=macos
		;;
	*-atari*)
		os=mint
		;;
	*-wrs)
		os=vxworks
		;;
	*)
		os=none
		;;
esac

fi

# Now, validate our (potentially fixed-up) individual pieces (OS, OBJ).

case $os in
	# Sometimes we do "kernel-libc", so those need to count as OSes.
	musl* | newlib* | relibc* | uclibc*)
		;;
	# Likewise for "kernel-abi"
	eabi* | gnueabi*)
		;;
	# VxWorks passes extra cpu info in the 4th filed.
	simlinux | simwindows | spe)
		;;
	# See `case $cpu-$os` validation below
	ghcjs)
		;;
	# Now accept the basic system types.
	# The portable systems comes first.
	# Each alternative MUST end in a * to match a version number.
	gnu* | android* | bsd* | mach* | minix* | genix* | ultrix* | irix* \
	     | *vms* | esix* | aix* | cnk* | sunos | sunos[34]* \
	     | hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \
	     | sym* |  plan9* | psp* | sim* | xray* | os68k* | v88r* \
	     | hiux* | abug | nacl* | netware* | windows* \
	     | os9* | macos* | osx* | ios* | tvos* | watchos* \
	     | mpw* | magic* | mmixware* | mon960* | lnews* \
	     | amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \
	     | aos* | aros* | cloudabi* | sortix* | twizzler* \
	     | nindy* | vxsim* | vxworks* | ebmon* | hms* | mvs* \
	     | clix* | riscos* | uniplus* | iris* | isc* | rtu* | xenix* \
	     | mirbsd* | netbsd* | dicos* | openedition* | ose* \
	     | bitrig* | openbsd* | secbsd* | solidbsd* | libertybsd* | os108* \
	     | ekkobsd* | freebsd* | riscix* | lynxos* | os400* \
	     | bosx* | nextstep* | cxux* | oabi* \
	     | ptx* | ecoff* | winnt* | domain* | vsta* \
	     | udi* | lites* | ieee* | go32* | aux* | hcos* \
	     | chorusrdb* | cegcc* | glidix* | serenity* \
	     | cygwin* | msys* | moss* | proelf* | rtems* \
	     | midipix* | mingw32* | mingw64* | mint* \
	     | uxpv* | beos* | mpeix* | udk* | moxiebox* \
	     | interix* | uwin* | mks* | rhapsody* | darwin* \
	     | openstep* | oskit* | conix* | pw32* | nonstopux* \
	     | storm-chaos* | tops10* | tenex* | tops20* | its* \
	     | os2* | vos* | palmos* | uclinux* | nucleus* | morphos* \
	     | scout* | superux* | sysv* | rtmk* | tpf* | windiss* \
	     | powermax* | dnix* | nx6 | nx7 | sei* | dragonfly* \
	     | skyos* | haiku* | rdos* | toppers* | drops* | es* \
	     | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \
	     | midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \
	     | nsk* | powerunix* | genode* | zvmoe* | qnx* | emx* | zephyr* \
	     | fiwix* | mlibc* | cos* | mbr* )
		;;
	# This one is extra strict with allowed versions
	sco3.2v2 | sco3.2v[4-9]* | sco5v6*)
		# Don't forget version if it is 3.2v4 or newer.
		;;
	none)
		;;
	kernel* | msvc* )
		# Restricted further below
		;;
	'')
		if test x"$obj" = x
		then
			echo "Invalid configuration '$1': Blank OS only allowed with explicit machine code file format" 1>&2
		fi
		;;
	*)
		echo "Invalid configuration '$1': OS '$os' not recognized" 1>&2
		exit 1
		;;
esac

case $obj in
	aout* | coff* | elf* | pe*)
		;;
	'')
		# empty is fine
		;;
	*)
		echo "Invalid configuration '$1': Machine code format '$obj' not recognized" 1>&2
		exit 1
		;;
esac

# Here we handle the constraint that a (synthetic) cpu and os are
# valid only in combination with each other and nowhere else.
case $cpu-$os in
	# The "javascript-unknown-ghcjs" triple is used by GHC; we
	# accept it here in order to tolerate that, but reject any
	# variations.
	javascript-ghcjs)
		;;
	javascript-* | *-ghcjs)
		echo "Invalid configuration '$1': cpu '$cpu' is not valid with os '$os$obj'" 1>&2
		exit 1
		;;
esac

# As a final step for OS-related things, validate the OS-kernel combination
# (given a valid OS), if there is a kernel.
case $kernel-$os-$obj in
	linux-gnu*- | linux-dietlibc*- | linux-android*- | linux-newlib*- \
		   | linux-musl*- | linux-relibc*- | linux-uclibc*- | linux-mlibc*- )
		;;
	uclinux-uclibc*- )
		;;
	managarm-mlibc*- | managarm-kernel*- )
		;;
	windows*-msvc*-)
		;;
	-dietlibc*- | -newlib*- | -musl*- | -relibc*- | -uclibc*- | -mlibc*- )
		# These are just libc implementations, not actual OSes, and thus
		# require a kernel.
		echo "Invalid configuration '$1': libc '$os' needs explicit kernel." 1>&2
		exit 1
		;;
	-kernel*- )
		echo "Invalid configuration '$1': '$os' needs explicit kernel." 1>&2
		exit 1
		;;
	*-kernel*- )
		echo "Invalid configuration '$1': '$kernel' does not support '$os'." 1>&2
		exit 1
		;;
	*-msvc*- )
		echo "Invalid configuration '$1': '$os' needs 'windows'." 1>&2
		exit 1
		;;
	kfreebsd*-gnu*- | kopensolaris*-gnu*-)
		;;
	vxworks-simlinux- | vxworks-simwindows- | vxworks-spe-)
		;;
	nto-qnx*-)
		;;
	os2-emx-)
		;;
	*-eabi*- | *-gnueabi*-)
		;;
	none--*)
		# None (no kernel, i.e. freestanding / bare metal),
		# can be paired with an machine code file format
		;;
	-*-)
		# Blank kernel with real OS is always fine.
		;;
	--*)
		# Blank kernel and OS with real machine code file format is always fine.
		;;
	*-*-*)
		echo "Invalid configuration '$1': Kernel '$kernel' not known to work with OS '$os'." 1>&2
		exit 1
		;;
esac

# Here we handle the case where we know the os, and the CPU type, but not the
# manufacturer.  We pick the logical manufacturer.
case $vendor in
	unknown)
		case $cpu-$os in
			*-riscix*)
				vendor=acorn
				;;
			*-sunos*)
				vendor=sun
				;;
			*-cnk* | *-aix*)
				vendor=ibm
				;;
			*-beos*)
				vendor=be
				;;
			*-hpux*)
				vendor=hp
				;;
			*-mpeix*)
				vendor=hp
				;;
			*-hiux*)
				vendor=hitachi
				;;
			*-unos*)
				vendor=crds
				;;
			*-dgux*)
				vendor=dg
				;;
			*-luna*)
				vendor=omron
				;;
			*-genix*)
				vendor=ns
				;;
			*-clix*)
				vendor=intergraph
				;;
			*-mvs* | *-opened*)
				vendor=ibm
				;;
			*-os400*)
				vendor=ibm
				;;
			s390-* | s390x-*)
				vendor=ibm
				;;
			*-ptx*)
				vendor=sequent
				;;
			*-tpf*)
				vendor=ibm
				;;
			*-vxsim* | *-vxworks* | *-windiss*)
				vendor=wrs
				;;
			*-aux*)
				vendor=apple
				;;
			*-hms*)
				vendor=hitachi
				;;
			*-mpw* | *-macos*)
				vendor=apple
				;;
			*-*mint | *-mint[0-9]* | *-*MiNT | *-MiNT[0-9]*)
				vendor=atari
				;;
			*-vos*)
				vendor=stratus
				;;
		esac
		;;
esac

echo "$cpu-$vendor${kernel:+-$kernel}${os:+-$os}${obj:+-$obj}"
exit

# Local variables:
# eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "timestamp='"
# time-stamp-format: "%:y-%02m-%02d"
# time-stamp-end: "'"
# End:
@


1.1
log
@- resolve conflicts
- Fix autoconf issues
	1. Check for login_cap.h
	2. Link with -Wl,-R
	3. On NetBSD define -D_OPENBSD_SOURCE
@
text
@d3 1
a3 1
#   Copyright 1992-2017 Free Software Foundation, Inc.
d5 3
a7 1
timestamp='2017-01-01'
d11 1
a11 1
# the Free Software Foundation; either version 3 of the License, or
d20 1
a20 1
# along with this program; if not, see <http://www.gnu.org/licenses/>.
d38 1
a38 1
# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
d55 7
d69 1
a69 1
Operation modes:
d79 1
a79 1
Copyright 1992-2017 Free Software Foundation, Inc.
d85 1
a85 1
Try \`$me --help' for more information."
d101 1
a101 1
       echo "$me: invalid option $1$help"
d106 1
a106 1
       echo $1
d122 13
a134 31
# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
# Here we must recognize all the valid KERNEL-OS combinations.
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
case $maybe_os in
  nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
  linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
  knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \
  kopensolaris*-gnu* | cloudabi*-eabi* | \
  storm-chaos* | os2-emx* | rtmk-nova*)
    os=-$maybe_os
    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
    ;;
  android-linux)
    os=-linux-android
    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
    ;;
  *)
    basic_machine=`echo $1 | sed 's/-[^-]*$//'`
    if [ $basic_machine != $1 ]
    then os=`echo $1 | sed 's/.*-/-/'`
    else os=; fi
    ;;
esac

### Let's recognize common machines as not being operating systems so
### that things like config.sub decstation-3100 work.  We also
### recognize some manufacturers as not being operating systems, so we
### can provide default operating systems below.
case $os in
	-sun*os*)
		# Prevent following clause from handling this invalid input.
d136 3
a138 9
	-dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
	-att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
	-unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
	-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
	-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
	-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
	-apple | -axis | -knuth | -cray | -microblaze*)
		os=
		basic_machine=$1
d140 22
a161 2
	-bluegene*)
		os=-cnk
d163 39
a201 3
	-sim | -cisco | -oki | -wec | -winbond)
		os=
		basic_machine=$1
d203 453
a655 79
	-scout)
		;;
	-wrs)
		os=-vxworks
		basic_machine=$1
		;;
	-chorusos*)
		os=-chorusos
		basic_machine=$1
		;;
	-chorusrdb)
		os=-chorusrdb
		basic_machine=$1
		;;
	-hiux*)
		os=-hiuxwe2
		;;
	-sco6)
		os=-sco5v6
		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
		;;
	-sco5)
		os=-sco3.2v5
		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
		;;
	-sco4)
		os=-sco3.2v4
		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
		;;
	-sco3.2.[4-9]*)
		os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
		;;
	-sco3.2v[4-9]*)
		# Don't forget version if it is 3.2v4 or newer.
		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
		;;
	-sco5v6*)
		# Don't forget version if it is 3.2v4 or newer.
		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
		;;
	-sco*)
		os=-sco3.2v2
		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
		;;
	-udk*)
		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
		;;
	-isc)
		os=-isc2.2
		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
		;;
	-clix*)
		basic_machine=clipper-intergraph
		;;
	-isc*)
		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
		;;
	-lynx*178)
		os=-lynxos178
		;;
	-lynx*5)
		os=-lynxos5
		;;
	-lynx*)
		os=-lynxos
		;;
	-ptx*)
		basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
		;;
	-windowsnt*)
		os=`echo $os | sed -e 's/windowsnt/winnt/'`
		;;
	-psos*)
		os=-psos
		;;
	-mint | -mint[0-9]*)
		basic_machine=m68k-atari
		os=-mint
d659 1
a659 1
# Decode aliases for certain CPU-COMPANY combinations.
d661 5
a665 76
	# Recognize the basic CPU types without company name.
	# Some are omitted here because they have special meanings below.
	1750a | 580 \
	| a29k \
	| aarch64 | aarch64_be \
	| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
	| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
	| am33_2.0 \
	| arc | arceb \
	| arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
	| avr | avr32 \
	| ba \
	| be32 | be64 \
	| bfin \
	| c4x | c8051 | clipper \
	| d10v | d30v | dlx | dsp16xx \
	| e2k | epiphany \
	| fido | fr30 | frv | ft32 \
	| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
	| hexagon \
	| i370 | i860 | i960 | ia64 \
	| ip2k | iq2000 \
	| k1om \
	| le32 | le64 \
	| lm32 \
	| m32c | m32r | m32rle | m68000 | m68k | m88k \
	| maxq | mb | microblaze | microblazeel | mcore | mep | metag \
	| mips | mipsbe | mipseb | mipsel | mipsle \
	| mips16 \
	| mips64 | mips64el \
	| mips64octeon | mips64octeonel \
	| mips64orion | mips64orionel \
	| mips64r5900 | mips64r5900el \
	| mips64vr | mips64vrel \
	| mips64vr4100 | mips64vr4100el \
	| mips64vr4300 | mips64vr4300el \
	| mips64vr5000 | mips64vr5000el \
	| mips64vr5900 | mips64vr5900el \
	| mipsisa32 | mipsisa32el \
	| mipsisa32r2 | mipsisa32r2el \
	| mipsisa32r6 | mipsisa32r6el \
	| mipsisa64 | mipsisa64el \
	| mipsisa64r2 | mipsisa64r2el \
	| mipsisa64r6 | mipsisa64r6el \
	| mipsisa64sb1 | mipsisa64sb1el \
	| mipsisa64sr71k | mipsisa64sr71kel \
	| mipsr5900 | mipsr5900el \
	| mipstx39 | mipstx39el \
	| mn10200 | mn10300 \
	| moxie \
	| mt \
	| msp430 \
	| nds32 | nds32le | nds32be \
	| nios | nios2 | nios2eb | nios2el \
	| ns16k | ns32k \
	| open8 | or1k | or1knd | or32 \
	| pdp10 | pdp11 | pj | pjl \
	| powerpc | powerpc64 | powerpc64le | powerpcle \
	| pru \
	| pyramid \
	| riscv32 | riscv64 \
	| rl78 | rx \
	| score \
	| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
	| sh64 | sh64le \
	| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
	| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
	| spu \
	| tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
	| ubicom32 \
	| v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
	| visium \
	| we32k \
	| x86 | xc16x | xstormy16 | xtensa \
	| z8k | z80)
		basic_machine=$basic_machine-unknown
d667 3
a669 2
	c54x)
		basic_machine=tic54x-unknown
d671 3
a673 2
	c55x)
		basic_machine=tic55x-unknown
d675 3
a677 2
	c6x)
		basic_machine=tic6x-unknown
d679 3
a681 2
	leon|leon[3-9])
		basic_machine=sparc-$basic_machine
d683 3
a685 3
	m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
		basic_machine=$basic_machine-unknown
		os=-none
d687 3
a689 4
	m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
		;;
	ms1)
		basic_machine=mt-unknown
a691 114
	strongarm | thumb | xscale)
		basic_machine=arm-unknown
		;;
	xgate)
		basic_machine=$basic_machine-unknown
		os=-none
		;;
	xscaleeb)
		basic_machine=armeb-unknown
		;;

	xscaleel)
		basic_machine=armel-unknown
		;;

	# We use `pc' rather than `unknown'
	# because (1) that's what they normally are, and
	# (2) the word "unknown" tends to confuse beginning users.
	i*86 | x86_64)
	  basic_machine=$basic_machine-pc
	  ;;
	# Object if more than one company name word.
	*-*-*)
		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
		exit 1
		;;
	# Recognize the basic CPU types with company name.
	580-* \
	| a29k-* \
	| aarch64-* | aarch64_be-* \
	| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
	| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
	| arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
	| avr-* | avr32-* \
	| ba-* \
	| be32-* | be64-* \
	| bfin-* | bs2000-* \
	| c[123]* | c30-* | [cjt]90-* | c4x-* \
	| c8051-* | clipper-* | craynv-* | cydra-* \
	| d10v-* | d30v-* | dlx-* \
	| e2k-* | elxsi-* \
	| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
	| h8300-* | h8500-* \
	| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
	| hexagon-* \
	| i*86-* | i860-* | i960-* | ia64-* \
	| ip2k-* | iq2000-* \
	| k1om-* \
	| le32-* | le64-* \
	| lm32-* \
	| m32c-* | m32r-* | m32rle-* \
	| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
	| m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
	| microblaze-* | microblazeel-* \
	| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
	| mips16-* \
	| mips64-* | mips64el-* \
	| mips64octeon-* | mips64octeonel-* \
	| mips64orion-* | mips64orionel-* \
	| mips64r5900-* | mips64r5900el-* \
	| mips64vr-* | mips64vrel-* \
	| mips64vr4100-* | mips64vr4100el-* \
	| mips64vr4300-* | mips64vr4300el-* \
	| mips64vr5000-* | mips64vr5000el-* \
	| mips64vr5900-* | mips64vr5900el-* \
	| mipsisa32-* | mipsisa32el-* \
	| mipsisa32r2-* | mipsisa32r2el-* \
	| mipsisa32r6-* | mipsisa32r6el-* \
	| mipsisa64-* | mipsisa64el-* \
	| mipsisa64r2-* | mipsisa64r2el-* \
	| mipsisa64r6-* | mipsisa64r6el-* \
	| mipsisa64sb1-* | mipsisa64sb1el-* \
	| mipsisa64sr71k-* | mipsisa64sr71kel-* \
	| mipsr5900-* | mipsr5900el-* \
	| mipstx39-* | mipstx39el-* \
	| mmix-* \
	| mt-* \
	| msp430-* \
	| nds32-* | nds32le-* | nds32be-* \
	| nios-* | nios2-* | nios2eb-* | nios2el-* \
	| none-* | np1-* | ns16k-* | ns32k-* \
	| open8-* \
	| or1k*-* \
	| orion-* \
	| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
	| pru-* \
	| pyramid-* \
	| riscv32-* | riscv64-* \
	| rl78-* | romp-* | rs6000-* | rx-* \
	| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
	| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
	| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
	| sparclite-* \
	| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \
	| tahoe-* \
	| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
	| tile*-* \
	| tron-* \
	| ubicom32-* \
	| v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
	| vax-* \
	| visium-* \
	| we32k-* \
	| x86-* | x86_64-* | xc16x-* | xps100-* \
	| xstormy16-* | xtensa*-* \
	| ymp-* \
	| z8k-* | z80-*)
		;;
	# Recognize the basic CPU types without company name, with glob match.
	xtensa*)
		basic_machine=$basic_machine-unknown
		;;
a693 4
	386bsd)
		basic_machine=i386-unknown
		os=-bsd
		;;
d695 2
a696 1
		basic_machine=m68000-att
d699 2
a700 74
		basic_machine=we32k-att
		;;
	a29khif)
		basic_machine=a29k-amd
		os=-udi
		;;
	abacus)
		basic_machine=abacus-unknown
		;;
	adobe68k)
		basic_machine=m68010-adobe
		os=-scout
		;;
	alliant | fx80)
		basic_machine=fx80-alliant
		;;
	altos | altos3068)
		basic_machine=m68k-altos
		;;
	am29k)
		basic_machine=a29k-none
		os=-bsd
		;;
	amd64)
		basic_machine=x86_64-pc
		;;
	amd64-*)
		basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
		;;
	amdahl)
		basic_machine=580-amdahl
		os=-sysv
		;;
	amiga | amiga-*)
		basic_machine=m68k-unknown
		;;
	amigaos | amigados)
		basic_machine=m68k-unknown
		os=-amigaos
		;;
	amigaunix | amix)
		basic_machine=m68k-unknown
		os=-sysv4
		;;
	apollo68)
		basic_machine=m68k-apollo
		os=-sysv
		;;
	apollo68bsd)
		basic_machine=m68k-apollo
		os=-bsd
		;;
	aros)
		basic_machine=i386-pc
		os=-aros
		;;
	asmjs)
		basic_machine=asmjs-unknown
		;;
	aux)
		basic_machine=m68k-apple
		os=-aux
		;;
	balance)
		basic_machine=ns32k-sequent
		os=-dynix
		;;
	blackfin)
		basic_machine=bfin-unknown
		os=-linux
		;;
	blackfin-*)
		basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
		os=-linux
d703 3
a705 70
		basic_machine=powerpc-ibm
		os=-cnk
		;;
	c54x-*)
		basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
		;;
	c55x-*)
		basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
		;;
	c6x-*)
		basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
		;;
	c90)
		basic_machine=c90-cray
		os=-unicos
		;;
	cegcc)
		basic_machine=arm-unknown
		os=-cegcc
		;;
	convex-c1)
		basic_machine=c1-convex
		os=-bsd
		;;
	convex-c2)
		basic_machine=c2-convex
		os=-bsd
		;;
	convex-c32)
		basic_machine=c32-convex
		os=-bsd
		;;
	convex-c34)
		basic_machine=c34-convex
		os=-bsd
		;;
	convex-c38)
		basic_machine=c38-convex
		os=-bsd
		;;
	cray | j90)
		basic_machine=j90-cray
		os=-unicos
		;;
	craynv)
		basic_machine=craynv-cray
		os=-unicosmp
		;;
	cr16 | cr16-*)
		basic_machine=cr16-unknown
		os=-elf
		;;
	crds | unos)
		basic_machine=m68k-crds
		;;
	crisv32 | crisv32-* | etraxfs*)
		basic_machine=crisv32-axis
		;;
	cris | cris-* | etrax*)
		basic_machine=cris-axis
		;;
	crx)
		basic_machine=crx-unknown
		os=-elf
		;;
	da30 | da30-*)
		basic_machine=m68k-da30
		;;
	decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
		basic_machine=mips-dec
d708 3
a710 2
		basic_machine=pdp10-dec
		os=-tops10
d713 3
a715 2
		basic_machine=pdp10-dec
		os=-tops20
d719 2
a720 1
		basic_machine=m68k-motorola
d722 4
a725 23
	delta88)
		basic_machine=m88k-motorola
		os=-sysv3
		;;
	dicos)
		basic_machine=i686-pc
		os=-dicos
		;;
	djgpp)
		basic_machine=i586-pc
		os=-msdosdjgpp
		;;
	dpx20 | dpx20-*)
		basic_machine=rs6000-bull
		os=-bosx
		;;
	dpx2* | dpx2*-bull)
		basic_machine=m68k-bull
		os=-sysv3
		;;
	e500v[12])
		basic_machine=powerpc-unknown
		os=$os"spe"
d727 3
a729 7
	e500v[12]-*)
		basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
		os=$os"spe"
		;;
	ebmon29k)
		basic_machine=a29k-amd
		os=-ebmon
d732 3
a734 9
		basic_machine=elxsi-elxsi
		os=-bsd
		;;
	encore | umax | mmax)
		basic_machine=ns32k-encore
		;;
	es1800 | OSE68k | ose68k | ose | OSE)
		basic_machine=m68k-ericsson
		os=-ose
d737 2
a738 1
		basic_machine=i860-alliant
d741 2
a742 9
		basic_machine=ns32k-ns
		;;
	gmicro)
		basic_machine=tron-gmicro
		os=-sysv
		;;
	go32)
		basic_machine=i386-pc
		os=-go32
d745 3
a747 29
		basic_machine=hppa1.1-hitachi
		os=-hiuxwe2
		;;
	h8300hms)
		basic_machine=h8300-hitachi
		os=-hms
		;;
	h8300xray)
		basic_machine=h8300-hitachi
		os=-xray
		;;
	h8500hms)
		basic_machine=h8500-hitachi
		os=-hms
		;;
	harris)
		basic_machine=m88k-harris
		os=-sysv3
		;;
	hp300-*)
		basic_machine=m68k-hp
		;;
	hp300bsd)
		basic_machine=m68k-hp
		os=-bsd
		;;
	hp300hpux)
		basic_machine=m68k-hp
		os=-hpux
d750 2
a751 1
		basic_machine=hppa1.0-hp
d754 2
a755 1
		basic_machine=m68000-hp
d758 2
a759 1
		basic_machine=m68k-hp
d762 2
a763 1
		basic_machine=hppa1.0-hp
d766 2
a767 1
		basic_machine=hppa1.1-hp
d771 2
a772 1
		basic_machine=hppa1.1-hp
d776 2
a777 1
		basic_machine=hppa1.1-hp
d780 2
a781 1
		basic_machine=hppa1.1-hp
d784 2
a785 15
		basic_machine=hppa1.0-hp
		;;
	hppa-next)
		os=-nextstep3
		;;
	hppaosf)
		basic_machine=hppa1.1-hp
		os=-osf
		;;
	hppro)
		basic_machine=hppa1.1-hp
		os=-proelf
		;;
	i370-ibm* | ibm*)
		basic_machine=i370-ibm
d788 3
a790 2
		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
		os=-sysv32
d793 3
a795 2
		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
		os=-sysv4
d798 3
a800 2
		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
		os=-sysv
d803 8
a810 10
		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
		os=-solaris2
		;;
	i386mach)
		basic_machine=i386-mach
		os=-mach
		;;
	i386-vsta | vsta)
		basic_machine=i386-unknown
		os=-vsta
d813 4
a816 3
		basic_machine=mips-sgi
		case $os in
		    -irix*)
d819 1
a819 1
			os=-irix4
a822 41
	isi68 | isi)
		basic_machine=m68k-isi
		os=-sysv
		;;
	leon-*|leon[3-9]-*)
		basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'`
		;;
	m68knommu)
		basic_machine=m68k-unknown
		os=-linux
		;;
	m68knommu-*)
		basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
		os=-linux
		;;
	m88k-omron*)
		basic_machine=m88k-omron
		;;
	magnum | m3230)
		basic_machine=mips-mips
		os=-sysv
		;;
	merlin)
		basic_machine=ns32k-utek
		os=-sysv
		;;
	microblaze*)
		basic_machine=microblaze-xilinx
		;;
	mingw64)
		basic_machine=x86_64-pc
		os=-mingw64
		;;
	mingw32)
		basic_machine=i686-pc
		os=-mingw32
		;;
	mingw32ce)
		basic_machine=arm-unknown
		os=-mingw32ce
		;;
d824 2
a825 11
		basic_machine=m68000-convergent
		;;
	*mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
		basic_machine=m68k-atari
		os=-mint
		;;
	mips3*-*)
		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
		;;
	mips3*)
		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
d827 4
a830 50
	monitor)
		basic_machine=m68k-rom68k
		os=-coff
		;;
	morphos)
		basic_machine=powerpc-unknown
		os=-morphos
		;;
	moxiebox)
		basic_machine=moxie-unknown
		os=-moxiebox
		;;
	msdos)
		basic_machine=i386-pc
		os=-msdos
		;;
	ms1-*)
		basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
		;;
	msys)
		basic_machine=i686-pc
		os=-msys
		;;
	mvs)
		basic_machine=i370-ibm
		os=-mvs
		;;
	nacl)
		basic_machine=le32-unknown
		os=-nacl
		;;
	ncr3000)
		basic_machine=i486-ncr
		os=-sysv4
		;;
	netbsd386)
		basic_machine=i386-unknown
		os=-netbsd
		;;
	netwinder)
		basic_machine=armv4l-rebel
		os=-linux
		;;
	news | news700 | news800 | news900)
		basic_machine=m68k-sony
		os=-newsos
		;;
	news1000)
		basic_machine=m68030-sony
		os=-newsos
d833 11
a843 11
		basic_machine=mips-sony
		os=-newsos
		;;
	necv70)
		basic_machine=v70-nec
		os=-sysv
		;;
	next | m*-next )
		basic_machine=m68k-next
		case $os in
		    -nextstep* )
d845 2
a846 2
		    -ns2*)
		      os=-nextstep2
d849 1
a849 1
		      os=-nextstep3
a852 20
	nh3000)
		basic_machine=m68k-harris
		os=-cxux
		;;
	nh[45]000)
		basic_machine=m88k-harris
		os=-cxux
		;;
	nindy960)
		basic_machine=i960-intel
		os=-nindy
		;;
	mon960)
		basic_machine=i960-intel
		os=-mon960
		;;
	nonstopux)
		basic_machine=mips-compaq
		os=-nonstopux
		;;
d854 2
a855 10
		basic_machine=np1-gould
		;;
	neo-tandem)
		basic_machine=neo-tandem
		;;
	nse-tandem)
		basic_machine=nse-tandem
		;;
	nsr-tandem)
		basic_machine=nsr-tandem
d858 3
a860 17
		basic_machine=hppa1.1-oki
		os=-proelf
		;;
	openrisc | openrisc-*)
		basic_machine=or32-unknown
		;;
	os400)
		basic_machine=powerpc-ibm
		os=-os400
		;;
	OSE68000 | ose68000)
		basic_machine=m68000-ericsson
		os=-ose
		;;
	os68k)
		basic_machine=m68k-none
		os=-os68k
d863 3
a865 14
		basic_machine=hppa1.1-hitachi
		os=-hiuxwe2
		;;
	paragon)
		basic_machine=i860-intel
		os=-osf
		;;
	parisc)
		basic_machine=hppa-unknown
		os=-linux
		;;
	parisc-*)
		basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
		os=-linux
d868 2
a869 1
		basic_machine=sparc-tti
d872 2
a873 1
		basic_machine=m68k-tti
d875 3
a877 2
	pc532 | pc532-*)
		basic_machine=ns32k-pc532
d879 3
a881 2
	pc98)
		basic_machine=i386-pc
d883 3
a885 2
	pc98-*)
		basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
d887 3
a889 2
	pentium | p5 | k5 | k6 | nexgen | viac3)
		basic_machine=i586-pc
d891 3
a893 2
	pentiumpro | p6 | 6x86 | athlon | athlon_*)
		basic_machine=i686-pc
d895 3
a897 2
	pentiumii | pentium2 | pentiumiii | pentium3)
		basic_machine=i686-pc
d899 9
a907 2
	pentium4)
		basic_machine=i786-pc
d909 3
a911 2
	pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
		basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
d913 3
a915 2
	pentiumpro-* | p6-* | 6x86-* | athlon-*)
		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
d917 3
a919 2
	pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
d921 4
a924 2
	pentium4-*)
		basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
d926 3
a928 2
	pn)
		basic_machine=pn-gould
d930 3
a932 1
	power)	basic_machine=power-ibm
d934 3
a936 1
	ppc | ppcbe)	basic_machine=powerpc-unknown
d938 8
a945 2
	ppc-* | ppcbe-*)
		basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
d947 6
a952 2
	ppcle | powerpclittle)
		basic_machine=powerpcle-unknown
d954 5
a958 2
	ppcle-* | powerpclittle-*)
		basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
d960 3
a962 1
	ppc64)	basic_machine=powerpc64-unknown
d964 4
a967 1
	ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
d969 11
a979 2
	ppc64le | powerpc64little)
		basic_machine=powerpc64le-unknown
d981 3
a983 2
	ppc64le-* | powerpc64little-*)
		basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
d985 2
a986 2
	ps2)
		basic_machine=i386-ibm
d988 2
a989 15
	pw32)
		basic_machine=i586-unknown
		os=-pw32
		;;
	rdos | rdos64)
		basic_machine=x86_64-pc
		os=-rdos
		;;
	rdos32)
		basic_machine=i386-pc
		os=-rdos
		;;
	rom68k)
		basic_machine=m68k-rom68k
		os=-coff
d991 2
a992 2
	rm[46]00)
		basic_machine=mips-siemens
d994 2
a995 2
	rtpc | rtpc-*)
		basic_machine=romp-ibm
d997 2
a998 2
	s390 | s390-*)
		basic_machine=s390-ibm
d1000 2
a1001 2
	s390x | s390x-*)
		basic_machine=s390x-ibm
d1003 2
a1004 3
	sa29200)
		basic_machine=a29k-amd
		os=-udi
d1006 2
a1007 2
	sb1)
		basic_machine=mipsisa64sb1-unknown
d1009 2
a1010 2
	sb1el)
		basic_machine=mipsisa64sb1el-unknown
d1012 2
a1013 3
	sde)
		basic_machine=mipsisa32-sde
		os=-elf
d1015 2
a1016 3
	sei)
		basic_machine=mips-sei
		os=-seiux
d1018 3
a1020 2
	sequent)
		basic_machine=i386-sequent
d1022 6
a1027 3
	sh)
		basic_machine=sh-hitachi
		os=-hms
d1029 4
a1032 2
	sh5el)
		basic_machine=sh5le-unknown
d1034 4
a1037 2
	sh64)
		basic_machine=sh64-unknown
d1039 3
a1041 3
	sparclite-wrs | simso-wrs)
		basic_machine=sparclite-wrs
		os=-vxworks
d1043 2
a1044 3
	sps7)
		basic_machine=m68k-bull
		os=-sysv2
d1046 2
a1047 2
	spur)
		basic_machine=spur-unknown
d1049 2
a1050 2
	st2000)
		basic_machine=m68k-tandem
d1052 3
a1054 3
	stratus)
		basic_machine=i860-stratus
		os=-sysv4
d1056 2
a1057 2
	strongarm-* | thumb-*)
		basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
d1059 2
a1060 2
	sun2)
		basic_machine=m68000-sun
d1062 3
a1064 3
	sun2os3)
		basic_machine=m68000-sun
		os=-sunos3
d1066 2
a1067 3
	sun2os4)
		basic_machine=m68000-sun
		os=-sunos4
d1069 2
a1070 3
	sun3os3)
		basic_machine=m68k-sun
		os=-sunos3
d1072 3
a1074 3
	sun3os4)
		basic_machine=m68k-sun
		os=-sunos4
d1076 2
a1077 3
	sun4os3)
		basic_machine=sparc-sun
		os=-sunos3
d1079 2
a1080 3
	sun4os4)
		basic_machine=sparc-sun
		os=-sunos4
d1082 2
a1083 3
	sun4sol2)
		basic_machine=sparc-sun
		os=-solaris2
d1085 2
a1086 2
	sun3 | sun3-*)
		basic_machine=m68k-sun
d1088 2
a1089 2
	sun4)
		basic_machine=sparc-sun
d1091 2
a1092 2
	sun386 | sun386i | roadrunner)
		basic_machine=i386-sun
d1094 2
a1095 3
	sv1)
		basic_machine=sv1-cray
		os=-unicos
d1097 2
a1098 3
	symmetry)
		basic_machine=i386-sequent
		os=-dynix
d1100 2
a1101 3
	t3e)
		basic_machine=alphaev5-cray
		os=-unicos
d1103 2
a1104 3
	t90)
		basic_machine=t90-cray
		os=-unicos
d1106 2
a1107 3
	tile*)
		basic_machine=$basic_machine-unknown
		os=-linux-gnu
d1109 2
a1110 2
	tx39)
		basic_machine=mipstx39-unknown
d1112 2
a1113 2
	tx39el)
		basic_machine=mipstx39el-unknown
d1115 2
a1116 30
	toad1)
		basic_machine=pdp10-xkl
		os=-tops20
		;;
	tower | tower-32)
		basic_machine=m68k-ncr
		;;
	tpf)
		basic_machine=s390x-ibm
		os=-tpf
		;;
	udi29k)
		basic_machine=a29k-amd
		os=-udi
		;;
	ultra3)
		basic_machine=a29k-nyu
		os=-sym1
		;;
	v810 | necv810)
		basic_machine=v810-nec
		os=-none
		;;
	vaxv)
		basic_machine=vax-dec
		os=-sysv
		;;
	vms)
		basic_machine=vax-dec
		os=-vms
d1118 2
a1119 18
	vpp*|vx|vx-*)
		basic_machine=f301-fujitsu
		;;
	vxworks960)
		basic_machine=i960-wrs
		os=-vxworks
		;;
	vxworks68)
		basic_machine=m68k-wrs
		os=-vxworks
		;;
	vxworks29k)
		basic_machine=a29k-wrs
		os=-vxworks
		;;
	w65*)
		basic_machine=w65-wdc
		os=-none
d1121 2
a1122 3
	w89k-*)
		basic_machine=hppa1.1-winbond
		os=-proelf
d1124 2
a1125 6
	xbox)
		basic_machine=i686-pc
		os=-mingw32
		;;
	xps | xps100)
		basic_machine=xps100-honeywell
d1128 1
a1128 1
		basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
d1130 2
a1131 15
	ymp)
		basic_machine=ymp-cray
		os=-unicos
		;;
	z8k-*-coff)
		basic_machine=z8k-unknown
		os=-sim
		;;
	z80-*-coff)
		basic_machine=z80-unknown
		os=-sim
		;;
	none)
		basic_machine=none-none
		os=-none
d1134 4
a1137 4
# Here we handle the default manufacturer of certain CPU types.  It is in
# some cases the only manufacturer, in others, it is the most popular.
	w89k)
		basic_machine=hppa1.1-winbond
d1139 3
a1141 2
	op50n)
		basic_machine=hppa1.1-oki
d1143 3
a1145 2
	op60c)
		basic_machine=hppa1.1-oki
d1147 2
a1148 2
	romp)
		basic_machine=romp-ibm
d1150 3
a1152 2
	mmix)
		basic_machine=mmix-knuth
d1154 3
a1156 2
	rs6000)
		basic_machine=rs6000-ibm
d1158 3
a1160 2
	vax)
		basic_machine=vax-dec
d1162 11
a1172 3
	pdp10)
		# there are many clones, so DEC is not a safe bet
		basic_machine=pdp10-unknown
d1174 2
a1175 29
	pdp11)
		basic_machine=pdp11-dec
		;;
	we32k)
		basic_machine=we32k-att
		;;
	sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
		basic_machine=sh-unknown
		;;
	sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
		basic_machine=sparc-sun
		;;
	cydra)
		basic_machine=cydra-cydrome
		;;
	orion)
		basic_machine=orion-highlevel
		;;
	orion105)
		basic_machine=clipper-highlevel
		;;
	mac | mpw | mac-mpw)
		basic_machine=m68k-apple
		;;
	pmac | pmac-mpw)
		basic_machine=powerpc-apple
		;;
	*-unknown)
		# Make sure to match an already-canonicalized machine name.
d1177 1
d1179 92
a1270 2
		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
		exit 1
d1275 3
a1277 3
case $basic_machine in
	*-digital*)
		basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
d1279 2
a1280 2
	*-commodore*)
		basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
d1288 1
a1288 1
if [ x"$os" != x"" ]
d1290 46
d1337 5
a1341 5
	# First match some system type aliases
	# that might get confused with valid system types.
	# -solaris* is a basic system type, with this one exception.
	-auroraux)
		os=-auroraux
d1343 2
a1344 2
	-solaris1 | -solaris1.*)
		os=`echo $os | sed -e 's|solaris1|sunos4|'`
d1346 2
a1347 2
	-solaris)
		os=-solaris2
d1349 2
a1350 2
	-svr4*)
		os=-sysv4
d1352 2
a1353 2
	-unixware*)
		os=-sysv4.2uw
d1355 3
a1357 2
	-gnu/linux*)
		os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
d1359 3
a1361 41
	# First accept the basic system types.
	# The portable systems comes first.
	# Each alternative MUST END IN A *, to match a version number.
	# -sysv* is not here because it comes later, after sysvr4.
	-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
	      | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
	      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
	      | -sym* | -kopensolaris* | -plan9* \
	      | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
	      | -aos* | -aros* | -cloudabi* | -sortix* \
	      | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
	      | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
	      | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
	      | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \
	      | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
	      | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
	      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
	      | -chorusos* | -chorusrdb* | -cegcc* | -glidix* \
	      | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
	      | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
	      | -linux-newlib* | -linux-musl* | -linux-uclibc* \
	      | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \
	      | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
	      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
	      | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
	      | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
	      | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
	      | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
	      | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \
	      | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox*)
	# Remember, each alternative MUST END IN *, to match a version number.
		;;
	-qnx*)
		case $basic_machine in
		    x86-* | i*86-*)
			;;
		    *)
			os=-nto$os
			;;
		esac
d1363 2
a1364 1
	-nto-qnx*)
d1366 2
a1367 2
	-nto*)
		os=`echo $os | sed -e 's|nto|nto-qnx|'`
d1369 2
a1370 3
	-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
	      | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
	      | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
d1372 2
a1373 2
	-mac*)
		os=`echo $os | sed -e 's|mac|macos|'`
d1375 2
a1376 2
	-linux-dietlibc)
		os=-linux-dietlibc
d1378 2
a1379 2
	-linux*)
		os=`echo $os | sed -e 's|linux|linux-gnu|'`
d1381 2
a1382 2
	-sunos5*)
		os=`echo $os | sed -e 's|sunos5|solaris2|'`
d1384 2
a1385 2
	-sunos6*)
		os=`echo $os | sed -e 's|sunos6|solaris3|'`
d1387 2
a1388 2
	-opened*)
		os=-openedition
d1390 2
a1391 2
	-os400*)
		os=-os400
d1393 2
a1394 2
	-wince*)
		os=-wince
d1396 2
a1397 2
	-osfrose*)
		os=-osfrose
d1399 2
a1400 2
	-osf*)
		os=-osf
d1402 2
a1403 2
	-utek*)
		os=-bsd
d1405 2
a1406 2
	-dynix*)
		os=-bsd
d1408 2
a1409 2
	-acis*)
		os=-aos
d1411 2
a1412 2
	-atheos*)
		os=-atheos
d1414 2
a1415 2
	-syllable*)
		os=-syllable
d1417 2
a1418 2
	-386bsd)
		os=-bsd
d1420 2
a1421 2
	-ctix* | -uts*)
		os=-sysv
d1423 2
a1424 2
	-nova*)
		os=-rtmk-nova
d1426 2
a1427 2
	-ns2 )
		os=-nextstep2
d1429 2
a1430 2
	-nsk*)
		os=-nsk
d1432 2
a1433 3
	# Preserve the version number of sinix5.
	-sinix5.*)
		os=`echo $os | sed -e 's|sinix|sysv|'`
d1435 2
a1436 2
	-sinix*)
		os=-sysv4
d1438 2
a1439 2
	-tpf*)
		os=-tpf
d1441 2
a1442 2
	-triton*)
		os=-sysv3
d1444 2
a1445 2
	-oss*)
		os=-sysv3
d1447 2
a1448 2
	-svr4)
		os=-sysv4
d1450 3
a1452 2
	-svr3)
		os=-sysv3
d1454 2
a1455 2
	-sysvr4)
		os=-sysv4
d1457 2
a1458 2
	# This must come after -sysvr4.
	-sysv*)
d1460 2
a1461 2
	-ose*)
		os=-ose
d1463 2
a1464 2
	-es1800*)
		os=-ose
d1466 2
a1467 2
	-xenix)
		os=-xenix
d1469 2
a1470 2
	-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
		os=-mint
d1472 2
a1473 2
	-aros*)
		os=-aros
d1475 2
a1476 2
	-zvmoe)
		os=-zvmoe
d1478 2
a1479 2
	-dicos*)
		os=-dicos
d1481 2
a1482 1
	-nacl*)
d1484 13
a1496 1
	-ios)
d1498 4
a1501 1
	-none)
d1504 1
a1504 4
		# Get rid of the `-' at the beginning of $os.
		os=`echo $os | sed 's/[^-]*-//'`
		echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
		exit 1
d1507 1
d1520 3
a1522 1
case $basic_machine in
d1524 2
a1525 1
		os=-elf
d1528 2
a1529 1
		os=-elf
d1532 1
a1532 1
		os=-riscix1.2
d1535 2
a1536 1
		os=-linux
d1539 2
a1540 1
		os=-aout
d1543 2
a1544 1
		os=-coff
d1547 5
a1551 1
		os=-elf
d1554 2
a1555 1
		os=-elf
d1558 2
a1559 1
		os=-coff
d1562 2
a1563 1
		os=-coff
d1566 2
a1567 1
		os=-coff
d1571 1
a1571 1
		os=-tops20
d1574 1
a1574 1
		os=-none
d1577 1
a1577 1
		os=-ultrix4.2
d1580 1
a1580 1
		os=-domain
d1583 1
a1583 1
		os=-sunos4.0.2
d1586 1
a1586 1
		os=-sunos3
d1589 2
a1590 1
		os=-aout
d1593 2
a1594 1
		os=-elf
d1597 2
a1598 1
		os=-elf
d1601 2
a1602 1
		os=-elf
d1605 2
a1606 1
		os=-coff
d1609 1
a1609 1
		os=-sysv3
d1612 1
a1612 1
		os=-sunos4.1.1
d1615 2
a1616 1
		os=-elf
d1619 1
a1619 4
		os=-beos
		;;
	*-haiku)
		os=-haiku
d1622 1
a1622 1
		os=-aix
d1625 1
a1625 1
		os=-mmixware
d1628 1
a1628 1
		os=-proelf
d1631 1
a1631 1
		os=-proelf
d1634 1
a1634 1
		os=-proelf
d1637 1
a1637 1
		os=-hpux
d1640 1
a1640 1
		os=-hiux
d1643 1
a1643 1
		os=-sysv
d1646 1
a1646 1
		os=-amigaos
d1649 1
a1649 1
		os=-dgux
d1652 1
a1652 1
		os=-sysv3
d1655 1
a1655 1
		os=-rtu
d1658 1
a1658 1
		os=-luna
d1660 2
a1661 2
	*-next )
		os=-nextstep
d1664 1
a1664 1
		os=-ptx
d1667 1
a1667 1
		os=-unos
d1670 1
a1670 1
		os=-genix
d1673 1
a1673 4
		os=-mvs
		;;
	*-next)
		os=-nextstep3
d1676 1
a1676 1
		os=-sysv
d1679 1
a1679 1
		os=-bsd
d1682 1
a1682 1
		os=-bsd
d1685 1
a1685 1
		os=-irix
d1688 1
a1688 1
		os=-sysv4
d1691 1
a1691 1
		os=-rtu
d1694 1
a1694 1
		os=-uxpv
d1697 2
a1698 1
		os=-coff
d1701 2
a1702 1
		os=-coff
d1705 1
a1705 1
		os=-macos
d1708 4
a1711 1
		os=-mint
d1714 1
a1714 1
		os=-none
d1717 1
d1720 154
d1876 4
a1879 5
vendor=unknown
case $basic_machine in
	*-unknown)
		case $os in
			-riscix*)
d1882 1
a1882 1
			-sunos*)
d1885 1
a1885 1
			-cnk*|-aix*)
d1888 1
a1888 1
			-beos*)
d1891 1
a1891 1
			-hpux*)
d1894 1
a1894 1
			-mpeix*)
d1897 1
a1897 1
			-hiux*)
d1900 1
a1900 1
			-unos*)
d1903 1
a1903 1
			-dgux*)
d1906 1
a1906 1
			-luna*)
d1909 1
a1909 1
			-genix*)
d1912 7
a1918 1
			-mvs* | -opened*)
d1921 1
a1921 1
			-os400*)
d1924 1
a1924 1
			-ptx*)
d1927 1
a1927 1
			-tpf*)
d1930 1
a1930 1
			-vxsim* | -vxworks* | -windiss*)
d1933 1
a1933 1
			-aux*)
d1936 1
a1936 1
			-hms*)
d1939 1
a1939 1
			-mpw* | -macos*)
d1942 1
a1942 1
			-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
d1945 1
a1945 1
			-vos*)
a1948 1
		basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
d1952 1
a1952 1
echo $basic_machine$os
d1956 1
a1956 1
# eval: (add-hook 'write-file-hooks 'time-stamp)
@


1.1.1.1
log
@Import 4.14.0 (previous was 4.8.0)

NSD 4.14.0 Latest
This release consists of a refactor of the RDATA storage, reducing the memory
footprint of NSD, and various bug fixes.

4.14.0
FEATURES:

Fix #137: Adds tcp-listen-queue: number config option to set
the TCP backlog. And the default for the listen TCP backlog is
set to -1 on BSDs and Linux.
Merge #444: Refactor RDATA storage to reduce memory footprint
BUG FIXES:

Fix empty debug statement body in catalog consumer zone process.
Merge #459: Check for libfstrm version >= 0.4.
For #459: Add configure check for fstrm_tcp_writer_options_init
in addition to the check for fstrm_iothr_init.
Merge #460: Add XDP_OBJ fixing link errors for XDP.
Fix XDP build error with --enable-checking
Resolve warnings about mixed declaration and code and unused variable
Fix confusing report for default send and receive buffer-size by
nsd-checkconf
Fix to log more details when send-buffer-size or receive-buffer-size
is not granted, on verbosity level 2.
Update in acx_nlnetlabs.m4 to version 49.
Update in acx_nlnetlabs.m4 to version 50, with cache value for
malloc function check.
Update acx_nlnetlabs.m4 to version 51, with nonstring unknown
attribute warning fix.
Merge #466: Do not delete nodes from non-existent zone's NSEC3 hash
trees
simdzone 0.2.4
BUG FIXES:

Correct lengths for GOST R 34.10-2012 and SM3 delegation signer (DS) digest
algorithms
Require the AMTRELAY relay field to be . for the no gateway relay type as
specified by RFC 8777 (#257)
Assets
2
Source code
(zip)
Dec 4, 2025
Source code
(tar.gz)
Dec 4, 2025
NSD 4.14.0rc1
Nov 27, 2025
@@mozzieongit mozzieongit
 NSD_4_14_0_RC1
 128ba30
NSD 4.14.0rc1 Pre-release
This release consists of a refactor of the RDATA storage, reducing
the memory footprint of NSD, and various bug fixes.

4.14.0
FEATURES:

Fix #137: Adds tcp-listen-queue: number config option to set
the TCP backlog. And the default for the listen TCP backlog is
set to -1 on BSDs and Linux.
Merge #444: Refactor RDATA storage to reduce memory footprint
BUG FIXES:

Fix empty debug statement body in catalog consumer zone process.
Merge #459: Check for libfstrm version >= 0.4.
For #459: Add configure check for fstrm_tcp_writer_options_init
in addition to the check for fstrm_iothr_init.
Merge #460: Add XDP_OBJ fixing link errors for XDP.
Fix XDP build error with --enable-checking
Resolve warnings about mixed declaration and code and unused variable
Fix confusing report for default send and receive buffer-size by
nsd-checkconf
Fix to log more details when send-buffer-size or receive-buffer-size
is not granted, on verbosity level 2.
Update in acx_nlnetlabs.m4 to version 49.
Update in acx_nlnetlabs.m4 to version 50, with cache value for
malloc function check.
Update acx_nlnetlabs.m4 to version 51, with nonstring unknown
attribute warning fix.
Merge #466: Do not delete nodes from non-existent zone's NSEC3 hash
trees
simdzone 0.2.4
BUG FIXES:

Correct lengths for GOST R 34.10-2012 and SM3 delegation signer (DS) digest
algorithms
Require the AMTRELAY relay field to be . for the no gateway relay type as
specified by RFC 8777 (#257)
Assets
2
NSD 4.13.0
Sep 3, 2025
@@mozzieongit mozzieongit
 NSD_4_13_0_REL
 559013e
NSD 4.13.0
This release enables some commonly used features by default, and
introduces experimental support for AF_XDP sockets that can be
enabled with the --enable-xdp feature flag (see
https://nsd.docs.nlnetlabs.nl/en/latest/xdp.html).

4.13.0
FEATURES:

Use '(all)' and '(none)' for the socket server affinity
log output instead of '*' and '-'.
The --enable-bind8-stats feature, was already enabled by default,
is described as enabled by default in usage.
The --enable-zone-stats feature is enabled by default. It can be
turned on with config like zonestats: "%s".
The --enable-ratelimit feature is enabled by default. The
ratelimit value is off by default. It can be turned on with
config like rrl-ratelimit: 200.
The --enable-dnstap feature is enabled by default. If fstrm-devel
or protobuf-c are not found by configure it prints an error.
It can be turned on with config like dnstap-enable: yes.
Change default for send-buffer-size to 4m, to mitigate a
cross-layer issue where the UDP socket send buffers are
exhausted waiting for ARP/NDP resolution. Thanks to Reflyable
for the report.
Disable TLSv1.2 if TLSv1.3 is available.
Merge #449: Add useful logging for XoT transfers.
Merge #425: Add experimental XDP (AF_XDP) support for UDP traffic
Merge #455: --with-dbdir option for configure to set the base
directory for the xfrd zone timer state file, the zone list file
and the cookie secrets file. Thanks Simon Josefsson.
Merge #456: Spelling fixes in metrics.c. Thanks Simon Josefsson.
BUG FIXES:

Fix punctuation of nsd -h output for the -a option.
Fix checkconf unit test for when metrics are not enabled.
Prometheus metrics tests require --enable-zone-stats.
Add unit test for socket server affinity log output.
Move xfrd-tcp unit test to its own file.
Fix contrib/nsd.spec to omit configure flags that are default or
that do not exist.
Fix to remove mention of obsolete root-server option.
Fix mention of draft-rrtypes and root-server configure options.
Fix ci workflow for enable dnstap.
Fix to remove use of sprintf from metrics.
Fix for fstrm and protobuf-c for ci workflow coverity-scan.
Fix for parallel build of dnstap protoc-c output.
Fix to remove unneeded mkdir from Makefile.
Fix dnstap to use protoc and keep dnstap_config.h unchanged if
possible.
Fix to provide doc for --enable-systemd.
Fix to remove debug printout for configure dnstap header.
Fix #441: SystemD script for NSD prevents using chroot.
Fix to add checks for compression pointers and too long dnames in
internal dname routines, dname_make and ixfr dname_length.
Fix to remove shell assignment operator from Makefile for DATE.
make depend.
Fix bitwise operators in conditional expressions with parentheses.
Fix conditional expressions with parentheses for bitwise and.
Merge #445: contrib/nsd.openrc.in: use supervise-daemon and
add need net.
Fix #446 nsd_size_db_in_mem_bytes (size.db.mem) metric not
updated on reload.
Merge #447: Minimize disruptions on reconfig.
For #447: Updated simdzone to latest commit. With the padding
test changes.
For #447: use need_to_send_reload to detect if a reload is issued.
For #447: acl_list_equal already tests for TSIG key changes, so
removed the duplicate checks.
For #447: log crypto error with the SSL_write error.
Update simdzone with support for --enable-pie.
Merge #454 from jaredmauch: handle rare case but seen in
production where data->query is NULL.
simdzone 0.2.3
FEATURES:

check_pie: match nsd support (#253).
BUG FIXES:

Fix tests to initialize padding (#252).
Fix for #253, add acx_nlnetlabs.m4 in the repo and allow CFLAGS passed to
configure to set the flags.
Assets
2
NSD 4.13.0rc1
Aug 26, 2025
@@mozzieongit mozzieongit
 NSD_4_13_0_RC1
 9a1a5ed
NSD 4.13.0rc1 Pre-release
This release enables some commonly used features by default, and
introduces experimental support for AF_XDP sockets that can be
enabled with the --enable-xdp feature flag (see
https://nsd.docs.nlnetlabs.nl/en/latest/xdp.html).

4.13.0
FEATURES:

Use '(all)' and '(none)' for the socket server affinity
log output instead of '*' and '-'.
The --enable-bind8-stats feature, was already enabled by default,
is described as enabled by default in usage.
The --enable-zone-stats feature is enabled by default. It can be
turned on with config like zonestats: "%s".
The --enable-ratelimit feature is enabled by default. The
ratelimit value is off by default. It can be turned on with
config like rrl-ratelimit: 200.
The --enable-dnstap feature is enabled by default. If fstrm-devel
or protobuf-c are not found by configure it prints an error.
It can be turned on with config like dnstap-enable: yes.
Change default for send-buffer-size to 4m, to mitigate a
cross-layer issue where the UDP socket send buffers are
exhausted waiting for ARP/NDP resolution. Thanks to Reflyable
for the report.
Disable TLSv1.2 if TLSv1.3 is available.
Merge #449: Add useful logging for XoT transfers.
Merge #425: Add experimental XDP (AF_XDP) support for UDP traffic
Merge #455: --with-dbdir option for configure to set the base
directory for the xfrd zone timer state file, the zone list file
and the cookie secrets file. Thanks Simon Josefsson.
Merge #456: Spelling fixes in metrics.c. Thanks Simon Josefsson.
BUG FIXES:

Fix punctuation of nsd -h output for the -a option.
Fix checkconf unit test for when metrics are not enabled.
Prometheus metrics tests require --enable-zone-stats.
Add unit test for socket server affinity log output.
Move xfrd-tcp unit test to its own file.
Fix contrib/nsd.spec to omit configure flags that are default or
that do not exist.
Fix to remove mention of obsolete root-server option.
Fix mention of draft-rrtypes and root-server configure options.
Fix ci workflow for enable dnstap.
Fix to remove use of sprintf from metrics.
Fix for fstrm and protobuf-c for ci workflow coverity-scan.
Fix for parallel build of dnstap protoc-c output.
Fix to remove unneeded mkdir from Makefile.
Fix dnstap to use protoc and keep dnstap_config.h unchanged if
possible.
Fix to provide doc for --enable-systemd.
Fix to remove debug printout for configure dnstap header.
Fix #441: SystemD script for NSD prevents using chroot.
Fix to add checks for compression pointers and too long dnames in
internal dname routines, dname_make and ixfr dname_length.
Fix to remove shell assignment operator from Makefile for DATE.
make depend.
Fix bitwise operators in conditional expressions with parentheses.
Fix conditional expressions with parentheses for bitwise and.
Merge #445: contrib/nsd.openrc.in: use supervise-daemon and
add need net.
Fix #446 nsd_size_db_in_mem_bytes (size.db.mem) metric not
updated on reload.
Merge #447: Minimize disruptions on reconfig.
For #447: Updated simdzone to latest commit. With the padding
test changes.
For #447: use need_to_send_reload to detect if a reload is issued.
For #447: acl_list_equal already tests for TSIG key changes, so
removed the duplicate checks.
For #447: log crypto error with the SSL_write error.
Update simdzone with support for --enable-pie.
Merge #454 from jaredmauch: handle rare case but seen in
production where data->query is NULL.
simdzone 0.2.3
FEATURES:

check_pie: match nsd support (#253).
BUG FIXES:

Fix tests to initialize padding (#252).
Fix for #253, add acx_nlnetlabs.m4 in the repo and allow CFLAGS passed to
configure to set the flags.
Assets
2
NSD 4.12.0
Apr 24, 2025
@@mozzieongit mozzieongit
 NSD_4_12_0_REL
 8eaaab3
NSD 4.12.0
This release introduces Prometheus metrics that can be configured with
enable-metrics (see nsd.conf(5)).

nsd 4.12.0
FEATURES:

Merge #418: Support for DSYNC, EID, NIMLOC, SINK, TALINK, DOA,
AMTRELAY and IPN resource record types.
Merge #420: Zones get state "old-serial" with
nsd-control zonestatus when the served serial is older than
the one received by the transfer daemon.
Merge #429: Add prometheus metrics
BUG FIXES:

Fix re-enable to configure dns-cookies from config file, which was
accidentally removed with the 4.11.1 release.
Fix #426: nsd crashes with patterns in config_apply_pattern.
Fix for #430: Confusing documentation: word "outgoing".
Fix for #430: Confusing documentation: word "outgoing". Add wording
to tcp-count, xfrd-tcp-max, xfrd-tcp-pipeline options.
Fix that nsec3 prehash after a full transfer can create the nsec3
zone trees if they are needed.
Fix in nsd-mem for a zone with ixfr data.
Fix ixfr read routine for use after the temp region is freed of rr.
Fix ixfr file read to manage numlist in temp domains.
Fix nsd-mem to clean ixfr storage.
Fix log print assert in server sockets for printing '-' empty.
Fix notify_fmt test for xfrd file location.
Fix sanitizer warnings in read_uint32.
Fix sanitizer warning in tsig write of zero length mac and otherdata.
Fix to please sanitizer for ixfr store of data in cancelled state.
Fix multiple zone transfers in one reload so that xfrd does not
check the update as failed and restart the transfer.
Fix read of ixfr file with rdata subdomain.
Fix test checkconf for metrics options.
Updated simdzone to include fixes for NSAP-PTR, LOC,
uninitialized reads, and comment nit.
Fix #436: Fix print of RR type NSAP-PTR.
Fix unit test call to zone_parse_string and initialize padding.
Fix escape more characters when printing an RR type with an
unquoted string.
Fix memory leak in the process of addzone.
Fix to update common.sh for speed of kill_pid.
Fix nsd-checkzone ixfr create cleanup on exit.
simdzone 0.2.2
FEATURES:

Support for EID, NIMLOC, SINK, TALINK, DSYNC, DOA, AMTRELAY
and IPN RR types.
BUG FIXES:

Empty base16 and base64 in CDS and CDNSKEY can be represented
with a '0'. As specified in Section 4 of RFC 8078.
Initialise padding after the file buffer (#249).
Fix type NSAP-PTR (#250).
Fix LOC poweroften lookup (#251).
Assets
2
2 people reacted
NSD 4.12.0rc1
Apr 16, 2025
@@mozzieongit mozzieongit
 NSD_4_12_0_RC1
 fee5394
NSD 4.12.0rc1 Pre-release
This release introduces Prometheus metrics that can be compiled with
--enable-prometheus-metrics and configured with enable-metrics (see
nsd.conf(5)).

4.12.0
FEATURES:

Merge #418: Support for DSYNC, EID, NIMLOC, SINK, TALINK, DOA,
AMTRELAY and IPN resource record types.
Merge #420: Zones get state "old-serial" with
nsd-control zonestatus when the served serial is older than
the one received by the transfer daemon.
Merge #429: Add prometheus metrics
BUG FIXES:

Fix re-enable to configure dns-cookies from config file, which was
accidentally removed with the 4.11.1 release.
Fix #426: nsd crashes with patterns in config_apply_pattern.
Fix for #430: Confusing documentation: word "outgoing".
Fix for #430: Confusing documentation: word "outgoing". Add wording
to tcp-count, xfrd-tcp-max, xfrd-tcp-pipeline options.
Fix that nsec3 prehash after a full transfer can create the nsec3
zone trees if they are needed.
Fix in nsd-mem for a zone with ixfr data.
Fix ixfr read routine for use after the temp region is freed of rr.
Fix ixfr file read to manage numlist in temp domains.
Fix nsd-mem to clean ixfr storage.
Fix log print assert in server sockets for printing '-' empty.
Fix notify_fmt test for xfrd file location.
Fix sanitizer warnings in read_uint32.
Fix sanitizer warning in tsig write of zero length mac and otherdata.
Fix to please sanitizer for ixfr store of data in cancelled state.
Fix multiple zone transfers in one reload so that xfrd does not
check the update as failed and restart the transfer.
Fix read of ixfr file with rdata subdomain.
Fix test checkconf for metrics options.
Updated simdzone to include fixes for NSAP-PTR, LOC,
uninitialized reads, and comment nit.
Fix #436: Fix print of RR type NSAP-PTR.
Fix unit test call to zone_parse_string and initialize padding.
Fix escape more characters when printing an RR type with an
unquoted string.
Fix memory leak in the process of addzone.
Fix to update common.sh for speed of kill_pid.
Fix nsd-checkzone ixfr create cleanup on exit.
simdzone 0.2.2
FEATURES:

Support for EID, NIMLOC, SINK, TALINK, DSYNC, DOA, AMTRELAY and IPN RR types.
BUG FIXES:

Empty base16 and base64 in CDS and CDNSKEY can be represented with a '0'.
As specified in Section 4 of RFC 8078.
Initialise padding after the file buffer (#249).
Fix type NSAP-PTR (#250).
Fix LOC poweroften lookup (#251).
Assets
2
1 person reacted
NSD_4_11_1_REL: NSD 4.11.1
Jan 19, 2025
@@wtoorop wtoorop
 NSD_4_11_1_REL
 2f62877
NSD_4_11_1_REL: NSD 4.11.1
NSD version 4.11.0 had a serious bug in which applying updates to
zones (and other modifications that require a reload, such as adding
and deleting zones), could stop entirely after reception of a broken
or corrupted update via zone transfer. We believe that this broken
state would appear as one of the NSD processes consuming 100% CPU.
Version 4.11.1 has this corrected as well as some other smaller
non-critical bugs.

We strongly advise to not run NSD version 4.11.0, and if you have
it deployed already, upgrade to 4.11.1 at the earliest possible
opportunity.

Many thanks to the people at SUNET and netnod (Fredrik and Arvid
and all the others) that helped us to get to the bottom of this
critical issue!

nsd 4.11.1
BUG FIXES:

Fix #415: Fix out of tree builds. Thanks Florian Obser (@@fobser).
Fix #414: XoT interoperability with BIND and Knot
Fix #421: old-main can quit before the reload process received
from old-main that it is done on the reload_listener pipe.
Thanks Otto Retter.
Fix whitespace in comment.
Fix #424: Stalled updates after corrupt transfer.
simdzone 0.2.1
BUG FIXES:

Cleanup westmere and haswell object files (#244) Thanks @@fobser
Out of tree builds (#415)
Fix function declarations for fallback detection routine in
isadetection.h.
Contributors
@@fobser
fobser
Assets
2
NSD 4.11.0
Dec 12, 2024
@@wtoorop wtoorop
 NSD_4_11_0_REL
 c628f66
NSD 4.11.0
This release has various small features and bugfixes.

One notable feature is that configuration can be reloaded and
evaluated on SIGHUP, when enabled with the new "reload-config"
option. Also new is that cookie secrets will be reevaluated from
config too.

One notable bugfix is to process and apply non transfer tasks before
transfer tasks during reloads. Before, non transfer tasks (such as
adding or deleting zones) would be lost when batched together with
a transfer task that would fail to apply.

NSD 4.11.0
FEATURES:

Support reloading configuration on SIGHUP.
Fix #383: log timestamps in ISO8601 format with timezone.
This adds the option log-time-iso: yes that logs in ISO8601
format.
Updated cookie secrets management.
The default cookie secret file location can be set at compile time
with the --with-cookiesecretsfile=path option to configure. The
default location is changed to {dbdir}/cookiesecrets.txt. The
previous default location will be checked at startup when there is
no cookie secrets file at the new default location.
A staging cookie can now also be configured in the configuration
file and secrets configured in the configuration file now take
precedence over those read from file.
All DNS related setting in the configuration file will be reevaluated
and effectuated after nsd-control reconfig.
Merge #398: RFC 9660 The DNS Zone Version (ZONEVERSION) Option
Merge #406: ohttp and tls-supported-groups SvcParam suppor
Merge #408: NINFO, RKEY, RESINFO, WALLET, CLA and TA RR types
Merge #409: Writing of NSAP-PTR, GPOS and HIP RR types
Merge #407: Better balanced verbosity levels for logging.
BUG FIXES:

Fix title underline and declaration after statement warnings.
Add cross platform freebsd, openbsd and netbsd to github ci.
Update simdzone to include fix for netbsd double bswap declarations,
and also semantic checks for DS and ZONEMD. And CFLAGS has -march
prepended to fix detection.
Merge #376: Point the user towards tcpdump for logging individual
queries.
Track $INCLUDEs in zone files.
Fix ci to update macos-12 to the macos-15 runner image.
Merge #390: Apply non-xfr tasks before xfr tasks.
This fixes an issue where non-xfr tasks are lost when they are
batch processed together with non-xfr tasks.
This merge also changes that notifies are passed on from the serve
processes to the xfrd directly instead of via main. This was
necessary to allow applying the non-xfr tasks without forking a
backup-main for the sole purpose of forwarding notifies.
Merge #391: Update copyright lines (in version output).
Fix #392: Inconsistent documentation about control-interface.
Merge #395: Explain the zonefile example better.
Merge #394: Fix the path to use doc/manual/.
Fix analyzer issue in do_print_cookie_secrets to check for failure.
Merge #404: Introducing Sphinx substitution in code blocks.
As well as other fixes with Sphinx build.
Update Copyright lines in help output
Merge #395: Explain zonefile example better
Merge #394: Fix doc path (fixes "Edit on GitHub" button in the docs)
Fix Makefile for parallel build failure around bison rule.
Fix #405: Fix typo in documentation.
Treat a mismatch in RRset TTLs as a warning.
simdzone 0.2.0
FEATURES:

Add semantic checks for DS and ZONEMD digests (#205).
Support registering a callback for $INCLUDE entries
(#229).
Add tls-supported-groups SvcParam support.
Check iana registries for unimplemented (new) RR types and
SvcParamKeys.
Add support for NINFO, RKEY, RESINFO, WALLET, CLA and TA RR types.
BUG FIXES:

Prepend -march to CFLAGS to fix architecture detection
(#372).
Fix propagation of implicit TTLs (#375).
Fix detection of Westmere architecture by checking for CLMUL too.
Fix compilation on NetBSD (#233).
Fix reading specialized symbolic links (#380).
Assets
2
1 person reacted
NSD 4.10.1
Aug 2, 2024
@@k0ekk0ek k0ekk0ek
 NSD_4_10_1_REL
 b92327b
NSD 4.10.1
NSD 4.10.1

This release consists primarily of bug fixes.

@@bilias implemented mutual TLS authentication for zone transfers.
Please consult the nsd.conf manual for details on the newly introduced
configuration options tls-auth-port and tls-auth-xfr-only.

@@orlitzky provided integration for the OpenRC init system.

Version 4.10.0 was the first release to integrate simdzone. Build
issues on OpenBSD releases before 5.6, Gentoo and Solaris have been
reported and fixed. The fallback parser, used on systems that lack
SSE4.2 and AVX2 instruction sets, contained some bugs with regards
to state keeping and under certain circumstances a use after free
bug was encountered in buffer management.

4.10.1
FEATURES:

Merge #352 from orlitzky: contrib: add OpenRC service script, config
file, and tmpfiles entry.
Merge #337 from bilias: Mutual TLS-AUTH.
BUG FIXES:

Fix incorrect punctuation of log messages.
Fix for #317, document more text on pidfile permissions.
Fix #334: RFC8482 behavior documentation.
Fix for OpenSSL 3.0 deprecated functions.
Merge #341: Fix allow-query wording in nsd.conf.5.in.
Fix test script from making spurious output.
Fix cpu_affinity and socket_partitioning tests for --enable-log-role.
Fix #344: Update simdzone.
Fix #347: Adjust verbosity for TLS (+TCP) to be 5.
Merge #348: Move TLS logging to verbosity level 5.
For #347: Also adjust verbosity of log message for remaining TCP connections.
Merge #349: log file name before loading.
Use MAKE variable rather than make command directly in Makefile.
Serialize WKS RRs using numeric values rather than names.
Fix propagation of Makefile targets to simdzone.
Do not log ACL mismatch on followed CNAMEs.
Fix link of xfr-inspect for libssl dependency.
Initialize tls_auth_port and tls_auth_xfr_only options.
Merge #358: Fix Hurd build error due to log_err.
Update simdzone to fix detection of AVX2 support.
simdzone 0.1.1
FEATURES:

Test to verify configure.ac and Makefile.in are correct.
Add support for reading from stdin if filename is "-".
Add support for building with Oracle Developer Studio 12.6.
Add support for "time" service for Well-Know Services (WKS) RR.
BUG FIXES:

Fix makefile dependencies.
Fix makefile to use source directory for build dependencies.
Fix changelog to reflect v0.1.0 release.
Update makefile to not use target-specific variables.
Fix makefile clean targets.
Fix state keeping in fallback scanner for contiguous and quoted.
Fix bug in name scanner.
Fix type mnemonic parsing in fallback parser.
Fix endian.h to include machine/endian.h on OpenBSD releases before 5.6.
Fix use after free on buffer resize.
Fix parsing of numeric protocols in WKS RRs.
Make devclean target depend on realclean target.
Fix detection of AVX2 support by checking generic AVX support by
the processor and operating system (#222).
CHANGES:

Make relative includes relative to current working directory.
Split Autoconf and CMake compiler tests for supported SIMD instructions.
Contributors
@@orlitzky
@@bilias
orlitzky and bilias
Assets
2
NSD 4.10.1rc2
Jul 23, 2024
@@k0ekk0ek k0ekk0ek
 NSD_4_10_1_RC2
 f0bb464
NSD 4.10.1rc2 Pre-release
NSD 4.10.1rc2

This release consists primarily of bug fixes.

@@bilias implemented mutual TLS authentication for zone transfers. Please
consult the nsd.conf manual for details on the newly introduced configuration
options tls-auth-port and tls-auth-xfr-only.

@@orlitzky provided integration for the OpenRC init system.

Version 4.10.0 was the first release to integrate simdzone. Build issues on
OpenBSD releases before 5.6, Gentoo and Solaris have been reported and fixed.
The fallback parser, used on systems that lack SSE4.2 and AVX2 instruction
sets, contained some bugs with regards to state keeping and under certain
circumstances a use after free bug was encountered in buffer management.

4.10.1
FEATURES:

Merge #352 from orlitzky: contrib: add OpenRC service script, config
file, and tmpfiles entry.
Merge #337 from bilias: Mutual TLS-AUTH.
BUG FIXES:

Fix incorrect punctuation of log messages.
Fix for #317, document more text on pidfile permissions.
Fix #334: RFC8482 behavior documentation.
Fix for OpenSSL 3.0 deprecated functions.
Merge #341: Fix allow-query wording in nsd.conf.5.in.
Fix test script from making spurious output.
Fix cpu_affinity and socket_partitioning tests for --enable-log-role.
Fix #344: Update simdzone.
Fix #347: Adjust verbosity for TLS (+TCP) to be 5.
Merge #348: Move TLS logging to verbosity level 5.
For #347: Also adjust verbosity of log message for remaining TCP
connections.
Merge #349: log file name before loading.
Use MAKE variable rather than make command directly in Makefile.
Serialize WKS RRs using numeric values rather than names.
Fix propagation of Makefile targets to simdzone
Do not log ACL mismatch on followed CNAMEs.
simdzone 0.1.1
FEATURES:

Test to verify configure.ac and Makefile.in are correct.
Add support for reading from stdin if filename is "-".
Add support for building with Oracle Developer Studio 12.6.
Add support for "time" service for Well-Know Services (WKS) RR.
BUG FIXES:

Fix makefile dependencies.
Fix makefile to use source directory for build dependencies.
Fix changelog to reflect v0.1.0 release.
Update makefile to not use target-specific variables.
Fix makefile clean targets.
Fix state keeping in fallback scanner for contiguous and quoted.
Fix bug in name scanner.
Fix type mnemonic parsing in fallback parser.
Fix endian.h to include machine/endian.h on OpenBSD releases before 5.6.
Fix use after free on buffer resize.
CHANGES:

Make relative includes relative to current working directory.

NSD 4.10.1rc1 Pre-release
NSD 4.10.1rc1

This release consists primarily of bug fixes.

@@bilias implemented mutual TLS authentication for zone transfers. Please
consult the nsd.conf manual for details on the newly introduced configuration
options tls-auth-port and tls-auth-xfr-only.

@@orlitzky provided integration for the OpenRC init system.

Version 4.10.0 was the first release to integrate simdzone. Build issues on
OpenBSD releases before 5.6, Gentoo and Solaris have been reported and fixed.
The fallback parser, used on systems that lack SSE4.2 and AVX2 instruction
sets, contained some bugs with regards to state keeping and under certain
circumstances a use after free bug was encountered in buffer management.

4.10.1
FEATURES:

Merge #352 from orlitzky: contrib: add OpenRC service script, config
file, and tmpfiles entry.
Merge #337 from bilias: Mutual TLS-AUTH.
BUG FIXES:

Fix incorrect punctuation of log messages.
Fix for #317, document more text on pidfile permissions.
Fix #334: RFC8482 behavior documentation.
Fix for OpenSSL 3.0 deprecated functions.
Merge #341: Fix allow-query wording in nsd.conf.5.in.
Fix test script from making spurious output.
Fix cpu_affinity and socket_partitioning tests for --enable-log-role.
Fix #344: Update simdzone.
Fix #347: Adjust verbosity for TLS (+TCP) to be 5.
Merge #348: Move TLS logging to verbosity level 5.
For #347: Also adjust verbosity of log message for remaining TCP
connections.
Merge #349: log file name before loading.
Use MAKE variable rather than make command directly in Makefile.
Serialize WKS RRs using numeric values rather than names.
Fix propagation of Makefile targets to simdzone
Do not log ACL mismatch on followed CNAMEs.
simdzone 0.1.1
FEATURES:

Test to verify configure.ac and Makefile.in are correct.
Add support for reading from stdin if filename is "-".
Add support for building with Oracle Developer Studio 12.6.
Add support for "time" service for Well-Know Services (WKS) RR.
BUG FIXES:

Fix makefile dependencies.
Fix makefile to use source directory for build dependencies.
Fix changelog to reflect v0.1.0 release.
Update makefile to not use target-specific variables.
Fix makefile clean targets.
Fix state keeping in fallback scanner for contiguous and quoted.
Fix bug in name scanner.
Fix type mnemonic parsing in fallback parser.
Fix endian.h to include machine/endian.h on OpenBSD releases before 5.6.
Fix use after free on buffer resize.
CHANGES:

Make relative includes relative to current working directory.
Contributors
@@orlitzky
@@bilias
orlitzky and bilias
Assets
2
NSD 4.10.0
Jun 13, 2024
@@wcawijngaards wcawijngaards
 NSD_4_10_0_REL
 d69dc13
NSD 4.10.0
NSD 4.10.0

Version 4.10.0 integrates simdzone and drops the Flex+Bison zone
parser.

NSD used a Flex+Bison based zone parser since version 1.4.0. The parser
served NSD well, but zones have increased in size and zone loading
performance has been problematic for some users.

With the integration of simdzone
(https://github.com/NLnetLabs/simdzone),
performance of loading zones and IXFRs is drastically improved. Quick
measurements show improvements ranging anywhere from 3.8x to 1.6x,
depending on zone size and database type, though the improvements will
be less noticable for NSEC3 zones due to pre-hashing.

simdzone leverages SIMD instructions in modern CPUs to improve
throughput. Right now SSE4.2 and AVX2 instruction sets are supported,
other instruction sets will use the fallback implementation, which
still is a decent improvement over the Flex+Bison based parser.

The release has additional fixes from the release candidate. The
parse of lowercase type names is fixed and the x86_64 variable is
set to no for other machines.

4.10.0
FEATURES:

Merge #278: Replace Flex+Bison based zone parser with simdzone.
Performance of loading zones and IXFRs is greatly improved by using
the simdzone project by NLnet Labs. The optimized presentation
format parser leverages SIMD instructions in modern CPUs to improve
throughput. Right now SSE4.2 and AVX2 instruction sets are
supported, other instruction sets will use the fallback
implementation, which still is a decent improvement over the
Flex+Bison based parser.
BUG FIXES:

Fix that when the server truncates the pidfile, it does not follow
symbolic links.
Fix #317: nsd should not chown its PID file.
For #317: Modify nsd service script to stop NSD from creating a pid
file that systemd is not using.
Fix #324: Clarify the purpose of contrib/bug390.patch.
Fix IXFR requests upstream for zones with a long name. Thanks for the
report to Yuuki Wakisaka from Internet Initiative Japan Inc.
Unit test for dname subdomain test used by xfrd-tcp.c.
Fix #329: TCP accept queues number.
Fix that the reload handler for sigchild uses signal_add, and also
that the signal handler is restored when done.
Fix that when server verify is done it resets the sigchild handler.
Fix makedist.sh for simdzone inclusion.
Fix makedist.sh to remove simdzone git tracking information and
scripting temporaries from tarball.
Fix error output of makedist.sh.
Use simdzone version with name parser fix.
Bump simdzone version to fix OpenBSD build issues.
Bump simdzone to include minor fixes.
Assets
2
NSD_4_10_0_RC1
Apr 25, 2024
@@k0ekk0ek k0ekk0ek
 NSD_4_10_0_RC1
 f6a7922
NSD_4_10_0_RC1 Pre-release
NSD 4.10.0rc1 is available:

Version 4.10.0 integrates simdzone and drops the Flex+Bison zone parser.

NSD used a Flex+Bison based zone parser since version 1.4.0. The parser served
NSD well, but zones have increased in size and zone loading performance has
been problematic for some users.

With the integration of simdzone (https://github.com/NLnetLabs/simdzone),
performance of loading zones and IXFRs is drastically improved. Quick
measurements show improvements ranging anywhere from 3.8x to 1.6x depending
on zone size and database type, though the improvements will be less noticable
for NSEC3 zones due to pre-hashing.

simdzone leverages SIMD instructions in modern CPUs to improve throughput.
Right now SSE4.2 and AVX2 instruction sets are supported, other instruction
sets will use the fallback implementation, which still is a decent improvement
over the Flex+Bison based parser.

The release candidate window will be longer this time as simdzone is rather
new and while it has been tested on various architectures and operating
systems, it is likely problems will pop-up due to sheer amount of code. Please
consider giving this release candidate a good run and report any problems.

4.10.0
FEATURES:

Merge #278: Replace Flex+Bison based zone parser with simdzone.
Performance of loading zones and IXFRs is greatly improved by using
the simdzone project by NLnet Labs. The optimized presentation format
parser leverages SIMD instructions in modern CPUs to improve throughput.
Right now SSE4.2 and AVX2 instruction sets are supported, other
instruction sets will use the fallback implementation, which still is
a decent improvement over the Flex+Bison based parser.
BUG FIXES:

Fix that when the server truncates the pidfile, it does not follow
symbolic links.
Fix #317: nsd should not chown its PID file.
For #317: Modify nsd service script to stop NSD from creating a
pid file that systemd is not using.
Fix #324: Clarify the purpose of contrib/bug390.patch.
Fix IXFR requests upstream for zones with a long name. Thanks for
the report to Yuuki Wakisaka from Internet Initiative Japan Inc.
Unit test for dname subdomain test used by xfrd-tcp.c.
Fix #329: TCP accept queues number.
Fix that the reload handler for sigchild uses signal_add, and
also that the signal handler is restored when done.
Fix that when server verify is done it resets the sigchild handler.
Fix makedist.sh for simdzone inclusion.
Fix makedist.sh to remove simdzone git tracking information and
scripting temporaries from tarball.
Fix error output of makedist.sh.
Use simdzone version with name parser fix.
Bump simdzone version to fix OpenBSD build issues.
Assets
2
NSD 4.9.1
Apr 4, 2024
@@k0ekk0ek k0ekk0ek
 NSD_4_9_1_REL
 07119e9
NSD 4.9.1
NSD 4.9.1

This release fixes the builds scripts in the release of version 4.9.0.

Version 4.9.0 adds support for DNS Catalog Zones (RFC 9432) version "2".

Both producer and consumer roles for catalog zones are implemented, but
only a single consumer zone is allowed. The "coo" property, relevant
when multiple consumer zones can be configured, is therefore not
supported. The "group" property is. Consult the nsd.conf man page for
details on how to configure and use catalog zones.

Thanks to Fredrik Pettai from Sunet for providing feedback and testing
DNS Catalog Zones.

4.9.1
BUG FIXES:

Use rooted temporary path in makedist.sh.
Assets
2
NSD 4.9.0
Apr 3, 2024
@@k0ekk0ek k0ekk0ek
 NSD_4_9_0_REL
 9373228
NSD 4.9.0
NSD 4.9.0

This release adds support for DNS Catalog Zones (RFC 9432) version "2".

Both producer and consumer roles for catalog zones are implemented, but
only a single consumer zone is allowed. The "coo" property, relevant
when multiple consumer zones can be configured, is therefore not
supported. The "group" property is. Consult the nsd.conf man page for
details on how to configure and use catalog zones.

Thanks to Fredrik Pettai from Sunet for providing feedback and testing
DNS Catalog Zones.

4.9.0
FEATURES:

Merge #315: Allow SOA apex queries to otherwise with allow-query
protected zones for clients matching a provide-xfr rule, because
clients that are allowed to transfer the zone need to be able to
query SOA at the apex preceding the actual transfer.
Merge #304: Support for Catalog zones version "2" as specified in
RFC 9432. Both the consumer as well as the producer role are
implemented, but only a single catalog consumer zone is allowed.
The "coo" property, only relevant with multiple catalog consumer,
is therefore not supported. The "group" property is supported.
Have a look at the nsd.conf man page for details on how to
configure and use catalog zones.
BUG FIXES:

Fix to sync the tests script file common.sh.
Update test script file common.sh.
Fix #306: Missing AC_SUBST(dbdir) breaks installation with 4.8.0.
Fix for #306: Create directory for xfrd.state and zone.list files
in make install.
Merge #307 from anandb-ripencc: Many improvements to the nsd.conf
man page.
Fix #308: Deprecate "multi-master-check" in favour of
"multi-primary-check".
Merge #309: More RFC 8499 compliance.
Fix control-reconfig-xfrd test for zonestatus primary that is
printed by nsd-control zonestatus.
Move acx_nlnetlabs.m4 to version 47, with crypt32 check.
Move acx_nlnetlabs.m4 to version 48, with ssp and getaddrinfo
include check.
Fix #313: nsd 4.8 stats with implausible spikes.
Fix compile with memclean for xfrd nsd.db close.
In xfrd del secondary zone, the timer could perhaps have
event_added, and if so, it would not be event_del if a tcp
connection is active at the time. This could cause the libevent
event lists to fail. Also fix to make sure to set event_added for
the nsd-control ssl nonblocking handshake and check event_added
there too, for extra certainty.
Merge #316: Fix to reap defunct children by the reload process that
emerged when some serve child processes were still serving TCP
request while the others had already quit, while the reload process
was waiting for the signal from the backup/old main process that all
children exited.
Fix (also from Merge #316) to reap exited children more frequently
from server main loop for processes that exited during reload, but
missed the initial reaping at start of the main loop because they
took somewhat longer to exit.
Fix timing sensitivity in ixfr_outsync test.
Test if debug is available in do-tests.
Enforce timeout from NSD in ixfr_gone test.
Update expressions in ixfr_and_restart test.
Make algorithm explicit in control-repattern test.
Switch algorithm to hmac-256 for testplan_mess test.
Replace multiple strcat and strcpy by snprintf.
Assets
2
1 person reacted
NSD 4.8.0
Dec 6, 2023
@@wcawijngaards wcawijngaards
 NSD_4_8_0_REL
 f96f83f
@
text
@d3 1
a3 1
#   Copyright 1992-2023 Free Software Foundation, Inc.
d5 1
a5 3
# shellcheck disable=SC2006,SC2268 # see below for rationale

timestamp='2023-09-19'
d9 1
a9 1
# the Free Software Foundation, either version 3 of the License, or
d18 1
a18 1
# along with this program; if not, see <https://www.gnu.org/licenses/>.
d36 1
a36 1
# https://git.savannah.gnu.org/cgit/config.git/plain/config.sub
a52 7
# The "shellcheck disable" line above the timestamp inhibits complaints
# about features and limitations of the classic Bourne shell that were
# superseded or lifted in POSIX.  However, this script identifies a wide
# variety of pre-POSIX systems that do not have POSIX shells at all, and
# even some reasonably current systems (Solaris 10 as case-in-point) still
# have a pre-POSIX /bin/sh.

d60 1
a60 1
Options:
d70 1
a70 1
Copyright 1992-2023 Free Software Foundation, Inc.
d76 1
a76 1
Try '$me --help' for more information."
d92 1
a92 1
       echo "$me: invalid option $1$help" >&2
d97 1
a97 1
       echo "$1"
d113 115
a227 13
# Split fields of configuration type
# shellcheck disable=SC2162
saved_IFS=$IFS
IFS="-" read field1 field2 field3 field4 <<EOF
$1
EOF
IFS=$saved_IFS

# Separate into logical components for further validation
case $1 in
	*-*-*-*-*)
		echo "Invalid configuration '$1': more than four components" >&2
		exit 1
d229 2
a230 3
	*-*-*-*)
		basic_machine=$field1-$field2
		basic_os=$field3-$field4
d232 2
a233 22
	*-*-*)
		# Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two
		# parts
		maybe_os=$field2-$field3
		case $maybe_os in
			nto-qnx* | linux-* | uclinux-uclibc* \
			| uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \
			| netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \
			| storm-chaos* | os2-emx* | rtmk-nova* | managarm-* \
			| windows-* )
				basic_machine=$field1
				basic_os=$maybe_os
				;;
			android-linux)
				basic_machine=$field1-unknown
				basic_os=linux-android
				;;
			*)
				basic_machine=$field1-$field2
				basic_os=$field3
				;;
		esac
d235 2
a236 39
	*-*)
		# A lone config we happen to match not fitting any pattern
		case $field1-$field2 in
			decstation-3100)
				basic_machine=mips-dec
				basic_os=
				;;
			*-*)
				# Second component is usually, but not always the OS
				case $field2 in
					# Prevent following clause from handling this valid os
					sun*os*)
						basic_machine=$field1
						basic_os=$field2
						;;
					zephyr*)
						basic_machine=$field1-unknown
						basic_os=$field2
						;;
					# Manufacturers
					dec* | mips* | sequent* | encore* | pc533* | sgi* | sony* \
					| att* | 7300* | 3300* | delta* | motorola* | sun[234]* \
					| unicom* | ibm* | next | hp | isi* | apollo | altos* \
					| convergent* | ncr* | news | 32* | 3600* | 3100* \
					| hitachi* | c[123]* | convex* | sun | crds | omron* | dg \
					| ultra | tti* | harris | dolphin | highlevel | gould \
					| cbm | ns | masscomp | apple | axis | knuth | cray \
					| microblaze* | sim | cisco \
					| oki | wec | wrs | winbond)
						basic_machine=$field1-$field2
						basic_os=
						;;
					*)
						basic_machine=$field1
						basic_os=$field2
						;;
				esac
			;;
		esac
d238 3
a240 453
	*)
		# Convert single-component short-hands not valid as part of
		# multi-component configurations.
		case $field1 in
			386bsd)
				basic_machine=i386-pc
				basic_os=bsd
				;;
			a29khif)
				basic_machine=a29k-amd
				basic_os=udi
				;;
			adobe68k)
				basic_machine=m68010-adobe
				basic_os=scout
				;;
			alliant)
				basic_machine=fx80-alliant
				basic_os=
				;;
			altos | altos3068)
				basic_machine=m68k-altos
				basic_os=
				;;
			am29k)
				basic_machine=a29k-none
				basic_os=bsd
				;;
			amdahl)
				basic_machine=580-amdahl
				basic_os=sysv
				;;
			amiga)
				basic_machine=m68k-unknown
				basic_os=
				;;
			amigaos | amigados)
				basic_machine=m68k-unknown
				basic_os=amigaos
				;;
			amigaunix | amix)
				basic_machine=m68k-unknown
				basic_os=sysv4
				;;
			apollo68)
				basic_machine=m68k-apollo
				basic_os=sysv
				;;
			apollo68bsd)
				basic_machine=m68k-apollo
				basic_os=bsd
				;;
			aros)
				basic_machine=i386-pc
				basic_os=aros
				;;
			aux)
				basic_machine=m68k-apple
				basic_os=aux
				;;
			balance)
				basic_machine=ns32k-sequent
				basic_os=dynix
				;;
			blackfin)
				basic_machine=bfin-unknown
				basic_os=linux
				;;
			cegcc)
				basic_machine=arm-unknown
				basic_os=cegcc
				;;
			convex-c1)
				basic_machine=c1-convex
				basic_os=bsd
				;;
			convex-c2)
				basic_machine=c2-convex
				basic_os=bsd
				;;
			convex-c32)
				basic_machine=c32-convex
				basic_os=bsd
				;;
			convex-c34)
				basic_machine=c34-convex
				basic_os=bsd
				;;
			convex-c38)
				basic_machine=c38-convex
				basic_os=bsd
				;;
			cray)
				basic_machine=j90-cray
				basic_os=unicos
				;;
			crds | unos)
				basic_machine=m68k-crds
				basic_os=
				;;
			da30)
				basic_machine=m68k-da30
				basic_os=
				;;
			decstation | pmax | pmin | dec3100 | decstatn)
				basic_machine=mips-dec
				basic_os=
				;;
			delta88)
				basic_machine=m88k-motorola
				basic_os=sysv3
				;;
			dicos)
				basic_machine=i686-pc
				basic_os=dicos
				;;
			djgpp)
				basic_machine=i586-pc
				basic_os=msdosdjgpp
				;;
			ebmon29k)
				basic_machine=a29k-amd
				basic_os=ebmon
				;;
			es1800 | OSE68k | ose68k | ose | OSE)
				basic_machine=m68k-ericsson
				basic_os=ose
				;;
			gmicro)
				basic_machine=tron-gmicro
				basic_os=sysv
				;;
			go32)
				basic_machine=i386-pc
				basic_os=go32
				;;
			h8300hms)
				basic_machine=h8300-hitachi
				basic_os=hms
				;;
			h8300xray)
				basic_machine=h8300-hitachi
				basic_os=xray
				;;
			h8500hms)
				basic_machine=h8500-hitachi
				basic_os=hms
				;;
			harris)
				basic_machine=m88k-harris
				basic_os=sysv3
				;;
			hp300 | hp300hpux)
				basic_machine=m68k-hp
				basic_os=hpux
				;;
			hp300bsd)
				basic_machine=m68k-hp
				basic_os=bsd
				;;
			hppaosf)
				basic_machine=hppa1.1-hp
				basic_os=osf
				;;
			hppro)
				basic_machine=hppa1.1-hp
				basic_os=proelf
				;;
			i386mach)
				basic_machine=i386-mach
				basic_os=mach
				;;
			isi68 | isi)
				basic_machine=m68k-isi
				basic_os=sysv
				;;
			m68knommu)
				basic_machine=m68k-unknown
				basic_os=linux
				;;
			magnum | m3230)
				basic_machine=mips-mips
				basic_os=sysv
				;;
			merlin)
				basic_machine=ns32k-utek
				basic_os=sysv
				;;
			mingw64)
				basic_machine=x86_64-pc
				basic_os=mingw64
				;;
			mingw32)
				basic_machine=i686-pc
				basic_os=mingw32
				;;
			mingw32ce)
				basic_machine=arm-unknown
				basic_os=mingw32ce
				;;
			monitor)
				basic_machine=m68k-rom68k
				basic_os=coff
				;;
			morphos)
				basic_machine=powerpc-unknown
				basic_os=morphos
				;;
			moxiebox)
				basic_machine=moxie-unknown
				basic_os=moxiebox
				;;
			msdos)
				basic_machine=i386-pc
				basic_os=msdos
				;;
			msys)
				basic_machine=i686-pc
				basic_os=msys
				;;
			mvs)
				basic_machine=i370-ibm
				basic_os=mvs
				;;
			nacl)
				basic_machine=le32-unknown
				basic_os=nacl
				;;
			ncr3000)
				basic_machine=i486-ncr
				basic_os=sysv4
				;;
			netbsd386)
				basic_machine=i386-pc
				basic_os=netbsd
				;;
			netwinder)
				basic_machine=armv4l-rebel
				basic_os=linux
				;;
			news | news700 | news800 | news900)
				basic_machine=m68k-sony
				basic_os=newsos
				;;
			news1000)
				basic_machine=m68030-sony
				basic_os=newsos
				;;
			necv70)
				basic_machine=v70-nec
				basic_os=sysv
				;;
			nh3000)
				basic_machine=m68k-harris
				basic_os=cxux
				;;
			nh[45]000)
				basic_machine=m88k-harris
				basic_os=cxux
				;;
			nindy960)
				basic_machine=i960-intel
				basic_os=nindy
				;;
			mon960)
				basic_machine=i960-intel
				basic_os=mon960
				;;
			nonstopux)
				basic_machine=mips-compaq
				basic_os=nonstopux
				;;
			os400)
				basic_machine=powerpc-ibm
				basic_os=os400
				;;
			OSE68000 | ose68000)
				basic_machine=m68000-ericsson
				basic_os=ose
				;;
			os68k)
				basic_machine=m68k-none
				basic_os=os68k
				;;
			paragon)
				basic_machine=i860-intel
				basic_os=osf
				;;
			parisc)
				basic_machine=hppa-unknown
				basic_os=linux
				;;
			psp)
				basic_machine=mipsallegrexel-sony
				basic_os=psp
				;;
			pw32)
				basic_machine=i586-unknown
				basic_os=pw32
				;;
			rdos | rdos64)
				basic_machine=x86_64-pc
				basic_os=rdos
				;;
			rdos32)
				basic_machine=i386-pc
				basic_os=rdos
				;;
			rom68k)
				basic_machine=m68k-rom68k
				basic_os=coff
				;;
			sa29200)
				basic_machine=a29k-amd
				basic_os=udi
				;;
			sei)
				basic_machine=mips-sei
				basic_os=seiux
				;;
			sequent)
				basic_machine=i386-sequent
				basic_os=
				;;
			sps7)
				basic_machine=m68k-bull
				basic_os=sysv2
				;;
			st2000)
				basic_machine=m68k-tandem
				basic_os=
				;;
			stratus)
				basic_machine=i860-stratus
				basic_os=sysv4
				;;
			sun2)
				basic_machine=m68000-sun
				basic_os=
				;;
			sun2os3)
				basic_machine=m68000-sun
				basic_os=sunos3
				;;
			sun2os4)
				basic_machine=m68000-sun
				basic_os=sunos4
				;;
			sun3)
				basic_machine=m68k-sun
				basic_os=
				;;
			sun3os3)
				basic_machine=m68k-sun
				basic_os=sunos3
				;;
			sun3os4)
				basic_machine=m68k-sun
				basic_os=sunos4
				;;
			sun4)
				basic_machine=sparc-sun
				basic_os=
				;;
			sun4os3)
				basic_machine=sparc-sun
				basic_os=sunos3
				;;
			sun4os4)
				basic_machine=sparc-sun
				basic_os=sunos4
				;;
			sun4sol2)
				basic_machine=sparc-sun
				basic_os=solaris2
				;;
			sun386 | sun386i | roadrunner)
				basic_machine=i386-sun
				basic_os=
				;;
			sv1)
				basic_machine=sv1-cray
				basic_os=unicos
				;;
			symmetry)
				basic_machine=i386-sequent
				basic_os=dynix
				;;
			t3e)
				basic_machine=alphaev5-cray
				basic_os=unicos
				;;
			t90)
				basic_machine=t90-cray
				basic_os=unicos
				;;
			toad1)
				basic_machine=pdp10-xkl
				basic_os=tops20
				;;
			tpf)
				basic_machine=s390x-ibm
				basic_os=tpf
				;;
			udi29k)
				basic_machine=a29k-amd
				basic_os=udi
				;;
			ultra3)
				basic_machine=a29k-nyu
				basic_os=sym1
				;;
			v810 | necv810)
				basic_machine=v810-nec
				basic_os=none
				;;
			vaxv)
				basic_machine=vax-dec
				basic_os=sysv
				;;
			vms)
				basic_machine=vax-dec
				basic_os=vms
				;;
			vsta)
				basic_machine=i386-pc
				basic_os=vsta
				;;
			vxworks960)
				basic_machine=i960-wrs
				basic_os=vxworks
				;;
			vxworks68)
				basic_machine=m68k-wrs
				basic_os=vxworks
				;;
			vxworks29k)
				basic_machine=a29k-wrs
				basic_os=vxworks
				;;
			xbox)
				basic_machine=i686-pc
				basic_os=mingw32
				;;
			ymp)
				basic_machine=ymp-cray
				basic_os=unicos
				;;
			*)
				basic_machine=$1
				basic_os=
				;;
		esac
d244 1
a244 1
# Decode 1-component or ad-hoc basic machines
d246 92
a337 5
	# Here we handle the default manufacturer of certain CPU types.  It is in
	# some cases the only manufacturer, in others, it is the most popular.
	w89k)
		cpu=hppa1.1
		vendor=winbond
d339 1
a339 3
	op50n)
		cpu=hppa1.1
		vendor=oki
d341 2
a342 3
	op60c)
		cpu=hppa1.1
		vendor=oki
d344 3
a346 3
	ibm*)
		cpu=i370
		vendor=ibm
d348 3
a350 3
	orion105)
		cpu=clipper
		vendor=highlevel
d352 2
a353 3
	mac | mpw | mac-mpw)
		cpu=m68k
		vendor=apple
d355 3
a357 3
	pmac | pmac-mpw)
		cpu=powerpc
		vendor=apple
d360 99
d461 4
d466 1
a466 2
		cpu=m68000
		vendor=att
d469 74
a542 2
		cpu=we32k
		vendor=att
d545 70
a614 3
		cpu=powerpc
		vendor=ibm
		basic_os=cnk
d617 2
a618 3
		cpu=pdp10
		vendor=dec
		basic_os=tops10
d621 2
a622 3
		cpu=pdp10
		vendor=dec
		basic_os=tops20
d626 33
a658 2
		cpu=m68k
		vendor=motorola
d660 3
a662 4
	dpx2*)
		cpu=m68k
		vendor=bull
		basic_os=sysv3
d665 1
a665 2
		cpu=ns32k
		vendor=encore
d667 3
a669 4
	elxsi)
		cpu=elxsi
		vendor=elxsi
		basic_os=${basic_os:-bsd}
d672 1
a672 2
		cpu=i860
		vendor=alliant
d675 9
a683 2
		cpu=ns32k
		vendor=ns
d686 29
a714 3
		cpu=hppa1.1
		vendor=hitachi
		basic_os=hiuxwe2
d717 1
a717 2
		cpu=hppa1.0
		vendor=hp
d720 1
a720 2
		cpu=m68000
		vendor=hp
d723 1
a723 2
		cpu=m68k
		vendor=hp
d726 1
a726 2
		cpu=hppa1.0
		vendor=hp
d729 1
a729 2
		cpu=hppa1.1
		vendor=hp
d733 1
a733 2
		cpu=hppa1.1
		vendor=hp
d737 1
a737 2
		cpu=hppa1.1
		vendor=hp
d740 1
a740 2
		cpu=hppa1.1
		vendor=hp
d743 15
a757 2
		cpu=hppa1.0
		vendor=hp
d760 2
a761 3
		cpu=`echo "$1" | sed -e 's/86.*/86/'`
		vendor=pc
		basic_os=sysv32
d764 2
a765 3
		cpu=`echo "$1" | sed -e 's/86.*/86/'`
		vendor=pc
		basic_os=sysv4
d768 2
a769 3
		cpu=`echo "$1" | sed -e 's/86.*/86/'`
		vendor=pc
		basic_os=sysv
d772 10
a781 8
		cpu=`echo "$1" | sed -e 's/86.*/86/'`
		vendor=pc
		basic_os=solaris2
		;;
	j90 | j90-cray)
		cpu=j90
		vendor=cray
		basic_os=${basic_os:-unicos}
d784 3
a786 4
		cpu=mips
		vendor=sgi
		case $basic_os in
		    irix*)
d789 1
a789 1
			basic_os=irix4
d793 41
d835 11
a845 2
		cpu=m68000
		vendor=convergent
d847 50
a896 4
	*mint | mint[0-9]* | *MiNT | *MiNT[0-9]*)
		cpu=m68k
		vendor=atari
		basic_os=mint
d899 11
a909 11
		cpu=mips
		vendor=sony
		basic_os=newsos
		;;
	next | m*-next)
		cpu=m68k
		vendor=next
		case $basic_os in
		    openstep*)
		        ;;
		    nextstep*)
d911 2
a912 2
		    ns2*)
		      basic_os=nextstep2
d915 1
a915 1
		      basic_os=nextstep3
d919 20
d940 10
a949 2
		cpu=np1
		vendor=gould
d952 17
a968 3
		cpu=hppa1.1
		vendor=oki
		basic_os=proelf
d971 14
a984 3
		cpu=hppa1.1
		vendor=hitachi
		basic_os=hiuxwe2
d987 1
a987 2
		cpu=sparc
		vendor=tti
d990 10
a999 2
		cpu=m68k
		vendor=tti
d1001 2
a1002 3
	pc532)
		cpu=ns32k
		vendor=pc532
d1004 5
a1008 3
	pn)
		cpu=pn
		vendor=gould
d1010 2
a1011 3
	power)
		cpu=power
		vendor=ibm
d1013 2
a1014 3
	ps2)
		cpu=i386
		vendor=ibm
d1016 2
a1017 3
	rm[46]00)
		cpu=mips
		vendor=siemens
d1019 2
a1020 3
	rtpc | rtpc-*)
		cpu=romp
		vendor=ibm
d1022 2
a1023 9
	sde)
		cpu=mipsisa32
		vendor=sde
		basic_os=${basic_os:-elf}
		;;
	simso-wrs)
		cpu=sparclite
		vendor=wrs
		basic_os=vxworks
d1025 2
a1026 3
	tower | tower-32)
		cpu=m68k
		vendor=ncr
d1028 1
a1028 3
	vpp*|vx|vx-*)
		cpu=f301
		vendor=fujitsu
d1030 1
a1030 3
	w65)
		cpu=w65
		vendor=wdc
d1032 2
a1033 4
	w89k-*)
		cpu=hppa1.1
		vendor=winbond
		basic_os=proelf
d1035 2
a1036 3
	none)
		cpu=none
		vendor=none
d1038 2
a1039 3
	leon|leon[3-9])
		cpu=sparc
		vendor=$basic_machine
d1041 1
a1041 3
	leon-*|leon[3-9]-*)
		cpu=sparc
		vendor=`echo "$basic_machine" | sed 's/-.*//'`
d1043 1
a1043 8

	*-*)
		# shellcheck disable=SC2162
		saved_IFS=$IFS
		IFS="-" read cpu vendor <<EOF
$basic_machine
EOF
		IFS=$saved_IFS
d1045 2
a1046 6
	# We use 'pc' rather than 'unknown'
	# because (1) that's what they normally are, and
	# (2) the word "unknown" tends to confuse beginning users.
	i*86 | x86_64)
		cpu=$basic_machine
		vendor=pc
d1048 2
a1049 5
	# These rules are duplicated from below for sake of the special case above;
	# i.e. things that normalized to x86 arches should also default to "pc"
	pc98)
		cpu=i386
		vendor=pc
d1051 2
a1052 3
	x64 | amd64)
		cpu=x86_64
		vendor=pc
d1054 15
a1068 4
	# Recognize the basic CPU types without company name.
	*)
		cpu=$basic_machine
		vendor=unknown
d1070 2
a1071 11
esac

unset -v basic_machine

# Decode basic machines in the full and proper CPU-Company form.
case $cpu-$vendor in
	# Here we handle the default manufacturer of certain CPU types in canonical form. It is in
	# some cases the only manufacturer, in others, it is the most popular.
	craynv-unknown)
		vendor=cray
		basic_os=${basic_os:-unicosmp}
d1073 2
a1074 3
	c90-unknown | c90-cray)
		vendor=cray
		basic_os=${Basic_os:-unicos}
d1076 2
a1077 2
	fx80-unknown)
		vendor=alliant
d1079 2
a1080 2
	romp-unknown)
		vendor=ibm
d1082 3
a1084 2
	mmix-unknown)
		vendor=knuth
d1086 2
a1087 2
	microblaze-unknown | microblazeel-unknown)
		vendor=xilinx
d1089 2
a1090 2
	rs6000-unknown)
		vendor=ibm
d1092 3
a1094 2
	vax-unknown)
		vendor=dec
d1096 3
a1098 2
	pdp11-unknown)
		vendor=dec
d1100 2
a1101 2
	we32k-unknown)
		vendor=att
d1103 3
a1105 2
	cydra-unknown)
		vendor=cydrome
d1107 2
a1108 2
	i370-ibm*)
		vendor=ibm
d1110 2
a1111 2
	orion-unknown)
		vendor=highlevel
d1113 3
a1115 3
	xps-unknown | xps100-unknown)
		cpu=xps100
		vendor=honeywell
d1117 3
a1119 6

	# Here we normalize CPU types with a missing or matching vendor
	armh-unknown | armh-alt)
		cpu=armv7l
		vendor=alt
		basic_os=${basic_os:-linux-gnueabihf}
d1121 2
a1122 4
	dpx20-unknown | dpx20-bull)
		cpu=rs6000
		vendor=bull
		basic_os=${basic_os:-bosx}
d1124 2
a1125 4

	# Here we normalize CPU types irrespective of the vendor
	amd64-*)
		cpu=x86_64
d1127 3
a1129 3
	blackfin-*)
		cpu=bfin
		basic_os=linux
d1131 2
a1132 2
	c54x-*)
		cpu=tic54x
d1134 2
a1135 2
	c55x-*)
		cpu=tic55x
d1137 3
a1139 2
	c6x-*)
		cpu=tic6x
d1141 3
a1143 3
	e500v[12]-*)
		cpu=powerpc
		basic_os=${basic_os}"spe"
d1145 3
a1147 2
	mips3*-*)
		cpu=mips64
d1149 3
a1151 2
	ms1-*)
		cpu=mt
d1153 3
a1155 3
	m68knommu-*)
		cpu=m68k
		basic_os=linux
d1157 3
a1159 2
	m9s12z-* | m68hcs12z-* | hcs12z-* | s12z-*)
		cpu=s12z
d1161 3
a1163 2
	openrisc-*)
		cpu=or32
d1165 2
a1166 3
	parisc-*)
		cpu=hppa
		basic_os=linux
d1168 2
a1169 2
	pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
		cpu=i586
d1171 2
a1172 2
	pentiumpro-* | p6-* | 6x86-* | athlon-* | athlon_*-*)
		cpu=i686
d1174 3
a1176 2
	pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
		cpu=i686
d1178 3
a1180 2
	pentium4-*)
		cpu=i786
d1182 3
a1184 2
	pc98-*)
		cpu=i386
d1186 3
a1188 2
	ppc-* | ppcbe-*)
		cpu=powerpc
d1190 3
a1192 2
	ppcle-* | powerpclittle-*)
		cpu=powerpcle
d1194 2
a1195 2
	ppc64-*)
		cpu=powerpc64
d1197 2
a1198 2
	ppc64le-* | powerpc64little-*)
		cpu=powerpc64le
d1200 3
a1202 2
	sb1-*)
		cpu=mipsisa64sb1
d1204 2
a1205 2
	sb1el-*)
		cpu=mipsisa64sb1el
d1207 23
a1229 2
	sh5e[lb]-*)
		cpu=`echo "$cpu" | sed 's/^\(sh.\)e\(.\)$/\1\2e/'`
d1231 2
a1232 2
	spur-*)
		cpu=spur
d1234 15
a1248 2
	strongarm-* | thumb-*)
		cpu=arm
d1250 3
a1252 2
	tx39-*)
		cpu=mipstx39
d1254 3
a1256 2
	tx39el-*)
		cpu=mipstx39el
d1258 2
a1259 2
	x64-*)
		cpu=x86_64
d1262 1
a1262 1
		cpu=`echo "$cpu" | sed 's/^xscale/arm/'`
d1264 15
a1278 2
	arm64-* | aarch64le-*)
		cpu=aarch64
d1281 26
a1306 4
	# Recognize the canonical CPU Types that limit and/or modify the
	# company names they are paired with.
	cr16-*)
		basic_os=${basic_os:-elf}
d1308 2
a1309 3
	crisv32-* | etraxfs*-*)
		cpu=crisv32
		vendor=axis
d1311 2
a1312 3
	cris-* | etrax*-*)
		cpu=cris
		vendor=axis
d1314 2
a1315 2
	crx-*)
		basic_os=${basic_os:-elf}
d1317 8
a1324 3
	neo-tandem)
		cpu=neo
		vendor=tandem
d1326 2
a1327 3
	nse-tandem)
		cpu=nse
		vendor=tandem
d1329 2
a1330 3
	nsr-tandem)
		cpu=nsr
		vendor=tandem
d1332 2
a1333 11
	nsv-tandem)
		cpu=nsv
		vendor=tandem
		;;
	nsx-tandem)
		cpu=nsx
		vendor=tandem
		;;
	mipsallegrexel-sony)
		cpu=mipsallegrexel
		vendor=sony
d1335 2
a1336 2
	tile*-*)
		basic_os=${basic_os:-linux-gnu}
a1337 1

d1339 2
a1340 92
		# Recognize the canonical CPU types that are allowed with any
		# company name.
		case $cpu in
			1750a | 580 \
			| a29k \
			| aarch64 | aarch64_be | aarch64c | arm64ec \
			| abacus \
			| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] \
			| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] \
			| alphapca5[67] | alpha64pca5[67] \
			| am33_2.0 \
			| amdgcn \
			| arc | arceb | arc32 | arc64 \
			| arm | arm[lb]e | arme[lb] | armv* \
			| avr | avr32 \
			| asmjs \
			| ba \
			| be32 | be64 \
			| bfin | bpf | bs2000 \
			| c[123]* | c30 | [cjt]90 | c4x \
			| c8051 | clipper | craynv | csky | cydra \
			| d10v | d30v | dlx | dsp16xx \
			| e2k | elxsi | epiphany \
			| f30[01] | f700 | fido | fr30 | frv | ft32 | fx80 \
			| javascript \
			| h8300 | h8500 \
			| hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
			| hexagon \
			| i370 | i*86 | i860 | i960 | ia16 | ia64 \
			| ip2k | iq2000 \
			| k1om \
			| kvx \
			| le32 | le64 \
			| lm32 \
			| loongarch32 | loongarch64 \
			| m32c | m32r | m32rle \
			| m5200 | m68000 | m680[012346]0 | m68360 | m683?2 | m68k \
			| m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x \
			| m88110 | m88k | maxq | mb | mcore | mep | metag \
			| microblaze | microblazeel \
			| mips* \
			| mmix \
			| mn10200 | mn10300 \
			| moxie \
			| mt \
			| msp430 \
			| nds32 | nds32le | nds32be \
			| nfp \
			| nios | nios2 | nios2eb | nios2el \
			| none | np1 | ns16k | ns32k | nvptx \
			| open8 \
			| or1k* \
			| or32 \
			| orion \
			| picochip \
			| pdp10 | pdp11 | pj | pjl | pn | power \
			| powerpc | powerpc64 | powerpc64le | powerpcle | powerpcspe \
			| pru \
			| pyramid \
			| riscv | riscv32 | riscv32be | riscv64 | riscv64be \
			| rl78 | romp | rs6000 | rx \
			| s390 | s390x \
			| score \
			| sh | shl \
			| sh[1234] | sh[24]a | sh[24]ae[lb] | sh[23]e | she[lb] | sh[lb]e \
			| sh[1234]e[lb] |  sh[12345][lb]e | sh[23]ele | sh64 | sh64le \
			| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet \
			| sparclite \
			| sparcv8 | sparcv9 | sparcv9b | sparcv9v | sv1 | sx* \
			| spu \
			| tahoe \
			| thumbv7* \
			| tic30 | tic4x | tic54x | tic55x | tic6x | tic80 \
			| tron \
			| ubicom32 \
			| v70 | v850 | v850e | v850e1 | v850es | v850e2 | v850e2v3 \
			| vax \
			| visium \
			| w65 \
			| wasm32 | wasm64 \
			| we32k \
			| x86 | x86_64 | xc16x | xgate | xps100 \
			| xstormy16 | xtensa* \
			| ymp \
			| z8k | z80)
				;;

			*)
				echo "Invalid configuration '$1': machine '$cpu-$vendor' not recognized" 1>&2
				exit 1
				;;
		esac
d1345 3
a1347 3
case $vendor in
	digital*)
		vendor=dec
d1349 2
a1350 2
	commodore*)
		vendor=cbm
d1358 1
a1358 1
if test x"$basic_os" != x
a1359 46

# First recognize some ad-hoc cases, or perhaps split kernel-os, or else just
# set os.
obj=
case $basic_os in
	gnu/linux*)
		kernel=linux
		os=`echo "$basic_os" | sed -e 's|gnu/linux|gnu|'`
		;;
	os2-emx)
		kernel=os2
		os=`echo "$basic_os" | sed -e 's|os2-emx|emx|'`
		;;
	nto-qnx*)
		kernel=nto
		os=`echo "$basic_os" | sed -e 's|nto-qnx|qnx|'`
		;;
	*-*)
		# shellcheck disable=SC2162
		saved_IFS=$IFS
		IFS="-" read kernel os <<EOF
$basic_os
EOF
		IFS=$saved_IFS
		;;
	# Default OS when just kernel was specified
	nto*)
		kernel=nto
		os=`echo "$basic_os" | sed -e 's|nto|qnx|'`
		;;
	linux*)
		kernel=linux
		os=`echo "$basic_os" | sed -e 's|linux|gnu|'`
		;;
	managarm*)
		kernel=managarm
		os=`echo "$basic_os" | sed -e 's|managarm|mlibc|'`
		;;
	*)
		kernel=
		os=$basic_os
		;;
esac

# Now, normalize the OS (knowing we just have one component, it's not a kernel,
# etc.)
d1361 5
a1365 5
	# First match some system type aliases that might get confused
	# with valid system types.
	# solaris* is a basic system type, with this one exception.
	auroraux)
		os=auroraux
d1367 2
a1368 2
	bluegene*)
		os=cnk
d1370 2
a1371 2
	solaris1 | solaris1.*)
		os=`echo "$os" | sed -e 's|solaris1|sunos4|'`
d1373 2
a1374 2
	solaris)
		os=solaris2
d1376 2
a1377 2
	unixware*)
		os=sysv4.2uw
d1379 2
a1380 3
	# es1800 is here to avoid being matched by es* (a different OS)
	es1800*)
		os=ose
d1382 41
a1422 3
	# Some version numbers need modification
	chorusos*)
		os=chorusos
d1424 1
a1424 2
	isc)
		os=isc2.2
d1426 2
a1427 2
	sco6)
		os=sco5v6
d1429 3
a1431 2
	sco5)
		os=sco3.2v5
d1433 2
a1434 2
	sco4)
		os=sco3.2v4
d1436 2
a1437 2
	sco3.2.[4-9]*)
		os=`echo "$os" | sed -e 's/sco3.2./sco3.2v/'`
d1439 2
a1440 2
	sco*v* | scout)
		# Don't match below
d1442 2
a1443 2
	sco*)
		os=sco3.2v2
d1445 2
a1446 2
	psos*)
		os=psos
d1448 2
a1449 2
	qnx*)
		os=qnx
d1451 2
a1452 2
	hiux*)
		os=hiuxwe2
d1454 2
a1455 2
	lynx*178)
		os=lynxos178
d1457 2
a1458 2
	lynx*5)
		os=lynxos5
d1460 2
a1461 2
	lynxos*)
		# don't get caught up in next wildcard
d1463 2
a1464 2
	lynx*)
		os=lynxos
d1466 2
a1467 2
	mac[0-9]*)
		os=`echo "$os" | sed -e 's|mac|macos|'`
d1469 2
a1470 2
	opened*)
		os=openedition
d1472 2
a1473 2
	os400*)
		os=os400
d1475 2
a1476 2
	sunos5*)
		os=`echo "$os" | sed -e 's|sunos5|solaris2|'`
d1478 2
a1479 2
	sunos6*)
		os=`echo "$os" | sed -e 's|sunos6|solaris3|'`
d1481 2
a1482 2
	wince*)
		os=wince
d1484 2
a1485 2
	utek*)
		os=bsd
d1487 2
a1488 2
	dynix*)
		os=bsd
d1490 2
a1491 2
	acis*)
		os=aos
d1493 3
a1495 2
	atheos*)
		os=atheos
d1497 2
a1498 2
	syllable*)
		os=syllable
d1500 2
a1501 2
	386bsd)
		os=bsd
d1503 2
a1504 2
	ctix* | uts*)
		os=sysv
d1506 2
a1507 2
	nova*)
		os=rtmk-nova
d1509 2
a1510 2
	ns2)
		os=nextstep2
d1512 2
a1513 3
	# Preserve the version number of sinix5.
	sinix5.*)
		os=`echo "$os" | sed -e 's|sinix|sysv|'`
d1515 2
a1516 2
	sinix*)
		os=sysv4
d1518 2
a1519 2
	tpf*)
		os=tpf
d1521 2
a1522 2
	triton*)
		os=sysv3
d1524 2
a1525 2
	oss*)
		os=sysv3
d1527 2
a1528 2
	svr4*)
		os=sysv4
d1530 2
a1531 2
	svr3)
		os=sysv3
d1533 2
a1534 2
	sysvr4)
		os=sysv4
d1536 2
a1537 2
	ose*)
		os=ose
d1539 2
a1540 2
	*mint | mint[0-9]* | *MiNT | MiNT[0-9]*)
		os=mint
d1542 1
a1542 2
	dicos*)
		os=dicos
d1544 1
a1544 13
	pikeos*)
		# Until real need of OS specific support for
		# particular features comes up, bare metal
		# configurations are quite functional.
		case $cpu in
		    arm*)
			os=eabi
			;;
		    *)
			os=
			obj=elf
			;;
		esac
d1546 1
a1546 4
	aout* | coff* | elf* | pe*)
		# These are machine code file formats, not OSes
		obj=$os
		os=
d1549 4
a1552 1
		# No normalization, but not necessarily accepted, that comes below.
a1554 1

d1567 1
a1567 3
kernel=
obj=
case $cpu-$vendor in
d1569 1
a1569 2
		os=
		obj=elf
d1572 1
a1572 2
		os=
		obj=elf
d1575 1
a1575 1
		os=riscix1.2
d1578 1
a1578 2
		kernel=linux
		os=gnu
d1581 1
a1581 2
		os=
		obj=aout
d1584 1
a1584 2
		os=
		obj=coff
d1587 1
a1587 5
		os=
		obj=elf
		;;
	clipper-intergraph)
		os=clix
d1590 1
a1590 2
		os=
		obj=elf
d1593 1
a1593 2
		os=
		obj=coff
d1596 1
a1596 2
		os=
		obj=coff
d1599 1
a1599 2
		os=
		obj=coff
d1603 1
a1603 1
		os=tops20
d1606 1
a1606 1
		os=none
d1609 1
a1609 1
		os=ultrix4.2
d1612 1
a1612 1
		os=domain
d1615 1
a1615 1
		os=sunos4.0.2
d1618 1
a1618 1
		os=sunos3
d1621 1
a1621 2
		os=
		obj=aout
d1624 1
a1624 2
		os=
		obj=elf
d1627 1
a1627 2
		os=
		obj=elf
d1630 1
a1630 2
		os=
		obj=elf
d1633 1
a1633 2
		os=
		obj=coff
d1636 1
a1636 1
		os=sysv3
d1639 1
a1639 1
		os=sunos4.1.1
d1642 1
a1642 2
		os=
		obj=elf
d1645 4
a1648 1
		os=beos
d1651 1
a1651 1
		os=aix
d1654 1
a1654 1
		os=mmixware
d1657 1
a1657 1
		os=proelf
d1660 1
a1660 1
		os=proelf
d1663 1
a1663 1
		os=proelf
d1666 1
a1666 1
		os=hpux
d1669 1
a1669 1
		os=hiux
d1672 1
a1672 1
		os=sysv
d1675 1
a1675 1
		os=amigaos
d1678 1
a1678 1
		os=dgux
d1681 1
a1681 1
		os=sysv3
d1684 1
a1684 1
		os=rtu
d1687 1
a1687 1
		os=luna
d1689 2
a1690 2
	*-next)
		os=nextstep
d1693 1
a1693 1
		os=ptx
d1696 1
a1696 1
		os=unos
d1699 1
a1699 1
		os=genix
d1702 4
a1705 1
		os=mvs
d1708 1
a1708 1
		os=sysv
d1711 1
a1711 1
		os=bsd
d1714 1
a1714 1
		os=bsd
d1717 1
a1717 1
		os=irix
d1720 1
a1720 1
		os=sysv4
d1723 1
a1723 1
		os=rtu
d1726 1
a1726 1
		os=uxpv
d1729 1
a1729 2
		os=
		obj=coff
d1732 1
a1732 2
		os=
		obj=coff
d1735 1
a1735 1
		os=macos
d1738 1
a1738 4
		os=mint
		;;
	*-wrs)
		os=vxworks
d1741 1
a1741 1
		os=none
a1743 1

a1745 154
# Now, validate our (potentially fixed-up) individual pieces (OS, OBJ).

case $os in
	# Sometimes we do "kernel-libc", so those need to count as OSes.
	musl* | newlib* | relibc* | uclibc*)
		;;
	# Likewise for "kernel-abi"
	eabi* | gnueabi*)
		;;
	# VxWorks passes extra cpu info in the 4th filed.
	simlinux | simwindows | spe)
		;;
	# See `case $cpu-$os` validation below
	ghcjs)
		;;
	# Now accept the basic system types.
	# The portable systems comes first.
	# Each alternative MUST end in a * to match a version number.
	gnu* | android* | bsd* | mach* | minix* | genix* | ultrix* | irix* \
	     | *vms* | esix* | aix* | cnk* | sunos | sunos[34]* \
	     | hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \
	     | sym* |  plan9* | psp* | sim* | xray* | os68k* | v88r* \
	     | hiux* | abug | nacl* | netware* | windows* \
	     | os9* | macos* | osx* | ios* | tvos* | watchos* \
	     | mpw* | magic* | mmixware* | mon960* | lnews* \
	     | amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \
	     | aos* | aros* | cloudabi* | sortix* | twizzler* \
	     | nindy* | vxsim* | vxworks* | ebmon* | hms* | mvs* \
	     | clix* | riscos* | uniplus* | iris* | isc* | rtu* | xenix* \
	     | mirbsd* | netbsd* | dicos* | openedition* | ose* \
	     | bitrig* | openbsd* | secbsd* | solidbsd* | libertybsd* | os108* \
	     | ekkobsd* | freebsd* | riscix* | lynxos* | os400* \
	     | bosx* | nextstep* | cxux* | oabi* \
	     | ptx* | ecoff* | winnt* | domain* | vsta* \
	     | udi* | lites* | ieee* | go32* | aux* | hcos* \
	     | chorusrdb* | cegcc* | glidix* | serenity* \
	     | cygwin* | msys* | moss* | proelf* | rtems* \
	     | midipix* | mingw32* | mingw64* | mint* \
	     | uxpv* | beos* | mpeix* | udk* | moxiebox* \
	     | interix* | uwin* | mks* | rhapsody* | darwin* \
	     | openstep* | oskit* | conix* | pw32* | nonstopux* \
	     | storm-chaos* | tops10* | tenex* | tops20* | its* \
	     | os2* | vos* | palmos* | uclinux* | nucleus* | morphos* \
	     | scout* | superux* | sysv* | rtmk* | tpf* | windiss* \
	     | powermax* | dnix* | nx6 | nx7 | sei* | dragonfly* \
	     | skyos* | haiku* | rdos* | toppers* | drops* | es* \
	     | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \
	     | midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \
	     | nsk* | powerunix* | genode* | zvmoe* | qnx* | emx* | zephyr* \
	     | fiwix* | mlibc* | cos* | mbr* )
		;;
	# This one is extra strict with allowed versions
	sco3.2v2 | sco3.2v[4-9]* | sco5v6*)
		# Don't forget version if it is 3.2v4 or newer.
		;;
	none)
		;;
	kernel* | msvc* )
		# Restricted further below
		;;
	'')
		if test x"$obj" = x
		then
			echo "Invalid configuration '$1': Blank OS only allowed with explicit machine code file format" 1>&2
		fi
		;;
	*)
		echo "Invalid configuration '$1': OS '$os' not recognized" 1>&2
		exit 1
		;;
esac

case $obj in
	aout* | coff* | elf* | pe*)
		;;
	'')
		# empty is fine
		;;
	*)
		echo "Invalid configuration '$1': Machine code format '$obj' not recognized" 1>&2
		exit 1
		;;
esac

# Here we handle the constraint that a (synthetic) cpu and os are
# valid only in combination with each other and nowhere else.
case $cpu-$os in
	# The "javascript-unknown-ghcjs" triple is used by GHC; we
	# accept it here in order to tolerate that, but reject any
	# variations.
	javascript-ghcjs)
		;;
	javascript-* | *-ghcjs)
		echo "Invalid configuration '$1': cpu '$cpu' is not valid with os '$os$obj'" 1>&2
		exit 1
		;;
esac

# As a final step for OS-related things, validate the OS-kernel combination
# (given a valid OS), if there is a kernel.
case $kernel-$os-$obj in
	linux-gnu*- | linux-dietlibc*- | linux-android*- | linux-newlib*- \
		   | linux-musl*- | linux-relibc*- | linux-uclibc*- | linux-mlibc*- )
		;;
	uclinux-uclibc*- )
		;;
	managarm-mlibc*- | managarm-kernel*- )
		;;
	windows*-msvc*-)
		;;
	-dietlibc*- | -newlib*- | -musl*- | -relibc*- | -uclibc*- | -mlibc*- )
		# These are just libc implementations, not actual OSes, and thus
		# require a kernel.
		echo "Invalid configuration '$1': libc '$os' needs explicit kernel." 1>&2
		exit 1
		;;
	-kernel*- )
		echo "Invalid configuration '$1': '$os' needs explicit kernel." 1>&2
		exit 1
		;;
	*-kernel*- )
		echo "Invalid configuration '$1': '$kernel' does not support '$os'." 1>&2
		exit 1
		;;
	*-msvc*- )
		echo "Invalid configuration '$1': '$os' needs 'windows'." 1>&2
		exit 1
		;;
	kfreebsd*-gnu*- | kopensolaris*-gnu*-)
		;;
	vxworks-simlinux- | vxworks-simwindows- | vxworks-spe-)
		;;
	nto-qnx*-)
		;;
	os2-emx-)
		;;
	*-eabi*- | *-gnueabi*-)
		;;
	none--*)
		# None (no kernel, i.e. freestanding / bare metal),
		# can be paired with an machine code file format
		;;
	-*-)
		# Blank kernel with real OS is always fine.
		;;
	--*)
		# Blank kernel and OS with real machine code file format is always fine.
		;;
	*-*-*)
		echo "Invalid configuration '$1': Kernel '$kernel' not known to work with OS '$os'." 1>&2
		exit 1
		;;
esac

d1748 5
a1752 4
case $vendor in
	unknown)
		case $cpu-$os in
			*-riscix*)
d1755 1
a1755 1
			*-sunos*)
d1758 1
a1758 1
			*-cnk* | *-aix*)
d1761 1
a1761 1
			*-beos*)
d1764 1
a1764 1
			*-hpux*)
d1767 1
a1767 1
			*-mpeix*)
d1770 1
a1770 1
			*-hiux*)
d1773 1
a1773 1
			*-unos*)
d1776 1
a1776 1
			*-dgux*)
d1779 1
a1779 1
			*-luna*)
d1782 1
a1782 1
			*-genix*)
d1785 1
a1785 7
			*-clix*)
				vendor=intergraph
				;;
			*-mvs* | *-opened*)
				vendor=ibm
				;;
			*-os400*)
d1788 1
a1788 1
			s390-* | s390x-*)
d1791 1
a1791 1
			*-ptx*)
d1794 1
a1794 1
			*-tpf*)
d1797 1
a1797 1
			*-vxsim* | *-vxworks* | *-windiss*)
d1800 1
a1800 1
			*-aux*)
d1803 1
a1803 1
			*-hms*)
d1806 1
a1806 1
			*-mpw* | *-macos*)
d1809 1
a1809 1
			*-*mint | *-mint[0-9]* | *-*MiNT | *-MiNT[0-9]*)
d1812 1
a1812 1
			*-vos*)
d1816 1
d1820 1
a1820 1
echo "$cpu-$vendor${kernel:+-$kernel}${os:+-$os}${obj:+-$obj}"
d1824 1
a1824 1
# eval: (add-hook 'before-save-hook 'time-stamp)
@


1.1.2.1
log
@file config.sub was added on branch phil-wifi on 2019-06-10 21:51:11 +0000
@
text
@d1 1828
@


1.1.2.2
log
@Sync with HEAD
@
text
@a0 1828
#! /bin/sh
# Configuration validation subroutine script.
#   Copyright 1992-2017 Free Software Foundation, Inc.

timestamp='2017-01-01'

# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, see <http://www.gnu.org/licenses/>.
#
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that
# program.  This Exception is an additional permission under section 7
# of the GNU General Public License, version 3 ("GPLv3").


# Please send patches to <config-patches@@gnu.org>.
#
# Configuration subroutine to validate and canonicalize a configuration type.
# Supply the specified configuration type as an argument.
# If it is invalid, we print an error message on stderr and exit with code 1.
# Otherwise, we print the canonical config type on stdout and succeed.

# You can get the latest version of this script from:
# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub

# This file is supposed to be the same for all GNU packages
# and recognize all the CPU types, system types and aliases
# that are meaningful with *any* GNU software.
# Each package is responsible for reporting which valid configurations
# it does not support.  The user should be able to distinguish
# a failure to support a valid configuration from a meaningless
# configuration.

# The goal of this file is to map all the various variations of a given
# machine specification into a single specification in the form:
#	CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
# or in some cases, the newer four-part form:
#	CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
# It is wrong to echo any other type of specification.

me=`echo "$0" | sed -e 's,.*/,,'`

usage="\
Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS

Canonicalize a configuration name.

Operation modes:
  -h, --help         print this help, then exit
  -t, --time-stamp   print date of last modification, then exit
  -v, --version      print version number, then exit

Report bugs and patches to <config-patches@@gnu.org>."

version="\
GNU config.sub ($timestamp)

Copyright 1992-2017 Free Software Foundation, Inc.

This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."

help="
Try \`$me --help' for more information."

# Parse command line
while test $# -gt 0 ; do
  case $1 in
    --time-stamp | --time* | -t )
       echo "$timestamp" ; exit ;;
    --version | -v )
       echo "$version" ; exit ;;
    --help | --h* | -h )
       echo "$usage"; exit ;;
    -- )     # Stop option processing
       shift; break ;;
    - )	# Use stdin as input.
       break ;;
    -* )
       echo "$me: invalid option $1$help"
       exit 1 ;;

    *local*)
       # First pass through any local machine types.
       echo $1
       exit ;;

    * )
       break ;;
  esac
done

case $# in
 0) echo "$me: missing argument$help" >&2
    exit 1;;
 1) ;;
 *) echo "$me: too many arguments$help" >&2
    exit 1;;
esac

# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
# Here we must recognize all the valid KERNEL-OS combinations.
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
case $maybe_os in
  nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
  linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
  knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \
  kopensolaris*-gnu* | cloudabi*-eabi* | \
  storm-chaos* | os2-emx* | rtmk-nova*)
    os=-$maybe_os
    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
    ;;
  android-linux)
    os=-linux-android
    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
    ;;
  *)
    basic_machine=`echo $1 | sed 's/-[^-]*$//'`
    if [ $basic_machine != $1 ]
    then os=`echo $1 | sed 's/.*-/-/'`
    else os=; fi
    ;;
esac

### Let's recognize common machines as not being operating systems so
### that things like config.sub decstation-3100 work.  We also
### recognize some manufacturers as not being operating systems, so we
### can provide default operating systems below.
case $os in
	-sun*os*)
		# Prevent following clause from handling this invalid input.
		;;
	-dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
	-att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
	-unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
	-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
	-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
	-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
	-apple | -axis | -knuth | -cray | -microblaze*)
		os=
		basic_machine=$1
		;;
	-bluegene*)
		os=-cnk
		;;
	-sim | -cisco | -oki | -wec | -winbond)
		os=
		basic_machine=$1
		;;
	-scout)
		;;
	-wrs)
		os=-vxworks
		basic_machine=$1
		;;
	-chorusos*)
		os=-chorusos
		basic_machine=$1
		;;
	-chorusrdb)
		os=-chorusrdb
		basic_machine=$1
		;;
	-hiux*)
		os=-hiuxwe2
		;;
	-sco6)
		os=-sco5v6
		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
		;;
	-sco5)
		os=-sco3.2v5
		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
		;;
	-sco4)
		os=-sco3.2v4
		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
		;;
	-sco3.2.[4-9]*)
		os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
		;;
	-sco3.2v[4-9]*)
		# Don't forget version if it is 3.2v4 or newer.
		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
		;;
	-sco5v6*)
		# Don't forget version if it is 3.2v4 or newer.
		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
		;;
	-sco*)
		os=-sco3.2v2
		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
		;;
	-udk*)
		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
		;;
	-isc)
		os=-isc2.2
		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
		;;
	-clix*)
		basic_machine=clipper-intergraph
		;;
	-isc*)
		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
		;;
	-lynx*178)
		os=-lynxos178
		;;
	-lynx*5)
		os=-lynxos5
		;;
	-lynx*)
		os=-lynxos
		;;
	-ptx*)
		basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
		;;
	-windowsnt*)
		os=`echo $os | sed -e 's/windowsnt/winnt/'`
		;;
	-psos*)
		os=-psos
		;;
	-mint | -mint[0-9]*)
		basic_machine=m68k-atari
		os=-mint
		;;
esac

# Decode aliases for certain CPU-COMPANY combinations.
case $basic_machine in
	# Recognize the basic CPU types without company name.
	# Some are omitted here because they have special meanings below.
	1750a | 580 \
	| a29k \
	| aarch64 | aarch64_be \
	| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
	| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
	| am33_2.0 \
	| arc | arceb \
	| arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
	| avr | avr32 \
	| ba \
	| be32 | be64 \
	| bfin \
	| c4x | c8051 | clipper \
	| d10v | d30v | dlx | dsp16xx \
	| e2k | epiphany \
	| fido | fr30 | frv | ft32 \
	| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
	| hexagon \
	| i370 | i860 | i960 | ia64 \
	| ip2k | iq2000 \
	| k1om \
	| le32 | le64 \
	| lm32 \
	| m32c | m32r | m32rle | m68000 | m68k | m88k \
	| maxq | mb | microblaze | microblazeel | mcore | mep | metag \
	| mips | mipsbe | mipseb | mipsel | mipsle \
	| mips16 \
	| mips64 | mips64el \
	| mips64octeon | mips64octeonel \
	| mips64orion | mips64orionel \
	| mips64r5900 | mips64r5900el \
	| mips64vr | mips64vrel \
	| mips64vr4100 | mips64vr4100el \
	| mips64vr4300 | mips64vr4300el \
	| mips64vr5000 | mips64vr5000el \
	| mips64vr5900 | mips64vr5900el \
	| mipsisa32 | mipsisa32el \
	| mipsisa32r2 | mipsisa32r2el \
	| mipsisa32r6 | mipsisa32r6el \
	| mipsisa64 | mipsisa64el \
	| mipsisa64r2 | mipsisa64r2el \
	| mipsisa64r6 | mipsisa64r6el \
	| mipsisa64sb1 | mipsisa64sb1el \
	| mipsisa64sr71k | mipsisa64sr71kel \
	| mipsr5900 | mipsr5900el \
	| mipstx39 | mipstx39el \
	| mn10200 | mn10300 \
	| moxie \
	| mt \
	| msp430 \
	| nds32 | nds32le | nds32be \
	| nios | nios2 | nios2eb | nios2el \
	| ns16k | ns32k \
	| open8 | or1k | or1knd | or32 \
	| pdp10 | pdp11 | pj | pjl \
	| powerpc | powerpc64 | powerpc64le | powerpcle \
	| pru \
	| pyramid \
	| riscv32 | riscv64 \
	| rl78 | rx \
	| score \
	| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
	| sh64 | sh64le \
	| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
	| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
	| spu \
	| tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
	| ubicom32 \
	| v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
	| visium \
	| we32k \
	| x86 | xc16x | xstormy16 | xtensa \
	| z8k | z80)
		basic_machine=$basic_machine-unknown
		;;
	c54x)
		basic_machine=tic54x-unknown
		;;
	c55x)
		basic_machine=tic55x-unknown
		;;
	c6x)
		basic_machine=tic6x-unknown
		;;
	leon|leon[3-9])
		basic_machine=sparc-$basic_machine
		;;
	m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
		basic_machine=$basic_machine-unknown
		os=-none
		;;
	m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
		;;
	ms1)
		basic_machine=mt-unknown
		;;

	strongarm | thumb | xscale)
		basic_machine=arm-unknown
		;;
	xgate)
		basic_machine=$basic_machine-unknown
		os=-none
		;;
	xscaleeb)
		basic_machine=armeb-unknown
		;;

	xscaleel)
		basic_machine=armel-unknown
		;;

	# We use `pc' rather than `unknown'
	# because (1) that's what they normally are, and
	# (2) the word "unknown" tends to confuse beginning users.
	i*86 | x86_64)
	  basic_machine=$basic_machine-pc
	  ;;
	# Object if more than one company name word.
	*-*-*)
		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
		exit 1
		;;
	# Recognize the basic CPU types with company name.
	580-* \
	| a29k-* \
	| aarch64-* | aarch64_be-* \
	| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
	| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
	| arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
	| avr-* | avr32-* \
	| ba-* \
	| be32-* | be64-* \
	| bfin-* | bs2000-* \
	| c[123]* | c30-* | [cjt]90-* | c4x-* \
	| c8051-* | clipper-* | craynv-* | cydra-* \
	| d10v-* | d30v-* | dlx-* \
	| e2k-* | elxsi-* \
	| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
	| h8300-* | h8500-* \
	| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
	| hexagon-* \
	| i*86-* | i860-* | i960-* | ia64-* \
	| ip2k-* | iq2000-* \
	| k1om-* \
	| le32-* | le64-* \
	| lm32-* \
	| m32c-* | m32r-* | m32rle-* \
	| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
	| m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
	| microblaze-* | microblazeel-* \
	| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
	| mips16-* \
	| mips64-* | mips64el-* \
	| mips64octeon-* | mips64octeonel-* \
	| mips64orion-* | mips64orionel-* \
	| mips64r5900-* | mips64r5900el-* \
	| mips64vr-* | mips64vrel-* \
	| mips64vr4100-* | mips64vr4100el-* \
	| mips64vr4300-* | mips64vr4300el-* \
	| mips64vr5000-* | mips64vr5000el-* \
	| mips64vr5900-* | mips64vr5900el-* \
	| mipsisa32-* | mipsisa32el-* \
	| mipsisa32r2-* | mipsisa32r2el-* \
	| mipsisa32r6-* | mipsisa32r6el-* \
	| mipsisa64-* | mipsisa64el-* \
	| mipsisa64r2-* | mipsisa64r2el-* \
	| mipsisa64r6-* | mipsisa64r6el-* \
	| mipsisa64sb1-* | mipsisa64sb1el-* \
	| mipsisa64sr71k-* | mipsisa64sr71kel-* \
	| mipsr5900-* | mipsr5900el-* \
	| mipstx39-* | mipstx39el-* \
	| mmix-* \
	| mt-* \
	| msp430-* \
	| nds32-* | nds32le-* | nds32be-* \
	| nios-* | nios2-* | nios2eb-* | nios2el-* \
	| none-* | np1-* | ns16k-* | ns32k-* \
	| open8-* \
	| or1k*-* \
	| orion-* \
	| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
	| pru-* \
	| pyramid-* \
	| riscv32-* | riscv64-* \
	| rl78-* | romp-* | rs6000-* | rx-* \
	| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
	| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
	| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
	| sparclite-* \
	| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \
	| tahoe-* \
	| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
	| tile*-* \
	| tron-* \
	| ubicom32-* \
	| v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
	| vax-* \
	| visium-* \
	| we32k-* \
	| x86-* | x86_64-* | xc16x-* | xps100-* \
	| xstormy16-* | xtensa*-* \
	| ymp-* \
	| z8k-* | z80-*)
		;;
	# Recognize the basic CPU types without company name, with glob match.
	xtensa*)
		basic_machine=$basic_machine-unknown
		;;
	# Recognize the various machine names and aliases which stand
	# for a CPU type and a company and sometimes even an OS.
	386bsd)
		basic_machine=i386-unknown
		os=-bsd
		;;
	3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
		basic_machine=m68000-att
		;;
	3b*)
		basic_machine=we32k-att
		;;
	a29khif)
		basic_machine=a29k-amd
		os=-udi
		;;
	abacus)
		basic_machine=abacus-unknown
		;;
	adobe68k)
		basic_machine=m68010-adobe
		os=-scout
		;;
	alliant | fx80)
		basic_machine=fx80-alliant
		;;
	altos | altos3068)
		basic_machine=m68k-altos
		;;
	am29k)
		basic_machine=a29k-none
		os=-bsd
		;;
	amd64)
		basic_machine=x86_64-pc
		;;
	amd64-*)
		basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
		;;
	amdahl)
		basic_machine=580-amdahl
		os=-sysv
		;;
	amiga | amiga-*)
		basic_machine=m68k-unknown
		;;
	amigaos | amigados)
		basic_machine=m68k-unknown
		os=-amigaos
		;;
	amigaunix | amix)
		basic_machine=m68k-unknown
		os=-sysv4
		;;
	apollo68)
		basic_machine=m68k-apollo
		os=-sysv
		;;
	apollo68bsd)
		basic_machine=m68k-apollo
		os=-bsd
		;;
	aros)
		basic_machine=i386-pc
		os=-aros
		;;
	asmjs)
		basic_machine=asmjs-unknown
		;;
	aux)
		basic_machine=m68k-apple
		os=-aux
		;;
	balance)
		basic_machine=ns32k-sequent
		os=-dynix
		;;
	blackfin)
		basic_machine=bfin-unknown
		os=-linux
		;;
	blackfin-*)
		basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
		os=-linux
		;;
	bluegene*)
		basic_machine=powerpc-ibm
		os=-cnk
		;;
	c54x-*)
		basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
		;;
	c55x-*)
		basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
		;;
	c6x-*)
		basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
		;;
	c90)
		basic_machine=c90-cray
		os=-unicos
		;;
	cegcc)
		basic_machine=arm-unknown
		os=-cegcc
		;;
	convex-c1)
		basic_machine=c1-convex
		os=-bsd
		;;
	convex-c2)
		basic_machine=c2-convex
		os=-bsd
		;;
	convex-c32)
		basic_machine=c32-convex
		os=-bsd
		;;
	convex-c34)
		basic_machine=c34-convex
		os=-bsd
		;;
	convex-c38)
		basic_machine=c38-convex
		os=-bsd
		;;
	cray | j90)
		basic_machine=j90-cray
		os=-unicos
		;;
	craynv)
		basic_machine=craynv-cray
		os=-unicosmp
		;;
	cr16 | cr16-*)
		basic_machine=cr16-unknown
		os=-elf
		;;
	crds | unos)
		basic_machine=m68k-crds
		;;
	crisv32 | crisv32-* | etraxfs*)
		basic_machine=crisv32-axis
		;;
	cris | cris-* | etrax*)
		basic_machine=cris-axis
		;;
	crx)
		basic_machine=crx-unknown
		os=-elf
		;;
	da30 | da30-*)
		basic_machine=m68k-da30
		;;
	decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
		basic_machine=mips-dec
		;;
	decsystem10* | dec10*)
		basic_machine=pdp10-dec
		os=-tops10
		;;
	decsystem20* | dec20*)
		basic_machine=pdp10-dec
		os=-tops20
		;;
	delta | 3300 | motorola-3300 | motorola-delta \
	      | 3300-motorola | delta-motorola)
		basic_machine=m68k-motorola
		;;
	delta88)
		basic_machine=m88k-motorola
		os=-sysv3
		;;
	dicos)
		basic_machine=i686-pc
		os=-dicos
		;;
	djgpp)
		basic_machine=i586-pc
		os=-msdosdjgpp
		;;
	dpx20 | dpx20-*)
		basic_machine=rs6000-bull
		os=-bosx
		;;
	dpx2* | dpx2*-bull)
		basic_machine=m68k-bull
		os=-sysv3
		;;
	e500v[12])
		basic_machine=powerpc-unknown
		os=$os"spe"
		;;
	e500v[12]-*)
		basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
		os=$os"spe"
		;;
	ebmon29k)
		basic_machine=a29k-amd
		os=-ebmon
		;;
	elxsi)
		basic_machine=elxsi-elxsi
		os=-bsd
		;;
	encore | umax | mmax)
		basic_machine=ns32k-encore
		;;
	es1800 | OSE68k | ose68k | ose | OSE)
		basic_machine=m68k-ericsson
		os=-ose
		;;
	fx2800)
		basic_machine=i860-alliant
		;;
	genix)
		basic_machine=ns32k-ns
		;;
	gmicro)
		basic_machine=tron-gmicro
		os=-sysv
		;;
	go32)
		basic_machine=i386-pc
		os=-go32
		;;
	h3050r* | hiux*)
		basic_machine=hppa1.1-hitachi
		os=-hiuxwe2
		;;
	h8300hms)
		basic_machine=h8300-hitachi
		os=-hms
		;;
	h8300xray)
		basic_machine=h8300-hitachi
		os=-xray
		;;
	h8500hms)
		basic_machine=h8500-hitachi
		os=-hms
		;;
	harris)
		basic_machine=m88k-harris
		os=-sysv3
		;;
	hp300-*)
		basic_machine=m68k-hp
		;;
	hp300bsd)
		basic_machine=m68k-hp
		os=-bsd
		;;
	hp300hpux)
		basic_machine=m68k-hp
		os=-hpux
		;;
	hp3k9[0-9][0-9] | hp9[0-9][0-9])
		basic_machine=hppa1.0-hp
		;;
	hp9k2[0-9][0-9] | hp9k31[0-9])
		basic_machine=m68000-hp
		;;
	hp9k3[2-9][0-9])
		basic_machine=m68k-hp
		;;
	hp9k6[0-9][0-9] | hp6[0-9][0-9])
		basic_machine=hppa1.0-hp
		;;
	hp9k7[0-79][0-9] | hp7[0-79][0-9])
		basic_machine=hppa1.1-hp
		;;
	hp9k78[0-9] | hp78[0-9])
		# FIXME: really hppa2.0-hp
		basic_machine=hppa1.1-hp
		;;
	hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
		# FIXME: really hppa2.0-hp
		basic_machine=hppa1.1-hp
		;;
	hp9k8[0-9][13679] | hp8[0-9][13679])
		basic_machine=hppa1.1-hp
		;;
	hp9k8[0-9][0-9] | hp8[0-9][0-9])
		basic_machine=hppa1.0-hp
		;;
	hppa-next)
		os=-nextstep3
		;;
	hppaosf)
		basic_machine=hppa1.1-hp
		os=-osf
		;;
	hppro)
		basic_machine=hppa1.1-hp
		os=-proelf
		;;
	i370-ibm* | ibm*)
		basic_machine=i370-ibm
		;;
	i*86v32)
		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
		os=-sysv32
		;;
	i*86v4*)
		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
		os=-sysv4
		;;
	i*86v)
		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
		os=-sysv
		;;
	i*86sol2)
		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
		os=-solaris2
		;;
	i386mach)
		basic_machine=i386-mach
		os=-mach
		;;
	i386-vsta | vsta)
		basic_machine=i386-unknown
		os=-vsta
		;;
	iris | iris4d)
		basic_machine=mips-sgi
		case $os in
		    -irix*)
			;;
		    *)
			os=-irix4
			;;
		esac
		;;
	isi68 | isi)
		basic_machine=m68k-isi
		os=-sysv
		;;
	leon-*|leon[3-9]-*)
		basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'`
		;;
	m68knommu)
		basic_machine=m68k-unknown
		os=-linux
		;;
	m68knommu-*)
		basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
		os=-linux
		;;
	m88k-omron*)
		basic_machine=m88k-omron
		;;
	magnum | m3230)
		basic_machine=mips-mips
		os=-sysv
		;;
	merlin)
		basic_machine=ns32k-utek
		os=-sysv
		;;
	microblaze*)
		basic_machine=microblaze-xilinx
		;;
	mingw64)
		basic_machine=x86_64-pc
		os=-mingw64
		;;
	mingw32)
		basic_machine=i686-pc
		os=-mingw32
		;;
	mingw32ce)
		basic_machine=arm-unknown
		os=-mingw32ce
		;;
	miniframe)
		basic_machine=m68000-convergent
		;;
	*mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
		basic_machine=m68k-atari
		os=-mint
		;;
	mips3*-*)
		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
		;;
	mips3*)
		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
		;;
	monitor)
		basic_machine=m68k-rom68k
		os=-coff
		;;
	morphos)
		basic_machine=powerpc-unknown
		os=-morphos
		;;
	moxiebox)
		basic_machine=moxie-unknown
		os=-moxiebox
		;;
	msdos)
		basic_machine=i386-pc
		os=-msdos
		;;
	ms1-*)
		basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
		;;
	msys)
		basic_machine=i686-pc
		os=-msys
		;;
	mvs)
		basic_machine=i370-ibm
		os=-mvs
		;;
	nacl)
		basic_machine=le32-unknown
		os=-nacl
		;;
	ncr3000)
		basic_machine=i486-ncr
		os=-sysv4
		;;
	netbsd386)
		basic_machine=i386-unknown
		os=-netbsd
		;;
	netwinder)
		basic_machine=armv4l-rebel
		os=-linux
		;;
	news | news700 | news800 | news900)
		basic_machine=m68k-sony
		os=-newsos
		;;
	news1000)
		basic_machine=m68030-sony
		os=-newsos
		;;
	news-3600 | risc-news)
		basic_machine=mips-sony
		os=-newsos
		;;
	necv70)
		basic_machine=v70-nec
		os=-sysv
		;;
	next | m*-next )
		basic_machine=m68k-next
		case $os in
		    -nextstep* )
			;;
		    -ns2*)
		      os=-nextstep2
			;;
		    *)
		      os=-nextstep3
			;;
		esac
		;;
	nh3000)
		basic_machine=m68k-harris
		os=-cxux
		;;
	nh[45]000)
		basic_machine=m88k-harris
		os=-cxux
		;;
	nindy960)
		basic_machine=i960-intel
		os=-nindy
		;;
	mon960)
		basic_machine=i960-intel
		os=-mon960
		;;
	nonstopux)
		basic_machine=mips-compaq
		os=-nonstopux
		;;
	np1)
		basic_machine=np1-gould
		;;
	neo-tandem)
		basic_machine=neo-tandem
		;;
	nse-tandem)
		basic_machine=nse-tandem
		;;
	nsr-tandem)
		basic_machine=nsr-tandem
		;;
	op50n-* | op60c-*)
		basic_machine=hppa1.1-oki
		os=-proelf
		;;
	openrisc | openrisc-*)
		basic_machine=or32-unknown
		;;
	os400)
		basic_machine=powerpc-ibm
		os=-os400
		;;
	OSE68000 | ose68000)
		basic_machine=m68000-ericsson
		os=-ose
		;;
	os68k)
		basic_machine=m68k-none
		os=-os68k
		;;
	pa-hitachi)
		basic_machine=hppa1.1-hitachi
		os=-hiuxwe2
		;;
	paragon)
		basic_machine=i860-intel
		os=-osf
		;;
	parisc)
		basic_machine=hppa-unknown
		os=-linux
		;;
	parisc-*)
		basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
		os=-linux
		;;
	pbd)
		basic_machine=sparc-tti
		;;
	pbb)
		basic_machine=m68k-tti
		;;
	pc532 | pc532-*)
		basic_machine=ns32k-pc532
		;;
	pc98)
		basic_machine=i386-pc
		;;
	pc98-*)
		basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
		;;
	pentium | p5 | k5 | k6 | nexgen | viac3)
		basic_machine=i586-pc
		;;
	pentiumpro | p6 | 6x86 | athlon | athlon_*)
		basic_machine=i686-pc
		;;
	pentiumii | pentium2 | pentiumiii | pentium3)
		basic_machine=i686-pc
		;;
	pentium4)
		basic_machine=i786-pc
		;;
	pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
		basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
		;;
	pentiumpro-* | p6-* | 6x86-* | athlon-*)
		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
		;;
	pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
		;;
	pentium4-*)
		basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
		;;
	pn)
		basic_machine=pn-gould
		;;
	power)	basic_machine=power-ibm
		;;
	ppc | ppcbe)	basic_machine=powerpc-unknown
		;;
	ppc-* | ppcbe-*)
		basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
		;;
	ppcle | powerpclittle)
		basic_machine=powerpcle-unknown
		;;
	ppcle-* | powerpclittle-*)
		basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
		;;
	ppc64)	basic_machine=powerpc64-unknown
		;;
	ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
		;;
	ppc64le | powerpc64little)
		basic_machine=powerpc64le-unknown
		;;
	ppc64le-* | powerpc64little-*)
		basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
		;;
	ps2)
		basic_machine=i386-ibm
		;;
	pw32)
		basic_machine=i586-unknown
		os=-pw32
		;;
	rdos | rdos64)
		basic_machine=x86_64-pc
		os=-rdos
		;;
	rdos32)
		basic_machine=i386-pc
		os=-rdos
		;;
	rom68k)
		basic_machine=m68k-rom68k
		os=-coff
		;;
	rm[46]00)
		basic_machine=mips-siemens
		;;
	rtpc | rtpc-*)
		basic_machine=romp-ibm
		;;
	s390 | s390-*)
		basic_machine=s390-ibm
		;;
	s390x | s390x-*)
		basic_machine=s390x-ibm
		;;
	sa29200)
		basic_machine=a29k-amd
		os=-udi
		;;
	sb1)
		basic_machine=mipsisa64sb1-unknown
		;;
	sb1el)
		basic_machine=mipsisa64sb1el-unknown
		;;
	sde)
		basic_machine=mipsisa32-sde
		os=-elf
		;;
	sei)
		basic_machine=mips-sei
		os=-seiux
		;;
	sequent)
		basic_machine=i386-sequent
		;;
	sh)
		basic_machine=sh-hitachi
		os=-hms
		;;
	sh5el)
		basic_machine=sh5le-unknown
		;;
	sh64)
		basic_machine=sh64-unknown
		;;
	sparclite-wrs | simso-wrs)
		basic_machine=sparclite-wrs
		os=-vxworks
		;;
	sps7)
		basic_machine=m68k-bull
		os=-sysv2
		;;
	spur)
		basic_machine=spur-unknown
		;;
	st2000)
		basic_machine=m68k-tandem
		;;
	stratus)
		basic_machine=i860-stratus
		os=-sysv4
		;;
	strongarm-* | thumb-*)
		basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
		;;
	sun2)
		basic_machine=m68000-sun
		;;
	sun2os3)
		basic_machine=m68000-sun
		os=-sunos3
		;;
	sun2os4)
		basic_machine=m68000-sun
		os=-sunos4
		;;
	sun3os3)
		basic_machine=m68k-sun
		os=-sunos3
		;;
	sun3os4)
		basic_machine=m68k-sun
		os=-sunos4
		;;
	sun4os3)
		basic_machine=sparc-sun
		os=-sunos3
		;;
	sun4os4)
		basic_machine=sparc-sun
		os=-sunos4
		;;
	sun4sol2)
		basic_machine=sparc-sun
		os=-solaris2
		;;
	sun3 | sun3-*)
		basic_machine=m68k-sun
		;;
	sun4)
		basic_machine=sparc-sun
		;;
	sun386 | sun386i | roadrunner)
		basic_machine=i386-sun
		;;
	sv1)
		basic_machine=sv1-cray
		os=-unicos
		;;
	symmetry)
		basic_machine=i386-sequent
		os=-dynix
		;;
	t3e)
		basic_machine=alphaev5-cray
		os=-unicos
		;;
	t90)
		basic_machine=t90-cray
		os=-unicos
		;;
	tile*)
		basic_machine=$basic_machine-unknown
		os=-linux-gnu
		;;
	tx39)
		basic_machine=mipstx39-unknown
		;;
	tx39el)
		basic_machine=mipstx39el-unknown
		;;
	toad1)
		basic_machine=pdp10-xkl
		os=-tops20
		;;
	tower | tower-32)
		basic_machine=m68k-ncr
		;;
	tpf)
		basic_machine=s390x-ibm
		os=-tpf
		;;
	udi29k)
		basic_machine=a29k-amd
		os=-udi
		;;
	ultra3)
		basic_machine=a29k-nyu
		os=-sym1
		;;
	v810 | necv810)
		basic_machine=v810-nec
		os=-none
		;;
	vaxv)
		basic_machine=vax-dec
		os=-sysv
		;;
	vms)
		basic_machine=vax-dec
		os=-vms
		;;
	vpp*|vx|vx-*)
		basic_machine=f301-fujitsu
		;;
	vxworks960)
		basic_machine=i960-wrs
		os=-vxworks
		;;
	vxworks68)
		basic_machine=m68k-wrs
		os=-vxworks
		;;
	vxworks29k)
		basic_machine=a29k-wrs
		os=-vxworks
		;;
	w65*)
		basic_machine=w65-wdc
		os=-none
		;;
	w89k-*)
		basic_machine=hppa1.1-winbond
		os=-proelf
		;;
	xbox)
		basic_machine=i686-pc
		os=-mingw32
		;;
	xps | xps100)
		basic_machine=xps100-honeywell
		;;
	xscale-* | xscalee[bl]-*)
		basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
		;;
	ymp)
		basic_machine=ymp-cray
		os=-unicos
		;;
	z8k-*-coff)
		basic_machine=z8k-unknown
		os=-sim
		;;
	z80-*-coff)
		basic_machine=z80-unknown
		os=-sim
		;;
	none)
		basic_machine=none-none
		os=-none
		;;

# Here we handle the default manufacturer of certain CPU types.  It is in
# some cases the only manufacturer, in others, it is the most popular.
	w89k)
		basic_machine=hppa1.1-winbond
		;;
	op50n)
		basic_machine=hppa1.1-oki
		;;
	op60c)
		basic_machine=hppa1.1-oki
		;;
	romp)
		basic_machine=romp-ibm
		;;
	mmix)
		basic_machine=mmix-knuth
		;;
	rs6000)
		basic_machine=rs6000-ibm
		;;
	vax)
		basic_machine=vax-dec
		;;
	pdp10)
		# there are many clones, so DEC is not a safe bet
		basic_machine=pdp10-unknown
		;;
	pdp11)
		basic_machine=pdp11-dec
		;;
	we32k)
		basic_machine=we32k-att
		;;
	sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
		basic_machine=sh-unknown
		;;
	sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
		basic_machine=sparc-sun
		;;
	cydra)
		basic_machine=cydra-cydrome
		;;
	orion)
		basic_machine=orion-highlevel
		;;
	orion105)
		basic_machine=clipper-highlevel
		;;
	mac | mpw | mac-mpw)
		basic_machine=m68k-apple
		;;
	pmac | pmac-mpw)
		basic_machine=powerpc-apple
		;;
	*-unknown)
		# Make sure to match an already-canonicalized machine name.
		;;
	*)
		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
		exit 1
		;;
esac

# Here we canonicalize certain aliases for manufacturers.
case $basic_machine in
	*-digital*)
		basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
		;;
	*-commodore*)
		basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
		;;
	*)
		;;
esac

# Decode manufacturer-specific aliases for certain operating systems.

if [ x"$os" != x"" ]
then
case $os in
	# First match some system type aliases
	# that might get confused with valid system types.
	# -solaris* is a basic system type, with this one exception.
	-auroraux)
		os=-auroraux
		;;
	-solaris1 | -solaris1.*)
		os=`echo $os | sed -e 's|solaris1|sunos4|'`
		;;
	-solaris)
		os=-solaris2
		;;
	-svr4*)
		os=-sysv4
		;;
	-unixware*)
		os=-sysv4.2uw
		;;
	-gnu/linux*)
		os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
		;;
	# First accept the basic system types.
	# The portable systems comes first.
	# Each alternative MUST END IN A *, to match a version number.
	# -sysv* is not here because it comes later, after sysvr4.
	-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
	      | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
	      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
	      | -sym* | -kopensolaris* | -plan9* \
	      | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
	      | -aos* | -aros* | -cloudabi* | -sortix* \
	      | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
	      | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
	      | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
	      | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \
	      | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
	      | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
	      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
	      | -chorusos* | -chorusrdb* | -cegcc* | -glidix* \
	      | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
	      | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
	      | -linux-newlib* | -linux-musl* | -linux-uclibc* \
	      | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \
	      | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
	      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
	      | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
	      | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
	      | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
	      | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
	      | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \
	      | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox*)
	# Remember, each alternative MUST END IN *, to match a version number.
		;;
	-qnx*)
		case $basic_machine in
		    x86-* | i*86-*)
			;;
		    *)
			os=-nto$os
			;;
		esac
		;;
	-nto-qnx*)
		;;
	-nto*)
		os=`echo $os | sed -e 's|nto|nto-qnx|'`
		;;
	-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
	      | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
	      | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
		;;
	-mac*)
		os=`echo $os | sed -e 's|mac|macos|'`
		;;
	-linux-dietlibc)
		os=-linux-dietlibc
		;;
	-linux*)
		os=`echo $os | sed -e 's|linux|linux-gnu|'`
		;;
	-sunos5*)
		os=`echo $os | sed -e 's|sunos5|solaris2|'`
		;;
	-sunos6*)
		os=`echo $os | sed -e 's|sunos6|solaris3|'`
		;;
	-opened*)
		os=-openedition
		;;
	-os400*)
		os=-os400
		;;
	-wince*)
		os=-wince
		;;
	-osfrose*)
		os=-osfrose
		;;
	-osf*)
		os=-osf
		;;
	-utek*)
		os=-bsd
		;;
	-dynix*)
		os=-bsd
		;;
	-acis*)
		os=-aos
		;;
	-atheos*)
		os=-atheos
		;;
	-syllable*)
		os=-syllable
		;;
	-386bsd)
		os=-bsd
		;;
	-ctix* | -uts*)
		os=-sysv
		;;
	-nova*)
		os=-rtmk-nova
		;;
	-ns2 )
		os=-nextstep2
		;;
	-nsk*)
		os=-nsk
		;;
	# Preserve the version number of sinix5.
	-sinix5.*)
		os=`echo $os | sed -e 's|sinix|sysv|'`
		;;
	-sinix*)
		os=-sysv4
		;;
	-tpf*)
		os=-tpf
		;;
	-triton*)
		os=-sysv3
		;;
	-oss*)
		os=-sysv3
		;;
	-svr4)
		os=-sysv4
		;;
	-svr3)
		os=-sysv3
		;;
	-sysvr4)
		os=-sysv4
		;;
	# This must come after -sysvr4.
	-sysv*)
		;;
	-ose*)
		os=-ose
		;;
	-es1800*)
		os=-ose
		;;
	-xenix)
		os=-xenix
		;;
	-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
		os=-mint
		;;
	-aros*)
		os=-aros
		;;
	-zvmoe)
		os=-zvmoe
		;;
	-dicos*)
		os=-dicos
		;;
	-nacl*)
		;;
	-ios)
		;;
	-none)
		;;
	*)
		# Get rid of the `-' at the beginning of $os.
		os=`echo $os | sed 's/[^-]*-//'`
		echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
		exit 1
		;;
esac
else

# Here we handle the default operating systems that come with various machines.
# The value should be what the vendor currently ships out the door with their
# machine or put another way, the most popular os provided with the machine.

# Note that if you're going to try to match "-MANUFACTURER" here (say,
# "-sun"), then you have to tell the case statement up towards the top
# that MANUFACTURER isn't an operating system.  Otherwise, code above
# will signal an error saying that MANUFACTURER isn't an operating
# system, and we'll never get to this point.

case $basic_machine in
	score-*)
		os=-elf
		;;
	spu-*)
		os=-elf
		;;
	*-acorn)
		os=-riscix1.2
		;;
	arm*-rebel)
		os=-linux
		;;
	arm*-semi)
		os=-aout
		;;
	c4x-* | tic4x-*)
		os=-coff
		;;
	c8051-*)
		os=-elf
		;;
	hexagon-*)
		os=-elf
		;;
	tic54x-*)
		os=-coff
		;;
	tic55x-*)
		os=-coff
		;;
	tic6x-*)
		os=-coff
		;;
	# This must come before the *-dec entry.
	pdp10-*)
		os=-tops20
		;;
	pdp11-*)
		os=-none
		;;
	*-dec | vax-*)
		os=-ultrix4.2
		;;
	m68*-apollo)
		os=-domain
		;;
	i386-sun)
		os=-sunos4.0.2
		;;
	m68000-sun)
		os=-sunos3
		;;
	m68*-cisco)
		os=-aout
		;;
	mep-*)
		os=-elf
		;;
	mips*-cisco)
		os=-elf
		;;
	mips*-*)
		os=-elf
		;;
	or32-*)
		os=-coff
		;;
	*-tti)	# must be before sparc entry or we get the wrong os.
		os=-sysv3
		;;
	sparc-* | *-sun)
		os=-sunos4.1.1
		;;
	pru-*)
		os=-elf
		;;
	*-be)
		os=-beos
		;;
	*-haiku)
		os=-haiku
		;;
	*-ibm)
		os=-aix
		;;
	*-knuth)
		os=-mmixware
		;;
	*-wec)
		os=-proelf
		;;
	*-winbond)
		os=-proelf
		;;
	*-oki)
		os=-proelf
		;;
	*-hp)
		os=-hpux
		;;
	*-hitachi)
		os=-hiux
		;;
	i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
		os=-sysv
		;;
	*-cbm)
		os=-amigaos
		;;
	*-dg)
		os=-dgux
		;;
	*-dolphin)
		os=-sysv3
		;;
	m68k-ccur)
		os=-rtu
		;;
	m88k-omron*)
		os=-luna
		;;
	*-next )
		os=-nextstep
		;;
	*-sequent)
		os=-ptx
		;;
	*-crds)
		os=-unos
		;;
	*-ns)
		os=-genix
		;;
	i370-*)
		os=-mvs
		;;
	*-next)
		os=-nextstep3
		;;
	*-gould)
		os=-sysv
		;;
	*-highlevel)
		os=-bsd
		;;
	*-encore)
		os=-bsd
		;;
	*-sgi)
		os=-irix
		;;
	*-siemens)
		os=-sysv4
		;;
	*-masscomp)
		os=-rtu
		;;
	f30[01]-fujitsu | f700-fujitsu)
		os=-uxpv
		;;
	*-rom68k)
		os=-coff
		;;
	*-*bug)
		os=-coff
		;;
	*-apple)
		os=-macos
		;;
	*-atari*)
		os=-mint
		;;
	*)
		os=-none
		;;
esac
fi

# Here we handle the case where we know the os, and the CPU type, but not the
# manufacturer.  We pick the logical manufacturer.
vendor=unknown
case $basic_machine in
	*-unknown)
		case $os in
			-riscix*)
				vendor=acorn
				;;
			-sunos*)
				vendor=sun
				;;
			-cnk*|-aix*)
				vendor=ibm
				;;
			-beos*)
				vendor=be
				;;
			-hpux*)
				vendor=hp
				;;
			-mpeix*)
				vendor=hp
				;;
			-hiux*)
				vendor=hitachi
				;;
			-unos*)
				vendor=crds
				;;
			-dgux*)
				vendor=dg
				;;
			-luna*)
				vendor=omron
				;;
			-genix*)
				vendor=ns
				;;
			-mvs* | -opened*)
				vendor=ibm
				;;
			-os400*)
				vendor=ibm
				;;
			-ptx*)
				vendor=sequent
				;;
			-tpf*)
				vendor=ibm
				;;
			-vxsim* | -vxworks* | -windiss*)
				vendor=wrs
				;;
			-aux*)
				vendor=apple
				;;
			-hms*)
				vendor=hitachi
				;;
			-mpw* | -macos*)
				vendor=apple
				;;
			-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
				vendor=atari
				;;
			-vos*)
				vendor=stratus
				;;
		esac
		basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
		;;
esac

echo $basic_machine$os
exit

# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "timestamp='"
# time-stamp-format: "%:y-%02m-%02d"
# time-stamp-end: "'"
# End:
@


