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