scripts/config.sub
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Fri Dec 30 14:15:43 2011 +0100 (2011-12-30)
changeset 2811 d74b5845f328
parent 2698 7501f41e3bbf
child 2831 d7c5e3b9d7d3
permissions -rwxr-xr-x
scripts: update config.guess and config.sub

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