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