* pksign.c (agent_pksign): Detect whether a Smartcard is to be
[gnupg.git] / scripts / config.sub
1 #! /bin/sh
2 # Configuration validation subroutine script, version 1.1.
3 #   Copyright (C) 1991, 92-97, 1998, 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*)
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)
102                 os=
103                 basic_machine=$1
104                 ;;
105         -scout)
106                 ;;
107         -wrs)
108                 os=vxworks
109                 basic_machine=$1
110                 ;;
111         -hiux*)
112                 os=-hiuxwe2
113                 ;;
114         -sco5)
115                 os=-sco3.2v5
116                 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
117                 ;;
118         -sco4)
119                 os=-sco3.2v4
120                 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
121                 ;;
122         -sco3.2.[4-9]*)
123                 os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
124                 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
125                 ;;
126         -sco3.2v[4-9]*)
127                 # Don't forget version if it is 3.2v4 or newer.
128                 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
129                 ;;
130         -sco*)
131                 os=-sco3.2v2
132                 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
133                 ;;
134         -udk*)
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 | arc | arm \
166                 | arme[lb] | pyramid | mn10200 | mn10300 | tron | a29k \
167                 | 580 | i960 | h8300 \
168                 | hppa | hppa1.0 | hppa1.1 | hppa2.0 | hppa2.0w | hppa2.0n \
169                 | alpha | alphaev[4-7] | alphaev56 | alphapca5[67] | s390 \
170                 | we32k | ns16k | clipper | i370 | sh | powerpc | powerpcle \
171                 | 1750a | dsp16xx | pdp11 | mips16 | mips64 | mipsel | mips64el \
172                 | mips64orion | mips64orionel | mipstx39 | mipstx39el \
173                 | mips64vr4300 | mips64vr4300el | mips64vr4100 | mips64vr4100el \
174                 | mips64vr5000 | miprs64vr5000el \
175                 | sparc | sparclet | sparclite | sparc64 | sparcv9 | v850 | c4x \
176                 | thumb | d10v)
177                 basic_machine=$basic_machine-unknown
178                 ;;
179         m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | z8k | v70 | h8500 | w65)
180                 ;;
181
182         # We use `pc' rather than `unknown'
183         # because (1) that's what they normally are, and
184         # (2) the word "unknown" tends to confuse beginning users.
185         i[34567]86)
186           basic_machine=$basic_machine-pc
187           ;;
188         s390 | s390-ibm)
189           basic_machine=s390-ibm
190           ;;
191         s390-redhat)
192           basic_machine=s390-redhat
193           ;;
194         # Object if more than one company name word.
195         *-*-*)
196                 echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
197                 exit 1
198                 ;;
199         # Recognize the basic CPU types with company name.
200         vax-* | tahoe-* | i[34567]86-* | i860-* | m32r-* | m68k-* | m68000-* \
201               | m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | arm-* | c[123]* \
202               | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \
203               | power-* | none-* | 580-* | cray2-* | h8300-* | h8500-* | i960-* \
204               | xmp-* | ymp-* \
205               | hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* | hppa2.0w-* | hppa2.0n-* \
206               | alpha-* | alphaev[4-7]-* | alphaev56-* | alphapca5[67]-* \
207               | we32k-* | cydra-* | ns16k-* | pn-* | np1-* | xps100-* \
208               | clipper-* | orion-* \
209               | sparclite-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \
210               | sparc64-* | sparcv9-* | sparc86x-* | mips16-* | mips64-* | mipsel-* \
211               | mips64el-* | mips64orion-* | mips64orionel-* \
212               | mips64vr4100-* | mips64vr4100el-* | mips64vr4300-* | mips64vr4300el-* \
213               | mipstx39-* | mipstx39el-* \
214               | f301-* | armv*-* | t3e-* \
215               | m88110-* | m680[01234]0-* | m683?2-* | m68360-* | z8k-* | d10v-* \
216               | thumb-* | v850-* | d30v-* | tic30-* | c30-* )
217                 ;;
218         # Recognize the various machine names and aliases which stand
219         # for a CPU type and a company and sometimes even an OS.
220         386bsd)
221                 basic_machine=i386-unknown
222                 os=-bsd
223                 ;;
224         3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
225                 basic_machine=m68000-att
226                 ;;
227         3b*)
228                 basic_machine=we32k-att
229                 ;;
230         a29khif)
231                 basic_machine=a29k-amd
232                 os=-udi
233                 ;;
234         adobe68k)
235                 basic_machine=m68010-adobe
236                 os=-scout
237                 ;;
238         alliant | fx80)
239                 basic_machine=fx80-alliant
240                 ;;
241         altos | altos3068)
242                 basic_machine=m68k-altos
243                 ;;
244         am29k)
245                 basic_machine=a29k-none
246                 os=-bsd
247                 ;;
248         amdahl)
249                 basic_machine=580-amdahl
250                 os=-sysv
251                 ;;
252         amiga | amiga-*)
253                 basic_machine=m68k-cbm
254                 ;;
255         amigaos | amigados)
256                 basic_machine=m68k-cbm
257                 os=-amigaos
258                 ;;
259         amigaunix | amix)
260                 basic_machine=m68k-cbm
261                 os=-sysv4
262                 ;;
263         apollo68)
264                 basic_machine=m68k-apollo
265                 os=-sysv
266                 ;;
267         apollo68bsd)
268                 basic_machine=m68k-apollo
269                 os=-bsd
270                 ;;
271         aux)
272                 basic_machine=m68k-apple
273                 os=-aux
274                 ;;
275         balance)
276                 basic_machine=ns32k-sequent
277                 os=-dynix
278                 ;;
279         convex-c1)
280                 basic_machine=c1-convex
281                 os=-bsd
282                 ;;
283         convex-c2)
284                 basic_machine=c2-convex
285                 os=-bsd
286                 ;;
287         convex-c32)
288                 basic_machine=c32-convex
289                 os=-bsd
290                 ;;
291         convex-c34)
292                 basic_machine=c34-convex
293                 os=-bsd
294                 ;;
295         convex-c38)
296                 basic_machine=c38-convex
297                 os=-bsd
298                 ;;
299         cray | ymp)
300                 basic_machine=ymp-cray
301                 os=-unicos
302                 ;;
303         cray2)
304                 basic_machine=cray2-cray
305                 os=-unicos
306                 ;;
307         [ctj]90-cray)
308                 basic_machine=c90-cray
309                 os=-unicos
310                 ;;
311         crds | unos)
312                 basic_machine=m68k-crds
313                 ;;
314         da30 | da30-*)
315                 basic_machine=m68k-da30
316                 ;;
317         decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
318                 basic_machine=mips-dec
319                 ;;
320         delta | 3300 | motorola-3300 | motorola-delta \
321               | 3300-motorola | delta-motorola)
322                 basic_machine=m68k-motorola
323                 ;;
324         delta88)
325                 basic_machine=m88k-motorola
326                 os=-sysv3
327                 ;;
328         dpx20 | dpx20-*)
329                 basic_machine=rs6000-bull
330                 os=-bosx
331                 ;;
332         dpx2* | dpx2*-bull)
333                 basic_machine=m68k-bull
334                 os=-sysv3
335                 ;;
336         ebmon29k)
337                 basic_machine=a29k-amd
338                 os=-ebmon
339                 ;;
340         elxsi)
341                 basic_machine=elxsi-elxsi
342                 os=-bsd
343                 ;;
344         encore | umax | mmax)
345                 basic_machine=ns32k-encore
346                 ;;
347         es1800 | OSE68k | ose68k | ose | OSE)
348                 basic_machine=m68k-ericsson
349                 os=-ose
350                 ;;
351         fx2800)
352                 basic_machine=i860-alliant
353                 ;;
354         genix)
355                 basic_machine=ns32k-ns
356                 ;;
357         gmicro)
358                 basic_machine=tron-gmicro
359                 os=-sysv
360                 ;;
361         h3050r* | hiux*)
362                 basic_machine=hppa1.1-hitachi
363                 os=-hiuxwe2
364                 ;;
365         h8300hms)
366                 basic_machine=h8300-hitachi
367                 os=-hms
368                 ;;
369         h8300xray)
370                 basic_machine=h8300-hitachi
371                 os=-xray
372                 ;;
373         h8500hms)
374                 basic_machine=h8500-hitachi
375                 os=-hms
376                 ;;
377         harris)
378                 basic_machine=m88k-harris
379                 os=-sysv3
380                 ;;
381         hp300-*)
382                 basic_machine=m68k-hp
383                 ;;
384         hp300bsd)
385                 basic_machine=m68k-hp
386                 os=-bsd
387                 ;;
388         hp300hpux)
389                 basic_machine=m68k-hp
390                 os=-hpux
391                 ;;
392         hp3k9[0-9][0-9] | hp9[0-9][0-9])
393                 basic_machine=hppa1.0-hp
394                 ;;
395         hp9k2[0-9][0-9] | hp9k31[0-9])
396                 basic_machine=m68000-hp
397                 ;;
398         hp9k3[2-9][0-9])
399                 basic_machine=m68k-hp
400                 ;;
401         hp9k6[0-9][0-9] | hp6[0-9][0-9])
402                 basic_machine=hppa1.0-hp
403                 ;;
404         hp9k7[0-79][0-9] | hp7[0-79][0-9])
405                 basic_machine=hppa1.1-hp
406                 ;;
407         hp9k78[0-9] | hp78[0-9])
408                 # FIXME: really hppa2.0-hp
409                 basic_machine=hppa1.1-hp
410                 ;;
411         hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
412                 # FIXME: really hppa2.0-hp
413                 basic_machine=hppa1.1-hp
414                 ;;
415         hp9k8[0-9][13679] | hp8[0-9][13679])
416                 basic_machine=hppa1.1-hp
417                 ;;
418         hp9k8[0-9][0-9] | hp8[0-9][0-9])
419                 basic_machine=hppa1.0-hp
420                 ;;
421         hppa-next)
422                 os=-nextstep3
423                 ;;
424         hppaosf)
425                 basic_machine=hppa1.1-hp
426                 os=-osf
427                 ;;
428         hppro)
429                 basic_machine=hppa1.1-hp
430                 os=-proelf
431                 ;;
432         i370-ibm* | ibm*)
433                 basic_machine=i370-ibm
434                 os=-mvs
435                 ;;
436 # I'm not sure what "Sysv32" means.  Should this be sysv3.2?
437         i[34567]86v32)
438                 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
439                 os=-sysv32
440                 ;;
441         i[34567]86v4*)
442                 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
443                 os=-sysv4
444                 ;;
445         i[34567]86v)
446                 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
447                 os=-sysv
448                 ;;
449         i[34567]86sol2)
450                 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
451                 os=-solaris2
452                 ;;
453         i386mach)
454                 basic_machine=i386-mach
455                 os=-mach
456                 ;;
457         i386-vsta | vsta)
458                 basic_machine=i386-unknown
459                 os=-vsta
460                 ;;
461         i386-go32 | go32)
462                 basic_machine=i386-unknown
463                 os=-go32
464                 ;;
465         i386-mingw32 | mingw32)
466                 basic_machine=i386-unknown
467                 os=-mingw32
468                 ;;
469         iris | iris4d)
470                 basic_machine=mips-sgi
471                 case $os in
472                     -irix*)
473                         ;;
474                     *)
475                         os=-irix4
476                         ;;
477                 esac
478                 ;;
479         isi68 | isi)
480                 basic_machine=m68k-isi
481                 os=-sysv
482                 ;;
483         m88k-omron*)
484                 basic_machine=m88k-omron
485                 ;;
486         magnum | m3230)
487                 basic_machine=mips-mips
488                 os=-sysv
489                 ;;
490         merlin)
491                 basic_machine=ns32k-utek
492                 os=-sysv
493                 ;;
494         miniframe)
495                 basic_machine=m68000-convergent
496                 ;;
497         *mint | *MiNT)
498                 basic_machine=m68k-atari
499                 os=-mint
500                 ;;
501         mipsel*-linux*)
502                 basic_machine=mipsel-unknown
503                 os=-linux-gnu
504                 ;;
505         mips*-linux*)
506                 basic_machine=mips-unknown
507                 os=-linux-gnu
508                 ;;
509         mips3*-*)
510                 basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
511                 ;;
512         mips3*)
513                 basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
514                 ;;
515         monitor)
516                 basic_machine=m68k-rom68k
517                 os=-coff
518                 ;;
519         msdos)
520                 basic_machine=i386-unknown
521                 os=-msdos
522                 ;;
523         ncr3000)
524                 basic_machine=i486-ncr
525                 os=-sysv4
526                 ;;
527         netbsd386)
528                 basic_machine=i386-unknown
529                 os=-netbsd
530                 ;;
531         netwinder)
532                 basic_machine=armv4l-corel
533                 os=-linux
534                 ;;
535         news | news700 | news800 | news900)
536                 basic_machine=m68k-sony
537                 os=-newsos
538                 ;;
539         news1000)
540                 basic_machine=m68030-sony
541                 os=-newsos
542                 ;;
543         news-3600 | risc-news)
544                 basic_machine=mips-sony
545                 os=-newsos
546                 ;;
547         necv70)
548                 basic_machine=v70-nec
549                 os=-sysv
550                 ;;
551         next | m*-next )
552                 basic_machine=m68k-next
553                 case $os in
554                     -nextstep* )
555                         ;;
556                     -ns2*)
557                       os=-nextstep2
558                         ;;
559                     *)
560                       os=-nextstep3
561                         ;;
562                 esac
563                 ;;
564         nh3000)
565                 basic_machine=m68k-harris
566                 os=-cxux
567                 ;;
568         nh[45]000)
569                 basic_machine=m88k-harris
570                 os=-cxux
571                 ;;
572         nindy960)
573                 basic_machine=i960-intel
574                 os=-nindy
575                 ;;
576         mon960)
577                 basic_machine=i960-intel
578                 os=-mon960
579                 ;;
580         np1)
581                 basic_machine=np1-gould
582                 ;;
583         op50n-* | op60c-*)
584                 basic_machine=hppa1.1-oki
585                 os=-proelf
586                 ;;
587         OSE68000 | ose68000)
588                 basic_machine=m68000-ericsson
589                 os=-ose
590                 ;;
591         os68k)
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 | k5 | k6 | nexen)
613                 basic_machine=i586-pc
614                 ;;
615         pentiumpro | p6 | 6x86)
616                 basic_machine=i686-pc
617                 ;;
618         pentiumii | pentium2)
619                 basic_machine=i786-pc
620                 ;;
621         pentium-* | p5-* | k5-* | k6-* | nexen-*)
622                 basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
623                 ;;
624         pentiumpro-* | p6-* | 6x86-*)
625                 basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
626                 ;;
627         pentiumii-* | pentium2-*)
628                 basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
629                 ;;
630         pn)
631                 basic_machine=pn-gould
632                 ;;
633         power)  basic_machine=rs6000-ibm
634                 ;;
635         ppc)    basic_machine=powerpc-unknown
636                 ;;
637         ppc-*)  basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
638                 ;;
639         ppcle | powerpclittle | ppc-le | powerpc-little)
640                 basic_machine=powerpcle-unknown
641                 ;;
642         ppcle-* | powerpclittle-*)
643                 basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
644                 ;;
645         ps2)
646                 basic_machine=i386-ibm
647                 ;;
648         rom68k)
649                 basic_machine=m68k-rom68k
650                 os=-coff
651                 ;;
652         rm[46]00)
653                 basic_machine=mips-siemens
654                 ;;
655         rtpc | rtpc-*)
656                 basic_machine=romp-ibm
657                 ;;
658         sa29200)
659                 basic_machine=a29k-amd
660                 os=-udi
661                 ;;
662         sequent)
663                 basic_machine=i386-sequent
664                 ;;
665         sh)
666                 basic_machine=sh-hitachi
667                 os=-hms
668                 ;;
669         sparclite-wrs)
670                 basic_machine=sparclite-wrs
671                 os=-vxworks
672                 ;;
673         sps7)
674                 basic_machine=m68k-bull
675                 os=-sysv2
676                 ;;
677         spur)
678                 basic_machine=spur-unknown
679                 ;;
680         st2000)
681                 basic_machine=m68k-tandem
682                 ;;
683         stratus)
684                 basic_machine=i860-stratus
685                 os=-sysv4
686                 ;;
687         sun2)
688                 basic_machine=m68000-sun
689                 ;;
690         sun2os3)
691                 basic_machine=m68000-sun
692                 os=-sunos3
693                 ;;
694         sun2os4)
695                 basic_machine=m68000-sun
696                 os=-sunos4
697                 ;;
698         sun3os3)
699                 basic_machine=m68k-sun
700                 os=-sunos3
701                 ;;
702         sun3os4)
703                 basic_machine=m68k-sun
704                 os=-sunos4
705                 ;;
706         sun4os3)
707                 basic_machine=sparc-sun
708                 os=-sunos3
709                 ;;
710         sun4os4)
711                 basic_machine=sparc-sun
712                 os=-sunos4
713                 ;;
714         sun4sol2)
715                 basic_machine=sparc-sun
716                 os=-solaris2
717                 ;;
718         sun3 | sun3-*)
719                 basic_machine=m68k-sun
720                 ;;
721         sun4)
722                 basic_machine=sparc-sun
723                 ;;
724         sun386 | sun386i | roadrunner)
725                 basic_machine=i386-sun
726                 ;;
727         symmetry)
728                 basic_machine=i386-sequent
729                 os=-dynix
730                 ;;
731         t3e)
732                 basic_machine=t3e-cray
733                 os=-unicos
734                 ;;
735         tx39)
736                 basic_machine=mipstx39-unknown
737                 ;;
738         tx39el)
739                 basic_machine=mipstx39el-unknown
740                 ;;
741         tower | tower-32)
742                 basic_machine=m68k-ncr
743                 ;;
744         udi29k)
745                 basic_machine=a29k-amd
746                 os=-udi
747                 ;;
748         ultra3)
749                 basic_machine=a29k-nyu
750                 os=-sym1
751                 ;;
752         v810 | necv810)
753                 basic_machine=v810-nec
754                 os=-none
755                 ;;
756         vaxv)
757                 basic_machine=vax-dec
758                 os=-sysv
759                 ;;
760         vms)
761                 basic_machine=vax-dec
762                 os=-vms
763                 ;;
764         vpp*|vx|vx-*)
765                basic_machine=f301-fujitsu
766                ;;
767         vxworks960)
768                 basic_machine=i960-wrs
769                 os=-vxworks
770                 ;;
771         vxworks68)
772                 basic_machine=m68k-wrs
773                 os=-vxworks
774                 ;;
775         vxworks29k)
776                 basic_machine=a29k-wrs
777                 os=-vxworks
778                 ;;
779         w65*)
780                 basic_machine=w65-wdc
781                 os=-none
782                 ;;
783         w89k-*)
784                 basic_machine=hppa1.1-winbond
785                 os=-proelf
786                 ;;
787         xmp)
788                 basic_machine=xmp-cray
789                 os=-unicos
790                 ;;
791         xps | xps100)
792                 basic_machine=xps100-honeywell
793                 ;;
794         z8k-*-coff)
795                 basic_machine=z8k-unknown
796                 os=-sim
797                 ;;
798         none)
799                 basic_machine=none-none
800                 os=-none
801                 ;;
802
803 # Here we handle the default manufacturer of certain CPU types.  It is in
804 # some cases the only manufacturer, in others, it is the most popular.
805         w89k)
806                 basic_machine=hppa1.1-winbond
807                 ;;
808         op50n)
809                 basic_machine=hppa1.1-oki
810                 ;;
811         op60c)
812                 basic_machine=hppa1.1-oki
813                 ;;
814         mips)
815                 if [ x$os = x-linux-gnu ]; then
816                         basic_machine=mips-unknown
817                 else
818                         basic_machine=mips-mips
819                 fi
820                 ;;
821         romp)
822                 basic_machine=romp-ibm
823                 ;;
824         rs6000)
825                 basic_machine=rs6000-ibm
826                 ;;
827         vax)
828                 basic_machine=vax-dec
829                 ;;
830         pdp11)
831                 basic_machine=pdp11-dec
832                 ;;
833         we32k)
834                 basic_machine=we32k-att
835                 ;;
836         sparc | sparcv9)
837                 basic_machine=sparc-sun
838                 ;;
839         cydra)
840                 basic_machine=cydra-cydrome
841                 ;;
842         orion)
843                 basic_machine=orion-highlevel
844                 ;;
845         orion105)
846                 basic_machine=clipper-highlevel
847                 ;;
848         mac | mpw | mac-mpw)
849                 basic_machine=m68k-apple
850                 ;;
851         pmac | pmac-mpw)
852                 basic_machine=powerpc-apple
853                 ;;
854         c4x*)
855                 basic_machine=c4x-none
856                 os=-coff
857                 ;;
858         *)
859                 echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
860                 exit 1
861                 ;;
862 esac
863
864 # Here we canonicalize certain aliases for manufacturers.
865 case $basic_machine in
866         *-digital*)
867                 basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
868                 ;;
869         *-commodore*)
870                 basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
871                 ;;
872         *)
873                 ;;
874 esac
875
876 # Decode manufacturer-specific aliases for certain operating systems.
877
878 if [ x"$os" != x"" ]
879 then
880 case $os in
881         # First match some system type aliases
882         # that might get confused with valid system types.
883         # -solaris* is a basic system type, with this one exception.
884         -solaris1 | -solaris1.*)
885                 os=`echo $os | sed -e 's|solaris1|sunos4|'`
886                 ;;
887         -solaris)
888                 os=-solaris2
889                 ;;
890         -qnx)
891                 os=-qnx
892                 ;;
893         -svr4*)
894                 os=-sysv4
895                 ;;
896         -unixware*)
897                 os=-sysv4.2uw
898                 ;;
899         -gnu/linux*)
900                 os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
901                 ;;
902         # First accept the basic system types.
903         # The portable systems comes first.
904         # Each alternative MUST END IN A *, to match a version number.
905         # -sysv* is not here because it comes later, after sysvr4.
906         -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
907               | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
908               | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
909               | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
910               | -aos* \
911               | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
912               | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
913               | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \
914               | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
915               | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
916               | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
917               | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
918               | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
919               | -interix* | -uwin* | -rhapsody* | -openstep* | -oskit*)
920         # Remember, each alternative MUST END IN *, to match a version number.
921                 ;;
922         -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
923               | -windows* | -osx | -abug | -netware* | -os9* | -beos* \
924               | -macos* | -mpw* | -magic* | -mon960* | -lnews*)
925                 ;;
926         -mac*)
927                 os=`echo $os | sed -e 's|mac|macos|'`
928                 ;;
929         -linux*)
930                 os=`echo $os | sed -e 's|linux|linux-gnu|'`
931                 ;;
932         -sunos5*)
933                 os=`echo $os | sed -e 's|sunos5|solaris2|'`
934                 ;;
935         -sunos6*)
936                 os=`echo $os | sed -e 's|sunos6|solaris3|'`
937                 ;;
938         -osfrose*)
939                 os=-osfrose
940                 ;;
941         -osf*)
942                 os=-osf
943                 ;;
944         -utek*)
945                 os=-bsd
946                 ;;
947         -dynix*)
948                 os=-bsd
949                 ;;
950         -acis*)
951                 os=-aos
952                 ;;
953         -386bsd)
954                 os=-bsd
955                 ;;
956         -ctix* | -uts*)
957                 os=-sysv
958                 ;;
959         -ns2 )
960                 os=-nextstep2
961                 ;;
962         # Preserve the version number of sinix5.
963         -sinix5.*)
964                 os=`echo $os | sed -e 's|sinix|sysv|'`
965                 ;;
966         -sinix*)
967                 os=-sysv4
968                 ;;
969         -triton*)
970                 os=-sysv3
971                 ;;
972         -oss*)
973                 os=-sysv3
974                 ;;
975         -svr4)
976                 os=-sysv4
977                 ;;
978         -svr3)
979                 os=-sysv3
980                 ;;
981         -sysvr4)
982                 os=-sysv4
983                 ;;
984         # This must come after -sysvr4.
985         -sysv*)
986                 ;;
987         -ose*)
988                 os=-ose
989                 ;;
990         -es1800*)
991                 os=-ose
992                 ;;
993         -xenix)
994                 os=-xenix
995                 ;;
996         -*mint | -*MiNT)
997                 os=-mint
998                 ;;
999         -none)
1000                 ;;
1001         *)
1002                 # Get rid of the `-' at the beginning of $os.
1003                 os=`echo $os | sed 's/[^-]*-//'`
1004                 echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
1005                 exit 1
1006                 ;;
1007 esac
1008 else
1009
1010 # Here we handle the default operating systems that come with various machines.
1011 # The value should be what the vendor currently ships out the door with their
1012 # machine or put another way, the most popular os provided with the machine.
1013
1014 # Note that if you're going to try to match "-MANUFACTURER" here (say,
1015 # "-sun"), then you have to tell the case statement up towards the top
1016 # that MANUFACTURER isn't an operating system.  Otherwise, code above
1017 # will signal an error saying that MANUFACTURER isn't an operating
1018 # system, and we'll never get to this point.
1019
1020 case $basic_machine in
1021         *-acorn)
1022                 os=-riscix1.2
1023                 ;;
1024         arm*-corel)
1025                 os=-linux
1026                 ;;
1027         arm*-semi)
1028                 os=-aout
1029                 ;;
1030         pdp11-*)
1031                 os=-none
1032                 ;;
1033         *-dec | vax-*)
1034                 os=-ultrix4.2
1035                 ;;
1036         m68*-apollo)
1037                 os=-domain
1038                 ;;
1039         i386-sun)
1040                 os=-sunos4.0.2
1041                 ;;
1042         m68000-sun)
1043                 os=-sunos3
1044                 # This also exists in the configure program, but was not the
1045                 # default.
1046                 # os=-sunos4
1047                 ;;
1048         m68*-cisco)
1049                 os=-aout
1050                 ;;
1051         mips*-cisco)
1052                 os=-elf
1053                 ;;
1054         mips*-*)
1055                 os=-elf
1056                 ;;
1057         *-tti)  # must be before sparc entry or we get the wrong os.
1058                 os=-sysv3
1059                 ;;
1060         sparc-* | *-sun)
1061                 os=-sunos4.1.1
1062                 ;;
1063         *-be)
1064                 os=-beos
1065                 ;;
1066         *-ibm)
1067                 os=-aix
1068                 ;;
1069         *-wec)
1070                 os=-proelf
1071                 ;;
1072         *-winbond)
1073                 os=-proelf
1074                 ;;
1075         *-oki)
1076                 os=-proelf
1077                 ;;
1078         *-hp)
1079                 os=-hpux
1080                 ;;
1081         *-hitachi)
1082                 os=-hiux
1083                 ;;
1084         i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
1085                 os=-sysv
1086                 ;;
1087         *-cbm)
1088                 os=-amigaos
1089                 ;;
1090         *-dg)
1091                 os=-dgux
1092                 ;;
1093         *-dolphin)
1094                 os=-sysv3
1095                 ;;
1096         m68k-ccur)
1097                 os=-rtu
1098                 ;;
1099         m88k-omron*)
1100                 os=-luna
1101                 ;;
1102         *-next )
1103                 os=-nextstep
1104                 ;;
1105         *-sequent)
1106                 os=-ptx
1107                 ;;
1108         *-crds)
1109                 os=-unos
1110                 ;;
1111         *-ns)
1112                 os=-genix
1113                 ;;
1114         i370-*)
1115                 os=-mvs
1116                 ;;
1117         *-next)
1118                 os=-nextstep3
1119                 ;;
1120         *-gould)
1121                 os=-sysv
1122                 ;;
1123         *-highlevel)
1124                 os=-bsd
1125                 ;;
1126         *-encore)
1127                 os=-bsd
1128                 ;;
1129         *-sgi)
1130                 os=-irix
1131                 ;;
1132         *-siemens)
1133                 os=-sysv4
1134                 ;;
1135         *-masscomp)
1136                 os=-rtu
1137                 ;;
1138         f301-fujitsu)
1139                 os=-uxpv
1140                 ;;
1141         *-rom68k)
1142                 os=-coff
1143                 ;;
1144         *-*bug)
1145                 os=-coff
1146                 ;;
1147         *-apple)
1148                 os=-macos
1149                 ;;
1150         *-atari*)
1151                 os=-mint
1152                 ;;
1153         *)
1154                 os=-none
1155                 ;;
1156 esac
1157 fi
1158
1159 # Here we handle the case where we know the os, and the CPU type, but not the
1160 # manufacturer.  We pick the logical manufacturer.
1161 vendor=unknown
1162 case $basic_machine in
1163         *-unknown)
1164                 case $os in
1165                         -riscix*)
1166                                 vendor=acorn
1167                                 ;;
1168                         -sunos*)
1169                                 vendor=sun
1170                                 ;;
1171                         -aix*)
1172                                 vendor=ibm
1173                                 ;;
1174                         -beos*)
1175                                 vendor=be
1176                                 ;;
1177                         -hpux*)
1178                                 vendor=hp
1179                                 ;;
1180                         -mpeix*)
1181                                 vendor=hp
1182                                 ;;
1183                         -hiux*)
1184                                 vendor=hitachi
1185                                 ;;
1186                         -unos*)
1187                                 vendor=crds
1188                                 ;;
1189                         -dgux*)
1190                                 vendor=dg
1191                                 ;;
1192                         -luna*)
1193                                 vendor=omron
1194                                 ;;
1195                         -genix*)
1196                                 vendor=ns
1197                                 ;;
1198                         -mvs*)
1199                                 vendor=ibm
1200                                 ;;
1201                         -ptx*)
1202                                 vendor=sequent
1203                                 ;;
1204                         -vxsim* | -vxworks*)
1205                                 vendor=wrs
1206                                 ;;
1207                         -aux*)
1208                                 vendor=apple
1209                                 ;;
1210                         -hms*)
1211                                 vendor=hitachi
1212                                 ;;
1213                         -mpw* | -macos*)
1214                                 vendor=apple
1215                                 ;;
1216                         -*mint | -*MiNT)
1217                                 vendor=atari
1218                                 ;;
1219                 esac
1220                 basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
1221                 ;;
1222 esac
1223
1224 echo $basic_machine$os