1*a3167c07Ssthen#! /bin/sh 2933707f3Ssthen# Configuration validation subroutine script. 3*a3167c07Ssthen# Copyright 1992-2020 Free Software Foundation, Inc. 4933707f3Ssthen 5*a3167c07Ssthentimestamp='2020-07-10' 6933707f3Ssthen 798f3ca02Sbrad# This file is free software; you can redistribute it and/or modify it 898f3ca02Sbrad# under the terms of the GNU General Public License as published by 998f3ca02Sbrad# the Free Software Foundation; either version 3 of the License, or 10933707f3Ssthen# (at your option) any later version. 11933707f3Ssthen# 1298f3ca02Sbrad# This program is distributed in the hope that it will be useful, but 1398f3ca02Sbrad# WITHOUT ANY WARRANTY; without even the implied warranty of 1498f3ca02Sbrad# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 1598f3ca02Sbrad# General Public License for more details. 16933707f3Ssthen# 17933707f3Ssthen# You should have received a copy of the GNU General Public License 18*a3167c07Ssthen# along with this program; if not, see <https://www.gnu.org/licenses/>. 19933707f3Ssthen# 20933707f3Ssthen# As a special exception to the GNU General Public License, if you 21933707f3Ssthen# distribute this file as part of a program that contains a 22933707f3Ssthen# configuration script generated by Autoconf, you may include it under 2398f3ca02Sbrad# the same distribution terms that you use for the rest of that 2498f3ca02Sbrad# program. This Exception is an additional permission under section 7 2598f3ca02Sbrad# of the GNU General Public License, version 3 ("GPLv3"). 26933707f3Ssthen 27933707f3Ssthen 280990ddf5Ssthen# Please send patches to <config-patches@gnu.org>. 29933707f3Ssthen# 30933707f3Ssthen# Configuration subroutine to validate and canonicalize a configuration type. 31933707f3Ssthen# Supply the specified configuration type as an argument. 32933707f3Ssthen# If it is invalid, we print an error message on stderr and exit with code 1. 33933707f3Ssthen# Otherwise, we print the canonical config type on stdout and succeed. 34933707f3Ssthen 35933707f3Ssthen# You can get the latest version of this script from: 36*a3167c07Ssthen# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub 37933707f3Ssthen 38933707f3Ssthen# This file is supposed to be the same for all GNU packages 39933707f3Ssthen# and recognize all the CPU types, system types and aliases 40933707f3Ssthen# that are meaningful with *any* GNU software. 41933707f3Ssthen# Each package is responsible for reporting which valid configurations 42933707f3Ssthen# it does not support. The user should be able to distinguish 43933707f3Ssthen# a failure to support a valid configuration from a meaningless 44933707f3Ssthen# configuration. 45933707f3Ssthen 46933707f3Ssthen# The goal of this file is to map all the various variations of a given 47933707f3Ssthen# machine specification into a single specification in the form: 48933707f3Ssthen# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM 49933707f3Ssthen# or in some cases, the newer four-part form: 50933707f3Ssthen# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM 51933707f3Ssthen# It is wrong to echo any other type of specification. 52933707f3Ssthen 53933707f3Ssthenme=`echo "$0" | sed -e 's,.*/,,'` 54933707f3Ssthen 55933707f3Ssthenusage="\ 560990ddf5SsthenUsage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS 57933707f3Ssthen 58933707f3SsthenCanonicalize a configuration name. 59933707f3Ssthen 60*a3167c07SsthenOptions: 61933707f3Ssthen -h, --help print this help, then exit 62933707f3Ssthen -t, --time-stamp print date of last modification, then exit 63933707f3Ssthen -v, --version print version number, then exit 64933707f3Ssthen 65933707f3SsthenReport bugs and patches to <config-patches@gnu.org>." 66933707f3Ssthen 67933707f3Ssthenversion="\ 68933707f3SsthenGNU config.sub ($timestamp) 69933707f3Ssthen 70*a3167c07SsthenCopyright 1992-2020 Free Software Foundation, Inc. 71933707f3Ssthen 72933707f3SsthenThis is free software; see the source for copying conditions. There is NO 73933707f3Ssthenwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." 74933707f3Ssthen 75933707f3Ssthenhelp=" 76933707f3SsthenTry \`$me --help' for more information." 77933707f3Ssthen 78933707f3Ssthen# Parse command line 79933707f3Ssthenwhile test $# -gt 0 ; do 80933707f3Ssthen case $1 in 81933707f3Ssthen --time-stamp | --time* | -t ) 82933707f3Ssthen echo "$timestamp" ; exit ;; 83933707f3Ssthen --version | -v ) 84933707f3Ssthen echo "$version" ; exit ;; 85933707f3Ssthen --help | --h* | -h ) 86933707f3Ssthen echo "$usage"; exit ;; 87933707f3Ssthen -- ) # Stop option processing 88933707f3Ssthen shift; break ;; 89933707f3Ssthen - ) # Use stdin as input. 90933707f3Ssthen break ;; 91933707f3Ssthen -* ) 92*a3167c07Ssthen echo "$me: invalid option $1$help" >&2 93933707f3Ssthen exit 1 ;; 94933707f3Ssthen 95933707f3Ssthen *local*) 96933707f3Ssthen # First pass through any local machine types. 97*a3167c07Ssthen echo "$1" 98933707f3Ssthen exit ;; 99933707f3Ssthen 100933707f3Ssthen * ) 101933707f3Ssthen break ;; 102933707f3Ssthen esac 103933707f3Ssthendone 104933707f3Ssthen 105933707f3Ssthencase $# in 106933707f3Ssthen 0) echo "$me: missing argument$help" >&2 107933707f3Ssthen exit 1;; 108933707f3Ssthen 1) ;; 109933707f3Ssthen *) echo "$me: too many arguments$help" >&2 110933707f3Ssthen exit 1;; 111933707f3Ssthenesac 112933707f3Ssthen 113*a3167c07Ssthen# Split fields of configuration type 114*a3167c07Ssthen# shellcheck disable=SC2162 115*a3167c07SsthenIFS="-" read field1 field2 field3 field4 <<EOF 116*a3167c07Ssthen$1 117*a3167c07SsthenEOF 118*a3167c07Ssthen 119*a3167c07Ssthen# Separate into logical components for further validation 120*a3167c07Ssthencase $1 in 121*a3167c07Ssthen *-*-*-*-*) 122*a3167c07Ssthen echo Invalid configuration \`"$1"\': more than four components >&2 123*a3167c07Ssthen exit 1 124*a3167c07Ssthen ;; 125*a3167c07Ssthen *-*-*-*) 126*a3167c07Ssthen basic_machine=$field1-$field2 127*a3167c07Ssthen basic_os=$field3-$field4 128*a3167c07Ssthen ;; 129*a3167c07Ssthen *-*-*) 130*a3167c07Ssthen # Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two 131*a3167c07Ssthen # parts 132*a3167c07Ssthen maybe_os=$field2-$field3 133933707f3Ssthen case $maybe_os in 134*a3167c07Ssthen nto-qnx* | linux-* | uclinux-uclibc* \ 135*a3167c07Ssthen | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \ 136*a3167c07Ssthen | netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \ 137*a3167c07Ssthen | storm-chaos* | os2-emx* | rtmk-nova*) 138*a3167c07Ssthen basic_machine=$field1 139*a3167c07Ssthen basic_os=$maybe_os 140933707f3Ssthen ;; 141229e174cSsthen android-linux) 142*a3167c07Ssthen basic_machine=$field1-unknown 143*a3167c07Ssthen basic_os=linux-android 144229e174cSsthen ;; 145933707f3Ssthen *) 146*a3167c07Ssthen basic_machine=$field1-$field2 147*a3167c07Ssthen basic_os=$field3 148*a3167c07Ssthen ;; 149*a3167c07Ssthen esac 150*a3167c07Ssthen ;; 151*a3167c07Ssthen *-*) 152*a3167c07Ssthen # A lone config we happen to match not fitting any pattern 153*a3167c07Ssthen case $field1-$field2 in 154*a3167c07Ssthen decstation-3100) 155*a3167c07Ssthen basic_machine=mips-dec 156*a3167c07Ssthen basic_os= 157*a3167c07Ssthen ;; 158*a3167c07Ssthen *-*) 159*a3167c07Ssthen # Second component is usually, but not always the OS 160*a3167c07Ssthen case $field2 in 161*a3167c07Ssthen # Prevent following clause from handling this valid os 162*a3167c07Ssthen sun*os*) 163*a3167c07Ssthen basic_machine=$field1 164*a3167c07Ssthen basic_os=$field2 165*a3167c07Ssthen ;; 166*a3167c07Ssthen # Manufacturers 167*a3167c07Ssthen dec* | mips* | sequent* | encore* | pc533* | sgi* | sony* \ 168*a3167c07Ssthen | att* | 7300* | 3300* | delta* | motorola* | sun[234]* \ 169*a3167c07Ssthen | unicom* | ibm* | next | hp | isi* | apollo | altos* \ 170*a3167c07Ssthen | convergent* | ncr* | news | 32* | 3600* | 3100* \ 171*a3167c07Ssthen | hitachi* | c[123]* | convex* | sun | crds | omron* | dg \ 172*a3167c07Ssthen | ultra | tti* | harris | dolphin | highlevel | gould \ 173*a3167c07Ssthen | cbm | ns | masscomp | apple | axis | knuth | cray \ 174*a3167c07Ssthen | microblaze* | sim | cisco \ 175*a3167c07Ssthen | oki | wec | wrs | winbond) 176*a3167c07Ssthen basic_machine=$field1-$field2 177*a3167c07Ssthen basic_os= 178*a3167c07Ssthen ;; 179*a3167c07Ssthen *) 180*a3167c07Ssthen basic_machine=$field1 181*a3167c07Ssthen basic_os=$field2 182*a3167c07Ssthen ;; 183*a3167c07Ssthen esac 184*a3167c07Ssthen ;; 185*a3167c07Ssthen esac 186*a3167c07Ssthen ;; 187*a3167c07Ssthen *) 188*a3167c07Ssthen # Convert single-component short-hands not valid as part of 189*a3167c07Ssthen # multi-component configurations. 190*a3167c07Ssthen case $field1 in 191*a3167c07Ssthen 386bsd) 192*a3167c07Ssthen basic_machine=i386-pc 193*a3167c07Ssthen basic_os=bsd 194*a3167c07Ssthen ;; 195*a3167c07Ssthen a29khif) 196*a3167c07Ssthen basic_machine=a29k-amd 197*a3167c07Ssthen basic_os=udi 198*a3167c07Ssthen ;; 199*a3167c07Ssthen adobe68k) 200*a3167c07Ssthen basic_machine=m68010-adobe 201*a3167c07Ssthen basic_os=scout 202*a3167c07Ssthen ;; 203*a3167c07Ssthen alliant) 204*a3167c07Ssthen basic_machine=fx80-alliant 205*a3167c07Ssthen basic_os= 206*a3167c07Ssthen ;; 207*a3167c07Ssthen altos | altos3068) 208*a3167c07Ssthen basic_machine=m68k-altos 209*a3167c07Ssthen basic_os= 210*a3167c07Ssthen ;; 211*a3167c07Ssthen am29k) 212*a3167c07Ssthen basic_machine=a29k-none 213*a3167c07Ssthen basic_os=bsd 214*a3167c07Ssthen ;; 215*a3167c07Ssthen amdahl) 216*a3167c07Ssthen basic_machine=580-amdahl 217*a3167c07Ssthen basic_os=sysv 218*a3167c07Ssthen ;; 219*a3167c07Ssthen amiga) 220*a3167c07Ssthen basic_machine=m68k-unknown 221*a3167c07Ssthen basic_os= 222*a3167c07Ssthen ;; 223*a3167c07Ssthen amigaos | amigados) 224*a3167c07Ssthen basic_machine=m68k-unknown 225*a3167c07Ssthen basic_os=amigaos 226*a3167c07Ssthen ;; 227*a3167c07Ssthen amigaunix | amix) 228*a3167c07Ssthen basic_machine=m68k-unknown 229*a3167c07Ssthen basic_os=sysv4 230*a3167c07Ssthen ;; 231*a3167c07Ssthen apollo68) 232*a3167c07Ssthen basic_machine=m68k-apollo 233*a3167c07Ssthen basic_os=sysv 234*a3167c07Ssthen ;; 235*a3167c07Ssthen apollo68bsd) 236*a3167c07Ssthen basic_machine=m68k-apollo 237*a3167c07Ssthen basic_os=bsd 238*a3167c07Ssthen ;; 239*a3167c07Ssthen aros) 240*a3167c07Ssthen basic_machine=i386-pc 241*a3167c07Ssthen basic_os=aros 242*a3167c07Ssthen ;; 243*a3167c07Ssthen aux) 244*a3167c07Ssthen basic_machine=m68k-apple 245*a3167c07Ssthen basic_os=aux 246*a3167c07Ssthen ;; 247*a3167c07Ssthen balance) 248*a3167c07Ssthen basic_machine=ns32k-sequent 249*a3167c07Ssthen basic_os=dynix 250*a3167c07Ssthen ;; 251*a3167c07Ssthen blackfin) 252*a3167c07Ssthen basic_machine=bfin-unknown 253*a3167c07Ssthen basic_os=linux 254*a3167c07Ssthen ;; 255*a3167c07Ssthen cegcc) 256*a3167c07Ssthen basic_machine=arm-unknown 257*a3167c07Ssthen basic_os=cegcc 258*a3167c07Ssthen ;; 259*a3167c07Ssthen convex-c1) 260*a3167c07Ssthen basic_machine=c1-convex 261*a3167c07Ssthen basic_os=bsd 262*a3167c07Ssthen ;; 263*a3167c07Ssthen convex-c2) 264*a3167c07Ssthen basic_machine=c2-convex 265*a3167c07Ssthen basic_os=bsd 266*a3167c07Ssthen ;; 267*a3167c07Ssthen convex-c32) 268*a3167c07Ssthen basic_machine=c32-convex 269*a3167c07Ssthen basic_os=bsd 270*a3167c07Ssthen ;; 271*a3167c07Ssthen convex-c34) 272*a3167c07Ssthen basic_machine=c34-convex 273*a3167c07Ssthen basic_os=bsd 274*a3167c07Ssthen ;; 275*a3167c07Ssthen convex-c38) 276*a3167c07Ssthen basic_machine=c38-convex 277*a3167c07Ssthen basic_os=bsd 278*a3167c07Ssthen ;; 279*a3167c07Ssthen cray) 280*a3167c07Ssthen basic_machine=j90-cray 281*a3167c07Ssthen basic_os=unicos 282*a3167c07Ssthen ;; 283*a3167c07Ssthen crds | unos) 284*a3167c07Ssthen basic_machine=m68k-crds 285*a3167c07Ssthen basic_os= 286*a3167c07Ssthen ;; 287*a3167c07Ssthen da30) 288*a3167c07Ssthen basic_machine=m68k-da30 289*a3167c07Ssthen basic_os= 290*a3167c07Ssthen ;; 291*a3167c07Ssthen decstation | pmax | pmin | dec3100 | decstatn) 292*a3167c07Ssthen basic_machine=mips-dec 293*a3167c07Ssthen basic_os= 294*a3167c07Ssthen ;; 295*a3167c07Ssthen delta88) 296*a3167c07Ssthen basic_machine=m88k-motorola 297*a3167c07Ssthen basic_os=sysv3 298*a3167c07Ssthen ;; 299*a3167c07Ssthen dicos) 300*a3167c07Ssthen basic_machine=i686-pc 301*a3167c07Ssthen basic_os=dicos 302*a3167c07Ssthen ;; 303*a3167c07Ssthen djgpp) 304*a3167c07Ssthen basic_machine=i586-pc 305*a3167c07Ssthen basic_os=msdosdjgpp 306*a3167c07Ssthen ;; 307*a3167c07Ssthen ebmon29k) 308*a3167c07Ssthen basic_machine=a29k-amd 309*a3167c07Ssthen basic_os=ebmon 310*a3167c07Ssthen ;; 311*a3167c07Ssthen es1800 | OSE68k | ose68k | ose | OSE) 312*a3167c07Ssthen basic_machine=m68k-ericsson 313*a3167c07Ssthen basic_os=ose 314*a3167c07Ssthen ;; 315*a3167c07Ssthen gmicro) 316*a3167c07Ssthen basic_machine=tron-gmicro 317*a3167c07Ssthen basic_os=sysv 318*a3167c07Ssthen ;; 319*a3167c07Ssthen go32) 320*a3167c07Ssthen basic_machine=i386-pc 321*a3167c07Ssthen basic_os=go32 322*a3167c07Ssthen ;; 323*a3167c07Ssthen h8300hms) 324*a3167c07Ssthen basic_machine=h8300-hitachi 325*a3167c07Ssthen basic_os=hms 326*a3167c07Ssthen ;; 327*a3167c07Ssthen h8300xray) 328*a3167c07Ssthen basic_machine=h8300-hitachi 329*a3167c07Ssthen basic_os=xray 330*a3167c07Ssthen ;; 331*a3167c07Ssthen h8500hms) 332*a3167c07Ssthen basic_machine=h8500-hitachi 333*a3167c07Ssthen basic_os=hms 334*a3167c07Ssthen ;; 335*a3167c07Ssthen harris) 336*a3167c07Ssthen basic_machine=m88k-harris 337*a3167c07Ssthen basic_os=sysv3 338*a3167c07Ssthen ;; 339*a3167c07Ssthen hp300 | hp300hpux) 340*a3167c07Ssthen basic_machine=m68k-hp 341*a3167c07Ssthen basic_os=hpux 342*a3167c07Ssthen ;; 343*a3167c07Ssthen hp300bsd) 344*a3167c07Ssthen basic_machine=m68k-hp 345*a3167c07Ssthen basic_os=bsd 346*a3167c07Ssthen ;; 347*a3167c07Ssthen hppaosf) 348*a3167c07Ssthen basic_machine=hppa1.1-hp 349*a3167c07Ssthen basic_os=osf 350*a3167c07Ssthen ;; 351*a3167c07Ssthen hppro) 352*a3167c07Ssthen basic_machine=hppa1.1-hp 353*a3167c07Ssthen basic_os=proelf 354*a3167c07Ssthen ;; 355*a3167c07Ssthen i386mach) 356*a3167c07Ssthen basic_machine=i386-mach 357*a3167c07Ssthen basic_os=mach 358*a3167c07Ssthen ;; 359*a3167c07Ssthen isi68 | isi) 360*a3167c07Ssthen basic_machine=m68k-isi 361*a3167c07Ssthen basic_os=sysv 362*a3167c07Ssthen ;; 363*a3167c07Ssthen m68knommu) 364*a3167c07Ssthen basic_machine=m68k-unknown 365*a3167c07Ssthen basic_os=linux 366*a3167c07Ssthen ;; 367*a3167c07Ssthen magnum | m3230) 368*a3167c07Ssthen basic_machine=mips-mips 369*a3167c07Ssthen basic_os=sysv 370*a3167c07Ssthen ;; 371*a3167c07Ssthen merlin) 372*a3167c07Ssthen basic_machine=ns32k-utek 373*a3167c07Ssthen basic_os=sysv 374*a3167c07Ssthen ;; 375*a3167c07Ssthen mingw64) 376*a3167c07Ssthen basic_machine=x86_64-pc 377*a3167c07Ssthen basic_os=mingw64 378*a3167c07Ssthen ;; 379*a3167c07Ssthen mingw32) 380*a3167c07Ssthen basic_machine=i686-pc 381*a3167c07Ssthen basic_os=mingw32 382*a3167c07Ssthen ;; 383*a3167c07Ssthen mingw32ce) 384*a3167c07Ssthen basic_machine=arm-unknown 385*a3167c07Ssthen basic_os=mingw32ce 386*a3167c07Ssthen ;; 387*a3167c07Ssthen monitor) 388*a3167c07Ssthen basic_machine=m68k-rom68k 389*a3167c07Ssthen basic_os=coff 390*a3167c07Ssthen ;; 391*a3167c07Ssthen morphos) 392*a3167c07Ssthen basic_machine=powerpc-unknown 393*a3167c07Ssthen basic_os=morphos 394*a3167c07Ssthen ;; 395*a3167c07Ssthen moxiebox) 396*a3167c07Ssthen basic_machine=moxie-unknown 397*a3167c07Ssthen basic_os=moxiebox 398*a3167c07Ssthen ;; 399*a3167c07Ssthen msdos) 400*a3167c07Ssthen basic_machine=i386-pc 401*a3167c07Ssthen basic_os=msdos 402*a3167c07Ssthen ;; 403*a3167c07Ssthen msys) 404*a3167c07Ssthen basic_machine=i686-pc 405*a3167c07Ssthen basic_os=msys 406*a3167c07Ssthen ;; 407*a3167c07Ssthen mvs) 408*a3167c07Ssthen basic_machine=i370-ibm 409*a3167c07Ssthen basic_os=mvs 410*a3167c07Ssthen ;; 411*a3167c07Ssthen nacl) 412*a3167c07Ssthen basic_machine=le32-unknown 413*a3167c07Ssthen basic_os=nacl 414*a3167c07Ssthen ;; 415*a3167c07Ssthen ncr3000) 416*a3167c07Ssthen basic_machine=i486-ncr 417*a3167c07Ssthen basic_os=sysv4 418*a3167c07Ssthen ;; 419*a3167c07Ssthen netbsd386) 420*a3167c07Ssthen basic_machine=i386-pc 421*a3167c07Ssthen basic_os=netbsd 422*a3167c07Ssthen ;; 423*a3167c07Ssthen netwinder) 424*a3167c07Ssthen basic_machine=armv4l-rebel 425*a3167c07Ssthen basic_os=linux 426*a3167c07Ssthen ;; 427*a3167c07Ssthen news | news700 | news800 | news900) 428*a3167c07Ssthen basic_machine=m68k-sony 429*a3167c07Ssthen basic_os=newsos 430*a3167c07Ssthen ;; 431*a3167c07Ssthen news1000) 432*a3167c07Ssthen basic_machine=m68030-sony 433*a3167c07Ssthen basic_os=newsos 434*a3167c07Ssthen ;; 435*a3167c07Ssthen necv70) 436*a3167c07Ssthen basic_machine=v70-nec 437*a3167c07Ssthen basic_os=sysv 438*a3167c07Ssthen ;; 439*a3167c07Ssthen nh3000) 440*a3167c07Ssthen basic_machine=m68k-harris 441*a3167c07Ssthen basic_os=cxux 442*a3167c07Ssthen ;; 443*a3167c07Ssthen nh[45]000) 444*a3167c07Ssthen basic_machine=m88k-harris 445*a3167c07Ssthen basic_os=cxux 446*a3167c07Ssthen ;; 447*a3167c07Ssthen nindy960) 448*a3167c07Ssthen basic_machine=i960-intel 449*a3167c07Ssthen basic_os=nindy 450*a3167c07Ssthen ;; 451*a3167c07Ssthen mon960) 452*a3167c07Ssthen basic_machine=i960-intel 453*a3167c07Ssthen basic_os=mon960 454*a3167c07Ssthen ;; 455*a3167c07Ssthen nonstopux) 456*a3167c07Ssthen basic_machine=mips-compaq 457*a3167c07Ssthen basic_os=nonstopux 458*a3167c07Ssthen ;; 459*a3167c07Ssthen os400) 460*a3167c07Ssthen basic_machine=powerpc-ibm 461*a3167c07Ssthen basic_os=os400 462*a3167c07Ssthen ;; 463*a3167c07Ssthen OSE68000 | ose68000) 464*a3167c07Ssthen basic_machine=m68000-ericsson 465*a3167c07Ssthen basic_os=ose 466*a3167c07Ssthen ;; 467*a3167c07Ssthen os68k) 468*a3167c07Ssthen basic_machine=m68k-none 469*a3167c07Ssthen basic_os=os68k 470*a3167c07Ssthen ;; 471*a3167c07Ssthen paragon) 472*a3167c07Ssthen basic_machine=i860-intel 473*a3167c07Ssthen basic_os=osf 474*a3167c07Ssthen ;; 475*a3167c07Ssthen parisc) 476*a3167c07Ssthen basic_machine=hppa-unknown 477*a3167c07Ssthen basic_os=linux 478*a3167c07Ssthen ;; 479*a3167c07Ssthen psp) 480*a3167c07Ssthen basic_machine=mipsallegrexel-sony 481*a3167c07Ssthen basic_os=psp 482*a3167c07Ssthen ;; 483*a3167c07Ssthen pw32) 484*a3167c07Ssthen basic_machine=i586-unknown 485*a3167c07Ssthen basic_os=pw32 486*a3167c07Ssthen ;; 487*a3167c07Ssthen rdos | rdos64) 488*a3167c07Ssthen basic_machine=x86_64-pc 489*a3167c07Ssthen basic_os=rdos 490*a3167c07Ssthen ;; 491*a3167c07Ssthen rdos32) 492*a3167c07Ssthen basic_machine=i386-pc 493*a3167c07Ssthen basic_os=rdos 494*a3167c07Ssthen ;; 495*a3167c07Ssthen rom68k) 496*a3167c07Ssthen basic_machine=m68k-rom68k 497*a3167c07Ssthen basic_os=coff 498*a3167c07Ssthen ;; 499*a3167c07Ssthen sa29200) 500*a3167c07Ssthen basic_machine=a29k-amd 501*a3167c07Ssthen basic_os=udi 502*a3167c07Ssthen ;; 503*a3167c07Ssthen sei) 504*a3167c07Ssthen basic_machine=mips-sei 505*a3167c07Ssthen basic_os=seiux 506*a3167c07Ssthen ;; 507*a3167c07Ssthen sequent) 508*a3167c07Ssthen basic_machine=i386-sequent 509*a3167c07Ssthen basic_os= 510*a3167c07Ssthen ;; 511*a3167c07Ssthen sps7) 512*a3167c07Ssthen basic_machine=m68k-bull 513*a3167c07Ssthen basic_os=sysv2 514*a3167c07Ssthen ;; 515*a3167c07Ssthen st2000) 516*a3167c07Ssthen basic_machine=m68k-tandem 517*a3167c07Ssthen basic_os= 518*a3167c07Ssthen ;; 519*a3167c07Ssthen stratus) 520*a3167c07Ssthen basic_machine=i860-stratus 521*a3167c07Ssthen basic_os=sysv4 522*a3167c07Ssthen ;; 523*a3167c07Ssthen sun2) 524*a3167c07Ssthen basic_machine=m68000-sun 525*a3167c07Ssthen basic_os= 526*a3167c07Ssthen ;; 527*a3167c07Ssthen sun2os3) 528*a3167c07Ssthen basic_machine=m68000-sun 529*a3167c07Ssthen basic_os=sunos3 530*a3167c07Ssthen ;; 531*a3167c07Ssthen sun2os4) 532*a3167c07Ssthen basic_machine=m68000-sun 533*a3167c07Ssthen basic_os=sunos4 534*a3167c07Ssthen ;; 535*a3167c07Ssthen sun3) 536*a3167c07Ssthen basic_machine=m68k-sun 537*a3167c07Ssthen basic_os= 538*a3167c07Ssthen ;; 539*a3167c07Ssthen sun3os3) 540*a3167c07Ssthen basic_machine=m68k-sun 541*a3167c07Ssthen basic_os=sunos3 542*a3167c07Ssthen ;; 543*a3167c07Ssthen sun3os4) 544*a3167c07Ssthen basic_machine=m68k-sun 545*a3167c07Ssthen basic_os=sunos4 546*a3167c07Ssthen ;; 547*a3167c07Ssthen sun4) 548*a3167c07Ssthen basic_machine=sparc-sun 549*a3167c07Ssthen basic_os= 550*a3167c07Ssthen ;; 551*a3167c07Ssthen sun4os3) 552*a3167c07Ssthen basic_machine=sparc-sun 553*a3167c07Ssthen basic_os=sunos3 554*a3167c07Ssthen ;; 555*a3167c07Ssthen sun4os4) 556*a3167c07Ssthen basic_machine=sparc-sun 557*a3167c07Ssthen basic_os=sunos4 558*a3167c07Ssthen ;; 559*a3167c07Ssthen sun4sol2) 560*a3167c07Ssthen basic_machine=sparc-sun 561*a3167c07Ssthen basic_os=solaris2 562*a3167c07Ssthen ;; 563*a3167c07Ssthen sun386 | sun386i | roadrunner) 564*a3167c07Ssthen basic_machine=i386-sun 565*a3167c07Ssthen basic_os= 566*a3167c07Ssthen ;; 567*a3167c07Ssthen sv1) 568*a3167c07Ssthen basic_machine=sv1-cray 569*a3167c07Ssthen basic_os=unicos 570*a3167c07Ssthen ;; 571*a3167c07Ssthen symmetry) 572*a3167c07Ssthen basic_machine=i386-sequent 573*a3167c07Ssthen basic_os=dynix 574*a3167c07Ssthen ;; 575*a3167c07Ssthen t3e) 576*a3167c07Ssthen basic_machine=alphaev5-cray 577*a3167c07Ssthen basic_os=unicos 578*a3167c07Ssthen ;; 579*a3167c07Ssthen t90) 580*a3167c07Ssthen basic_machine=t90-cray 581*a3167c07Ssthen basic_os=unicos 582*a3167c07Ssthen ;; 583*a3167c07Ssthen toad1) 584*a3167c07Ssthen basic_machine=pdp10-xkl 585*a3167c07Ssthen basic_os=tops20 586*a3167c07Ssthen ;; 587*a3167c07Ssthen tpf) 588*a3167c07Ssthen basic_machine=s390x-ibm 589*a3167c07Ssthen basic_os=tpf 590*a3167c07Ssthen ;; 591*a3167c07Ssthen udi29k) 592*a3167c07Ssthen basic_machine=a29k-amd 593*a3167c07Ssthen basic_os=udi 594*a3167c07Ssthen ;; 595*a3167c07Ssthen ultra3) 596*a3167c07Ssthen basic_machine=a29k-nyu 597*a3167c07Ssthen basic_os=sym1 598*a3167c07Ssthen ;; 599*a3167c07Ssthen v810 | necv810) 600*a3167c07Ssthen basic_machine=v810-nec 601*a3167c07Ssthen basic_os=none 602*a3167c07Ssthen ;; 603*a3167c07Ssthen vaxv) 604*a3167c07Ssthen basic_machine=vax-dec 605*a3167c07Ssthen basic_os=sysv 606*a3167c07Ssthen ;; 607*a3167c07Ssthen vms) 608*a3167c07Ssthen basic_machine=vax-dec 609*a3167c07Ssthen basic_os=vms 610*a3167c07Ssthen ;; 611*a3167c07Ssthen vsta) 612*a3167c07Ssthen basic_machine=i386-pc 613*a3167c07Ssthen basic_os=vsta 614*a3167c07Ssthen ;; 615*a3167c07Ssthen vxworks960) 616*a3167c07Ssthen basic_machine=i960-wrs 617*a3167c07Ssthen basic_os=vxworks 618*a3167c07Ssthen ;; 619*a3167c07Ssthen vxworks68) 620*a3167c07Ssthen basic_machine=m68k-wrs 621*a3167c07Ssthen basic_os=vxworks 622*a3167c07Ssthen ;; 623*a3167c07Ssthen vxworks29k) 624*a3167c07Ssthen basic_machine=a29k-wrs 625*a3167c07Ssthen basic_os=vxworks 626*a3167c07Ssthen ;; 627*a3167c07Ssthen xbox) 628*a3167c07Ssthen basic_machine=i686-pc 629*a3167c07Ssthen basic_os=mingw32 630*a3167c07Ssthen ;; 631*a3167c07Ssthen ymp) 632*a3167c07Ssthen basic_machine=ymp-cray 633*a3167c07Ssthen basic_os=unicos 634*a3167c07Ssthen ;; 635*a3167c07Ssthen *) 636*a3167c07Ssthen basic_machine=$1 637*a3167c07Ssthen basic_os= 638*a3167c07Ssthen ;; 639*a3167c07Ssthen esac 640933707f3Ssthen ;; 641933707f3Ssthenesac 642933707f3Ssthen 643*a3167c07Ssthen# Decode 1-component or ad-hoc basic machines 644933707f3Ssthencase $basic_machine in 645*a3167c07Ssthen # Here we handle the default manufacturer of certain CPU types. It is in 646*a3167c07Ssthen # some cases the only manufacturer, in others, it is the most popular. 647*a3167c07Ssthen w89k) 648*a3167c07Ssthen cpu=hppa1.1 649*a3167c07Ssthen vendor=winbond 650*a3167c07Ssthen ;; 651*a3167c07Ssthen op50n) 652*a3167c07Ssthen cpu=hppa1.1 653*a3167c07Ssthen vendor=oki 654*a3167c07Ssthen ;; 655*a3167c07Ssthen op60c) 656*a3167c07Ssthen cpu=hppa1.1 657*a3167c07Ssthen vendor=oki 658*a3167c07Ssthen ;; 659*a3167c07Ssthen ibm*) 660*a3167c07Ssthen cpu=i370 661*a3167c07Ssthen vendor=ibm 662*a3167c07Ssthen ;; 663*a3167c07Ssthen orion105) 664*a3167c07Ssthen cpu=clipper 665*a3167c07Ssthen vendor=highlevel 666*a3167c07Ssthen ;; 667*a3167c07Ssthen mac | mpw | mac-mpw) 668*a3167c07Ssthen cpu=m68k 669*a3167c07Ssthen vendor=apple 670*a3167c07Ssthen ;; 671*a3167c07Ssthen pmac | pmac-mpw) 672*a3167c07Ssthen cpu=powerpc 673*a3167c07Ssthen vendor=apple 674*a3167c07Ssthen ;; 675*a3167c07Ssthen 676*a3167c07Ssthen # Recognize the various machine names and aliases which stand 677*a3167c07Ssthen # for a CPU type and a company and sometimes even an OS. 678*a3167c07Ssthen 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) 679*a3167c07Ssthen cpu=m68000 680*a3167c07Ssthen vendor=att 681*a3167c07Ssthen ;; 682*a3167c07Ssthen 3b*) 683*a3167c07Ssthen cpu=we32k 684*a3167c07Ssthen vendor=att 685*a3167c07Ssthen ;; 686*a3167c07Ssthen bluegene*) 687*a3167c07Ssthen cpu=powerpc 688*a3167c07Ssthen vendor=ibm 689*a3167c07Ssthen basic_os=cnk 690*a3167c07Ssthen ;; 691*a3167c07Ssthen decsystem10* | dec10*) 692*a3167c07Ssthen cpu=pdp10 693*a3167c07Ssthen vendor=dec 694*a3167c07Ssthen basic_os=tops10 695*a3167c07Ssthen ;; 696*a3167c07Ssthen decsystem20* | dec20*) 697*a3167c07Ssthen cpu=pdp10 698*a3167c07Ssthen vendor=dec 699*a3167c07Ssthen basic_os=tops20 700*a3167c07Ssthen ;; 701*a3167c07Ssthen delta | 3300 | motorola-3300 | motorola-delta \ 702*a3167c07Ssthen | 3300-motorola | delta-motorola) 703*a3167c07Ssthen cpu=m68k 704*a3167c07Ssthen vendor=motorola 705*a3167c07Ssthen ;; 706*a3167c07Ssthen dpx2*) 707*a3167c07Ssthen cpu=m68k 708*a3167c07Ssthen vendor=bull 709*a3167c07Ssthen basic_os=sysv3 710*a3167c07Ssthen ;; 711*a3167c07Ssthen encore | umax | mmax) 712*a3167c07Ssthen cpu=ns32k 713*a3167c07Ssthen vendor=encore 714*a3167c07Ssthen ;; 715*a3167c07Ssthen elxsi) 716*a3167c07Ssthen cpu=elxsi 717*a3167c07Ssthen vendor=elxsi 718*a3167c07Ssthen basic_os=${basic_os:-bsd} 719*a3167c07Ssthen ;; 720*a3167c07Ssthen fx2800) 721*a3167c07Ssthen cpu=i860 722*a3167c07Ssthen vendor=alliant 723*a3167c07Ssthen ;; 724*a3167c07Ssthen genix) 725*a3167c07Ssthen cpu=ns32k 726*a3167c07Ssthen vendor=ns 727*a3167c07Ssthen ;; 728*a3167c07Ssthen h3050r* | hiux*) 729*a3167c07Ssthen cpu=hppa1.1 730*a3167c07Ssthen vendor=hitachi 731*a3167c07Ssthen basic_os=hiuxwe2 732*a3167c07Ssthen ;; 733*a3167c07Ssthen hp3k9[0-9][0-9] | hp9[0-9][0-9]) 734*a3167c07Ssthen cpu=hppa1.0 735*a3167c07Ssthen vendor=hp 736*a3167c07Ssthen ;; 737*a3167c07Ssthen hp9k2[0-9][0-9] | hp9k31[0-9]) 738*a3167c07Ssthen cpu=m68000 739*a3167c07Ssthen vendor=hp 740*a3167c07Ssthen ;; 741*a3167c07Ssthen hp9k3[2-9][0-9]) 742*a3167c07Ssthen cpu=m68k 743*a3167c07Ssthen vendor=hp 744*a3167c07Ssthen ;; 745*a3167c07Ssthen hp9k6[0-9][0-9] | hp6[0-9][0-9]) 746*a3167c07Ssthen cpu=hppa1.0 747*a3167c07Ssthen vendor=hp 748*a3167c07Ssthen ;; 749*a3167c07Ssthen hp9k7[0-79][0-9] | hp7[0-79][0-9]) 750*a3167c07Ssthen cpu=hppa1.1 751*a3167c07Ssthen vendor=hp 752*a3167c07Ssthen ;; 753*a3167c07Ssthen hp9k78[0-9] | hp78[0-9]) 754*a3167c07Ssthen # FIXME: really hppa2.0-hp 755*a3167c07Ssthen cpu=hppa1.1 756*a3167c07Ssthen vendor=hp 757*a3167c07Ssthen ;; 758*a3167c07Ssthen hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) 759*a3167c07Ssthen # FIXME: really hppa2.0-hp 760*a3167c07Ssthen cpu=hppa1.1 761*a3167c07Ssthen vendor=hp 762*a3167c07Ssthen ;; 763*a3167c07Ssthen hp9k8[0-9][13679] | hp8[0-9][13679]) 764*a3167c07Ssthen cpu=hppa1.1 765*a3167c07Ssthen vendor=hp 766*a3167c07Ssthen ;; 767*a3167c07Ssthen hp9k8[0-9][0-9] | hp8[0-9][0-9]) 768*a3167c07Ssthen cpu=hppa1.0 769*a3167c07Ssthen vendor=hp 770*a3167c07Ssthen ;; 771*a3167c07Ssthen i*86v32) 772*a3167c07Ssthen cpu=`echo "$1" | sed -e 's/86.*/86/'` 773*a3167c07Ssthen vendor=pc 774*a3167c07Ssthen basic_os=sysv32 775*a3167c07Ssthen ;; 776*a3167c07Ssthen i*86v4*) 777*a3167c07Ssthen cpu=`echo "$1" | sed -e 's/86.*/86/'` 778*a3167c07Ssthen vendor=pc 779*a3167c07Ssthen basic_os=sysv4 780*a3167c07Ssthen ;; 781*a3167c07Ssthen i*86v) 782*a3167c07Ssthen cpu=`echo "$1" | sed -e 's/86.*/86/'` 783*a3167c07Ssthen vendor=pc 784*a3167c07Ssthen basic_os=sysv 785*a3167c07Ssthen ;; 786*a3167c07Ssthen i*86sol2) 787*a3167c07Ssthen cpu=`echo "$1" | sed -e 's/86.*/86/'` 788*a3167c07Ssthen vendor=pc 789*a3167c07Ssthen basic_os=solaris2 790*a3167c07Ssthen ;; 791*a3167c07Ssthen j90 | j90-cray) 792*a3167c07Ssthen cpu=j90 793*a3167c07Ssthen vendor=cray 794*a3167c07Ssthen basic_os=${basic_os:-unicos} 795*a3167c07Ssthen ;; 796*a3167c07Ssthen iris | iris4d) 797*a3167c07Ssthen cpu=mips 798*a3167c07Ssthen vendor=sgi 799*a3167c07Ssthen case $basic_os in 800*a3167c07Ssthen irix*) 801*a3167c07Ssthen ;; 802*a3167c07Ssthen *) 803*a3167c07Ssthen basic_os=irix4 804*a3167c07Ssthen ;; 805*a3167c07Ssthen esac 806*a3167c07Ssthen ;; 807*a3167c07Ssthen miniframe) 808*a3167c07Ssthen cpu=m68000 809*a3167c07Ssthen vendor=convergent 810*a3167c07Ssthen ;; 811*a3167c07Ssthen *mint | mint[0-9]* | *MiNT | *MiNT[0-9]*) 812*a3167c07Ssthen cpu=m68k 813*a3167c07Ssthen vendor=atari 814*a3167c07Ssthen basic_os=mint 815*a3167c07Ssthen ;; 816*a3167c07Ssthen news-3600 | risc-news) 817*a3167c07Ssthen cpu=mips 818*a3167c07Ssthen vendor=sony 819*a3167c07Ssthen basic_os=newsos 820*a3167c07Ssthen ;; 821*a3167c07Ssthen next | m*-next) 822*a3167c07Ssthen cpu=m68k 823*a3167c07Ssthen vendor=next 824*a3167c07Ssthen case $basic_os in 825*a3167c07Ssthen openstep*) 826*a3167c07Ssthen ;; 827*a3167c07Ssthen nextstep*) 828*a3167c07Ssthen ;; 829*a3167c07Ssthen ns2*) 830*a3167c07Ssthen basic_os=nextstep2 831*a3167c07Ssthen ;; 832*a3167c07Ssthen *) 833*a3167c07Ssthen basic_os=nextstep3 834*a3167c07Ssthen ;; 835*a3167c07Ssthen esac 836*a3167c07Ssthen ;; 837*a3167c07Ssthen np1) 838*a3167c07Ssthen cpu=np1 839*a3167c07Ssthen vendor=gould 840*a3167c07Ssthen ;; 841*a3167c07Ssthen op50n-* | op60c-*) 842*a3167c07Ssthen cpu=hppa1.1 843*a3167c07Ssthen vendor=oki 844*a3167c07Ssthen basic_os=proelf 845*a3167c07Ssthen ;; 846*a3167c07Ssthen pa-hitachi) 847*a3167c07Ssthen cpu=hppa1.1 848*a3167c07Ssthen vendor=hitachi 849*a3167c07Ssthen basic_os=hiuxwe2 850*a3167c07Ssthen ;; 851*a3167c07Ssthen pbd) 852*a3167c07Ssthen cpu=sparc 853*a3167c07Ssthen vendor=tti 854*a3167c07Ssthen ;; 855*a3167c07Ssthen pbb) 856*a3167c07Ssthen cpu=m68k 857*a3167c07Ssthen vendor=tti 858*a3167c07Ssthen ;; 859*a3167c07Ssthen pc532) 860*a3167c07Ssthen cpu=ns32k 861*a3167c07Ssthen vendor=pc532 862*a3167c07Ssthen ;; 863*a3167c07Ssthen pn) 864*a3167c07Ssthen cpu=pn 865*a3167c07Ssthen vendor=gould 866*a3167c07Ssthen ;; 867*a3167c07Ssthen power) 868*a3167c07Ssthen cpu=power 869*a3167c07Ssthen vendor=ibm 870*a3167c07Ssthen ;; 871*a3167c07Ssthen ps2) 872*a3167c07Ssthen cpu=i386 873*a3167c07Ssthen vendor=ibm 874*a3167c07Ssthen ;; 875*a3167c07Ssthen rm[46]00) 876*a3167c07Ssthen cpu=mips 877*a3167c07Ssthen vendor=siemens 878*a3167c07Ssthen ;; 879*a3167c07Ssthen rtpc | rtpc-*) 880*a3167c07Ssthen cpu=romp 881*a3167c07Ssthen vendor=ibm 882*a3167c07Ssthen ;; 883*a3167c07Ssthen sde) 884*a3167c07Ssthen cpu=mipsisa32 885*a3167c07Ssthen vendor=sde 886*a3167c07Ssthen basic_os=${basic_os:-elf} 887*a3167c07Ssthen ;; 888*a3167c07Ssthen simso-wrs) 889*a3167c07Ssthen cpu=sparclite 890*a3167c07Ssthen vendor=wrs 891*a3167c07Ssthen basic_os=vxworks 892*a3167c07Ssthen ;; 893*a3167c07Ssthen tower | tower-32) 894*a3167c07Ssthen cpu=m68k 895*a3167c07Ssthen vendor=ncr 896*a3167c07Ssthen ;; 897*a3167c07Ssthen vpp*|vx|vx-*) 898*a3167c07Ssthen cpu=f301 899*a3167c07Ssthen vendor=fujitsu 900*a3167c07Ssthen ;; 901*a3167c07Ssthen w65) 902*a3167c07Ssthen cpu=w65 903*a3167c07Ssthen vendor=wdc 904*a3167c07Ssthen ;; 905*a3167c07Ssthen w89k-*) 906*a3167c07Ssthen cpu=hppa1.1 907*a3167c07Ssthen vendor=winbond 908*a3167c07Ssthen basic_os=proelf 909*a3167c07Ssthen ;; 910*a3167c07Ssthen none) 911*a3167c07Ssthen cpu=none 912*a3167c07Ssthen vendor=none 913*a3167c07Ssthen ;; 914*a3167c07Ssthen leon|leon[3-9]) 915*a3167c07Ssthen cpu=sparc 916*a3167c07Ssthen vendor=$basic_machine 917*a3167c07Ssthen ;; 918*a3167c07Ssthen leon-*|leon[3-9]-*) 919*a3167c07Ssthen cpu=sparc 920*a3167c07Ssthen vendor=`echo "$basic_machine" | sed 's/-.*//'` 921*a3167c07Ssthen ;; 922*a3167c07Ssthen 923*a3167c07Ssthen *-*) 924*a3167c07Ssthen # shellcheck disable=SC2162 925*a3167c07Ssthen IFS="-" read cpu vendor <<EOF 926*a3167c07Ssthen$basic_machine 927*a3167c07SsthenEOF 928*a3167c07Ssthen ;; 929*a3167c07Ssthen # We use `pc' rather than `unknown' 930*a3167c07Ssthen # because (1) that's what they normally are, and 931*a3167c07Ssthen # (2) the word "unknown" tends to confuse beginning users. 932*a3167c07Ssthen i*86 | x86_64) 933*a3167c07Ssthen cpu=$basic_machine 934*a3167c07Ssthen vendor=pc 935*a3167c07Ssthen ;; 936*a3167c07Ssthen # These rules are duplicated from below for sake of the special case above; 937*a3167c07Ssthen # i.e. things that normalized to x86 arches should also default to "pc" 938*a3167c07Ssthen pc98) 939*a3167c07Ssthen cpu=i386 940*a3167c07Ssthen vendor=pc 941*a3167c07Ssthen ;; 942*a3167c07Ssthen x64 | amd64) 943*a3167c07Ssthen cpu=x86_64 944*a3167c07Ssthen vendor=pc 945*a3167c07Ssthen ;; 946933707f3Ssthen # Recognize the basic CPU types without company name. 947*a3167c07Ssthen *) 948*a3167c07Ssthen cpu=$basic_machine 949*a3167c07Ssthen vendor=unknown 950*a3167c07Ssthen ;; 951*a3167c07Ssthenesac 952*a3167c07Ssthen 953*a3167c07Ssthenunset -v basic_machine 954*a3167c07Ssthen 955*a3167c07Ssthen# Decode basic machines in the full and proper CPU-Company form. 956*a3167c07Ssthencase $cpu-$vendor in 957*a3167c07Ssthen # Here we handle the default manufacturer of certain CPU types in canonical form. It is in 958*a3167c07Ssthen # some cases the only manufacturer, in others, it is the most popular. 959*a3167c07Ssthen craynv-unknown) 960*a3167c07Ssthen vendor=cray 961*a3167c07Ssthen basic_os=${basic_os:-unicosmp} 962*a3167c07Ssthen ;; 963*a3167c07Ssthen c90-unknown | c90-cray) 964*a3167c07Ssthen vendor=cray 965*a3167c07Ssthen basic_os=${Basic_os:-unicos} 966*a3167c07Ssthen ;; 967*a3167c07Ssthen fx80-unknown) 968*a3167c07Ssthen vendor=alliant 969*a3167c07Ssthen ;; 970*a3167c07Ssthen romp-unknown) 971*a3167c07Ssthen vendor=ibm 972*a3167c07Ssthen ;; 973*a3167c07Ssthen mmix-unknown) 974*a3167c07Ssthen vendor=knuth 975*a3167c07Ssthen ;; 976*a3167c07Ssthen microblaze-unknown | microblazeel-unknown) 977*a3167c07Ssthen vendor=xilinx 978*a3167c07Ssthen ;; 979*a3167c07Ssthen rs6000-unknown) 980*a3167c07Ssthen vendor=ibm 981*a3167c07Ssthen ;; 982*a3167c07Ssthen vax-unknown) 983*a3167c07Ssthen vendor=dec 984*a3167c07Ssthen ;; 985*a3167c07Ssthen pdp11-unknown) 986*a3167c07Ssthen vendor=dec 987*a3167c07Ssthen ;; 988*a3167c07Ssthen we32k-unknown) 989*a3167c07Ssthen vendor=att 990*a3167c07Ssthen ;; 991*a3167c07Ssthen cydra-unknown) 992*a3167c07Ssthen vendor=cydrome 993*a3167c07Ssthen ;; 994*a3167c07Ssthen i370-ibm*) 995*a3167c07Ssthen vendor=ibm 996*a3167c07Ssthen ;; 997*a3167c07Ssthen orion-unknown) 998*a3167c07Ssthen vendor=highlevel 999*a3167c07Ssthen ;; 1000*a3167c07Ssthen xps-unknown | xps100-unknown) 1001*a3167c07Ssthen cpu=xps100 1002*a3167c07Ssthen vendor=honeywell 1003*a3167c07Ssthen ;; 1004*a3167c07Ssthen 1005*a3167c07Ssthen # Here we normalize CPU types with a missing or matching vendor 1006*a3167c07Ssthen dpx20-unknown | dpx20-bull) 1007*a3167c07Ssthen cpu=rs6000 1008*a3167c07Ssthen vendor=bull 1009*a3167c07Ssthen basic_os=${basic_os:-bosx} 1010*a3167c07Ssthen ;; 1011*a3167c07Ssthen 1012*a3167c07Ssthen # Here we normalize CPU types irrespective of the vendor 1013*a3167c07Ssthen amd64-*) 1014*a3167c07Ssthen cpu=x86_64 1015*a3167c07Ssthen ;; 1016*a3167c07Ssthen blackfin-*) 1017*a3167c07Ssthen cpu=bfin 1018*a3167c07Ssthen basic_os=linux 1019*a3167c07Ssthen ;; 1020*a3167c07Ssthen c54x-*) 1021*a3167c07Ssthen cpu=tic54x 1022*a3167c07Ssthen ;; 1023*a3167c07Ssthen c55x-*) 1024*a3167c07Ssthen cpu=tic55x 1025*a3167c07Ssthen ;; 1026*a3167c07Ssthen c6x-*) 1027*a3167c07Ssthen cpu=tic6x 1028*a3167c07Ssthen ;; 1029*a3167c07Ssthen e500v[12]-*) 1030*a3167c07Ssthen cpu=powerpc 1031*a3167c07Ssthen basic_os=${basic_os}"spe" 1032*a3167c07Ssthen ;; 1033*a3167c07Ssthen mips3*-*) 1034*a3167c07Ssthen cpu=mips64 1035*a3167c07Ssthen ;; 1036*a3167c07Ssthen ms1-*) 1037*a3167c07Ssthen cpu=mt 1038*a3167c07Ssthen ;; 1039*a3167c07Ssthen m68knommu-*) 1040*a3167c07Ssthen cpu=m68k 1041*a3167c07Ssthen basic_os=linux 1042*a3167c07Ssthen ;; 1043*a3167c07Ssthen m9s12z-* | m68hcs12z-* | hcs12z-* | s12z-*) 1044*a3167c07Ssthen cpu=s12z 1045*a3167c07Ssthen ;; 1046*a3167c07Ssthen openrisc-*) 1047*a3167c07Ssthen cpu=or32 1048*a3167c07Ssthen ;; 1049*a3167c07Ssthen parisc-*) 1050*a3167c07Ssthen cpu=hppa 1051*a3167c07Ssthen basic_os=linux 1052*a3167c07Ssthen ;; 1053*a3167c07Ssthen pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) 1054*a3167c07Ssthen cpu=i586 1055*a3167c07Ssthen ;; 1056*a3167c07Ssthen pentiumpro-* | p6-* | 6x86-* | athlon-* | athalon_*-*) 1057*a3167c07Ssthen cpu=i686 1058*a3167c07Ssthen ;; 1059*a3167c07Ssthen pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) 1060*a3167c07Ssthen cpu=i686 1061*a3167c07Ssthen ;; 1062*a3167c07Ssthen pentium4-*) 1063*a3167c07Ssthen cpu=i786 1064*a3167c07Ssthen ;; 1065*a3167c07Ssthen pc98-*) 1066*a3167c07Ssthen cpu=i386 1067*a3167c07Ssthen ;; 1068*a3167c07Ssthen ppc-* | ppcbe-*) 1069*a3167c07Ssthen cpu=powerpc 1070*a3167c07Ssthen ;; 1071*a3167c07Ssthen ppcle-* | powerpclittle-*) 1072*a3167c07Ssthen cpu=powerpcle 1073*a3167c07Ssthen ;; 1074*a3167c07Ssthen ppc64-*) 1075*a3167c07Ssthen cpu=powerpc64 1076*a3167c07Ssthen ;; 1077*a3167c07Ssthen ppc64le-* | powerpc64little-*) 1078*a3167c07Ssthen cpu=powerpc64le 1079*a3167c07Ssthen ;; 1080*a3167c07Ssthen sb1-*) 1081*a3167c07Ssthen cpu=mipsisa64sb1 1082*a3167c07Ssthen ;; 1083*a3167c07Ssthen sb1el-*) 1084*a3167c07Ssthen cpu=mipsisa64sb1el 1085*a3167c07Ssthen ;; 1086*a3167c07Ssthen sh5e[lb]-*) 1087*a3167c07Ssthen cpu=`echo "$cpu" | sed 's/^\(sh.\)e\(.\)$/\1\2e/'` 1088*a3167c07Ssthen ;; 1089*a3167c07Ssthen spur-*) 1090*a3167c07Ssthen cpu=spur 1091*a3167c07Ssthen ;; 1092*a3167c07Ssthen strongarm-* | thumb-*) 1093*a3167c07Ssthen cpu=arm 1094*a3167c07Ssthen ;; 1095*a3167c07Ssthen tx39-*) 1096*a3167c07Ssthen cpu=mipstx39 1097*a3167c07Ssthen ;; 1098*a3167c07Ssthen tx39el-*) 1099*a3167c07Ssthen cpu=mipstx39el 1100*a3167c07Ssthen ;; 1101*a3167c07Ssthen x64-*) 1102*a3167c07Ssthen cpu=x86_64 1103*a3167c07Ssthen ;; 1104*a3167c07Ssthen xscale-* | xscalee[bl]-*) 1105*a3167c07Ssthen cpu=`echo "$cpu" | sed 's/^xscale/arm/'` 1106*a3167c07Ssthen ;; 1107*a3167c07Ssthen arm64-*) 1108*a3167c07Ssthen cpu=aarch64 1109*a3167c07Ssthen ;; 1110*a3167c07Ssthen 1111*a3167c07Ssthen # Recognize the canonical CPU Types that limit and/or modify the 1112*a3167c07Ssthen # company names they are paired with. 1113*a3167c07Ssthen cr16-*) 1114*a3167c07Ssthen basic_os=${basic_os:-elf} 1115*a3167c07Ssthen ;; 1116*a3167c07Ssthen crisv32-* | etraxfs*-*) 1117*a3167c07Ssthen cpu=crisv32 1118*a3167c07Ssthen vendor=axis 1119*a3167c07Ssthen ;; 1120*a3167c07Ssthen cris-* | etrax*-*) 1121*a3167c07Ssthen cpu=cris 1122*a3167c07Ssthen vendor=axis 1123*a3167c07Ssthen ;; 1124*a3167c07Ssthen crx-*) 1125*a3167c07Ssthen basic_os=${basic_os:-elf} 1126*a3167c07Ssthen ;; 1127*a3167c07Ssthen neo-tandem) 1128*a3167c07Ssthen cpu=neo 1129*a3167c07Ssthen vendor=tandem 1130*a3167c07Ssthen ;; 1131*a3167c07Ssthen nse-tandem) 1132*a3167c07Ssthen cpu=nse 1133*a3167c07Ssthen vendor=tandem 1134*a3167c07Ssthen ;; 1135*a3167c07Ssthen nsr-tandem) 1136*a3167c07Ssthen cpu=nsr 1137*a3167c07Ssthen vendor=tandem 1138*a3167c07Ssthen ;; 1139*a3167c07Ssthen nsv-tandem) 1140*a3167c07Ssthen cpu=nsv 1141*a3167c07Ssthen vendor=tandem 1142*a3167c07Ssthen ;; 1143*a3167c07Ssthen nsx-tandem) 1144*a3167c07Ssthen cpu=nsx 1145*a3167c07Ssthen vendor=tandem 1146*a3167c07Ssthen ;; 1147*a3167c07Ssthen mipsallegrexel-sony) 1148*a3167c07Ssthen cpu=mipsallegrexel 1149*a3167c07Ssthen vendor=sony 1150*a3167c07Ssthen ;; 1151*a3167c07Ssthen tile*-*) 1152*a3167c07Ssthen basic_os=${basic_os:-linux-gnu} 1153*a3167c07Ssthen ;; 1154*a3167c07Ssthen 1155*a3167c07Ssthen *) 1156*a3167c07Ssthen # Recognize the canonical CPU types that are allowed with any 1157*a3167c07Ssthen # company name. 1158*a3167c07Ssthen case $cpu in 1159933707f3Ssthen 1750a | 580 \ 1160933707f3Ssthen | a29k \ 1161229e174cSsthen | aarch64 | aarch64_be \ 1162*a3167c07Ssthen | abacus \ 1163*a3167c07Ssthen | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] \ 1164*a3167c07Ssthen | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] \ 1165*a3167c07Ssthen | alphapca5[67] | alpha64pca5[67] \ 1166933707f3Ssthen | am33_2.0 \ 1167*a3167c07Ssthen | amdgcn \ 116898f3ca02Sbrad | arc | arceb \ 1169*a3167c07Ssthen | arm | arm[lb]e | arme[lb] | armv* \ 117098f3ca02Sbrad | avr | avr32 \ 1171*a3167c07Ssthen | asmjs \ 11720990ddf5Ssthen | ba \ 1173229e174cSsthen | be32 | be64 \ 1174*a3167c07Ssthen | bfin | bpf | bs2000 \ 1175*a3167c07Ssthen | c[123]* | c30 | [cjt]90 | c4x \ 1176*a3167c07Ssthen | c8051 | clipper | craynv | csky | cydra \ 1177933707f3Ssthen | d10v | d30v | dlx | dsp16xx \ 1178*a3167c07Ssthen | e2k | elxsi | epiphany \ 1179*a3167c07Ssthen | f30[01] | f700 | fido | fr30 | frv | ft32 | fx80 \ 1180*a3167c07Ssthen | h8300 | h8500 \ 1181*a3167c07Ssthen | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ 1182229e174cSsthen | hexagon \ 1183*a3167c07Ssthen | i370 | i*86 | i860 | i960 | ia16 | ia64 \ 1184933707f3Ssthen | ip2k | iq2000 \ 11850990ddf5Ssthen | k1om \ 1186229e174cSsthen | le32 | le64 \ 1187933707f3Ssthen | lm32 \ 1188*a3167c07Ssthen | m32c | m32r | m32rle \ 1189*a3167c07Ssthen | m5200 | m68000 | m680[012346]0 | m68360 | m683?2 | m68k \ 1190*a3167c07Ssthen | m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x \ 1191*a3167c07Ssthen | m88110 | m88k | maxq | mb | mcore | mep | metag \ 1192*a3167c07Ssthen | microblaze | microblazeel \ 1193933707f3Ssthen | mips | mipsbe | mipseb | mipsel | mipsle \ 1194933707f3Ssthen | mips16 \ 1195*a3167c07Ssthen | mips64 | mips64eb | mips64el \ 1196933707f3Ssthen | mips64octeon | mips64octeonel \ 1197933707f3Ssthen | mips64orion | mips64orionel \ 1198933707f3Ssthen | mips64r5900 | mips64r5900el \ 1199933707f3Ssthen | mips64vr | mips64vrel \ 1200933707f3Ssthen | mips64vr4100 | mips64vr4100el \ 1201933707f3Ssthen | mips64vr4300 | mips64vr4300el \ 1202933707f3Ssthen | mips64vr5000 | mips64vr5000el \ 1203933707f3Ssthen | mips64vr5900 | mips64vr5900el \ 1204933707f3Ssthen | mipsisa32 | mipsisa32el \ 1205933707f3Ssthen | mipsisa32r2 | mipsisa32r2el \ 12060990ddf5Ssthen | mipsisa32r6 | mipsisa32r6el \ 1207933707f3Ssthen | mipsisa64 | mipsisa64el \ 1208933707f3Ssthen | mipsisa64r2 | mipsisa64r2el \ 12090990ddf5Ssthen | mipsisa64r6 | mipsisa64r6el \ 1210933707f3Ssthen | mipsisa64sb1 | mipsisa64sb1el \ 1211933707f3Ssthen | mipsisa64sr71k | mipsisa64sr71kel \ 121298f3ca02Sbrad | mipsr5900 | mipsr5900el \ 1213933707f3Ssthen | mipstx39 | mipstx39el \ 1214*a3167c07Ssthen | mmix \ 1215933707f3Ssthen | mn10200 | mn10300 \ 1216933707f3Ssthen | moxie \ 1217933707f3Ssthen | mt \ 1218933707f3Ssthen | msp430 \ 1219229e174cSsthen | nds32 | nds32le | nds32be \ 1220*a3167c07Ssthen | nfp \ 122198f3ca02Sbrad | nios | nios2 | nios2eb | nios2el \ 1222*a3167c07Ssthen | none | np1 | ns16k | ns32k | nvptx \ 1223*a3167c07Ssthen | open8 \ 1224*a3167c07Ssthen | or1k* \ 1225*a3167c07Ssthen | or32 \ 1226*a3167c07Ssthen | orion \ 1227*a3167c07Ssthen | picochip \ 1228*a3167c07Ssthen | pdp10 | pdp11 | pj | pjl | pn | power \ 1229*a3167c07Ssthen | powerpc | powerpc64 | powerpc64le | powerpcle | powerpcspe \ 1230*a3167c07Ssthen | pru \ 1231933707f3Ssthen | pyramid \ 1232*a3167c07Ssthen | riscv | riscv32 | riscv64 \ 1233*a3167c07Ssthen | rl78 | romp | rs6000 | rx \ 1234*a3167c07Ssthen | s390 | s390x \ 1235933707f3Ssthen | score \ 1236*a3167c07Ssthen | sh | shl \ 1237*a3167c07Ssthen | sh[1234] | sh[24]a | sh[24]ae[lb] | sh[23]e | she[lb] | sh[lb]e \ 1238*a3167c07Ssthen | sh[1234]e[lb] | sh[12345][lb]e | sh[23]ele | sh64 | sh64le \ 1239*a3167c07Ssthen | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet \ 1240*a3167c07Ssthen | sparclite \ 1241*a3167c07Ssthen | sparcv8 | sparcv9 | sparcv9b | sparcv9v | sv1 | sx* \ 1242229e174cSsthen | spu \ 1243*a3167c07Ssthen | tahoe \ 1244*a3167c07Ssthen | tic30 | tic4x | tic54x | tic55x | tic6x | tic80 \ 1245*a3167c07Ssthen | tron \ 1246933707f3Ssthen | ubicom32 \ 1247*a3167c07Ssthen | v70 | v850 | v850e | v850e1 | v850es | v850e2 | v850e2v3 \ 1248*a3167c07Ssthen | vax \ 12490990ddf5Ssthen | visium \ 1250*a3167c07Ssthen | w65 \ 1251*a3167c07Ssthen | wasm32 | wasm64 \ 1252eaf2578eSsthen | we32k \ 1253*a3167c07Ssthen | x86 | x86_64 | xc16x | xgate | xps100 \ 1254*a3167c07Ssthen | xstormy16 | xtensa* \ 1255*a3167c07Ssthen | ymp \ 1256933707f3Ssthen | z8k | z80) 1257933707f3Ssthen ;; 1258933707f3Ssthen 1259*a3167c07Ssthen *) 1260*a3167c07Ssthen echo Invalid configuration \`"$1"\': machine \`"$cpu-$vendor"\' not recognized 1>&2 1261933707f3Ssthen exit 1 1262933707f3Ssthen ;; 1263933707f3Ssthen esac 1264933707f3Ssthen ;; 1265933707f3Ssthenesac 1266933707f3Ssthen 1267933707f3Ssthen# Here we canonicalize certain aliases for manufacturers. 1268*a3167c07Ssthencase $vendor in 1269*a3167c07Ssthen digital*) 1270*a3167c07Ssthen vendor=dec 1271933707f3Ssthen ;; 1272*a3167c07Ssthen commodore*) 1273*a3167c07Ssthen vendor=cbm 1274933707f3Ssthen ;; 1275933707f3Ssthen *) 1276933707f3Ssthen ;; 1277933707f3Ssthenesac 1278933707f3Ssthen 1279933707f3Ssthen# Decode manufacturer-specific aliases for certain operating systems. 1280933707f3Ssthen 1281*a3167c07Ssthenif [ x$basic_os != x ] 1282933707f3Ssthenthen 1283*a3167c07Ssthen 1284*a3167c07Ssthen# First recognize some ad-hoc caes, or perhaps split kernel-os, or else just 1285*a3167c07Ssthen# set os. 1286*a3167c07Ssthencase $basic_os in 1287*a3167c07Ssthen gnu/linux*) 1288*a3167c07Ssthen kernel=linux 1289*a3167c07Ssthen os=`echo $basic_os | sed -e 's|gnu/linux|gnu|'` 1290933707f3Ssthen ;; 1291*a3167c07Ssthen nto-qnx*) 1292*a3167c07Ssthen kernel=nto 1293*a3167c07Ssthen os=`echo $basic_os | sed -e 's|nto-qnx|qnx|'` 1294*a3167c07Ssthen ;; 1295*a3167c07Ssthen *-*) 1296*a3167c07Ssthen # shellcheck disable=SC2162 1297*a3167c07Ssthen IFS="-" read kernel os <<EOF 1298*a3167c07Ssthen$basic_os 1299*a3167c07SsthenEOF 1300*a3167c07Ssthen ;; 1301*a3167c07Ssthen # Default OS when just kernel was specified 1302*a3167c07Ssthen nto*) 1303*a3167c07Ssthen kernel=nto 1304*a3167c07Ssthen os=`echo $basic_os | sed -e 's|nto|qnx|'` 1305*a3167c07Ssthen ;; 1306*a3167c07Ssthen linux*) 1307*a3167c07Ssthen kernel=linux 1308*a3167c07Ssthen os=`echo $basic_os | sed -e 's|linux|gnu|'` 1309*a3167c07Ssthen ;; 1310*a3167c07Ssthen *) 1311*a3167c07Ssthen kernel= 1312*a3167c07Ssthen os=$basic_os 1313*a3167c07Ssthen ;; 1314*a3167c07Ssthenesac 1315*a3167c07Ssthen 1316*a3167c07Ssthen# Now, normalize the OS (knowing we just have one component, it's not a kernel, 1317*a3167c07Ssthen# etc.) 1318*a3167c07Ssthencase $os in 1319*a3167c07Ssthen # First match some system type aliases that might get confused 1320*a3167c07Ssthen # with valid system types. 1321*a3167c07Ssthen # solaris* is a basic system type, with this one exception. 1322*a3167c07Ssthen auroraux) 1323*a3167c07Ssthen os=auroraux 1324*a3167c07Ssthen ;; 1325*a3167c07Ssthen bluegene*) 1326*a3167c07Ssthen os=cnk 1327*a3167c07Ssthen ;; 1328*a3167c07Ssthen solaris1 | solaris1.*) 1329933707f3Ssthen os=`echo $os | sed -e 's|solaris1|sunos4|'` 1330933707f3Ssthen ;; 1331*a3167c07Ssthen solaris) 1332*a3167c07Ssthen os=solaris2 1333933707f3Ssthen ;; 1334*a3167c07Ssthen unixware*) 1335*a3167c07Ssthen os=sysv4.2uw 1336eaf2578eSsthen ;; 1337*a3167c07Ssthen # es1800 is here to avoid being matched by es* (a different OS) 1338*a3167c07Ssthen es1800*) 1339*a3167c07Ssthen os=ose 1340933707f3Ssthen ;; 1341*a3167c07Ssthen # Some version numbers need modification 1342*a3167c07Ssthen chorusos*) 1343*a3167c07Ssthen os=chorusos 1344933707f3Ssthen ;; 1345*a3167c07Ssthen isc) 1346*a3167c07Ssthen os=isc2.2 1347933707f3Ssthen ;; 1348*a3167c07Ssthen sco6) 1349*a3167c07Ssthen os=sco5v6 1350*a3167c07Ssthen ;; 1351*a3167c07Ssthen sco5) 1352*a3167c07Ssthen os=sco3.2v5 1353*a3167c07Ssthen ;; 1354*a3167c07Ssthen sco4) 1355*a3167c07Ssthen os=sco3.2v4 1356*a3167c07Ssthen ;; 1357*a3167c07Ssthen sco3.2.[4-9]*) 1358*a3167c07Ssthen os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` 1359*a3167c07Ssthen ;; 1360*a3167c07Ssthen sco*v* | scout) 1361*a3167c07Ssthen # Don't match below 1362*a3167c07Ssthen ;; 1363*a3167c07Ssthen sco*) 1364*a3167c07Ssthen os=sco3.2v2 1365*a3167c07Ssthen ;; 1366*a3167c07Ssthen psos*) 1367*a3167c07Ssthen os=psos 1368*a3167c07Ssthen ;; 1369*a3167c07Ssthen qnx*) 1370*a3167c07Ssthen case $cpu in 1371*a3167c07Ssthen x86 | i*86) 1372933707f3Ssthen ;; 1373933707f3Ssthen *) 1374*a3167c07Ssthen os=nto-$os 1375933707f3Ssthen ;; 1376933707f3Ssthen esac 1377933707f3Ssthen ;; 1378*a3167c07Ssthen hiux*) 1379*a3167c07Ssthen os=hiuxwe2 1380933707f3Ssthen ;; 1381*a3167c07Ssthen lynx*178) 1382*a3167c07Ssthen os=lynxos178 1383933707f3Ssthen ;; 1384*a3167c07Ssthen lynx*5) 1385*a3167c07Ssthen os=lynxos5 1386933707f3Ssthen ;; 1387*a3167c07Ssthen lynxos*) 1388*a3167c07Ssthen # don't get caught up in next wildcard 1389933707f3Ssthen ;; 1390*a3167c07Ssthen lynx*) 1391*a3167c07Ssthen os=lynxos 1392933707f3Ssthen ;; 1393*a3167c07Ssthen mac[0-9]*) 1394*a3167c07Ssthen os=`echo "$os" | sed -e 's|mac|macos|'` 1395933707f3Ssthen ;; 1396*a3167c07Ssthen opened*) 1397*a3167c07Ssthen os=openedition 1398933707f3Ssthen ;; 1399*a3167c07Ssthen os400*) 1400*a3167c07Ssthen os=os400 1401933707f3Ssthen ;; 1402*a3167c07Ssthen sunos5*) 1403*a3167c07Ssthen os=`echo "$os" | sed -e 's|sunos5|solaris2|'` 1404933707f3Ssthen ;; 1405*a3167c07Ssthen sunos6*) 1406*a3167c07Ssthen os=`echo "$os" | sed -e 's|sunos6|solaris3|'` 1407933707f3Ssthen ;; 1408*a3167c07Ssthen wince*) 1409*a3167c07Ssthen os=wince 1410933707f3Ssthen ;; 1411*a3167c07Ssthen utek*) 1412*a3167c07Ssthen os=bsd 1413eaf2578eSsthen ;; 1414*a3167c07Ssthen dynix*) 1415*a3167c07Ssthen os=bsd 1416eaf2578eSsthen ;; 1417*a3167c07Ssthen acis*) 1418*a3167c07Ssthen os=aos 1419933707f3Ssthen ;; 1420*a3167c07Ssthen atheos*) 1421*a3167c07Ssthen os=atheos 1422933707f3Ssthen ;; 1423*a3167c07Ssthen syllable*) 1424*a3167c07Ssthen os=syllable 1425933707f3Ssthen ;; 1426*a3167c07Ssthen 386bsd) 1427*a3167c07Ssthen os=bsd 1428933707f3Ssthen ;; 1429*a3167c07Ssthen ctix* | uts*) 1430*a3167c07Ssthen os=sysv 1431933707f3Ssthen ;; 1432*a3167c07Ssthen nova*) 1433*a3167c07Ssthen os=rtmk-nova 1434933707f3Ssthen ;; 1435*a3167c07Ssthen ns2) 1436*a3167c07Ssthen os=nextstep2 1437933707f3Ssthen ;; 1438933707f3Ssthen # Preserve the version number of sinix5. 1439*a3167c07Ssthen sinix5.*) 1440933707f3Ssthen os=`echo $os | sed -e 's|sinix|sysv|'` 1441933707f3Ssthen ;; 1442*a3167c07Ssthen sinix*) 1443*a3167c07Ssthen os=sysv4 1444933707f3Ssthen ;; 1445*a3167c07Ssthen tpf*) 1446*a3167c07Ssthen os=tpf 1447933707f3Ssthen ;; 1448*a3167c07Ssthen triton*) 1449*a3167c07Ssthen os=sysv3 1450933707f3Ssthen ;; 1451*a3167c07Ssthen oss*) 1452*a3167c07Ssthen os=sysv3 1453933707f3Ssthen ;; 1454*a3167c07Ssthen svr4*) 1455*a3167c07Ssthen os=sysv4 1456933707f3Ssthen ;; 1457*a3167c07Ssthen svr3) 1458*a3167c07Ssthen os=sysv3 1459933707f3Ssthen ;; 1460*a3167c07Ssthen sysvr4) 1461*a3167c07Ssthen os=sysv4 1462933707f3Ssthen ;; 1463*a3167c07Ssthen ose*) 1464*a3167c07Ssthen os=ose 1465933707f3Ssthen ;; 1466*a3167c07Ssthen *mint | mint[0-9]* | *MiNT | MiNT[0-9]*) 1467*a3167c07Ssthen os=mint 1468933707f3Ssthen ;; 1469*a3167c07Ssthen dicos*) 1470*a3167c07Ssthen os=dicos 1471eaf2578eSsthen ;; 1472*a3167c07Ssthen pikeos*) 1473*a3167c07Ssthen # Until real need of OS specific support for 1474*a3167c07Ssthen # particular features comes up, bare metal 1475*a3167c07Ssthen # configurations are quite functional. 1476*a3167c07Ssthen case $cpu in 1477*a3167c07Ssthen arm*) 1478*a3167c07Ssthen os=eabi 1479933707f3Ssthen ;; 1480933707f3Ssthen *) 1481*a3167c07Ssthen os=elf 1482933707f3Ssthen ;; 1483933707f3Ssthen esac 1484*a3167c07Ssthen ;; 1485*a3167c07Ssthen *) 1486*a3167c07Ssthen # No normalization, but not necessarily accepted, that comes below. 1487*a3167c07Ssthen ;; 1488*a3167c07Ssthenesac 1489*a3167c07Ssthen 1490933707f3Ssthenelse 1491933707f3Ssthen 1492933707f3Ssthen# Here we handle the default operating systems that come with various machines. 1493933707f3Ssthen# The value should be what the vendor currently ships out the door with their 1494933707f3Ssthen# machine or put another way, the most popular os provided with the machine. 1495933707f3Ssthen 1496933707f3Ssthen# Note that if you're going to try to match "-MANUFACTURER" here (say, 1497933707f3Ssthen# "-sun"), then you have to tell the case statement up towards the top 1498933707f3Ssthen# that MANUFACTURER isn't an operating system. Otherwise, code above 1499933707f3Ssthen# will signal an error saying that MANUFACTURER isn't an operating 1500933707f3Ssthen# system, and we'll never get to this point. 1501933707f3Ssthen 1502*a3167c07Ssthenkernel= 1503*a3167c07Ssthencase $cpu-$vendor in 1504933707f3Ssthen score-*) 1505*a3167c07Ssthen os=elf 1506933707f3Ssthen ;; 1507933707f3Ssthen spu-*) 1508*a3167c07Ssthen os=elf 1509933707f3Ssthen ;; 1510933707f3Ssthen *-acorn) 1511*a3167c07Ssthen os=riscix1.2 1512933707f3Ssthen ;; 1513933707f3Ssthen arm*-rebel) 1514*a3167c07Ssthen kernel=linux 1515*a3167c07Ssthen os=gnu 1516933707f3Ssthen ;; 1517933707f3Ssthen arm*-semi) 1518*a3167c07Ssthen os=aout 1519933707f3Ssthen ;; 1520933707f3Ssthen c4x-* | tic4x-*) 1521*a3167c07Ssthen os=coff 1522933707f3Ssthen ;; 152398f3ca02Sbrad c8051-*) 1524*a3167c07Ssthen os=elf 1525*a3167c07Ssthen ;; 1526*a3167c07Ssthen clipper-intergraph) 1527*a3167c07Ssthen os=clix 152898f3ca02Sbrad ;; 1529229e174cSsthen hexagon-*) 1530*a3167c07Ssthen os=elf 1531229e174cSsthen ;; 1532229e174cSsthen tic54x-*) 1533*a3167c07Ssthen os=coff 1534229e174cSsthen ;; 1535229e174cSsthen tic55x-*) 1536*a3167c07Ssthen os=coff 1537229e174cSsthen ;; 1538229e174cSsthen tic6x-*) 1539*a3167c07Ssthen os=coff 1540229e174cSsthen ;; 1541933707f3Ssthen # This must come before the *-dec entry. 1542933707f3Ssthen pdp10-*) 1543*a3167c07Ssthen os=tops20 1544933707f3Ssthen ;; 1545933707f3Ssthen pdp11-*) 1546*a3167c07Ssthen os=none 1547933707f3Ssthen ;; 1548933707f3Ssthen *-dec | vax-*) 1549*a3167c07Ssthen os=ultrix4.2 1550933707f3Ssthen ;; 1551933707f3Ssthen m68*-apollo) 1552*a3167c07Ssthen os=domain 1553933707f3Ssthen ;; 1554933707f3Ssthen i386-sun) 1555*a3167c07Ssthen os=sunos4.0.2 1556933707f3Ssthen ;; 1557933707f3Ssthen m68000-sun) 1558*a3167c07Ssthen os=sunos3 1559933707f3Ssthen ;; 1560933707f3Ssthen m68*-cisco) 1561*a3167c07Ssthen os=aout 1562933707f3Ssthen ;; 1563933707f3Ssthen mep-*) 1564*a3167c07Ssthen os=elf 1565933707f3Ssthen ;; 1566933707f3Ssthen mips*-cisco) 1567*a3167c07Ssthen os=elf 1568933707f3Ssthen ;; 1569933707f3Ssthen mips*-*) 1570*a3167c07Ssthen os=elf 1571933707f3Ssthen ;; 1572933707f3Ssthen or32-*) 1573*a3167c07Ssthen os=coff 1574933707f3Ssthen ;; 1575933707f3Ssthen *-tti) # must be before sparc entry or we get the wrong os. 1576*a3167c07Ssthen os=sysv3 1577933707f3Ssthen ;; 1578933707f3Ssthen sparc-* | *-sun) 1579*a3167c07Ssthen os=sunos4.1.1 1580*a3167c07Ssthen ;; 1581*a3167c07Ssthen pru-*) 1582*a3167c07Ssthen os=elf 1583933707f3Ssthen ;; 1584933707f3Ssthen *-be) 1585*a3167c07Ssthen os=beos 1586eaf2578eSsthen ;; 1587933707f3Ssthen *-ibm) 1588*a3167c07Ssthen os=aix 1589933707f3Ssthen ;; 1590933707f3Ssthen *-knuth) 1591*a3167c07Ssthen os=mmixware 1592933707f3Ssthen ;; 1593933707f3Ssthen *-wec) 1594*a3167c07Ssthen os=proelf 1595933707f3Ssthen ;; 1596933707f3Ssthen *-winbond) 1597*a3167c07Ssthen os=proelf 1598933707f3Ssthen ;; 1599933707f3Ssthen *-oki) 1600*a3167c07Ssthen os=proelf 1601933707f3Ssthen ;; 1602933707f3Ssthen *-hp) 1603*a3167c07Ssthen os=hpux 1604933707f3Ssthen ;; 1605933707f3Ssthen *-hitachi) 1606*a3167c07Ssthen os=hiux 1607933707f3Ssthen ;; 1608933707f3Ssthen i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) 1609*a3167c07Ssthen os=sysv 1610933707f3Ssthen ;; 1611933707f3Ssthen *-cbm) 1612*a3167c07Ssthen os=amigaos 1613933707f3Ssthen ;; 1614933707f3Ssthen *-dg) 1615*a3167c07Ssthen os=dgux 1616933707f3Ssthen ;; 1617933707f3Ssthen *-dolphin) 1618*a3167c07Ssthen os=sysv3 1619933707f3Ssthen ;; 1620933707f3Ssthen m68k-ccur) 1621*a3167c07Ssthen os=rtu 1622933707f3Ssthen ;; 1623933707f3Ssthen m88k-omron*) 1624*a3167c07Ssthen os=luna 1625933707f3Ssthen ;; 1626933707f3Ssthen *-next) 1627*a3167c07Ssthen os=nextstep 1628933707f3Ssthen ;; 1629933707f3Ssthen *-sequent) 1630*a3167c07Ssthen os=ptx 1631933707f3Ssthen ;; 1632933707f3Ssthen *-crds) 1633*a3167c07Ssthen os=unos 1634933707f3Ssthen ;; 1635933707f3Ssthen *-ns) 1636*a3167c07Ssthen os=genix 1637933707f3Ssthen ;; 1638933707f3Ssthen i370-*) 1639*a3167c07Ssthen os=mvs 1640eaf2578eSsthen ;; 1641933707f3Ssthen *-gould) 1642*a3167c07Ssthen os=sysv 1643933707f3Ssthen ;; 1644933707f3Ssthen *-highlevel) 1645*a3167c07Ssthen os=bsd 1646933707f3Ssthen ;; 1647933707f3Ssthen *-encore) 1648*a3167c07Ssthen os=bsd 1649933707f3Ssthen ;; 1650933707f3Ssthen *-sgi) 1651*a3167c07Ssthen os=irix 1652933707f3Ssthen ;; 1653933707f3Ssthen *-siemens) 1654*a3167c07Ssthen os=sysv4 1655933707f3Ssthen ;; 1656933707f3Ssthen *-masscomp) 1657*a3167c07Ssthen os=rtu 1658933707f3Ssthen ;; 1659933707f3Ssthen f30[01]-fujitsu | f700-fujitsu) 1660*a3167c07Ssthen os=uxpv 1661933707f3Ssthen ;; 1662933707f3Ssthen *-rom68k) 1663*a3167c07Ssthen os=coff 1664933707f3Ssthen ;; 1665933707f3Ssthen *-*bug) 1666*a3167c07Ssthen os=coff 1667933707f3Ssthen ;; 1668933707f3Ssthen *-apple) 1669*a3167c07Ssthen os=macos 1670933707f3Ssthen ;; 1671933707f3Ssthen *-atari*) 1672*a3167c07Ssthen os=mint 1673*a3167c07Ssthen ;; 1674*a3167c07Ssthen *-wrs) 1675*a3167c07Ssthen os=vxworks 1676933707f3Ssthen ;; 1677933707f3Ssthen *) 1678*a3167c07Ssthen os=none 1679933707f3Ssthen ;; 1680933707f3Ssthenesac 1681*a3167c07Ssthen 1682933707f3Ssthenfi 1683933707f3Ssthen 1684*a3167c07Ssthen# Now, validate our (potentially fixed-up) OS. 1685*a3167c07Ssthencase $os in 1686*a3167c07Ssthen # Sometimes we do "kernel-abi", so those need to count as OSes. 1687*a3167c07Ssthen musl* | newlib* | uclibc*) 1688*a3167c07Ssthen ;; 1689*a3167c07Ssthen # Likewise for "kernel-libc" 1690*a3167c07Ssthen eabi | eabihf | gnueabi | gnueabihf) 1691*a3167c07Ssthen ;; 1692*a3167c07Ssthen # Now accept the basic system types. 1693*a3167c07Ssthen # The portable systems comes first. 1694*a3167c07Ssthen # Each alternative MUST end in a * to match a version number. 1695*a3167c07Ssthen gnu* | android* | bsd* | mach* | minix* | genix* | ultrix* | irix* \ 1696*a3167c07Ssthen | *vms* | esix* | aix* | cnk* | sunos | sunos[34]* \ 1697*a3167c07Ssthen | hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \ 1698*a3167c07Ssthen | sym* | plan9* | psp* | sim* | xray* | os68k* | v88r* \ 1699*a3167c07Ssthen | hiux* | abug | nacl* | netware* | windows* \ 1700*a3167c07Ssthen | os9* | macos* | osx* | ios* \ 1701*a3167c07Ssthen | mpw* | magic* | mmixware* | mon960* | lnews* \ 1702*a3167c07Ssthen | amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \ 1703*a3167c07Ssthen | aos* | aros* | cloudabi* | sortix* | twizzler* \ 1704*a3167c07Ssthen | nindy* | vxsim* | vxworks* | ebmon* | hms* | mvs* \ 1705*a3167c07Ssthen | clix* | riscos* | uniplus* | iris* | isc* | rtu* | xenix* \ 1706*a3167c07Ssthen | mirbsd* | netbsd* | dicos* | openedition* | ose* \ 1707*a3167c07Ssthen | bitrig* | openbsd* | solidbsd* | libertybsd* | os108* \ 1708*a3167c07Ssthen | ekkobsd* | freebsd* | riscix* | lynxos* | os400* \ 1709*a3167c07Ssthen | bosx* | nextstep* | cxux* | aout* | elf* | oabi* \ 1710*a3167c07Ssthen | ptx* | coff* | ecoff* | winnt* | domain* | vsta* \ 1711*a3167c07Ssthen | udi* | lites* | ieee* | go32* | aux* | hcos* \ 1712*a3167c07Ssthen | chorusrdb* | cegcc* | glidix* \ 1713*a3167c07Ssthen | cygwin* | msys* | pe* | moss* | proelf* | rtems* \ 1714*a3167c07Ssthen | midipix* | mingw32* | mingw64* | mint* \ 1715*a3167c07Ssthen | uxpv* | beos* | mpeix* | udk* | moxiebox* \ 1716*a3167c07Ssthen | interix* | uwin* | mks* | rhapsody* | darwin* \ 1717*a3167c07Ssthen | openstep* | oskit* | conix* | pw32* | nonstopux* \ 1718*a3167c07Ssthen | storm-chaos* | tops10* | tenex* | tops20* | its* \ 1719*a3167c07Ssthen | os2* | vos* | palmos* | uclinux* | nucleus* | morphos* \ 1720*a3167c07Ssthen | scout* | superux* | sysv* | rtmk* | tpf* | windiss* \ 1721*a3167c07Ssthen | powermax* | dnix* | nx6 | nx7 | sei* | dragonfly* \ 1722*a3167c07Ssthen | skyos* | haiku* | rdos* | toppers* | drops* | es* \ 1723*a3167c07Ssthen | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \ 1724*a3167c07Ssthen | midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \ 1725*a3167c07Ssthen | nsk* | powerunix* | genode* | zvmoe* ) 1726*a3167c07Ssthen ;; 1727*a3167c07Ssthen # This one is extra strict with allowed versions 1728*a3167c07Ssthen sco3.2v2 | sco3.2v[4-9]* | sco5v6*) 1729*a3167c07Ssthen # Don't forget version if it is 3.2v4 or newer. 1730*a3167c07Ssthen ;; 1731*a3167c07Ssthen none) 1732*a3167c07Ssthen ;; 1733*a3167c07Ssthen *) 1734*a3167c07Ssthen echo Invalid configuration \`"$1"\': OS \`"$os"\' not recognized 1>&2 1735*a3167c07Ssthen exit 1 1736*a3167c07Ssthen ;; 1737*a3167c07Ssthenesac 1738*a3167c07Ssthen 1739*a3167c07Ssthen# As a final step for OS-related things, validate the OS-kernel combination 1740*a3167c07Ssthen# (given a valid OS), if there is a kernel. 1741*a3167c07Ssthencase $kernel-$os in 1742*a3167c07Ssthen linux-gnu* | linux-dietlibc* | linux-android* | linux-newlib* | linux-musl* | linux-uclibc* ) 1743*a3167c07Ssthen ;; 1744*a3167c07Ssthen -dietlibc* | -newlib* | -musl* | -uclibc* ) 1745*a3167c07Ssthen # These are just libc implementations, not actual OSes, and thus 1746*a3167c07Ssthen # require a kernel. 1747*a3167c07Ssthen echo "Invalid configuration \`$1': libc \`$os' needs explicit kernel." 1>&2 1748*a3167c07Ssthen exit 1 1749*a3167c07Ssthen ;; 1750*a3167c07Ssthen kfreebsd*-gnu* | kopensolaris*-gnu*) 1751*a3167c07Ssthen ;; 1752*a3167c07Ssthen nto-qnx*) 1753*a3167c07Ssthen ;; 1754*a3167c07Ssthen *-eabi* | *-gnueabi*) 1755*a3167c07Ssthen ;; 1756*a3167c07Ssthen -*) 1757*a3167c07Ssthen # Blank kernel with real OS is always fine. 1758*a3167c07Ssthen ;; 1759*a3167c07Ssthen *-*) 1760*a3167c07Ssthen echo "Invalid configuration \`$1': Kernel \`$kernel' not known to work with OS \`$os'." 1>&2 1761*a3167c07Ssthen exit 1 1762*a3167c07Ssthen ;; 1763*a3167c07Ssthenesac 1764*a3167c07Ssthen 1765933707f3Ssthen# Here we handle the case where we know the os, and the CPU type, but not the 1766933707f3Ssthen# manufacturer. We pick the logical manufacturer. 1767*a3167c07Ssthencase $vendor in 1768*a3167c07Ssthen unknown) 1769*a3167c07Ssthen case $cpu-$os in 1770*a3167c07Ssthen *-riscix*) 1771933707f3Ssthen vendor=acorn 1772933707f3Ssthen ;; 1773*a3167c07Ssthen *-sunos*) 1774933707f3Ssthen vendor=sun 1775933707f3Ssthen ;; 1776*a3167c07Ssthen *-cnk* | *-aix*) 1777933707f3Ssthen vendor=ibm 1778933707f3Ssthen ;; 1779*a3167c07Ssthen *-beos*) 1780933707f3Ssthen vendor=be 1781933707f3Ssthen ;; 1782*a3167c07Ssthen *-hpux*) 1783933707f3Ssthen vendor=hp 1784933707f3Ssthen ;; 1785*a3167c07Ssthen *-mpeix*) 1786933707f3Ssthen vendor=hp 1787933707f3Ssthen ;; 1788*a3167c07Ssthen *-hiux*) 1789933707f3Ssthen vendor=hitachi 1790933707f3Ssthen ;; 1791*a3167c07Ssthen *-unos*) 1792933707f3Ssthen vendor=crds 1793933707f3Ssthen ;; 1794*a3167c07Ssthen *-dgux*) 1795933707f3Ssthen vendor=dg 1796933707f3Ssthen ;; 1797*a3167c07Ssthen *-luna*) 1798933707f3Ssthen vendor=omron 1799933707f3Ssthen ;; 1800*a3167c07Ssthen *-genix*) 1801933707f3Ssthen vendor=ns 1802933707f3Ssthen ;; 1803*a3167c07Ssthen *-clix*) 1804*a3167c07Ssthen vendor=intergraph 1805*a3167c07Ssthen ;; 1806*a3167c07Ssthen *-mvs* | *-opened*) 1807933707f3Ssthen vendor=ibm 1808933707f3Ssthen ;; 1809*a3167c07Ssthen *-os400*) 1810933707f3Ssthen vendor=ibm 1811933707f3Ssthen ;; 1812*a3167c07Ssthen s390-* | s390x-*) 1813*a3167c07Ssthen vendor=ibm 1814*a3167c07Ssthen ;; 1815*a3167c07Ssthen *-ptx*) 1816933707f3Ssthen vendor=sequent 1817933707f3Ssthen ;; 1818*a3167c07Ssthen *-tpf*) 1819933707f3Ssthen vendor=ibm 1820933707f3Ssthen ;; 1821*a3167c07Ssthen *-vxsim* | *-vxworks* | *-windiss*) 1822933707f3Ssthen vendor=wrs 1823933707f3Ssthen ;; 1824*a3167c07Ssthen *-aux*) 1825933707f3Ssthen vendor=apple 1826933707f3Ssthen ;; 1827*a3167c07Ssthen *-hms*) 1828933707f3Ssthen vendor=hitachi 1829933707f3Ssthen ;; 1830*a3167c07Ssthen *-mpw* | *-macos*) 1831933707f3Ssthen vendor=apple 1832933707f3Ssthen ;; 1833*a3167c07Ssthen *-*mint | *-mint[0-9]* | *-*MiNT | *-MiNT[0-9]*) 1834933707f3Ssthen vendor=atari 1835933707f3Ssthen ;; 1836*a3167c07Ssthen *-vos*) 1837933707f3Ssthen vendor=stratus 1838933707f3Ssthen ;; 1839933707f3Ssthen esac 1840933707f3Ssthen ;; 1841933707f3Ssthenesac 1842933707f3Ssthen 1843*a3167c07Ssthenecho "$cpu-$vendor-${kernel:+$kernel-}$os" 1844933707f3Ssthenexit 1845933707f3Ssthen 1846933707f3Ssthen# Local variables: 1847*a3167c07Ssthen# eval: (add-hook 'before-save-hook 'time-stamp) 1848933707f3Ssthen# time-stamp-start: "timestamp='" 1849933707f3Ssthen# time-stamp-format: "%:y-%02m-%02d" 1850933707f3Ssthen# time-stamp-end: "'" 1851933707f3Ssthen# End: 1852