home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 7 / FreshFishVol7.bin / bbs / gnu / libg++-2.6-fsf.lha / libg++-2.6 / config.sub < prev    next >
Text File  |  1994-07-18  |  19KB  |  951 lines

  1. #!/bin/sh
  2. # Configuration validation subroutine script, version 1.1.
  3. #   Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc.
  4. # This file is (in principle) common to ALL GNU software.
  5. # The presence of a machine in this file suggests that SOME GNU software
  6. # can handle that machine.  It does not imply ALL GNU software can. 
  7.  
  8. #This file is free software; you can redistribute it and/or modify
  9. #it under the terms of the GNU General Public License as published by
  10. #the Free Software Foundation; either version 2 of the License, or
  11. #(at your option) any later version.
  12.  
  13. #This program is distributed in the hope that it will be useful,
  14. #but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  16. #GNU General Public License for more details.
  17.  
  18. #You should have received a copy of the GNU General Public License
  19. #along with this program; if not, write to the Free Software
  20. #Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  21.  
  22.  
  23. # Configuration subroutine to validate and canonicalize a configuration type.
  24. # Supply the specified configuration type as an argument.
  25. # If it is invalid, we print an error message on stderr and exit with code 1.
  26. # Otherwise, we print the canonical config type on stdout and succeed.
  27.  
  28. # This file is supposed to be the same for all GNU packages
  29. # and recognize all the CPU types, system types and aliases
  30. # that are meaningful with *any* GNU software.
  31. # Each package is responsible for reporting which valid configurations
  32. # it does not support.  The user should be able to distinguish
  33. # a failure to support a valid configuration from a meaningless
  34. # configuration.
  35.  
  36. # The goal of this file is to map all the various variations of a given
  37. # machine specification into a single specification in the form:
  38. #    CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
  39. # It is wrong to echo any other type of specification.
  40.  
  41. if [ x$1 = x ]
  42. then
  43.     echo Configuration name missing. 1>&2
  44.     echo "Usage: $0 CPU-MFR-OPSYS" 1>&2
  45.     echo "or     $0 ALIAS" 1>&2
  46.     echo where ALIAS is a recognized configuration type. 1>&2
  47.     exit 1
  48. fi
  49.  
  50. # First pass through any local machine types.
  51. case $1 in
  52.     *local*)
  53.         echo $1
  54.         exit 0
  55.         ;;
  56.     *)
  57.     ;;
  58. esac
  59.  
  60. # Separate what the user gave into CPU-COMPANY and OS (if any).
  61. basic_machine=`echo $1 | sed 's/-[^-]*$//'`
  62. if [ $basic_machine != $1 ]
  63. then os=`echo $1 | sed 's/.*-/-/'`
  64. else os=; fi
  65.  
  66. ### Let's recognize common machines as not being operating systems so
  67. ### that things like config.sub decstation-3100 work.  We also
  68. ### recognize some manufacturers as not being operating systems, so we
  69. ### can provide default operating systems below.
  70. case $os in
  71.     -sun*os*)
  72.         # Prevent following clause from handling this invalid input.
  73.         ;;
  74.     -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
  75.     -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
  76.     -unicom* | -ibm* | -next* | -hp | -isi* | -apollo | -altos* | \
  77.     -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
  78.     -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
  79.     -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
  80.     -sim | -cisco)                        # CYGNUS LOCAL
  81.         os=
  82.         basic_machine=$1
  83.         ;;
  84.     -scout)                        # CYGNUS LOCAL
  85.         ;;
  86.     -wrs)                        # CYGNUS LOCAL
  87.         os=vxworks
  88.         basic_machine=$1
  89.         ;;
  90.     -unixware)                    # CYGNUS LOCAL
  91.         os=-sysv4
  92.         basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'`
  93.         ;;
  94.     -hiux*)
  95.         os=-hiuxwe2
  96.         ;;
  97.     -sco4)
  98.         os=-sco3.2v4
  99.         basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'`
  100.         ;;
  101.     -sco3.2.[4-9]*)
  102.         os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
  103.         basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'`
  104.         ;;
  105.     -sco3.2v[4-9]*)
  106.         # Don't forget version if it is 3.2v4 or newer.
  107.         basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'`
  108.         ;;
  109.     -sco*)
  110.         os=-sco3.2v2
  111.         basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'`
  112.         ;;
  113.     -isc)
  114.         os=-isc2.2
  115.         basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'`
  116.         ;;
  117.     -clix*)
  118.         basic_machine=clipper-intergraph
  119.         ;;
  120.     -isc*)
  121.         basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'`
  122.         ;;
  123.     -lynx*)
  124.         os=-lynxos
  125.         ;;
  126.     -os9k)
  127.         os=-os9k
  128.         ;;
  129.     -os9)
  130.         os=-os9
  131.         ;;
  132. esac
  133.  
  134. # Decode aliases for certain CPU-COMPANY combinations.
  135. case $basic_machine in
  136.     # Recognize the basic CPU types without company name.
  137.     # Some are omitted here because they have special meanings below.
  138.     tahoe | i[34]86 | i860 | m68k | m68000 | m88k | ns32k | arm | pyramid \
  139.         | tron | a29k | 580 | i960 | hppa1.0 | hppa1.1 \
  140.         | alpha | we32k | ns16k | clipper | sparclite | i370 \
  141.         | powerpc \
  142.         | h8300 | h8300h | sh \
  143.         | m88110 | sparc | m680[01234]0 | m683?2 | z8k | v70 \
  144.         | v810 \
  145.         | h8500 | mips64 | mipsel | mips64el) # CYGNUS LOCAL
  146.         basic_machine=$basic_machine-unknown
  147.         ;;
  148.     # Object if more than one company name word.
  149.     *-*-*)
  150.         echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
  151.         exit 1
  152.         ;;
  153.     # Recognize the basic CPU types with company name.
  154.     vax-* | tahoe-* | i[34]86-* | i860-* | m68k-* | m68000-* | m88k-* \
  155.           | sparc-* | ns32k-* | fx80-* | arm-* | c[123]* \
  156.           | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \
  157.           | none-* | 580-* | cray2-* | i960-* | xmp-* | ymp-* \
  158.           | hppa1.0-* | hppa1.1-* | alpha-* | we32k-* | cydra-* | ns16k-* \
  159.           | pn-* | np1-* | xps100-* | clipper-* | orion-* | sparclite-* \
  160.           | powerpc-* \
  161.           | h8300-* | h8300h-* | sh-* \
  162.           | m88110-* | m680[01234]0-* | m683?2-* | z8k-* | h8500-* \
  163.           | mips64-* | mipsel-* | mips64el-*) # CYGNUS LOCAL
  164.         ;;
  165.     # Recognize the various machine names and aliases which stand
  166.     # for a CPU type and a company and sometimes even an OS.
  167.     sparc64)                    # CYGNUS LOCAL
  168.         basic_machine=sparc64-sun
  169.         os=-elf
  170.         ;;
  171.     sparc64-*)                    # CYGNUS LOCAL
  172.         ;;
  173.  
  174.     mips3-*)                    # CYGNUS LOCAL
  175.         basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
  176.         ;;
  177.     mips3)                        # CYGNUS LOCAL
  178.         basic_machine=mips64-unknown
  179.         ;;
  180.     dpx20 | dpx20-*)                # CYGNUS LOCAL
  181.         basic_machine=rs6000-bull
  182.         os=-bosx
  183.         ;;
  184.     unixware)                    # CYGNUS LOCAL
  185.         os=-sysv4
  186.         basic_machine=i386-unknown
  187.         ;;
  188.     vaxv)
  189.         basic_machine=vax-dec
  190.         os=-sysv
  191.         ;;
  192.     vms)
  193.         basic_machine=vax-dec
  194.         os=-vms
  195.         ;;
  196.     i370-ibm* | ibm*)
  197.         basic_machine=i370-ibm
  198.         os=-mvs
  199.         ;;
  200.     i386mach)                    # CYGNUS LOCAL
  201.         basic_machine=i386-mach
  202.         os=-mach
  203.         ;;
  204.     i[34]86v32)
  205.         basic_machine=`echo $1 | sed -e 's/86.*/86-unknown/'`
  206.         os=-sysv32
  207.         ;;
  208.     i[34]86v4*)
  209.         basic_machine=`echo $1 | sed -e 's/86.*/86-unknown/'`
  210.         os=-sysv4
  211.         ;;
  212.     i[34]86v)
  213.         basic_machine=`echo $1 | sed -e 's/86.*/86-unknown/'`
  214.         os=-sysv
  215.         ;;
  216.     i[34]86sol2)
  217.         basic_machine=`echo $1 | sed -e 's/86.*/86-unknown/'`
  218.         os=-solaris2
  219.         ;;
  220.     vsta | i386-vsta)                # CYGNUS LOCAL
  221.         basic_machine=i386-unknown
  222.         os=-vsta
  223.         ;;
  224.     go32 | i386-go32)                # CYGNUS LOCAL
  225.         basic_machine=i386-unknown
  226.         os=-go32
  227.         ;;
  228.     i386-linux* | linux)                # CYGNUS LOCAL
  229.         basic_machine=i386-unknown
  230.         os=-linux
  231.         ;;
  232.     i386-linux*coff | linuxcoff)            # CYGNUS LOCAL
  233.         basic_machine=i386-unknown
  234.         os=-linuxcoff
  235.         ;;
  236.     i386-linux*elf | linuxelf)            # CYGNUS LOCAL
  237.         basic_machine=i386-unknown
  238.         os=-linuxelf
  239.         ;;
  240.     386bsd)                        # CYGNUS LOCAL
  241.         basic_machine=i386-unknown
  242.         os=-bsd
  243.         ;;
  244.     netbsd386)
  245.         basic_machine=i386-unknown        # CYGNUS LOCAL
  246.         os=-netbsd
  247.         ;;
  248.     spur)
  249.         basic_machine=spur-unknown
  250.         ;;
  251.     paragon)
  252.         basic_machine=i860-intel
  253.         os=-osf
  254.         ;;
  255.     alliant | fx80)
  256.         basic_machine=fx80-alliant
  257.         ;;
  258.     convex-c1)
  259.         basic_machine=c1-convex
  260.         os=-bsd
  261.         ;;
  262.     convex-c2)
  263.         basic_machine=c2-convex
  264.         os=-bsd
  265.         ;;
  266.     convex-c32)
  267.         basic_machine=c32-convex
  268.         os=-bsd
  269.         ;;
  270.     convex-c34)
  271.         basic_machine=c34-convex
  272.         os=-bsd
  273.         ;;
  274.     convex-c38)
  275.         basic_machine=c38-convex
  276.         os=-bsd
  277.         ;;
  278.     m88k-omron*)
  279.         basic_machine=m88k-omron
  280.         ;;
  281.     merlin)
  282.         basic_machine=ns32k-utek
  283.         os=-sysv
  284.         ;;
  285.     crds | unos)
  286.         basic_machine=m68k-crds
  287.         ;;
  288.     elxsi)
  289.         basic_machine=elxsi-elxsi
  290.         os=-bsd
  291.         ;;
  292.     encore | umax | mmax)
  293.         basic_machine=ns32k-encore
  294.         ;;
  295.     genix)
  296.         basic_machine=ns32k-ns
  297.         ;;
  298.     iris | iris4d | \
  299.     iris3 | iris4)                    # CYGNUS LOCAL
  300.         basic_machine=mips-sgi
  301.         case $os in
  302.             -irix*)
  303.             ;;
  304.             *)
  305.             os=-irix4
  306.             ;;
  307.         esac
  308.         ;;
  309.     news | news700 | news800 | news900)
  310.         basic_machine=m68k-sony
  311.         os=-newsos
  312.         ;;
  313.     3b1 | 7300 | 73