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