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