config.sub 17.5 KB
Newer Older
1
#! /bin/sh
2
# Configuration validation subroutine script, version 1.1.
3
#   Copyright (C) 1991, 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
4 5 6
# This file is (in principle) common to ALL GNU software.
# The presence of a machine in this file suggests that SOME GNU software
# can handle that machine.  It does not imply ALL GNU software can. 
7 8 9 10 11 12 13 14 15 16 17 18 19 20
#
# This file is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Richard M. Stallman's avatar
Richard M. Stallman committed
21

22 23 24 25
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
Richard M. Stallman's avatar
Richard M. Stallman committed
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42

# Configuration subroutine to validate and canonicalize a configuration type.
# Supply the specified configuration type as an argument.
# If it is invalid, we print an error message on stderr and exit with code 1.
# Otherwise, we print the canonical config type on stdout and succeed.

# This file is supposed to be the same for all GNU packages
# and recognize all the CPU types, system types and aliases
# that are meaningful with *any* GNU software.
# Each package is responsible for reporting which valid configurations
# it does not support.  The user should be able to distinguish
# a failure to support a valid configuration from a meaningless
# configuration.

# The goal of this file is to map all the various variations of a given
# machine specification into a single specification in the form:
#	CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
43
# It is wrong to echo any other type of specification.
Richard M. Stallman's avatar
Richard M. Stallman committed
44

Doug Evans's avatar
Doug Evans committed
45 46 47 48 49 50 51 52 53
if [ x$1 = x ]
then
	echo Configuration name missing. 1>&2
	echo "Usage: $0 CPU-MFR-OPSYS" 1>&2
	echo "or     $0 ALIAS" 1>&2
	echo where ALIAS is a recognized configuration type. 1>&2
	exit 1
fi

Richard M. Stallman's avatar
Richard M. Stallman committed
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
# First pass through any local machine types.
case $1 in
	*local*)
		echo $1
		exit 0
		;;
	*)
	;;
esac

# Separate what the user gave into CPU-COMPANY and OS (if any).
basic_machine=`echo $1 | sed 's/-[^-]*$//'`
if [ $basic_machine != $1 ]
then os=`echo $1 | sed 's/.*-/-/'`
else os=; fi

70 71 72 73
### Let's recognize common machines as not being operating systems so
### that things like config.sub decstation-3100 work.  We also
### recognize some manufacturers as not being operating systems, so we
### can provide default operating systems below.
Richard M. Stallman's avatar
Richard M. Stallman committed
74
case $os in
75 76 77
	-sun*os*)
		# Prevent following clause from handling this invalid input.
		;;
Richard M. Stallman's avatar
Richard M. Stallman committed
78 79
	-dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
	-att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
80
	-unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
81
	-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
Richard M. Stallman's avatar
Richard M. Stallman committed
82
	-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
83
	-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp )
Richard M. Stallman's avatar
Richard M. Stallman committed
84 85 86
		os=
		basic_machine=$1
		;;
Richard Kenner's avatar
Richard Kenner committed
87
	-hiux*)
Richard Kenner's avatar
Richard Kenner committed
88
		os=-hiuxwe2
Richard Kenner's avatar
Richard Kenner committed
89
		;;
90 91 92 93 94 95 96 97
	-sco4)
		os=-sco3.2v4
		basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'`
		;;
	-sco3.2.[4-9]*)
		os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
		basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'`
		;;
98 99
	-sco3.2v[4-9]*)
		# Don't forget version if it is 3.2v4 or newer.
100
		basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'`
101
		;;
Richard M. Stallman's avatar
Richard M. Stallman committed
102
	-sco*)
103
		os=-sco3.2v2
104
		basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'`
Richard M. Stallman's avatar
Richard M. Stallman committed
105
		;;
106 107
	-isc)
		os=-isc2.2
108
		basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'`
109
		;;
110 111 112
	-clix*)
		basic_machine=clipper-intergraph
		;;
Richard M. Stallman's avatar
Richard M. Stallman committed
113
	-isc*)
114
		basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'`
Richard M. Stallman's avatar
Richard M. Stallman committed
115
		;;
Doug Evans's avatar
Doug Evans committed
116
	-lynx*)
Jim Wilson's avatar
Jim Wilson committed
117 118
		os=-lynxos
		;;
119 120 121
	-ptx*)
		basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
		;;
Richard Kenner's avatar
Richard Kenner committed
122 123 124
	-windowsnt*)
		os=`echo $os | sed -e 's/windowsnt/winnt/'`
		;;
Richard M. Stallman's avatar
Richard M. Stallman committed
125 126 127 128
esac

# Decode aliases for certain CPU-COMPANY combinations.
case $basic_machine in
Doug Evans's avatar
Doug Evans committed
129
	# Recognize the basic CPU types without company name.
Richard M. Stallman's avatar
Richard M. Stallman committed
130
	# Some are omitted here because they have special meanings below.
Richard M. Stallman's avatar
Richard M. Stallman committed
131
	tahoe | i[345]86 | i860 | m68k | m68000 | m88k | ns32k | arm | pyramid \
Richard Kenner's avatar
Richard Kenner committed
132
		| tron | a29k | 580 | i960 | h8300 | hppa1.0 | hppa1.1 \
Richard M. Stallman's avatar
Richard M. Stallman committed
133
		| alpha | we32k | ns16k | clipper | sparclite | i370 | sh \
134
		| powerpc | powerpcle | sparc64 | 1750a | dsp16xx | mips64 | mipsel \
Doug Evans's avatar
Doug Evans committed
135 136
		| pdp11 | mips64el | mips64orion | mips64orionel \
		| sparc)
Richard M. Stallman's avatar
Richard M. Stallman committed
137 138
		basic_machine=$basic_machine-unknown
		;;
139 140 141 142 143
	# Object if more than one company name word.
	*-*-*)
		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
		exit 1
		;;
Doug Evans's avatar
Doug Evans committed
144
	# Recognize the basic CPU types with company name.
Richard M. Stallman's avatar
Richard M. Stallman committed
145
	vax-* | tahoe-* | i[345]86-* | i860-* | m68k-* | m68000-* | m88k-* \
Richard M. Stallman's avatar
Richard M. Stallman committed
146
	      | sparc-* | ns32k-* | fx80-* | arm-* | c[123]* \
147
	      | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* | power-* \
Richard M. Stallman's avatar
Richard M. Stallman committed
148
	      | none-* | 580-* | cray2-* | h8300-* | i960-* | xmp-* | ymp-* \
149
	      | hppa1.0-* | hppa1.1-* | alpha-* | we32k-* | cydra-* | ns16k-* \
Steve Chamberlain's avatar
Steve Chamberlain committed
150
	      | pn-* | np1-* | xps100-* | clipper-* | orion-* | sparclite-* \
151
	      | pdp11-* | sh-* | powerpc-* | powerpcle-* | sparc64-* | mips64-* | mipsel-* \
Doug Evans's avatar
Doug Evans committed
152
	      | mips64el-* | mips64orion-* | mips64orionel-*)
Richard M. Stallman's avatar
Richard M. Stallman committed
153
		;;
Doug Evans's avatar
Doug Evans committed
154 155
	# Recognize the various machine names and aliases which stand
	# for a CPU type and a company and sometimes even an OS.
156 157
	3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
		basic_machine=m68000-att
Richard M. Stallman's avatar
Richard M. Stallman committed
158
		;;
159 160
	3b*)
		basic_machine=we32k-att
Richard M. Stallman's avatar
Richard M. Stallman committed
161
		;;
162 163
	alliant | fx80)
		basic_machine=fx80-alliant
Richard M. Stallman's avatar
Richard M. Stallman committed
164
		;;
165 166
	altos | altos3068)
		basic_machine=m68k-altos
Richard M. Stallman's avatar
Richard M. Stallman committed
167
		;;
168 169 170
	am29k)
		basic_machine=a29k-none
		os=-bsd
171
		;;
172 173
	amdahl)
		basic_machine=580-amdahl
174 175
		os=-sysv
		;;
176
	amiga | amiga-*)
177
		basic_machine=m68k-cbm
178
		;;
179 180 181
	amigados)
		basic_machine=m68k-cbm
		os=-amigados
Richard M. Stallman's avatar
Richard M. Stallman committed
182
		;;
183 184 185
	amigaunix | amix)
		basic_machine=m68k-cbm
		os=-sysv4
Richard M. Stallman's avatar
Richard M. Stallman committed
186
		;;
187 188 189 190 191 192 193
	apollo68)
		basic_machine=m68k-apollo
		os=-sysv
		;;
	balance)
		basic_machine=ns32k-sequent
		os=-dynix
Richard M. Stallman's avatar
Richard M. Stallman committed
194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214
		;;
	convex-c1)
		basic_machine=c1-convex
		os=-bsd
		;;
	convex-c2)
		basic_machine=c2-convex
		os=-bsd
		;;
	convex-c32)
		basic_machine=c32-convex
		os=-bsd
		;;
	convex-c34)
		basic_machine=c34-convex
		os=-bsd
		;;
	convex-c38)
		basic_machine=c38-convex
		os=-bsd
		;;
215 216 217
	cray | ymp)
		basic_machine=ymp-cray
		os=-unicos
Richard M. Stallman's avatar
Richard M. Stallman committed
218
		;;
219 220 221
	cray2)
		basic_machine=cray2-cray
		os=-unicos
Richard M. Stallman's avatar
Richard M. Stallman committed
222 223 224 225
		;;
	crds | unos)
		basic_machine=m68k-crds
		;;
226 227 228 229
	da30 | da30-*)
		basic_machine=m68k-da30
		;;
	decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
230
		basic_machine=mips-dec
231
		;;
Richard M. Stallman's avatar
Richard M. Stallman committed
232 233 234 235
	delta | 3300 | motorola-3300 | motorola-delta \
	      | 3300-motorola | delta-motorola)
		basic_machine=m68k-motorola
		;;
236 237 238
	delta88)
		basic_machine=m88k-motorola
		os=-sysv3
Richard M. Stallman's avatar
Richard M. Stallman committed
239
		;;
Richard Kenner's avatar
Richard Kenner committed
240 241 242 243
	dpx20 | dpx20-*)
		basic_machine=rs6000-bull
		os=-bosx
		;;
244 245 246
	dpx2* | dpx2*-bull)
		basic_machine=m68k-bull
		os=-sysv3
Richard M. Stallman's avatar
Richard M. Stallman committed
247
		;;
248 249 250
	ebmon29k)
		basic_machine=a29k-amd
		os=-ebmon
Richard M. Stallman's avatar
Richard M. Stallman committed
251
		;;
252 253 254
	elxsi)
		basic_machine=elxsi-elxsi
		os=-bsd
Richard M. Stallman's avatar
Richard M. Stallman committed
255
		;;
256 257
	encore | umax | mmax)
		basic_machine=ns32k-encore
Richard M. Stallman's avatar
Richard M. Stallman committed
258
		;;
259 260
	fx2800)
		basic_machine=i860-alliant
Richard M. Stallman's avatar
Richard M. Stallman committed
261
		;;
262 263
	genix)
		basic_machine=ns32k-ns
Richard M. Stallman's avatar
Richard M. Stallman committed
264
		;;
265 266 267
	gmicro)
		basic_machine=tron-gmicro
		os=-sysv
Richard M. Stallman's avatar
Richard M. Stallman committed
268
		;;
269 270 271
	h3050r* | hiux*)
		basic_machine=hppa1.1-hitachi
		os=-hiuxwe2
Richard M. Stallman's avatar
Richard M. Stallman committed
272
		;;
273 274 275
	h8300hms)
		basic_machine=h8300-hitachi
		os=-hms
Richard M. Stallman's avatar
Richard M. Stallman committed
276
		;;
277 278 279
	harris)
		basic_machine=m88k-harris
		os=-sysv3
280
		;;
281 282 283
	hp300-*)
		basic_machine=m68k-hp
		;;
284 285
	hp300bsd)
		basic_machine=m68k-hp
286
		os=-bsd
Richard M. Stallman's avatar
Richard M. Stallman committed
287
		;;
288 289 290
	hp300hpux)
		basic_machine=m68k-hp
		os=-hpux
291
		;;
292 293
	hp9k2[0-9][0-9] | hp9k31[0-9])
		basic_machine=m68000-hp
294
		;;
Richard M. Stallman's avatar
Richard M. Stallman committed
295 296 297
	hp9k3[2-9][0-9])
		basic_machine=m68k-hp
		;;
Torbjorn Granlund's avatar
Torbjorn Granlund committed
298 299
	hp9k7[0-9][0-9] | hp7[0-9][0-9] | hp9k8[0-9]7 | hp8[0-9]7)
		basic_machine=hppa1.1-hp
Richard M. Stallman's avatar
Richard M. Stallman committed
300
		;;
Torbjorn Granlund's avatar
Torbjorn Granlund committed
301 302
	hp9k8[0-9][0-9] | hp8[0-9][0-9])
		basic_machine=hppa1.0-hp
303
		;;
304 305 306
	i370-ibm* | ibm*)
		basic_machine=i370-ibm
		os=-mvs
Richard Kenner's avatar
Richard Kenner committed
307
		;;
308
# I'm not sure what "Sysv32" means.  Should this be sysv3.2?
Richard M. Stallman's avatar
Richard M. Stallman committed
309
	i[345]86v32)
310 311 312
		basic_machine=`echo $1 | sed -e 's/86.*/86-unknown/'`
		os=-sysv32
		;;
Richard M. Stallman's avatar
Richard M. Stallman committed
313
	i[345]86v4*)
314 315 316
		basic_machine=`echo $1 | sed -e 's/86.*/86-unknown/'`
		os=-sysv4
		;;
Richard M. Stallman's avatar
Richard M. Stallman committed
317
	i[345]86v)
318 319 320
		basic_machine=`echo $1 | sed -e 's/86.*/86-unknown/'`
		os=-sysv
		;;
Richard M. Stallman's avatar
Richard M. Stallman committed
321
	i[345]86sol2)
322 323 324 325 326 327 328 329 330 331 332 333
		basic_machine=`echo $1 | sed -e 's/86.*/86-unknown/'`
		os=-solaris2
		;;
	iris | iris4d)
		basic_machine=mips-sgi
		case $os in
		    -irix*)
			;;
		    *)
			os=-irix4
			;;
		esac
Richard Kenner's avatar
Richard Kenner committed
334
		;;
Richard M. Stallman's avatar
Richard M. Stallman committed
335 336 337 338
	isi68 | isi)
		basic_machine=m68k-isi
		os=-sysv
		;;
339 340 341 342 343
	m88k-omron*)
		basic_machine=m88k-omron
		;;
	magnum | m3230)
		basic_machine=mips-mips
Richard M. Stallman's avatar
Richard M. Stallman committed
344 345
		os=-sysv
		;;
346 347 348
	merlin)
		basic_machine=ns32k-utek
		os=-sysv
Richard M. Stallman's avatar
Richard M. Stallman committed
349 350 351 352
		;;
	miniframe)
		basic_machine=m68000-convergent
		;;
353 354 355 356 357 358
	mips3*-*)
		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
		;;
	mips3*)
		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
		;;
359 360 361 362 363 364 365 366 367 368 369
	ncr3000)
		basic_machine=i486-ncr
		os=-sysv4
		;;
	news | news700 | news800 | news900)
		basic_machine=m68k-sony
		os=-newsos
		;;
	news1000)
		basic_machine=m68030-sony
		os=-newsos
Richard M. Stallman's avatar
Richard M. Stallman committed
370 371 372 373 374
		;;
	news-3600 | risc-news)
		basic_machine=mips-sony
		os=-newsos
		;;
375
	next | m*-next )
376
		basic_machine=m68k-next
377
		case $os in
378 379
		    -nextstep* )
			;;
380
		    -ns2*)
381
		      os=-nextstep2
382 383
			;;
		    *)
384
		      os=-nextstep3
385 386
			;;
		esac
Richard M. Stallman's avatar
Richard M. Stallman committed
387
		;;
388 389 390
	nh3000)
		basic_machine=m68k-harris
		os=-cxux
Richard M. Stallman's avatar
Richard M. Stallman committed
391
		;;
392 393 394
	nh[45]000)
		basic_machine=m88k-harris
		os=-cxux
Richard M. Stallman's avatar
Richard M. Stallman committed
395
		;;
396 397 398
	nindy960)
		basic_machine=i960-intel
		os=-nindy
Richard M. Stallman's avatar
Richard M. Stallman committed
399
		;;
400 401
	np1)
		basic_machine=np1-gould
Richard M. Stallman's avatar
Richard M. Stallman committed
402
		;;
403 404 405
	pa-hitachi)
		basic_machine=hppa1.1-hitachi
		os=-hiuxwe2
Richard M. Stallman's avatar
Richard M. Stallman committed
406
		;;
407 408 409
	paragon)
		basic_machine=i860-intel
		os=-osf
Richard M. Stallman's avatar
Richard M. Stallman committed
410
		;;
411 412
	pbd)
		basic_machine=sparc-tti
Richard M. Stallman's avatar
Richard M. Stallman committed
413
		;;
414 415
	pbb)
		basic_machine=m68k-tti
Richard M. Stallman's avatar
Richard M. Stallman committed
416
		;;
Charles Hannum's avatar
Charles Hannum committed
417 418
        pc532 | pc532-*)
		basic_machine=ns32k-pc532
Richard M. Stallman's avatar
Richard M. Stallman committed
419
		;;
420 421 422 423 424 425 426 427 428 429 430 431 432 433 434
	pentium | p5 | p6)
		# We don't have specific support for the Intel Pentium (p6) followon yet, so just call it a Pentium
		basic_machine=i586-intel
		;;
	pentium-* | p5-* | p6-*)
		# We don't have specific support for the Intel Pentium (p6) followon yet, so just call it a Pentium
		basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
		;;
	k5)
		# We don't have specific support for AMD's K5 yet, so just call it a Pentium
		basic_machine=i586-amd
		;;
	nexen)
		# We don't have specific support for Nexgen yet, so just call it a Pentium
		basic_machine=i586-nexgen
435
		;;
436 437 438
	pn)
		basic_machine=pn-gould
		;;
439 440 441 442 443 444 445 446 447 448 449 450
	power)	basic_machine=rs6000-ibm
		;;
	ppc)	basic_machine=powerpc-unknown
	        ;;
	ppc-*)	basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
		;;
	ppcle | powerpclittle | ppc-le | powerpc-little)
		basic_machine=powerpcle-unknown
	        ;;
	ppcle-* | powerpclittle-*)
		basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
		;;
451 452 453
	ps2)
		basic_machine=i386-ibm
		;;
454 455 456
	rm[46]00)
		basic_machine=mips-siemens
		;;
457 458 459
	rtpc | rtpc-*)
		basic_machine=romp-ibm
		;;
460 461 462
	sequent)
		basic_machine=i386-sequent
		;;
463 464 465
	sh)
		basic_machine=sh-hitachi
		os=-hms
466 467 468 469
		;;
	sps7)
		basic_machine=m68k-bull
		os=-sysv2
Richard M. Stallman's avatar
Richard M. Stallman committed
470
		;;
471 472
	spur)
		basic_machine=spur-unknown
Richard M. Stallman's avatar
Richard M. Stallman committed
473
		;;
474 475
	sun2)
		basic_machine=m68000-sun
Steve Chamberlain's avatar
Steve Chamberlain committed
476
		;;
477 478 479
	sun2os3)
		basic_machine=m68000-sun
		os=-sunos3
Richard M. Stallman's avatar
Richard M. Stallman committed
480
		;;
481 482 483
	sun2os4)
		basic_machine=m68000-sun
		os=-sunos4
Richard M. Stallman's avatar
Richard M. Stallman committed
484
		;;
485 486 487
	sun3os3)
		basic_machine=m68k-sun
		os=-sunos3
Richard M. Stallman's avatar
Richard M. Stallman committed
488
		;;
489 490 491
	sun3os4)
		basic_machine=m68k-sun
		os=-sunos4
Richard M. Stallman's avatar
Richard M. Stallman committed
492
		;;
493 494 495
	sun4os3)
		basic_machine=sparc-sun
		os=-sunos3
Richard M. Stallman's avatar
Richard M. Stallman committed
496
		;;
497 498 499
	sun4os4)
		basic_machine=sparc-sun
		os=-sunos4
Richard M. Stallman's avatar
Richard M. Stallman committed
500
		;;
501 502 503 504
	sun4sol2)
		basic_machine=sparc-sun
		os=-solaris2
		;;
505
	sun3 | sun3-*)
506
		basic_machine=m68k-sun
Richard M. Stallman's avatar
Richard M. Stallman committed
507
		;;
508 509
	sun4)
		basic_machine=sparc-sun
Richard M. Stallman's avatar
Richard M. Stallman committed
510
		;;
511 512
	sun386 | sun386i | roadrunner)
		basic_machine=i386-sun
Richard M. Stallman's avatar
Richard M. Stallman committed
513
		;;
514 515 516
	symmetry)
		basic_machine=i386-sequent
		os=-dynix
Richard M. Stallman's avatar
Richard M. Stallman committed
517
		;;
518 519
	tower | tower-32)
		basic_machine=m68k-ncr
Richard M. Stallman's avatar
Richard M. Stallman committed
520
		;;
Doug Evans's avatar
Doug Evans committed
521 522 523 524
	udi29k)
		basic_machine=a29k-amd
		os=-udi
		;;
Richard M. Stallman's avatar
Richard M. Stallman committed
525 526 527 528
	ultra3)
		basic_machine=a29k-nyu
		os=-sym1
		;;
529 530 531 532 533 534 535 536
	vaxv)
		basic_machine=vax-dec
		os=-sysv
		;;
	vms)
		basic_machine=vax-dec
		os=-vms
		;;
Richard M. Stallman's avatar
Richard M. Stallman committed
537 538 539 540 541 542 543 544
	vxworks960)
		basic_machine=i960-wrs
		os=-vxworks
		;;
	vxworks68)
		basic_machine=m68k-wrs
		os=-vxworks
		;;
Doug Evans's avatar
Doug Evans committed
545 546 547 548
	vxworks29k)
		basic_machine=a29k-wrs
		os=-vxworks
		;;
549 550 551 552
	xmp)
		basic_machine=xmp-cray
		os=-unicos
		;;
553 554 555
        xps | xps100)
		basic_machine=xps100-honeywell
		;;
Richard M. Stallman's avatar
Richard M. Stallman committed
556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574
	none)
		basic_machine=none-none
		os=-none
		;;

# Here we handle the default manufacturer of certain CPU types.  It is in
# some cases the only manufacturer, in others, it is the most popular.
	mips)
		basic_machine=mips-mips
		;;
	romp)
		basic_machine=romp-ibm
		;;
	rs6000)
		basic_machine=rs6000-ibm
		;;
	vax)
		basic_machine=vax-dec
		;;
Richard Kenner's avatar
Richard Kenner committed
575 576 577
	pdp11)
		basic_machine=pdp11-dec
		;;
578 579 580
	we32k)
		basic_machine=we32k-att
		;;
Richard M. Stallman's avatar
Richard M. Stallman committed
581 582 583
	sparc)
		basic_machine=sparc-sun
		;;
584 585 586 587 588 589 590 591 592
        cydra)
		basic_machine=cydra-cydrome
		;;
	orion)
		basic_machine=orion-highlevel
		;;
	orion105)
		basic_machine=clipper-highlevel
		;;
Richard M. Stallman's avatar
Richard M. Stallman committed
593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612
	*)
		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
		exit 1
		;;
esac

# Here we canonicalize certain aliases for manufacturers.
case $basic_machine in
	*-digital*)
		basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
		;;
	*-commodore*)
		basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
		;;
	*)
		;;
esac

# Decode manufacturer-specific aliases for certain operating systems.

613
if [ x"$os" != x"" ]
Richard M. Stallman's avatar
Richard M. Stallman committed
614 615
then
case $os in
616 617 618 619
	# -solaris* is a basic system type, with this one exception.
	-solaris1 | -solaris1.*)
		os=`echo $os | sed -e 's|solaris1|sunos4|'`
		;;
620 621 622
	-solaris)
		os=-solaris2
		;;
623 624 625
	-unixware* | svr4*)
		os=-sysv4
		;;
626 627 628
	-gnu/linux*)
		os=`echo $os | sed -e 's|gnu/linux|linux|'`
		;;
Richard M. Stallman's avatar
Richard M. Stallman committed
629 630
	# First accept the basic system types.
	# The portable systems comes first.
631
	# Each alternative MUST END IN A *, to match a version number.
632
	# -sysv* is not here because it comes later, after sysvr4.
633
	-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
Richard M. Stallman's avatar
Richard M. Stallman committed
634
	      | -vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[345]* \
Richard Kenner's avatar
Richard Kenner committed
635
	      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
Torbjorn Granlund's avatar
Torbjorn Granlund committed
636
	      | -amigados* | -msdos* | -newsos* | -unicos* | -aos* \
Jim Wilson's avatar
Jim Wilson committed
637
	      | -nindy* | -vxworks* | -ebmon* | -hms* | -mvs* | -clix* \
Richard M. Stallman's avatar
Richard M. Stallman committed
638
	      | -riscos* | -linux* | -uniplus* | -iris* | -rtu* | -xenix* \
Richard Kenner's avatar
Richard Kenner committed
639
	      | -hiux* | -386bsd* | -netbsd* | -freebsd* | -riscix* \
640
	      | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* \
641 642 643
	      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
	      | -udi* | -eabi* | -lites* )
	# Remember, each alternative MUST END IN *, to match a version number.
Richard M. Stallman's avatar
Richard M. Stallman committed
644
		;;
645 646 647 648 649 650
	-sunos5*)
		os=`echo $os | sed -e 's|sunos5|solaris2|'`
		;;
	-sunos6*)
		os=`echo $os | sed -e 's|sunos6|solaris3|'`
		;;
Richard M. Stallman's avatar
Richard M. Stallman committed
651
	-osfrose*)
652
		os=-osfrose
Richard M. Stallman's avatar
Richard M. Stallman committed
653 654
		;;
	-osf*)
655
		os=-osf
Richard M. Stallman's avatar
Richard M. Stallman committed
656
		;;
Charles Hannum's avatar
Charles Hannum committed
657 658 659
	-utek*)
		os=-bsd
		;;
Richard M. Stallman's avatar
Richard M. Stallman committed
660 661 662 663 664 665 666 667 668
	-dynix*)
		os=-bsd
		;;
	-acis*)
		os=-aos
		;;
	-ctix* | -uts*)
		os=-sysv
		;;
669 670 671 672 673 674 675
	# Preserve the version number of sinix5.
	-sinix5.*)
		os=`echo $os | sed -e 's|sinix|sysv|'`
		;;
	-sinix*)
		os=-sysv4
		;;
Richard M. Stallman's avatar
Richard M. Stallman committed
676 677 678 679 680 681 682 683 684
	-triton*)
		os=-sysv3
		;;
	-oss*)
		os=-sysv3
		;;
	-svr4)
		os=-sysv4
		;;
685 686 687
	-svr3)
		os=-sysv3
		;;
688 689 690
	-sysvr4)
		os=-sysv4
		;;
691 692
	# This must come after -sysvr4.
	-sysv*)
Richard M. Stallman's avatar
Richard M. Stallman committed
693
		;;
694 695 696
	-xenix)
		os=-xenix
		;;
697 698
	-none)
		;;
Richard M. Stallman's avatar
Richard M. Stallman committed
699 700
	*)
		# Get rid of the `-' at the beginning of $os.
701
		os=`echo $os | sed 's/[^-]*-//'`
Richard M. Stallman's avatar
Richard M. Stallman committed
702 703 704 705 706 707 708 709 710
		echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
		exit 1
		;;
esac
else

# Here we handle the default operating systems that come with various machines.
# The value should be what the vendor currently ships out the door with their
# machine or put another way, the most popular os provided with the machine.
711 712 713 714 715 716 717

# Note that if you're going to try to match "-MANUFACTURER" here (say,
# "-sun"), then you have to tell the case statement up towards the top
# that MANUFACTURER isn't an operating system.  Otherwise, code above
# will signal an error saying that MANUFACTURER isn't an operating
# system, and we'll never get to this point.

Richard M. Stallman's avatar
Richard M. Stallman committed
718
case $basic_machine in
719 720 721
	*-acorn)
		os=-riscix1.2
		;;
Richard Kenner's avatar
Richard Kenner committed
722 723 724
        pdp11-*)
		os=-none
		;;
Richard M. Stallman's avatar
Richard M. Stallman committed
725
	*-dec | vax-*)
Michael Meissner's avatar
Michael Meissner committed
726
		os=-ultrix4.2
Richard M. Stallman's avatar
Richard M. Stallman committed
727
		;;
728 729 730
	m68*-apollo)
		os=-domain
		;;
Richard M. Stallman's avatar
Richard M. Stallman committed
731
	i386-sun)
Michael Meissner's avatar
Michael Meissner committed
732
		os=-sunos4.0.2
Richard M. Stallman's avatar
Richard M. Stallman committed
733 734 735 736 737 738 739 740 741 742 743
		;;
	m68000-sun)
		os=-sunos3
		# This also exists in the configure program, but was not the
		# default.
		# os=-sunos4
		;;
	*-tti)	# must be before sparc entry or we get the wrong os.
		os=-sysv3
		;;
	sparc-* | *-sun)
Michael Meissner's avatar
Michael Meissner committed
744
		os=-sunos4.1.1
Richard M. Stallman's avatar
Richard M. Stallman committed
745 746 747 748 749 750 751
		;;
	*-ibm)
		os=-aix
		;;
	*-hp)
		os=-hpux
		;;
Richard Kenner's avatar
Richard Kenner committed
752 753 754
	*-hitachi)
		os=-hiux
		;;
755
	i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
Richard M. Stallman's avatar
Richard M. Stallman committed
756 757 758 759 760 761 762 763 764 765 766
		os=-sysv
		;;
	*-cbm)
		os=-amigados
		;;
	*-dg)
		os=-dgux
		;;
	*-dolphin)
		os=-sysv3
		;;
767 768 769
	m68k-ccur)
		os=-rtu
		;;
Richard M. Stallman's avatar
Richard M. Stallman committed
770 771 772
	m88k-omron*)
		os=-luna
		;;
773
	*-sequent)
774
		os=-ptx
775
		;;
Richard M. Stallman's avatar
Richard M. Stallman committed
776 777 778 779 780 781
	*-crds)
		os=-unos
		;;
	*-ns)
		os=-genix
		;;
Richard M. Stallman's avatar
Richard M. Stallman committed
782 783 784
	i370-*)
		os=-mvs
		;;
Tom Wood's avatar
Tom Wood committed
785
	*-next)
786
		os=-nextstep3
Tom Wood's avatar
Tom Wood committed
787
		;;
788 789 790 791 792 793 794 795 796 797 798 799
        *-gould)
		os=-sysv
		;;
        *-highlevel)
		os=-bsd
		;;
	*-encore)
		os=-bsd
		;;
        *-sgi)
		os=-irix
		;;
800 801 802
        *-siemens)
		os=-sysv4
		;;
803 804 805
	*-masscomp)
		os=-rtu
		;;
Richard M. Stallman's avatar
Richard M. Stallman committed
806 807 808 809 810 811 812 813 814 815 816 817
	*)
		os=-none
		;;
esac
fi

# Here we handle the case where we know the os, and the CPU type, but not the
# manufacturer.  We pick the logical manufacturer.
vendor=unknown
case $basic_machine in
	*-unknown)
		case $os in
818 819 820
			-riscix*)
				vendor=acorn
				;;
Richard M. Stallman's avatar
Richard M. Stallman committed
821 822 823
			-sunos*)
				vendor=sun
				;;
Jim Wilson's avatar
Jim Wilson committed
824 825 826
			-lynxos*)
				vendor=lynx
				;;
Richard M. Stallman's avatar
Richard M. Stallman committed
827 828 829 830 831 832
			-aix*)
				vendor=ibm
				;;
			-hpux*)
				vendor=hp
				;;
Richard Kenner's avatar
Richard Kenner committed
833 834 835
			-hiux*)
				vendor=hitachi
				;;
Richard M. Stallman's avatar
Richard M. Stallman committed
836 837 838 839 840 841 842 843 844 845 846 847
			-unos*)
				vendor=crds
				;;
			-dgux*)
				vendor=dg
				;;
			-luna*)
				vendor=omron
				;;
			-genix*)
				vendor=ns
				;;
Richard M. Stallman's avatar
Richard M. Stallman committed
848 849 850
			-mvs*)
				vendor=ibm
				;;
851 852 853
			-ptx*)
				vendor=sequent
				;;
Doug Evans's avatar
Doug Evans committed
854 855 856
			-vxworks*)
				vendor=wrs
				;;
Richard M. Stallman's avatar
Richard M. Stallman committed
857 858 859 860 861 862
		esac
		basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
		;;
esac

echo $basic_machine$os