1def0d0f3Smrg#! /bin/sh 2def0d0f3Smrg# Configuration validation subroutine script. 3def0d0f3Smrg# Copyright 1992-2023 Free Software Foundation, Inc. 4def0d0f3Smrg 5def0d0f3Smrg# shellcheck disable=SC2006,SC2268 # see below for rationale 6def0d0f3Smrg 7def0d0f3Smrgtimestamp='2023-01-21' 8def0d0f3Smrg 9def0d0f3Smrg# This file is free software; you can redistribute it and/or modify it 10def0d0f3Smrg# under the terms of the GNU General Public License as published by 11def0d0f3Smrg# the Free Software Foundation, either version 3 of the License, or 12def0d0f3Smrg# (at your option) any later version. 13def0d0f3Smrg# 14def0d0f3Smrg# This program is distributed in the hope that it will be useful, but 15def0d0f3Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of 16def0d0f3Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17def0d0f3Smrg# General Public License for more details. 18def0d0f3Smrg# 19def0d0f3Smrg# You should have received a copy of the GNU General Public License 20def0d0f3Smrg# along with this program; if not, see <https://www.gnu.org/licenses/>. 21def0d0f3Smrg# 22def0d0f3Smrg# As a special exception to the GNU General Public License, if you 23def0d0f3Smrg# distribute this file as part of a program that contains a 24def0d0f3Smrg# configuration script generated by Autoconf, you may include it under 25def0d0f3Smrg# the same distribution terms that you use for the rest of that 26def0d0f3Smrg# program. This Exception is an additional permission under section 7 27def0d0f3Smrg# of the GNU General Public License, version 3 ("GPLv3"). 28def0d0f3Smrg 29def0d0f3Smrg 30def0d0f3Smrg# Please send patches to <config-patches@gnu.org>. 31def0d0f3Smrg# 32def0d0f3Smrg# Configuration subroutine to validate and canonicalize a configuration type. 33def0d0f3Smrg# Supply the specified configuration type as an argument. 34def0d0f3Smrg# If it is invalid, we print an error message on stderr and exit with code 1. 35def0d0f3Smrg# Otherwise, we print the canonical config type on stdout and succeed. 36def0d0f3Smrg 37def0d0f3Smrg# You can get the latest version of this script from: 38def0d0f3Smrg# https://git.savannah.gnu.org/cgit/config.git/plain/config.sub 39def0d0f3Smrg 40def0d0f3Smrg# This file is supposed to be the same for all GNU packages 41def0d0f3Smrg# and recognize all the CPU types, system types and aliases 42def0d0f3Smrg# that are meaningful with *any* GNU software. 43def0d0f3Smrg# Each package is responsible for reporting which valid configurations 44def0d0f3Smrg# it does not support. The user should be able to distinguish 45def0d0f3Smrg# a failure to support a valid configuration from a meaningless 46def0d0f3Smrg# configuration. 47def0d0f3Smrg 48def0d0f3Smrg# The goal of this file is to map all the various variations of a given 49def0d0f3Smrg# machine specification into a single specification in the form: 50def0d0f3Smrg# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM 51def0d0f3Smrg# or in some cases, the newer four-part form: 52def0d0f3Smrg# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM 53def0d0f3Smrg# It is wrong to echo any other type of specification. 54def0d0f3Smrg 55def0d0f3Smrg# The "shellcheck disable" line above the timestamp inhibits complaints 56def0d0f3Smrg# about features and limitations of the classic Bourne shell that were 57def0d0f3Smrg# superseded or lifted in POSIX. However, this script identifies a wide 58def0d0f3Smrg# variety of pre-POSIX systems that do not have POSIX shells at all, and 59def0d0f3Smrg# even some reasonably current systems (Solaris 10 as case-in-point) still 60def0d0f3Smrg# have a pre-POSIX /bin/sh. 61def0d0f3Smrg 62def0d0f3Smrgme=`echo "$0" | sed -e 's,.*/,,'` 63def0d0f3Smrg 64def0d0f3Smrgusage="\ 65def0d0f3SmrgUsage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS 66def0d0f3Smrg 67def0d0f3SmrgCanonicalize a configuration name. 68def0d0f3Smrg 69def0d0f3SmrgOptions: 70def0d0f3Smrg -h, --help print this help, then exit 71def0d0f3Smrg -t, --time-stamp print date of last modification, then exit 72def0d0f3Smrg -v, --version print version number, then exit 73def0d0f3Smrg 74def0d0f3SmrgReport bugs and patches to <config-patches@gnu.org>." 75def0d0f3Smrg 76def0d0f3Smrgversion="\ 77def0d0f3SmrgGNU config.sub ($timestamp) 78def0d0f3Smrg 79def0d0f3SmrgCopyright 1992-2023 Free Software Foundation, Inc. 80def0d0f3Smrg 81def0d0f3SmrgThis is free software; see the source for copying conditions. There is NO 82def0d0f3Smrgwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." 83def0d0f3Smrg 84def0d0f3Smrghelp=" 85def0d0f3SmrgTry \`$me --help' for more information." 86def0d0f3Smrg 87def0d0f3Smrg# Parse command line 88def0d0f3Smrgwhile test $# -gt 0 ; do 89def0d0f3Smrg case $1 in 90def0d0f3Smrg --time-stamp | --time* | -t ) 91def0d0f3Smrg echo "$timestamp" ; exit ;; 92def0d0f3Smrg --version | -v ) 93def0d0f3Smrg echo "$version" ; exit ;; 94def0d0f3Smrg --help | --h* | -h ) 95def0d0f3Smrg echo "$usage"; exit ;; 96def0d0f3Smrg -- ) # Stop option processing 97def0d0f3Smrg shift; break ;; 98def0d0f3Smrg - ) # Use stdin as input. 99def0d0f3Smrg break ;; 100def0d0f3Smrg -* ) 101def0d0f3Smrg echo "$me: invalid option $1$help" >&2 102def0d0f3Smrg exit 1 ;; 103def0d0f3Smrg 104def0d0f3Smrg *local*) 105def0d0f3Smrg # First pass through any local machine types. 106def0d0f3Smrg echo "$1" 107def0d0f3Smrg exit ;; 108def0d0f3Smrg 109def0d0f3Smrg * ) 110def0d0f3Smrg break ;; 111def0d0f3Smrg esac 112def0d0f3Smrgdone 113def0d0f3Smrg 114def0d0f3Smrgcase $# in 115def0d0f3Smrg 0) echo "$me: missing argument$help" >&2 116def0d0f3Smrg exit 1;; 117def0d0f3Smrg 1) ;; 118def0d0f3Smrg *) echo "$me: too many arguments$help" >&2 119def0d0f3Smrg exit 1;; 120def0d0f3Smrgesac 121def0d0f3Smrg 122def0d0f3Smrg# Split fields of configuration type 123def0d0f3Smrg# shellcheck disable=SC2162 124def0d0f3Smrgsaved_IFS=$IFS 125def0d0f3SmrgIFS="-" read field1 field2 field3 field4 <<EOF 126def0d0f3Smrg$1 127def0d0f3SmrgEOF 128def0d0f3SmrgIFS=$saved_IFS 129def0d0f3Smrg 130def0d0f3Smrg# Separate into logical components for further validation 131def0d0f3Smrgcase $1 in 132def0d0f3Smrg *-*-*-*-*) 133def0d0f3Smrg echo Invalid configuration \`"$1"\': more than four components >&2 134def0d0f3Smrg exit 1 135def0d0f3Smrg ;; 136def0d0f3Smrg *-*-*-*) 137def0d0f3Smrg basic_machine=$field1-$field2 138def0d0f3Smrg basic_os=$field3-$field4 139def0d0f3Smrg ;; 140def0d0f3Smrg *-*-*) 141def0d0f3Smrg # Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two 142def0d0f3Smrg # parts 143def0d0f3Smrg maybe_os=$field2-$field3 144def0d0f3Smrg case $maybe_os in 145def0d0f3Smrg nto-qnx* | linux-* | uclinux-uclibc* \ 146def0d0f3Smrg | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \ 147def0d0f3Smrg | netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \ 148def0d0f3Smrg | storm-chaos* | os2-emx* | rtmk-nova* | managarm-*) 149def0d0f3Smrg basic_machine=$field1 150def0d0f3Smrg basic_os=$maybe_os 151def0d0f3Smrg ;; 152def0d0f3Smrg android-linux) 153def0d0f3Smrg basic_machine=$field1-unknown 154def0d0f3Smrg basic_os=linux-android 155def0d0f3Smrg ;; 156def0d0f3Smrg *) 157def0d0f3Smrg basic_machine=$field1-$field2 158def0d0f3Smrg basic_os=$field3 159def0d0f3Smrg ;; 160def0d0f3Smrg esac 161def0d0f3Smrg ;; 162def0d0f3Smrg *-*) 163def0d0f3Smrg # A lone config we happen to match not fitting any pattern 164def0d0f3Smrg case $field1-$field2 in 165def0d0f3Smrg decstation-3100) 166def0d0f3Smrg basic_machine=mips-dec 167def0d0f3Smrg basic_os= 168def0d0f3Smrg ;; 169def0d0f3Smrg *-*) 170def0d0f3Smrg # Second component is usually, but not always the OS 171def0d0f3Smrg case $field2 in 172def0d0f3Smrg # Prevent following clause from handling this valid os 173def0d0f3Smrg sun*os*) 174def0d0f3Smrg basic_machine=$field1 175def0d0f3Smrg basic_os=$field2 176def0d0f3Smrg ;; 177def0d0f3Smrg zephyr*) 178def0d0f3Smrg basic_machine=$field1-unknown 179def0d0f3Smrg basic_os=$field2 180def0d0f3Smrg ;; 181def0d0f3Smrg # Manufacturers 182def0d0f3Smrg dec* | mips* | sequent* | encore* | pc533* | sgi* | sony* \ 183def0d0f3Smrg | att* | 7300* | 3300* | delta* | motorola* | sun[234]* \ 184def0d0f3Smrg | unicom* | ibm* | next | hp | isi* | apollo | altos* \ 185def0d0f3Smrg | convergent* | ncr* | news | 32* | 3600* | 3100* \ 186def0d0f3Smrg | hitachi* | c[123]* | convex* | sun | crds | omron* | dg \ 187def0d0f3Smrg | ultra | tti* | harris | dolphin | highlevel | gould \ 188def0d0f3Smrg | cbm | ns | masscomp | apple | axis | knuth | cray \ 189def0d0f3Smrg | microblaze* | sim | cisco \ 190def0d0f3Smrg | oki | wec | wrs | winbond) 191def0d0f3Smrg basic_machine=$field1-$field2 192def0d0f3Smrg basic_os= 193def0d0f3Smrg ;; 194def0d0f3Smrg *) 195def0d0f3Smrg basic_machine=$field1 196def0d0f3Smrg basic_os=$field2 197def0d0f3Smrg ;; 198def0d0f3Smrg esac 199def0d0f3Smrg ;; 200def0d0f3Smrg esac 201def0d0f3Smrg ;; 202def0d0f3Smrg *) 203def0d0f3Smrg # Convert single-component short-hands not valid as part of 204def0d0f3Smrg # multi-component configurations. 205def0d0f3Smrg case $field1 in 206def0d0f3Smrg 386bsd) 207def0d0f3Smrg basic_machine=i386-pc 208def0d0f3Smrg basic_os=bsd 209def0d0f3Smrg ;; 210def0d0f3Smrg a29khif) 211def0d0f3Smrg basic_machine=a29k-amd 212def0d0f3Smrg basic_os=udi 213def0d0f3Smrg ;; 214def0d0f3Smrg adobe68k) 215def0d0f3Smrg basic_machine=m68010-adobe 216def0d0f3Smrg basic_os=scout 217def0d0f3Smrg ;; 218def0d0f3Smrg alliant) 219def0d0f3Smrg basic_machine=fx80-alliant 220def0d0f3Smrg basic_os= 221def0d0f3Smrg ;; 222def0d0f3Smrg altos | altos3068) 223def0d0f3Smrg basic_machine=m68k-altos 224def0d0f3Smrg basic_os= 225def0d0f3Smrg ;; 226def0d0f3Smrg am29k) 227def0d0f3Smrg basic_machine=a29k-none 228def0d0f3Smrg basic_os=bsd 229def0d0f3Smrg ;; 230def0d0f3Smrg amdahl) 231def0d0f3Smrg basic_machine=580-amdahl 232def0d0f3Smrg basic_os=sysv 233def0d0f3Smrg ;; 234def0d0f3Smrg amiga) 235def0d0f3Smrg basic_machine=m68k-unknown 236def0d0f3Smrg basic_os= 237def0d0f3Smrg ;; 238def0d0f3Smrg amigaos | amigados) 239def0d0f3Smrg basic_machine=m68k-unknown 240def0d0f3Smrg basic_os=amigaos 241def0d0f3Smrg ;; 242def0d0f3Smrg amigaunix | amix) 243def0d0f3Smrg basic_machine=m68k-unknown 244def0d0f3Smrg basic_os=sysv4 245def0d0f3Smrg ;; 246def0d0f3Smrg apollo68) 247def0d0f3Smrg basic_machine=m68k-apollo 248def0d0f3Smrg basic_os=sysv 249def0d0f3Smrg ;; 250def0d0f3Smrg apollo68bsd) 251def0d0f3Smrg basic_machine=m68k-apollo 252def0d0f3Smrg basic_os=bsd 253def0d0f3Smrg ;; 254def0d0f3Smrg aros) 255def0d0f3Smrg basic_machine=i386-pc 256def0d0f3Smrg basic_os=aros 257def0d0f3Smrg ;; 258def0d0f3Smrg aux) 259def0d0f3Smrg basic_machine=m68k-apple 260def0d0f3Smrg basic_os=aux 261def0d0f3Smrg ;; 262def0d0f3Smrg balance) 263def0d0f3Smrg basic_machine=ns32k-sequent 264def0d0f3Smrg basic_os=dynix 265def0d0f3Smrg ;; 266def0d0f3Smrg blackfin) 267def0d0f3Smrg basic_machine=bfin-unknown 268def0d0f3Smrg basic_os=linux 269def0d0f3Smrg ;; 270def0d0f3Smrg cegcc) 271def0d0f3Smrg basic_machine=arm-unknown 272def0d0f3Smrg basic_os=cegcc 273def0d0f3Smrg ;; 274def0d0f3Smrg convex-c1) 275def0d0f3Smrg basic_machine=c1-convex 276def0d0f3Smrg basic_os=bsd 277def0d0f3Smrg ;; 278def0d0f3Smrg convex-c2) 279def0d0f3Smrg basic_machine=c2-convex 280def0d0f3Smrg basic_os=bsd 281def0d0f3Smrg ;; 282def0d0f3Smrg convex-c32) 283def0d0f3Smrg basic_machine=c32-convex 284def0d0f3Smrg basic_os=bsd 285def0d0f3Smrg ;; 286def0d0f3Smrg convex-c34) 287def0d0f3Smrg basic_machine=c34-convex 288def0d0f3Smrg basic_os=bsd 289def0d0f3Smrg ;; 290def0d0f3Smrg convex-c38) 291def0d0f3Smrg basic_machine=c38-convex 292def0d0f3Smrg basic_os=bsd 293def0d0f3Smrg ;; 294def0d0f3Smrg cray) 295def0d0f3Smrg basic_machine=j90-cray 296def0d0f3Smrg basic_os=unicos 297def0d0f3Smrg ;; 298def0d0f3Smrg crds | unos) 299def0d0f3Smrg basic_machine=m68k-crds 300def0d0f3Smrg basic_os= 301def0d0f3Smrg ;; 302def0d0f3Smrg da30) 303def0d0f3Smrg basic_machine=m68k-da30 304def0d0f3Smrg basic_os= 305def0d0f3Smrg ;; 306def0d0f3Smrg decstation | pmax | pmin | dec3100 | decstatn) 307def0d0f3Smrg basic_machine=mips-dec 308def0d0f3Smrg basic_os= 309def0d0f3Smrg ;; 310def0d0f3Smrg delta88) 311def0d0f3Smrg basic_machine=m88k-motorola 312def0d0f3Smrg basic_os=sysv3 313def0d0f3Smrg ;; 314def0d0f3Smrg dicos) 315def0d0f3Smrg basic_machine=i686-pc 316def0d0f3Smrg basic_os=dicos 317def0d0f3Smrg ;; 318def0d0f3Smrg djgpp) 319def0d0f3Smrg basic_machine=i586-pc 320def0d0f3Smrg basic_os=msdosdjgpp 321def0d0f3Smrg ;; 322def0d0f3Smrg ebmon29k) 323def0d0f3Smrg basic_machine=a29k-amd 324def0d0f3Smrg basic_os=ebmon 325def0d0f3Smrg ;; 326def0d0f3Smrg es1800 | OSE68k | ose68k | ose | OSE) 327def0d0f3Smrg basic_machine=m68k-ericsson 328def0d0f3Smrg basic_os=ose 329def0d0f3Smrg ;; 330def0d0f3Smrg gmicro) 331def0d0f3Smrg basic_machine=tron-gmicro 332def0d0f3Smrg basic_os=sysv 333def0d0f3Smrg ;; 334def0d0f3Smrg go32) 335def0d0f3Smrg basic_machine=i386-pc 336def0d0f3Smrg basic_os=go32 337def0d0f3Smrg ;; 338def0d0f3Smrg h8300hms) 339def0d0f3Smrg basic_machine=h8300-hitachi 340def0d0f3Smrg basic_os=hms 341def0d0f3Smrg ;; 342def0d0f3Smrg h8300xray) 343def0d0f3Smrg basic_machine=h8300-hitachi 344def0d0f3Smrg basic_os=xray 345def0d0f3Smrg ;; 346def0d0f3Smrg h8500hms) 347def0d0f3Smrg basic_machine=h8500-hitachi 348def0d0f3Smrg basic_os=hms 349def0d0f3Smrg ;; 350def0d0f3Smrg harris) 351def0d0f3Smrg basic_machine=m88k-harris 352def0d0f3Smrg basic_os=sysv3 353def0d0f3Smrg ;; 354def0d0f3Smrg hp300 | hp300hpux) 355def0d0f3Smrg basic_machine=m68k-hp 356def0d0f3Smrg basic_os=hpux 357def0d0f3Smrg ;; 358def0d0f3Smrg hp300bsd) 359def0d0f3Smrg basic_machine=m68k-hp 360def0d0f3Smrg basic_os=bsd 361def0d0f3Smrg ;; 362def0d0f3Smrg hppaosf) 363def0d0f3Smrg basic_machine=hppa1.1-hp 364def0d0f3Smrg basic_os=osf 365def0d0f3Smrg ;; 366def0d0f3Smrg hppro) 367def0d0f3Smrg basic_machine=hppa1.1-hp 368def0d0f3Smrg basic_os=proelf 369def0d0f3Smrg ;; 370def0d0f3Smrg i386mach) 371def0d0f3Smrg basic_machine=i386-mach 372def0d0f3Smrg basic_os=mach 373def0d0f3Smrg ;; 374def0d0f3Smrg isi68 | isi) 375def0d0f3Smrg basic_machine=m68k-isi 376def0d0f3Smrg basic_os=sysv 377def0d0f3Smrg ;; 378def0d0f3Smrg m68knommu) 379def0d0f3Smrg basic_machine=m68k-unknown 380def0d0f3Smrg basic_os=linux 381def0d0f3Smrg ;; 382def0d0f3Smrg magnum | m3230) 383def0d0f3Smrg basic_machine=mips-mips 384def0d0f3Smrg basic_os=sysv 385def0d0f3Smrg ;; 386def0d0f3Smrg merlin) 387def0d0f3Smrg basic_machine=ns32k-utek 388def0d0f3Smrg basic_os=sysv 389def0d0f3Smrg ;; 390def0d0f3Smrg mingw64) 391def0d0f3Smrg basic_machine=x86_64-pc 392def0d0f3Smrg basic_os=mingw64 393def0d0f3Smrg ;; 394def0d0f3Smrg mingw32) 395def0d0f3Smrg basic_machine=i686-pc 396def0d0f3Smrg basic_os=mingw32 397def0d0f3Smrg ;; 398def0d0f3Smrg mingw32ce) 399def0d0f3Smrg basic_machine=arm-unknown 400def0d0f3Smrg basic_os=mingw32ce 401def0d0f3Smrg ;; 402def0d0f3Smrg monitor) 403def0d0f3Smrg basic_machine=m68k-rom68k 404def0d0f3Smrg basic_os=coff 405def0d0f3Smrg ;; 406def0d0f3Smrg morphos) 407def0d0f3Smrg basic_machine=powerpc-unknown 408def0d0f3Smrg basic_os=morphos 409def0d0f3Smrg ;; 410def0d0f3Smrg moxiebox) 411def0d0f3Smrg basic_machine=moxie-unknown 412def0d0f3Smrg basic_os=moxiebox 413def0d0f3Smrg ;; 414def0d0f3Smrg msdos) 415def0d0f3Smrg basic_machine=i386-pc 416def0d0f3Smrg basic_os=msdos 417def0d0f3Smrg ;; 418def0d0f3Smrg msys) 419def0d0f3Smrg basic_machine=i686-pc 420def0d0f3Smrg basic_os=msys 421def0d0f3Smrg ;; 422def0d0f3Smrg mvs) 423def0d0f3Smrg basic_machine=i370-ibm 424def0d0f3Smrg basic_os=mvs 425def0d0f3Smrg ;; 426def0d0f3Smrg nacl) 427def0d0f3Smrg basic_machine=le32-unknown 428def0d0f3Smrg basic_os=nacl 429def0d0f3Smrg ;; 430def0d0f3Smrg ncr3000) 431def0d0f3Smrg basic_machine=i486-ncr 432def0d0f3Smrg basic_os=sysv4 433def0d0f3Smrg ;; 434def0d0f3Smrg netbsd386) 435def0d0f3Smrg basic_machine=i386-pc 436def0d0f3Smrg basic_os=netbsd 437def0d0f3Smrg ;; 438def0d0f3Smrg netwinder) 439def0d0f3Smrg basic_machine=armv4l-rebel 440def0d0f3Smrg basic_os=linux 441def0d0f3Smrg ;; 442def0d0f3Smrg news | news700 | news800 | news900) 443def0d0f3Smrg basic_machine=m68k-sony 444def0d0f3Smrg basic_os=newsos 445def0d0f3Smrg ;; 446def0d0f3Smrg news1000) 447def0d0f3Smrg basic_machine=m68030-sony 448def0d0f3Smrg basic_os=newsos 449def0d0f3Smrg ;; 450def0d0f3Smrg necv70) 451def0d0f3Smrg basic_machine=v70-nec 452def0d0f3Smrg basic_os=sysv 453def0d0f3Smrg ;; 454def0d0f3Smrg nh3000) 455def0d0f3Smrg basic_machine=m68k-harris 456def0d0f3Smrg basic_os=cxux 457def0d0f3Smrg ;; 458def0d0f3Smrg nh[45]000) 459def0d0f3Smrg basic_machine=m88k-harris 460def0d0f3Smrg basic_os=cxux 461def0d0f3Smrg ;; 462def0d0f3Smrg nindy960) 463def0d0f3Smrg basic_machine=i960-intel 464def0d0f3Smrg basic_os=nindy 465def0d0f3Smrg ;; 466def0d0f3Smrg mon960) 467def0d0f3Smrg basic_machine=i960-intel 468def0d0f3Smrg basic_os=mon960 469def0d0f3Smrg ;; 470def0d0f3Smrg nonstopux) 471def0d0f3Smrg basic_machine=mips-compaq 472def0d0f3Smrg basic_os=nonstopux 473def0d0f3Smrg ;; 474def0d0f3Smrg os400) 475def0d0f3Smrg basic_machine=powerpc-ibm 476def0d0f3Smrg basic_os=os400 477def0d0f3Smrg ;; 478def0d0f3Smrg OSE68000 | ose68000) 479def0d0f3Smrg basic_machine=m68000-ericsson 480def0d0f3Smrg basic_os=ose 481def0d0f3Smrg ;; 482def0d0f3Smrg os68k) 483def0d0f3Smrg basic_machine=m68k-none 484def0d0f3Smrg basic_os=os68k 485def0d0f3Smrg ;; 486def0d0f3Smrg paragon) 487def0d0f3Smrg basic_machine=i860-intel 488def0d0f3Smrg basic_os=osf 489def0d0f3Smrg ;; 490def0d0f3Smrg parisc) 491def0d0f3Smrg basic_machine=hppa-unknown 492def0d0f3Smrg basic_os=linux 493def0d0f3Smrg ;; 494def0d0f3Smrg psp) 495def0d0f3Smrg basic_machine=mipsallegrexel-sony 496def0d0f3Smrg basic_os=psp 497def0d0f3Smrg ;; 498def0d0f3Smrg pw32) 499def0d0f3Smrg basic_machine=i586-unknown 500def0d0f3Smrg basic_os=pw32 501def0d0f3Smrg ;; 502def0d0f3Smrg rdos | rdos64) 503def0d0f3Smrg basic_machine=x86_64-pc 504def0d0f3Smrg basic_os=rdos 505def0d0f3Smrg ;; 506def0d0f3Smrg rdos32) 507def0d0f3Smrg basic_machine=i386-pc 508def0d0f3Smrg basic_os=rdos 509def0d0f3Smrg ;; 510def0d0f3Smrg rom68k) 511def0d0f3Smrg basic_machine=m68k-rom68k 512def0d0f3Smrg basic_os=coff 513def0d0f3Smrg ;; 514def0d0f3Smrg sa29200) 515def0d0f3Smrg basic_machine=a29k-amd 516def0d0f3Smrg basic_os=udi 517def0d0f3Smrg ;; 518def0d0f3Smrg sei) 519def0d0f3Smrg basic_machine=mips-sei 520def0d0f3Smrg basic_os=seiux 521def0d0f3Smrg ;; 522def0d0f3Smrg sequent) 523def0d0f3Smrg basic_machine=i386-sequent 524def0d0f3Smrg basic_os= 525def0d0f3Smrg ;; 526def0d0f3Smrg sps7) 527def0d0f3Smrg basic_machine=m68k-bull 528def0d0f3Smrg basic_os=sysv2 529def0d0f3Smrg ;; 530def0d0f3Smrg st2000) 531def0d0f3Smrg basic_machine=m68k-tandem 532def0d0f3Smrg basic_os= 533def0d0f3Smrg ;; 534def0d0f3Smrg stratus) 535def0d0f3Smrg basic_machine=i860-stratus 536def0d0f3Smrg basic_os=sysv4 537def0d0f3Smrg ;; 538def0d0f3Smrg sun2) 539def0d0f3Smrg basic_machine=m68000-sun 540def0d0f3Smrg basic_os= 541def0d0f3Smrg ;; 542def0d0f3Smrg sun2os3) 543def0d0f3Smrg basic_machine=m68000-sun 544def0d0f3Smrg basic_os=sunos3 545def0d0f3Smrg ;; 546def0d0f3Smrg sun2os4) 547def0d0f3Smrg basic_machine=m68000-sun 548def0d0f3Smrg basic_os=sunos4 549def0d0f3Smrg ;; 550def0d0f3Smrg sun3) 551def0d0f3Smrg basic_machine=m68k-sun 552def0d0f3Smrg basic_os= 553def0d0f3Smrg ;; 554def0d0f3Smrg sun3os3) 555def0d0f3Smrg basic_machine=m68k-sun 556def0d0f3Smrg basic_os=sunos3 557def0d0f3Smrg ;; 558def0d0f3Smrg sun3os4) 559def0d0f3Smrg basic_machine=m68k-sun 560def0d0f3Smrg basic_os=sunos4 561def0d0f3Smrg ;; 562def0d0f3Smrg sun4) 563def0d0f3Smrg basic_machine=sparc-sun 564def0d0f3Smrg basic_os= 565def0d0f3Smrg ;; 566def0d0f3Smrg sun4os3) 567def0d0f3Smrg basic_machine=sparc-sun 568def0d0f3Smrg basic_os=sunos3 569def0d0f3Smrg ;; 570def0d0f3Smrg sun4os4) 571def0d0f3Smrg basic_machine=sparc-sun 572def0d0f3Smrg basic_os=sunos4 573def0d0f3Smrg ;; 574def0d0f3Smrg sun4sol2) 575def0d0f3Smrg basic_machine=sparc-sun 576def0d0f3Smrg basic_os=solaris2 577def0d0f3Smrg ;; 578def0d0f3Smrg sun386 | sun386i | roadrunner) 579def0d0f3Smrg basic_machine=i386-sun 580def0d0f3Smrg basic_os= 581def0d0f3Smrg ;; 582def0d0f3Smrg sv1) 583def0d0f3Smrg basic_machine=sv1-cray 584def0d0f3Smrg basic_os=unicos 585def0d0f3Smrg ;; 586def0d0f3Smrg symmetry) 587def0d0f3Smrg basic_machine=i386-sequent 588def0d0f3Smrg basic_os=dynix 589def0d0f3Smrg ;; 590def0d0f3Smrg t3e) 591def0d0f3Smrg basic_machine=alphaev5-cray 592def0d0f3Smrg basic_os=unicos 593def0d0f3Smrg ;; 594def0d0f3Smrg t90) 595def0d0f3Smrg basic_machine=t90-cray 596def0d0f3Smrg basic_os=unicos 597def0d0f3Smrg ;; 598def0d0f3Smrg toad1) 599def0d0f3Smrg basic_machine=pdp10-xkl 600def0d0f3Smrg basic_os=tops20 601def0d0f3Smrg ;; 602def0d0f3Smrg tpf) 603def0d0f3Smrg basic_machine=s390x-ibm 604def0d0f3Smrg basic_os=tpf 605def0d0f3Smrg ;; 606def0d0f3Smrg udi29k) 607def0d0f3Smrg basic_machine=a29k-amd 608def0d0f3Smrg basic_os=udi 609def0d0f3Smrg ;; 610def0d0f3Smrg ultra3) 611def0d0f3Smrg basic_machine=a29k-nyu 612def0d0f3Smrg basic_os=sym1 613def0d0f3Smrg ;; 614def0d0f3Smrg v810 | necv810) 615def0d0f3Smrg basic_machine=v810-nec 616def0d0f3Smrg basic_os=none 617def0d0f3Smrg ;; 618def0d0f3Smrg vaxv) 619def0d0f3Smrg basic_machine=vax-dec 620def0d0f3Smrg basic_os=sysv 621def0d0f3Smrg ;; 622def0d0f3Smrg vms) 623def0d0f3Smrg basic_machine=vax-dec 624def0d0f3Smrg basic_os=vms 625def0d0f3Smrg ;; 626def0d0f3Smrg vsta) 627def0d0f3Smrg basic_machine=i386-pc 628def0d0f3Smrg basic_os=vsta 629def0d0f3Smrg ;; 630def0d0f3Smrg vxworks960) 631def0d0f3Smrg basic_machine=i960-wrs 632def0d0f3Smrg basic_os=vxworks 633def0d0f3Smrg ;; 634def0d0f3Smrg vxworks68) 635def0d0f3Smrg basic_machine=m68k-wrs 636def0d0f3Smrg basic_os=vxworks 637def0d0f3Smrg ;; 638def0d0f3Smrg vxworks29k) 639def0d0f3Smrg basic_machine=a29k-wrs 640def0d0f3Smrg basic_os=vxworks 641def0d0f3Smrg ;; 642def0d0f3Smrg xbox) 643def0d0f3Smrg basic_machine=i686-pc 644def0d0f3Smrg basic_os=mingw32 645def0d0f3Smrg ;; 646def0d0f3Smrg ymp) 647def0d0f3Smrg basic_machine=ymp-cray 648def0d0f3Smrg basic_os=unicos 649def0d0f3Smrg ;; 650def0d0f3Smrg *) 651def0d0f3Smrg basic_machine=$1 652def0d0f3Smrg basic_os= 653def0d0f3Smrg ;; 654def0d0f3Smrg esac 655def0d0f3Smrg ;; 656def0d0f3Smrgesac 657def0d0f3Smrg 658def0d0f3Smrg# Decode 1-component or ad-hoc basic machines 659def0d0f3Smrgcase $basic_machine in 660def0d0f3Smrg # Here we handle the default manufacturer of certain CPU types. It is in 661def0d0f3Smrg # some cases the only manufacturer, in others, it is the most popular. 662def0d0f3Smrg w89k) 663def0d0f3Smrg cpu=hppa1.1 664def0d0f3Smrg vendor=winbond 665def0d0f3Smrg ;; 666def0d0f3Smrg op50n) 667def0d0f3Smrg cpu=hppa1.1 668def0d0f3Smrg vendor=oki 669def0d0f3Smrg ;; 670def0d0f3Smrg op60c) 671def0d0f3Smrg cpu=hppa1.1 672def0d0f3Smrg vendor=oki 673def0d0f3Smrg ;; 674def0d0f3Smrg ibm*) 675def0d0f3Smrg cpu=i370 676def0d0f3Smrg vendor=ibm 677def0d0f3Smrg ;; 678def0d0f3Smrg orion105) 679def0d0f3Smrg cpu=clipper 680def0d0f3Smrg vendor=highlevel 681def0d0f3Smrg ;; 682def0d0f3Smrg mac | mpw | mac-mpw) 683def0d0f3Smrg cpu=m68k 684def0d0f3Smrg vendor=apple 685def0d0f3Smrg ;; 686def0d0f3Smrg pmac | pmac-mpw) 687def0d0f3Smrg cpu=powerpc 688def0d0f3Smrg vendor=apple 689def0d0f3Smrg ;; 690def0d0f3Smrg 691def0d0f3Smrg # Recognize the various machine names and aliases which stand 692def0d0f3Smrg # for a CPU type and a company and sometimes even an OS. 693def0d0f3Smrg 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) 694def0d0f3Smrg cpu=m68000 695def0d0f3Smrg vendor=att 696def0d0f3Smrg ;; 697def0d0f3Smrg 3b*) 698def0d0f3Smrg cpu=we32k 699def0d0f3Smrg vendor=att 700def0d0f3Smrg ;; 701def0d0f3Smrg bluegene*) 702def0d0f3Smrg cpu=powerpc 703def0d0f3Smrg vendor=ibm 704def0d0f3Smrg basic_os=cnk 705def0d0f3Smrg ;; 706def0d0f3Smrg decsystem10* | dec10*) 707def0d0f3Smrg cpu=pdp10 708def0d0f3Smrg vendor=dec 709def0d0f3Smrg basic_os=tops10 710def0d0f3Smrg ;; 711def0d0f3Smrg decsystem20* | dec20*) 712def0d0f3Smrg cpu=pdp10 713def0d0f3Smrg vendor=dec 714def0d0f3Smrg basic_os=tops20 715def0d0f3Smrg ;; 716def0d0f3Smrg delta | 3300 | motorola-3300 | motorola-delta \ 717def0d0f3Smrg | 3300-motorola | delta-motorola) 718def0d0f3Smrg cpu=m68k 719def0d0f3Smrg vendor=motorola 720def0d0f3Smrg ;; 721def0d0f3Smrg dpx2*) 722def0d0f3Smrg cpu=m68k 723def0d0f3Smrg vendor=bull 724def0d0f3Smrg basic_os=sysv3 725def0d0f3Smrg ;; 726def0d0f3Smrg encore | umax | mmax) 727def0d0f3Smrg cpu=ns32k 728def0d0f3Smrg vendor=encore 729def0d0f3Smrg ;; 730def0d0f3Smrg elxsi) 731def0d0f3Smrg cpu=elxsi 732def0d0f3Smrg vendor=elxsi 733def0d0f3Smrg basic_os=${basic_os:-bsd} 734def0d0f3Smrg ;; 735def0d0f3Smrg fx2800) 736def0d0f3Smrg cpu=i860 737def0d0f3Smrg vendor=alliant 738def0d0f3Smrg ;; 739def0d0f3Smrg genix) 740def0d0f3Smrg cpu=ns32k 741def0d0f3Smrg vendor=ns 742def0d0f3Smrg ;; 743def0d0f3Smrg h3050r* | hiux*) 744def0d0f3Smrg cpu=hppa1.1 745def0d0f3Smrg vendor=hitachi 746def0d0f3Smrg basic_os=hiuxwe2 747def0d0f3Smrg ;; 748def0d0f3Smrg hp3k9[0-9][0-9] | hp9[0-9][0-9]) 749def0d0f3Smrg cpu=hppa1.0 750def0d0f3Smrg vendor=hp 751def0d0f3Smrg ;; 752def0d0f3Smrg hp9k2[0-9][0-9] | hp9k31[0-9]) 753def0d0f3Smrg cpu=m68000 754def0d0f3Smrg vendor=hp 755def0d0f3Smrg ;; 756def0d0f3Smrg hp9k3[2-9][0-9]) 757def0d0f3Smrg cpu=m68k 758def0d0f3Smrg vendor=hp 759def0d0f3Smrg ;; 760def0d0f3Smrg hp9k6[0-9][0-9] | hp6[0-9][0-9]) 761def0d0f3Smrg cpu=hppa1.0 762def0d0f3Smrg vendor=hp 763def0d0f3Smrg ;; 764def0d0f3Smrg hp9k7[0-79][0-9] | hp7[0-79][0-9]) 765def0d0f3Smrg cpu=hppa1.1 766def0d0f3Smrg vendor=hp 767def0d0f3Smrg ;; 768def0d0f3Smrg hp9k78[0-9] | hp78[0-9]) 769def0d0f3Smrg # FIXME: really hppa2.0-hp 770def0d0f3Smrg cpu=hppa1.1 771def0d0f3Smrg vendor=hp 772def0d0f3Smrg ;; 773def0d0f3Smrg hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) 774def0d0f3Smrg # FIXME: really hppa2.0-hp 775def0d0f3Smrg cpu=hppa1.1 776def0d0f3Smrg vendor=hp 777def0d0f3Smrg ;; 778def0d0f3Smrg hp9k8[0-9][13679] | hp8[0-9][13679]) 779def0d0f3Smrg cpu=hppa1.1 780def0d0f3Smrg vendor=hp 781def0d0f3Smrg ;; 782def0d0f3Smrg hp9k8[0-9][0-9] | hp8[0-9][0-9]) 783def0d0f3Smrg cpu=hppa1.0 784def0d0f3Smrg vendor=hp 785def0d0f3Smrg ;; 786def0d0f3Smrg i*86v32) 787def0d0f3Smrg cpu=`echo "$1" | sed -e 's/86.*/86/'` 788def0d0f3Smrg vendor=pc 789def0d0f3Smrg basic_os=sysv32 790def0d0f3Smrg ;; 791def0d0f3Smrg i*86v4*) 792def0d0f3Smrg cpu=`echo "$1" | sed -e 's/86.*/86/'` 793def0d0f3Smrg vendor=pc 794def0d0f3Smrg basic_os=sysv4 795def0d0f3Smrg ;; 796def0d0f3Smrg i*86v) 797def0d0f3Smrg cpu=`echo "$1" | sed -e 's/86.*/86/'` 798def0d0f3Smrg vendor=pc 799def0d0f3Smrg basic_os=sysv 800def0d0f3Smrg ;; 801def0d0f3Smrg i*86sol2) 802def0d0f3Smrg cpu=`echo "$1" | sed -e 's/86.*/86/'` 803def0d0f3Smrg vendor=pc 804def0d0f3Smrg basic_os=solaris2 805def0d0f3Smrg ;; 806def0d0f3Smrg j90 | j90-cray) 807def0d0f3Smrg cpu=j90 808def0d0f3Smrg vendor=cray 809def0d0f3Smrg basic_os=${basic_os:-unicos} 810def0d0f3Smrg ;; 811def0d0f3Smrg iris | iris4d) 812def0d0f3Smrg cpu=mips 813def0d0f3Smrg vendor=sgi 814def0d0f3Smrg case $basic_os in 815def0d0f3Smrg irix*) 816def0d0f3Smrg ;; 817def0d0f3Smrg *) 818def0d0f3Smrg basic_os=irix4 819def0d0f3Smrg ;; 820def0d0f3Smrg esac 821def0d0f3Smrg ;; 822def0d0f3Smrg miniframe) 823def0d0f3Smrg cpu=m68000 824def0d0f3Smrg vendor=convergent 825def0d0f3Smrg ;; 826def0d0f3Smrg *mint | mint[0-9]* | *MiNT | *MiNT[0-9]*) 827def0d0f3Smrg cpu=m68k 828def0d0f3Smrg vendor=atari 829def0d0f3Smrg basic_os=mint 830def0d0f3Smrg ;; 831def0d0f3Smrg news-3600 | risc-news) 832def0d0f3Smrg cpu=mips 833def0d0f3Smrg vendor=sony 834def0d0f3Smrg basic_os=newsos 835def0d0f3Smrg ;; 836def0d0f3Smrg next | m*-next) 837def0d0f3Smrg cpu=m68k 838def0d0f3Smrg vendor=next 839def0d0f3Smrg case $basic_os in 840def0d0f3Smrg openstep*) 841def0d0f3Smrg ;; 842def0d0f3Smrg nextstep*) 843def0d0f3Smrg ;; 844def0d0f3Smrg ns2*) 845def0d0f3Smrg basic_os=nextstep2 846def0d0f3Smrg ;; 847def0d0f3Smrg *) 848def0d0f3Smrg basic_os=nextstep3 849def0d0f3Smrg ;; 850def0d0f3Smrg esac 851def0d0f3Smrg ;; 852def0d0f3Smrg np1) 853def0d0f3Smrg cpu=np1 854def0d0f3Smrg vendor=gould 855def0d0f3Smrg ;; 856def0d0f3Smrg op50n-* | op60c-*) 857def0d0f3Smrg cpu=hppa1.1 858def0d0f3Smrg vendor=oki 859def0d0f3Smrg basic_os=proelf 860def0d0f3Smrg ;; 861def0d0f3Smrg pa-hitachi) 862def0d0f3Smrg cpu=hppa1.1 863def0d0f3Smrg vendor=hitachi 864def0d0f3Smrg basic_os=hiuxwe2 865def0d0f3Smrg ;; 866def0d0f3Smrg pbd) 867def0d0f3Smrg cpu=sparc 868def0d0f3Smrg vendor=tti 869def0d0f3Smrg ;; 870def0d0f3Smrg pbb) 871def0d0f3Smrg cpu=m68k 872def0d0f3Smrg vendor=tti 873def0d0f3Smrg ;; 874def0d0f3Smrg pc532) 875def0d0f3Smrg cpu=ns32k 876def0d0f3Smrg vendor=pc532 877def0d0f3Smrg ;; 878def0d0f3Smrg pn) 879def0d0f3Smrg cpu=pn 880def0d0f3Smrg vendor=gould 881def0d0f3Smrg ;; 882def0d0f3Smrg power) 883def0d0f3Smrg cpu=power 884def0d0f3Smrg vendor=ibm 885def0d0f3Smrg ;; 886def0d0f3Smrg ps2) 887def0d0f3Smrg cpu=i386 888def0d0f3Smrg vendor=ibm 889def0d0f3Smrg ;; 890def0d0f3Smrg rm[46]00) 891def0d0f3Smrg cpu=mips 892def0d0f3Smrg vendor=siemens 893def0d0f3Smrg ;; 894def0d0f3Smrg rtpc | rtpc-*) 895def0d0f3Smrg cpu=romp 896def0d0f3Smrg vendor=ibm 897def0d0f3Smrg ;; 898def0d0f3Smrg sde) 899def0d0f3Smrg cpu=mipsisa32 900def0d0f3Smrg vendor=sde 901def0d0f3Smrg basic_os=${basic_os:-elf} 902def0d0f3Smrg ;; 903def0d0f3Smrg simso-wrs) 904def0d0f3Smrg cpu=sparclite 905def0d0f3Smrg vendor=wrs 906def0d0f3Smrg basic_os=vxworks 907def0d0f3Smrg ;; 908def0d0f3Smrg tower | tower-32) 909def0d0f3Smrg cpu=m68k 910def0d0f3Smrg vendor=ncr 911def0d0f3Smrg ;; 912def0d0f3Smrg vpp*|vx|vx-*) 913def0d0f3Smrg cpu=f301 914def0d0f3Smrg vendor=fujitsu 915def0d0f3Smrg ;; 916def0d0f3Smrg w65) 917def0d0f3Smrg cpu=w65 918def0d0f3Smrg vendor=wdc 919def0d0f3Smrg ;; 920def0d0f3Smrg w89k-*) 921def0d0f3Smrg cpu=hppa1.1 922def0d0f3Smrg vendor=winbond 923def0d0f3Smrg basic_os=proelf 924def0d0f3Smrg ;; 925def0d0f3Smrg none) 926def0d0f3Smrg cpu=none 927def0d0f3Smrg vendor=none 928def0d0f3Smrg ;; 929def0d0f3Smrg leon|leon[3-9]) 930def0d0f3Smrg cpu=sparc 931def0d0f3Smrg vendor=$basic_machine 932def0d0f3Smrg ;; 933def0d0f3Smrg leon-*|leon[3-9]-*) 934def0d0f3Smrg cpu=sparc 935def0d0f3Smrg vendor=`echo "$basic_machine" | sed 's/-.*//'` 936def0d0f3Smrg ;; 937def0d0f3Smrg 938def0d0f3Smrg *-*) 939def0d0f3Smrg # shellcheck disable=SC2162 940def0d0f3Smrg saved_IFS=$IFS 941def0d0f3Smrg IFS="-" read cpu vendor <<EOF 942def0d0f3Smrg$basic_machine 943def0d0f3SmrgEOF 944def0d0f3Smrg IFS=$saved_IFS 945def0d0f3Smrg ;; 946def0d0f3Smrg # We use `pc' rather than `unknown' 947def0d0f3Smrg # because (1) that's what they normally are, and 948def0d0f3Smrg # (2) the word "unknown" tends to confuse beginning users. 949def0d0f3Smrg i*86 | x86_64) 950def0d0f3Smrg cpu=$basic_machine 951def0d0f3Smrg vendor=pc 952def0d0f3Smrg ;; 953def0d0f3Smrg # These rules are duplicated from below for sake of the special case above; 954def0d0f3Smrg # i.e. things that normalized to x86 arches should also default to "pc" 955def0d0f3Smrg pc98) 956def0d0f3Smrg cpu=i386 957def0d0f3Smrg vendor=pc 958def0d0f3Smrg ;; 959def0d0f3Smrg x64 | amd64) 960def0d0f3Smrg cpu=x86_64 961def0d0f3Smrg vendor=pc 962def0d0f3Smrg ;; 963def0d0f3Smrg # Recognize the basic CPU types without company name. 964def0d0f3Smrg *) 965def0d0f3Smrg cpu=$basic_machine 966def0d0f3Smrg vendor=unknown 967def0d0f3Smrg ;; 968def0d0f3Smrgesac 969def0d0f3Smrg 970def0d0f3Smrgunset -v basic_machine 971def0d0f3Smrg 972def0d0f3Smrg# Decode basic machines in the full and proper CPU-Company form. 973def0d0f3Smrgcase $cpu-$vendor in 974def0d0f3Smrg # Here we handle the default manufacturer of certain CPU types in canonical form. It is in 975def0d0f3Smrg # some cases the only manufacturer, in others, it is the most popular. 976def0d0f3Smrg craynv-unknown) 977def0d0f3Smrg vendor=cray 978def0d0f3Smrg basic_os=${basic_os:-unicosmp} 979def0d0f3Smrg ;; 980def0d0f3Smrg c90-unknown | c90-cray) 981def0d0f3Smrg vendor=cray 982def0d0f3Smrg basic_os=${Basic_os:-unicos} 983def0d0f3Smrg ;; 984def0d0f3Smrg fx80-unknown) 985def0d0f3Smrg vendor=alliant 986def0d0f3Smrg ;; 987def0d0f3Smrg romp-unknown) 988def0d0f3Smrg vendor=ibm 989def0d0f3Smrg ;; 990def0d0f3Smrg mmix-unknown) 991def0d0f3Smrg vendor=knuth 992def0d0f3Smrg ;; 993def0d0f3Smrg microblaze-unknown | microblazeel-unknown) 994def0d0f3Smrg vendor=xilinx 995def0d0f3Smrg ;; 996def0d0f3Smrg rs6000-unknown) 997def0d0f3Smrg vendor=ibm 998def0d0f3Smrg ;; 999def0d0f3Smrg vax-unknown) 1000def0d0f3Smrg vendor=dec 1001def0d0f3Smrg ;; 1002def0d0f3Smrg pdp11-unknown) 1003def0d0f3Smrg vendor=dec 1004def0d0f3Smrg ;; 1005def0d0f3Smrg we32k-unknown) 1006def0d0f3Smrg vendor=att 1007def0d0f3Smrg ;; 1008def0d0f3Smrg cydra-unknown) 1009def0d0f3Smrg vendor=cydrome 1010def0d0f3Smrg ;; 1011def0d0f3Smrg i370-ibm*) 1012def0d0f3Smrg vendor=ibm 1013def0d0f3Smrg ;; 1014def0d0f3Smrg orion-unknown) 1015def0d0f3Smrg vendor=highlevel 1016def0d0f3Smrg ;; 1017def0d0f3Smrg xps-unknown | xps100-unknown) 1018def0d0f3Smrg cpu=xps100 1019def0d0f3Smrg vendor=honeywell 1020def0d0f3Smrg ;; 1021def0d0f3Smrg 1022def0d0f3Smrg # Here we normalize CPU types with a missing or matching vendor 1023def0d0f3Smrg armh-unknown | armh-alt) 1024def0d0f3Smrg cpu=armv7l 1025def0d0f3Smrg vendor=alt 1026def0d0f3Smrg basic_os=${basic_os:-linux-gnueabihf} 1027def0d0f3Smrg ;; 1028def0d0f3Smrg dpx20-unknown | dpx20-bull) 1029def0d0f3Smrg cpu=rs6000 1030def0d0f3Smrg vendor=bull 1031def0d0f3Smrg basic_os=${basic_os:-bosx} 1032def0d0f3Smrg ;; 1033def0d0f3Smrg 1034def0d0f3Smrg # Here we normalize CPU types irrespective of the vendor 1035def0d0f3Smrg amd64-*) 1036def0d0f3Smrg cpu=x86_64 1037def0d0f3Smrg ;; 1038def0d0f3Smrg blackfin-*) 1039def0d0f3Smrg cpu=bfin 1040def0d0f3Smrg basic_os=linux 1041def0d0f3Smrg ;; 1042def0d0f3Smrg c54x-*) 1043def0d0f3Smrg cpu=tic54x 1044def0d0f3Smrg ;; 1045def0d0f3Smrg c55x-*) 1046def0d0f3Smrg cpu=tic55x 1047def0d0f3Smrg ;; 1048def0d0f3Smrg c6x-*) 1049def0d0f3Smrg cpu=tic6x 1050def0d0f3Smrg ;; 1051def0d0f3Smrg e500v[12]-*) 1052def0d0f3Smrg cpu=powerpc 1053def0d0f3Smrg basic_os=${basic_os}"spe" 1054def0d0f3Smrg ;; 1055def0d0f3Smrg mips3*-*) 1056def0d0f3Smrg cpu=mips64 1057def0d0f3Smrg ;; 1058def0d0f3Smrg ms1-*) 1059def0d0f3Smrg cpu=mt 1060def0d0f3Smrg ;; 1061def0d0f3Smrg m68knommu-*) 1062def0d0f3Smrg cpu=m68k 1063def0d0f3Smrg basic_os=linux 1064def0d0f3Smrg ;; 1065def0d0f3Smrg m9s12z-* | m68hcs12z-* | hcs12z-* | s12z-*) 1066def0d0f3Smrg cpu=s12z 1067def0d0f3Smrg ;; 1068def0d0f3Smrg openrisc-*) 1069def0d0f3Smrg cpu=or32 1070def0d0f3Smrg ;; 1071def0d0f3Smrg parisc-*) 1072def0d0f3Smrg cpu=hppa 1073def0d0f3Smrg basic_os=linux 1074def0d0f3Smrg ;; 1075def0d0f3Smrg pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) 1076def0d0f3Smrg cpu=i586 1077def0d0f3Smrg ;; 1078def0d0f3Smrg pentiumpro-* | p6-* | 6x86-* | athlon-* | athlon_*-*) 1079def0d0f3Smrg cpu=i686 1080def0d0f3Smrg ;; 1081def0d0f3Smrg pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) 1082def0d0f3Smrg cpu=i686 1083def0d0f3Smrg ;; 1084def0d0f3Smrg pentium4-*) 1085def0d0f3Smrg cpu=i786 1086def0d0f3Smrg ;; 1087def0d0f3Smrg pc98-*) 1088def0d0f3Smrg cpu=i386 1089def0d0f3Smrg ;; 1090def0d0f3Smrg ppc-* | ppcbe-*) 1091def0d0f3Smrg cpu=powerpc 1092def0d0f3Smrg ;; 1093def0d0f3Smrg ppcle-* | powerpclittle-*) 1094def0d0f3Smrg cpu=powerpcle 1095def0d0f3Smrg ;; 1096def0d0f3Smrg ppc64-*) 1097def0d0f3Smrg cpu=powerpc64 1098def0d0f3Smrg ;; 1099def0d0f3Smrg ppc64le-* | powerpc64little-*) 1100def0d0f3Smrg cpu=powerpc64le 1101def0d0f3Smrg ;; 1102def0d0f3Smrg sb1-*) 1103def0d0f3Smrg cpu=mipsisa64sb1 1104def0d0f3Smrg ;; 1105def0d0f3Smrg sb1el-*) 1106def0d0f3Smrg cpu=mipsisa64sb1el 1107def0d0f3Smrg ;; 1108def0d0f3Smrg sh5e[lb]-*) 1109def0d0f3Smrg cpu=`echo "$cpu" | sed 's/^\(sh.\)e\(.\)$/\1\2e/'` 1110def0d0f3Smrg ;; 1111def0d0f3Smrg spur-*) 1112def0d0f3Smrg cpu=spur 1113def0d0f3Smrg ;; 1114def0d0f3Smrg strongarm-* | thumb-*) 1115def0d0f3Smrg cpu=arm 1116def0d0f3Smrg ;; 1117def0d0f3Smrg tx39-*) 1118def0d0f3Smrg cpu=mipstx39 1119def0d0f3Smrg ;; 1120def0d0f3Smrg tx39el-*) 1121def0d0f3Smrg cpu=mipstx39el 1122def0d0f3Smrg ;; 1123def0d0f3Smrg x64-*) 1124def0d0f3Smrg cpu=x86_64 1125def0d0f3Smrg ;; 1126def0d0f3Smrg xscale-* | xscalee[bl]-*) 1127def0d0f3Smrg cpu=`echo "$cpu" | sed 's/^xscale/arm/'` 1128def0d0f3Smrg ;; 1129def0d0f3Smrg arm64-* | aarch64le-*) 1130def0d0f3Smrg cpu=aarch64 1131def0d0f3Smrg ;; 1132def0d0f3Smrg 1133def0d0f3Smrg # Recognize the canonical CPU Types that limit and/or modify the 1134def0d0f3Smrg # company names they are paired with. 1135def0d0f3Smrg cr16-*) 1136def0d0f3Smrg basic_os=${basic_os:-elf} 1137def0d0f3Smrg ;; 1138def0d0f3Smrg crisv32-* | etraxfs*-*) 1139def0d0f3Smrg cpu=crisv32 1140def0d0f3Smrg vendor=axis 1141def0d0f3Smrg ;; 1142def0d0f3Smrg cris-* | etrax*-*) 1143def0d0f3Smrg cpu=cris 1144def0d0f3Smrg vendor=axis 1145def0d0f3Smrg ;; 1146def0d0f3Smrg crx-*) 1147def0d0f3Smrg basic_os=${basic_os:-elf} 1148def0d0f3Smrg ;; 1149def0d0f3Smrg neo-tandem) 1150def0d0f3Smrg cpu=neo 1151def0d0f3Smrg vendor=tandem 1152def0d0f3Smrg ;; 1153def0d0f3Smrg nse-tandem) 1154def0d0f3Smrg cpu=nse 1155def0d0f3Smrg vendor=tandem 1156def0d0f3Smrg ;; 1157def0d0f3Smrg nsr-tandem) 1158def0d0f3Smrg cpu=nsr 1159def0d0f3Smrg vendor=tandem 1160def0d0f3Smrg ;; 1161def0d0f3Smrg nsv-tandem) 1162def0d0f3Smrg cpu=nsv 1163def0d0f3Smrg vendor=tandem 1164def0d0f3Smrg ;; 1165def0d0f3Smrg nsx-tandem) 1166def0d0f3Smrg cpu=nsx 1167def0d0f3Smrg vendor=tandem 1168def0d0f3Smrg ;; 1169def0d0f3Smrg mipsallegrexel-sony) 1170def0d0f3Smrg cpu=mipsallegrexel 1171def0d0f3Smrg vendor=sony 1172def0d0f3Smrg ;; 1173def0d0f3Smrg tile*-*) 1174def0d0f3Smrg basic_os=${basic_os:-linux-gnu} 1175def0d0f3Smrg ;; 1176def0d0f3Smrg 1177def0d0f3Smrg *) 1178def0d0f3Smrg # Recognize the canonical CPU types that are allowed with any 1179def0d0f3Smrg # company name. 1180def0d0f3Smrg case $cpu in 1181def0d0f3Smrg 1750a | 580 \ 1182def0d0f3Smrg | a29k \ 1183def0d0f3Smrg | aarch64 | aarch64_be \ 1184def0d0f3Smrg | abacus \ 1185def0d0f3Smrg | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] \ 1186def0d0f3Smrg | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] \ 1187def0d0f3Smrg | alphapca5[67] | alpha64pca5[67] \ 1188def0d0f3Smrg | am33_2.0 \ 1189def0d0f3Smrg | amdgcn \ 1190def0d0f3Smrg | arc | arceb | arc32 | arc64 \ 1191def0d0f3Smrg | arm | arm[lb]e | arme[lb] | armv* \ 1192def0d0f3Smrg | avr | avr32 \ 1193def0d0f3Smrg | asmjs \ 1194def0d0f3Smrg | ba \ 1195def0d0f3Smrg | be32 | be64 \ 1196def0d0f3Smrg | bfin | bpf | bs2000 \ 1197def0d0f3Smrg | c[123]* | c30 | [cjt]90 | c4x \ 1198def0d0f3Smrg | c8051 | clipper | craynv | csky | cydra \ 1199def0d0f3Smrg | d10v | d30v | dlx | dsp16xx \ 1200def0d0f3Smrg | e2k | elxsi | epiphany \ 1201def0d0f3Smrg | f30[01] | f700 | fido | fr30 | frv | ft32 | fx80 \ 1202def0d0f3Smrg | h8300 | h8500 \ 1203def0d0f3Smrg | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ 1204def0d0f3Smrg | hexagon \ 1205def0d0f3Smrg | i370 | i*86 | i860 | i960 | ia16 | ia64 \ 1206def0d0f3Smrg | ip2k | iq2000 \ 1207def0d0f3Smrg | k1om \ 1208def0d0f3Smrg | le32 | le64 \ 1209def0d0f3Smrg | lm32 \ 1210def0d0f3Smrg | loongarch32 | loongarch64 \ 1211def0d0f3Smrg | m32c | m32r | m32rle \ 1212def0d0f3Smrg | m5200 | m68000 | m680[012346]0 | m68360 | m683?2 | m68k \ 1213def0d0f3Smrg | m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x \ 1214def0d0f3Smrg | m88110 | m88k | maxq | mb | mcore | mep | metag \ 1215def0d0f3Smrg | microblaze | microblazeel \ 1216def0d0f3Smrg | mips | mipsbe | mipseb | mipsel | mipsle \ 1217def0d0f3Smrg | mips16 \ 1218def0d0f3Smrg | mips64 | mips64eb | mips64el \ 1219def0d0f3Smrg | mips64octeon | mips64octeonel \ 1220def0d0f3Smrg | mips64orion | mips64orionel \ 1221def0d0f3Smrg | mips64r5900 | mips64r5900el \ 1222def0d0f3Smrg | mips64vr | mips64vrel \ 1223def0d0f3Smrg | mips64vr4100 | mips64vr4100el \ 1224def0d0f3Smrg | mips64vr4300 | mips64vr4300el \ 1225def0d0f3Smrg | mips64vr5000 | mips64vr5000el \ 1226def0d0f3Smrg | mips64vr5900 | mips64vr5900el \ 1227def0d0f3Smrg | mipsisa32 | mipsisa32el \ 1228def0d0f3Smrg | mipsisa32r2 | mipsisa32r2el \ 1229def0d0f3Smrg | mipsisa32r3 | mipsisa32r3el \ 1230def0d0f3Smrg | mipsisa32r5 | mipsisa32r5el \ 1231def0d0f3Smrg | mipsisa32r6 | mipsisa32r6el \ 1232def0d0f3Smrg | mipsisa64 | mipsisa64el \ 1233def0d0f3Smrg | mipsisa64r2 | mipsisa64r2el \ 1234def0d0f3Smrg | mipsisa64r3 | mipsisa64r3el \ 1235def0d0f3Smrg | mipsisa64r5 | mipsisa64r5el \ 1236def0d0f3Smrg | mipsisa64r6 | mipsisa64r6el \ 1237def0d0f3Smrg | mipsisa64sb1 | mipsisa64sb1el \ 1238def0d0f3Smrg | mipsisa64sr71k | mipsisa64sr71kel \ 1239def0d0f3Smrg | mipsr5900 | mipsr5900el \ 1240def0d0f3Smrg | mipstx39 | mipstx39el \ 1241def0d0f3Smrg | mmix \ 1242def0d0f3Smrg | mn10200 | mn10300 \ 1243def0d0f3Smrg | moxie \ 1244def0d0f3Smrg | mt \ 1245def0d0f3Smrg | msp430 \ 1246def0d0f3Smrg | nds32 | nds32le | nds32be \ 1247def0d0f3Smrg | nfp \ 1248def0d0f3Smrg | nios | nios2 | nios2eb | nios2el \ 1249def0d0f3Smrg | none | np1 | ns16k | ns32k | nvptx \ 1250def0d0f3Smrg | open8 \ 1251def0d0f3Smrg | or1k* \ 1252def0d0f3Smrg | or32 \ 1253def0d0f3Smrg | orion \ 1254def0d0f3Smrg | picochip \ 1255def0d0f3Smrg | pdp10 | pdp11 | pj | pjl | pn | power \ 1256def0d0f3Smrg | powerpc | powerpc64 | powerpc64le | powerpcle | powerpcspe \ 1257def0d0f3Smrg | pru \ 1258def0d0f3Smrg | pyramid \ 1259def0d0f3Smrg | riscv | riscv32 | riscv32be | riscv64 | riscv64be \ 1260def0d0f3Smrg | rl78 | romp | rs6000 | rx \ 1261def0d0f3Smrg | s390 | s390x \ 1262def0d0f3Smrg | score \ 1263def0d0f3Smrg | sh | shl \ 1264def0d0f3Smrg | sh[1234] | sh[24]a | sh[24]ae[lb] | sh[23]e | she[lb] | sh[lb]e \ 1265def0d0f3Smrg | sh[1234]e[lb] | sh[12345][lb]e | sh[23]ele | sh64 | sh64le \ 1266def0d0f3Smrg | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet \ 1267def0d0f3Smrg | sparclite \ 1268def0d0f3Smrg | sparcv8 | sparcv9 | sparcv9b | sparcv9v | sv1 | sx* \ 1269def0d0f3Smrg | spu \ 1270def0d0f3Smrg | tahoe \ 1271def0d0f3Smrg | thumbv7* \ 1272def0d0f3Smrg | tic30 | tic4x | tic54x | tic55x | tic6x | tic80 \ 1273def0d0f3Smrg | tron \ 1274def0d0f3Smrg | ubicom32 \ 1275def0d0f3Smrg | v70 | v850 | v850e | v850e1 | v850es | v850e2 | v850e2v3 \ 1276def0d0f3Smrg | vax \ 1277def0d0f3Smrg | visium \ 1278def0d0f3Smrg | w65 \ 1279def0d0f3Smrg | wasm32 | wasm64 \ 1280def0d0f3Smrg | we32k \ 1281def0d0f3Smrg | x86 | x86_64 | xc16x | xgate | xps100 \ 1282def0d0f3Smrg | xstormy16 | xtensa* \ 1283def0d0f3Smrg | ymp \ 1284def0d0f3Smrg | z8k | z80) 1285def0d0f3Smrg ;; 1286def0d0f3Smrg 1287def0d0f3Smrg *) 1288def0d0f3Smrg echo Invalid configuration \`"$1"\': machine \`"$cpu-$vendor"\' not recognized 1>&2 1289def0d0f3Smrg exit 1 1290def0d0f3Smrg ;; 1291def0d0f3Smrg esac 1292def0d0f3Smrg ;; 1293def0d0f3Smrgesac 1294def0d0f3Smrg 1295def0d0f3Smrg# Here we canonicalize certain aliases for manufacturers. 1296def0d0f3Smrgcase $vendor in 1297def0d0f3Smrg digital*) 1298def0d0f3Smrg vendor=dec 1299def0d0f3Smrg ;; 1300def0d0f3Smrg commodore*) 1301def0d0f3Smrg vendor=cbm 1302def0d0f3Smrg ;; 1303def0d0f3Smrg *) 1304def0d0f3Smrg ;; 1305def0d0f3Smrgesac 1306def0d0f3Smrg 1307def0d0f3Smrg# Decode manufacturer-specific aliases for certain operating systems. 1308def0d0f3Smrg 1309def0d0f3Smrgif test x$basic_os != x 1310def0d0f3Smrgthen 1311def0d0f3Smrg 1312def0d0f3Smrg# First recognize some ad-hoc cases, or perhaps split kernel-os, or else just 1313def0d0f3Smrg# set os. 1314def0d0f3Smrgcase $basic_os in 1315def0d0f3Smrg gnu/linux*) 1316def0d0f3Smrg kernel=linux 1317def0d0f3Smrg os=`echo "$basic_os" | sed -e 's|gnu/linux|gnu|'` 1318def0d0f3Smrg ;; 1319def0d0f3Smrg os2-emx) 1320def0d0f3Smrg kernel=os2 1321def0d0f3Smrg os=`echo "$basic_os" | sed -e 's|os2-emx|emx|'` 1322def0d0f3Smrg ;; 1323def0d0f3Smrg nto-qnx*) 1324def0d0f3Smrg kernel=nto 1325def0d0f3Smrg os=`echo "$basic_os" | sed -e 's|nto-qnx|qnx|'` 1326def0d0f3Smrg ;; 1327def0d0f3Smrg *-*) 1328def0d0f3Smrg # shellcheck disable=SC2162 1329def0d0f3Smrg saved_IFS=$IFS 1330def0d0f3Smrg IFS="-" read kernel os <<EOF 1331def0d0f3Smrg$basic_os 1332def0d0f3SmrgEOF 1333def0d0f3Smrg IFS=$saved_IFS 1334def0d0f3Smrg ;; 1335def0d0f3Smrg # Default OS when just kernel was specified 1336def0d0f3Smrg nto*) 1337def0d0f3Smrg kernel=nto 1338def0d0f3Smrg os=`echo "$basic_os" | sed -e 's|nto|qnx|'` 1339def0d0f3Smrg ;; 1340def0d0f3Smrg linux*) 1341def0d0f3Smrg kernel=linux 1342def0d0f3Smrg os=`echo "$basic_os" | sed -e 's|linux|gnu|'` 1343def0d0f3Smrg ;; 1344def0d0f3Smrg managarm*) 1345def0d0f3Smrg kernel=managarm 1346def0d0f3Smrg os=`echo "$basic_os" | sed -e 's|managarm|mlibc|'` 1347def0d0f3Smrg ;; 1348def0d0f3Smrg *) 1349def0d0f3Smrg kernel= 1350def0d0f3Smrg os=$basic_os 1351def0d0f3Smrg ;; 1352def0d0f3Smrgesac 1353def0d0f3Smrg 1354def0d0f3Smrg# Now, normalize the OS (knowing we just have one component, it's not a kernel, 1355def0d0f3Smrg# etc.) 1356def0d0f3Smrgcase $os in 1357def0d0f3Smrg # First match some system type aliases that might get confused 1358def0d0f3Smrg # with valid system types. 1359def0d0f3Smrg # solaris* is a basic system type, with this one exception. 1360def0d0f3Smrg auroraux) 1361def0d0f3Smrg os=auroraux 1362def0d0f3Smrg ;; 1363def0d0f3Smrg bluegene*) 1364def0d0f3Smrg os=cnk 1365def0d0f3Smrg ;; 1366def0d0f3Smrg solaris1 | solaris1.*) 1367def0d0f3Smrg os=`echo "$os" | sed -e 's|solaris1|sunos4|'` 1368def0d0f3Smrg ;; 1369def0d0f3Smrg solaris) 1370def0d0f3Smrg os=solaris2 1371def0d0f3Smrg ;; 1372def0d0f3Smrg unixware*) 1373def0d0f3Smrg os=sysv4.2uw 1374def0d0f3Smrg ;; 1375def0d0f3Smrg # es1800 is here to avoid being matched by es* (a different OS) 1376def0d0f3Smrg es1800*) 1377def0d0f3Smrg os=ose 1378def0d0f3Smrg ;; 1379def0d0f3Smrg # Some version numbers need modification 1380def0d0f3Smrg chorusos*) 1381def0d0f3Smrg os=chorusos 1382def0d0f3Smrg ;; 1383def0d0f3Smrg isc) 1384def0d0f3Smrg os=isc2.2 1385def0d0f3Smrg ;; 1386def0d0f3Smrg sco6) 1387def0d0f3Smrg os=sco5v6 1388def0d0f3Smrg ;; 1389def0d0f3Smrg sco5) 1390def0d0f3Smrg os=sco3.2v5 1391def0d0f3Smrg ;; 1392def0d0f3Smrg sco4) 1393def0d0f3Smrg os=sco3.2v4 1394def0d0f3Smrg ;; 1395def0d0f3Smrg sco3.2.[4-9]*) 1396def0d0f3Smrg os=`echo "$os" | sed -e 's/sco3.2./sco3.2v/'` 1397def0d0f3Smrg ;; 1398def0d0f3Smrg sco*v* | scout) 1399def0d0f3Smrg # Don't match below 1400def0d0f3Smrg ;; 1401def0d0f3Smrg sco*) 1402def0d0f3Smrg os=sco3.2v2 1403def0d0f3Smrg ;; 1404def0d0f3Smrg psos*) 1405def0d0f3Smrg os=psos 1406def0d0f3Smrg ;; 1407def0d0f3Smrg qnx*) 1408def0d0f3Smrg os=qnx 1409def0d0f3Smrg ;; 1410def0d0f3Smrg hiux*) 1411def0d0f3Smrg os=hiuxwe2 1412def0d0f3Smrg ;; 1413def0d0f3Smrg lynx*178) 1414def0d0f3Smrg os=lynxos178 1415def0d0f3Smrg ;; 1416def0d0f3Smrg lynx*5) 1417def0d0f3Smrg os=lynxos5 1418def0d0f3Smrg ;; 1419def0d0f3Smrg lynxos*) 1420def0d0f3Smrg # don't get caught up in next wildcard 1421def0d0f3Smrg ;; 1422def0d0f3Smrg lynx*) 1423def0d0f3Smrg os=lynxos 1424def0d0f3Smrg ;; 1425def0d0f3Smrg mac[0-9]*) 1426def0d0f3Smrg os=`echo "$os" | sed -e 's|mac|macos|'` 1427def0d0f3Smrg ;; 1428def0d0f3Smrg opened*) 1429def0d0f3Smrg os=openedition 1430def0d0f3Smrg ;; 1431def0d0f3Smrg os400*) 1432def0d0f3Smrg os=os400 1433def0d0f3Smrg ;; 1434def0d0f3Smrg sunos5*) 1435def0d0f3Smrg os=`echo "$os" | sed -e 's|sunos5|solaris2|'` 1436def0d0f3Smrg ;; 1437def0d0f3Smrg sunos6*) 1438def0d0f3Smrg os=`echo "$os" | sed -e 's|sunos6|solaris3|'` 1439def0d0f3Smrg ;; 1440def0d0f3Smrg wince*) 1441def0d0f3Smrg os=wince 1442def0d0f3Smrg ;; 1443def0d0f3Smrg utek*) 1444def0d0f3Smrg os=bsd 1445def0d0f3Smrg ;; 1446def0d0f3Smrg dynix*) 1447def0d0f3Smrg os=bsd 1448def0d0f3Smrg ;; 1449def0d0f3Smrg acis*) 1450def0d0f3Smrg os=aos 1451def0d0f3Smrg ;; 1452def0d0f3Smrg atheos*) 1453def0d0f3Smrg os=atheos 1454def0d0f3Smrg ;; 1455def0d0f3Smrg syllable*) 1456def0d0f3Smrg os=syllable 1457def0d0f3Smrg ;; 1458def0d0f3Smrg 386bsd) 1459def0d0f3Smrg os=bsd 1460def0d0f3Smrg ;; 1461def0d0f3Smrg ctix* | uts*) 1462def0d0f3Smrg os=sysv 1463def0d0f3Smrg ;; 1464def0d0f3Smrg nova*) 1465def0d0f3Smrg os=rtmk-nova 1466def0d0f3Smrg ;; 1467def0d0f3Smrg ns2) 1468def0d0f3Smrg os=nextstep2 1469def0d0f3Smrg ;; 1470def0d0f3Smrg # Preserve the version number of sinix5. 1471def0d0f3Smrg sinix5.*) 1472def0d0f3Smrg os=`echo "$os" | sed -e 's|sinix|sysv|'` 1473def0d0f3Smrg ;; 1474def0d0f3Smrg sinix*) 1475def0d0f3Smrg os=sysv4 1476def0d0f3Smrg ;; 1477def0d0f3Smrg tpf*) 1478def0d0f3Smrg os=tpf 1479def0d0f3Smrg ;; 1480def0d0f3Smrg triton*) 1481def0d0f3Smrg os=sysv3 1482def0d0f3Smrg ;; 1483def0d0f3Smrg oss*) 1484def0d0f3Smrg os=sysv3 1485def0d0f3Smrg ;; 1486def0d0f3Smrg svr4*) 1487def0d0f3Smrg os=sysv4 1488def0d0f3Smrg ;; 1489def0d0f3Smrg svr3) 1490def0d0f3Smrg os=sysv3 1491def0d0f3Smrg ;; 1492def0d0f3Smrg sysvr4) 1493def0d0f3Smrg os=sysv4 1494def0d0f3Smrg ;; 1495def0d0f3Smrg ose*) 1496def0d0f3Smrg os=ose 1497def0d0f3Smrg ;; 1498def0d0f3Smrg *mint | mint[0-9]* | *MiNT | MiNT[0-9]*) 1499def0d0f3Smrg os=mint 1500def0d0f3Smrg ;; 1501def0d0f3Smrg dicos*) 1502def0d0f3Smrg os=dicos 1503def0d0f3Smrg ;; 1504def0d0f3Smrg pikeos*) 1505def0d0f3Smrg # Until real need of OS specific support for 1506def0d0f3Smrg # particular features comes up, bare metal 1507def0d0f3Smrg # configurations are quite functional. 1508def0d0f3Smrg case $cpu in 1509def0d0f3Smrg arm*) 1510def0d0f3Smrg os=eabi 1511def0d0f3Smrg ;; 1512def0d0f3Smrg *) 1513def0d0f3Smrg os=elf 1514def0d0f3Smrg ;; 1515def0d0f3Smrg esac 1516def0d0f3Smrg ;; 1517def0d0f3Smrg *) 1518def0d0f3Smrg # No normalization, but not necessarily accepted, that comes below. 1519def0d0f3Smrg ;; 1520def0d0f3Smrgesac 1521def0d0f3Smrg 1522def0d0f3Smrgelse 1523def0d0f3Smrg 1524def0d0f3Smrg# Here we handle the default operating systems that come with various machines. 1525def0d0f3Smrg# The value should be what the vendor currently ships out the door with their 1526def0d0f3Smrg# machine or put another way, the most popular os provided with the machine. 1527def0d0f3Smrg 1528def0d0f3Smrg# Note that if you're going to try to match "-MANUFACTURER" here (say, 1529def0d0f3Smrg# "-sun"), then you have to tell the case statement up towards the top 1530def0d0f3Smrg# that MANUFACTURER isn't an operating system. Otherwise, code above 1531def0d0f3Smrg# will signal an error saying that MANUFACTURER isn't an operating 1532def0d0f3Smrg# system, and we'll never get to this point. 1533def0d0f3Smrg 1534def0d0f3Smrgkernel= 1535def0d0f3Smrgcase $cpu-$vendor in 1536def0d0f3Smrg score-*) 1537def0d0f3Smrg os=elf 1538def0d0f3Smrg ;; 1539def0d0f3Smrg spu-*) 1540def0d0f3Smrg os=elf 1541def0d0f3Smrg ;; 1542def0d0f3Smrg *-acorn) 1543def0d0f3Smrg os=riscix1.2 1544def0d0f3Smrg ;; 1545def0d0f3Smrg arm*-rebel) 1546def0d0f3Smrg kernel=linux 1547def0d0f3Smrg os=gnu 1548def0d0f3Smrg ;; 1549def0d0f3Smrg arm*-semi) 1550def0d0f3Smrg os=aout 1551def0d0f3Smrg ;; 1552def0d0f3Smrg c4x-* | tic4x-*) 1553def0d0f3Smrg os=coff 1554def0d0f3Smrg ;; 1555def0d0f3Smrg c8051-*) 1556def0d0f3Smrg os=elf 1557def0d0f3Smrg ;; 1558def0d0f3Smrg clipper-intergraph) 1559def0d0f3Smrg os=clix 1560def0d0f3Smrg ;; 1561def0d0f3Smrg hexagon-*) 1562def0d0f3Smrg os=elf 1563def0d0f3Smrg ;; 1564def0d0f3Smrg tic54x-*) 1565def0d0f3Smrg os=coff 1566def0d0f3Smrg ;; 1567def0d0f3Smrg tic55x-*) 1568def0d0f3Smrg os=coff 1569def0d0f3Smrg ;; 1570def0d0f3Smrg tic6x-*) 1571def0d0f3Smrg os=coff 1572def0d0f3Smrg ;; 1573def0d0f3Smrg # This must come before the *-dec entry. 1574def0d0f3Smrg pdp10-*) 1575def0d0f3Smrg os=tops20 1576def0d0f3Smrg ;; 1577def0d0f3Smrg pdp11-*) 1578def0d0f3Smrg os=none 1579def0d0f3Smrg ;; 1580def0d0f3Smrg *-dec | vax-*) 1581def0d0f3Smrg os=ultrix4.2 1582def0d0f3Smrg ;; 1583def0d0f3Smrg m68*-apollo) 1584def0d0f3Smrg os=domain 1585def0d0f3Smrg ;; 1586def0d0f3Smrg i386-sun) 1587def0d0f3Smrg os=sunos4.0.2 1588def0d0f3Smrg ;; 1589def0d0f3Smrg m68000-sun) 1590def0d0f3Smrg os=sunos3 1591def0d0f3Smrg ;; 1592def0d0f3Smrg m68*-cisco) 1593def0d0f3Smrg os=aout 1594def0d0f3Smrg ;; 1595def0d0f3Smrg mep-*) 1596def0d0f3Smrg os=elf 1597def0d0f3Smrg ;; 1598def0d0f3Smrg mips*-cisco) 1599def0d0f3Smrg os=elf 1600def0d0f3Smrg ;; 1601def0d0f3Smrg mips*-*) 1602def0d0f3Smrg os=elf 1603def0d0f3Smrg ;; 1604def0d0f3Smrg or32-*) 1605def0d0f3Smrg os=coff 1606def0d0f3Smrg ;; 1607def0d0f3Smrg *-tti) # must be before sparc entry or we get the wrong os. 1608def0d0f3Smrg os=sysv3 1609def0d0f3Smrg ;; 1610def0d0f3Smrg sparc-* | *-sun) 1611def0d0f3Smrg os=sunos4.1.1 1612def0d0f3Smrg ;; 1613def0d0f3Smrg pru-*) 1614def0d0f3Smrg os=elf 1615def0d0f3Smrg ;; 1616def0d0f3Smrg *-be) 1617def0d0f3Smrg os=beos 1618def0d0f3Smrg ;; 1619def0d0f3Smrg *-ibm) 1620def0d0f3Smrg os=aix 1621def0d0f3Smrg ;; 1622def0d0f3Smrg *-knuth) 1623def0d0f3Smrg os=mmixware 1624def0d0f3Smrg ;; 1625def0d0f3Smrg *-wec) 1626def0d0f3Smrg os=proelf 1627def0d0f3Smrg ;; 1628def0d0f3Smrg *-winbond) 1629def0d0f3Smrg os=proelf 1630def0d0f3Smrg ;; 1631def0d0f3Smrg *-oki) 1632def0d0f3Smrg os=proelf 1633def0d0f3Smrg ;; 1634def0d0f3Smrg *-hp) 1635def0d0f3Smrg os=hpux 1636def0d0f3Smrg ;; 1637def0d0f3Smrg *-hitachi) 1638def0d0f3Smrg os=hiux 1639def0d0f3Smrg ;; 1640def0d0f3Smrg i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) 1641def0d0f3Smrg os=sysv 1642def0d0f3Smrg ;; 1643def0d0f3Smrg *-cbm) 1644def0d0f3Smrg os=amigaos 1645def0d0f3Smrg ;; 1646def0d0f3Smrg *-dg) 1647def0d0f3Smrg os=dgux 1648def0d0f3Smrg ;; 1649def0d0f3Smrg *-dolphin) 1650def0d0f3Smrg os=sysv3 1651def0d0f3Smrg ;; 1652def0d0f3Smrg m68k-ccur) 1653def0d0f3Smrg os=rtu 1654def0d0f3Smrg ;; 1655def0d0f3Smrg m88k-omron*) 1656def0d0f3Smrg os=luna 1657def0d0f3Smrg ;; 1658def0d0f3Smrg *-next) 1659def0d0f3Smrg os=nextstep 1660def0d0f3Smrg ;; 1661def0d0f3Smrg *-sequent) 1662def0d0f3Smrg os=ptx 1663def0d0f3Smrg ;; 1664def0d0f3Smrg *-crds) 1665def0d0f3Smrg os=unos 1666def0d0f3Smrg ;; 1667def0d0f3Smrg *-ns) 1668def0d0f3Smrg os=genix 1669def0d0f3Smrg ;; 1670def0d0f3Smrg i370-*) 1671def0d0f3Smrg os=mvs 1672def0d0f3Smrg ;; 1673def0d0f3Smrg *-gould) 1674def0d0f3Smrg os=sysv 1675def0d0f3Smrg ;; 1676def0d0f3Smrg *-highlevel) 1677def0d0f3Smrg os=bsd 1678def0d0f3Smrg ;; 1679def0d0f3Smrg *-encore) 1680def0d0f3Smrg os=bsd 1681def0d0f3Smrg ;; 1682def0d0f3Smrg *-sgi) 1683def0d0f3Smrg os=irix 1684def0d0f3Smrg ;; 1685def0d0f3Smrg *-siemens) 1686def0d0f3Smrg os=sysv4 1687def0d0f3Smrg ;; 1688def0d0f3Smrg *-masscomp) 1689def0d0f3Smrg os=rtu 1690def0d0f3Smrg ;; 1691def0d0f3Smrg f30[01]-fujitsu | f700-fujitsu) 1692def0d0f3Smrg os=uxpv 1693def0d0f3Smrg ;; 1694def0d0f3Smrg *-rom68k) 1695def0d0f3Smrg os=coff 1696def0d0f3Smrg ;; 1697def0d0f3Smrg *-*bug) 1698def0d0f3Smrg os=coff 1699def0d0f3Smrg ;; 1700def0d0f3Smrg *-apple) 1701def0d0f3Smrg os=macos 1702def0d0f3Smrg ;; 1703def0d0f3Smrg *-atari*) 1704def0d0f3Smrg os=mint 1705def0d0f3Smrg ;; 1706def0d0f3Smrg *-wrs) 1707def0d0f3Smrg os=vxworks 1708def0d0f3Smrg ;; 1709def0d0f3Smrg *) 1710def0d0f3Smrg os=none 1711def0d0f3Smrg ;; 1712def0d0f3Smrgesac 1713def0d0f3Smrg 1714def0d0f3Smrgfi 1715def0d0f3Smrg 1716def0d0f3Smrg# Now, validate our (potentially fixed-up) OS. 1717def0d0f3Smrgcase $os in 1718def0d0f3Smrg # Sometimes we do "kernel-libc", so those need to count as OSes. 1719def0d0f3Smrg musl* | newlib* | relibc* | uclibc*) 1720def0d0f3Smrg ;; 1721def0d0f3Smrg # Likewise for "kernel-abi" 1722def0d0f3Smrg eabi* | gnueabi*) 1723def0d0f3Smrg ;; 1724def0d0f3Smrg # VxWorks passes extra cpu info in the 4th filed. 1725def0d0f3Smrg simlinux | simwindows | spe) 1726def0d0f3Smrg ;; 1727def0d0f3Smrg # Now accept the basic system types. 1728def0d0f3Smrg # The portable systems comes first. 1729def0d0f3Smrg # Each alternative MUST end in a * to match a version number. 1730def0d0f3Smrg gnu* | android* | bsd* | mach* | minix* | genix* | ultrix* | irix* \ 1731def0d0f3Smrg | *vms* | esix* | aix* | cnk* | sunos | sunos[34]* \ 1732def0d0f3Smrg | hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \ 1733def0d0f3Smrg | sym* | plan9* | psp* | sim* | xray* | os68k* | v88r* \ 1734def0d0f3Smrg | hiux* | abug | nacl* | netware* | windows* \ 1735def0d0f3Smrg | os9* | macos* | osx* | ios* \ 1736def0d0f3Smrg | mpw* | magic* | mmixware* | mon960* | lnews* \ 1737def0d0f3Smrg | amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \ 1738def0d0f3Smrg | aos* | aros* | cloudabi* | sortix* | twizzler* \ 1739def0d0f3Smrg | nindy* | vxsim* | vxworks* | ebmon* | hms* | mvs* \ 1740def0d0f3Smrg | clix* | riscos* | uniplus* | iris* | isc* | rtu* | xenix* \ 1741def0d0f3Smrg | mirbsd* | netbsd* | dicos* | openedition* | ose* \ 1742def0d0f3Smrg | bitrig* | openbsd* | secbsd* | solidbsd* | libertybsd* | os108* \ 1743def0d0f3Smrg | ekkobsd* | freebsd* | riscix* | lynxos* | os400* \ 1744def0d0f3Smrg | bosx* | nextstep* | cxux* | aout* | elf* | oabi* \ 1745def0d0f3Smrg | ptx* | coff* | ecoff* | winnt* | domain* | vsta* \ 1746def0d0f3Smrg | udi* | lites* | ieee* | go32* | aux* | hcos* \ 1747def0d0f3Smrg | chorusrdb* | cegcc* | glidix* | serenity* \ 1748def0d0f3Smrg | cygwin* | msys* | pe* | moss* | proelf* | rtems* \ 1749def0d0f3Smrg | midipix* | mingw32* | mingw64* | mint* \ 1750def0d0f3Smrg | uxpv* | beos* | mpeix* | udk* | moxiebox* \ 1751def0d0f3Smrg | interix* | uwin* | mks* | rhapsody* | darwin* \ 1752def0d0f3Smrg | openstep* | oskit* | conix* | pw32* | nonstopux* \ 1753def0d0f3Smrg | storm-chaos* | tops10* | tenex* | tops20* | its* \ 1754def0d0f3Smrg | os2* | vos* | palmos* | uclinux* | nucleus* | morphos* \ 1755def0d0f3Smrg | scout* | superux* | sysv* | rtmk* | tpf* | windiss* \ 1756def0d0f3Smrg | powermax* | dnix* | nx6 | nx7 | sei* | dragonfly* \ 1757def0d0f3Smrg | skyos* | haiku* | rdos* | toppers* | drops* | es* \ 1758def0d0f3Smrg | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \ 1759def0d0f3Smrg | midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \ 1760def0d0f3Smrg | nsk* | powerunix* | genode* | zvmoe* | qnx* | emx* | zephyr* \ 1761def0d0f3Smrg | fiwix* | mlibc* ) 1762def0d0f3Smrg ;; 1763def0d0f3Smrg # This one is extra strict with allowed versions 1764def0d0f3Smrg sco3.2v2 | sco3.2v[4-9]* | sco5v6*) 1765def0d0f3Smrg # Don't forget version if it is 3.2v4 or newer. 1766def0d0f3Smrg ;; 1767def0d0f3Smrg none) 1768def0d0f3Smrg ;; 1769def0d0f3Smrg kernel* ) 1770def0d0f3Smrg # Restricted further below 1771def0d0f3Smrg ;; 1772def0d0f3Smrg *) 1773def0d0f3Smrg echo Invalid configuration \`"$1"\': OS \`"$os"\' not recognized 1>&2 1774def0d0f3Smrg exit 1 1775def0d0f3Smrg ;; 1776def0d0f3Smrgesac 1777def0d0f3Smrg 1778def0d0f3Smrg# As a final step for OS-related things, validate the OS-kernel combination 1779def0d0f3Smrg# (given a valid OS), if there is a kernel. 1780def0d0f3Smrgcase $kernel-$os in 1781def0d0f3Smrg linux-gnu* | linux-dietlibc* | linux-android* | linux-newlib* \ 1782def0d0f3Smrg | linux-musl* | linux-relibc* | linux-uclibc* | linux-mlibc* ) 1783def0d0f3Smrg ;; 1784def0d0f3Smrg uclinux-uclibc* ) 1785def0d0f3Smrg ;; 1786def0d0f3Smrg managarm-mlibc* | managarm-kernel* ) 1787def0d0f3Smrg ;; 1788def0d0f3Smrg -dietlibc* | -newlib* | -musl* | -relibc* | -uclibc* | -mlibc* ) 1789def0d0f3Smrg # These are just libc implementations, not actual OSes, and thus 1790def0d0f3Smrg # require a kernel. 1791def0d0f3Smrg echo "Invalid configuration \`$1': libc \`$os' needs explicit kernel." 1>&2 1792def0d0f3Smrg exit 1 1793def0d0f3Smrg ;; 1794def0d0f3Smrg -kernel* ) 1795def0d0f3Smrg echo "Invalid configuration \`$1': \`$os' needs explicit kernel." 1>&2 1796def0d0f3Smrg exit 1 1797def0d0f3Smrg ;; 1798def0d0f3Smrg *-kernel* ) 1799def0d0f3Smrg echo "Invalid configuration \`$1': \`$kernel' does not support \`$os'." 1>&2 1800def0d0f3Smrg exit 1 1801def0d0f3Smrg ;; 1802def0d0f3Smrg kfreebsd*-gnu* | kopensolaris*-gnu*) 1803def0d0f3Smrg ;; 1804def0d0f3Smrg vxworks-simlinux | vxworks-simwindows | vxworks-spe) 1805def0d0f3Smrg ;; 1806def0d0f3Smrg nto-qnx*) 1807def0d0f3Smrg ;; 1808def0d0f3Smrg os2-emx) 1809def0d0f3Smrg ;; 1810def0d0f3Smrg *-eabi* | *-gnueabi*) 1811def0d0f3Smrg ;; 1812def0d0f3Smrg -*) 1813def0d0f3Smrg # Blank kernel with real OS is always fine. 1814def0d0f3Smrg ;; 1815def0d0f3Smrg *-*) 1816def0d0f3Smrg echo "Invalid configuration \`$1': Kernel \`$kernel' not known to work with OS \`$os'." 1>&2 1817def0d0f3Smrg exit 1 1818def0d0f3Smrg ;; 1819def0d0f3Smrgesac 1820def0d0f3Smrg 1821def0d0f3Smrg# Here we handle the case where we know the os, and the CPU type, but not the 1822def0d0f3Smrg# manufacturer. We pick the logical manufacturer. 1823def0d0f3Smrgcase $vendor in 1824def0d0f3Smrg unknown) 1825def0d0f3Smrg case $cpu-$os in 1826def0d0f3Smrg *-riscix*) 1827def0d0f3Smrg vendor=acorn 1828def0d0f3Smrg ;; 1829def0d0f3Smrg *-sunos*) 1830def0d0f3Smrg vendor=sun 1831def0d0f3Smrg ;; 1832def0d0f3Smrg *-cnk* | *-aix*) 1833def0d0f3Smrg vendor=ibm 1834def0d0f3Smrg ;; 1835def0d0f3Smrg *-beos*) 1836def0d0f3Smrg vendor=be 1837def0d0f3Smrg ;; 1838def0d0f3Smrg *-hpux*) 1839def0d0f3Smrg vendor=hp 1840def0d0f3Smrg ;; 1841def0d0f3Smrg *-mpeix*) 1842def0d0f3Smrg vendor=hp 1843def0d0f3Smrg ;; 1844def0d0f3Smrg *-hiux*) 1845def0d0f3Smrg vendor=hitachi 1846def0d0f3Smrg ;; 1847def0d0f3Smrg *-unos*) 1848def0d0f3Smrg vendor=crds 1849def0d0f3Smrg ;; 1850def0d0f3Smrg *-dgux*) 1851def0d0f3Smrg vendor=dg 1852def0d0f3Smrg ;; 1853def0d0f3Smrg *-luna*) 1854def0d0f3Smrg vendor=omron 1855def0d0f3Smrg ;; 1856def0d0f3Smrg *-genix*) 1857def0d0f3Smrg vendor=ns 1858def0d0f3Smrg ;; 1859def0d0f3Smrg *-clix*) 1860def0d0f3Smrg vendor=intergraph 1861def0d0f3Smrg ;; 1862def0d0f3Smrg *-mvs* | *-opened*) 1863def0d0f3Smrg vendor=ibm 1864def0d0f3Smrg ;; 1865def0d0f3Smrg *-os400*) 1866def0d0f3Smrg vendor=ibm 1867def0d0f3Smrg ;; 1868def0d0f3Smrg s390-* | s390x-*) 1869def0d0f3Smrg vendor=ibm 1870def0d0f3Smrg ;; 1871def0d0f3Smrg *-ptx*) 1872def0d0f3Smrg vendor=sequent 1873def0d0f3Smrg ;; 1874def0d0f3Smrg *-tpf*) 1875def0d0f3Smrg vendor=ibm 1876def0d0f3Smrg ;; 1877def0d0f3Smrg *-vxsim* | *-vxworks* | *-windiss*) 1878def0d0f3Smrg vendor=wrs 1879def0d0f3Smrg ;; 1880def0d0f3Smrg *-aux*) 1881def0d0f3Smrg vendor=apple 1882def0d0f3Smrg ;; 1883def0d0f3Smrg *-hms*) 1884def0d0f3Smrg vendor=hitachi 1885def0d0f3Smrg ;; 1886def0d0f3Smrg *-mpw* | *-macos*) 1887def0d0f3Smrg vendor=apple 1888def0d0f3Smrg ;; 1889def0d0f3Smrg *-*mint | *-mint[0-9]* | *-*MiNT | *-MiNT[0-9]*) 1890def0d0f3Smrg vendor=atari 1891def0d0f3Smrg ;; 1892def0d0f3Smrg *-vos*) 1893def0d0f3Smrg vendor=stratus 1894def0d0f3Smrg ;; 1895def0d0f3Smrg esac 1896def0d0f3Smrg ;; 1897def0d0f3Smrgesac 1898def0d0f3Smrg 1899def0d0f3Smrgecho "$cpu-$vendor-${kernel:+$kernel-}$os" 1900def0d0f3Smrgexit 1901def0d0f3Smrg 1902def0d0f3Smrg# Local variables: 1903def0d0f3Smrg# eval: (add-hook 'before-save-hook 'time-stamp) 1904def0d0f3Smrg# time-stamp-start: "timestamp='" 1905def0d0f3Smrg# time-stamp-format: "%:y-%02m-%02d" 1906def0d0f3Smrg# time-stamp-end: "'" 1907def0d0f3Smrg# End: 1908