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