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