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