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