See ChangeLog: Wed Feb 10 17:15:39 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         emx)
286                 basic_machine=i386-emx
287                 ;;
288         aux)
289                 basic_machine=m68k-apple
290                 os=-aux
291                 ;;
292         balance)
293                 basic_machine=ns32k-sequent
294                 os=-dynix
295                 ;;
296         convex-c1)
297                 basic_machine=c1-convex
298                 os=-bsd
299                 ;;
300         convex-c2)
301                 basic_machine=c2-convex
302                 os=-bsd
303                 ;;
304         convex-c32)
305                 basic_machine=c32-convex
306                 os=-bsd
307                 ;;
308         convex-c34)
309                 basic_machine=c34-convex
310                 os=-bsd
311                 ;;
312         convex-c38)
313                 basic_machine=c38-convex
314                 os=-bsd
315                 ;;
316         cray | ymp)
317                 basic_machine=ymp-cray
318                 os=-unicos
319                 ;;
320         cray2)
321                 basic_machine=cray2-cray
322                 os=-unicos
323                 ;;
324         [ctj]90-cray)
325                 basic_machine=c90-cray
326                 os=-unicos
327                 ;;
328         crds | unos)
329                 basic_machine=m68k-crds
330                 ;;
331         da30 | da30-*)
332                 basic_machine=m68k-da30
333                 ;;
334         decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
335                 basic_machine=mips-dec
336                 ;;
337         delta | 3300 | motorola-3300 | motorola-delta \
338               | 3300-motorola | delta-motorola)
339                 basic_machine=m68k-motorola
340                 ;;
341         delta88)
342                 basic_machine=m88k-motorola
343                 os=-sysv3
344                 ;;
345         dpx20 | dpx20-*)
346                 basic_machine=rs6000-bull
347                 os=-bosx
348                 ;;
349         dpx2* | dpx2*-bull)
350                 basic_machine=m68k-bull
351                 os=-sysv3
352                 ;;
353         ebmon29k)
354                 basic_machine=a29k-amd
355                 os=-ebmon
356                 ;;
357         elxsi)
358                 basic_machine=elxsi-elxsi
359                 os=-bsd
360                 ;;
361         encore | umax | mmax)
362                 basic_machine=ns32k-encore
363                 ;;
364         es1800 | OSE68k | ose68k | ose | OSE)           # CYGNUS LOCAL
365                 basic_machine=m68k-ericsson
366                 os=-ose
367                 ;;
368         fx2800)
369                 basic_machine=i860-alliant
370                 ;;
371         genix)
372                 basic_machine=ns32k-ns
373                 ;;
374         gmicro)
375                 basic_machine=tron-gmicro
376                 os=-sysv
377                 ;;
378         hiuxmpp)
379                 basic_machine=hppa1.1-hitachi
380                 os=-hiuxmpp
381                 ;;
382         h3050r* | hiux*)
383                 basic_machine=hppa1.1-hitachi
384                 os=-hiuxwe2
385                 ;;
386         h8300hms)
387                 basic_machine=h8300-hitachi
388                 os=-hms
389                 ;;
390         h8300xray)                                      # CYGNUS LOCAL
391                 basic_machine=h8300-hitachi
392                 os=-xray
393                 ;;
394         h8500hms)                                       # CYGNUS LOCAL
395                 basic_machine=h8500-hitachi
396                 os=-hms
397                 ;;
398         harris)
399                 basic_machine=m88k-harris
400                 os=-sysv3
401                 ;;
402         hp300-*)
403                 basic_machine=m68k-hp
404                 ;;
405         hp300bsd)
406                 basic_machine=m68k-hp
407                 os=-bsd
408                 ;;
409         hp300hpux)
410                 basic_machine=m68k-hp
411                 os=-hpux
412                 ;;
413         w89k-*)                                         # CYGNUS LOCAL
414                 basic_machine=hppa1.1-winbond
415                 os=-proelf
416                 ;;
417         op50n-*)                                        # CYGNUS LOCAL
418                 basic_machine=hppa1.1-oki
419                 os=-proelf
420                 ;;
421         op60c-*)                                        # CYGNUS LOCAL
422                 basic_machine=hppa1.1-oki
423                 os=-proelf
424                 ;;
425         hppro)                                          # CYGNUS LOCAL
426                 basic_machine=hppa1.1-hp
427                 os=-proelf
428                 ;;
429         hp9k2[0-9][0-9] | hp9k31[0-9])
430                 basic_machine=m68000-hp
431                 ;;
432         hp9k3[2-9][0-9])
433                 basic_machine=m68k-hp
434                 ;;
435         hp9k7[0-9][0-9] | hp7[0-9][0-9] | hp9k8[0-9]7 | hp8[0-9]7)
436                 basic_machine=hppa1.1-hp
437                 ;;
438         hp9k8[0-9][0-9] | hp8[0-9][0-9])
439                 basic_machine=hppa1.0-hp
440                 ;;
441         hppa-next)
442                 os=-nextstep3
443                 ;;
444         hppaosf)                                        # CYGNUS LOCAL
445                 basic_machine=hppa1.1-hp
446                 os=-osf
447                 ;;
448         i370-ibm* | ibm*)
449                 basic_machine=i370-ibm
450                 os=-mvs
451                 ;;
452 # I'm not sure what "Sysv32" means.  Should this be sysv3.2?
453         i[3456]86v32)
454                 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
455                 os=-sysv32
456                 ;;
457         i[3456]86v4*)
458                 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
459                 os=-sysv4
460                 ;;
461         i[3456]86v)
462                 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
463                 os=-sysv
464                 ;;
465         i[3456]86sol2)
466                 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
467                 os=-solaris2
468                 ;;
469         i386mach)                                       # CYGNUS LOCAL
470                 basic_machine=i386-mach
471                 os=-mach
472                 ;;
473         i386-vsta | vsta)                               # CYGNUS LOCAL
474                 basic_machine=i386-unknown
475                 os=-vsta
476                 ;;
477         i386-go32 | go32)                               # CYGNUS LOCAL
478                 basic_machine=i386-unknown
479                 os=-go32
480                 ;;
481         iris | iris4d)
482                 basic_machine=mips-sgi
483                 case $os in
484                     -irix*)
485                         ;;
486                     *)
487                         os=-irix4
488                         ;;
489                 esac
490                 ;;
491         isi68 | isi)
492                 basic_machine=m68k-isi
493                 os=-sysv
494                 ;;
495         m88k-omron*)
496                 basic_machine=m88k-omron
497                 ;;
498         magnum | m3230)
499                 basic_machine=mips-mips
500                 os=-sysv
501                 ;;
502         merlin)
503                 basic_machine=ns32k-utek
504                 os=-sysv
505                 ;;
506         miniframe)
507                 basic_machine=m68000-convergent
508                 ;;
509         mipsel*-linux*)
510                 basic_machine=mipsel-unknown
511                 os=-linux
512                 ;;
513         mips*-linux*)
514                 basic_machine=mips-unknown
515                 os=-linux
516                 ;;
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                 ;;
523         monitor)                                        # CYGNUS LOCAL
524                 basic_machine=m68k-rom68k
525                 os=-coff
526                 ;;
527         msdos)                                          # CYGNUS LOCAL
528                 basic_machine=i386-unknown
529                 os=-msdos
530                 ;;
531         ncr3000)
532                 basic_machine=i486-ncr
533                 os=-sysv4
534                 ;;
535         netbsd386)
536                 basic_machine=i386-unknown              # CYGNUS LOCAL
537                 os=-netbsd
538                 ;;
539         news | news700 | news800 | news900)
540                 basic_machine=m68k-sony
541                 os=-newsos
542                 ;;
543         news1000)
544                 basic_machine=m68030-sony
545                 os=-newsos
546                 ;;
547         news-3600 | risc-news)
548                 basic_machine=mips-sony
549                 os=-newsos
550                 ;;
551         necv70)                                         # CYGNUS LOCAL
552                 basic_machine=v70-nec
553                 os=-sysv
554                 ;;
555         next | m*-next )
556                 basic_machine=m68k-next
557                 case $os in
558                     -nextstep* )
559                         ;;
560                     -ns2*)
561                       os=-nextstep2
562                         ;;
563                     *)
564                       os=-nextstep3
565                         ;;
566                 esac
567                 ;;
568         nh3000)
569                 basic_machine=m68k-harris
570                 os=-cxux
571                 ;;
572         nh[45]000)
573                 basic_machine=m88k-harris
574                 os=-cxux
575                 ;;
576         nindy960)
577                 basic_machine=i960-intel
578                 os=-nindy
579                 ;;
580         mon960)                                         # CYGNUS LOCAL
581                 basic_machine=i960-intel
582                 os=-mon960
583                 ;;
584         np1)
585                 basic_machine=np1-gould
586                 ;;
587         OSE68000 | ose68000)                            # CYGNUS LOCAL
588                 basic_machine=m68000-ericsson
589                 os=-ose
590                 ;;
591         os68k)                                          # CYGNUS LOCAL
592                 basic_machine=m68k-none
593                 os=-os68k
594                 ;;
595         pa-hitachi)
596                 basic_machine=hppa1.1-hitachi
597                 os=-hiuxwe2
598                 ;;
599         paragon)
600                 basic_machine=i860-intel
601                 os=-osf
602                 ;;
603         pbd)
604                 basic_machine=sparc-tti
605                 ;;
606         pbb)
607                 basic_machine=m68k-tti
608                 ;;
609         pc532 | pc532-*)
610                 basic_machine=ns32k-pc532
611                 ;;
612         pentium | p5)
613                 basic_machine=i586-intel
614                 ;;
615         pentiumpro | p6)
616                 basic_machine=i686-intel
617                 ;;
618         pentium-* | p5-*)
619                 basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
620                 ;;
621         pentiumpro-* | p6-*)
622                 basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
623                 ;;
624         k5)
625                 # We don't have specific support for AMD's K5 yet, so just call it a Pentium
626                 basic_machine=i586-amd
627                 ;;
628         nexen)
629                 # We don't have specific support for Nexgen yet, so just call it a Pentium
630                 basic_machine=i586-nexgen
631                 ;;
632         pn)
633                 basic_machine=pn-gould
634                 ;;
635         power)  basic_machine=rs6000-ibm
636                 ;;
637         ppc)    basic_machine=powerpc-unknown
638                 ;;
639         ppc-*)  basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
640                 ;;
641         ppcle | powerpclittle | ppc-le | powerpc-little)
642                 basic_machine=powerpcle-unknown
643                 ;;
644         ppcle-* | powerpclittle-*)
645                 basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
646                 ;;
647         ps2)
648                 basic_machine=i386-ibm
649                 ;;
650         rom68k)                                         # CYGNUS LOCAL
651                 basic_machine=m68k-rom68k
652                 os=-coff
653                 ;;
654         rm[46]00)
655                 basic_machine=mips-siemens
656                 ;;
657         rtpc | rtpc-*)
658                 basic_machine=romp-ibm
659                 ;;
660         sa29200)                                        # CYGNUS LOCAL
661                 basic_machine=a29k-amd
662                 os=-udi
663                 ;;
664         sequent)
665                 basic_machine=i386-sequent
666                 ;;
667         sh)
668                 basic_machine=sh-hitachi
669                 os=-hms
670                 ;;
671         sparclite-wrs)                                  # CYGNUS LOCAL
672                 basic_machine=sparclite-wrs
673                 os=-vxworks
674                 ;;
675         sps7)
676                 basic_machine=m68k-bull
677                 os=-sysv2
678                 ;;
679         spur)
680                 basic_machine=spur-unknown
681                 ;;
682         st2000)                                         # CYGNUS LOCAL
683                 basic_machine=m68k-tandem
684                 ;;
685         stratus)                                        # CYGNUS LOCAL
686                 basic_machine=i860-stratus
687                 os=-sysv4
688                 ;;
689         sun2)
690                 basic_machine=m68000-sun
691                 ;;
692         sun2os3)
693                 basic_machine=m68000-sun
694                 os=-sunos3
695                 ;;
696         sun2os4)
697                 basic_machine=m68000-sun
698                 os=-sunos4
699                 ;;
700         sun3os3)
701                 basic_machine=m68k-sun
702                 os=-sunos3
703                 ;;
704         sun3os4)
705                 basic_machine=m68k-sun
706                 os=-sunos4
707                 ;;
708         sun4os3)
709                 basic_machine=sparc-sun
710                 os=-sunos3
711                 ;;
712         sun4os4)
713                 basic_machine=sparc-sun
714                 os=-sunos4
715                 ;;
716         sun4sol2)
717                 basic_machine=sparc-sun
718                 os=-solaris2
719                 ;;
720         sun3 | sun3-*)
721                 basic_machine=m68k-sun
722                 ;;
723         sun4)
724                 basic_machine=sparc-sun
725                 ;;
726         sun386 | sun386i | roadrunner)
727                 basic_machine=i386-sun
728                 ;;
729         symmetry)
730                 basic_machine=i386-sequent
731                 os=-dynix
732                 ;;
733         tower | tower-32)
734                 basic_machine=m68k-ncr
735                 ;;
736         udi29k)
737                 basic_machine=a29k-amd
738                 os=-udi
739                 ;;
740         ultra3)
741                 basic_machine=a29k-nyu
742                 os=-sym1
743                 ;;
744         v810 | necv810)                                 # CYGNUS LOCAL
745                 basic_machine=v810-nec
746                 os=-none
747                 ;;
748         vaxv)
749                 basic_machine=vax-dec
750                 os=-sysv
751                 ;;
752         vms)
753                 basic_machine=vax-dec
754                 os=-vms
755                 ;;
756        vpp*|vx|vx-*)
757                basic_machine=f301-fujitsu
758                ;;
759         vxworks960)
760                 basic_machine=i960-wrs
761                 os=-vxworks
762                 ;;
763         vxworks68)
764                 basic_machine=m68k-wrs
765                 os=-vxworks
766                 ;;
767         vxworks29k)
768                 basic_machine=a29k-wrs
769                 os=-vxworks
770                 ;;
771         w65*)                                           # CYGNUS LOCAL
772                 basic_machine=w65-wdc
773                 os=-none
774                 ;;
775         xmp)
776                 basic_machine=xmp-cray
777                 os=-unicos
778                 ;;
779         xps | xps100)
780                 basic_machine=xps100-honeywell
781                 ;;
782         z8k-*-coff)                                     # CYGNUS LOCAL
783                 basic_machine=z8k-unknown
784                 os=-sim
785                 ;;
786         none)
787                 basic_machine=none-none
788                 os=-none
789                 ;;
790
791 # Here we handle the default manufacturer of certain CPU types.  It is in
792 # some cases the only manufacturer, in others, it is the most popular.
793         w89k)                                           # CYGNUS LOCAL
794                 basic_machine=hppa1.1-winbond
795                 ;;
796         op50n)                                          # CYGNUS LOCAL
797                 basic_machine=hppa1.1-oki
798                 ;;
799         op60c)                                          # CYGNUS LOCAL
800                 basic_machine=hppa1.1-oki
801                 ;;
802         mips)
803                 if [ x$os = x-linux ]; then
804                         basic_machine=mips-unknown
805                 else
806                         basic_machine=mips-mips
807                 fi
808                 ;;
809         romp)
810                 basic_machine=romp-ibm
811                 ;;
812         rs6000)
813                 basic_machine=rs6000-ibm
814                 ;;
815         vax)
816                 basic_machine=vax-dec
817                 ;;
818         pdp11)
819                 basic_machine=pdp11-dec
820                 ;;
821         we32k)
822                 basic_machine=we32k-att
823                 ;;
824         sparc)
825                 basic_machine=sparc-sun
826                 ;;
827         cydra)
828                 basic_machine=cydra-cydrome
829                 ;;
830         orion)
831                 basic_machine=orion-highlevel
832                 ;;
833         orion105)
834                 basic_machine=clipper-highlevel
835                 ;;
836         mac | mpw | mac-mpw)                            # CYGNUS LOCAL
837                 basic_machine=m68k-apple
838                 ;;
839         pmac | pmac-mpw)                                # CYGNUS LOCAL
840                 basic_machine=powerpc-apple
841                 ;;
842         *)
843                 echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
844                 exit 1
845                 ;;
846 esac
847
848 # Here we canonicalize certain aliases for manufacturers.
849 case $basic_machine in
850         *-digital*)
851                 basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
852                 ;;
853         *-commodore*)
854                 basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
855                 ;;
856         *)
857                 ;;
858 esac
859
860 # Decode manufacturer-specific aliases for certain operating systems.
861
862 if [ x"$os" != x"" ]
863 then
864 case $os in
865         # First match some system type aliases
866         # that might get confused with valid system types.
867         # -solaris* is a basic system type, with this one exception.
868         -solaris1 | -solaris1.*)
869                 os=`echo $os | sed -e 's|solaris1|sunos4|'`
870                 ;;
871         -solaris)
872                 os=-solaris2
873                 ;;
874         -unixware* | svr4*)
875                 os=-sysv4
876                 ;;
877         -gnu/linux*)
878                 os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
879                 ;;
880         # First accept the basic system types.
881         # The portable systems comes first.
882         # Each alternative MUST END IN A *, to match a version number.
883         # -sysv* is not here because it comes later, after sysvr4.
884         -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
885               | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
886               | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
887               | -amigados* | -msdos* | -newsos* | -unicos* | -aof* | -aos* \
888               | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
889               | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
890               | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \
891               | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* \
892               | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
893               | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
894               | -cygwin32* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
895               | -linux-gnu* | -uxpv* | -mingw32* )
896         # Remember, each alternative MUST END IN *, to match a version number.
897                 ;;
898         # CYGNUS LOCAL
899         -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
900               | -windows* | -osx | -abug |  -netware* | -os9* | -beos* \
901               | -macos* | -mpw* | -magic* | -mon960* | -lnews* )
902                 ;;
903         -mac*)
904                 os=`echo $os | sed -e 's|mac|macos|'`
905                 ;;
906         # END CYGNUS LOCAL
907         -linux*)
908                 os=`echo $os | sed -e 's|linux|linux-gnu|'`
909                 ;;
910         -sunos5*)
911                 os=`echo $os | sed -e 's|sunos5|solaris2|'`
912                 ;;
913         -sunos6*)
914                 os=`echo $os | sed -e 's|sunos6|solaris3|'`
915                 ;;
916         -osfrose*)
917                 os=-osfrose
918                 ;;
919         -osf*)
920                 os=-osf
921                 ;;
922         -utek*)
923                 os=-bsd
924                 ;;
925         -dynix*)
926                 os=-bsd
927                 ;;
928         -acis*)
929                 os=-aos
930                 ;;
931         -386bsd)                                        # CYGNUS LOCAL
932                 os=-bsd
933                 ;;
934         -ctix* | -uts*)
935                 os=-sysv
936                 ;;
937         -ns2 )
938                 os=-nextstep2
939                 ;;
940         # Preserve the version number of sinix5.
941         -sinix5.*)
942                 os=`echo $os | sed -e 's|sinix|sysv|'`
943                 ;;
944         -sinix*)
945                 os=-sysv4
946                 ;;
947         -triton*)
948                 os=-sysv3
949                 ;;
950         -oss*)
951                 os=-sysv3
952                 ;;
953         -svr4)
954                 os=-sysv4
955                 ;;
956         -svr3)
957                 os=-sysv3
958                 ;;
959         -sysvr4)
960                 os=-sysv4
961                 ;;
962         # This must come after -sysvr4.
963         -sysv*)
964                 ;;
965         -ose*)                                          # CYGNUS LOCAL
966                 os=-ose
967                 ;;
968         -es1800*)                                       # CYGNUS LOCAL
969                 os=-ose
970                 ;;
971         -xenix)
972                 os=-xenix
973                 ;;
974         -mint)
975                 os=-mint
976                 ;;
977         -os2)
978                 os=-os2
979                 ;;
980         -none)
981                 ;;
982         *)
983                 # Get rid of the `-' at the beginning of $os.
984                 echo "os=($os)"
985                 os=`echo $os | sed 's/[^-]*-//'`
986                 echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
987                 exit 1
988                 ;;
989 esac
990 else
991
992 # Here we handle the default operating systems that come with various machines.
993 # The value should be what the vendor currently ships out the door with their
994 # machine or put another way, the most popular os provided with the machine.
995
996 # Note that if you're going to try to match "-MANUFACTURER" here (say,
997 # "-sun"), then you have to tell the case statement up towards the top
998 # that MANUFACTURER isn't an operating system.  Otherwise, code above
999 # will signal an error saying that MANUFACTURER isn't an operating
1000 # system, and we'll never get to this point.
1001
1002 case $basic_machine in
1003         *-acorn)
1004                 os=-riscix1.2
1005                 ;;
1006         arm*-semi)
1007                 os=-aout
1008                 ;;
1009         pdp11-*)
1010                 os=-none
1011                 ;;
1012         *-dec | vax-*)
1013                 os=-ultrix4.2
1014                 ;;
1015         m68*-apollo)
1016                 os=-domain
1017                 ;;
1018         i386-sun)
1019                 os=-sunos4.0.2
1020                 ;;
1021         m68000-sun)
1022                 os=-sunos3
1023                 # This also exists in the configure program, but was not the
1024                 # default.
1025                 # os=-sunos4
1026                 ;;
1027         m68*-cisco)                                     # CYGNUS LOCAL
1028                 os=-aout
1029                 ;;
1030         mips*-cisco)                                    # CYGNUS LOCAL
1031                 os=-elf
1032                 ;;
1033         mips*-*)                                        # CYGNUS LOCAL
1034                 os=-elf
1035                 ;;
1036         *-tti)  # must be before sparc entry or we get the wrong os.
1037                 os=-sysv3
1038                 ;;
1039         sparc-* | *-sun)
1040                 os=-sunos4.1.1
1041                 ;;
1042         *-be)                                           # CYGNUS LOCAL
1043                 os=-beos
1044                 ;;
1045         *-ibm)
1046                 os=-aix
1047                 ;;
1048         *-wec)                                          # CYGNUS LOCAL
1049                 os=-proelf
1050                 ;;
1051         *-winbond)                                      # CYGNUS LOCAL
1052                 os=-proelf
1053                 ;;
1054         *-oki)                                          # CYGNUS LOCAL
1055                 os=-proelf
1056                 ;;
1057         *-hp)
1058                 os=-hpux
1059                 ;;
1060         *-hitachi)
1061                 os=-hiux
1062                 ;;
1063         i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
1064                 os=-sysv
1065                 ;;
1066         *-cbm)
1067                 os=-amigados
1068                 ;;
1069         *-dg)
1070                 os=-dgux
1071                 ;;
1072         *-dolphin)
1073                 os=-sysv3
1074                 ;;
1075         m68k-ccur)
1076                 os=-rtu
1077                 ;;
1078         m88k-omron*)
1079                 os=-luna
1080                 ;;
1081         *-next )
1082                 os=-nextstep
1083                 ;;
1084         *-sequent)
1085                 os=-ptx
1086                 ;;
1087         *-crds)
1088                 os=-unos
1089                 ;;
1090         *-ns)
1091                 os=-genix
1092                 ;;
1093         i370-*)
1094                 os=-mvs
1095                 ;;
1096         *-next)
1097                 os=-nextstep3
1098                 ;;
1099         *-gould)
1100                 os=-sysv
1101                 ;;
1102         *-highlevel)
1103                 os=-bsd
1104                 ;;
1105         *-encore)
1106                 os=-bsd
1107                 ;;
1108         *-sgi)
1109                 os=-irix
1110                 ;;
1111         *-siemens)
1112                 os=-sysv4
1113                 ;;
1114         *-masscomp)
1115                 os=-rtu
1116                 ;;
1117         f301-fujitsu)
1118                 os=-uxpv
1119                 ;;
1120         *-rom68k)                                       # CYGNUS LOCAL
1121                 os=-coff
1122                 ;;
1123         *-*bug)                                         # CYGNUS LOCAL
1124                 os=-coff
1125                 ;;
1126         *-apple)                                        # CYGNUS LOCAL
1127                 os=-macos
1128                 ;;
1129         *)
1130                 os=-none
1131                 ;;
1132 esac
1133 fi
1134
1135 # Here we handle the case where we know the os, and the CPU type, but not the
1136 # manufacturer.  We pick the logical manufacturer.
1137 vendor=unknown
1138 case $basic_machine in
1139         *-unknown)
1140                 case $os in
1141                         -riscix*)
1142                                 vendor=acorn
1143                                 ;;
1144                         -sunos*)
1145                                 vendor=sun
1146                                 ;;
1147                         -aix*)
1148                                 vendor=ibm
1149                                 ;;
1150                         -beos*)                                         # CYGNUS LOCAL
1151                                 vendor=be
1152                                 ;;
1153                         -hpux*)
1154                                 vendor=hp
1155                                 ;;
1156                         -hiux*)
1157                                 vendor=hitachi
1158                                 ;;
1159                         -unos*)
1160                                 vendor=crds
1161                                 ;;
1162                         -dgux*)
1163                                 vendor=dg
1164                                 ;;
1165                         -luna*)
1166                                 vendor=omron
1167                                 ;;
1168                         -genix*)
1169                                 vendor=ns
1170                                 ;;
1171                         -mvs*)
1172                                 vendor=ibm
1173                                 ;;
1174                         -ptx*)
1175                                 vendor=sequent
1176                                 ;;
1177                         -vxsim* | -vxworks*)
1178                                 vendor=wrs
1179                                 ;;
1180                         -aux*)
1181                                 vendor=apple
1182                                 ;;
1183                         -hms*)                          # CYGNUS LOCAL
1184                                 vendor=hitachi
1185                                 ;;
1186                         -mpw* | -macos*)                # CYGNUS LOCAL
1187                                 vendor=apple
1188                                 ;;
1189                 esac
1190                 basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
1191                 ;;
1192 esac
1193
1194 echo $basic_machine$os