config.sub revision 0103645b
1100ae103Smrg#! /bin/sh 2100ae103Smrg# Configuration validation subroutine script. 30103645bSmrg# Copyright 1992-2021 Free Software Foundation, Inc. 4100ae103Smrg 50103645bSmrg# shellcheck disable=SC2006,SC2268 # see below for rationale 60103645bSmrg 70103645bSmrgtimestamp='2021-08-14' 8100ae103Smrg 995cf0c00Smrg# This file is free software; you can redistribute it and/or modify it 1095cf0c00Smrg# under the terms of the GNU General Public License as published by 1195cf0c00Smrg# the Free Software Foundation; either version 3 of the License, or 12100ae103Smrg# (at your option) any later version. 13100ae103Smrg# 1495cf0c00Smrg# This program is distributed in the hope that it will be useful, but 1595cf0c00Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of 1695cf0c00Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 1795cf0c00Smrg# General Public License for more details. 18100ae103Smrg# 19100ae103Smrg# You should have received a copy of the GNU General Public License 2095cf0c00Smrg# along with this program; if not, see <https://www.gnu.org/licenses/>. 21100ae103Smrg# 22100ae103Smrg# As a special exception to the GNU General Public License, if you 23100ae103Smrg# distribute this file as part of a program that contains a 24100ae103Smrg# configuration script generated by Autoconf, you may include it under 2595cf0c00Smrg# the same distribution terms that you use for the rest of that 2695cf0c00Smrg# program. This Exception is an additional permission under section 7 2795cf0c00Smrg# of the GNU General Public License, version 3 ("GPLv3"). 28100ae103Smrg 29100ae103Smrg 3095cf0c00Smrg# Please send patches to <config-patches@gnu.org>. 31100ae103Smrg# 32100ae103Smrg# Configuration subroutine to validate and canonicalize a configuration type. 33100ae103Smrg# Supply the specified configuration type as an argument. 34100ae103Smrg# If it is invalid, we print an error message on stderr and exit with code 1. 35100ae103Smrg# Otherwise, we print the canonical config type on stdout and succeed. 36100ae103Smrg 37165cb819Smrg# You can get the latest version of this script from: 380103645bSmrg# https://git.savannah.gnu.org/cgit/config.git/plain/config.sub 39165cb819Smrg 40100ae103Smrg# This file is supposed to be the same for all GNU packages 41100ae103Smrg# and recognize all the CPU types, system types and aliases 42100ae103Smrg# that are meaningful with *any* GNU software. 43100ae103Smrg# Each package is responsible for reporting which valid configurations 44100ae103Smrg# it does not support. The user should be able to distinguish 45100ae103Smrg# a failure to support a valid configuration from a meaningless 46100ae103Smrg# configuration. 47100ae103Smrg 48100ae103Smrg# The goal of this file is to map all the various variations of a given 49100ae103Smrg# machine specification into a single specification in the form: 50100ae103Smrg# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM 51100ae103Smrg# or in some cases, the newer four-part form: 52100ae103Smrg# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM 53100ae103Smrg# It is wrong to echo any other type of specification. 54100ae103Smrg 550103645bSmrg# The "shellcheck disable" line above the timestamp inhibits complaints 560103645bSmrg# about features and limitations of the classic Bourne shell that were 570103645bSmrg# superseded or lifted in POSIX. However, this script identifies a wide 580103645bSmrg# variety of pre-POSIX systems that do not have POSIX shells at all, and 590103645bSmrg# even some reasonably current systems (Solaris 10 as case-in-point) still 600103645bSmrg# have a pre-POSIX /bin/sh. 610103645bSmrg 62100ae103Smrgme=`echo "$0" | sed -e 's,.*/,,'` 63100ae103Smrg 64100ae103Smrgusage="\ 6595cf0c00SmrgUsage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS 66100ae103Smrg 67100ae103SmrgCanonicalize a configuration name. 68100ae103Smrg 6995cf0c00SmrgOptions: 70100ae103Smrg -h, --help print this help, then exit 71100ae103Smrg -t, --time-stamp print date of last modification, then exit 72100ae103Smrg -v, --version print version number, then exit 73100ae103Smrg 74100ae103SmrgReport bugs and patches to <config-patches@gnu.org>." 75100ae103Smrg 76100ae103Smrgversion="\ 77100ae103SmrgGNU config.sub ($timestamp) 78100ae103Smrg 790103645bSmrgCopyright 1992-2021 Free Software Foundation, Inc. 80100ae103Smrg 81100ae103SmrgThis is free software; see the source for copying conditions. There is NO 82100ae103Smrgwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." 83100ae103Smrg 84100ae103Smrghelp=" 85100ae103SmrgTry \`$me --help' for more information." 86100ae103Smrg 87100ae103Smrg# Parse command line 88100ae103Smrgwhile test $# -gt 0 ; do 89100ae103Smrg case $1 in 90100ae103Smrg --time-stamp | --time* | -t ) 91100ae103Smrg echo "$timestamp" ; exit ;; 92100ae103Smrg --version | -v ) 93100ae103Smrg echo "$version" ; exit ;; 94100ae103Smrg --help | --h* | -h ) 95100ae103Smrg echo "$usage"; exit ;; 96100ae103Smrg -- ) # Stop option processing 97100ae103Smrg shift; break ;; 98100ae103Smrg - ) # Use stdin as input. 99100ae103Smrg break ;; 100100ae103Smrg -* ) 1010103645bSmrg echo "$me: invalid option $1$help" >&2 102100ae103Smrg exit 1 ;; 103100ae103Smrg 104100ae103Smrg *local*) 105100ae103Smrg # First pass through any local machine types. 10695cf0c00Smrg echo "$1" 107100ae103Smrg exit ;; 108100ae103Smrg 109100ae103Smrg * ) 110100ae103Smrg break ;; 111100ae103Smrg esac 112100ae103Smrgdone 113100ae103Smrg 114100ae103Smrgcase $# in 115100ae103Smrg 0) echo "$me: missing argument$help" >&2 116100ae103Smrg exit 1;; 117100ae103Smrg 1) ;; 118100ae103Smrg *) echo "$me: too many arguments$help" >&2 119100ae103Smrg exit 1;; 120100ae103Smrgesac 121100ae103Smrg 1220103645bSmrg# Split fields of configuration type 1230103645bSmrg# shellcheck disable=SC2162 1240103645bSmrgsaved_IFS=$IFS 1250103645bSmrgIFS="-" read field1 field2 field3 field4 <<EOF 1260103645bSmrg$1 1270103645bSmrgEOF 1280103645bSmrgIFS=$saved_IFS 129100ae103Smrg 1300103645bSmrg# Separate into logical components for further validation 1310103645bSmrgcase $1 in 1320103645bSmrg *-*-*-*-*) 1330103645bSmrg echo Invalid configuration \`"$1"\': more than four components >&2 1340103645bSmrg exit 1 135100ae103Smrg ;; 1360103645bSmrg *-*-*-*) 1370103645bSmrg basic_machine=$field1-$field2 1380103645bSmrg basic_os=$field3-$field4 139100ae103Smrg ;; 1400103645bSmrg *-*-*) 1410103645bSmrg # Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two 1420103645bSmrg # parts 1430103645bSmrg maybe_os=$field2-$field3 1440103645bSmrg case $maybe_os in 1450103645bSmrg nto-qnx* | linux-* | uclinux-uclibc* \ 1460103645bSmrg | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \ 1470103645bSmrg | netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \ 1480103645bSmrg | storm-chaos* | os2-emx* | rtmk-nova*) 1490103645bSmrg basic_machine=$field1 1500103645bSmrg basic_os=$maybe_os 1510103645bSmrg ;; 1520103645bSmrg android-linux) 1530103645bSmrg basic_machine=$field1-unknown 1540103645bSmrg basic_os=linux-android 1550103645bSmrg ;; 1560103645bSmrg *) 1570103645bSmrg basic_machine=$field1-$field2 1580103645bSmrg basic_os=$field3 1590103645bSmrg ;; 1600103645bSmrg esac 161100ae103Smrg ;; 1620103645bSmrg *-*) 1630103645bSmrg # A lone config we happen to match not fitting any pattern 1640103645bSmrg case $field1-$field2 in 1650103645bSmrg decstation-3100) 1660103645bSmrg basic_machine=mips-dec 1670103645bSmrg basic_os= 1680103645bSmrg ;; 1690103645bSmrg *-*) 1700103645bSmrg # Second component is usually, but not always the OS 1710103645bSmrg case $field2 in 1720103645bSmrg # Prevent following clause from handling this valid os 1730103645bSmrg sun*os*) 1740103645bSmrg basic_machine=$field1 1750103645bSmrg basic_os=$field2 1760103645bSmrg ;; 1770103645bSmrg zephyr*) 1780103645bSmrg basic_machine=$field1-unknown 1790103645bSmrg basic_os=$field2 1800103645bSmrg ;; 1810103645bSmrg # Manufacturers 1820103645bSmrg dec* | mips* | sequent* | encore* | pc533* | sgi* | sony* \ 1830103645bSmrg | att* | 7300* | 3300* | delta* | motorola* | sun[234]* \ 1840103645bSmrg | unicom* | ibm* | next | hp | isi* | apollo | altos* \ 1850103645bSmrg | convergent* | ncr* | news | 32* | 3600* | 3100* \ 1860103645bSmrg | hitachi* | c[123]* | convex* | sun | crds | omron* | dg \ 1870103645bSmrg | ultra | tti* | harris | dolphin | highlevel | gould \ 1880103645bSmrg | cbm | ns | masscomp | apple | axis | knuth | cray \ 1890103645bSmrg | microblaze* | sim | cisco \ 1900103645bSmrg | oki | wec | wrs | winbond) 1910103645bSmrg basic_machine=$field1-$field2 1920103645bSmrg basic_os= 1930103645bSmrg ;; 1940103645bSmrg *) 1950103645bSmrg basic_machine=$field1 1960103645bSmrg basic_os=$field2 1970103645bSmrg ;; 1980103645bSmrg esac 1990103645bSmrg ;; 2000103645bSmrg esac 201100ae103Smrg ;; 2020103645bSmrg *) 2030103645bSmrg # Convert single-component short-hands not valid as part of 2040103645bSmrg # multi-component configurations. 2050103645bSmrg case $field1 in 2060103645bSmrg 386bsd) 2070103645bSmrg basic_machine=i386-pc 2080103645bSmrg basic_os=bsd 2090103645bSmrg ;; 2100103645bSmrg a29khif) 2110103645bSmrg basic_machine=a29k-amd 2120103645bSmrg basic_os=udi 2130103645bSmrg ;; 2140103645bSmrg adobe68k) 2150103645bSmrg basic_machine=m68010-adobe 2160103645bSmrg basic_os=scout 2170103645bSmrg ;; 2180103645bSmrg alliant) 2190103645bSmrg basic_machine=fx80-alliant 2200103645bSmrg basic_os= 2210103645bSmrg ;; 2220103645bSmrg altos | altos3068) 2230103645bSmrg basic_machine=m68k-altos 2240103645bSmrg basic_os= 2250103645bSmrg ;; 2260103645bSmrg am29k) 2270103645bSmrg basic_machine=a29k-none 2280103645bSmrg basic_os=bsd 2290103645bSmrg ;; 2300103645bSmrg amdahl) 2310103645bSmrg basic_machine=580-amdahl 2320103645bSmrg basic_os=sysv 2330103645bSmrg ;; 2340103645bSmrg amiga) 2350103645bSmrg basic_machine=m68k-unknown 2360103645bSmrg basic_os= 2370103645bSmrg ;; 2380103645bSmrg amigaos | amigados) 2390103645bSmrg basic_machine=m68k-unknown 2400103645bSmrg basic_os=amigaos 2410103645bSmrg ;; 2420103645bSmrg amigaunix | amix) 2430103645bSmrg basic_machine=m68k-unknown 2440103645bSmrg basic_os=sysv4 2450103645bSmrg ;; 2460103645bSmrg apollo68) 2470103645bSmrg basic_machine=m68k-apollo 2480103645bSmrg basic_os=sysv 2490103645bSmrg ;; 2500103645bSmrg apollo68bsd) 2510103645bSmrg basic_machine=m68k-apollo 2520103645bSmrg basic_os=bsd 2530103645bSmrg ;; 2540103645bSmrg aros) 2550103645bSmrg basic_machine=i386-pc 2560103645bSmrg basic_os=aros 2570103645bSmrg ;; 2580103645bSmrg aux) 2590103645bSmrg basic_machine=m68k-apple 2600103645bSmrg basic_os=aux 2610103645bSmrg ;; 2620103645bSmrg balance) 2630103645bSmrg basic_machine=ns32k-sequent 2640103645bSmrg basic_os=dynix 2650103645bSmrg ;; 2660103645bSmrg blackfin) 2670103645bSmrg basic_machine=bfin-unknown 2680103645bSmrg basic_os=linux 2690103645bSmrg ;; 2700103645bSmrg cegcc) 2710103645bSmrg basic_machine=arm-unknown 2720103645bSmrg basic_os=cegcc 2730103645bSmrg ;; 2740103645bSmrg convex-c1) 2750103645bSmrg basic_machine=c1-convex 2760103645bSmrg basic_os=bsd 2770103645bSmrg ;; 2780103645bSmrg convex-c2) 2790103645bSmrg basic_machine=c2-convex 2800103645bSmrg basic_os=bsd 2810103645bSmrg ;; 2820103645bSmrg convex-c32) 2830103645bSmrg basic_machine=c32-convex 2840103645bSmrg basic_os=bsd 2850103645bSmrg ;; 2860103645bSmrg convex-c34) 2870103645bSmrg basic_machine=c34-convex 2880103645bSmrg basic_os=bsd 2890103645bSmrg ;; 2900103645bSmrg convex-c38) 2910103645bSmrg basic_machine=c38-convex 2920103645bSmrg basic_os=bsd 2930103645bSmrg ;; 2940103645bSmrg cray) 2950103645bSmrg basic_machine=j90-cray 2960103645bSmrg basic_os=unicos 2970103645bSmrg ;; 2980103645bSmrg crds | unos) 2990103645bSmrg basic_machine=m68k-crds 3000103645bSmrg basic_os= 3010103645bSmrg ;; 3020103645bSmrg da30) 3030103645bSmrg basic_machine=m68k-da30 3040103645bSmrg basic_os= 3050103645bSmrg ;; 3060103645bSmrg decstation | pmax | pmin | dec3100 | decstatn) 3070103645bSmrg basic_machine=mips-dec 3080103645bSmrg basic_os= 3090103645bSmrg ;; 3100103645bSmrg delta88) 3110103645bSmrg basic_machine=m88k-motorola 3120103645bSmrg basic_os=sysv3 3130103645bSmrg ;; 3140103645bSmrg dicos) 3150103645bSmrg basic_machine=i686-pc 3160103645bSmrg basic_os=dicos 3170103645bSmrg ;; 3180103645bSmrg djgpp) 3190103645bSmrg basic_machine=i586-pc 3200103645bSmrg basic_os=msdosdjgpp 3210103645bSmrg ;; 3220103645bSmrg ebmon29k) 3230103645bSmrg basic_machine=a29k-amd 3240103645bSmrg basic_os=ebmon 3250103645bSmrg ;; 3260103645bSmrg es1800 | OSE68k | ose68k | ose | OSE) 3270103645bSmrg basic_machine=m68k-ericsson 3280103645bSmrg basic_os=ose 3290103645bSmrg ;; 3300103645bSmrg gmicro) 3310103645bSmrg basic_machine=tron-gmicro 3320103645bSmrg basic_os=sysv 3330103645bSmrg ;; 3340103645bSmrg go32) 3350103645bSmrg basic_machine=i386-pc 3360103645bSmrg basic_os=go32 3370103645bSmrg ;; 3380103645bSmrg h8300hms) 3390103645bSmrg basic_machine=h8300-hitachi 3400103645bSmrg basic_os=hms 3410103645bSmrg ;; 3420103645bSmrg h8300xray) 3430103645bSmrg basic_machine=h8300-hitachi 3440103645bSmrg basic_os=xray 3450103645bSmrg ;; 3460103645bSmrg h8500hms) 3470103645bSmrg basic_machine=h8500-hitachi 3480103645bSmrg basic_os=hms 3490103645bSmrg ;; 3500103645bSmrg harris) 3510103645bSmrg basic_machine=m88k-harris 3520103645bSmrg basic_os=sysv3 3530103645bSmrg ;; 3540103645bSmrg hp300 | hp300hpux) 3550103645bSmrg basic_machine=m68k-hp 3560103645bSmrg basic_os=hpux 3570103645bSmrg ;; 3580103645bSmrg hp300bsd) 3590103645bSmrg basic_machine=m68k-hp 3600103645bSmrg basic_os=bsd 3610103645bSmrg ;; 3620103645bSmrg hppaosf) 3630103645bSmrg basic_machine=hppa1.1-hp 3640103645bSmrg basic_os=osf 3650103645bSmrg ;; 3660103645bSmrg hppro) 3670103645bSmrg basic_machine=hppa1.1-hp 3680103645bSmrg basic_os=proelf 3690103645bSmrg ;; 3700103645bSmrg i386mach) 3710103645bSmrg basic_machine=i386-mach 3720103645bSmrg basic_os=mach 3730103645bSmrg ;; 3740103645bSmrg isi68 | isi) 3750103645bSmrg basic_machine=m68k-isi 3760103645bSmrg basic_os=sysv 3770103645bSmrg ;; 3780103645bSmrg m68knommu) 3790103645bSmrg basic_machine=m68k-unknown 3800103645bSmrg basic_os=linux 3810103645bSmrg ;; 3820103645bSmrg magnum | m3230) 3830103645bSmrg basic_machine=mips-mips 3840103645bSmrg basic_os=sysv 3850103645bSmrg ;; 3860103645bSmrg merlin) 3870103645bSmrg basic_machine=ns32k-utek 3880103645bSmrg basic_os=sysv 3890103645bSmrg ;; 3900103645bSmrg mingw64) 3910103645bSmrg basic_machine=x86_64-pc 3920103645bSmrg basic_os=mingw64 3930103645bSmrg ;; 3940103645bSmrg mingw32) 3950103645bSmrg basic_machine=i686-pc 3960103645bSmrg basic_os=mingw32 3970103645bSmrg ;; 3980103645bSmrg mingw32ce) 3990103645bSmrg basic_machine=arm-unknown 4000103645bSmrg basic_os=mingw32ce 4010103645bSmrg ;; 4020103645bSmrg monitor) 4030103645bSmrg basic_machine=m68k-rom68k 4040103645bSmrg basic_os=coff 4050103645bSmrg ;; 4060103645bSmrg morphos) 4070103645bSmrg basic_machine=powerpc-unknown 4080103645bSmrg basic_os=morphos 4090103645bSmrg ;; 4100103645bSmrg moxiebox) 4110103645bSmrg basic_machine=moxie-unknown 4120103645bSmrg basic_os=moxiebox 4130103645bSmrg ;; 4140103645bSmrg msdos) 4150103645bSmrg basic_machine=i386-pc 4160103645bSmrg basic_os=msdos 4170103645bSmrg ;; 4180103645bSmrg msys) 4190103645bSmrg basic_machine=i686-pc 4200103645bSmrg basic_os=msys 4210103645bSmrg ;; 4220103645bSmrg mvs) 4230103645bSmrg basic_machine=i370-ibm 4240103645bSmrg basic_os=mvs 4250103645bSmrg ;; 4260103645bSmrg nacl) 4270103645bSmrg basic_machine=le32-unknown 4280103645bSmrg basic_os=nacl 4290103645bSmrg ;; 4300103645bSmrg ncr3000) 4310103645bSmrg basic_machine=i486-ncr 4320103645bSmrg basic_os=sysv4 4330103645bSmrg ;; 4340103645bSmrg netbsd386) 4350103645bSmrg basic_machine=i386-pc 4360103645bSmrg basic_os=netbsd 4370103645bSmrg ;; 4380103645bSmrg netwinder) 4390103645bSmrg basic_machine=armv4l-rebel 4400103645bSmrg basic_os=linux 4410103645bSmrg ;; 4420103645bSmrg news | news700 | news800 | news900) 4430103645bSmrg basic_machine=m68k-sony 4440103645bSmrg basic_os=newsos 4450103645bSmrg ;; 4460103645bSmrg news1000) 4470103645bSmrg basic_machine=m68030-sony 4480103645bSmrg basic_os=newsos 4490103645bSmrg ;; 4500103645bSmrg necv70) 4510103645bSmrg basic_machine=v70-nec 4520103645bSmrg basic_os=sysv 4530103645bSmrg ;; 4540103645bSmrg nh3000) 4550103645bSmrg basic_machine=m68k-harris 4560103645bSmrg basic_os=cxux 4570103645bSmrg ;; 4580103645bSmrg nh[45]000) 4590103645bSmrg basic_machine=m88k-harris 4600103645bSmrg basic_os=cxux 4610103645bSmrg ;; 4620103645bSmrg nindy960) 4630103645bSmrg basic_machine=i960-intel 4640103645bSmrg basic_os=nindy 4650103645bSmrg ;; 4660103645bSmrg mon960) 4670103645bSmrg basic_machine=i960-intel 4680103645bSmrg basic_os=mon960 4690103645bSmrg ;; 4700103645bSmrg nonstopux) 4710103645bSmrg basic_machine=mips-compaq 4720103645bSmrg basic_os=nonstopux 4730103645bSmrg ;; 4740103645bSmrg os400) 4750103645bSmrg basic_machine=powerpc-ibm 4760103645bSmrg basic_os=os400 4770103645bSmrg ;; 4780103645bSmrg OSE68000 | ose68000) 4790103645bSmrg basic_machine=m68000-ericsson 4800103645bSmrg basic_os=ose 4810103645bSmrg ;; 4820103645bSmrg os68k) 4830103645bSmrg basic_machine=m68k-none 4840103645bSmrg basic_os=os68k 4850103645bSmrg ;; 4860103645bSmrg paragon) 4870103645bSmrg basic_machine=i860-intel 4880103645bSmrg basic_os=osf 4890103645bSmrg ;; 4900103645bSmrg parisc) 4910103645bSmrg basic_machine=hppa-unknown 4920103645bSmrg basic_os=linux 4930103645bSmrg ;; 4940103645bSmrg psp) 4950103645bSmrg basic_machine=mipsallegrexel-sony 4960103645bSmrg basic_os=psp 4970103645bSmrg ;; 4980103645bSmrg pw32) 4990103645bSmrg basic_machine=i586-unknown 5000103645bSmrg basic_os=pw32 5010103645bSmrg ;; 5020103645bSmrg rdos | rdos64) 5030103645bSmrg basic_machine=x86_64-pc 5040103645bSmrg basic_os=rdos 5050103645bSmrg ;; 5060103645bSmrg rdos32) 5070103645bSmrg basic_machine=i386-pc 5080103645bSmrg basic_os=rdos 5090103645bSmrg ;; 5100103645bSmrg rom68k) 5110103645bSmrg basic_machine=m68k-rom68k 5120103645bSmrg basic_os=coff 5130103645bSmrg ;; 5140103645bSmrg sa29200) 5150103645bSmrg basic_machine=a29k-amd 5160103645bSmrg basic_os=udi 5170103645bSmrg ;; 5180103645bSmrg sei) 5190103645bSmrg basic_machine=mips-sei 5200103645bSmrg basic_os=seiux 5210103645bSmrg ;; 5220103645bSmrg sequent) 5230103645bSmrg basic_machine=i386-sequent 5240103645bSmrg basic_os= 5250103645bSmrg ;; 5260103645bSmrg sps7) 5270103645bSmrg basic_machine=m68k-bull 5280103645bSmrg basic_os=sysv2 5290103645bSmrg ;; 5300103645bSmrg st2000) 5310103645bSmrg basic_machine=m68k-tandem 5320103645bSmrg basic_os= 5330103645bSmrg ;; 5340103645bSmrg stratus) 5350103645bSmrg basic_machine=i860-stratus 5360103645bSmrg basic_os=sysv4 5370103645bSmrg ;; 5380103645bSmrg sun2) 5390103645bSmrg basic_machine=m68000-sun 5400103645bSmrg basic_os= 5410103645bSmrg ;; 5420103645bSmrg sun2os3) 5430103645bSmrg basic_machine=m68000-sun 5440103645bSmrg basic_os=sunos3 5450103645bSmrg ;; 5460103645bSmrg sun2os4) 5470103645bSmrg basic_machine=m68000-sun 5480103645bSmrg basic_os=sunos4 5490103645bSmrg ;; 5500103645bSmrg sun3) 5510103645bSmrg basic_machine=m68k-sun 5520103645bSmrg basic_os= 5530103645bSmrg ;; 5540103645bSmrg sun3os3) 5550103645bSmrg basic_machine=m68k-sun 5560103645bSmrg basic_os=sunos3 5570103645bSmrg ;; 5580103645bSmrg sun3os4) 5590103645bSmrg basic_machine=m68k-sun 5600103645bSmrg basic_os=sunos4 5610103645bSmrg ;; 5620103645bSmrg sun4) 5630103645bSmrg basic_machine=sparc-sun 5640103645bSmrg basic_os= 5650103645bSmrg ;; 5660103645bSmrg sun4os3) 5670103645bSmrg basic_machine=sparc-sun 5680103645bSmrg basic_os=sunos3 5690103645bSmrg ;; 5700103645bSmrg sun4os4) 5710103645bSmrg basic_machine=sparc-sun 5720103645bSmrg basic_os=sunos4 5730103645bSmrg ;; 5740103645bSmrg sun4sol2) 5750103645bSmrg basic_machine=sparc-sun 5760103645bSmrg basic_os=solaris2 5770103645bSmrg ;; 5780103645bSmrg sun386 | sun386i | roadrunner) 5790103645bSmrg basic_machine=i386-sun 5800103645bSmrg basic_os= 5810103645bSmrg ;; 5820103645bSmrg sv1) 5830103645bSmrg basic_machine=sv1-cray 5840103645bSmrg basic_os=unicos 5850103645bSmrg ;; 5860103645bSmrg symmetry) 5870103645bSmrg basic_machine=i386-sequent 5880103645bSmrg basic_os=dynix 5890103645bSmrg ;; 5900103645bSmrg t3e) 5910103645bSmrg basic_machine=alphaev5-cray 5920103645bSmrg basic_os=unicos 5930103645bSmrg ;; 5940103645bSmrg t90) 5950103645bSmrg basic_machine=t90-cray 5960103645bSmrg basic_os=unicos 5970103645bSmrg ;; 5980103645bSmrg toad1) 5990103645bSmrg basic_machine=pdp10-xkl 6000103645bSmrg basic_os=tops20 6010103645bSmrg ;; 6020103645bSmrg tpf) 6030103645bSmrg basic_machine=s390x-ibm 6040103645bSmrg basic_os=tpf 6050103645bSmrg ;; 6060103645bSmrg udi29k) 6070103645bSmrg basic_machine=a29k-amd 6080103645bSmrg basic_os=udi 6090103645bSmrg ;; 6100103645bSmrg ultra3) 6110103645bSmrg basic_machine=a29k-nyu 6120103645bSmrg basic_os=sym1 6130103645bSmrg ;; 6140103645bSmrg v810 | necv810) 6150103645bSmrg basic_machine=v810-nec 6160103645bSmrg basic_os=none 6170103645bSmrg ;; 6180103645bSmrg vaxv) 6190103645bSmrg basic_machine=vax-dec 6200103645bSmrg basic_os=sysv 6210103645bSmrg ;; 6220103645bSmrg vms) 6230103645bSmrg basic_machine=vax-dec 6240103645bSmrg basic_os=vms 6250103645bSmrg ;; 6260103645bSmrg vsta) 6270103645bSmrg basic_machine=i386-pc 6280103645bSmrg basic_os=vsta 6290103645bSmrg ;; 6300103645bSmrg vxworks960) 6310103645bSmrg basic_machine=i960-wrs 6320103645bSmrg basic_os=vxworks 6330103645bSmrg ;; 6340103645bSmrg vxworks68) 6350103645bSmrg basic_machine=m68k-wrs 6360103645bSmrg basic_os=vxworks 6370103645bSmrg ;; 6380103645bSmrg vxworks29k) 6390103645bSmrg basic_machine=a29k-wrs 6400103645bSmrg basic_os=vxworks 6410103645bSmrg ;; 6420103645bSmrg xbox) 6430103645bSmrg basic_machine=i686-pc 6440103645bSmrg basic_os=mingw32 6450103645bSmrg ;; 6460103645bSmrg ymp) 6470103645bSmrg basic_machine=ymp-cray 6480103645bSmrg basic_os=unicos 6490103645bSmrg ;; 6500103645bSmrg *) 6510103645bSmrg basic_machine=$1 6520103645bSmrg basic_os= 6530103645bSmrg ;; 6540103645bSmrg esac 655100ae103Smrg ;; 656100ae103Smrgesac 657100ae103Smrg 6580103645bSmrg# Decode 1-component or ad-hoc basic machines 659100ae103Smrgcase $basic_machine in 6600103645bSmrg # Here we handle the default manufacturer of certain CPU types. It is in 6610103645bSmrg # some cases the only manufacturer, in others, it is the most popular. 6620103645bSmrg w89k) 6630103645bSmrg cpu=hppa1.1 6640103645bSmrg vendor=winbond 66595cf0c00Smrg ;; 6660103645bSmrg op50n) 6670103645bSmrg cpu=hppa1.1 6680103645bSmrg vendor=oki 669100ae103Smrg ;; 6700103645bSmrg op60c) 6710103645bSmrg cpu=hppa1.1 6720103645bSmrg vendor=oki 673100ae103Smrg ;; 6740103645bSmrg ibm*) 6750103645bSmrg cpu=i370 6760103645bSmrg vendor=ibm 677165cb819Smrg ;; 6780103645bSmrg orion105) 6790103645bSmrg cpu=clipper 6800103645bSmrg vendor=highlevel 68195cf0c00Smrg ;; 6820103645bSmrg mac | mpw | mac-mpw) 6830103645bSmrg cpu=m68k 6840103645bSmrg vendor=apple 6858831d3fbSmrg ;; 6860103645bSmrg pmac | pmac-mpw) 6870103645bSmrg cpu=powerpc 6880103645bSmrg vendor=apple 6898831d3fbSmrg ;; 6908831d3fbSmrg 691100ae103Smrg # Recognize the various machine names and aliases which stand 692100ae103Smrg # for a CPU type and a company and sometimes even an OS. 693100ae103Smrg 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) 6940103645bSmrg cpu=m68000 6950103645bSmrg vendor=att 696100ae103Smrg ;; 697100ae103Smrg 3b*) 6980103645bSmrg cpu=we32k 6990103645bSmrg vendor=att 700165cb819Smrg ;; 701165cb819Smrg bluegene*) 7020103645bSmrg cpu=powerpc 7030103645bSmrg vendor=ibm 7040103645bSmrg basic_os=cnk 705100ae103Smrg ;; 706100ae103Smrg decsystem10* | dec10*) 7070103645bSmrg cpu=pdp10 7080103645bSmrg vendor=dec 7090103645bSmrg basic_os=tops10 710100ae103Smrg ;; 711100ae103Smrg decsystem20* | dec20*) 7120103645bSmrg cpu=pdp10 7130103645bSmrg vendor=dec 7140103645bSmrg basic_os=tops20 715100ae103Smrg ;; 716100ae103Smrg delta | 3300 | motorola-3300 | motorola-delta \ 717100ae103Smrg | 3300-motorola | delta-motorola) 7180103645bSmrg cpu=m68k 7190103645bSmrg vendor=motorola 720100ae103Smrg ;; 72195cf0c00Smrg dpx2*) 7220103645bSmrg cpu=m68k 7230103645bSmrg vendor=bull 7240103645bSmrg basic_os=sysv3 725100ae103Smrg ;; 726100ae103Smrg encore | umax | mmax) 7270103645bSmrg cpu=ns32k 7280103645bSmrg vendor=encore 729100ae103Smrg ;; 7300103645bSmrg elxsi) 7310103645bSmrg cpu=elxsi 7320103645bSmrg vendor=elxsi 7330103645bSmrg basic_os=${basic_os:-bsd} 734100ae103Smrg ;; 735100ae103Smrg fx2800) 7360103645bSmrg cpu=i860 7370103645bSmrg vendor=alliant 738100ae103Smrg ;; 739100ae103Smrg genix) 7400103645bSmrg cpu=ns32k 7410103645bSmrg vendor=ns 742100ae103Smrg ;; 743100ae103Smrg h3050r* | hiux*) 7440103645bSmrg cpu=hppa1.1 7450103645bSmrg vendor=hitachi 7460103645bSmrg basic_os=hiuxwe2 747100ae103Smrg ;; 748100ae103Smrg hp3k9[0-9][0-9] | hp9[0-9][0-9]) 7490103645bSmrg cpu=hppa1.0 7500103645bSmrg vendor=hp 751100ae103Smrg ;; 752100ae103Smrg hp9k2[0-9][0-9] | hp9k31[0-9]) 7530103645bSmrg cpu=m68000 7540103645bSmrg vendor=hp 755100ae103Smrg ;; 756100ae103Smrg hp9k3[2-9][0-9]) 7570103645bSmrg cpu=m68k 7580103645bSmrg vendor=hp 759100ae103Smrg ;; 760100ae103Smrg hp9k6[0-9][0-9] | hp6[0-9][0-9]) 7610103645bSmrg cpu=hppa1.0 7620103645bSmrg vendor=hp 763100ae103Smrg ;; 764100ae103Smrg hp9k7[0-79][0-9] | hp7[0-79][0-9]) 7650103645bSmrg cpu=hppa1.1 7660103645bSmrg vendor=hp 767100ae103Smrg ;; 768100ae103Smrg hp9k78[0-9] | hp78[0-9]) 769100ae103Smrg # FIXME: really hppa2.0-hp 7700103645bSmrg cpu=hppa1.1 7710103645bSmrg vendor=hp 772100ae103Smrg ;; 773100ae103Smrg hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) 774100ae103Smrg # FIXME: really hppa2.0-hp 7750103645bSmrg cpu=hppa1.1 7760103645bSmrg vendor=hp 777100ae103Smrg ;; 778100ae103Smrg hp9k8[0-9][13679] | hp8[0-9][13679]) 7790103645bSmrg cpu=hppa1.1 7800103645bSmrg vendor=hp 781100ae103Smrg ;; 782100ae103Smrg hp9k8[0-9][0-9] | hp8[0-9][0-9]) 7830103645bSmrg cpu=hppa1.0 7840103645bSmrg vendor=hp 785100ae103Smrg ;; 786100ae103Smrg i*86v32) 7870103645bSmrg cpu=`echo "$1" | sed -e 's/86.*/86/'` 7880103645bSmrg vendor=pc 7890103645bSmrg basic_os=sysv32 790100ae103Smrg ;; 791100ae103Smrg i*86v4*) 7920103645bSmrg cpu=`echo "$1" | sed -e 's/86.*/86/'` 7930103645bSmrg vendor=pc 7940103645bSmrg basic_os=sysv4 795100ae103Smrg ;; 796100ae103Smrg i*86v) 7970103645bSmrg cpu=`echo "$1" | sed -e 's/86.*/86/'` 7980103645bSmrg vendor=pc 7990103645bSmrg basic_os=sysv 800100ae103Smrg ;; 801100ae103Smrg i*86sol2) 8020103645bSmrg cpu=`echo "$1" | sed -e 's/86.*/86/'` 8030103645bSmrg vendor=pc 8040103645bSmrg basic_os=solaris2 805100ae103Smrg ;; 8060103645bSmrg j90 | j90-cray) 8070103645bSmrg cpu=j90 8080103645bSmrg vendor=cray 8090103645bSmrg basic_os=${basic_os:-unicos} 810100ae103Smrg ;; 811100ae103Smrg iris | iris4d) 8120103645bSmrg cpu=mips 8130103645bSmrg vendor=sgi 8140103645bSmrg case $basic_os in 8150103645bSmrg irix*) 816100ae103Smrg ;; 817100ae103Smrg *) 8180103645bSmrg basic_os=irix4 819100ae103Smrg ;; 820100ae103Smrg esac 821100ae103Smrg ;; 822100ae103Smrg miniframe) 8230103645bSmrg cpu=m68000 8240103645bSmrg vendor=convergent 825100ae103Smrg ;; 8260103645bSmrg *mint | mint[0-9]* | *MiNT | *MiNT[0-9]*) 8270103645bSmrg cpu=m68k 8280103645bSmrg vendor=atari 8290103645bSmrg basic_os=mint 830100ae103Smrg ;; 831100ae103Smrg news-3600 | risc-news) 8320103645bSmrg cpu=mips 8330103645bSmrg vendor=sony 8340103645bSmrg basic_os=newsos 835100ae103Smrg ;; 83695cf0c00Smrg next | m*-next) 8370103645bSmrg cpu=m68k 8380103645bSmrg vendor=next 8390103645bSmrg case $basic_os in 8400103645bSmrg openstep*) 8410103645bSmrg ;; 8420103645bSmrg nextstep*) 843100ae103Smrg ;; 8440103645bSmrg ns2*) 8450103645bSmrg basic_os=nextstep2 846100ae103Smrg ;; 847100ae103Smrg *) 8480103645bSmrg basic_os=nextstep3 849100ae103Smrg ;; 850100ae103Smrg esac 851100ae103Smrg ;; 852100ae103Smrg np1) 8530103645bSmrg cpu=np1 8540103645bSmrg vendor=gould 85595cf0c00Smrg ;; 856100ae103Smrg op50n-* | op60c-*) 8570103645bSmrg cpu=hppa1.1 8580103645bSmrg vendor=oki 8590103645bSmrg basic_os=proelf 860100ae103Smrg ;; 861100ae103Smrg pa-hitachi) 8620103645bSmrg cpu=hppa1.1 8630103645bSmrg vendor=hitachi 8640103645bSmrg basic_os=hiuxwe2 865165cb819Smrg ;; 866100ae103Smrg pbd) 8670103645bSmrg cpu=sparc 8680103645bSmrg vendor=tti 869100ae103Smrg ;; 870100ae103Smrg pbb) 8710103645bSmrg cpu=m68k 8720103645bSmrg vendor=tti 873100ae103Smrg ;; 8740103645bSmrg pc532) 8750103645bSmrg cpu=ns32k 8760103645bSmrg vendor=pc532 877100ae103Smrg ;; 878100ae103Smrg pn) 8790103645bSmrg cpu=pn 8800103645bSmrg vendor=gould 881100ae103Smrg ;; 8820103645bSmrg power) 8830103645bSmrg cpu=power 8840103645bSmrg vendor=ibm 885100ae103Smrg ;; 8860103645bSmrg ps2) 8870103645bSmrg cpu=i386 8880103645bSmrg vendor=ibm 889100ae103Smrg ;; 8900103645bSmrg rm[46]00) 8910103645bSmrg cpu=mips 8920103645bSmrg vendor=siemens 893100ae103Smrg ;; 8940103645bSmrg rtpc | rtpc-*) 8950103645bSmrg cpu=romp 8960103645bSmrg vendor=ibm 897100ae103Smrg ;; 8980103645bSmrg sde) 8990103645bSmrg cpu=mipsisa32 9000103645bSmrg vendor=sde 9010103645bSmrg basic_os=${basic_os:-elf} 902100ae103Smrg ;; 9030103645bSmrg simso-wrs) 9040103645bSmrg cpu=sparclite 9050103645bSmrg vendor=wrs 9060103645bSmrg basic_os=vxworks 907100ae103Smrg ;; 9080103645bSmrg tower | tower-32) 9090103645bSmrg cpu=m68k 9100103645bSmrg vendor=ncr 911100ae103Smrg ;; 9120103645bSmrg vpp*|vx|vx-*) 9130103645bSmrg cpu=f301 9140103645bSmrg vendor=fujitsu 91595cf0c00Smrg ;; 9160103645bSmrg w65) 9170103645bSmrg cpu=w65 9180103645bSmrg vendor=wdc 919165cb819Smrg ;; 9200103645bSmrg w89k-*) 9210103645bSmrg cpu=hppa1.1 9220103645bSmrg vendor=winbond 9230103645bSmrg basic_os=proelf 924100ae103Smrg ;; 9250103645bSmrg none) 9260103645bSmrg cpu=none 9270103645bSmrg vendor=none 928100ae103Smrg ;; 9290103645bSmrg leon|leon[3-9]) 9300103645bSmrg cpu=sparc 9310103645bSmrg vendor=$basic_machine 932100ae103Smrg ;; 9330103645bSmrg leon-*|leon[3-9]-*) 9340103645bSmrg cpu=sparc 9350103645bSmrg vendor=`echo "$basic_machine" | sed 's/-.*//'` 936100ae103Smrg ;; 9370103645bSmrg 9380103645bSmrg *-*) 9390103645bSmrg # shellcheck disable=SC2162 9400103645bSmrg saved_IFS=$IFS 9410103645bSmrg IFS="-" read cpu vendor <<EOF 9420103645bSmrg$basic_machine 9430103645bSmrgEOF 9440103645bSmrg IFS=$saved_IFS 945100ae103Smrg ;; 9460103645bSmrg # We use `pc' rather than `unknown' 9470103645bSmrg # because (1) that's what they normally are, and 9480103645bSmrg # (2) the word "unknown" tends to confuse beginning users. 9490103645bSmrg i*86 | x86_64) 9500103645bSmrg cpu=$basic_machine 9510103645bSmrg vendor=pc 952100ae103Smrg ;; 9530103645bSmrg # These rules are duplicated from below for sake of the special case above; 9540103645bSmrg # i.e. things that normalized to x86 arches should also default to "pc" 9550103645bSmrg pc98) 9560103645bSmrg cpu=i386 9570103645bSmrg vendor=pc 958100ae103Smrg ;; 9590103645bSmrg x64 | amd64) 9600103645bSmrg cpu=x86_64 9610103645bSmrg vendor=pc 962100ae103Smrg ;; 9630103645bSmrg # Recognize the basic CPU types without company name. 9640103645bSmrg *) 9650103645bSmrg cpu=$basic_machine 9660103645bSmrg vendor=unknown 967165cb819Smrg ;; 9680103645bSmrgesac 9690103645bSmrg 9700103645bSmrgunset -v basic_machine 9710103645bSmrg 9720103645bSmrg# Decode basic machines in the full and proper CPU-Company form. 9730103645bSmrgcase $cpu-$vendor in 9740103645bSmrg # Here we handle the default manufacturer of certain CPU types in canonical form. It is in 9750103645bSmrg # some cases the only manufacturer, in others, it is the most popular. 9760103645bSmrg craynv-unknown) 9770103645bSmrg vendor=cray 9780103645bSmrg basic_os=${basic_os:-unicosmp} 979100ae103Smrg ;; 9800103645bSmrg c90-unknown | c90-cray) 9810103645bSmrg vendor=cray 9820103645bSmrg basic_os=${Basic_os:-unicos} 983100ae103Smrg ;; 9840103645bSmrg fx80-unknown) 9850103645bSmrg vendor=alliant 986165cb819Smrg ;; 9870103645bSmrg romp-unknown) 9880103645bSmrg vendor=ibm 989100ae103Smrg ;; 9900103645bSmrg mmix-unknown) 9910103645bSmrg vendor=knuth 992100ae103Smrg ;; 9930103645bSmrg microblaze-unknown | microblazeel-unknown) 9940103645bSmrg vendor=xilinx 995100ae103Smrg ;; 9960103645bSmrg rs6000-unknown) 9970103645bSmrg vendor=ibm 998100ae103Smrg ;; 9990103645bSmrg vax-unknown) 10000103645bSmrg vendor=dec 1001100ae103Smrg ;; 10020103645bSmrg pdp11-unknown) 10030103645bSmrg vendor=dec 10048831d3fbSmrg ;; 10050103645bSmrg we32k-unknown) 10060103645bSmrg vendor=att 1007100ae103Smrg ;; 10080103645bSmrg cydra-unknown) 10090103645bSmrg vendor=cydrome 1010100ae103Smrg ;; 10110103645bSmrg i370-ibm*) 10120103645bSmrg vendor=ibm 1013100ae103Smrg ;; 10140103645bSmrg orion-unknown) 10150103645bSmrg vendor=highlevel 1016100ae103Smrg ;; 10170103645bSmrg xps-unknown | xps100-unknown) 10180103645bSmrg cpu=xps100 10190103645bSmrg vendor=honeywell 1020100ae103Smrg ;; 10210103645bSmrg 10220103645bSmrg # Here we normalize CPU types with a missing or matching vendor 10230103645bSmrg dpx20-unknown | dpx20-bull) 10240103645bSmrg cpu=rs6000 10250103645bSmrg vendor=bull 10260103645bSmrg basic_os=${basic_os:-bosx} 1027100ae103Smrg ;; 10280103645bSmrg 10290103645bSmrg # Here we normalize CPU types irrespective of the vendor 10300103645bSmrg amd64-*) 10310103645bSmrg cpu=x86_64 1032100ae103Smrg ;; 10330103645bSmrg blackfin-*) 10340103645bSmrg cpu=bfin 10350103645bSmrg basic_os=linux 1036100ae103Smrg ;; 10370103645bSmrg c54x-*) 10380103645bSmrg cpu=tic54x 1039100ae103Smrg ;; 10400103645bSmrg c55x-*) 10410103645bSmrg cpu=tic55x 1042100ae103Smrg ;; 10430103645bSmrg c6x-*) 10440103645bSmrg cpu=tic6x 1045100ae103Smrg ;; 10460103645bSmrg e500v[12]-*) 10470103645bSmrg cpu=powerpc 10480103645bSmrg basic_os=${basic_os}"spe" 1049100ae103Smrg ;; 10500103645bSmrg mips3*-*) 10510103645bSmrg cpu=mips64 1052100ae103Smrg ;; 10530103645bSmrg ms1-*) 10540103645bSmrg cpu=mt 1055100ae103Smrg ;; 10560103645bSmrg m68knommu-*) 10570103645bSmrg cpu=m68k 10580103645bSmrg basic_os=linux 1059100ae103Smrg ;; 10600103645bSmrg m9s12z-* | m68hcs12z-* | hcs12z-* | s12z-*) 10610103645bSmrg cpu=s12z 1062165cb819Smrg ;; 10630103645bSmrg openrisc-*) 10640103645bSmrg cpu=or32 1065100ae103Smrg ;; 10660103645bSmrg parisc-*) 10670103645bSmrg cpu=hppa 10680103645bSmrg basic_os=linux 1069100ae103Smrg ;; 10700103645bSmrg pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) 10710103645bSmrg cpu=i586 1072100ae103Smrg ;; 10730103645bSmrg pentiumpro-* | p6-* | 6x86-* | athlon-* | athalon_*-*) 10740103645bSmrg cpu=i686 1075100ae103Smrg ;; 10760103645bSmrg pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) 10770103645bSmrg cpu=i686 1078100ae103Smrg ;; 10790103645bSmrg pentium4-*) 10800103645bSmrg cpu=i786 1081100ae103Smrg ;; 10820103645bSmrg pc98-*) 10830103645bSmrg cpu=i386 1084100ae103Smrg ;; 10850103645bSmrg ppc-* | ppcbe-*) 10860103645bSmrg cpu=powerpc 1087100ae103Smrg ;; 10880103645bSmrg ppcle-* | powerpclittle-*) 10890103645bSmrg cpu=powerpcle 1090100ae103Smrg ;; 10910103645bSmrg ppc64-*) 10920103645bSmrg cpu=powerpc64 1093100ae103Smrg ;; 10940103645bSmrg ppc64le-* | powerpc64little-*) 10950103645bSmrg cpu=powerpc64le 1096100ae103Smrg ;; 10970103645bSmrg sb1-*) 10980103645bSmrg cpu=mipsisa64sb1 1099100ae103Smrg ;; 11000103645bSmrg sb1el-*) 11010103645bSmrg cpu=mipsisa64sb1el 1102100ae103Smrg ;; 11030103645bSmrg sh5e[lb]-*) 11040103645bSmrg cpu=`echo "$cpu" | sed 's/^\(sh.\)e\(.\)$/\1\2e/'` 1105100ae103Smrg ;; 11060103645bSmrg spur-*) 11070103645bSmrg cpu=spur 1108100ae103Smrg ;; 11090103645bSmrg strongarm-* | thumb-*) 11100103645bSmrg cpu=arm 1111100ae103Smrg ;; 11120103645bSmrg tx39-*) 11130103645bSmrg cpu=mipstx39 111495cf0c00Smrg ;; 11150103645bSmrg tx39el-*) 11160103645bSmrg cpu=mipstx39el 1117100ae103Smrg ;; 11180103645bSmrg x64-*) 11190103645bSmrg cpu=x86_64 1120100ae103Smrg ;; 11218831d3fbSmrg xscale-* | xscalee[bl]-*) 11220103645bSmrg cpu=`echo "$cpu" | sed 's/^xscale/arm/'` 1123100ae103Smrg ;; 11240103645bSmrg arm64-*) 11250103645bSmrg cpu=aarch64 1126100ae103Smrg ;; 1127100ae103Smrg 11280103645bSmrg # Recognize the canonical CPU Types that limit and/or modify the 11290103645bSmrg # company names they are paired with. 11300103645bSmrg cr16-*) 11310103645bSmrg basic_os=${basic_os:-elf} 1132100ae103Smrg ;; 11330103645bSmrg crisv32-* | etraxfs*-*) 11340103645bSmrg cpu=crisv32 11350103645bSmrg vendor=axis 1136100ae103Smrg ;; 11370103645bSmrg cris-* | etrax*-*) 11380103645bSmrg cpu=cris 11390103645bSmrg vendor=axis 1140100ae103Smrg ;; 11410103645bSmrg crx-*) 11420103645bSmrg basic_os=${basic_os:-elf} 1143100ae103Smrg ;; 11440103645bSmrg neo-tandem) 11450103645bSmrg cpu=neo 11460103645bSmrg vendor=tandem 1147100ae103Smrg ;; 11480103645bSmrg nse-tandem) 11490103645bSmrg cpu=nse 11500103645bSmrg vendor=tandem 1151100ae103Smrg ;; 11520103645bSmrg nsr-tandem) 11530103645bSmrg cpu=nsr 11540103645bSmrg vendor=tandem 1155100ae103Smrg ;; 11560103645bSmrg nsv-tandem) 11570103645bSmrg cpu=nsv 11580103645bSmrg vendor=tandem 1159100ae103Smrg ;; 11600103645bSmrg nsx-tandem) 11610103645bSmrg cpu=nsx 11620103645bSmrg vendor=tandem 1163100ae103Smrg ;; 11640103645bSmrg mipsallegrexel-sony) 11650103645bSmrg cpu=mipsallegrexel 11660103645bSmrg vendor=sony 1167100ae103Smrg ;; 11680103645bSmrg tile*-*) 11690103645bSmrg basic_os=${basic_os:-linux-gnu} 1170100ae103Smrg ;; 11710103645bSmrg 1172100ae103Smrg *) 11730103645bSmrg # Recognize the canonical CPU types that are allowed with any 11740103645bSmrg # company name. 11750103645bSmrg case $cpu in 11760103645bSmrg 1750a | 580 \ 11770103645bSmrg | a29k \ 11780103645bSmrg | aarch64 | aarch64_be \ 11790103645bSmrg | abacus \ 11800103645bSmrg | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] \ 11810103645bSmrg | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] \ 11820103645bSmrg | alphapca5[67] | alpha64pca5[67] \ 11830103645bSmrg | am33_2.0 \ 11840103645bSmrg | amdgcn \ 11850103645bSmrg | arc | arceb | arc32 | arc64 \ 11860103645bSmrg | arm | arm[lb]e | arme[lb] | armv* \ 11870103645bSmrg | avr | avr32 \ 11880103645bSmrg | asmjs \ 11890103645bSmrg | ba \ 11900103645bSmrg | be32 | be64 \ 11910103645bSmrg | bfin | bpf | bs2000 \ 11920103645bSmrg | c[123]* | c30 | [cjt]90 | c4x \ 11930103645bSmrg | c8051 | clipper | craynv | csky | cydra \ 11940103645bSmrg | d10v | d30v | dlx | dsp16xx \ 11950103645bSmrg | e2k | elxsi | epiphany \ 11960103645bSmrg | f30[01] | f700 | fido | fr30 | frv | ft32 | fx80 \ 11970103645bSmrg | h8300 | h8500 \ 11980103645bSmrg | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ 11990103645bSmrg | hexagon \ 12000103645bSmrg | i370 | i*86 | i860 | i960 | ia16 | ia64 \ 12010103645bSmrg | ip2k | iq2000 \ 12020103645bSmrg | k1om \ 12030103645bSmrg | le32 | le64 \ 12040103645bSmrg | lm32 \ 12050103645bSmrg | loongarch32 | loongarch64 | loongarchx32 \ 12060103645bSmrg | m32c | m32r | m32rle \ 12070103645bSmrg | m5200 | m68000 | m680[012346]0 | m68360 | m683?2 | m68k \ 12080103645bSmrg | m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x \ 12090103645bSmrg | m88110 | m88k | maxq | mb | mcore | mep | metag \ 12100103645bSmrg | microblaze | microblazeel \ 12110103645bSmrg | mips | mipsbe | mipseb | mipsel | mipsle \ 12120103645bSmrg | mips16 \ 12130103645bSmrg | mips64 | mips64eb | mips64el \ 12140103645bSmrg | mips64octeon | mips64octeonel \ 12150103645bSmrg | mips64orion | mips64orionel \ 12160103645bSmrg | mips64r5900 | mips64r5900el \ 12170103645bSmrg | mips64vr | mips64vrel \ 12180103645bSmrg | mips64vr4100 | mips64vr4100el \ 12190103645bSmrg | mips64vr4300 | mips64vr4300el \ 12200103645bSmrg | mips64vr5000 | mips64vr5000el \ 12210103645bSmrg | mips64vr5900 | mips64vr5900el \ 12220103645bSmrg | mipsisa32 | mipsisa32el \ 12230103645bSmrg | mipsisa32r2 | mipsisa32r2el \ 12240103645bSmrg | mipsisa32r3 | mipsisa32r3el \ 12250103645bSmrg | mipsisa32r5 | mipsisa32r5el \ 12260103645bSmrg | mipsisa32r6 | mipsisa32r6el \ 12270103645bSmrg | mipsisa64 | mipsisa64el \ 12280103645bSmrg | mipsisa64r2 | mipsisa64r2el \ 12290103645bSmrg | mipsisa64r3 | mipsisa64r3el \ 12300103645bSmrg | mipsisa64r5 | mipsisa64r5el \ 12310103645bSmrg | mipsisa64r6 | mipsisa64r6el \ 12320103645bSmrg | mipsisa64sb1 | mipsisa64sb1el \ 12330103645bSmrg | mipsisa64sr71k | mipsisa64sr71kel \ 12340103645bSmrg | mipsr5900 | mipsr5900el \ 12350103645bSmrg | mipstx39 | mipstx39el \ 12360103645bSmrg | mmix \ 12370103645bSmrg | mn10200 | mn10300 \ 12380103645bSmrg | moxie \ 12390103645bSmrg | mt \ 12400103645bSmrg | msp430 \ 12410103645bSmrg | nds32 | nds32le | nds32be \ 12420103645bSmrg | nfp \ 12430103645bSmrg | nios | nios2 | nios2eb | nios2el \ 12440103645bSmrg | none | np1 | ns16k | ns32k | nvptx \ 12450103645bSmrg | open8 \ 12460103645bSmrg | or1k* \ 12470103645bSmrg | or32 \ 12480103645bSmrg | orion \ 12490103645bSmrg | picochip \ 12500103645bSmrg | pdp10 | pdp11 | pj | pjl | pn | power \ 12510103645bSmrg | powerpc | powerpc64 | powerpc64le | powerpcle | powerpcspe \ 12520103645bSmrg | pru \ 12530103645bSmrg | pyramid \ 12540103645bSmrg | riscv | riscv32 | riscv32be | riscv64 | riscv64be \ 12550103645bSmrg | rl78 | romp | rs6000 | rx \ 12560103645bSmrg | s390 | s390x \ 12570103645bSmrg | score \ 12580103645bSmrg | sh | shl \ 12590103645bSmrg | sh[1234] | sh[24]a | sh[24]ae[lb] | sh[23]e | she[lb] | sh[lb]e \ 12600103645bSmrg | sh[1234]e[lb] | sh[12345][lb]e | sh[23]ele | sh64 | sh64le \ 12610103645bSmrg | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet \ 12620103645bSmrg | sparclite \ 12630103645bSmrg | sparcv8 | sparcv9 | sparcv9b | sparcv9v | sv1 | sx* \ 12640103645bSmrg | spu \ 12650103645bSmrg | tahoe \ 12660103645bSmrg | thumbv7* \ 12670103645bSmrg | tic30 | tic4x | tic54x | tic55x | tic6x | tic80 \ 12680103645bSmrg | tron \ 12690103645bSmrg | ubicom32 \ 12700103645bSmrg | v70 | v850 | v850e | v850e1 | v850es | v850e2 | v850e2v3 \ 12710103645bSmrg | vax \ 12720103645bSmrg | visium \ 12730103645bSmrg | w65 \ 12740103645bSmrg | wasm32 | wasm64 \ 12750103645bSmrg | we32k \ 12760103645bSmrg | x86 | x86_64 | xc16x | xgate | xps100 \ 12770103645bSmrg | xstormy16 | xtensa* \ 12780103645bSmrg | ymp \ 12790103645bSmrg | z8k | z80) 12800103645bSmrg ;; 12810103645bSmrg 12820103645bSmrg *) 12830103645bSmrg echo Invalid configuration \`"$1"\': machine \`"$cpu-$vendor"\' not recognized 1>&2 12840103645bSmrg exit 1 12850103645bSmrg ;; 12860103645bSmrg esac 1287100ae103Smrg ;; 1288100ae103Smrgesac 1289100ae103Smrg 1290100ae103Smrg# Here we canonicalize certain aliases for manufacturers. 12910103645bSmrgcase $vendor in 12920103645bSmrg digital*) 12930103645bSmrg vendor=dec 1294100ae103Smrg ;; 12950103645bSmrg commodore*) 12960103645bSmrg vendor=cbm 1297100ae103Smrg ;; 1298100ae103Smrg *) 1299100ae103Smrg ;; 1300100ae103Smrgesac 1301100ae103Smrg 1302100ae103Smrg# Decode manufacturer-specific aliases for certain operating systems. 1303100ae103Smrg 13040103645bSmrgif test x$basic_os != x 1305100ae103Smrgthen 13060103645bSmrg 13070103645bSmrg# First recognize some ad-hoc caes, or perhaps split kernel-os, or else just 13080103645bSmrg# set os. 13090103645bSmrgcase $basic_os in 13100103645bSmrg gnu/linux*) 13110103645bSmrg kernel=linux 13120103645bSmrg os=`echo "$basic_os" | sed -e 's|gnu/linux|gnu|'` 13130103645bSmrg ;; 13140103645bSmrg os2-emx) 13150103645bSmrg kernel=os2 13160103645bSmrg os=`echo "$basic_os" | sed -e 's|os2-emx|emx|'` 13170103645bSmrg ;; 13180103645bSmrg nto-qnx*) 13190103645bSmrg kernel=nto 13200103645bSmrg os=`echo "$basic_os" | sed -e 's|nto-qnx|qnx|'` 13210103645bSmrg ;; 13220103645bSmrg *-*) 13230103645bSmrg # shellcheck disable=SC2162 13240103645bSmrg saved_IFS=$IFS 13250103645bSmrg IFS="-" read kernel os <<EOF 13260103645bSmrg$basic_os 13270103645bSmrgEOF 13280103645bSmrg IFS=$saved_IFS 13290103645bSmrg ;; 13300103645bSmrg # Default OS when just kernel was specified 13310103645bSmrg nto*) 13320103645bSmrg kernel=nto 13330103645bSmrg os=`echo "$basic_os" | sed -e 's|nto|qnx|'` 13340103645bSmrg ;; 13350103645bSmrg linux*) 13360103645bSmrg kernel=linux 13370103645bSmrg os=`echo "$basic_os" | sed -e 's|linux|gnu|'` 13380103645bSmrg ;; 13390103645bSmrg *) 13400103645bSmrg kernel= 13410103645bSmrg os=$basic_os 13420103645bSmrg ;; 13430103645bSmrgesac 13440103645bSmrg 13450103645bSmrg# Now, normalize the OS (knowing we just have one component, it's not a kernel, 13460103645bSmrg# etc.) 1347100ae103Smrgcase $os in 134895cf0c00Smrg # First match some system type aliases that might get confused 134995cf0c00Smrg # with valid system types. 13500103645bSmrg # solaris* is a basic system type, with this one exception. 13510103645bSmrg auroraux) 13520103645bSmrg os=auroraux 1353165cb819Smrg ;; 13540103645bSmrg bluegene*) 13550103645bSmrg os=cnk 1356100ae103Smrg ;; 13570103645bSmrg solaris1 | solaris1.*) 13580103645bSmrg os=`echo "$os" | sed -e 's|solaris1|sunos4|'` 1359100ae103Smrg ;; 13600103645bSmrg solaris) 13610103645bSmrg os=solaris2 1362100ae103Smrg ;; 13630103645bSmrg unixware*) 13640103645bSmrg os=sysv4.2uw 1365100ae103Smrg ;; 136695cf0c00Smrg # es1800 is here to avoid being matched by es* (a different OS) 13670103645bSmrg es1800*) 13680103645bSmrg os=ose 136995cf0c00Smrg ;; 13700103645bSmrg # Some version numbers need modification 13710103645bSmrg chorusos*) 13720103645bSmrg os=chorusos 1373100ae103Smrg ;; 13740103645bSmrg isc) 13750103645bSmrg os=isc2.2 1376100ae103Smrg ;; 13770103645bSmrg sco6) 13780103645bSmrg os=sco5v6 1379100ae103Smrg ;; 13800103645bSmrg sco5) 13810103645bSmrg os=sco3.2v5 1382100ae103Smrg ;; 13830103645bSmrg sco4) 13840103645bSmrg os=sco3.2v4 1385100ae103Smrg ;; 13860103645bSmrg sco3.2.[4-9]*) 13870103645bSmrg os=`echo "$os" | sed -e 's/sco3.2./sco3.2v/'` 1388100ae103Smrg ;; 13890103645bSmrg sco*v* | scout) 13900103645bSmrg # Don't match below 1391100ae103Smrg ;; 13920103645bSmrg sco*) 13930103645bSmrg os=sco3.2v2 1394100ae103Smrg ;; 13950103645bSmrg psos*) 13960103645bSmrg os=psos 1397100ae103Smrg ;; 13980103645bSmrg qnx*) 13990103645bSmrg os=qnx 1400100ae103Smrg ;; 14010103645bSmrg hiux*) 14020103645bSmrg os=hiuxwe2 1403100ae103Smrg ;; 14040103645bSmrg lynx*178) 14050103645bSmrg os=lynxos178 1406100ae103Smrg ;; 14070103645bSmrg lynx*5) 14080103645bSmrg os=lynxos5 1409100ae103Smrg ;; 14100103645bSmrg lynxos*) 14110103645bSmrg # don't get caught up in next wildcard 1412100ae103Smrg ;; 14130103645bSmrg lynx*) 14140103645bSmrg os=lynxos 1415100ae103Smrg ;; 14160103645bSmrg mac[0-9]*) 14170103645bSmrg os=`echo "$os" | sed -e 's|mac|macos|'` 1418100ae103Smrg ;; 14190103645bSmrg opened*) 14200103645bSmrg os=openedition 1421100ae103Smrg ;; 14220103645bSmrg os400*) 14230103645bSmrg os=os400 1424100ae103Smrg ;; 14250103645bSmrg sunos5*) 14260103645bSmrg os=`echo "$os" | sed -e 's|sunos5|solaris2|'` 1427100ae103Smrg ;; 14280103645bSmrg sunos6*) 14290103645bSmrg os=`echo "$os" | sed -e 's|sunos6|solaris3|'` 1430100ae103Smrg ;; 14310103645bSmrg wince*) 14320103645bSmrg os=wince 1433100ae103Smrg ;; 14340103645bSmrg utek*) 14350103645bSmrg os=bsd 1436100ae103Smrg ;; 14370103645bSmrg dynix*) 14380103645bSmrg os=bsd 1439100ae103Smrg ;; 14400103645bSmrg acis*) 14410103645bSmrg os=aos 1442100ae103Smrg ;; 14430103645bSmrg atheos*) 14440103645bSmrg os=atheos 1445100ae103Smrg ;; 14460103645bSmrg syllable*) 14470103645bSmrg os=syllable 14480103645bSmrg ;; 14490103645bSmrg 386bsd) 14500103645bSmrg os=bsd 14510103645bSmrg ;; 14520103645bSmrg ctix* | uts*) 14530103645bSmrg os=sysv 14540103645bSmrg ;; 14550103645bSmrg nova*) 14560103645bSmrg os=rtmk-nova 14570103645bSmrg ;; 14580103645bSmrg ns2) 14590103645bSmrg os=nextstep2 14600103645bSmrg ;; 14610103645bSmrg # Preserve the version number of sinix5. 14620103645bSmrg sinix5.*) 14630103645bSmrg os=`echo "$os" | sed -e 's|sinix|sysv|'` 1464100ae103Smrg ;; 14650103645bSmrg sinix*) 14660103645bSmrg os=sysv4 1467100ae103Smrg ;; 14680103645bSmrg tpf*) 14690103645bSmrg os=tpf 1470100ae103Smrg ;; 14710103645bSmrg triton*) 14720103645bSmrg os=sysv3 1473100ae103Smrg ;; 14740103645bSmrg oss*) 14750103645bSmrg os=sysv3 1476100ae103Smrg ;; 14770103645bSmrg svr4*) 14780103645bSmrg os=sysv4 1479100ae103Smrg ;; 14800103645bSmrg svr3) 14810103645bSmrg os=sysv3 1482100ae103Smrg ;; 14830103645bSmrg sysvr4) 14840103645bSmrg os=sysv4 1485100ae103Smrg ;; 14860103645bSmrg ose*) 14870103645bSmrg os=ose 1488100ae103Smrg ;; 14890103645bSmrg *mint | mint[0-9]* | *MiNT | MiNT[0-9]*) 14900103645bSmrg os=mint 1491165cb819Smrg ;; 14920103645bSmrg dicos*) 14930103645bSmrg os=dicos 14940103645bSmrg ;; 14950103645bSmrg pikeos*) 149695cf0c00Smrg # Until real need of OS specific support for 149795cf0c00Smrg # particular features comes up, bare metal 149895cf0c00Smrg # configurations are quite functional. 14990103645bSmrg case $cpu in 150095cf0c00Smrg arm*) 15010103645bSmrg os=eabi 150295cf0c00Smrg ;; 150395cf0c00Smrg *) 15040103645bSmrg os=elf 150595cf0c00Smrg ;; 150695cf0c00Smrg esac 150795cf0c00Smrg ;; 1508100ae103Smrg *) 15090103645bSmrg # No normalization, but not necessarily accepted, that comes below. 1510100ae103Smrg ;; 1511100ae103Smrgesac 15120103645bSmrg 1513100ae103Smrgelse 1514100ae103Smrg 1515100ae103Smrg# Here we handle the default operating systems that come with various machines. 1516100ae103Smrg# The value should be what the vendor currently ships out the door with their 1517100ae103Smrg# machine or put another way, the most popular os provided with the machine. 1518100ae103Smrg 1519100ae103Smrg# Note that if you're going to try to match "-MANUFACTURER" here (say, 1520100ae103Smrg# "-sun"), then you have to tell the case statement up towards the top 1521100ae103Smrg# that MANUFACTURER isn't an operating system. Otherwise, code above 1522100ae103Smrg# will signal an error saying that MANUFACTURER isn't an operating 1523100ae103Smrg# system, and we'll never get to this point. 1524100ae103Smrg 15250103645bSmrgkernel= 15260103645bSmrgcase $cpu-$vendor in 15278831d3fbSmrg score-*) 15280103645bSmrg os=elf 1529165cb819Smrg ;; 15308831d3fbSmrg spu-*) 15310103645bSmrg os=elf 1532165cb819Smrg ;; 1533100ae103Smrg *-acorn) 15340103645bSmrg os=riscix1.2 1535100ae103Smrg ;; 1536100ae103Smrg arm*-rebel) 15370103645bSmrg kernel=linux 15380103645bSmrg os=gnu 1539100ae103Smrg ;; 1540100ae103Smrg arm*-semi) 15410103645bSmrg os=aout 1542100ae103Smrg ;; 15438831d3fbSmrg c4x-* | tic4x-*) 15440103645bSmrg os=coff 15458831d3fbSmrg ;; 154695cf0c00Smrg c8051-*) 15470103645bSmrg os=elf 15480103645bSmrg ;; 15490103645bSmrg clipper-intergraph) 15500103645bSmrg os=clix 155195cf0c00Smrg ;; 155295cf0c00Smrg hexagon-*) 15530103645bSmrg os=elf 155495cf0c00Smrg ;; 15558831d3fbSmrg tic54x-*) 15560103645bSmrg os=coff 15578831d3fbSmrg ;; 15588831d3fbSmrg tic55x-*) 15590103645bSmrg os=coff 15608831d3fbSmrg ;; 15618831d3fbSmrg tic6x-*) 15620103645bSmrg os=coff 1563165cb819Smrg ;; 1564100ae103Smrg # This must come before the *-dec entry. 1565100ae103Smrg pdp10-*) 15660103645bSmrg os=tops20 1567100ae103Smrg ;; 1568100ae103Smrg pdp11-*) 15690103645bSmrg os=none 1570100ae103Smrg ;; 1571100ae103Smrg *-dec | vax-*) 15720103645bSmrg os=ultrix4.2 1573100ae103Smrg ;; 1574100ae103Smrg m68*-apollo) 15750103645bSmrg os=domain 1576100ae103Smrg ;; 1577100ae103Smrg i386-sun) 15780103645bSmrg os=sunos4.0.2 1579100ae103Smrg ;; 1580100ae103Smrg m68000-sun) 15810103645bSmrg os=sunos3 1582100ae103Smrg ;; 1583100ae103Smrg m68*-cisco) 15840103645bSmrg os=aout 1585100ae103Smrg ;; 15868831d3fbSmrg mep-*) 15870103645bSmrg os=elf 1588165cb819Smrg ;; 1589100ae103Smrg mips*-cisco) 15900103645bSmrg os=elf 1591100ae103Smrg ;; 1592100ae103Smrg mips*-*) 15930103645bSmrg os=elf 1594100ae103Smrg ;; 1595100ae103Smrg or32-*) 15960103645bSmrg os=coff 1597100ae103Smrg ;; 1598100ae103Smrg *-tti) # must be before sparc entry or we get the wrong os. 15990103645bSmrg os=sysv3 1600100ae103Smrg ;; 1601100ae103Smrg sparc-* | *-sun) 16020103645bSmrg os=sunos4.1.1 1603100ae103Smrg ;; 160495cf0c00Smrg pru-*) 16050103645bSmrg os=elf 160695cf0c00Smrg ;; 1607100ae103Smrg *-be) 16080103645bSmrg os=beos 1609100ae103Smrg ;; 1610100ae103Smrg *-ibm) 16110103645bSmrg os=aix 1612100ae103Smrg ;; 16138831d3fbSmrg *-knuth) 16140103645bSmrg os=mmixware 1615100ae103Smrg ;; 1616100ae103Smrg *-wec) 16170103645bSmrg os=proelf 1618100ae103Smrg ;; 1619100ae103Smrg *-winbond) 16200103645bSmrg os=proelf 1621100ae103Smrg ;; 1622100ae103Smrg *-oki) 16230103645bSmrg os=proelf 1624100ae103Smrg ;; 1625100ae103Smrg *-hp) 16260103645bSmrg os=hpux 1627100ae103Smrg ;; 1628100ae103Smrg *-hitachi) 16290103645bSmrg os=hiux 1630100ae103Smrg ;; 1631100ae103Smrg i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) 16320103645bSmrg os=sysv 1633100ae103Smrg ;; 1634100ae103Smrg *-cbm) 16350103645bSmrg os=amigaos 1636100ae103Smrg ;; 1637100ae103Smrg *-dg) 16380103645bSmrg os=dgux 1639100ae103Smrg ;; 1640100ae103Smrg *-dolphin) 16410103645bSmrg os=sysv3 1642100ae103Smrg ;; 1643100ae103Smrg m68k-ccur) 16440103645bSmrg os=rtu 1645100ae103Smrg ;; 1646100ae103Smrg m88k-omron*) 16470103645bSmrg os=luna 1648100ae103Smrg ;; 164995cf0c00Smrg *-next) 16500103645bSmrg os=nextstep 1651100ae103Smrg ;; 1652100ae103Smrg *-sequent) 16530103645bSmrg os=ptx 1654100ae103Smrg ;; 1655100ae103Smrg *-crds) 16560103645bSmrg os=unos 1657100ae103Smrg ;; 1658100ae103Smrg *-ns) 16590103645bSmrg os=genix 1660100ae103Smrg ;; 1661100ae103Smrg i370-*) 16620103645bSmrg os=mvs 1663100ae103Smrg ;; 1664100ae103Smrg *-gould) 16650103645bSmrg os=sysv 1666100ae103Smrg ;; 1667100ae103Smrg *-highlevel) 16680103645bSmrg os=bsd 1669100ae103Smrg ;; 1670100ae103Smrg *-encore) 16710103645bSmrg os=bsd 1672100ae103Smrg ;; 1673100ae103Smrg *-sgi) 16740103645bSmrg os=irix 1675100ae103Smrg ;; 1676100ae103Smrg *-siemens) 16770103645bSmrg os=sysv4 1678100ae103Smrg ;; 1679100ae103Smrg *-masscomp) 16800103645bSmrg os=rtu 1681100ae103Smrg ;; 1682100ae103Smrg f30[01]-fujitsu | f700-fujitsu) 16830103645bSmrg os=uxpv 1684100ae103Smrg ;; 1685100ae103Smrg *-rom68k) 16860103645bSmrg os=coff 1687100ae103Smrg ;; 1688100ae103Smrg *-*bug) 16890103645bSmrg os=coff 1690100ae103Smrg ;; 1691100ae103Smrg *-apple) 16920103645bSmrg os=macos 1693100ae103Smrg ;; 1694100ae103Smrg *-atari*) 16950103645bSmrg os=mint 16960103645bSmrg ;; 16970103645bSmrg *-wrs) 16980103645bSmrg os=vxworks 1699100ae103Smrg ;; 1700100ae103Smrg *) 17010103645bSmrg os=none 1702100ae103Smrg ;; 1703100ae103Smrgesac 17040103645bSmrg 1705100ae103Smrgfi 1706100ae103Smrg 17070103645bSmrg# Now, validate our (potentially fixed-up) OS. 17080103645bSmrgcase $os in 17090103645bSmrg # Sometimes we do "kernel-libc", so those need to count as OSes. 17100103645bSmrg musl* | newlib* | relibc* | uclibc*) 17110103645bSmrg ;; 17120103645bSmrg # Likewise for "kernel-abi" 17130103645bSmrg eabi* | gnueabi*) 17140103645bSmrg ;; 17150103645bSmrg # VxWorks passes extra cpu info in the 4th filed. 17160103645bSmrg simlinux | simwindows | spe) 17170103645bSmrg ;; 17180103645bSmrg # Now accept the basic system types. 17190103645bSmrg # The portable systems comes first. 17200103645bSmrg # Each alternative MUST end in a * to match a version number. 17210103645bSmrg gnu* | android* | bsd* | mach* | minix* | genix* | ultrix* | irix* \ 17220103645bSmrg | *vms* | esix* | aix* | cnk* | sunos | sunos[34]* \ 17230103645bSmrg | hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \ 17240103645bSmrg | sym* | plan9* | psp* | sim* | xray* | os68k* | v88r* \ 17250103645bSmrg | hiux* | abug | nacl* | netware* | windows* \ 17260103645bSmrg | os9* | macos* | osx* | ios* \ 17270103645bSmrg | mpw* | magic* | mmixware* | mon960* | lnews* \ 17280103645bSmrg | amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \ 17290103645bSmrg | aos* | aros* | cloudabi* | sortix* | twizzler* \ 17300103645bSmrg | nindy* | vxsim* | vxworks* | ebmon* | hms* | mvs* \ 17310103645bSmrg | clix* | riscos* | uniplus* | iris* | isc* | rtu* | xenix* \ 17320103645bSmrg | mirbsd* | netbsd* | dicos* | openedition* | ose* \ 17330103645bSmrg | bitrig* | openbsd* | secbsd* | solidbsd* | libertybsd* | os108* \ 17340103645bSmrg | ekkobsd* | freebsd* | riscix* | lynxos* | os400* \ 17350103645bSmrg | bosx* | nextstep* | cxux* | aout* | elf* | oabi* \ 17360103645bSmrg | ptx* | coff* | ecoff* | winnt* | domain* | vsta* \ 17370103645bSmrg | udi* | lites* | ieee* | go32* | aux* | hcos* \ 17380103645bSmrg | chorusrdb* | cegcc* | glidix* | serenity* \ 17390103645bSmrg | cygwin* | msys* | pe* | moss* | proelf* | rtems* \ 17400103645bSmrg | midipix* | mingw32* | mingw64* | mint* \ 17410103645bSmrg | uxpv* | beos* | mpeix* | udk* | moxiebox* \ 17420103645bSmrg | interix* | uwin* | mks* | rhapsody* | darwin* \ 17430103645bSmrg | openstep* | oskit* | conix* | pw32* | nonstopux* \ 17440103645bSmrg | storm-chaos* | tops10* | tenex* | tops20* | its* \ 17450103645bSmrg | os2* | vos* | palmos* | uclinux* | nucleus* | morphos* \ 17460103645bSmrg | scout* | superux* | sysv* | rtmk* | tpf* | windiss* \ 17470103645bSmrg | powermax* | dnix* | nx6 | nx7 | sei* | dragonfly* \ 17480103645bSmrg | skyos* | haiku* | rdos* | toppers* | drops* | es* \ 17490103645bSmrg | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \ 17500103645bSmrg | midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \ 17510103645bSmrg | nsk* | powerunix* | genode* | zvmoe* | qnx* | emx* | zephyr*) 17520103645bSmrg ;; 17530103645bSmrg # This one is extra strict with allowed versions 17540103645bSmrg sco3.2v2 | sco3.2v[4-9]* | sco5v6*) 17550103645bSmrg # Don't forget version if it is 3.2v4 or newer. 17560103645bSmrg ;; 17570103645bSmrg none) 17580103645bSmrg ;; 17590103645bSmrg *) 17600103645bSmrg echo Invalid configuration \`"$1"\': OS \`"$os"\' not recognized 1>&2 17610103645bSmrg exit 1 17620103645bSmrg ;; 17630103645bSmrgesac 17640103645bSmrg 17650103645bSmrg# As a final step for OS-related things, validate the OS-kernel combination 17660103645bSmrg# (given a valid OS), if there is a kernel. 17670103645bSmrgcase $kernel-$os in 17680103645bSmrg linux-gnu* | linux-dietlibc* | linux-android* | linux-newlib* \ 17690103645bSmrg | linux-musl* | linux-relibc* | linux-uclibc* ) 17700103645bSmrg ;; 17710103645bSmrg uclinux-uclibc* ) 17720103645bSmrg ;; 17730103645bSmrg -dietlibc* | -newlib* | -musl* | -relibc* | -uclibc* ) 17740103645bSmrg # These are just libc implementations, not actual OSes, and thus 17750103645bSmrg # require a kernel. 17760103645bSmrg echo "Invalid configuration \`$1': libc \`$os' needs explicit kernel." 1>&2 17770103645bSmrg exit 1 17780103645bSmrg ;; 17790103645bSmrg kfreebsd*-gnu* | kopensolaris*-gnu*) 17800103645bSmrg ;; 17810103645bSmrg vxworks-simlinux | vxworks-simwindows | vxworks-spe) 17820103645bSmrg ;; 17830103645bSmrg nto-qnx*) 17840103645bSmrg ;; 17850103645bSmrg os2-emx) 17860103645bSmrg ;; 17870103645bSmrg *-eabi* | *-gnueabi*) 17880103645bSmrg ;; 17890103645bSmrg -*) 17900103645bSmrg # Blank kernel with real OS is always fine. 17910103645bSmrg ;; 17920103645bSmrg *-*) 17930103645bSmrg echo "Invalid configuration \`$1': Kernel \`$kernel' not known to work with OS \`$os'." 1>&2 17940103645bSmrg exit 1 17950103645bSmrg ;; 17960103645bSmrgesac 17970103645bSmrg 1798100ae103Smrg# Here we handle the case where we know the os, and the CPU type, but not the 1799100ae103Smrg# manufacturer. We pick the logical manufacturer. 18000103645bSmrgcase $vendor in 18010103645bSmrg unknown) 18020103645bSmrg case $cpu-$os in 18030103645bSmrg *-riscix*) 1804100ae103Smrg vendor=acorn 1805100ae103Smrg ;; 18060103645bSmrg *-sunos*) 1807100ae103Smrg vendor=sun 1808100ae103Smrg ;; 18090103645bSmrg *-cnk* | *-aix*) 1810100ae103Smrg vendor=ibm 1811100ae103Smrg ;; 18120103645bSmrg *-beos*) 1813100ae103Smrg vendor=be 1814100ae103Smrg ;; 18150103645bSmrg *-hpux*) 1816100ae103Smrg vendor=hp 1817100ae103Smrg ;; 18180103645bSmrg *-mpeix*) 1819100ae103Smrg vendor=hp 1820100ae103Smrg ;; 18210103645bSmrg *-hiux*) 1822100ae103Smrg vendor=hitachi 1823100ae103Smrg ;; 18240103645bSmrg *-unos*) 1825100ae103Smrg vendor=crds 1826100ae103Smrg ;; 18270103645bSmrg *-dgux*) 1828100ae103Smrg vendor=dg 1829100ae103Smrg ;; 18300103645bSmrg *-luna*) 1831100ae103Smrg vendor=omron 1832100ae103Smrg ;; 18330103645bSmrg *-genix*) 1834100ae103Smrg vendor=ns 1835100ae103Smrg ;; 18360103645bSmrg *-clix*) 18370103645bSmrg vendor=intergraph 18380103645bSmrg ;; 18390103645bSmrg *-mvs* | *-opened*) 18400103645bSmrg vendor=ibm 18410103645bSmrg ;; 18420103645bSmrg *-os400*) 1843100ae103Smrg vendor=ibm 1844100ae103Smrg ;; 18450103645bSmrg s390-* | s390x-*) 1846100ae103Smrg vendor=ibm 1847100ae103Smrg ;; 18480103645bSmrg *-ptx*) 1849100ae103Smrg vendor=sequent 1850100ae103Smrg ;; 18510103645bSmrg *-tpf*) 1852100ae103Smrg vendor=ibm 1853100ae103Smrg ;; 18540103645bSmrg *-vxsim* | *-vxworks* | *-windiss*) 1855100ae103Smrg vendor=wrs 1856100ae103Smrg ;; 18570103645bSmrg *-aux*) 1858100ae103Smrg vendor=apple 1859100ae103Smrg ;; 18600103645bSmrg *-hms*) 1861100ae103Smrg vendor=hitachi 1862100ae103Smrg ;; 18630103645bSmrg *-mpw* | *-macos*) 1864100ae103Smrg vendor=apple 1865100ae103Smrg ;; 18660103645bSmrg *-*mint | *-mint[0-9]* | *-*MiNT | *-MiNT[0-9]*) 1867100ae103Smrg vendor=atari 1868100ae103Smrg ;; 18690103645bSmrg *-vos*) 1870100ae103Smrg vendor=stratus 1871100ae103Smrg ;; 1872100ae103Smrg esac 1873100ae103Smrg ;; 1874100ae103Smrgesac 1875100ae103Smrg 18760103645bSmrgecho "$cpu-$vendor-${kernel:+$kernel-}$os" 1877100ae103Smrgexit 1878100ae103Smrg 1879100ae103Smrg# Local variables: 18800103645bSmrg# eval: (add-hook 'before-save-hook 'time-stamp) 1881100ae103Smrg# time-stamp-start: "timestamp='" 1882100ae103Smrg# time-stamp-format: "%:y-%02m-%02d" 1883100ae103Smrg# time-stamp-end: "'" 1884100ae103Smrg# End: 1885