config.sub
author Sam Lantinga <slouken@libsdl.org>
Sun, 09 Feb 2003 02:58:40 +0000
changeset 596 475f969e8c01
parent 53 25dfe480c75e
child 729 dac996d69abb
permissions -rwxr-xr-x
CVS should ignore files automatically generated by building on MacOS X
slouken@0
     1
#! /bin/sh
slouken@53
     2
# Configuration validation subroutine script.
slouken@53
     3
#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
slouken@53
     4
#   Free Software Foundation, Inc.
slouken@53
     5
slouken@53
     6
timestamp='2001-03-19'
slouken@53
     7
slouken@0
     8
# This file is (in principle) common to ALL GNU software.
slouken@0
     9
# The presence of a machine in this file suggests that SOME GNU software
slouken@0
    10
# can handle that machine.  It does not imply ALL GNU software can.
slouken@0
    11
#
slouken@0
    12
# This file is free software; you can redistribute it and/or modify
slouken@0
    13
# it under the terms of the GNU General Public License as published by
slouken@0
    14
# the Free Software Foundation; either version 2 of the License, or
slouken@0
    15
# (at your option) any later version.
slouken@0
    16
#
slouken@0
    17
# This program is distributed in the hope that it will be useful,
slouken@0
    18
# but WITHOUT ANY WARRANTY; without even the implied warranty of
slouken@0
    19
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
slouken@0
    20
# GNU General Public License for more details.
slouken@0
    21
#
slouken@0
    22
# You should have received a copy of the GNU General Public License
slouken@0
    23
# along with this program; if not, write to the Free Software
slouken@0
    24
# Foundation, Inc., 59 Temple Place - Suite 330,
slouken@0
    25
# Boston, MA 02111-1307, USA.
slouken@0
    26
slouken@0
    27
# As a special exception to the GNU General Public License, if you
slouken@0
    28
# distribute this file as part of a program that contains a
slouken@0
    29
# configuration script generated by Autoconf, you may include it under
slouken@0
    30
# the same distribution terms that you use for the rest of that program.
slouken@0
    31
slouken@53
    32
# Please send patches to <config-patches@gnu.org>.
slouken@53
    33
#
slouken@0
    34
# Configuration subroutine to validate and canonicalize a configuration type.
slouken@0
    35
# Supply the specified configuration type as an argument.
slouken@0
    36
# If it is invalid, we print an error message on stderr and exit with code 1.
slouken@0
    37
# Otherwise, we print the canonical config type on stdout and succeed.
slouken@0
    38
slouken@0
    39
# This file is supposed to be the same for all GNU packages
slouken@0
    40
# and recognize all the CPU types, system types and aliases
slouken@0
    41
# that are meaningful with *any* GNU software.
slouken@0
    42
# Each package is responsible for reporting which valid configurations
slouken@0
    43
# it does not support.  The user should be able to distinguish
slouken@0
    44
# a failure to support a valid configuration from a meaningless
slouken@0
    45
# configuration.
slouken@0
    46
slouken@0
    47
# The goal of this file is to map all the various variations of a given
slouken@0
    48
# machine specification into a single specification in the form:
slouken@0
    49
#	CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
slouken@0
    50
# or in some cases, the newer four-part form:
slouken@0
    51
#	CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
slouken@0
    52
# It is wrong to echo any other type of specification.
slouken@0
    53
slouken@53
    54
me=`echo "$0" | sed -e 's,.*/,,'`
slouken@0
    55
slouken@53
    56
usage="\
slouken@53
    57
Usage: $0 [OPTION] CPU-MFR-OPSYS
slouken@53
    58
       $0 [OPTION] ALIAS
slouken@53
    59
slouken@53
    60
Canonicalize a configuration name.
slouken@53
    61
slouken@53
    62
Operation modes:
slouken@53
    63
  -h, --help         print this help, then exit
slouken@53
    64
  -t, --time-stamp   print date of last modification, then exit
slouken@53
    65
  -v, --version      print version number, then exit
slouken@53
    66
slouken@53
    67
Report bugs and patches to <config-patches@gnu.org>."
slouken@53
    68
slouken@53
    69
version="\
slouken@53
    70
GNU config.sub ($timestamp)
slouken@53
    71
slouken@53
    72
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
slouken@53
    73
Free Software Foundation, Inc.
slouken@53
    74
slouken@53
    75
This is free software; see the source for copying conditions.  There is NO
slouken@53
    76
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
slouken@53
    77
slouken@53
    78
help="
slouken@53
    79
Try \`$me --help' for more information."
slouken@53
    80
slouken@53
    81
# Parse command line
slouken@53
    82
while test $# -gt 0 ; do
slouken@53
    83
  case $1 in
slouken@53
    84
    --time-stamp | --time* | -t )
slouken@53
    85
       echo "$timestamp" ; exit 0 ;;
slouken@53
    86
    --version | -v )
slouken@53
    87
       echo "$version" ; exit 0 ;;
slouken@53
    88
    --help | --h* | -h )
slouken@53
    89
       echo "$usage"; exit 0 ;;
slouken@53
    90
    -- )     # Stop option processing
slouken@53
    91
       shift; break ;;
slouken@53
    92
    - )	# Use stdin as input.
slouken@53
    93
       break ;;
slouken@53
    94
    -* )
slouken@53
    95
       echo "$me: invalid option $1$help"
slouken@53
    96
       exit 1 ;;
slouken@53
    97
slouken@53
    98
    *local*)
slouken@53
    99
       # First pass through any local machine types.
slouken@53
   100
       echo $1
slouken@53
   101
       exit 0;;
slouken@53
   102
slouken@53
   103
    * )
slouken@53
   104
       break ;;
slouken@53
   105
  esac
slouken@53
   106
done
slouken@53
   107
slouken@53
   108
case $# in
slouken@53
   109
 0) echo "$me: missing argument$help" >&2
slouken@53
   110
    exit 1;;
slouken@53
   111
 1) ;;
slouken@53
   112
 *) echo "$me: too many arguments$help" >&2
slouken@53
   113
    exit 1;;
slouken@0
   114
esac
slouken@0
   115
slouken@0
   116
# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
slouken@0
   117
# Here we must recognize all the valid KERNEL-OS combinations.
slouken@0
   118
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
slouken@0
   119
case $maybe_os in
slouken@53
   120
  nto-qnx* | linux-gnu* | storm-chaos* | os2-emx*)
slouken@0
   121
    os=-$maybe_os
slouken@0
   122
    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
slouken@0
   123
    ;;
slouken@0
   124
  *)
slouken@0
   125
    basic_machine=`echo $1 | sed 's/-[^-]*$//'`
slouken@0
   126
    if [ $basic_machine != $1 ]
slouken@0
   127
    then os=`echo $1 | sed 's/.*-/-/'`
slouken@0
   128
    else os=; fi
slouken@0
   129
    ;;
slouken@0
   130
esac
slouken@0
   131
slouken@0
   132
### Let's recognize common machines as not being operating systems so
slouken@0
   133
### that things like config.sub decstation-3100 work.  We also
slouken@0
   134
### recognize some manufacturers as not being operating systems, so we
slouken@0
   135
### can provide default operating systems below.
slouken@0
   136
case $os in
slouken@0
   137
	-sun*os*)
slouken@0
   138
		# Prevent following clause from handling this invalid input.
slouken@0
   139
		;;
slouken@0
   140
	-dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
slouken@0
   141
	-att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
slouken@0
   142
	-unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
slouken@0
   143
	-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
slouken@0
   144
	-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
slouken@0
   145
	-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
slouken@53
   146
	-apple | -axis)
slouken@0
   147
		os=
slouken@0
   148
		basic_machine=$1
slouken@0
   149
		;;
slouken@0
   150
	-sim | -cisco | -oki | -wec | -winbond)
slouken@0
   151
		os=
slouken@0
   152
		basic_machine=$1
slouken@0
   153
		;;
slouken@0
   154
	-scout)
slouken@0
   155
		;;
slouken@0
   156
	-wrs)
slouken@53
   157
		os=-vxworks
slouken@0
   158
		basic_machine=$1
slouken@0
   159
		;;
slouken@0
   160
	-hiux*)
slouken@0
   161
		os=-hiuxwe2
slouken@0
   162
		;;
slouken@0
   163
	-sco5)
slouken@0
   164
		os=-sco3.2v5
slouken@0
   165
		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
slouken@0
   166
		;;
slouken@0
   167
	-sco4)
slouken@0
   168
		os=-sco3.2v4
slouken@0
   169
		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
slouken@0
   170
		;;
slouken@0
   171
	-sco3.2.[4-9]*)
slouken@0
   172
		os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
slouken@0
   173
		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
slouken@0
   174
		;;
slouken@0
   175
	-sco3.2v[4-9]*)
slouken@0
   176
		# Don't forget version if it is 3.2v4 or newer.
slouken@0
   177
		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
slouken@0
   178
		;;
slouken@0
   179
	-sco*)
slouken@0
   180
		os=-sco3.2v2
slouken@0
   181
		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
slouken@0
   182
		;;
slouken@0
   183
	-udk*)
slouken@0
   184
		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
slouken@0
   185
		;;
slouken@0
   186
	-isc)
slouken@0
   187
		os=-isc2.2
slouken@0
   188
		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
slouken@0
   189
		;;
slouken@0
   190
	-clix*)
slouken@0
   191
		basic_machine=clipper-intergraph
slouken@0
   192
		;;
slouken@0
   193
	-isc*)
slouken@0
   194
		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
slouken@0
   195
		;;
slouken@0
   196
	-lynx*)
slouken@0
   197
		os=-lynxos
slouken@0
   198
		;;
slouken@0
   199
	-ptx*)
slouken@0
   200
		basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
slouken@0
   201
		;;
slouken@0
   202
	-windowsnt*)
slouken@0
   203
		os=`echo $os | sed -e 's/windowsnt/winnt/'`
slouken@0
   204
		;;
slouken@0
   205
	-psos*)
slouken@0
   206
		os=-psos
slouken@0
   207
		;;
slouken@53
   208
	-mint | -mint[0-9]*)
slouken@53
   209
		basic_machine=m68k-atari
slouken@53
   210
		os=-mint
slouken@53
   211
		;;
slouken@0
   212
esac
slouken@0
   213
slouken@0
   214
# Decode aliases for certain CPU-COMPANY combinations.
slouken@0
   215
case $basic_machine in
slouken@0
   216
	# Recognize the basic CPU types without company name.
slouken@0
   217
	# Some are omitted here because they have special meanings below.
slouken@53
   218
	tahoe | i860 | ia64 | m32r | m68k | m68000 | m88k | ns32k | arc \
slouken@53
   219
	        | arm | arme[lb] | arm[bl]e | armv[2345] | armv[345][lb] | strongarm | xscale \
slouken@53
   220
		| pyramid | mn10200 | mn10300 | tron | a29k \
slouken@0
   221
		| 580 | i960 | h8300 \
slouken@53
   222
		| x86 | ppcbe | mipsbe | mipsle | shbe | shle \
slouken@0
   223
		| hppa | hppa1.0 | hppa1.1 | hppa2.0 | hppa2.0w | hppa2.0n \
slouken@53
   224
		| hppa64 \
slouken@53
   225
		| alpha | alphaev[4-8] | alphaev56 | alphapca5[67] \
slouken@53
   226
		| alphaev6[78] \
slouken@53
   227
		| we32k | ns16k | clipper | i370 | sh | sh[34] \
slouken@53
   228
		| powerpc | powerpcle \
slouken@53
   229
		| 1750a | dsp16xx | pdp10 | pdp11 \
slouken@53
   230
		| mips16 | mips64 | mipsel | mips64el \
slouken@0
   231
		| mips64orion | mips64orionel | mipstx39 | mipstx39el \
slouken@0
   232
		| mips64vr4300 | mips64vr4300el | mips64vr4100 | mips64vr4100el \
slouken@53
   233
		| mips64vr5000 | miprs64vr5000el | mcore | s390 | s390x \
slouken@53
   234
		| sparc | sparclet | sparclite | sparc64 | sparcv9 | v850 | c4x \
slouken@53
   235
		| thumb | d10v | d30v | fr30 | avr | openrisc | tic80 \
slouken@53
   236
		| pj | pjl | h8500)
slouken@0
   237
		basic_machine=$basic_machine-unknown
slouken@0
   238
		;;
slouken@53
   239
	m6811 | m68hc11 | m6812 | m68hc12)
slouken@53
   240
		# Motorola 68HC11/12.
slouken@53
   241
		basic_machine=$basic_machine-unknown
slouken@53
   242
		os=-none
slouken@53
   243
		;;
slouken@53
   244
	m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | z8k | v70 | w65)
slouken@0
   245
		;;
slouken@0
   246
slouken@0
   247
	# We use `pc' rather than `unknown'
slouken@0
   248
	# because (1) that's what they normally are, and
slouken@0
   249
	# (2) the word "unknown" tends to confuse beginning users.
slouken@53
   250
	i[234567]86 | x86_64)
slouken@0
   251
	  basic_machine=$basic_machine-pc
slouken@0
   252
	  ;;
slouken@0
   253
	# Object if more than one company name word.
slouken@0
   254
	*-*-*)
slouken@0
   255
		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
slouken@0
   256
		exit 1
slouken@0
   257
		;;
slouken@0
   258
	# Recognize the basic CPU types with company name.
slouken@53
   259
	# FIXME: clean up the formatting here.
slouken@53
   260
	vax-* | tahoe-* | i[234567]86-* | i860-* | ia64-* | m32r-* | m68k-* | m68000-* \
slouken@53
   261
	      | m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | c[123]* \
slouken@53
   262
	      | arm-*  | armbe-* | armle-* | armv*-* | strongarm-* | xscale-* \
slouken@0
   263
	      | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \
slouken@0
   264
	      | power-* | none-* | 580-* | cray2-* | h8300-* | h8500-* | i960-* \
slouken@0
   265
	      | xmp-* | ymp-* \
slouken@53
   266
	      | x86-* | ppcbe-* | mipsbe-* | mipsle-* | shbe-* | shle-* \
slouken@53
   267
	      | hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* | hppa2.0w-* \
slouken@53
   268
	      | hppa2.0n-* | hppa64-* \
slouken@53
   269
	      | alpha-* | alphaev[4-8]-* | alphaev56-* | alphapca5[67]-* \
slouken@53
   270
	      | alphaev6[78]-* \
slouken@0
   271
	      | we32k-* | cydra-* | ns16k-* | pn-* | np1-* | xps100-* \
slouken@0
   272
	      | clipper-* | orion-* \
slouken@53
   273
	      | sparclite-* | pdp10-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \
slouken@0
   274
	      | sparc64-* | sparcv9-* | sparc86x-* | mips16-* | mips64-* | mipsel-* \
slouken@0
   275
	      | mips64el-* | mips64orion-* | mips64orionel-* \
slouken@0
   276
	      | mips64vr4100-* | mips64vr4100el-* | mips64vr4300-* | mips64vr4300el-* \
slouken@53
   277
	      | mipstx39-* | mipstx39el-* | mcore-* \
slouken@53
   278
	      | f30[01]-* | f700-* | s390-* | s390x-* | sv1-* | t3e-* \
slouken@53
   279
	      | [cjt]90-* \
slouken@0
   280
	      | m88110-* | m680[01234]0-* | m683?2-* | m68360-* | z8k-* | d10v-* \
slouken@53
   281
	      | thumb-* | v850-* | d30v-* | tic30-* | tic80-* | c30-* | fr30-* \
slouken@53
   282
	      | bs2000-* | tic54x-* | c54x-* | x86_64-* | pj-* | pjl-*)
slouken@0
   283
		;;
slouken@0
   284
	# Recognize the various machine names and aliases which stand
slouken@0
   285
	# for a CPU type and a company and sometimes even an OS.
slouken@0
   286
	386bsd)
slouken@0
   287
		basic_machine=i386-unknown
slouken@0
   288
		os=-bsd
slouken@0
   289
		;;
slouken@0
   290
	3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
slouken@0
   291
		basic_machine=m68000-att
slouken@0
   292
		;;
slouken@0
   293
	3b*)
slouken@0
   294
		basic_machine=we32k-att
slouken@0
   295
		;;
slouken@0
   296
	a29khif)
slouken@0
   297
		basic_machine=a29k-amd
slouken@0
   298
		os=-udi
slouken@0
   299
		;;
slouken@0
   300
	adobe68k)
slouken@0
   301
		basic_machine=m68010-adobe
slouken@0
   302
		os=-scout
slouken@0
   303
		;;
slouken@0
   304
	alliant | fx80)
slouken@0
   305
		basic_machine=fx80-alliant
slouken@0
   306
		;;
slouken@0
   307
	altos | altos3068)
slouken@0
   308
		basic_machine=m68k-altos
slouken@0
   309
		;;
slouken@0
   310
	am29k)
slouken@0
   311
		basic_machine=a29k-none
slouken@0
   312
		os=-bsd
slouken@0
   313
		;;
slouken@0
   314
	amdahl)
slouken@0
   315
		basic_machine=580-amdahl
slouken@0
   316
		os=-sysv
slouken@0
   317
		;;
slouken@0
   318
	amiga | amiga-*)
slouken@53
   319
		basic_machine=m68k-unknown
slouken@0
   320
		;;
slouken@0
   321
	amigaos | amigados)
slouken@53
   322
		basic_machine=m68k-unknown
slouken@0
   323
		os=-amigaos
slouken@0
   324
		;;
slouken@0
   325
	amigaunix | amix)
slouken@53
   326
		basic_machine=m68k-unknown
slouken@0
   327
		os=-sysv4
slouken@0
   328
		;;
slouken@0
   329
	apollo68)
slouken@0
   330
		basic_machine=m68k-apollo
slouken@0
   331
		os=-sysv
slouken@0
   332
		;;
slouken@0
   333
	apollo68bsd)
slouken@0
   334
		basic_machine=m68k-apollo
slouken@0
   335
		os=-bsd
slouken@0
   336
		;;
slouken@0
   337
	aux)
slouken@0
   338
		basic_machine=m68k-apple
slouken@0
   339
		os=-aux
slouken@0
   340
		;;
slouken@0
   341
	balance)
slouken@0
   342
		basic_machine=ns32k-sequent
slouken@0
   343
		os=-dynix
slouken@0
   344
		;;
slouken@0
   345
	convex-c1)
slouken@0
   346
		basic_machine=c1-convex
slouken@0
   347
		os=-bsd
slouken@0
   348
		;;
slouken@0
   349
	convex-c2)
slouken@0
   350
		basic_machine=c2-convex
slouken@0
   351
		os=-bsd
slouken@0
   352
		;;
slouken@0
   353
	convex-c32)
slouken@0
   354
		basic_machine=c32-convex
slouken@0
   355
		os=-bsd
slouken@0
   356
		;;
slouken@0
   357
	convex-c34)
slouken@0
   358
		basic_machine=c34-convex
slouken@0
   359
		os=-bsd
slouken@0
   360
		;;
slouken@0
   361
	convex-c38)
slouken@0
   362
		basic_machine=c38-convex
slouken@0
   363
		os=-bsd
slouken@0
   364
		;;
slouken@0
   365
	cray | ymp)
slouken@0
   366
		basic_machine=ymp-cray
slouken@0
   367
		os=-unicos
slouken@0
   368
		;;
slouken@0
   369
	cray2)
slouken@0
   370
		basic_machine=cray2-cray
slouken@0
   371
		os=-unicos
slouken@0
   372
		;;
slouken@53
   373
	[cjt]90)
slouken@53
   374
		basic_machine=${basic_machine}-cray
slouken@0
   375
		os=-unicos
slouken@0
   376
		;;
slouken@0
   377
	crds | unos)
slouken@0
   378
		basic_machine=m68k-crds
slouken@0
   379
		;;
slouken@53
   380
	cris | cris-* | etrax*)
slouken@53
   381
		basic_machine=cris-axis
slouken@53
   382
		;;
slouken@0
   383
	da30 | da30-*)
slouken@0
   384
		basic_machine=m68k-da30
slouken@0
   385
		;;
slouken@0
   386
	decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
slouken@0
   387
		basic_machine=mips-dec
slouken@0
   388
		;;
slouken@0
   389
	delta | 3300 | motorola-3300 | motorola-delta \
slouken@0
   390
	      | 3300-motorola | delta-motorola)
slouken@0
   391
		basic_machine=m68k-motorola
slouken@0
   392
		;;
slouken@0
   393
	delta88)
slouken@0
   394
		basic_machine=m88k-motorola
slouken@0
   395
		os=-sysv3
slouken@0
   396
		;;
slouken@0
   397
	dpx20 | dpx20-*)
slouken@0
   398
		basic_machine=rs6000-bull
slouken@0
   399
		os=-bosx
slouken@0
   400
		;;
slouken@0
   401
	dpx2* | dpx2*-bull)
slouken@0
   402
		basic_machine=m68k-bull
slouken@0
   403
		os=-sysv3
slouken@0
   404
		;;
slouken@0
   405
	ebmon29k)
slouken@0
   406
		basic_machine=a29k-amd
slouken@0
   407
		os=-ebmon
slouken@0
   408
		;;
slouken@0
   409
	elxsi)
slouken@0
   410
		basic_machine=elxsi-elxsi
slouken@0
   411
		os=-bsd
slouken@0
   412
		;;
slouken@0
   413
	encore | umax | mmax)
slouken@0
   414
		basic_machine=ns32k-encore
slouken@0
   415
		;;
slouken@0
   416
	es1800 | OSE68k | ose68k | ose | OSE)
slouken@0
   417
		basic_machine=m68k-ericsson
slouken@0
   418
		os=-ose
slouken@0
   419
		;;
slouken@0
   420
	fx2800)
slouken@0
   421
		basic_machine=i860-alliant
slouken@0
   422
		;;
slouken@0
   423
	genix)
slouken@0
   424
		basic_machine=ns32k-ns
slouken@0
   425
		;;
slouken@0
   426
	gmicro)
slouken@0
   427
		basic_machine=tron-gmicro
slouken@0
   428
		os=-sysv
slouken@0
   429
		;;
slouken@53
   430
	go32)
slouken@53
   431
		basic_machine=i386-pc
slouken@53
   432
		os=-go32
slouken@53
   433
		;;
slouken@0
   434
	h3050r* | hiux*)
slouken@0
   435
		basic_machine=hppa1.1-hitachi
slouken@0
   436
		os=-hiuxwe2
slouken@0
   437
		;;
slouken@0
   438
	h8300hms)
slouken@0
   439
		basic_machine=h8300-hitachi
slouken@0
   440
		os=-hms
slouken@0
   441
		;;
slouken@0
   442
	h8300xray)
slouken@0
   443
		basic_machine=h8300-hitachi
slouken@0
   444
		os=-xray
slouken@0
   445
		;;
slouken@0
   446
	h8500hms)
slouken@0
   447
		basic_machine=h8500-hitachi
slouken@0
   448
		os=-hms
slouken@0
   449
		;;
slouken@0
   450
	harris)
slouken@0
   451
		basic_machine=m88k-harris
slouken@0
   452
		os=-sysv3
slouken@0
   453
		;;
slouken@0
   454
	hp300-*)
slouken@0
   455
		basic_machine=m68k-hp
slouken@0
   456
		;;
slouken@0
   457
	hp300bsd)
slouken@0
   458
		basic_machine=m68k-hp
slouken@0
   459
		os=-bsd
slouken@0
   460
		;;
slouken@0
   461
	hp300hpux)
slouken@0
   462
		basic_machine=m68k-hp
slouken@0
   463
		os=-hpux
slouken@0
   464
		;;
slouken@0
   465
	hp3k9[0-9][0-9] | hp9[0-9][0-9])
slouken@0
   466
		basic_machine=hppa1.0-hp
slouken@0
   467
		;;
slouken@0
   468
	hp9k2[0-9][0-9] | hp9k31[0-9])
slouken@0
   469
		basic_machine=m68000-hp
slouken@0
   470
		;;
slouken@0
   471
	hp9k3[2-9][0-9])
slouken@0
   472
		basic_machine=m68k-hp
slouken@0
   473
		;;
slouken@0
   474
	hp9k6[0-9][0-9] | hp6[0-9][0-9])
slouken@0
   475
		basic_machine=hppa1.0-hp
slouken@0
   476
		;;
slouken@0
   477
	hp9k7[0-79][0-9] | hp7[0-79][0-9])
slouken@0
   478
		basic_machine=hppa1.1-hp
slouken@0
   479
		;;
slouken@0
   480
	hp9k78[0-9] | hp78[0-9])
slouken@0
   481
		# FIXME: really hppa2.0-hp
slouken@0
   482
		basic_machine=hppa1.1-hp
slouken@0
   483
		;;
slouken@0
   484
	hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
slouken@0
   485
		# FIXME: really hppa2.0-hp
slouken@0
   486
		basic_machine=hppa1.1-hp
slouken@0
   487
		;;
slouken@0
   488
	hp9k8[0-9][13679] | hp8[0-9][13679])
slouken@0
   489
		basic_machine=hppa1.1-hp
slouken@0
   490
		;;
slouken@0
   491
	hp9k8[0-9][0-9] | hp8[0-9][0-9])
slouken@0
   492
		basic_machine=hppa1.0-hp
slouken@0
   493
		;;
slouken@0
   494
	hppa-next)
slouken@0
   495
		os=-nextstep3
slouken@0
   496
		;;
slouken@0
   497
	hppaosf)
slouken@0
   498
		basic_machine=hppa1.1-hp
slouken@0
   499
		os=-osf
slouken@0
   500
		;;
slouken@0
   501
	hppro)
slouken@0
   502
		basic_machine=hppa1.1-hp
slouken@0
   503
		os=-proelf
slouken@0
   504
		;;
slouken@0
   505
	i370-ibm* | ibm*)
slouken@0
   506
		basic_machine=i370-ibm
slouken@0
   507
		;;
slouken@0
   508
# I'm not sure what "Sysv32" means.  Should this be sysv3.2?
slouken@0
   509
	i[34567]86v32)
slouken@0
   510
		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
slouken@0
   511
		os=-sysv32
slouken@0
   512
		;;
slouken@0
   513
	i[34567]86v4*)
slouken@0
   514
		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
slouken@0
   515
		os=-sysv4
slouken@0
   516
		;;
slouken@0
   517
	i[34567]86v)
slouken@0
   518
		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
slouken@0
   519
		os=-sysv
slouken@0
   520
		;;
slouken@0
   521
	i[34567]86sol2)
slouken@0
   522
		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
slouken@0
   523
		os=-solaris2
slouken@0
   524
		;;
slouken@0
   525
	i386mach)
slouken@0
   526
		basic_machine=i386-mach
slouken@0
   527
		os=-mach
slouken@0
   528
		;;
slouken@0
   529
	i386-vsta | vsta)
slouken@0
   530
		basic_machine=i386-unknown
slouken@0
   531
		os=-vsta
slouken@0
   532
		;;
slouken@0
   533
	iris | iris4d)
slouken@0
   534
		basic_machine=mips-sgi
slouken@0
   535
		case $os in
slouken@0
   536
		    -irix*)
slouken@0
   537
			;;
slouken@0
   538
		    *)
slouken@0
   539
			os=-irix4
slouken@0
   540
			;;
slouken@0
   541
		esac
slouken@0
   542
		;;
slouken@0
   543
	isi68 | isi)
slouken@0
   544
		basic_machine=m68k-isi
slouken@0
   545
		os=-sysv
slouken@0
   546
		;;
slouken@0
   547
	m88k-omron*)
slouken@0
   548
		basic_machine=m88k-omron
slouken@0
   549
		;;
slouken@0
   550
	magnum | m3230)
slouken@0
   551
		basic_machine=mips-mips
slouken@0
   552
		os=-sysv
slouken@0
   553
		;;
slouken@0
   554
	merlin)
slouken@0
   555
		basic_machine=ns32k-utek
slouken@0
   556
		os=-sysv
slouken@0
   557
		;;
slouken@53
   558
	mingw32)
slouken@53
   559
		basic_machine=i386-pc
slouken@53
   560
		os=-mingw32
slouken@53
   561
		;;
slouken@0
   562
	miniframe)
slouken@0
   563
		basic_machine=m68000-convergent
slouken@0
   564
		;;
slouken@53
   565
	*mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
slouken@0
   566
		basic_machine=m68k-atari
slouken@0
   567
		os=-mint
slouken@0
   568
		;;
slouken@0
   569
	mipsel*-linux*)
slouken@0
   570
		basic_machine=mipsel-unknown
slouken@0
   571
		os=-linux-gnu
slouken@0
   572
		;;
slouken@0
   573
	mips*-linux*)
slouken@0
   574
		basic_machine=mips-unknown
slouken@0
   575
		os=-linux-gnu
slouken@0
   576
		;;
slouken@0
   577
	mips3*-*)
slouken@0
   578
		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
slouken@0
   579
		;;
slouken@0
   580
	mips3*)
slouken@0
   581
		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
slouken@0
   582
		;;
slouken@53
   583
	mmix*)
slouken@53
   584
		basic_machine=mmix-knuth
slouken@53
   585
		os=-mmixware
slouken@53
   586
		;;
slouken@0
   587
	monitor)
slouken@0
   588
		basic_machine=m68k-rom68k
slouken@0
   589
		os=-coff
slouken@0
   590
		;;
slouken@0
   591
	msdos)
slouken@53
   592
		basic_machine=i386-pc
slouken@0
   593
		os=-msdos
slouken@0
   594
		;;
slouken@53
   595
	mvs)
slouken@53
   596
		basic_machine=i370-ibm
slouken@53
   597
		os=-mvs
slouken@53
   598
		;;
slouken@0
   599
	ncr3000)
slouken@0
   600
		basic_machine=i486-ncr
slouken@0
   601
		os=-sysv4
slouken@0
   602
		;;
slouken@0
   603
	netbsd386)
slouken@0
   604
		basic_machine=i386-unknown
slouken@0
   605
		os=-netbsd
slouken@0
   606
		;;
slouken@0
   607
	netwinder)
slouken@53
   608
		basic_machine=armv4l-rebel
slouken@0
   609
		os=-linux
slouken@0
   610
		;;
slouken@0
   611
	news | news700 | news800 | news900)
slouken@0
   612
		basic_machine=m68k-sony
slouken@0
   613
		os=-newsos
slouken@0
   614
		;;
slouken@0
   615
	news1000)
slouken@0
   616
		basic_machine=m68030-sony
slouken@0
   617
		os=-newsos
slouken@0
   618
		;;
slouken@0
   619
	news-3600 | risc-news)
slouken@0
   620
		basic_machine=mips-sony
slouken@0
   621
		os=-newsos
slouken@0
   622
		;;
slouken@0
   623
	necv70)
slouken@0
   624
		basic_machine=v70-nec
slouken@0
   625
		os=-sysv
slouken@0
   626
		;;
slouken@0
   627
	next | m*-next )
slouken@0
   628
		basic_machine=m68k-next
slouken@0
   629
		case $os in
slouken@0
   630
		    -nextstep* )
slouken@0
   631
			;;
slouken@0
   632
		    -ns2*)
slouken@0
   633
		      os=-nextstep2
slouken@0
   634
			;;
slouken@0
   635
		    *)
slouken@0
   636
		      os=-nextstep3
slouken@0
   637
			;;
slouken@0
   638
		esac
slouken@0
   639
		;;
slouken@0
   640
	nh3000)
slouken@0
   641
		basic_machine=m68k-harris
slouken@0
   642
		os=-cxux
slouken@0
   643
		;;
slouken@0
   644
	nh[45]000)
slouken@0
   645
		basic_machine=m88k-harris
slouken@0
   646
		os=-cxux
slouken@0
   647
		;;
slouken@0
   648
	nindy960)
slouken@0
   649
		basic_machine=i960-intel
slouken@0
   650
		os=-nindy
slouken@0
   651
		;;
slouken@0
   652
	mon960)
slouken@0
   653
		basic_machine=i960-intel
slouken@0
   654
		os=-mon960
slouken@0
   655
		;;
slouken@53
   656
	nonstopux)
slouken@53
   657
		basic_machine=mips-compaq
slouken@53
   658
		os=-nonstopux
slouken@53
   659
		;;
slouken@0
   660
	np1)
slouken@0
   661
		basic_machine=np1-gould
slouken@0
   662
		;;
slouken@53
   663
	nsr-tandem)
slouken@53
   664
		basic_machine=nsr-tandem
slouken@53
   665
		;;
slouken@0
   666
	op50n-* | op60c-*)
slouken@0
   667
		basic_machine=hppa1.1-oki
slouken@0
   668
		os=-proelf
slouken@0
   669
		;;
slouken@0
   670
	OSE68000 | ose68000)
slouken@0
   671
		basic_machine=m68000-ericsson
slouken@0
   672
		os=-ose
slouken@0
   673
		;;
slouken@0
   674
	os68k)
slouken@0
   675
		basic_machine=m68k-none
slouken@0
   676
		os=-os68k
slouken@0
   677
		;;
slouken@0
   678
	pa-hitachi)
slouken@0
   679
		basic_machine=hppa1.1-hitachi
slouken@0
   680
		os=-hiuxwe2
slouken@0
   681
		;;
slouken@0
   682
	paragon)
slouken@0
   683
		basic_machine=i860-intel
slouken@0
   684
		os=-osf
slouken@0
   685
		;;
slouken@0
   686
	pbd)
slouken@0
   687
		basic_machine=sparc-tti
slouken@0
   688
		;;
slouken@0
   689
	pbb)
slouken@0
   690
		basic_machine=m68k-tti
slouken@0
   691
		;;
slouken@0
   692
        pc532 | pc532-*)
slouken@0
   693
		basic_machine=ns32k-pc532
slouken@0
   694
		;;
slouken@53
   695
	pentium | p5 | k5 | k6 | nexgen)
slouken@0
   696
		basic_machine=i586-pc
slouken@0
   697
		;;
slouken@53
   698
	pentiumpro | p6 | 6x86 | athlon)
slouken@0
   699
		basic_machine=i686-pc
slouken@0
   700
		;;
slouken@0
   701
	pentiumii | pentium2)
slouken@53
   702
		basic_machine=i686-pc
slouken@0
   703
		;;
slouken@53
   704
	pentium-* | p5-* | k5-* | k6-* | nexgen-*)
slouken@0
   705
		basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
slouken@0
   706
		;;
slouken@53
   707
	pentiumpro-* | p6-* | 6x86-* | athlon-*)
slouken@0
   708
		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
slouken@0
   709
		;;
slouken@0
   710
	pentiumii-* | pentium2-*)
slouken@53
   711
		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
slouken@0
   712
		;;
slouken@0
   713
	pn)
slouken@0
   714
		basic_machine=pn-gould
slouken@0
   715
		;;
slouken@53
   716
	power)	basic_machine=power-ibm
slouken@0
   717
		;;
slouken@0
   718
	ppc)	basic_machine=powerpc-unknown
slouken@0
   719
	        ;;
slouken@0
   720
	ppc-*)	basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
slouken@0
   721
		;;
slouken@0
   722
	ppcle | powerpclittle | ppc-le | powerpc-little)
slouken@0
   723
		basic_machine=powerpcle-unknown
slouken@0
   724
	        ;;
slouken@0
   725
	ppcle-* | powerpclittle-*)
slouken@0
   726
		basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
slouken@0
   727
		;;
slouken@0
   728
	ps2)
slouken@0
   729
		basic_machine=i386-ibm
slouken@0
   730
		;;
slouken@53
   731
	pw32)
slouken@53
   732
		basic_machine=i586-unknown
slouken@53
   733
		os=-pw32
slouken@53
   734
		;;
slouken@0
   735
	rom68k)
slouken@0
   736
		basic_machine=m68k-rom68k
slouken@0
   737
		os=-coff
slouken@0
   738
		;;
slouken@0
   739
	rm[46]00)
slouken@0
   740
		basic_machine=mips-siemens
slouken@0
   741
		;;
slouken@0
   742
	rtpc | rtpc-*)
slouken@0
   743
		basic_machine=romp-ibm
slouken@0
   744
		;;
slouken@0
   745
	sa29200)
slouken@0
   746
		basic_machine=a29k-amd
slouken@0
   747
		os=-udi
slouken@0
   748
		;;
slouken@0
   749
	sequent)
slouken@0
   750
		basic_machine=i386-sequent
slouken@0
   751
		;;
slouken@0
   752
	sh)
slouken@0
   753
		basic_machine=sh-hitachi
slouken@0
   754
		os=-hms
slouken@0
   755
		;;
slouken@0
   756
	sparclite-wrs)
slouken@0
   757
		basic_machine=sparclite-wrs
slouken@0
   758
		os=-vxworks
slouken@0
   759
		;;
slouken@0
   760
	sps7)
slouken@0
   761
		basic_machine=m68k-bull
slouken@0
   762
		os=-sysv2
slouken@0
   763
		;;
slouken@0
   764
	spur)
slouken@0
   765
		basic_machine=spur-unknown
slouken@0
   766
		;;
slouken@0
   767
	st2000)
slouken@0
   768
		basic_machine=m68k-tandem
slouken@0
   769
		;;
slouken@0
   770
	stratus)
slouken@0
   771
		basic_machine=i860-stratus
slouken@0
   772
		os=-sysv4
slouken@0
   773
		;;
slouken@0
   774
	sun2)
slouken@0
   775
		basic_machine=m68000-sun
slouken@0
   776
		;;
slouken@0
   777
	sun2os3)
slouken@0
   778
		basic_machine=m68000-sun
slouken@0
   779
		os=-sunos3
slouken@0
   780
		;;
slouken@0
   781
	sun2os4)
slouken@0
   782
		basic_machine=m68000-sun
slouken@0
   783
		os=-sunos4
slouken@0
   784
		;;
slouken@0
   785
	sun3os3)
slouken@0
   786
		basic_machine=m68k-sun
slouken@0
   787
		os=-sunos3
slouken@0
   788
		;;
slouken@0
   789
	sun3os4)
slouken@0
   790
		basic_machine=m68k-sun
slouken@0
   791
		os=-sunos4
slouken@0
   792
		;;
slouken@0
   793
	sun4os3)
slouken@0
   794
		basic_machine=sparc-sun
slouken@0
   795
		os=-sunos3
slouken@0
   796
		;;
slouken@0
   797
	sun4os4)
slouken@0
   798
		basic_machine=sparc-sun
slouken@0
   799
		os=-sunos4
slouken@0
   800
		;;
slouken@0
   801
	sun4sol2)
slouken@0
   802
		basic_machine=sparc-sun
slouken@0
   803
		os=-solaris2
slouken@0
   804
		;;
slouken@0
   805
	sun3 | sun3-*)
slouken@0
   806
		basic_machine=m68k-sun
slouken@0
   807
		;;
slouken@0
   808
	sun4)
slouken@0
   809
		basic_machine=sparc-sun
slouken@0
   810
		;;
slouken@0
   811
	sun386 | sun386i | roadrunner)
slouken@0
   812
		basic_machine=i386-sun
slouken@0
   813
		;;
slouken@53
   814
	sv1)
slouken@53
   815
		basic_machine=sv1-cray
slouken@53
   816
		os=-unicos
slouken@53
   817
		;;
slouken@0
   818
	symmetry)
slouken@0
   819
		basic_machine=i386-sequent
slouken@0
   820
		os=-dynix
slouken@0
   821
		;;
slouken@0
   822
	t3e)
slouken@0
   823
		basic_machine=t3e-cray
slouken@0
   824
		os=-unicos
slouken@0
   825
		;;
slouken@53
   826
	tic54x | c54x*)
slouken@53
   827
		basic_machine=tic54x-unknown
slouken@53
   828
		os=-coff
slouken@53
   829
		;;
slouken@0
   830
	tx39)
slouken@0
   831
		basic_machine=mipstx39-unknown
slouken@0
   832
		;;
slouken@0
   833
	tx39el)
slouken@0
   834
		basic_machine=mipstx39el-unknown
slouken@0
   835
		;;
slouken@0
   836
	tower | tower-32)
slouken@0
   837
		basic_machine=m68k-ncr
slouken@0
   838
		;;
slouken@0
   839
	udi29k)
slouken@0
   840
		basic_machine=a29k-amd
slouken@0
   841
		os=-udi
slouken@0
   842
		;;
slouken@0
   843
	ultra3)
slouken@0
   844
		basic_machine=a29k-nyu
slouken@0
   845
		os=-sym1
slouken@0
   846
		;;
slouken@0
   847
	v810 | necv810)
slouken@0
   848
		basic_machine=v810-nec
slouken@0
   849
		os=-none
slouken@0
   850
		;;
slouken@0
   851
	vaxv)
slouken@0
   852
		basic_machine=vax-dec
slouken@0
   853
		os=-sysv
slouken@0
   854
		;;
slouken@0
   855
	vms)
slouken@0
   856
		basic_machine=vax-dec
slouken@0
   857
		os=-vms
slouken@0
   858
		;;
slouken@0
   859
	vpp*|vx|vx-*)
slouken@0
   860
               basic_machine=f301-fujitsu
slouken@0
   861
               ;;
slouken@0
   862
	vxworks960)
slouken@0
   863
		basic_machine=i960-wrs
slouken@0
   864
		os=-vxworks
slouken@0
   865
		;;
slouken@0
   866
	vxworks68)
slouken@0
   867
		basic_machine=m68k-wrs
slouken@0
   868
		os=-vxworks
slouken@0
   869
		;;
slouken@0
   870
	vxworks29k)
slouken@0
   871
		basic_machine=a29k-wrs
slouken@0
   872
		os=-vxworks
slouken@0
   873
		;;
slouken@0
   874
	w65*)
slouken@0
   875
		basic_machine=w65-wdc
slouken@0
   876
		os=-none
slouken@0
   877
		;;
slouken@0
   878
	w89k-*)
slouken@0
   879
		basic_machine=hppa1.1-winbond
slouken@0
   880
		os=-proelf
slouken@0
   881
		;;
slouken@0
   882
	xmp)
slouken@0
   883
		basic_machine=xmp-cray
slouken@0
   884
		os=-unicos
slouken@0
   885
		;;
slouken@0
   886
        xps | xps100)
slouken@0
   887
		basic_machine=xps100-honeywell
slouken@0
   888
		;;
slouken@0
   889
	z8k-*-coff)
slouken@0
   890
		basic_machine=z8k-unknown
slouken@0
   891
		os=-sim
slouken@0
   892
		;;
slouken@0
   893
	none)
slouken@0
   894
		basic_machine=none-none
slouken@0
   895
		os=-none
slouken@0
   896
		;;
slouken@0
   897
slouken@0
   898
# Here we handle the default manufacturer of certain CPU types.  It is in
slouken@0
   899
# some cases the only manufacturer, in others, it is the most popular.
slouken@0
   900
	w89k)
slouken@0
   901
		basic_machine=hppa1.1-winbond
slouken@0
   902
		;;
slouken@0
   903
	op50n)
slouken@0
   904
		basic_machine=hppa1.1-oki
slouken@0
   905
		;;
slouken@0
   906
	op60c)
slouken@0
   907
		basic_machine=hppa1.1-oki
slouken@0
   908
		;;
slouken@0
   909
	mips)
slouken@0
   910
		if [ x$os = x-linux-gnu ]; then
slouken@0
   911
			basic_machine=mips-unknown
slouken@0
   912
		else
slouken@0
   913
			basic_machine=mips-mips
slouken@0
   914
		fi
slouken@0
   915
		;;
slouken@0
   916
	romp)
slouken@0
   917
		basic_machine=romp-ibm
slouken@0
   918
		;;
slouken@0
   919
	rs6000)
slouken@0
   920
		basic_machine=rs6000-ibm
slouken@0
   921
		;;
slouken@0
   922
	vax)
slouken@0
   923
		basic_machine=vax-dec
slouken@0
   924
		;;
slouken@53
   925
	pdp10)
slouken@53
   926
		# there are many clones, so DEC is not a safe bet
slouken@53
   927
		basic_machine=pdp10-unknown
slouken@53
   928
		;;
slouken@0
   929
	pdp11)
slouken@0
   930
		basic_machine=pdp11-dec
slouken@0
   931
		;;
slouken@0
   932
	we32k)
slouken@0
   933
		basic_machine=we32k-att
slouken@0
   934
		;;
slouken@53
   935
	sh3 | sh4)
slouken@53
   936
		basic_machine=sh-unknown
slouken@53
   937
		;;
slouken@0
   938
	sparc | sparcv9)
slouken@0
   939
		basic_machine=sparc-sun
slouken@0
   940
		;;
slouken@0
   941
        cydra)
slouken@0
   942
		basic_machine=cydra-cydrome
slouken@0
   943
		;;
slouken@0
   944
	orion)
slouken@0
   945
		basic_machine=orion-highlevel
slouken@0
   946
		;;
slouken@0
   947
	orion105)
slouken@0
   948
		basic_machine=clipper-highlevel
slouken@0
   949
		;;
slouken@0
   950
	mac | mpw | mac-mpw)
slouken@0
   951
		basic_machine=m68k-apple
slouken@0
   952
		;;
slouken@0
   953
	pmac | pmac-mpw)
slouken@0
   954
		basic_machine=powerpc-apple
slouken@0
   955
		;;
slouken@0
   956
	c4x*)
slouken@0
   957
		basic_machine=c4x-none
slouken@0
   958
		os=-coff
slouken@0
   959
		;;
slouken@0
   960
	*)
slouken@0
   961
		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
slouken@0
   962
		exit 1
slouken@0
   963
		;;
slouken@0
   964
esac
slouken@0
   965
slouken@0
   966
# Here we canonicalize certain aliases for manufacturers.
slouken@0
   967
case $basic_machine in
slouken@0
   968
	*-digital*)
slouken@0
   969
		basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
slouken@0
   970
		;;
slouken@0
   971
	*-commodore*)
slouken@0
   972
		basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
slouken@0
   973
		;;
slouken@0
   974
	*)
slouken@0
   975
		;;
slouken@0
   976
esac
slouken@0
   977
slouken@0
   978
# Decode manufacturer-specific aliases for certain operating systems.
slouken@0
   979
slouken@0
   980
if [ x"$os" != x"" ]
slouken@0
   981
then
slouken@0
   982
case $os in
slouken@0
   983
        # First match some system type aliases
slouken@0
   984
        # that might get confused with valid system types.
slouken@0
   985
	# -solaris* is a basic system type, with this one exception.
slouken@0
   986
	-solaris1 | -solaris1.*)
slouken@0
   987
		os=`echo $os | sed -e 's|solaris1|sunos4|'`
slouken@0
   988
		;;
slouken@0
   989
	-solaris)
slouken@0
   990
		os=-solaris2
slouken@0
   991
		;;
slouken@0
   992
	-svr4*)
slouken@0
   993
		os=-sysv4
slouken@0
   994
		;;
slouken@0
   995
	-unixware*)
slouken@0
   996
		os=-sysv4.2uw
slouken@0
   997
		;;
slouken@0
   998
	-gnu/linux*)
slouken@0
   999
		os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
slouken@0
  1000
		;;
slouken@0
  1001
	# First accept the basic system types.
slouken@0
  1002
	# The portable systems comes first.
slouken@0
  1003
	# Each alternative MUST END IN A *, to match a version number.
slouken@0
  1004
	# -sysv* is not here because it comes later, after sysvr4.
slouken@0
  1005
	-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
slouken@0
  1006
	      | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
slouken@0
  1007
	      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
slouken@0
  1008
	      | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
slouken@0
  1009
	      | -aos* \
slouken@0
  1010
	      | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
slouken@0
  1011
	      | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
slouken@0
  1012
	      | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \
slouken@0
  1013
	      | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
slouken@0
  1014
	      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
slouken@0
  1015
	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
slouken@0
  1016
	      | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
slouken@0
  1017
	      | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
slouken@53
  1018
	      | -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \
slouken@53
  1019
	      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
slouken@53
  1020
	      | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* | -os2*)
slouken@0
  1021
	# Remember, each alternative MUST END IN *, to match a version number.
slouken@0
  1022
		;;
slouken@53
  1023
	-qnx*)
slouken@53
  1024
		case $basic_machine in
slouken@53
  1025
		    x86-* | i[34567]86-*)
slouken@53
  1026
			;;
slouken@53
  1027
		    *)
slouken@53
  1028
			os=-nto$os
slouken@53
  1029
			;;
slouken@53
  1030
		esac
slouken@53
  1031
		;;
slouken@53
  1032
	-nto*)
slouken@53
  1033
		os=-nto-qnx
slouken@53
  1034
		;;
slouken@0
  1035
	-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
slouken@0
  1036
	      | -windows* | -osx | -abug | -netware* | -os9* | -beos* \
slouken@53
  1037
	      | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
slouken@0
  1038
		;;
slouken@0
  1039
	-mac*)
slouken@0
  1040
		os=`echo $os | sed -e 's|mac|macos|'`
slouken@0
  1041
		;;
slouken@0
  1042
	-linux*)
slouken@0
  1043
		os=`echo $os | sed -e 's|linux|linux-gnu|'`
slouken@0
  1044
		;;
slouken@0
  1045
	-sunos5*)
slouken@0
  1046
		os=`echo $os | sed -e 's|sunos5|solaris2|'`
slouken@0
  1047
		;;
slouken@0
  1048
	-sunos6*)
slouken@0
  1049
		os=`echo $os | sed -e 's|sunos6|solaris3|'`
slouken@0
  1050
		;;
slouken@53
  1051
	-opened*)
slouken@53
  1052
		os=-openedition
slouken@53
  1053
		;;
slouken@53
  1054
	-wince*)
slouken@53
  1055
		os=-wince
slouken@53
  1056
		;;
slouken@0
  1057
	-osfrose*)
slouken@0
  1058
		os=-osfrose
slouken@0
  1059
		;;
slouken@0
  1060
	-osf*)
slouken@0
  1061
		os=-osf
slouken@0
  1062
		;;
slouken@0
  1063
	-utek*)
slouken@0
  1064
		os=-bsd
slouken@0
  1065
		;;
slouken@0
  1066
	-dynix*)
slouken@0
  1067
		os=-bsd
slouken@0
  1068
		;;
slouken@0
  1069
	-acis*)
slouken@0
  1070
		os=-aos
slouken@0
  1071
		;;
slouken@0
  1072
	-386bsd)
slouken@0
  1073
		os=-bsd
slouken@0
  1074
		;;
slouken@0
  1075
	-ctix* | -uts*)
slouken@0
  1076
		os=-sysv
slouken@0
  1077
		;;
slouken@0
  1078
	-ns2 )
slouken@0
  1079
	        os=-nextstep2
slouken@0
  1080
		;;
slouken@53
  1081
	-nsk*)
slouken@53
  1082
		os=-nsk
slouken@53
  1083
		;;
slouken@0
  1084
	# Preserve the version number of sinix5.
slouken@0
  1085
	-sinix5.*)
slouken@0
  1086
		os=`echo $os | sed -e 's|sinix|sysv|'`
slouken@0
  1087
		;;
slouken@0
  1088
	-sinix*)
slouken@0
  1089
		os=-sysv4
slouken@0
  1090
		;;
slouken@0
  1091
	-triton*)
slouken@0
  1092
		os=-sysv3
slouken@0
  1093
		;;
slouken@0
  1094
	-oss*)
slouken@0
  1095
		os=-sysv3
slouken@0
  1096
		;;
slouken@0
  1097
	-svr4)
slouken@0
  1098
		os=-sysv4
slouken@0
  1099
		;;
slouken@0
  1100
	-svr3)
slouken@0
  1101
		os=-sysv3
slouken@0
  1102
		;;
slouken@0
  1103
	-sysvr4)
slouken@0
  1104
		os=-sysv4
slouken@0
  1105
		;;
slouken@0
  1106
	# This must come after -sysvr4.
slouken@0
  1107
	-sysv*)
slouken@0
  1108
		;;
slouken@0
  1109
	-ose*)
slouken@0
  1110
		os=-ose
slouken@0
  1111
		;;
slouken@0
  1112
	-es1800*)
slouken@0
  1113
		os=-ose
slouken@0
  1114
		;;
slouken@0
  1115
	-xenix)
slouken@0
  1116
		os=-xenix
slouken@0
  1117
		;;
slouken@53
  1118
        -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
slouken@0
  1119
	        os=-mint
slouken@0
  1120
		;;
slouken@0
  1121
	-none)
slouken@0
  1122
		;;
slouken@0
  1123
	*)
slouken@0
  1124
		# Get rid of the `-' at the beginning of $os.
slouken@0
  1125
		os=`echo $os | sed 's/[^-]*-//'`
slouken@0
  1126
		echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
slouken@0
  1127
		exit 1
slouken@0
  1128
		;;
slouken@0
  1129
esac
slouken@0
  1130
else
slouken@0
  1131
slouken@0
  1132
# Here we handle the default operating systems that come with various machines.
slouken@0
  1133
# The value should be what the vendor currently ships out the door with their
slouken@0
  1134
# machine or put another way, the most popular os provided with the machine.
slouken@0
  1135
slouken@0
  1136
# Note that if you're going to try to match "-MANUFACTURER" here (say,
slouken@0
  1137
# "-sun"), then you have to tell the case statement up towards the top
slouken@0
  1138
# that MANUFACTURER isn't an operating system.  Otherwise, code above
slouken@0
  1139
# will signal an error saying that MANUFACTURER isn't an operating
slouken@0
  1140
# system, and we'll never get to this point.
slouken@0
  1141
slouken@0
  1142
case $basic_machine in
slouken@0
  1143
	*-acorn)
slouken@0
  1144
		os=-riscix1.2
slouken@0
  1145
		;;
slouken@53
  1146
	arm*-rebel)
slouken@0
  1147
		os=-linux
slouken@0
  1148
		;;
slouken@0
  1149
	arm*-semi)
slouken@0
  1150
		os=-aout
slouken@0
  1151
		;;
slouken@53
  1152
	pdp10-*)
slouken@53
  1153
		os=-tops20
slouken@53
  1154
		;;
slouken@0
  1155
        pdp11-*)
slouken@0
  1156
		os=-none
slouken@0
  1157
		;;
slouken@0
  1158
	*-dec | vax-*)
slouken@0
  1159
		os=-ultrix4.2
slouken@0
  1160
		;;
slouken@0
  1161
	m68*-apollo)
slouken@0
  1162
		os=-domain
slouken@0
  1163
		;;
slouken@0
  1164
	i386-sun)
slouken@0
  1165
		os=-sunos4.0.2
slouken@0
  1166
		;;
slouken@0
  1167
	m68000-sun)
slouken@0
  1168
		os=-sunos3
slouken@0
  1169
		# This also exists in the configure program, but was not the
slouken@0
  1170
		# default.
slouken@0
  1171
		# os=-sunos4
slouken@0
  1172
		;;
slouken@0
  1173
	m68*-cisco)
slouken@0
  1174
		os=-aout
slouken@0
  1175
		;;
slouken@0
  1176
	mips*-cisco)
slouken@0
  1177
		os=-elf
slouken@0
  1178
		;;
slouken@0
  1179
	mips*-*)
slouken@0
  1180
		os=-elf
slouken@0
  1181
		;;
slouken@0
  1182
	*-tti)	# must be before sparc entry or we get the wrong os.
slouken@0
  1183
		os=-sysv3
slouken@0
  1184
		;;
slouken@0
  1185
	sparc-* | *-sun)
slouken@0
  1186
		os=-sunos4.1.1
slouken@0
  1187
		;;
slouken@0
  1188
	*-be)
slouken@0
  1189
		os=-beos
slouken@0
  1190
		;;
slouken@0
  1191
	*-ibm)
slouken@0
  1192
		os=-aix
slouken@0
  1193
		;;
slouken@0
  1194
	*-wec)
slouken@0
  1195
		os=-proelf
slouken@0
  1196
		;;
slouken@0
  1197
	*-winbond)
slouken@0
  1198
		os=-proelf
slouken@0
  1199
		;;
slouken@0
  1200
	*-oki)
slouken@0
  1201
		os=-proelf
slouken@0
  1202
		;;
slouken@0
  1203
	*-hp)
slouken@0
  1204
		os=-hpux
slouken@0
  1205
		;;
slouken@0
  1206
	*-hitachi)
slouken@0
  1207
		os=-hiux
slouken@0
  1208
		;;
slouken@0
  1209
	i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
slouken@0
  1210
		os=-sysv
slouken@0
  1211
		;;
slouken@0
  1212
	*-cbm)
slouken@0
  1213
		os=-amigaos
slouken@0
  1214
		;;
slouken@0
  1215
	*-dg)
slouken@0
  1216
		os=-dgux
slouken@0
  1217
		;;
slouken@0
  1218
	*-dolphin)
slouken@0
  1219
		os=-sysv3
slouken@0
  1220
		;;
slouken@0
  1221
	m68k-ccur)
slouken@0
  1222
		os=-rtu
slouken@0
  1223
		;;
slouken@0
  1224
	m88k-omron*)
slouken@0
  1225
		os=-luna
slouken@0
  1226
		;;
slouken@0
  1227
	*-next )
slouken@0
  1228
		os=-nextstep
slouken@0
  1229
		;;
slouken@0
  1230
	*-sequent)
slouken@0
  1231
		os=-ptx
slouken@0
  1232
		;;
slouken@0
  1233
	*-crds)
slouken@0
  1234
		os=-unos
slouken@0
  1235
		;;
slouken@0
  1236
	*-ns)
slouken@0
  1237
		os=-genix
slouken@0
  1238
		;;
slouken@0
  1239
	i370-*)
slouken@0
  1240
		os=-mvs
slouken@0
  1241
		;;
slouken@0
  1242
	*-next)
slouken@0
  1243
		os=-nextstep3
slouken@0
  1244
		;;
slouken@0
  1245
        *-gould)
slouken@0
  1246
		os=-sysv
slouken@0
  1247
		;;
slouken@0
  1248
        *-highlevel)
slouken@0
  1249
		os=-bsd
slouken@0
  1250
		;;
slouken@0
  1251
	*-encore)
slouken@0
  1252
		os=-bsd
slouken@0
  1253
		;;
slouken@0
  1254
        *-sgi)
slouken@0
  1255
		os=-irix
slouken@0
  1256
		;;
slouken@0
  1257
        *-siemens)
slouken@0
  1258
		os=-sysv4
slouken@0
  1259
		;;
slouken@0
  1260
	*-masscomp)
slouken@0
  1261
		os=-rtu
slouken@0
  1262
		;;
slouken@53
  1263
	f30[01]-fujitsu | f700-fujitsu)
slouken@0
  1264
		os=-uxpv
slouken@0
  1265
		;;
slouken@0
  1266
	*-rom68k)
slouken@0
  1267
		os=-coff
slouken@0
  1268
		;;
slouken@0
  1269
	*-*bug)
slouken@0
  1270
		os=-coff
slouken@0
  1271
		;;
slouken@0
  1272
	*-apple)
slouken@0
  1273
		os=-macos
slouken@0
  1274
		;;
slouken@0
  1275
	*-atari*)
slouken@0
  1276
		os=-mint
slouken@0
  1277
		;;
slouken@0
  1278
	*)
slouken@0
  1279
		os=-none
slouken@0
  1280
		;;
slouken@0
  1281
esac
slouken@0
  1282
fi
slouken@0
  1283
slouken@0
  1284
# Here we handle the case where we know the os, and the CPU type, but not the
slouken@0
  1285
# manufacturer.  We pick the logical manufacturer.
slouken@0
  1286
vendor=unknown
slouken@0
  1287
case $basic_machine in
slouken@0
  1288
	*-unknown)
slouken@0
  1289
		case $os in
slouken@0
  1290
			-riscix*)
slouken@0
  1291
				vendor=acorn
slouken@0
  1292
				;;
slouken@0
  1293
			-sunos*)
slouken@0
  1294
				vendor=sun
slouken@0
  1295
				;;
slouken@0
  1296
			-aix*)
slouken@0
  1297
				vendor=ibm
slouken@0
  1298
				;;
slouken@0
  1299
			-beos*)
slouken@0
  1300
				vendor=be
slouken@0
  1301
				;;
slouken@0
  1302
			-hpux*)
slouken@0
  1303
				vendor=hp
slouken@0
  1304
				;;
slouken@0
  1305
			-mpeix*)
slouken@0
  1306
				vendor=hp
slouken@0
  1307
				;;
slouken@0
  1308
			-hiux*)
slouken@0
  1309
				vendor=hitachi
slouken@0
  1310
				;;
slouken@0
  1311
			-unos*)
slouken@0
  1312
				vendor=crds
slouken@0
  1313
				;;
slouken@0
  1314
			-dgux*)
slouken@0
  1315
				vendor=dg
slouken@0
  1316
				;;
slouken@0
  1317
			-luna*)
slouken@0
  1318
				vendor=omron
slouken@0
  1319
				;;
slouken@0
  1320
			-genix*)
slouken@0
  1321
				vendor=ns
slouken@0
  1322
				;;
slouken@53
  1323
			-mvs* | -opened*)
slouken@0
  1324
				vendor=ibm
slouken@0
  1325
				;;
slouken@0
  1326
			-ptx*)
slouken@0
  1327
				vendor=sequent
slouken@0
  1328
				;;
slouken@0
  1329
			-vxsim* | -vxworks*)
slouken@0
  1330
				vendor=wrs
slouken@0
  1331
				;;
slouken@0
  1332
			-aux*)
slouken@0
  1333
				vendor=apple
slouken@0
  1334
				;;
slouken@0
  1335
			-hms*)
slouken@0
  1336
				vendor=hitachi
slouken@0
  1337
				;;
slouken@0
  1338
			-mpw* | -macos*)
slouken@0
  1339
				vendor=apple
slouken@0
  1340
				;;
slouken@53
  1341
			-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
slouken@0
  1342
				vendor=atari
slouken@0
  1343
				;;
slouken@0
  1344
		esac
slouken@0
  1345
		basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
slouken@0
  1346
		;;
slouken@0
  1347
esac
slouken@0
  1348
slouken@0
  1349
echo $basic_machine$os
slouken@53
  1350
exit 0
slouken@53
  1351
slouken@53
  1352
# Local variables:
slouken@53
  1353
# eval: (add-hook 'write-file-hooks 'time-stamp)
slouken@53
  1354
# time-stamp-start: "timestamp='"
slouken@53
  1355
# time-stamp-format: "%:y-%02m-%02d"
slouken@53
  1356
# time-stamp-end: "'"
slouken@53
  1357
# End: