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