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