Annotation of gcc/config.sub, revision 1.1.1.1

1.1       root        1: #!/bin/sh
                      2: # Configuration validation subroutine script, version 1.0.
                      3: #   Copyright (C) 1991 Free Software Foundation, Inc.
                      4: 
                      5: #This file is free software; you can redistribute it and/or modify
                      6: #it under the terms of the GNU General Public License as published by
                      7: #the Free Software Foundation; either version 2 of the License, or
                      8: #(at your option) any later version.
                      9: 
                     10: #This program is distributed in the hope that it will be useful,
                     11: #but WITHOUT ANY WARRANTY; without even the implied warranty of
                     12: #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
                     13: #GNU General Public License for more details.
                     14: 
                     15: #You should have received a copy of the GNU General Public License
                     16: #along with this program; if not, write to the Free Software
                     17: #Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
                     18: 
                     19: 
                     20: # Configuration subroutine to validate and canonicalize a configuration type.
                     21: # Supply the specified configuration type as an argument.
                     22: # If it is invalid, we print an error message on stderr and exit with code 1.
                     23: # Otherwise, we print the canonical config type on stdout and succeed.
                     24: 
                     25: # This file is supposed to be the same for all GNU packages
                     26: # and recognize all the CPU types, system types and aliases
                     27: # that are meaningful with *any* GNU software.
                     28: # Each package is responsible for reporting which valid configurations
                     29: # it does not support.  The user should be able to distinguish
                     30: # a failure to support a valid configuration from a meaningless
                     31: # configuration.
                     32: 
                     33: # The goal of this file is to map all the various variations of a given
                     34: # machine specification into a single specification in the form:
                     35: #      CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
                     36: # it is wrong to echo any other type of specification
                     37: 
                     38: # First pass through any local machine types.
                     39: case $1 in
                     40:        *local*)
                     41:                echo $1
                     42:                exit 0
                     43:                ;;
                     44:        *)
                     45:        ;;
                     46: esac
                     47: 
                     48: # Separate what the user gave into CPU-COMPANY and OS (if any).
                     49: basic_machine=`echo $1 | sed 's/-[^-]*$//'`
                     50: if [ $basic_machine != $1 ]
                     51: then os=`echo $1 | sed 's/.*-/-/'`
                     52: else os=; fi
                     53: 
                     54: # Lets recognize common machines as not being OS so that things like
                     55: # config.subr decstation-3100 as legal.
                     56: case $os in
                     57:        -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
                     58:        -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
                     59:        -unicom* | -ibm* | -next* | -hp | -isi* | -apollo | -altos* | \
                     60:        -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -osf* | \
                     61:        -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
                     62:        -harris)
                     63:                os=
                     64:                basic_machine=$1
                     65:                ;;
                     66:        -sco*)
                     67:                os=-scosysv322
                     68:                basic_machine=i386-unknown
                     69:                ;;
                     70:        -isc*)
                     71:                os=-iscsysv
                     72:                basic_machine=i386-unknown
                     73:                ;;
                     74: esac
                     75: 
                     76: # Decode aliases for certain CPU-COMPANY combinations.
                     77: case $basic_machine in
                     78:        # Recognize the basic CPU types with without company name.
                     79:        # Some are omitted here because they have special meanings below.
                     80:        tahoe | i386 | i860 | m68k | m68000 | m88k | ns32k | arm | pyramid \
                     81:                | tron | a29k | 580 | i960 | h8300 | hppa)
                     82:                basic_machine=$basic_machine-unknown
                     83:                ;;
                     84:        # Recognize the basic CPU types with with company name.
                     85:        vax-* | tahoe-* | i386-* | i860-* | m68k-* | m68000-* | m88k-* \
                     86:              | sparc-* | ns32k-* | fx80-* | arm-* | c[123]* \
                     87:              | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \
                     88:              | none-* | 580-* | cray2-* | h8300-* | i960-* | xmp-* | ymp-* \
                     89:              | hppa-*)
                     90:                ;;
                     91:        # Recognize the various machine names and aliases which stand
                     92:        # for a CPU type and a company and sometimes even an OS.
                     93:        vaxv)
                     94:                basic_machine=vax-dec
                     95:                os=-sysv
                     96:                ;;
                     97:        vms)
                     98:                basic_machine=vax-dec
                     99:                os=-vms
                    100:                ;;
                    101:        i386v32)
                    102:                basic_machine=i386-unknown
                    103:                os=-sysv32
                    104:                ;;
                    105:        i386-sco* | i386sco | sco)
                    106:                basic_machine=i386-unknown
                    107:                os=-scosysv322
                    108:                ;;
                    109:        i386-isc* | isc)
                    110:                basic_machine=i386-unknown
                    111:                os=-iscsysv
                    112:                ;;
                    113:        i386v4*)
                    114:                basic_machine=i386-unknown
                    115:                os=-sysv4
                    116:                ;;
                    117:        i386v)
                    118:                basic_machine=i386-unknown
                    119:                os=-sysv
                    120:                ;;
                    121:        spur)
                    122:                basic_machine=spur-unknown
                    123:                ;;
                    124:        alliant | fx80)
                    125:                basic_machine=fx80-alliant
                    126:                ;;
                    127:        convex-c1)
                    128:                basic_machine=c1-convex
                    129:                os=-bsd
                    130:                ;;
                    131:        convex-c2)
                    132:                basic_machine=c2-convex
                    133:                os=-bsd
                    134:                ;;
                    135:        convex-c32)
                    136:                basic_machine=c32-convex
                    137:                os=-bsd
                    138:                ;;
                    139:        convex-c34)
                    140:                basic_machine=c34-convex
                    141:                os=-bsd
                    142:                ;;
                    143:        convex-c38)
                    144:                basic_machine=c38-convex
                    145:                os=-bsd
                    146:                ;;
                    147:        m88k-omron*)
                    148:                basic_machine=m88k-omron
                    149:                ;;
                    150:        merlin)
                    151:                basic_machine=ns32k-utek
                    152:                os=-sysv
                    153:                ;;
                    154:        crds | unos)
                    155:                basic_machine=m68k-crds
                    156:                ;;
                    157:        encore | umax | mmax)
                    158:                basic_machine=ns32k-encore
                    159:                os=-sysv
                    160:                ;;
                    161:        genix)
                    162:                basic_machine=ns32k-ns
                    163:                ;;
                    164:        iris | iris4d)
                    165:                basic_machine=mips-sgi
                    166:                os=-irix
                    167:                ;;
                    168:        news | news700 | news800 | news900)
                    169:                basic_machine=m68k-sony
                    170:                os=-newsos
                    171:                ;;
                    172:        3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
                    173:                basic_machine=m68k-att
                    174:                ;;
                    175:        delta | 3300 | motorola-3300 | motorola-delta \
                    176:              | 3300-motorola | delta-motorola)
                    177:                basic_machine=m68k-motorola
                    178:                ;;
                    179:        balance)
                    180:                basic_machine=ns32k-sequent
                    181:                os=-dynix
                    182:                ;;
                    183:         pc532)
                    184:                basic_machine=ns32k-pc532
                    185:                ;;
                    186:        symmetry)
                    187:                basic_machine=i386-sequent
                    188:                os=-dynix
                    189:                ;;
                    190:        sun2)
                    191:                basic_machine=m68000-sun
                    192:                ;;
                    193:        sun2os3)
                    194:                basic_machine=m68000-sun
                    195:                os=-sunos3
                    196:                ;;
                    197:        sun2os4)
                    198:                basic_machine=m68000-sun
                    199:                os=-sunos4
                    200:                ;;
                    201:        sun3os3)
                    202:                basic_machine=m68k-sun
                    203:                os=-sunos3
                    204:                ;;
                    205:        sun3os4)
                    206:                basic_machine=m68k-sun
                    207:                os=-sunos4
                    208:                ;;
                    209:        sun4os3)
                    210:                basic_machine=sparc-sun
                    211:                os=-sunos3
                    212:                ;;
                    213:        sun4os4)
                    214:                basic_machine=sparc-sun
                    215:                os=-sunos4
                    216:                ;;
                    217:        sun3)
                    218:                basic_machine=m68k-sun
                    219:                ;;
                    220:        sun4)
                    221:                basic_machine=sparc-sun
                    222:                ;;
                    223:        pbd)
                    224:                basic_machine=sparc-unicom
                    225:                ;;
                    226:        sun386 | sun386i | roadrunner)
                    227:                basic_machine=i386-sun
                    228:                ;;
                    229:        ps2)
                    230:                basic_machine=i386-ibm
                    231:                ;;
                    232:        next)
                    233:                basic_machine=m68k-next
                    234:                os=-sysv
                    235:                ;;
                    236:        amiga)
                    237:                basic_machine=m68k-cbm
                    238:                ;;
                    239:        hp9k3[2-9][0-9])
                    240:                basic_machine=m68k-hp
                    241:                ;;
                    242:        hp9k31[0-9] | hp9k2[0-9][0-9])
                    243:                basic_machine=m68000-hp
                    244:                ;;
                    245:        hp9k8[0-9][0-9] | hp9k7[0-9][0-9] | hp8[0-9][0-9] | hp7[0-9][0-9])
                    246:                basic_machine=hp800-hp
                    247:                ;;
                    248:        isi68 | isi)
                    249:                basic_machine=m68k-isi
                    250:                os=-sysv
                    251:                ;;
                    252:        apollo68)
                    253:                basic_machine=m68k-apollo
                    254:                os=-sysv
                    255:                ;;
                    256:        altos | altos3068)
                    257:                basic_machine=m68k-altos
                    258:                ;;
                    259:        miniframe)
                    260:                basic_machine=m68000-convergent
                    261:                ;;
                    262:        tower | tower-32)
                    263:                basic_machine=m68k-ncr
                    264:                ;;
                    265:        news-3600 | risc-news)
                    266:                basic_machine=mips-sony
                    267:                os=-newsos
                    268:                ;;
                    269:        decstation-dec | decstation | decstation-3100 | pmax | pmin | dec3100 | decstatn)
                    270:                basic_machine=mips-dec
                    271:                ;;
                    272:        magnum | m3230)
                    273:                basic_machine=mips-mips
                    274:                os=-sysv
                    275:                ;;
                    276:        gmicro)
                    277:                basic_machine=tron-gmicro
                    278:                os=-sysv
                    279:                ;;
                    280:        rtpc | rtpc-*)
                    281:                basic_machine=romp-ibm
                    282:                ;;
                    283:        am29k)
                    284:                basic_machine=a29k-none
                    285:                os=-bsd
                    286:                ;;
                    287:        amdahl)
                    288:                basic_machine=580-amdahl
                    289:                os=-sysv
                    290:                ;;
                    291:        amigados)
                    292:                basic_machine=m68k-cbm
                    293:                os=-amigados
                    294:                ;;
                    295:        amigaunix | amix)
                    296:                basic_machine=m68k-cbm
                    297:                os=-amix
                    298:                ;;
                    299:        cray | ymp)
                    300:                basic_machine=ymp-cray
                    301:                os=-unicos
                    302:                ;;
                    303:        cray2)
                    304:                basic_machine=cray2-cray
                    305:                os=-unicos
                    306:                ;;
                    307:        xmp)
                    308:                basic_machine=xmp-cray
                    309:                os=-unicos
                    310:                ;;
                    311:        delta88)
                    312:                basic_machine=m88k-motorola
                    313:                os=-m88kbcs
                    314:                ;;
                    315:        dpx2)
                    316:                basic_machine=m68k-bull
                    317:                os=-sysv
                    318:                ;;
                    319:        ebmon29k)
                    320:                basic_machine=a29k-amd
                    321:                os=-ebmon
                    322:                ;;
                    323:        h8300hds)
                    324:                basic_machine=h8300-hitachi
                    325:                os=-hds
                    326:                ;;
                    327:        harris)
                    328:                basic_machine=m88k-harris
                    329:                os=-m88kbcs
                    330:                ;;
                    331:        hp300bsd)
                    332:                basic_machine=m68k-hp
                    333:                os=-bsd
                    334:                ;;
                    335:        hp300hpux)
                    336:                basic_machine=m68k-hp
                    337:                os=-hpux
                    338:                ;;
                    339:        hp9k2[0-9][0-9] | hp9k31[0-9])
                    340:                basic_machine=m68000-hp
                    341:                os=-hpux
                    342:                ;;
                    343:        hp9k3[2-9][0-9])
                    344:                basic_machine=m68k-hp
                    345:                os=-hpux
                    346:                ;;
                    347:        ncr3000)
                    348:                basic_machine=i386-ncr
                    349:                os=-sysv4
                    350:                ;;
                    351:        news1000)
                    352:                basic_machine=m68030-sony
                    353:                os=-newsos
                    354:                ;;
                    355:        nindy960)
                    356:                basic_machine=i960-intel
                    357:                os=-nindy
                    358:                ;;
                    359:        pn)
                    360:                basic_machine=pn-gould
                    361:                os=-sysv
                    362:                ;;
                    363:        np1)
                    364:                basic_machine=np1-gould
                    365:                os=-sysv
                    366:                ;;
                    367:        ultra3)
                    368:                basic_machine=a29k-nyu
                    369:                os=-sym1
                    370:                ;;
                    371:        vxworks960)
                    372:                basic_machine=i960-wrs
                    373:                os=-vxworks
                    374:                ;;
                    375:        vxworks68)
                    376:                basic_machine=m68k-wrs
                    377:                os=-vxworks
                    378:                ;;
                    379:        none)
                    380:                basic_machine=none-none
                    381:                os=-none
                    382:                ;;
                    383: 
                    384: # Here we handle the default manufacturer of certain CPU types.  It is in
                    385: # some cases the only manufacturer, in others, it is the most popular.
                    386:        mips)
                    387:                basic_machine=mips-mips
                    388:                ;;
                    389:        romp)
                    390:                basic_machine=romp-ibm
                    391:                ;;
                    392:        rs6000)
                    393:                basic_machine=rs6000-ibm
                    394:                ;;
                    395:        vax)
                    396:                basic_machine=vax-dec
                    397:                ;;
                    398:        sparc)
                    399:                basic_machine=sparc-sun
                    400:                ;;
                    401:        fx2800)
                    402:                basic_machine=i860-alliant
                    403:                ;;
                    404:        *)
                    405:                echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
                    406:                exit 1
                    407:                ;;
                    408: esac
                    409: 
                    410: # Here we canonicalize certain aliases for manufacturers.
                    411: case $basic_machine in
                    412:        *-digital*)
                    413:                basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
                    414:                ;;
                    415:        *-commodore*)
                    416:                basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
                    417:                ;;
                    418:        *)
                    419:                ;;
                    420: esac
                    421: 
                    422: # Decode manufacturer-specific aliases for certain operating systems.
                    423: 
                    424: if [ "$os" ]
                    425: then
                    426: case $os in
                    427:        # First accept the basic system types.
                    428:        # The portable systems comes first.
                    429:        # Each alternative must end in a *, to match a version number.
                    430:        -bsd* | -sysv* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
                    431:              | -vms* | -sco* | -esix* | -isc* | -aix* | -sunos* | -hpux* \
                    432:              | -unos* | -osf* | -luna* | -dgux* | -solari* | -sym* | -amix* \
                    433:              | -amigados* | -msdos* | -unicos* \
                    434:              | -nindy* | -vxworks* | -ebmon* | -hds* | -m88kbcs*)
                    435:                ;;
                    436:        -newsos*)
                    437:                os=-bsd
                    438:                ;;
                    439:        -osfrose*)
                    440:                os=-osf
                    441:                ;;
                    442:        -osf*)
                    443:                os=-bsd
                    444:                ;;
                    445:        -dynix*)
                    446:                os=-bsd
                    447:                ;;
                    448:        -aos*)
                    449:                os=-bsd
                    450:                ;;
                    451:        -ctix* | -uts*)
                    452:                os=-sysv
                    453:                ;;
                    454:        -svr4)
                    455:                os=-sysv4
                    456:                ;;
                    457:        -svr3)
                    458:                os=-sysv3
                    459:                ;;
                    460:        *)
                    461:                # Get rid of the `-' at the beginning of $os.
                    462:                os=`echo $1 | sed 's/[^-]*-//'`
                    463:                echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
                    464:                exit 1
                    465:                ;;
                    466: esac
                    467: else
                    468: 
                    469: # Here we handle the default operating systems that come with various machines.
                    470: # The value should be what the vendor currently ships out the door with their
                    471: # machine or put another way, the most popular os provided with the machine.
                    472: case $basic_machine in
                    473:        *-dec | vax-*)
                    474:                os=-ultrix42
                    475:                ;;
                    476:        i386-sun)
                    477:                os=-sunos402
                    478:                ;;
                    479:        m68000-sun)
                    480:                os=-sunos3
                    481:                # This also exists in the configure program, but was not the
                    482:                # default.
                    483:                # os=-sunos4
                    484:                ;;
                    485:        sparc-* | *-sun)
                    486:                os=-sunos411
                    487:                ;;
                    488:        romp-*)
                    489:                os=-bsd
                    490:                ;;
                    491:        *-ibm)
                    492:                os=-aix
                    493:                ;;
                    494:        *-hp)
                    495:                os=-hpux
                    496:                ;;
                    497:        *-sgi | i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
                    498:                os=-sysv
                    499:                ;;
                    500:        *-cbm)
                    501:                os=-amigados
                    502:                ;;
                    503:        *-dg)
                    504:                os=-dgux
                    505:                ;;
                    506:        m88k-omron*)
                    507:                os=-luna
                    508:                ;;
                    509:        *-crds)
                    510:                os=-unos
                    511:                ;;
                    512:        *-ns)
                    513:                os=-genix
                    514:                ;;
                    515:        i386-*)
                    516:                os=-scosysv322
                    517:                ;;
                    518:        *)
                    519:                os=-none
                    520:                ;;
                    521: esac
                    522: fi
                    523: 
                    524: # Here we handle the case where we know the os, and the CPU type, but not the
                    525: # manufacturer.  We pick the logical manufacturer.
                    526: vendor=unknown
                    527: case $basic_machine in
                    528:        *-unknown)
                    529:                case $os in
                    530:                        -sunos*)
                    531:                                vendor=sun
                    532:                                ;;
                    533:                        -aix*)
                    534:                                vendor=ibm
                    535:                                ;;
                    536:                        -hpux*)
                    537:                                vendor=hp
                    538:                                ;;
                    539:                        -unos*)
                    540:                                vendor=crds
                    541:                                ;;
                    542:                        -dgux*)
                    543:                                vendor=dg
                    544:                                ;;
                    545:                        -luna*)
                    546:                                vendor=omron
                    547:                                ;;
                    548:                        -genix*)
                    549:                                vendor=ns
                    550:                                ;;
                    551:                esac
                    552:                basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
                    553:                ;;
                    554: esac
                    555: 
                    556: echo $basic_machine$os

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.