autoupdate
[gnulib.git] / build-aux / config.sub
1 #! /bin/sh
2 # Configuration validation subroutine script.
3 #   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
4 #   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
5 #   Free Software Foundation, Inc.
6
7 timestamp='2010-08-13'
8
9 # This file is (in principle) common to ALL GNU software.
10 # The presence of a machine in this file suggests that SOME GNU software
11 # can handle that machine.  It does not imply ALL GNU software can.
12 #
13 # This file is free software; you can redistribute it and/or modify
14 # it under the terms of the GNU General Public License as published by
15 # the Free Software Foundation; either version 2 of the License, or
16 # (at your option) any later version.
17 #
18 # This program is distributed in the hope that it will be useful,
19 # but WITHOUT ANY WARRANTY; without even the implied warranty of
20 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21 # GNU General Public License for more details.
22 #
23 # You should have received a copy of the GNU General Public License
24 # along with this program; if not, write to the Free Software
25 # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
26 # 02110-1301, USA.
27 #
28 # As a special exception to the GNU General Public License, if you
29 # distribute this file as part of a program that contains a
30 # configuration script generated by Autoconf, you may include it under
31 # the same distribution terms that you use for the rest of that program.
32
33
34 # Please send patches to <config-patches@gnu.org>.  Submit a context
35 # diff and a properly formatted GNU ChangeLog entry.
36 #
37 # Configuration subroutine to validate and canonicalize a configuration type.
38 # Supply the specified configuration type as an argument.
39 # If it is invalid, we print an error message on stderr and exit with code 1.
40 # Otherwise, we print the canonical config type on stdout and succeed.
41
42 # You can get the latest version of this script from:
43 # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
44
45 # This file is supposed to be the same for all GNU packages
46 # and recognize all the CPU types, system types and aliases
47 # that are meaningful with *any* GNU software.
48 # Each package is responsible for reporting which valid configurations
49 # it does not support.  The user should be able to distinguish
50 # a failure to support a valid configuration from a meaningless
51 # configuration.
52
53 # The goal of this file is to map all the various variations of a given
54 # machine specification into a single specification in the form:
55 #       CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
56 # or in some cases, the newer four-part form:
57 #       CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
58 # It is wrong to echo any other type of specification.
59
60 me=`echo "$0" | sed -e 's,.*/,,'`
61
62 usage="\
63 Usage: $0 [OPTION] CPU-MFR-OPSYS
64        $0 [OPTION] ALIAS
65
66 Canonicalize a configuration name.
67
68 Operation modes:
69   -h, --help         print this help, then exit
70   -t, --time-stamp   print date of last modification, then exit
71   -v, --version      print version number, then exit
72
73 Report bugs and patches to <config-patches@gnu.org>."
74
75 version="\
76 GNU config.sub ($timestamp)
77
78 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
79 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free
80 Software Foundation, Inc.
81
82 This is free software; see the source for copying conditions.  There is NO
83 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
84
85 help="
86 Try \`$me --help' for more information."
87
88 # Parse command line
89 while test $# -gt 0 ; do
90   case $1 in
91     --time-stamp | --time* | -t )
92        echo "$timestamp" ; exit ;;
93     --version | -v )
94        echo "$version" ; exit ;;
95     --help | --h* | -h )
96        echo "$usage"; exit ;;
97     -- )     # Stop option processing
98        shift; break ;;
99     - ) # Use stdin as input.
100        break ;;
101     -* )
102        echo "$me: invalid option $1$help"
103        exit 1 ;;
104
105     *local*)
106        # First pass through any local machine types.
107        echo $1
108        exit ;;
109
110     * )
111        break ;;
112   esac
113 done
114
115 case $# in
116  0) echo "$me: missing argument$help" >&2
117     exit 1;;
118  1) ;;
119  *) echo "$me: too many arguments$help" >&2
120     exit 1;;
121 esac
122
123 # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
124 # Here we must recognize all the valid KERNEL-OS combinations.
125 maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
126 case $maybe_os in
127   nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
128   linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
129   knetbsd*-gnu* | netbsd*-gnu* | \
130   kopensolaris*-gnu* | \
131   storm-chaos* | os2-emx* | rtmk-nova*)
132     os=-$maybe_os
133     basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
134     ;;
135   *)
136     basic_machine=`echo $1 | sed 's/-[^-]*$//'`
137     if [ $basic_machine != $1 ]
138     then os=`echo $1 | sed 's/.*-/-/'`
139     else os=; fi
140     ;;
141 esac
142
143 ### Let's recognize common machines as not being operating systems so
144 ### that things like config.sub decstation-3100 work.  We also
145 ### recognize some manufacturers as not being operating systems, so we
146 ### can provide default operating systems below.
147 case $os in
148         -sun*os*)
149                 # Prevent following clause from handling this invalid input.
150                 ;;
151         -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
152         -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
153         -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
154         -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
155         -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
156         -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
157         -apple | -axis | -knuth | -cray | -microblaze)
158                 os=
159                 basic_machine=$1
160                 ;;
161         -bluegene*)
162                 os=-cnk
163                 ;;
164         -sim | -cisco | -oki | -wec | -winbond)
165                 os=
166                 basic_machine=$1
167                 ;;
168         -scout)
169                 ;;
170         -wrs)
171                 os=-vxworks
172                 basic_machine=$1
173                 ;;
174         -chorusos*)
175                 os=-chorusos
176                 basic_machine=$1
177                 ;;
178         -chorusrdb)
179                 os=-chorusrdb
180                 basic_machine=$1
181                 ;;
182         -hiux*)
183                 os=-hiuxwe2
184                 ;;
185         -sco6)
186                 os=-sco5v6
187                 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
188                 ;;
189         -sco5)
190                 os=-sco3.2v5
191                 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
192                 ;;
193         -sco4)
194                 os=-sco3.2v4
195                 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
196                 ;;
197         -sco3.2.[4-9]*)
198                 os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
199                 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
200                 ;;
201         -sco3.2v[4-9]*)
202                 # Don't forget version if it is 3.2v4 or newer.
203                 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
204                 ;;
205         -sco5v6*)
206                 # Don't forget version if it is 3.2v4 or newer.
207                 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
208                 ;;
209         -sco*)
210                 os=-sco3.2v2
211                 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
212                 ;;
213         -udk*)
214                 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
215                 ;;
216         -isc)
217                 os=-isc2.2
218                 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
219                 ;;
220         -clix*)
221                 basic_machine=clipper-intergraph
222                 ;;
223         -isc*)
224                 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
225                 ;;
226         -lynx*)
227                 os=-lynxos
228                 ;;
229         -ptx*)
230                 basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
231                 ;;
232         -windowsnt*)
233                 os=`echo $os | sed -e 's/windowsnt/winnt/'`
234                 ;;
235         -psos*)
236                 os=-psos
237                 ;;
238         -mint | -mint[0-9]*)
239                 basic_machine=m68k-atari
240                 os=-mint
241                 ;;
242 esac
243
244 # Decode aliases for certain CPU-COMPANY combinations.
245 case $basic_machine in
246         # Recognize the basic CPU types without company name.
247         # Some are omitted here because they have special meanings below.
248         1750a | 580 \
249         | a29k \
250         | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
251         | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
252         | am33_2.0 \
253         | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
254         | bfin \
255         | c4x | clipper \
256         | d10v | d30v | dlx | dsp16xx \
257         | fido | fr30 | frv \
258         | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
259         | i370 | i860 | i960 | ia64 \
260         | ip2k | iq2000 \
261         | lm32 \
262         | m32c | m32r | m32rle | m68000 | m68k | m88k \
263         | maxq | mb | microblaze | mcore | mep | metag \
264         | mips | mipsbe | mipseb | mipsel | mipsle \
265         | mips16 \
266         | mips64 | mips64el \
267         | mips64octeon | mips64octeonel \
268         | mips64orion | mips64orionel \
269         | mips64r5900 | mips64r5900el \
270         | mips64vr | mips64vrel \
271         | mips64vr4100 | mips64vr4100el \
272         | mips64vr4300 | mips64vr4300el \
273         | mips64vr5000 | mips64vr5000el \
274         | mips64vr5900 | mips64vr5900el \
275         | mipsisa32 | mipsisa32el \
276         | mipsisa32r2 | mipsisa32r2el \
277         | mipsisa64 | mipsisa64el \
278         | mipsisa64r2 | mipsisa64r2el \
279         | mipsisa64sb1 | mipsisa64sb1el \
280         | mipsisa64sr71k | mipsisa64sr71kel \
281         | mipstx39 | mipstx39el \
282         | mn10200 | mn10300 \
283         | moxie \
284         | mt \
285         | msp430 \
286         | nds32 | nds32le \
287         | nios | nios2 \
288         | ns16k | ns32k \
289         | or32 \
290         | pdp10 | pdp11 | pj | pjl \
291         | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
292         | pyramid \
293         | rx \
294         | score \
295         | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
296         | sh64 | sh64le \
297         | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
298         | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
299         | spu | strongarm \
300         | tahoe | thumb | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
301         | ubicom32 \
302         | v850 | v850e \
303         | we32k \
304         | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
305         | z8k | z80)
306                 basic_machine=$basic_machine-unknown
307                 ;;
308         c54x)
309                 basic_machine=tic54x-unknown
310                 ;;
311         c55x)
312                 basic_machine=tic55x-unknown
313                 ;;
314         c6x)
315                 basic_machine=tic6x-unknown
316                 ;;
317         m6811 | m68hc11 | m6812 | m68hc12 | picochip)
318                 # Motorola 68HC11/12.
319                 basic_machine=$basic_machine-unknown
320                 os=-none
321                 ;;
322         m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
323                 ;;
324         ms1)
325                 basic_machine=mt-unknown
326                 ;;
327
328         # We use `pc' rather than `unknown'
329         # because (1) that's what they normally are, and
330         # (2) the word "unknown" tends to confuse beginning users.
331         i*86 | x86_64)
332           basic_machine=$basic_machine-pc
333           ;;
334         # Object if more than one company name word.
335         *-*-*)
336                 echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
337                 exit 1
338                 ;;
339         # Recognize the basic CPU types with company name.
340         580-* \
341         | a29k-* \
342         | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
343         | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
344         | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
345         | arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
346         | avr-* | avr32-* \
347         | bfin-* | bs2000-* \
348         | c[123]* | c30-* | [cjt]90-* | c4x-* \
349         | clipper-* | craynv-* | cydra-* \
350         | d10v-* | d30v-* | dlx-* \
351         | elxsi-* \
352         | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
353         | h8300-* | h8500-* \
354         | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
355         | i*86-* | i860-* | i960-* | ia64-* \
356         | ip2k-* | iq2000-* \
357         | lm32-* \
358         | m32c-* | m32r-* | m32rle-* \
359         | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
360         | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \
361         | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
362         | mips16-* \
363         | mips64-* | mips64el-* \
364         | mips64octeon-* | mips64octeonel-* \
365         | mips64orion-* | mips64orionel-* \
366         | mips64r5900-* | mips64r5900el-* \
367         | mips64vr-* | mips64vrel-* \
368         | mips64vr4100-* | mips64vr4100el-* \
369         | mips64vr4300-* | mips64vr4300el-* \
370         | mips64vr5000-* | mips64vr5000el-* \
371         | mips64vr5900-* | mips64vr5900el-* \
372         | mipsisa32-* | mipsisa32el-* \
373         | mipsisa32r2-* | mipsisa32r2el-* \
374         | mipsisa64-* | mipsisa64el-* \
375         | mipsisa64r2-* | mipsisa64r2el-* \
376         | mipsisa64sb1-* | mipsisa64sb1el-* \
377         | mipsisa64sr71k-* | mipsisa64sr71kel-* \
378         | mipstx39-* | mipstx39el-* \
379         | mmix-* \
380         | mt-* \
381         | msp430-* \
382         | nds32-* | nds32le-* \
383         | nios-* | nios2-* \
384         | none-* | np1-* | ns16k-* | ns32k-* \
385         | orion-* \
386         | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
387         | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
388         | pyramid-* \
389         | romp-* | rs6000-* | rx-* \
390         | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
391         | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
392         | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
393         | sparclite-* \
394         | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
395         | tahoe-* | thumb-* \
396         | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
397         | tile-* | tilegx-* \
398         | tron-* \
399         | ubicom32-* \
400         | v850-* | v850e-* | vax-* \
401         | we32k-* \
402         | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
403         | xstormy16-* | xtensa*-* \
404         | ymp-* \
405         | z8k-* | z80-*)
406                 ;;
407         # Recognize the basic CPU types without company name, with glob match.
408         xtensa*)
409                 basic_machine=$basic_machine-unknown
410                 ;;
411         # Recognize the various machine names and aliases which stand
412         # for a CPU type and a company and sometimes even an OS.
413         386bsd)
414                 basic_machine=i386-unknown
415                 os=-bsd
416                 ;;
417         3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
418                 basic_machine=m68000-att
419                 ;;
420         3b*)
421                 basic_machine=we32k-att
422                 ;;
423         a29khif)
424                 basic_machine=a29k-amd
425                 os=-udi
426                 ;;
427         abacus)
428                 basic_machine=abacus-unknown
429                 ;;
430         adobe68k)
431                 basic_machine=m68010-adobe
432                 os=-scout
433                 ;;
434         alliant | fx80)
435                 basic_machine=fx80-alliant
436                 ;;
437         altos | altos3068)
438                 basic_machine=m68k-altos
439                 ;;
440         am29k)
441                 basic_machine=a29k-none
442                 os=-bsd
443                 ;;
444         amd64)
445                 basic_machine=x86_64-pc
446                 ;;
447         amd64-*)
448                 basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
449                 ;;
450         amdahl)
451                 basic_machine=580-amdahl
452                 os=-sysv
453                 ;;
454         amiga | amiga-*)
455                 basic_machine=m68k-unknown
456                 ;;
457         amigaos | amigados)
458                 basic_machine=m68k-unknown
459                 os=-amigaos
460                 ;;
461         amigaunix | amix)
462                 basic_machine=m68k-unknown
463                 os=-sysv4
464                 ;;
465         apollo68)
466                 basic_machine=m68k-apollo
467                 os=-sysv
468                 ;;
469         apollo68bsd)
470                 basic_machine=m68k-apollo
471                 os=-bsd
472                 ;;
473         aros)
474                 basic_machine=i386-pc
475                 os=-aros
476                 ;;
477         aux)
478                 basic_machine=m68k-apple
479                 os=-aux
480                 ;;
481         balance)
482                 basic_machine=ns32k-sequent
483                 os=-dynix
484                 ;;
485         blackfin)
486                 basic_machine=bfin-unknown
487                 os=-linux
488                 ;;
489         blackfin-*)
490                 basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
491                 os=-linux
492                 ;;
493         bluegene*)
494                 basic_machine=powerpc-ibm
495                 os=-cnk
496                 ;;
497         c54x-*)
498                 basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
499                 ;;
500         c55x-*)
501                 basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
502                 ;;
503         c6x-*)
504                 basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
505                 ;;
506         c90)
507                 basic_machine=c90-cray
508                 os=-unicos
509                 ;;
510         cegcc)
511                 basic_machine=arm-unknown
512                 os=-cegcc
513                 ;;
514         convex-c1)
515                 basic_machine=c1-convex
516                 os=-bsd
517                 ;;
518         convex-c2)
519                 basic_machine=c2-convex
520                 os=-bsd
521                 ;;
522         convex-c32)
523                 basic_machine=c32-convex
524                 os=-bsd
525                 ;;
526         convex-c34)
527                 basic_machine=c34-convex
528                 os=-bsd
529                 ;;
530         convex-c38)
531                 basic_machine=c38-convex
532                 os=-bsd
533                 ;;
534         cray | j90)
535                 basic_machine=j90-cray
536                 os=-unicos
537                 ;;
538         craynv)
539                 basic_machine=craynv-cray
540                 os=-unicosmp
541                 ;;
542         cr16)
543                 basic_machine=cr16-unknown
544                 os=-elf
545                 ;;
546         crds | unos)
547                 basic_machine=m68k-crds
548                 ;;
549         crisv32 | crisv32-* | etraxfs*)
550                 basic_machine=crisv32-axis
551                 ;;
552         cris | cris-* | etrax*)
553                 basic_machine=cris-axis
554                 ;;
555         crx)
556                 basic_machine=crx-unknown
557                 os=-elf
558                 ;;
559         da30 | da30-*)
560                 basic_machine=m68k-da30
561                 ;;
562         decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
563                 basic_machine=mips-dec
564                 ;;
565         decsystem10* | dec10*)
566                 basic_machine=pdp10-dec
567                 os=-tops10
568                 ;;
569         decsystem20* | dec20*)
570                 basic_machine=pdp10-dec
571                 os=-tops20
572                 ;;
573         delta | 3300 | motorola-3300 | motorola-delta \
574               | 3300-motorola | delta-motorola)
575                 basic_machine=m68k-motorola
576                 ;;
577         delta88)
578                 basic_machine=m88k-motorola
579                 os=-sysv3
580                 ;;
581         dicos)
582                 basic_machine=i686-pc
583                 os=-dicos
584                 ;;
585         djgpp)
586                 basic_machine=i586-pc
587                 os=-msdosdjgpp
588                 ;;
589         dpx20 | dpx20-*)
590                 basic_machine=rs6000-bull
591                 os=-bosx
592                 ;;
593         dpx2* | dpx2*-bull)
594                 basic_machine=m68k-bull
595                 os=-sysv3
596                 ;;
597         ebmon29k)
598                 basic_machine=a29k-amd
599                 os=-ebmon
600                 ;;
601         elxsi)
602                 basic_machine=elxsi-elxsi
603                 os=-bsd
604                 ;;
605         encore | umax | mmax)
606                 basic_machine=ns32k-encore
607                 ;;
608         es1800 | OSE68k | ose68k | ose | OSE)
609                 basic_machine=m68k-ericsson
610                 os=-ose
611                 ;;
612         fx2800)
613                 basic_machine=i860-alliant
614                 ;;
615         genix)
616                 basic_machine=ns32k-ns
617                 ;;
618         gmicro)
619                 basic_machine=tron-gmicro
620                 os=-sysv
621                 ;;
622         go32)
623                 basic_machine=i386-pc
624                 os=-go32
625                 ;;
626         h3050r* | hiux*)
627                 basic_machine=hppa1.1-hitachi
628                 os=-hiuxwe2
629                 ;;
630         h8300hms)
631                 basic_machine=h8300-hitachi
632                 os=-hms
633                 ;;
634         h8300xray)
635                 basic_machine=h8300-hitachi
636                 os=-xray
637                 ;;
638         h8500hms)
639                 basic_machine=h8500-hitachi
640                 os=-hms
641                 ;;
642         harris)
643                 basic_machine=m88k-harris
644                 os=-sysv3
645                 ;;
646         hp300-*)
647                 basic_machine=m68k-hp
648                 ;;
649         hp300bsd)
650                 basic_machine=m68k-hp
651                 os=-bsd
652                 ;;
653         hp300hpux)
654                 basic_machine=m68k-hp
655                 os=-hpux
656                 ;;
657         hp3k9[0-9][0-9] | hp9[0-9][0-9])
658                 basic_machine=hppa1.0-hp
659                 ;;
660         hp9k2[0-9][0-9] | hp9k31[0-9])
661                 basic_machine=m68000-hp
662                 ;;
663         hp9k3[2-9][0-9])
664                 basic_machine=m68k-hp
665                 ;;
666         hp9k6[0-9][0-9] | hp6[0-9][0-9])
667                 basic_machine=hppa1.0-hp
668                 ;;
669         hp9k7[0-79][0-9] | hp7[0-79][0-9])
670                 basic_machine=hppa1.1-hp
671                 ;;
672         hp9k78[0-9] | hp78[0-9])
673                 # FIXME: really hppa2.0-hp
674                 basic_machine=hppa1.1-hp
675                 ;;
676         hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
677                 # FIXME: really hppa2.0-hp
678                 basic_machine=hppa1.1-hp
679                 ;;
680         hp9k8[0-9][13679] | hp8[0-9][13679])
681                 basic_machine=hppa1.1-hp
682                 ;;
683         hp9k8[0-9][0-9] | hp8[0-9][0-9])
684                 basic_machine=hppa1.0-hp
685                 ;;
686         hppa-next)
687                 os=-nextstep3
688                 ;;
689         hppaosf)
690                 basic_machine=hppa1.1-hp
691                 os=-osf
692                 ;;
693         hppro)
694                 basic_machine=hppa1.1-hp
695                 os=-proelf
696                 ;;
697         i370-ibm* | ibm*)
698                 basic_machine=i370-ibm
699                 ;;
700 # I'm not sure what "Sysv32" means.  Should this be sysv3.2?
701         i*86v32)
702                 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
703                 os=-sysv32
704                 ;;
705         i*86v4*)
706                 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
707                 os=-sysv4
708                 ;;
709         i*86v)
710                 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
711                 os=-sysv
712                 ;;
713         i*86sol2)
714                 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
715                 os=-solaris2
716                 ;;
717         i386mach)
718                 basic_machine=i386-mach
719                 os=-mach
720                 ;;
721         i386-vsta | vsta)
722                 basic_machine=i386-unknown
723                 os=-vsta
724                 ;;
725         iris | iris4d)
726                 basic_machine=mips-sgi
727                 case $os in
728                     -irix*)
729                         ;;
730                     *)
731                         os=-irix4
732                         ;;
733                 esac
734                 ;;
735         isi68 | isi)
736                 basic_machine=m68k-isi
737                 os=-sysv
738                 ;;
739         m68knommu)
740                 basic_machine=m68k-unknown
741                 os=-linux
742                 ;;
743         m68knommu-*)
744                 basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
745                 os=-linux
746                 ;;
747         m88k-omron*)
748                 basic_machine=m88k-omron
749                 ;;
750         magnum | m3230)
751                 basic_machine=mips-mips
752                 os=-sysv
753                 ;;
754         merlin)
755                 basic_machine=ns32k-utek
756                 os=-sysv
757                 ;;
758         microblaze)
759                 basic_machine=microblaze-xilinx
760                 ;;
761         mingw32)
762                 basic_machine=i386-pc
763                 os=-mingw32
764                 ;;
765         mingw32ce)
766                 basic_machine=arm-unknown
767                 os=-mingw32ce
768                 ;;
769         miniframe)
770                 basic_machine=m68000-convergent
771                 ;;
772         *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
773                 basic_machine=m68k-atari
774                 os=-mint
775                 ;;
776         mips3*-*)
777                 basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
778                 ;;
779         mips3*)
780                 basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
781                 ;;
782         monitor)
783                 basic_machine=m68k-rom68k
784                 os=-coff
785                 ;;
786         morphos)
787                 basic_machine=powerpc-unknown
788                 os=-morphos
789                 ;;
790         msdos)
791                 basic_machine=i386-pc
792                 os=-msdos
793                 ;;
794         ms1-*)
795                 basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
796                 ;;
797         mvs)
798                 basic_machine=i370-ibm
799                 os=-mvs
800                 ;;
801         ncr3000)
802                 basic_machine=i486-ncr
803                 os=-sysv4
804                 ;;
805         netbsd386)
806                 basic_machine=i386-unknown
807                 os=-netbsd
808                 ;;
809         netwinder)
810                 basic_machine=armv4l-rebel
811                 os=-linux
812                 ;;
813         news | news700 | news800 | news900)
814                 basic_machine=m68k-sony
815                 os=-newsos
816                 ;;
817         news1000)
818                 basic_machine=m68030-sony
819                 os=-newsos
820                 ;;
821         news-3600 | risc-news)
822                 basic_machine=mips-sony
823                 os=-newsos
824                 ;;
825         necv70)
826                 basic_machine=v70-nec
827                 os=-sysv
828                 ;;
829         next | m*-next )
830                 basic_machine=m68k-next
831                 case $os in
832                     -nextstep* )
833                         ;;
834                     -ns2*)
835                       os=-nextstep2
836                         ;;
837                     *)
838                       os=-nextstep3
839                         ;;
840                 esac
841                 ;;
842         nh3000)
843                 basic_machine=m68k-harris
844                 os=-cxux
845                 ;;
846         nh[45]000)
847                 basic_machine=m88k-harris
848                 os=-cxux
849                 ;;
850         nindy960)
851                 basic_machine=i960-intel
852                 os=-nindy
853                 ;;
854         mon960)
855                 basic_machine=i960-intel
856                 os=-mon960
857                 ;;
858         nonstopux)
859                 basic_machine=mips-compaq
860                 os=-nonstopux
861                 ;;
862         np1)
863                 basic_machine=np1-gould
864                 ;;
865         nsr-tandem)
866                 basic_machine=nsr-tandem
867                 ;;
868         op50n-* | op60c-*)
869                 basic_machine=hppa1.1-oki
870                 os=-proelf
871                 ;;
872         openrisc | openrisc-*)
873                 basic_machine=or32-unknown
874                 ;;
875         os400)
876                 basic_machine=powerpc-ibm
877                 os=-os400
878                 ;;
879         OSE68000 | ose68000)
880                 basic_machine=m68000-ericsson
881                 os=-ose
882                 ;;
883         os68k)
884                 basic_machine=m68k-none
885                 os=-os68k
886                 ;;
887         pa-hitachi)
888                 basic_machine=hppa1.1-hitachi
889                 os=-hiuxwe2
890                 ;;
891         paragon)
892                 basic_machine=i860-intel
893                 os=-osf
894                 ;;
895         parisc)
896                 basic_machine=hppa-unknown
897                 os=-linux
898                 ;;
899         parisc-*)
900                 basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
901                 os=-linux
902                 ;;
903         pbd)
904                 basic_machine=sparc-tti
905                 ;;
906         pbb)
907                 basic_machine=m68k-tti
908                 ;;
909         pc532 | pc532-*)
910                 basic_machine=ns32k-pc532
911                 ;;
912         pc98)
913                 basic_machine=i386-pc
914                 ;;
915         pc98-*)
916                 basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
917                 ;;
918         pentium | p5 | k5 | k6 | nexgen | viac3)
919                 basic_machine=i586-pc
920                 ;;
921         pentiumpro | p6 | 6x86 | athlon | athlon_*)
922                 basic_machine=i686-pc
923                 ;;
924         pentiumii | pentium2 | pentiumiii | pentium3)
925                 basic_machine=i686-pc
926                 ;;
927         pentium4)
928                 basic_machine=i786-pc
929                 ;;
930         pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
931                 basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
932                 ;;
933         pentiumpro-* | p6-* | 6x86-* | athlon-*)
934                 basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
935                 ;;
936         pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
937                 basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
938                 ;;
939         pentium4-*)
940                 basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
941                 ;;
942         pn)
943                 basic_machine=pn-gould
944                 ;;
945         power)  basic_machine=power-ibm
946                 ;;
947         ppc)    basic_machine=powerpc-unknown
948                 ;;
949         ppc-*)  basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
950                 ;;
951         ppcle | powerpclittle | ppc-le | powerpc-little)
952                 basic_machine=powerpcle-unknown
953                 ;;
954         ppcle-* | powerpclittle-*)
955                 basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
956                 ;;
957         ppc64)  basic_machine=powerpc64-unknown
958                 ;;
959         ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
960                 ;;
961         ppc64le | powerpc64little | ppc64-le | powerpc64-little)
962                 basic_machine=powerpc64le-unknown
963                 ;;
964         ppc64le-* | powerpc64little-*)
965                 basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
966                 ;;
967         ps2)
968                 basic_machine=i386-ibm
969                 ;;
970         pw32)
971                 basic_machine=i586-unknown
972                 os=-pw32
973                 ;;
974         rdos)
975                 basic_machine=i386-pc
976                 os=-rdos
977                 ;;
978         rom68k)
979                 basic_machine=m68k-rom68k
980                 os=-coff
981                 ;;
982         rm[46]00)
983                 basic_machine=mips-siemens
984                 ;;
985         rtpc | rtpc-*)
986                 basic_machine=romp-ibm
987                 ;;
988         s390 | s390-*)
989                 basic_machine=s390-ibm
990                 ;;
991         s390x | s390x-*)
992                 basic_machine=s390x-ibm
993                 ;;
994         sa29200)
995                 basic_machine=a29k-amd
996                 os=-udi
997                 ;;
998         sb1)
999                 basic_machine=mipsisa64sb1-unknown
1000                 ;;
1001         sb1el)
1002                 basic_machine=mipsisa64sb1el-unknown
1003                 ;;
1004         sde)
1005                 basic_machine=mipsisa32-sde
1006                 os=-elf
1007                 ;;
1008         sei)
1009                 basic_machine=mips-sei
1010                 os=-seiux
1011                 ;;
1012         sequent)
1013                 basic_machine=i386-sequent
1014                 ;;
1015         sh)
1016                 basic_machine=sh-hitachi
1017                 os=-hms
1018                 ;;
1019         sh5el)
1020                 basic_machine=sh5le-unknown
1021                 ;;
1022         sh64)
1023                 basic_machine=sh64-unknown
1024                 ;;
1025         sparclite-wrs | simso-wrs)
1026                 basic_machine=sparclite-wrs
1027                 os=-vxworks
1028                 ;;
1029         sps7)
1030                 basic_machine=m68k-bull
1031                 os=-sysv2
1032                 ;;
1033         spur)
1034                 basic_machine=spur-unknown
1035                 ;;
1036         st2000)
1037                 basic_machine=m68k-tandem
1038                 ;;
1039         stratus)
1040                 basic_machine=i860-stratus
1041                 os=-sysv4
1042                 ;;
1043         sun2)
1044                 basic_machine=m68000-sun
1045                 ;;
1046         sun2os3)
1047                 basic_machine=m68000-sun
1048                 os=-sunos3
1049                 ;;
1050         sun2os4)
1051                 basic_machine=m68000-sun
1052                 os=-sunos4
1053                 ;;
1054         sun3os3)
1055                 basic_machine=m68k-sun
1056                 os=-sunos3
1057                 ;;
1058         sun3os4)
1059                 basic_machine=m68k-sun
1060                 os=-sunos4
1061                 ;;
1062         sun4os3)
1063                 basic_machine=sparc-sun
1064                 os=-sunos3
1065                 ;;
1066         sun4os4)
1067                 basic_machine=sparc-sun
1068                 os=-sunos4
1069                 ;;
1070         sun4sol2)
1071                 basic_machine=sparc-sun
1072                 os=-solaris2
1073                 ;;
1074         sun3 | sun3-*)
1075                 basic_machine=m68k-sun
1076                 ;;
1077         sun4)
1078                 basic_machine=sparc-sun
1079                 ;;
1080         sun386 | sun386i | roadrunner)
1081                 basic_machine=i386-sun
1082                 ;;
1083         sv1)
1084                 basic_machine=sv1-cray
1085                 os=-unicos
1086                 ;;
1087         symmetry)
1088                 basic_machine=i386-sequent
1089                 os=-dynix
1090                 ;;
1091         t3e)
1092                 basic_machine=alphaev5-cray
1093                 os=-unicos
1094                 ;;
1095         t90)
1096                 basic_machine=t90-cray
1097                 os=-unicos
1098                 ;;
1099         # This must be matched before tile*.
1100         tilegx*)
1101                 basic_machine=tilegx-unknown
1102                 os=-linux-gnu
1103                 ;;
1104         tile*)
1105                 basic_machine=tile-unknown
1106                 os=-linux-gnu
1107                 ;;
1108         tx39)
1109                 basic_machine=mipstx39-unknown
1110                 ;;
1111         tx39el)
1112                 basic_machine=mipstx39el-unknown
1113                 ;;
1114         toad1)
1115                 basic_machine=pdp10-xkl
1116                 os=-tops20
1117                 ;;
1118         tower | tower-32)
1119                 basic_machine=m68k-ncr
1120                 ;;
1121         tpf)
1122                 basic_machine=s390x-ibm
1123                 os=-tpf
1124                 ;;
1125         udi29k)
1126                 basic_machine=a29k-amd
1127                 os=-udi
1128                 ;;
1129         ultra3)
1130                 basic_machine=a29k-nyu
1131                 os=-sym1
1132                 ;;
1133         v810 | necv810)
1134                 basic_machine=v810-nec
1135                 os=-none
1136                 ;;
1137         vaxv)
1138                 basic_machine=vax-dec
1139                 os=-sysv
1140                 ;;
1141         vms)
1142                 basic_machine=vax-dec
1143                 os=-vms
1144                 ;;
1145         vpp*|vx|vx-*)
1146                 basic_machine=f301-fujitsu
1147                 ;;
1148         vxworks960)
1149                 basic_machine=i960-wrs
1150                 os=-vxworks
1151                 ;;
1152         vxworks68)
1153                 basic_machine=m68k-wrs
1154                 os=-vxworks
1155                 ;;
1156         vxworks29k)
1157                 basic_machine=a29k-wrs
1158                 os=-vxworks
1159                 ;;
1160         w65*)
1161                 basic_machine=w65-wdc
1162                 os=-none
1163                 ;;
1164         w89k-*)
1165                 basic_machine=hppa1.1-winbond
1166                 os=-proelf
1167                 ;;
1168         xbox)
1169                 basic_machine=i686-pc
1170                 os=-mingw32
1171                 ;;
1172         xps | xps100)
1173                 basic_machine=xps100-honeywell
1174                 ;;
1175         ymp)
1176                 basic_machine=ymp-cray
1177                 os=-unicos
1178                 ;;
1179         z8k-*-coff)
1180                 basic_machine=z8k-unknown
1181                 os=-sim
1182                 ;;
1183         z80-*-coff)
1184                 basic_machine=z80-unknown
1185                 os=-sim
1186                 ;;
1187         none)
1188                 basic_machine=none-none
1189                 os=-none
1190                 ;;
1191
1192 # Here we handle the default manufacturer of certain CPU types.  It is in
1193 # some cases the only manufacturer, in others, it is the most popular.
1194         w89k)
1195                 basic_machine=hppa1.1-winbond
1196                 ;;
1197         op50n)
1198                 basic_machine=hppa1.1-oki
1199                 ;;
1200         op60c)
1201                 basic_machine=hppa1.1-oki
1202                 ;;
1203         romp)
1204                 basic_machine=romp-ibm
1205                 ;;
1206         mmix)
1207                 basic_machine=mmix-knuth
1208                 ;;
1209         rs6000)
1210                 basic_machine=rs6000-ibm
1211                 ;;
1212         vax)
1213                 basic_machine=vax-dec
1214                 ;;
1215         pdp10)
1216                 # there are many clones, so DEC is not a safe bet
1217                 basic_machine=pdp10-unknown
1218                 ;;
1219         pdp11)
1220                 basic_machine=pdp11-dec
1221                 ;;
1222         we32k)
1223                 basic_machine=we32k-att
1224                 ;;
1225         sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
1226                 basic_machine=sh-unknown
1227                 ;;
1228         sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
1229                 basic_machine=sparc-sun
1230                 ;;
1231         cydra)
1232                 basic_machine=cydra-cydrome
1233                 ;;
1234         orion)
1235                 basic_machine=orion-highlevel
1236                 ;;
1237         orion105)
1238                 basic_machine=clipper-highlevel
1239                 ;;
1240         mac | mpw | mac-mpw)
1241                 basic_machine=m68k-apple
1242                 ;;
1243         pmac | pmac-mpw)
1244                 basic_machine=powerpc-apple
1245                 ;;
1246         *-unknown)
1247                 # Make sure to match an already-canonicalized machine name.
1248                 ;;
1249         *)
1250                 echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
1251                 exit 1
1252                 ;;
1253 esac
1254
1255 # Here we canonicalize certain aliases for manufacturers.
1256 case $basic_machine in
1257         *-digital*)
1258                 basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
1259                 ;;
1260         *-commodore*)
1261                 basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
1262                 ;;
1263         *)
1264                 ;;
1265 esac
1266
1267 # Decode manufacturer-specific aliases for certain operating systems.
1268
1269 if [ x"$os" != x"" ]
1270 then
1271 case $os in
1272         # First match some system type aliases
1273         # that might get confused with valid system types.
1274         # -solaris* is a basic system type, with this one exception.
1275         -auroraux)
1276                 os=-auroraux
1277                 ;;
1278         -solaris1 | -solaris1.*)
1279                 os=`echo $os | sed -e 's|solaris1|sunos4|'`
1280                 ;;
1281         -solaris)
1282                 os=-solaris2
1283                 ;;
1284         -svr4*)
1285                 os=-sysv4
1286                 ;;
1287         -unixware*)
1288                 os=-sysv4.2uw
1289                 ;;
1290         -gnu/linux*)
1291                 os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
1292                 ;;
1293         # First accept the basic system types.
1294         # The portable systems comes first.
1295         # Each alternative MUST END IN A *, to match a version number.
1296         # -sysv* is not here because it comes later, after sysvr4.
1297         -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
1298               | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
1299               | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
1300               | -sym* | -kopensolaris* \
1301               | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
1302               | -aos* | -aros* \
1303               | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
1304               | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
1305               | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
1306               | -openbsd* | -solidbsd* \
1307               | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
1308               | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
1309               | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
1310               | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
1311               | -chorusos* | -chorusrdb* | -cegcc* \
1312               | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
1313               | -mingw32* | -linux-gnu* | -linux-android* \
1314               | -linux-newlib* | -linux-uclibc* \
1315               | -uxpv* | -beos* | -mpeix* | -udk* \
1316               | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
1317               | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
1318               | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
1319               | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
1320               | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
1321               | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
1322               | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*)
1323         # Remember, each alternative MUST END IN *, to match a version number.
1324                 ;;
1325         -qnx*)
1326                 case $basic_machine in
1327                     x86-* | i*86-*)
1328                         ;;
1329                     *)
1330                         os=-nto$os
1331                         ;;
1332                 esac
1333                 ;;
1334         -nto-qnx*)
1335                 ;;
1336         -nto*)
1337                 os=`echo $os | sed -e 's|nto|nto-qnx|'`
1338                 ;;
1339         -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
1340               | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
1341               | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
1342                 ;;
1343         -mac*)
1344                 os=`echo $os | sed -e 's|mac|macos|'`
1345                 ;;
1346         -linux-dietlibc)
1347                 os=-linux-dietlibc
1348                 ;;
1349         -linux*)
1350                 os=`echo $os | sed -e 's|linux|linux-gnu|'`
1351                 ;;
1352         -sunos5*)
1353                 os=`echo $os | sed -e 's|sunos5|solaris2|'`
1354                 ;;
1355         -sunos6*)
1356                 os=`echo $os | sed -e 's|sunos6|solaris3|'`
1357                 ;;
1358         -opened*)
1359                 os=-openedition
1360                 ;;
1361         -os400*)
1362                 os=-os400
1363                 ;;
1364         -wince*)
1365                 os=-wince
1366                 ;;
1367         -osfrose*)
1368                 os=-osfrose
1369                 ;;
1370         -osf*)
1371                 os=-osf
1372                 ;;
1373         -utek*)
1374                 os=-bsd
1375                 ;;
1376         -dynix*)
1377                 os=-bsd
1378                 ;;
1379         -acis*)
1380                 os=-aos
1381                 ;;
1382         -atheos*)
1383                 os=-atheos
1384                 ;;
1385         -syllable*)
1386                 os=-syllable
1387                 ;;
1388         -386bsd)
1389                 os=-bsd
1390                 ;;
1391         -ctix* | -uts*)
1392                 os=-sysv
1393                 ;;
1394         -nova*)
1395                 os=-rtmk-nova
1396                 ;;
1397         -ns2 )
1398                 os=-nextstep2
1399                 ;;
1400         -nsk*)
1401                 os=-nsk
1402                 ;;
1403         # Preserve the version number of sinix5.
1404         -sinix5.*)
1405                 os=`echo $os | sed -e 's|sinix|sysv|'`
1406                 ;;
1407         -sinix*)
1408                 os=-sysv4
1409                 ;;
1410         -tpf*)
1411                 os=-tpf
1412                 ;;
1413         -triton*)
1414                 os=-sysv3
1415                 ;;
1416         -oss*)
1417                 os=-sysv3
1418                 ;;
1419         -svr4)
1420                 os=-sysv4
1421                 ;;
1422         -svr3)
1423                 os=-sysv3
1424                 ;;
1425         -sysvr4)
1426                 os=-sysv4
1427                 ;;
1428         # This must come after -sysvr4.
1429         -sysv*)
1430                 ;;
1431         -ose*)
1432                 os=-ose
1433                 ;;
1434         -es1800*)
1435                 os=-ose
1436                 ;;
1437         -xenix)
1438                 os=-xenix
1439                 ;;
1440         -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
1441                 os=-mint
1442                 ;;
1443         -aros*)
1444                 os=-aros
1445                 ;;
1446         -kaos*)
1447                 os=-kaos
1448                 ;;
1449         -zvmoe)
1450                 os=-zvmoe
1451                 ;;
1452         -dicos*)
1453                 os=-dicos
1454                 ;;
1455         -nacl*)
1456                 ;;
1457         -none)
1458                 ;;
1459         *)
1460                 # Get rid of the `-' at the beginning of $os.
1461                 os=`echo $os | sed 's/[^-]*-//'`
1462                 echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
1463                 exit 1
1464                 ;;
1465 esac
1466 else
1467
1468 # Here we handle the default operating systems that come with various machines.
1469 # The value should be what the vendor currently ships out the door with their
1470 # machine or put another way, the most popular os provided with the machine.
1471
1472 # Note that if you're going to try to match "-MANUFACTURER" here (say,
1473 # "-sun"), then you have to tell the case statement up towards the top
1474 # that MANUFACTURER isn't an operating system.  Otherwise, code above
1475 # will signal an error saying that MANUFACTURER isn't an operating
1476 # system, and we'll never get to this point.
1477
1478 case $basic_machine in
1479         score-*)
1480                 os=-elf
1481                 ;;
1482         spu-*)
1483                 os=-elf
1484                 ;;
1485         *-acorn)
1486                 os=-riscix1.2
1487                 ;;
1488         arm*-rebel)
1489                 os=-linux
1490                 ;;
1491         arm*-semi)
1492                 os=-aout
1493                 ;;
1494         c4x-* | tic4x-*)
1495                 os=-coff
1496                 ;;
1497         tic54x-*)
1498                 os=-coff
1499                 ;;
1500         tic55x-*)
1501                 os=-coff
1502                 ;;
1503         tic6x-*)
1504                 os=-coff
1505                 ;;
1506         # This must come before the *-dec entry.
1507         pdp10-*)
1508                 os=-tops20
1509                 ;;
1510         pdp11-*)
1511                 os=-none
1512                 ;;
1513         *-dec | vax-*)
1514                 os=-ultrix4.2
1515                 ;;
1516         m68*-apollo)
1517                 os=-domain
1518                 ;;
1519         i386-sun)
1520                 os=-sunos4.0.2
1521                 ;;
1522         m68000-sun)
1523                 os=-sunos3
1524                 # This also exists in the configure program, but was not the
1525                 # default.
1526                 # os=-sunos4
1527                 ;;
1528         m68*-cisco)
1529                 os=-aout
1530                 ;;
1531         mep-*)
1532                 os=-elf
1533                 ;;
1534         mips*-cisco)
1535                 os=-elf
1536                 ;;
1537         mips*-*)
1538                 os=-elf
1539                 ;;
1540         or32-*)
1541                 os=-coff
1542                 ;;
1543         *-tti)  # must be before sparc entry or we get the wrong os.
1544                 os=-sysv3
1545                 ;;
1546         sparc-* | *-sun)
1547                 os=-sunos4.1.1
1548                 ;;
1549         *-be)
1550                 os=-beos
1551                 ;;
1552         *-haiku)
1553                 os=-haiku
1554                 ;;
1555         *-ibm)
1556                 os=-aix
1557                 ;;
1558         *-knuth)
1559                 os=-mmixware
1560                 ;;
1561         *-wec)
1562                 os=-proelf
1563                 ;;
1564         *-winbond)
1565                 os=-proelf
1566                 ;;
1567         *-oki)
1568                 os=-proelf
1569                 ;;
1570         *-hp)
1571                 os=-hpux
1572                 ;;
1573         *-hitachi)
1574                 os=-hiux
1575                 ;;
1576         i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
1577                 os=-sysv
1578                 ;;
1579         *-cbm)
1580                 os=-amigaos
1581                 ;;
1582         *-dg)
1583                 os=-dgux
1584                 ;;
1585         *-dolphin)
1586                 os=-sysv3
1587                 ;;
1588         m68k-ccur)
1589                 os=-rtu
1590                 ;;
1591         m88k-omron*)
1592                 os=-luna
1593                 ;;
1594         *-next )
1595                 os=-nextstep
1596                 ;;
1597         *-sequent)
1598                 os=-ptx
1599                 ;;
1600         *-crds)
1601                 os=-unos
1602                 ;;
1603         *-ns)
1604                 os=-genix
1605                 ;;
1606         i370-*)
1607                 os=-mvs
1608                 ;;
1609         *-next)
1610                 os=-nextstep3
1611                 ;;
1612         *-gould)
1613                 os=-sysv
1614                 ;;
1615         *-highlevel)
1616                 os=-bsd
1617                 ;;
1618         *-encore)
1619                 os=-bsd
1620                 ;;
1621         *-sgi)
1622                 os=-irix
1623                 ;;
1624         *-siemens)
1625                 os=-sysv4
1626                 ;;
1627         *-masscomp)
1628                 os=-rtu
1629                 ;;
1630         f30[01]-fujitsu | f700-fujitsu)
1631                 os=-uxpv
1632                 ;;
1633         *-rom68k)
1634                 os=-coff
1635                 ;;
1636         *-*bug)
1637                 os=-coff
1638                 ;;
1639         *-apple)
1640                 os=-macos
1641                 ;;
1642         *-atari*)
1643                 os=-mint
1644                 ;;
1645         *)
1646                 os=-none
1647                 ;;
1648 esac
1649 fi
1650
1651 # Here we handle the case where we know the os, and the CPU type, but not the
1652 # manufacturer.  We pick the logical manufacturer.
1653 vendor=unknown
1654 case $basic_machine in
1655         *-unknown)
1656                 case $os in
1657                         -riscix*)
1658                                 vendor=acorn
1659                                 ;;
1660                         -sunos*)
1661                                 vendor=sun
1662                                 ;;
1663                         -cnk*|-aix*)
1664                                 vendor=ibm
1665                                 ;;
1666                         -beos*)
1667                                 vendor=be
1668                                 ;;
1669                         -hpux*)
1670                                 vendor=hp
1671                                 ;;
1672                         -mpeix*)
1673                                 vendor=hp
1674                                 ;;
1675                         -hiux*)
1676                                 vendor=hitachi
1677                                 ;;
1678                         -unos*)
1679                                 vendor=crds
1680                                 ;;
1681                         -dgux*)
1682                                 vendor=dg
1683                                 ;;
1684                         -luna*)
1685                                 vendor=omron
1686                                 ;;
1687                         -genix*)
1688                                 vendor=ns
1689                                 ;;
1690                         -mvs* | -opened*)
1691                                 vendor=ibm
1692                                 ;;
1693                         -os400*)
1694                                 vendor=ibm
1695                                 ;;
1696                         -ptx*)
1697                                 vendor=sequent
1698                                 ;;
1699                         -tpf*)
1700                                 vendor=ibm
1701                                 ;;
1702                         -vxsim* | -vxworks* | -windiss*)
1703                                 vendor=wrs
1704                                 ;;
1705                         -aux*)
1706                                 vendor=apple
1707                                 ;;
1708                         -hms*)
1709                                 vendor=hitachi
1710                                 ;;
1711                         -mpw* | -macos*)
1712                                 vendor=apple
1713                                 ;;
1714                         -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
1715                                 vendor=atari
1716                                 ;;
1717                         -vos*)
1718                                 vendor=stratus
1719                                 ;;
1720                 esac
1721                 basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
1722                 ;;
1723 esac
1724
1725 echo $basic_machine$os
1726 exit
1727
1728 # Local variables:
1729 # eval: (add-hook 'write-file-hooks 'time-stamp)
1730 # time-stamp-start: "timestamp='"
1731 # time-stamp-format: "%:y-%02m-%02d"
1732 # time-stamp-end: "'"
1733 # End: