1 #! /bin/sh
   2 
   3 #
   4 # Copyright (c) 2012, 2021, Oracle and/or its affiliates. All rights reserved.
   5 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   6 #
   7 # This code is free software; you can redistribute it and/or modify it
   8 # under the terms of the GNU General Public License version 2 only, as
   9 # published by the Free Software Foundation.  Oracle designates this
  10 # particular file as subject to the "Classpath" exception as provided
  11 # by Oracle in the LICENSE file that accompanied this code.
  12 #
  13 # This code is distributed in the hope that it will be useful, but WITHOUT
  14 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  15 # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  16 # version 2 for more details (a copy is included in the LICENSE file that
  17 # accompanied this code).
  18 #
  19 # You should have received a copy of the GNU General Public License version
  20 # 2 along with this work; if not, write to the Free Software Foundation,
  21 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  22 #
  23 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  24 # or visit www.oracle.com if you need additional information or have any
  25 # questions.
  26 #
  27 
  28 # Configuration validation subroutine script.
  29 #   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
  30 #   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
  31 #   Free Software Foundation, Inc.
  32 
  33 timestamp='2008-01-16'
  34 
  35 # This file is (in principle) common to ALL GNU software.
  36 # The presence of a machine in this file suggests that SOME GNU software
  37 # can handle that machine.  It does not imply ALL GNU software can.
  38 #
  39 # This file is free software; you can redistribute it and/or modify
  40 # it under the terms of the GNU General Public License as published by
  41 # the Free Software Foundation; either version 2 of the License, or
  42 # (at your option) any later version.
  43 #
  44 # This program is distributed in the hope that it will be useful,
  45 # but WITHOUT ANY WARRANTY; without even the implied warranty of
  46 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  47 # GNU General Public License for more details.
  48 #
  49 # You should have received a copy of the GNU General Public License
  50 # along with this program; if not, write to the Free Software
  51 # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
  52 # 02110-1301, USA.
  53 #
  54 # As a special exception to the GNU General Public License, if you
  55 # distribute this file as part of a program that contains a
  56 # configuration script generated by Autoconf, you may include it under
  57 # the same distribution terms that you use for the rest of that program.
  58 
  59 
  60 # Please send patches to <config-patches@gnu.org>.  Submit a context
  61 # diff and a properly formatted ChangeLog entry.
  62 #
  63 # Configuration subroutine to validate and canonicalize a configuration type.
  64 # Supply the specified configuration type as an argument.
  65 # If it is invalid, we print an error message on stderr and exit with code 1.
  66 # Otherwise, we print the canonical config type on stdout and succeed.
  67 
  68 # This file is supposed to be the same for all GNU packages
  69 # and recognize all the CPU types, system types and aliases
  70 # that are meaningful with *any* GNU software.
  71 # Each package is responsible for reporting which valid configurations
  72 # it does not support.  The user should be able to distinguish
  73 # a failure to support a valid configuration from a meaningless
  74 # configuration.
  75 
  76 # The goal of this file is to map all the various variations of a given
  77 # machine specification into a single specification in the form:
  78 #	CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
  79 # or in some cases, the newer four-part form:
  80 #	CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
  81 # It is wrong to echo any other type of specification.
  82 
  83 me=`echo "$0" | sed -e 's,.*/,,'`
  84 
  85 usage="\
  86 Usage: $0 [OPTION] CPU-MFR-OPSYS
  87        $0 [OPTION] ALIAS
  88 
  89 Canonicalize a configuration name.
  90 
  91 Operation modes:
  92   -h, --help         print this help, then exit
  93   -t, --time-stamp   print date of last modification, then exit
  94   -v, --version      print version number, then exit
  95 
  96 Report bugs and patches to <config-patches@gnu.org>."
  97 
  98 version="\
  99 GNU config.sub ($timestamp)
 100 
 101 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
 102 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
 103 
 104 This is free software; see the source for copying conditions.  There is NO
 105 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
 106 
 107 help="
 108 Try \`$me --help' for more information."
 109 
 110 # Parse command line
 111 while test $# -gt 0 ; do
 112   case $1 in
 113     --time-stamp | --time* | -t )
 114        echo "$timestamp" ; exit ;;
 115     --version | -v )
 116        echo "$version" ; exit ;;
 117     --help | --h* | -h )
 118        echo "$usage"; exit ;;
 119     -- )     # Stop option processing
 120        shift; break ;;
 121     - )	# Use stdin as input.
 122        break ;;
 123     -* )
 124        echo "$me: invalid option $1$help"
 125        exit 1 ;;
 126 
 127     *local*)
 128        # First pass through any local machine types.
 129        echo $1
 130        exit ;;
 131 
 132     * )
 133        break ;;
 134   esac
 135 done
 136 
 137 case $# in
 138  0) echo "$me: missing argument$help" >&2
 139     exit 1;;
 140  1) ;;
 141  *) echo "$me: too many arguments$help" >&2
 142     exit 1;;
 143 esac
 144 
 145 # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
 146 # Here we must recognize all the valid KERNEL-OS combinations.
 147 maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
 148 case $maybe_os in
 149   nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
 150   uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
 151   storm-chaos* | os2-emx* | rtmk-nova*)
 152     os=-$maybe_os
 153     basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
 154     ;;
 155   *)
 156     basic_machine=`echo $1 | sed 's/-[^-]*$//'`
 157     if [ $basic_machine != $1 ]
 158     then os=`echo $1 | sed 's/.*-/-/'`
 159     else os=; fi
 160     ;;
 161 esac
 162 
 163 ### Let's recognize common machines as not being operating systems so
 164 ### that things like config.sub decstation-3100 work.  We also
 165 ### recognize some manufacturers as not being operating systems, so we
 166 ### can provide default operating systems below.
 167 case $os in
 168 	-sun*os*)
 169 		# Prevent following clause from handling this invalid input.
 170 		;;
 171 	-dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
 172 	-att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
 173 	-unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
 174 	-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
 175 	-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
 176 	-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
 177 	-apple | -axis | -knuth | -cray)
 178 		os=
 179 		basic_machine=$1
 180 		;;
 181 	-sim | -cisco | -oki | -wec | -winbond)
 182 		os=
 183 		basic_machine=$1
 184 		;;
 185 	-scout)
 186 		;;
 187 	-wrs)
 188 		os=-vxworks
 189 		basic_machine=$1
 190 		;;
 191 	-chorusos*)
 192 		os=-chorusos
 193 		basic_machine=$1
 194 		;;
 195  	-chorusrdb)
 196  		os=-chorusrdb
 197 		basic_machine=$1
 198  		;;
 199 	-hiux*)
 200 		os=-hiuxwe2
 201 		;;
 202 	-sco6)
 203 		os=-sco5v6
 204 		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
 205 		;;
 206 	-sco5)
 207 		os=-sco3.2v5
 208 		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
 209 		;;
 210 	-sco4)
 211 		os=-sco3.2v4
 212 		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
 213 		;;
 214 	-sco3.2.[4-9]*)
 215 		os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
 216 		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
 217 		;;
 218 	-sco3.2v[4-9]*)
 219 		# Don't forget version if it is 3.2v4 or newer.
 220 		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
 221 		;;
 222 	-sco5v6*)
 223 		# Don't forget version if it is 3.2v4 or newer.
 224 		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
 225 		;;
 226 	-sco*)
 227 		os=-sco3.2v2
 228 		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
 229 		;;
 230 	-udk*)
 231 		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
 232 		;;
 233 	-isc)
 234 		os=-isc2.2
 235 		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
 236 		;;
 237 	-clix*)
 238 		basic_machine=clipper-intergraph
 239 		;;
 240 	-isc*)
 241 		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
 242 		;;
 243 	-lynx*)
 244 		os=-lynxos
 245 		;;
 246 	-ptx*)
 247 		basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
 248 		;;
 249 	-windowsnt*)
 250 		os=`echo $os | sed -e 's/windowsnt/winnt/'`
 251 		;;
 252 	-psos*)
 253 		os=-psos
 254 		;;
 255 	-mint | -mint[0-9]*)
 256 		basic_machine=m68k-atari
 257 		os=-mint
 258 		;;
 259 esac
 260 
 261 # Decode aliases for certain CPU-COMPANY combinations.
 262 case $basic_machine in
 263 	# Recognize the basic CPU types without company name.
 264 	# Some are omitted here because they have special meanings below.
 265 	1750a | 580 \
 266 	| a29k \
 267 	| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
 268 	| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
 269 	| am33_2.0 \
 270 	| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
 271 	| bfin \
 272 	| c4x | clipper \
 273 	| d10v | d30v | dlx | dsp16xx \
 274 	| fido | fr30 | frv \
 275 	| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
 276 	| i370 | i860 | i960 | ia64 \
 277 	| ip2k | iq2000 \
 278 	| m32c | m32r | m32rle | m68000 | m68k | m88k \
 279 	| maxq | mb | microblaze | mcore | mep \
 280 	| mips | mipsbe | mipseb | mipsel | mipsle \
 281 	| mips16 \
 282 	| mips64 | mips64el \
 283 	| mips64vr | mips64vrel \
 284 	| mips64orion | mips64orionel \
 285 	| mips64vr4100 | mips64vr4100el \
 286 	| mips64vr4300 | mips64vr4300el \
 287 	| mips64vr5000 | mips64vr5000el \
 288 	| mips64vr5900 | mips64vr5900el \
 289 	| mipsisa32 | mipsisa32el \
 290 	| mipsisa32r2 | mipsisa32r2el \
 291 	| mipsisa64 | mipsisa64el \
 292 	| mipsisa64r2 | mipsisa64r2el \
 293 	| mipsisa64sb1 | mipsisa64sb1el \
 294 	| mipsisa64sr71k | mipsisa64sr71kel \
 295 	| mipstx39 | mipstx39el \
 296 	| mn10200 | mn10300 \
 297 	| mt \
 298 	| msp430 \
 299 	| nios | nios2 \
 300 	| ns16k | ns32k \
 301 	| or32 \
 302 	| pdp10 | pdp11 | pj | pjl \
 303 	| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
 304 	| pyramid \
 305 	| riscv64 \
 306 	| score \
 307 	| sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
 308 	| sh64 | sh64le \
 309 	| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
 310 	| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
 311 	| spu | strongarm \
 312 	| tahoe | thumb | tic4x | tic80 | tron \
 313 	| v850 | v850e \
 314 	| we32k \
 315 	| x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
 316 	| z8k)
 317 		basic_machine=$basic_machine-unknown
 318 		;;
 319 	m6811 | m68hc11 | m6812 | m68hc12)
 320 		# Motorola 68HC11/12.
 321 		basic_machine=$basic_machine-unknown
 322 		os=-none
 323 		;;
 324 	m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
 325 		;;
 326 	ms1)
 327 		basic_machine=mt-unknown
 328 		;;
 329 
 330 	# We use `pc' rather than `unknown'
 331 	# because (1) that's what they normally are, and
 332 	# (2) the word "unknown" tends to confuse beginning users.
 333 	i*86 | x86_64)
 334 	  basic_machine=$basic_machine-pc
 335 	  ;;
 336 	# Object if more than one company name word.
 337 	*-*-*)
 338 		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
 339 		exit 1
 340 		;;
 341 	# Recognize the basic CPU types with company name.
 342 	580-* \
 343 	| a29k-* \
 344 	| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
 345 	| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
 346 	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
 347 	| arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
 348 	| avr-* | avr32-* \
 349 	| bfin-* | bs2000-* \
 350 	| c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
 351 	| clipper-* | craynv-* | cydra-* \
 352 	| d10v-* | d30v-* | dlx-* \
 353 	| elxsi-* \
 354 	| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
 355 	| h8300-* | h8500-* \
 356 	| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
 357 	| i*86-* | i860-* | i960-* | ia64-* \
 358 	| ip2k-* | iq2000-* \
 359 	| m32c-* | m32r-* | m32rle-* \
 360 	| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
 361 	| m88110-* | m88k-* | maxq-* | mcore-* \
 362 	| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
 363 	| mips16-* \
 364 	| mips64-* | mips64el-* \
 365 	| mips64vr-* | mips64vrel-* \
 366 	| mips64orion-* | mips64orionel-* \
 367 	| mips64vr4100-* | mips64vr4100el-* \
 368 	| mips64vr4300-* | mips64vr4300el-* \
 369 	| mips64vr5000-* | mips64vr5000el-* \
 370 	| mips64vr5900-* | mips64vr5900el-* \
 371 	| mipsisa32-* | mipsisa32el-* \
 372 	| mipsisa32r2-* | mipsisa32r2el-* \
 373 	| mipsisa64-* | mipsisa64el-* \
 374 	| mipsisa64r2-* | mipsisa64r2el-* \
 375 	| mipsisa64sb1-* | mipsisa64sb1el-* \
 376 	| mipsisa64sr71k-* | mipsisa64sr71kel-* \
 377 	| mipstx39-* | mipstx39el-* \
 378 	| mmix-* \
 379 	| mt-* \
 380 	| msp430-* \
 381 	| nios-* | nios2-* \
 382 	| none-* | np1-* | ns16k-* | ns32k-* \
 383 	| orion-* \
 384 	| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
 385 	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
 386 	| pyramid-* \
 387 	| riscv64-* \
 388 	| romp-* | rs6000-* \
 389 	| sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
 390 	| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
 391 	| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
 392 	| sparclite-* \
 393 	| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
 394 	| tahoe-* | thumb-* \
 395 	| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
 396 	| tron-* \
 397 	| v850-* | v850e-* | vax-* \
 398 	| we32k-* \
 399 	| x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
 400 	| xstormy16-* | xtensa*-* \
 401 	| ymp-* \
 402 	| z8k-*)
 403 		;;
 404 	# Recognize the basic CPU types without company name, with glob match.
 405 	xtensa*)
 406 		basic_machine=$basic_machine-unknown
 407 		;;
 408 	# Recognize the various machine names and aliases which stand
 409 	# for a CPU type and a company and sometimes even an OS.
 410 	386bsd)
 411 		basic_machine=i386-unknown
 412 		os=-bsd
 413 		;;
 414 	3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
 415 		basic_machine=m68000-att
 416 		;;
 417 	3b*)
 418 		basic_machine=we32k-att
 419 		;;
 420 	a29khif)
 421 		basic_machine=a29k-amd
 422 		os=-udi
 423 		;;
 424     	abacus)
 425 		basic_machine=abacus-unknown
 426 		;;
 427 	adobe68k)
 428 		basic_machine=m68010-adobe
 429 		os=-scout
 430 		;;
 431 	alliant | fx80)
 432 		basic_machine=fx80-alliant
 433 		;;
 434 	altos | altos3068)
 435 		basic_machine=m68k-altos
 436 		;;
 437 	am29k)
 438 		basic_machine=a29k-none
 439 		os=-bsd
 440 		;;
 441 	amd64)
 442 		basic_machine=x86_64-pc
 443 		;;
 444 	amd64-*)
 445 		basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
 446 		;;
 447 	amdahl)
 448 		basic_machine=580-amdahl
 449 		os=-sysv
 450 		;;
 451 	amiga | amiga-*)
 452 		basic_machine=m68k-unknown
 453 		;;
 454 	amigaos | amigados)
 455 		basic_machine=m68k-unknown
 456 		os=-amigaos
 457 		;;
 458 	amigaunix | amix)
 459 		basic_machine=m68k-unknown
 460 		os=-sysv4
 461 		;;
 462 	apollo68)
 463 		basic_machine=m68k-apollo
 464 		os=-sysv
 465 		;;
 466 	apollo68bsd)
 467 		basic_machine=m68k-apollo
 468 		os=-bsd
 469 		;;
 470 	aux)
 471 		basic_machine=m68k-apple
 472 		os=-aux
 473 		;;
 474 	balance)
 475 		basic_machine=ns32k-sequent
 476 		os=-dynix
 477 		;;
 478 	blackfin)
 479 		basic_machine=bfin-unknown
 480 		os=-linux
 481 		;;
 482 	blackfin-*)
 483 		basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
 484 		os=-linux
 485 		;;
 486 	c90)
 487 		basic_machine=c90-cray
 488 		os=-unicos
 489 		;;
 490 	convex-c1)
 491 		basic_machine=c1-convex
 492 		os=-bsd
 493 		;;
 494 	convex-c2)
 495 		basic_machine=c2-convex
 496 		os=-bsd
 497 		;;
 498 	convex-c32)
 499 		basic_machine=c32-convex
 500 		os=-bsd
 501 		;;
 502 	convex-c34)
 503 		basic_machine=c34-convex
 504 		os=-bsd
 505 		;;
 506 	convex-c38)
 507 		basic_machine=c38-convex
 508 		os=-bsd
 509 		;;
 510 	cray | j90)
 511 		basic_machine=j90-cray
 512 		os=-unicos
 513 		;;
 514 	craynv)
 515 		basic_machine=craynv-cray
 516 		os=-unicosmp
 517 		;;
 518 	cr16)
 519 		basic_machine=cr16-unknown
 520 		os=-elf
 521 		;;
 522 	crds | unos)
 523 		basic_machine=m68k-crds
 524 		;;
 525 	crisv32 | crisv32-* | etraxfs*)
 526 		basic_machine=crisv32-axis
 527 		;;
 528 	cris | cris-* | etrax*)
 529 		basic_machine=cris-axis
 530 		;;
 531 	crx)
 532 		basic_machine=crx-unknown
 533 		os=-elf
 534 		;;
 535 	da30 | da30-*)
 536 		basic_machine=m68k-da30
 537 		;;
 538 	decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
 539 		basic_machine=mips-dec
 540 		;;
 541 	decsystem10* | dec10*)
 542 		basic_machine=pdp10-dec
 543 		os=-tops10
 544 		;;
 545 	decsystem20* | dec20*)
 546 		basic_machine=pdp10-dec
 547 		os=-tops20
 548 		;;
 549 	delta | 3300 | motorola-3300 | motorola-delta \
 550 	      | 3300-motorola | delta-motorola)
 551 		basic_machine=m68k-motorola
 552 		;;
 553 	delta88)
 554 		basic_machine=m88k-motorola
 555 		os=-sysv3
 556 		;;
 557 	djgpp)
 558 		basic_machine=i586-pc
 559 		os=-msdosdjgpp
 560 		;;
 561 	dpx20 | dpx20-*)
 562 		basic_machine=rs6000-bull
 563 		os=-bosx
 564 		;;
 565 	dpx2* | dpx2*-bull)
 566 		basic_machine=m68k-bull
 567 		os=-sysv3
 568 		;;
 569 	ebmon29k)
 570 		basic_machine=a29k-amd
 571 		os=-ebmon
 572 		;;
 573 	elxsi)
 574 		basic_machine=elxsi-elxsi
 575 		os=-bsd
 576 		;;
 577 	encore | umax | mmax)
 578 		basic_machine=ns32k-encore
 579 		;;
 580 	es1800 | OSE68k | ose68k | ose | OSE)
 581 		basic_machine=m68k-ericsson
 582 		os=-ose
 583 		;;
 584 	fx2800)
 585 		basic_machine=i860-alliant
 586 		;;
 587 	genix)
 588 		basic_machine=ns32k-ns
 589 		;;
 590 	gmicro)
 591 		basic_machine=tron-gmicro
 592 		os=-sysv
 593 		;;
 594 	go32)
 595 		basic_machine=i386-pc
 596 		os=-go32
 597 		;;
 598 	h3050r* | hiux*)
 599 		basic_machine=hppa1.1-hitachi
 600 		os=-hiuxwe2
 601 		;;
 602 	h8300hms)
 603 		basic_machine=h8300-hitachi
 604 		os=-hms
 605 		;;
 606 	h8300xray)
 607 		basic_machine=h8300-hitachi
 608 		os=-xray
 609 		;;
 610 	h8500hms)
 611 		basic_machine=h8500-hitachi
 612 		os=-hms
 613 		;;
 614 	harris)
 615 		basic_machine=m88k-harris
 616 		os=-sysv3
 617 		;;
 618 	hp300-*)
 619 		basic_machine=m68k-hp
 620 		;;
 621 	hp300bsd)
 622 		basic_machine=m68k-hp
 623 		os=-bsd
 624 		;;
 625 	hp300hpux)
 626 		basic_machine=m68k-hp
 627 		os=-hpux
 628 		;;
 629 	hp3k9[0-9][0-9] | hp9[0-9][0-9])
 630 		basic_machine=hppa1.0-hp
 631 		;;
 632 	hp9k2[0-9][0-9] | hp9k31[0-9])
 633 		basic_machine=m68000-hp
 634 		;;
 635 	hp9k3[2-9][0-9])
 636 		basic_machine=m68k-hp
 637 		;;
 638 	hp9k6[0-9][0-9] | hp6[0-9][0-9])
 639 		basic_machine=hppa1.0-hp
 640 		;;
 641 	hp9k7[0-79][0-9] | hp7[0-79][0-9])
 642 		basic_machine=hppa1.1-hp
 643 		;;
 644 	hp9k78[0-9] | hp78[0-9])
 645 		# FIXME: really hppa2.0-hp
 646 		basic_machine=hppa1.1-hp
 647 		;;
 648 	hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
 649 		# FIXME: really hppa2.0-hp
 650 		basic_machine=hppa1.1-hp
 651 		;;
 652 	hp9k8[0-9][13679] | hp8[0-9][13679])
 653 		basic_machine=hppa1.1-hp
 654 		;;
 655 	hp9k8[0-9][0-9] | hp8[0-9][0-9])
 656 		basic_machine=hppa1.0-hp
 657 		;;
 658 	hppa-next)
 659 		os=-nextstep3
 660 		;;
 661 	hppaosf)
 662 		basic_machine=hppa1.1-hp
 663 		os=-osf
 664 		;;
 665 	hppro)
 666 		basic_machine=hppa1.1-hp
 667 		os=-proelf
 668 		;;
 669 	i370-ibm* | ibm*)
 670 		basic_machine=i370-ibm
 671 		;;
 672 # I'm not sure what "Sysv32" means.  Should this be sysv3.2?
 673 	i*86v32)
 674 		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
 675 		os=-sysv32
 676 		;;
 677 	i*86v4*)
 678 		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
 679 		os=-sysv4
 680 		;;
 681 	i*86v)
 682 		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
 683 		os=-sysv
 684 		;;
 685 	i*86sol2)
 686 		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
 687 		os=-solaris2
 688 		;;
 689 	i386mach)
 690 		basic_machine=i386-mach
 691 		os=-mach
 692 		;;
 693 	i386-vsta | vsta)
 694 		basic_machine=i386-unknown
 695 		os=-vsta
 696 		;;
 697 	iris | iris4d)
 698 		basic_machine=mips-sgi
 699 		case $os in
 700 		    -irix*)
 701 			;;
 702 		    *)
 703 			os=-irix4
 704 			;;
 705 		esac
 706 		;;
 707 	isi68 | isi)
 708 		basic_machine=m68k-isi
 709 		os=-sysv
 710 		;;
 711 	m68knommu)
 712 		basic_machine=m68k-unknown
 713 		os=-linux
 714 		;;
 715 	m68knommu-*)
 716 		basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
 717 		os=-linux
 718 		;;
 719 	m88k-omron*)
 720 		basic_machine=m88k-omron
 721 		;;
 722 	magnum | m3230)
 723 		basic_machine=mips-mips
 724 		os=-sysv
 725 		;;
 726 	merlin)
 727 		basic_machine=ns32k-utek
 728 		os=-sysv
 729 		;;
 730 	mingw32)
 731 		basic_machine=i386-pc
 732 		os=-mingw32
 733 		;;
 734 	mingw32ce)
 735 		basic_machine=arm-unknown
 736 		os=-mingw32ce
 737 		;;
 738 	miniframe)
 739 		basic_machine=m68000-convergent
 740 		;;
 741 	*mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
 742 		basic_machine=m68k-atari
 743 		os=-mint
 744 		;;
 745 	mips3*-*)
 746 		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
 747 		;;
 748 	mips3*)
 749 		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
 750 		;;
 751 	monitor)
 752 		basic_machine=m68k-rom68k
 753 		os=-coff
 754 		;;
 755 	morphos)
 756 		basic_machine=powerpc-unknown
 757 		os=-morphos
 758 		;;
 759 	msdos)
 760 		basic_machine=i386-pc
 761 		os=-msdos
 762 		;;
 763 	ms1-*)
 764 		basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
 765 		;;
 766 	mvs)
 767 		basic_machine=i370-ibm
 768 		os=-mvs
 769 		;;
 770 	ncr3000)
 771 		basic_machine=i486-ncr
 772 		os=-sysv4
 773 		;;
 774 	netbsd386)
 775 		basic_machine=i386-unknown
 776 		os=-netbsd
 777 		;;
 778 	netwinder)
 779 		basic_machine=armv4l-rebel
 780 		os=-linux
 781 		;;
 782 	news | news700 | news800 | news900)
 783 		basic_machine=m68k-sony
 784 		os=-newsos
 785 		;;
 786 	news1000)
 787 		basic_machine=m68030-sony
 788 		os=-newsos
 789 		;;
 790 	news-3600 | risc-news)
 791 		basic_machine=mips-sony
 792 		os=-newsos
 793 		;;
 794 	necv70)
 795 		basic_machine=v70-nec
 796 		os=-sysv
 797 		;;
 798 	next | m*-next )
 799 		basic_machine=m68k-next
 800 		case $os in
 801 		    -nextstep* )
 802 			;;
 803 		    -ns2*)
 804 		      os=-nextstep2
 805 			;;
 806 		    *)
 807 		      os=-nextstep3
 808 			;;
 809 		esac
 810 		;;
 811 	nh3000)
 812 		basic_machine=m68k-harris
 813 		os=-cxux
 814 		;;
 815 	nh[45]000)
 816 		basic_machine=m88k-harris
 817 		os=-cxux
 818 		;;
 819 	nindy960)
 820 		basic_machine=i960-intel
 821 		os=-nindy
 822 		;;
 823 	mon960)
 824 		basic_machine=i960-intel
 825 		os=-mon960
 826 		;;
 827 	nonstopux)
 828 		basic_machine=mips-compaq
 829 		os=-nonstopux
 830 		;;
 831 	np1)
 832 		basic_machine=np1-gould
 833 		;;
 834 	nsr-tandem)
 835 		basic_machine=nsr-tandem
 836 		;;
 837 	op50n-* | op60c-*)
 838 		basic_machine=hppa1.1-oki
 839 		os=-proelf
 840 		;;
 841 	openrisc | openrisc-*)
 842 		basic_machine=or32-unknown
 843 		;;
 844 	os400)
 845 		basic_machine=powerpc-ibm
 846 		os=-os400
 847 		;;
 848 	OSE68000 | ose68000)
 849 		basic_machine=m68000-ericsson
 850 		os=-ose
 851 		;;
 852 	os68k)
 853 		basic_machine=m68k-none
 854 		os=-os68k
 855 		;;
 856 	pa-hitachi)
 857 		basic_machine=hppa1.1-hitachi
 858 		os=-hiuxwe2
 859 		;;
 860 	paragon)
 861 		basic_machine=i860-intel
 862 		os=-osf
 863 		;;
 864 	parisc)
 865 		basic_machine=hppa-unknown
 866 		os=-linux
 867 		;;
 868 	parisc-*)
 869 		basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
 870 		os=-linux
 871 		;;
 872 	pbd)
 873 		basic_machine=sparc-tti
 874 		;;
 875 	pbb)
 876 		basic_machine=m68k-tti
 877 		;;
 878 	pc532 | pc532-*)
 879 		basic_machine=ns32k-pc532
 880 		;;
 881 	pc98)
 882 		basic_machine=i386-pc
 883 		;;
 884 	pc98-*)
 885 		basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
 886 		;;
 887 	pentium | p5 | k5 | k6 | nexgen | viac3)
 888 		basic_machine=i586-pc
 889 		;;
 890 	pentiumpro | p6 | 6x86 | athlon | athlon_*)
 891 		basic_machine=i686-pc
 892 		;;
 893 	pentiumii | pentium2 | pentiumiii | pentium3)
 894 		basic_machine=i686-pc
 895 		;;
 896 	pentium4)
 897 		basic_machine=i786-pc
 898 		;;
 899 	pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
 900 		basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
 901 		;;
 902 	pentiumpro-* | p6-* | 6x86-* | athlon-*)
 903 		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
 904 		;;
 905 	pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
 906 		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
 907 		;;
 908 	pentium4-*)
 909 		basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
 910 		;;
 911 	pn)
 912 		basic_machine=pn-gould
 913 		;;
 914 	power)	basic_machine=power-ibm
 915 		;;
 916 	ppc)	basic_machine=powerpc-unknown
 917 		;;
 918 	ppc-*)	basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
 919 		;;
 920 	ppcle | powerpclittle | ppc-le | powerpc-little)
 921 		basic_machine=powerpcle-unknown
 922 		;;
 923 	ppcle-* | powerpclittle-*)
 924 		basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
 925 		;;
 926 	ppc64)	basic_machine=powerpc64-unknown
 927 		;;
 928 	ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
 929 		;;
 930 	ppc64le | powerpc64little | ppc64-le | powerpc64-little)
 931 		basic_machine=powerpc64le-unknown
 932 		;;
 933 	ppc64le-* | powerpc64little-*)
 934 		basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
 935 		;;
 936 	ps2)
 937 		basic_machine=i386-ibm
 938 		;;
 939 	pw32)
 940 		basic_machine=i586-unknown
 941 		os=-pw32
 942 		;;
 943 	rdos)
 944 		basic_machine=i386-pc
 945 		os=-rdos
 946 		;;
 947 	rom68k)
 948 		basic_machine=m68k-rom68k
 949 		os=-coff
 950 		;;
 951 	rm[46]00)
 952 		basic_machine=mips-siemens
 953 		;;
 954 	rtpc | rtpc-*)
 955 		basic_machine=romp-ibm
 956 		;;
 957 	s390 | s390-*)
 958 		basic_machine=s390-ibm
 959 		;;
 960 	s390x | s390x-*)
 961 		basic_machine=s390x-ibm
 962 		;;
 963 	sa29200)
 964 		basic_machine=a29k-amd
 965 		os=-udi
 966 		;;
 967 	sb1)
 968 		basic_machine=mipsisa64sb1-unknown
 969 		;;
 970 	sb1el)
 971 		basic_machine=mipsisa64sb1el-unknown
 972 		;;
 973 	sde)
 974 		basic_machine=mipsisa32-sde
 975 		os=-elf
 976 		;;
 977 	sei)
 978 		basic_machine=mips-sei
 979 		os=-seiux
 980 		;;
 981 	sequent)
 982 		basic_machine=i386-sequent
 983 		;;
 984 	sh)
 985 		basic_machine=sh-hitachi
 986 		os=-hms
 987 		;;
 988 	sh5el)
 989 		basic_machine=sh5le-unknown
 990 		;;
 991 	sh64)
 992 		basic_machine=sh64-unknown
 993 		;;
 994 	sparclite-wrs | simso-wrs)
 995 		basic_machine=sparclite-wrs
 996 		os=-vxworks
 997 		;;
 998 	sps7)
 999 		basic_machine=m68k-bull
1000 		os=-sysv2
1001 		;;
1002 	spur)
1003 		basic_machine=spur-unknown
1004 		;;
1005 	st2000)
1006 		basic_machine=m68k-tandem
1007 		;;
1008 	stratus)
1009 		basic_machine=i860-stratus
1010 		os=-sysv4
1011 		;;
1012 	sun2)
1013 		basic_machine=m68000-sun
1014 		;;
1015 	sun2os3)
1016 		basic_machine=m68000-sun
1017 		os=-sunos3
1018 		;;
1019 	sun2os4)
1020 		basic_machine=m68000-sun
1021 		os=-sunos4
1022 		;;
1023 	sun3os3)
1024 		basic_machine=m68k-sun
1025 		os=-sunos3
1026 		;;
1027 	sun3os4)
1028 		basic_machine=m68k-sun
1029 		os=-sunos4
1030 		;;
1031 	sun4os3)
1032 		basic_machine=sparc-sun
1033 		os=-sunos3
1034 		;;
1035 	sun4os4)
1036 		basic_machine=sparc-sun
1037 		os=-sunos4
1038 		;;
1039 	sun4sol2)
1040 		basic_machine=sparc-sun
1041 		os=-solaris2
1042 		;;
1043 	sun3 | sun3-*)
1044 		basic_machine=m68k-sun
1045 		;;
1046 	sun4)
1047 		basic_machine=sparc-sun
1048 		;;
1049 	sun386 | sun386i | roadrunner)
1050 		basic_machine=i386-sun
1051 		;;
1052 	sv1)
1053 		basic_machine=sv1-cray
1054 		os=-unicos
1055 		;;
1056 	symmetry)
1057 		basic_machine=i386-sequent
1058 		os=-dynix
1059 		;;
1060 	t3e)
1061 		basic_machine=alphaev5-cray
1062 		os=-unicos
1063 		;;
1064 	t90)
1065 		basic_machine=t90-cray
1066 		os=-unicos
1067 		;;
1068 	tic54x | c54x*)
1069 		basic_machine=tic54x-unknown
1070 		os=-coff
1071 		;;
1072 	tic55x | c55x*)
1073 		basic_machine=tic55x-unknown
1074 		os=-coff
1075 		;;
1076 	tic6x | c6x*)
1077 		basic_machine=tic6x-unknown
1078 		os=-coff
1079 		;;
1080 	tile*)
1081 		basic_machine=tile-unknown
1082 		os=-linux-gnu
1083 		;;
1084 	tx39)
1085 		basic_machine=mipstx39-unknown
1086 		;;
1087 	tx39el)
1088 		basic_machine=mipstx39el-unknown
1089 		;;
1090 	toad1)
1091 		basic_machine=pdp10-xkl
1092 		os=-tops20
1093 		;;
1094 	tower | tower-32)
1095 		basic_machine=m68k-ncr
1096 		;;
1097 	tpf)
1098 		basic_machine=s390x-ibm
1099 		os=-tpf
1100 		;;
1101 	udi29k)
1102 		basic_machine=a29k-amd
1103 		os=-udi
1104 		;;
1105 	ultra3)
1106 		basic_machine=a29k-nyu
1107 		os=-sym1
1108 		;;
1109 	v810 | necv810)
1110 		basic_machine=v810-nec
1111 		os=-none
1112 		;;
1113 	vaxv)
1114 		basic_machine=vax-dec
1115 		os=-sysv
1116 		;;
1117 	vms)
1118 		basic_machine=vax-dec
1119 		os=-vms
1120 		;;
1121 	vpp*|vx|vx-*)
1122 		basic_machine=f301-fujitsu
1123 		;;
1124 	vxworks960)
1125 		basic_machine=i960-wrs
1126 		os=-vxworks
1127 		;;
1128 	vxworks68)
1129 		basic_machine=m68k-wrs
1130 		os=-vxworks
1131 		;;
1132 	vxworks29k)
1133 		basic_machine=a29k-wrs
1134 		os=-vxworks
1135 		;;
1136 	w65*)
1137 		basic_machine=w65-wdc
1138 		os=-none
1139 		;;
1140 	w89k-*)
1141 		basic_machine=hppa1.1-winbond
1142 		os=-proelf
1143 		;;
1144 	xbox)
1145 		basic_machine=i686-pc
1146 		os=-mingw32
1147 		;;
1148 	xps | xps100)
1149 		basic_machine=xps100-honeywell
1150 		;;
1151 	ymp)
1152 		basic_machine=ymp-cray
1153 		os=-unicos
1154 		;;
1155 	z8k-*-coff)
1156 		basic_machine=z8k-unknown
1157 		os=-sim
1158 		;;
1159 	none)
1160 		basic_machine=none-none
1161 		os=-none
1162 		;;
1163 
1164 # Here we handle the default manufacturer of certain CPU types.  It is in
1165 # some cases the only manufacturer, in others, it is the most popular.
1166 	w89k)
1167 		basic_machine=hppa1.1-winbond
1168 		;;
1169 	op50n)
1170 		basic_machine=hppa1.1-oki
1171 		;;
1172 	op60c)
1173 		basic_machine=hppa1.1-oki
1174 		;;
1175 	romp)
1176 		basic_machine=romp-ibm
1177 		;;
1178 	mmix)
1179 		basic_machine=mmix-knuth
1180 		;;
1181 	rs6000)
1182 		basic_machine=rs6000-ibm
1183 		;;
1184 	vax)
1185 		basic_machine=vax-dec
1186 		;;
1187 	pdp10)
1188 		# there are many clones, so DEC is not a safe bet
1189 		basic_machine=pdp10-unknown
1190 		;;
1191 	pdp11)
1192 		basic_machine=pdp11-dec
1193 		;;
1194 	we32k)
1195 		basic_machine=we32k-att
1196 		;;
1197 	sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele)
1198 		basic_machine=sh-unknown
1199 		;;
1200 	sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
1201 		basic_machine=sparc-sun
1202 		;;
1203 	cydra)
1204 		basic_machine=cydra-cydrome
1205 		;;
1206 	orion)
1207 		basic_machine=orion-highlevel
1208 		;;
1209 	orion105)
1210 		basic_machine=clipper-highlevel
1211 		;;
1212 	mac | mpw | mac-mpw)
1213 		basic_machine=m68k-apple
1214 		;;
1215 	pmac | pmac-mpw)
1216 		basic_machine=powerpc-apple
1217 		;;
1218 	*-unknown)
1219 		# Make sure to match an already-canonicalized machine name.
1220 		;;
1221 	*)
1222 		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
1223 		exit 1
1224 		;;
1225 esac
1226 
1227 # Here we canonicalize certain aliases for manufacturers.
1228 case $basic_machine in
1229 	*-digital*)
1230 		basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
1231 		;;
1232 	*-commodore*)
1233 		basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
1234 		;;
1235 	*)
1236 		;;
1237 esac
1238 
1239 # Decode manufacturer-specific aliases for certain operating systems.
1240 
1241 if [ x"$os" != x"" ]
1242 then
1243 case $os in
1244         # First match some system type aliases
1245         # that might get confused with valid system types.
1246 	# -solaris* is a basic system type, with this one exception.
1247 	-solaris1 | -solaris1.*)
1248 		os=`echo $os | sed -e 's|solaris1|sunos4|'`
1249 		;;
1250 	-solaris)
1251 		os=-solaris2
1252 		;;
1253 	-svr4*)
1254 		os=-sysv4
1255 		;;
1256 	-unixware*)
1257 		os=-sysv4.2uw
1258 		;;
1259 	-gnu/linux*)
1260 		os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
1261 		;;
1262 	# First accept the basic system types.
1263 	# The portable systems comes first.
1264 	# Each alternative MUST END IN A *, to match a version number.
1265 	# -sysv* is not here because it comes later, after sysvr4.
1266 	-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
1267 	      | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
1268 	      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
1269 	      | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
1270 	      | -aos* \
1271 	      | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
1272 	      | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
1273 	      | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
1274 	      | -openbsd* | -solidbsd* \
1275 	      | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
1276 	      | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
1277 	      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
1278 	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
1279 	      | -chorusos* | -chorusrdb* \
1280 	      | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
1281 	      | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
1282 	      | -uxpv* | -beos* | -mpeix* | -udk* \
1283 	      | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
1284 	      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
1285 	      | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
1286 	      | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
1287 	      | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
1288 	      | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
1289 	      | -skyos* | -haiku* | -rdos* | -toppers* | -drops*)
1290 	# Remember, each alternative MUST END IN *, to match a version number.
1291 		;;
1292 	-qnx*)
1293 		case $basic_machine in
1294 		    x86-* | i*86-*)
1295 			;;
1296 		    *)
1297 			os=-nto$os
1298 			;;
1299 		esac
1300 		;;
1301 	-nto-qnx*)
1302 		;;
1303 	-nto*)
1304 		os=`echo $os | sed -e 's|nto|nto-qnx|'`
1305 		;;
1306 	-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
1307 	      | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
1308 	      | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
1309 		;;
1310 	-mac*)
1311 		os=`echo $os | sed -e 's|mac|macos|'`
1312 		;;
1313 	-linux-dietlibc)
1314 		os=-linux-dietlibc
1315 		;;
1316 	-linux*)
1317 		os=`echo $os | sed -e 's|linux|linux-gnu|'`
1318 		;;
1319 	-sunos5*)
1320 		os=`echo $os | sed -e 's|sunos5|solaris2|'`
1321 		;;
1322 	-sunos6*)
1323 		os=`echo $os | sed -e 's|sunos6|solaris3|'`
1324 		;;
1325 	-opened*)
1326 		os=-openedition
1327 		;;
1328         -os400*)
1329 		os=-os400
1330 		;;
1331 	-wince*)
1332 		os=-wince
1333 		;;
1334 	-osfrose*)
1335 		os=-osfrose
1336 		;;
1337 	-osf*)
1338 		os=-osf
1339 		;;
1340 	-utek*)
1341 		os=-bsd
1342 		;;
1343 	-dynix*)
1344 		os=-bsd
1345 		;;
1346 	-acis*)
1347 		os=-aos
1348 		;;
1349 	-atheos*)
1350 		os=-atheos
1351 		;;
1352 	-syllable*)
1353 		os=-syllable
1354 		;;
1355 	-386bsd)
1356 		os=-bsd
1357 		;;
1358 	-ctix* | -uts*)
1359 		os=-sysv
1360 		;;
1361 	-nova*)
1362 		os=-rtmk-nova
1363 		;;
1364 	-ns2 )
1365 		os=-nextstep2
1366 		;;
1367 	-nsk*)
1368 		os=-nsk
1369 		;;
1370 	# Preserve the version number of sinix5.
1371 	-sinix5.*)
1372 		os=`echo $os | sed -e 's|sinix|sysv|'`
1373 		;;
1374 	-sinix*)
1375 		os=-sysv4
1376 		;;
1377         -tpf*)
1378 		os=-tpf
1379 		;;
1380 	-triton*)
1381 		os=-sysv3
1382 		;;
1383 	-oss*)
1384 		os=-sysv3
1385 		;;
1386 	-svr4)
1387 		os=-sysv4
1388 		;;
1389 	-svr3)
1390 		os=-sysv3
1391 		;;
1392 	-sysvr4)
1393 		os=-sysv4
1394 		;;
1395 	# This must come after -sysvr4.
1396 	-sysv*)
1397 		;;
1398 	-ose*)
1399 		os=-ose
1400 		;;
1401 	-es1800*)
1402 		os=-ose
1403 		;;
1404 	-xenix)
1405 		os=-xenix
1406 		;;
1407 	-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
1408 		os=-mint
1409 		;;
1410 	-aros*)
1411 		os=-aros
1412 		;;
1413 	-kaos*)
1414 		os=-kaos
1415 		;;
1416 	-zvmoe)
1417 		os=-zvmoe
1418 		;;
1419 	-none)
1420 		;;
1421 	*)
1422 		# Get rid of the `-' at the beginning of $os.
1423 		os=`echo $os | sed 's/[^-]*-//'`
1424 		echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
1425 		exit 1
1426 		;;
1427 esac
1428 else
1429 
1430 # Here we handle the default operating systems that come with various machines.
1431 # The value should be what the vendor currently ships out the door with their
1432 # machine or put another way, the most popular os provided with the machine.
1433 
1434 # Note that if you're going to try to match "-MANUFACTURER" here (say,
1435 # "-sun"), then you have to tell the case statement up towards the top
1436 # that MANUFACTURER isn't an operating system.  Otherwise, code above
1437 # will signal an error saying that MANUFACTURER isn't an operating
1438 # system, and we'll never get to this point.
1439 
1440 case $basic_machine in
1441         score-*)
1442 		os=-elf
1443 		;;
1444         spu-*)
1445 		os=-elf
1446 		;;
1447 	*-acorn)
1448 		os=-riscix1.2
1449 		;;
1450 	arm*-rebel)
1451 		os=-linux
1452 		;;
1453 	arm*-semi)
1454 		os=-aout
1455 		;;
1456         c4x-* | tic4x-*)
1457         	os=-coff
1458 		;;
1459 	# This must come before the *-dec entry.
1460 	pdp10-*)
1461 		os=-tops20
1462 		;;
1463 	pdp11-*)
1464 		os=-none
1465 		;;
1466 	*-dec | vax-*)
1467 		os=-ultrix4.2
1468 		;;
1469 	m68*-apollo)
1470 		os=-domain
1471 		;;
1472 	i386-sun)
1473 		os=-sunos4.0.2
1474 		;;
1475 	m68000-sun)
1476 		os=-sunos3
1477 		# This also exists in the configure program, but was not the
1478 		# default.
1479 		# os=-sunos4
1480 		;;
1481 	m68*-cisco)
1482 		os=-aout
1483 		;;
1484         mep-*)
1485 		os=-elf
1486 		;;
1487 	mips*-cisco)
1488 		os=-elf
1489 		;;
1490 	mips*-*)
1491 		os=-elf
1492 		;;
1493 	or32-*)
1494 		os=-coff
1495 		;;
1496 	*-tti)	# must be before sparc entry or we get the wrong os.
1497 		os=-sysv3
1498 		;;
1499 	sparc-* | *-sun)
1500 		os=-sunos4.1.1
1501 		;;
1502 	*-be)
1503 		os=-beos
1504 		;;
1505 	*-haiku)
1506 		os=-haiku
1507 		;;
1508 	*-ibm)
1509 		os=-aix
1510 		;;
1511     	*-knuth)
1512 		os=-mmixware
1513 		;;
1514 	*-wec)
1515 		os=-proelf
1516 		;;
1517 	*-winbond)
1518 		os=-proelf
1519 		;;
1520 	*-oki)
1521 		os=-proelf
1522 		;;
1523 	*-hp)
1524 		os=-hpux
1525 		;;
1526 	*-hitachi)
1527 		os=-hiux
1528 		;;
1529 	i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
1530 		os=-sysv
1531 		;;
1532 	*-cbm)
1533 		os=-amigaos
1534 		;;
1535 	*-dg)
1536 		os=-dgux
1537 		;;
1538 	*-dolphin)
1539 		os=-sysv3
1540 		;;
1541 	m68k-ccur)
1542 		os=-rtu
1543 		;;
1544 	m88k-omron*)
1545 		os=-luna
1546 		;;
1547 	*-next )
1548 		os=-nextstep
1549 		;;
1550 	*-sequent)
1551 		os=-ptx
1552 		;;
1553 	*-crds)
1554 		os=-unos
1555 		;;
1556 	*-ns)
1557 		os=-genix
1558 		;;
1559 	i370-*)
1560 		os=-mvs
1561 		;;
1562 	*-next)
1563 		os=-nextstep3
1564 		;;
1565 	*-gould)
1566 		os=-sysv
1567 		;;
1568 	*-highlevel)
1569 		os=-bsd
1570 		;;
1571 	*-encore)
1572 		os=-bsd
1573 		;;
1574 	*-sgi)
1575 		os=-irix
1576 		;;
1577 	*-siemens)
1578 		os=-sysv4
1579 		;;
1580 	*-masscomp)
1581 		os=-rtu
1582 		;;
1583 	f30[01]-fujitsu | f700-fujitsu)
1584 		os=-uxpv
1585 		;;
1586 	*-rom68k)
1587 		os=-coff
1588 		;;
1589 	*-*bug)
1590 		os=-coff
1591 		;;
1592 	*-apple)
1593 		os=-macos
1594 		;;
1595 	*-atari*)
1596 		os=-mint
1597 		;;
1598 	*)
1599 		os=-none
1600 		;;
1601 esac
1602 fi
1603 
1604 # Here we handle the case where we know the os, and the CPU type, but not the
1605 # manufacturer.  We pick the logical manufacturer.
1606 vendor=unknown
1607 case $basic_machine in
1608 	*-unknown)
1609 		case $os in
1610 			-riscix*)
1611 				vendor=acorn
1612 				;;
1613 			-sunos*)
1614 				vendor=sun
1615 				;;
1616 			-aix*)
1617 				vendor=ibm
1618 				;;
1619 			-beos*)
1620 				vendor=be
1621 				;;
1622 			-hpux*)
1623 				vendor=hp
1624 				;;
1625 			-mpeix*)
1626 				vendor=hp
1627 				;;
1628 			-hiux*)
1629 				vendor=hitachi
1630 				;;
1631 			-unos*)
1632 				vendor=crds
1633 				;;
1634 			-dgux*)
1635 				vendor=dg
1636 				;;
1637 			-luna*)
1638 				vendor=omron
1639 				;;
1640 			-genix*)
1641 				vendor=ns
1642 				;;
1643 			-mvs* | -opened*)
1644 				vendor=ibm
1645 				;;
1646 			-os400*)
1647 				vendor=ibm
1648 				;;
1649 			-ptx*)
1650 				vendor=sequent
1651 				;;
1652 			-tpf*)
1653 				vendor=ibm
1654 				;;
1655 			-vxsim* | -vxworks* | -windiss*)
1656 				vendor=wrs
1657 				;;
1658 			-aux*)
1659 				vendor=apple
1660 				;;
1661 			-hms*)
1662 				vendor=hitachi
1663 				;;
1664 			-mpw* | -macos*)
1665 				vendor=apple
1666 				;;
1667 			-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
1668 				vendor=atari
1669 				;;
1670 			-vos*)
1671 				vendor=stratus
1672 				;;
1673 		esac
1674 		basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
1675 		;;
1676 esac
1677 
1678 echo $basic_machine$os
1679 exit
1680 
1681 # Local variables:
1682 # eval: (add-hook 'write-file-hooks 'time-stamp)
1683 # time-stamp-start: "timestamp='"
1684 # time-stamp-format: "%:y-%02m-%02d"
1685 # time-stamp-end: "'"
1686 # End: