home *** CD-ROM | disk | FTP | other *** search
/ OpenStep 4.2J (Developer) / os42jdev.iso / NextDeveloper / Source / GNU / gcc / config.sub < prev    next >
Text File  |  1995-09-21  |  18KB  |  889 lines

  1. #! /bin/sh
  2. # Configuration validation subroutine script, version 1.1.
  3. #   Copyright (C) 1991, 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
  4. # This file is (in principle) common to ALL GNU software.
  5. # The presence of a machine in this file suggests that SOME GNU software
  6. # can handle that machine.  It does not imply ALL GNU software can. 
  7. #
  8. # This file is free software; you can redistribute it and/or modify
  9. # it under the terms of the GNU General Public License as published by
  10. # the Free Software Foundation; either version 2 of the License, or
  11. # (at your option) any later version.
  12. #
  13. # This program is distributed in the hope that it will be useful,
  14. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  16. # GNU General Public License for more details.
  17. #
  18. # You should have received a copy of the GNU General Public License
  19. # along with this program; if not, write to the Free Software
  20. # Foundation, Inc., 59 Temple Place - Suite 330,
  21. # Boston, MA 02111-1307, USA.
  22.  
  23. # As a special exception to the GNU General Public License, if you
  24. # distribute this file as part of a program that contains a
  25. # configuration script generated by Autoconf, you may include it under
  26. # the same distribution terms that you use for the rest of that program.
  27.  
  28. # Configuration subroutine to validate and canonicalize a configuration type.
  29. # Supply the specified configuration type as an argument.
  30. # If it is invalid, we print an error message on stderr and exit with code 1.
  31. # Otherwise, we print the canonical config type on stdout and succeed.
  32.  
  33. # This file is supposed to be the same for all GNU packages
  34. # and recognize all the CPU types, system types and aliases
  35. # that are meaningful with *any* GNU software.
  36. # Each package is responsible for reporting which valid configurations
  37. # it does not support.  The user should be able to distinguish
  38. # a failure to support a valid configuration from a meaningless
  39. # configuration.
  40.  
  41. # The goal of this file is to map all the various variations of a given
  42. # machine specification into a single specification in the form:
  43. #    CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
  44. # It is wrong to echo any other type of specification.
  45.  
  46. if [ x$1 = x ]
  47. then
  48.     echo Configuration name missing. 1>&2
  49.     echo "Usage: $0 CPU-MFR-OPSYS" 1>&2
  50.     echo "or     $0 ALIAS" 1>&2
  51.     echo where ALIAS is a recognized configuration type. 1>&2
  52.     exit 1
  53. fi
  54.  
  55. # First pass through any local machine types.
  56. case $1 in
  57.     *local*)
  58.         echo $1
  59.         exit 0
  60.         ;;
  61.     *)
  62.     ;;
  63. esac
  64.  
  65. # Separate what the user gave into CPU-COMPANY and OS (if any).
  66. basic_machine=`echo $1 | sed 's/-[^-]*$//'`
  67. if [ $basic_machine != $1 ]
  68. then os=`echo $1 | sed 's/.*-/-/'`
  69. else os=; fi
  70.  
  71. ### Let's recognize common machines as not being operating systems so
  72. ### that things like config.sub decstation-3100 work.  We also
  73. ### recognize some manufacturers as not being operating systems, so we
  74. ### can provide default operating systems below.
  75. case $os in
  76.     -sun*os*)
  77.         # Prevent following clause from handling this invalid input.
  78.         ;;
  79.     -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
  80.     -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
  81.     -unicom* | -ibm* | -hp | -isi* | -apollo | -altos* | \
  82.     -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
  83.     -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
  84.     -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp )
  85.         os=
  86.         basic_machine=$1
  87.         ;;
  88.     -hiux*)
  89.         os=-hiuxwe2
  90.         ;;
  91.     -sco4)
  92.         os=-sco3.2v4
  93.         basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'`
  94.         ;;
  95.     -sco3.2.[4-9]*)
  96.         os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
  97.         basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'`
  98.         ;;
  99.     -sco3.2v[4-9]*)
  100.         # Don't forget version if it is 3.2v4 or newer.
  101.         basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'`
  102.         ;;
  103.     -sco*)
  104.         os=-sco3.2v2
  105.         basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'`
  106.         ;;
  107.     -isc)
  108.         os=-isc2.2
  109.         basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'`
  110.         ;;
  111.     -clix*)
  112.         basic_machine=clipper-intergraph
  113.         ;;
  114.     -isc*)
  115.         basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'`
  116.         ;;
  117.     -lynx*)
  118.         os=-lynxos
  119.         ;;
  120.     -next)
  121.         if [ $basic_machine = m68k ]
  122.         then basic_machine=$1
  123.         fi
  124.         os=-nextstep3
  125.         ;;
  126.     -nextstep*)
  127.         if [ $basic_machine = m68k ]
  128.         then basic_machine=$basic_machine-next
  129.         fi
  130.         case $basic_machine in
  131.             hppa1*)
  132.                 ;;
  133.             hppa*)
  134.                 basic_machine=`echo $basic_machine \
  135.                     | sed -e 's/hppa/hppa1.1/'`
  136.         esac
  137.         if [ $os = -nextstep ]
  138.         then os=-nextstep3
  139.         fi
  140.         ;;
  141.     -ptx*)
  142.         basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
  143.         ;;
  144.     -windowsnt*)
  145.         os=`echo $os | sed -e 's/windowsnt/winnt/'`
  146.         ;;
  147. esac
  148.  
  149. # Decode aliases for certain CPU-COMPANY combinations.
  150. case $basic_machine in
  151.     # Recognize the basic CPU types without company name.
  152.     # Some are omitted here because they have special meanings below.
  153.     tahoe | i[345]86 | i860 | m68k | m68000 | m88k | ns32k | arm \
  154.         | arme[lb] | pyramid \
  155.         | tron | a29k | 580 | i960 | h8300 | hppa1.0 | hppa1.1 \
  156.         | alpha | we32k | ns16k | clipper | sparclite | i370 | sh \
  157.         | powerpc | powerpcle | sparc64 | 1750a | dsp16xx | mips64 | mipsel \
  158.         | pdp11 | mips64el | mips64orion | mips64orionel \
  159.         | sparc)
  160.         basic_machine=$basic_machine-unknown
  161.         ;;
  162.     # Object if more than one company name word.
  163.     *-*-*)
  164.         echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
  165.         exit 1
  166.         ;;
  167.     # Recognize the basic CPU types with company name.
  168.     vax-* | tahoe-* | i[345]86-* | i860-* | m68k-* | m68000-* | m88k-* \
  169.           | sparc-* | ns32k-* | fx80-* | arm-* | c[123]* \
  170.           | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* | power-* \
  171.           | none-* | 580-* | cray2-* | h8300-* | i960-* | xmp-* | ymp-* \
  172.           | hppa1.0-* | hppa1.1-* | alpha-* | we32k-* | cydra-* | ns16k-* \
  173.           | pn-* | np1-* | xps100-* | clipper-* | orion-* | sparclite-* \
  174.           | pdp11-* | sh-* | powerpc-* | powerpcle-* | sparc64-* | mips64-* | mipsel-* \
  175.           | mips64el-* | mips64orion-* | mips64orionel-*)
  176.         ;;
  177.     # Recognize the various machine names and aliases which stand
  178.     # for a CPU type and a company and sometimes even an OS.
  179.     3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
  180.         basic_machine=m68000-att
  181.         ;;
  182.     3b*)
  183.         basic_machine=we32k-att
  184.         ;;
  185.     alliant | fx80)
  186.         basic_machine=fx80-alliant
  187.         ;;
  188.     altos | altos3068)
  189.         basic_machine=m68k-altos
  190.         ;;
  191.     am29k)
  192.         basic_machine=a29k-none
  193.         os=-bsd
  194.         ;;
  195.     amdahl)
  196.         basic_machine=580-amdahl
  197.         os=-sysv
  198.         ;;
  199.     amiga | amiga-*)
  200.         basic_machine=m68k-cbm
  201.         ;;
  202.     amigados)
  203.         basic_machine=m68k-cbm
  204.         os=-amigados
  205.         ;;
  206.     amigaunix | amix)
  207.         basic_machine=m68k-cbm
  208.         os=-sysv4
  209.         ;;
  210.     apollo68)
  211.         basic_machine=m68k-apollo
  212.         os=-sysv
  213.         ;;
  214.     balance)
  215.         basic_machine=ns32k-sequent
  216.         os=-dynix
  217.         ;;
  218.     convex-c1)
  219.         basic_machine=c1-convex
  220.         os=-bsd
  221.         ;;
  222.     convex-c2)
  223.         basic_machine=c2-convex
  224.         os=-bsd
  225.         ;;
  226.     convex-c32)
  227.         basic_machine=c32-convex
  228.         os=-bsd
  229.         ;;
  230.     convex-c34)
  231.         basic_machine=c34-convex
  232.         os=-bsd
  233.         ;;
  234.     convex-c38)
  235.         basic_machine=c38-convex
  236.         os=-bsd
  237.         ;;
  238.     cray | ymp)
  239.         basic_machine=ymp-cray
  240.         os=-unicos
  241.         ;;
  242.     cray2)
  243.         basic_machine=cray2-cray
  244.         os=-unicos
  245.         ;;
  246.     crds | unos)
  247.         basic_machine=m68k-crds
  248.         ;;
  249.     da30 | da30-*)
  250.         basic_machine=m68k-da30
  251.         ;;
  252.     decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
  253.         basic_machine=mips-dec
  254.         ;;
  255.     delta | 3300 | motorola-3300 | motorola-delta \
  256.           | 3300-motorola | delta-motorola)
  257.         basic_machine=m68k-motorola
  258.         ;;
  259.     delta88)
  260.         basic_machine=m88k-motorola
  261.         os=-sysv3
  262.         ;;
  263.     dpx20 | dpx20-*)
  264.         basic_machine=rs6000-bull
  265.         os=-bosx
  266.         ;;
  267.     dpx2* | dpx2*-bull)
  268.         basic_machine=m68k-bull
  269.         os=-sysv3
  270.         ;;
  271.     ebmon29k)
  272.         basic_machine=a29k-amd
  273.         os=-ebmon
  274.         ;;
  275.     elxsi)
  276.         basic_machine=elxsi-elxsi
  277.         os=-bsd
  278.         ;;
  279.     encore | umax | mmax)
  280.         basic_machine=ns32k-encore
  281.         ;;
  282.     fx2800)
  283.         basic_machine=i860-alliant
  284.         ;;
  285.     genix)
  286.         basic_machine=ns32k-ns
  287.         ;;
  288.     gmicro)
  289.         basic_machine=tron-gmicro
  290.         os=-sysv
  291.         ;;
  292.     h3050r* | hiux*)
  293.         basic_machine=hppa1.1-hitachi
  294.         os=-hiuxwe2
  295.         ;;
  296.     h8300hms)
  297.         basic_machine=h8300-hitachi
  298.         os=-hms
  299.         ;;
  300.     harris)
  301.         basic_machine=m88k-harris
  302.         os=-sysv3
  303.         ;;
  304.     hp300-*)
  305.         basic_machine=m68k-hp
  306.         ;;
  307.     hp300bsd)
  308.         basic_machine=m68k-hp
  309.         os=-bsd
  310.         ;;
  311.     hp300hpux)
  312.         basic_machine=m68k-hp
  313.         os=-hpux
  314.         ;;
  315.     hp9k2[0-9][0-9] | hp9k31[0-9])
  316.         basic_machine=m68000-hp
  317.         ;;
  318.     hp9k3[2-9][0-9])
  319.         basic_machine=m68k-hp
  320.         ;;
  321.     hp9k7[0-9][0-9] | hp7[0-9][0-9] | hp9k8[0-9]7 | hp8[0-9]7)
  322.         basic_machine=hppa1.1-hp
  323.         ;;
  324.     hp9k8[0-9][0-9] | hp8[0-9][0-9])
  325.         basic_machine=hppa1.0-hp
  326.         ;;
  327.     i370-ibm* | ibm*)
  328.         basic_machine=i370-ibm
  329.         os=-mvs
  330.         ;;
  331. # I'm not sure what "Sysv32" means.  Should this be sysv3.2?
  332.     i[345]86v32)
  333.         basic_machine=`echo $1 | sed -e 's/86.*/86-unknown/'`
  334.         os=-sysv32
  335.         ;;
  336.     i[345]86v4*)
  337.         basic_machine=`echo $1 | sed -e 's/86.*/86-unknown/'`
  338.         os=-sysv4
  339.         ;;
  340.     i[345]86v)
  341.         basic_machine=`echo $1 | sed -e 's/86.*/86-unknown/'`
  342.         os=-sysv
  343.         ;;
  344.     i[345]86sol2)
  345.         basic_machine=`echo $1 | sed -e 's/86.*/86-unknown/'`
  346.         os=-solaris2
  347.         ;;
  348.     iris | iris4d)
  349.         basic_machine=mips-sgi
  350.         case $os in
  351.             -irix*)
  352.             ;;
  353.             *)
  354.             os=-irix4
  355.             ;;
  356.         esac
  357.         ;;
  358.     isi68 | isi)
  359.         basic_machine=m68k-isi
  360.         os=-sysv
  361.         ;;
  362.     m88k-omron*)
  363.         basic_machine=m88k-omron
  364.         ;;
  365.     magnum | m3230)
  366.         basic_machine=mips-mips
  367.         os=-sysv
  368.         ;;
  369.     merlin)
  370.         basic_machine=ns32k-utek
  371.         os=-sysv
  372.         ;;
  373.     miniframe)
  374.         basic_machine=m68000-convergent
  375.         ;;
  376.     mips3*-*)
  377.         basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
  378.         ;;
  379.     mips3*)
  380.         basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
  381.         ;;
  382.     ncr3000)
  383.         basic_machine=i486-ncr
  384.         os=-sysv4
  385.         ;;
  386.     news | news700 | news800 | news900)
  387.         basic_machine=m68k-sony
  388.         os=-newsos
  389.         ;;
  390.     news1000)
  391.         basic_machine=m68030-sony
  392.         os=-newsos
  393.         ;;
  394.     news-3600 | risc-news)
  395.         basic_machine=mips-sony
  396.         os=-newsos
  397.         ;;
  398.     next | m*-next )
  399.         basic_machine=m68k-next
  400.         case $os in
  401.             -nextstep* )
  402.             ;;
  403.             -ns2*)
  404.               os=-nextstep2
  405.             ;;
  406.             *)
  407.               os=-nextstep3
  408.             ;;
  409.         esac
  410.         ;;
  411.     nh3000)
  412.         basic_machine=m68k-harris
  413.         os=-cxux
  414.         ;;
  415.     nh[45]000)
  416.         basic_machine=m88k-harris
  417.         os=-cxux
  418.         ;;
  419.     nindy960)
  420.         basic_machine=i960-intel
  421.         os=-nindy
  422.         ;;
  423.     np1)
  424.         basic_machine=np1-gould
  425.         ;;
  426.     pa-hitachi)
  427.         basic_machine=hppa1.1-hitachi
  428.         os=-hiuxwe2
  429.         ;;
  430.     paragon)
  431.         basic_machine=i860-intel
  432.         os=-osf
  433.         ;;
  434.     pbd)
  435.         basic_machine=sparc-tti
  436.         ;;
  437.     pbb)
  438.         basic_machine=m68k-tti
  439.         ;;
  440.         pc532 | pc532-*)
  441.         basic_machine=ns32k-pc532
  442.         ;;
  443.     pentium | p5 | p6)
  444.         # We don't have specific support for the Intel Pentium (p6) followon yet, so just call it a Pentium
  445.         basic_machine=i586-intel
  446.         ;;
  447.     pentium-* | p5-* | p6-*)
  448.         # We don't have specific support for the Intel Pentium (p6) followon yet, so just call it a Pentium
  449.         basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
  450.         ;;
  451.     k5)
  452.         # We don't have specific support for AMD's K5 yet, so just call it a Pentium
  453.         basic_machine=i586-amd
  454.         ;;
  455.     nexen)
  456.         # We don't have specific support for Nexgen yet, so just call it a Pentium
  457.         basic_machine=i586-nexgen
  458.         ;;
  459.     pn)
  460.         basic_machine=pn-gould
  461.         ;;
  462.     power)    basic_machine=rs6000-ibm
  463.         ;;
  464.     ppc)    basic_machine=powerpc-unknown
  465.             ;;
  466.     ppc-*)    basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
  467.         ;;
  468.     ppcle | powerpclittle | ppc-le | powerpc-little)
  469.         basic_machine=powerpcle-unknown
  470.             ;;
  471.     ppcle-* | powerpclittle-*)
  472.         basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
  473.         ;;
  474.     ps2)
  475.         basic_machine=i386-ibm
  476.         ;;
  477.     rm[46]00)
  478.         basic_machine=mips-siemens
  479.         ;;
  480.     rtpc | rtpc-*)
  481.         basic_machine=romp-ibm
  482.         ;;
  483.     sequent)
  484.         basic_machine=i386-sequent
  485.         ;;
  486.     sh)
  487.         basic_machine=sh-hitachi
  488.         os=-hms
  489.         ;;
  490.     sps7)
  491.         basic_machine=m68k-bull
  492.         os=-sysv2
  493.         ;;
  494.     spur)
  495.         basic_machine=spur-unknown
  496.         ;;
  497.     sun2)
  498.         basic_machine=m68000-sun
  499.         ;;
  500.     sun2os3)
  501.         basic_machine=m68000-sun
  502.         os=-sunos3
  503.         ;;
  504.     sun2os4)
  505.         basic_machine=m68000-sun
  506.         os=-sunos4
  507.         ;;
  508.     sun3os3)
  509.         basic_machine=m68k-sun
  510.         os=-sunos3
  511.         ;;
  512.     sun3os4)
  513.         basic_machine=m68k-sun
  514.         os=-sunos4
  515.         ;;
  516.     sun4os3)
  517.         basic_machine=sparc-sun
  518.         os=-sunos3
  519.         ;;
  520.     sun4os4)
  521.         basic_machine=sparc-sun
  522.         os=-sunos4
  523.         ;;
  524.     sun4sol2)
  525.         basic_machine=sparc-sun
  526.         os=-solaris2
  527.         ;;
  528.     sun3 | sun3-*)
  529.         basic_machine=m68k-sun
  530.         ;;
  531.     sun4)
  532.         basic_machine=sparc-sun
  533.         ;;
  534.     sun386 | sun386i | roadrunner)
  535.         basic_machine=i386-sun
  536.         ;;
  537.     symmetry)
  538.         basic_machine=i386-sequent
  539.         os=-dynix
  540.         ;;
  541.     tower | tower-32)
  542.         basic_machine=m68k-ncr
  543.         ;;
  544.     udi29k)
  545.         basic_machine=a29k-amd
  546.         os=-udi
  547.         ;;
  548.     ultra3)
  549.         basic_machine=a29k-nyu
  550.         os=-sym1
  551.         ;;
  552.     vaxv)
  553.         basic_machine=vax-dec
  554.         os=-sysv
  555.         ;;
  556.     vms)
  557.         basic_machine=vax-dec
  558.         os=-vms
  559.         ;;
  560.     vxworks960)
  561.         basic_machine=i960-wrs
  562.         os=-vxworks
  563.         ;;
  564.     vxworks68)
  565.         basic_machine=m68k-wrs
  566.         os=-vxworks
  567.         ;;
  568.     vxworks29k)
  569.         basic_machine=a29k-wrs
  570.         os=-vxworks
  571.         ;;
  572.     xmp)
  573.         basic_machine=xmp-cray
  574.         os=-unicos
  575.         ;;
  576.         xps | xps100)
  577.         basic_machine=xps100-honeywell
  578.         ;;
  579.     none)
  580.         basic_machine=none-none
  581.         os=-none
  582.         ;;
  583.  
  584. # Here we handle the default manufacturer of certain CPU types.  It is in
  585. # some cases the only manufacturer, in others, it is the most popular.
  586.     mips)
  587.         basic_machine=mips-mips
  588.         ;;
  589.     romp)
  590.         basic_machine=romp-ibm
  591.         ;;
  592.     rs6000)
  593.         basic_machine=rs6000-ibm
  594.         ;;
  595.     vax)
  596.         basic_machine=vax-dec
  597.         ;;
  598.     pdp11)
  599.         basic_machine=pdp11-dec
  600.         ;;
  601.     we32k)
  602.         basic_machine=we32k-att
  603.         ;;
  604.     sparc)
  605.         basic_machine=sparc-sun
  606.         ;;
  607.         cydra)
  608.         basic_machine=cydra-cydrome
  609.         ;;
  610.     orion)
  611.         basic_machine=orion-highlevel
  612.         ;;
  613.     orion105)
  614.         basic_machine=clipper-highlevel
  615.         ;;
  616.     *)
  617.         echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
  618.         exit 1
  619.         ;;
  620. esac
  621.  
  622. # Here we canonicalize certain aliases for manufacturers.
  623. case $basic_machine in
  624.     *-digital*)
  625.         basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
  626.         ;;
  627.     *-commodore*)
  628.         basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
  629.         ;;
  630.     *)
  631.         ;;
  632. esac
  633.  
  634. # Decode manufacturer-specific aliases for certain operating systems.
  635.  
  636. if [ x"$os" != x"" ]
  637. then
  638. case $os in
  639.     # -solaris* is a basic system type, with this one exception.
  640.     -solaris1 | -solaris1.*)
  641.         os=`echo $os | sed -e 's|solaris1|sunos4|'`
  642.         ;;
  643.     -solaris)
  644.         os=-solaris2
  645.         ;;
  646.     -unixware* | svr4*)
  647.         os=-sysv4
  648.         ;;
  649.     -gnu/linux*)
  650.         os=`echo $os | sed -e 's|gnu/linux|linux|'`
  651.         ;;
  652.     # First accept the basic system types.
  653.     # The portable systems comes first.
  654.     # Each alternative MUST END IN A *, to match a version number.
  655.     # -sysv* is not here because it comes later, after sysvr4.
  656.     -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
  657.           | -vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[345]* \
  658.           | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
  659.           | -amigados* | -msdos* | -newsos* | -unicos* | -aos* \
  660.           | -nindy* | -vxworks* | -ebmon* | -hms* | -mvs* | -clix* \
  661.           | -riscos* | -linux* | -uniplus* | -iris* | -rtu* | -xenix* \
  662.           | -hiux* | -386bsd* | -netbsd* | -freebsd* | -riscix* \
  663.           | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* \
  664.           | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
  665.           | -udi* | -eabi* | -lites* )
  666.     # Remember, each alternative MUST END IN *, to match a version number.
  667.         ;;
  668.     -sunos5*)
  669.         os=`echo $os | sed -e 's|sunos5|solaris2|'`
  670.         ;;
  671.     -sunos6*)
  672.         os=`echo $os | sed -e 's|sunos6|solaris3|'`
  673.         ;;
  674.     -osfrose*)
  675.         os=-osfrose
  676.         ;;
  677.     -osf*)
  678.         os=-osf
  679.         ;;
  680.     -utek*)
  681.         os=-bsd
  682.         ;;
  683.     -dynix*)
  684.         os=-bsd
  685.         ;;
  686.     -acis*)
  687.         os=-aos
  688.         ;;
  689.     -ctix* | -uts*)
  690.         os=-sysv
  691.         ;;
  692.     # Preserve the version number of sinix5.
  693.     -sinix5.*)
  694.         os=`echo $os | sed -e 's|sinix|sysv|'`
  695.         ;;
  696.     -sinix*)
  697.         os=-sysv4
  698.         ;;
  699.     -triton*)
  700.         os=-sysv3
  701.         ;;
  702.     -oss*)
  703.         os=-sysv3
  704.         ;;
  705.     -svr4)
  706.         os=-sysv4
  707.         ;;
  708.     -svr3)
  709.         os=-sysv3
  710.         ;;
  711.     -sysvr4)
  712.         os=-sysv4
  713.         ;;
  714.     # This must come after -sysvr4.
  715.     -sysv*)
  716.         ;;
  717.     -xenix)
  718.         os=-xenix
  719.         ;;
  720.     -none)
  721.         ;;
  722.     *)
  723.         # Get rid of the `-' at the beginning of $os.
  724.         os=`echo $os | sed 's/[^-]*-//'`
  725.         echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
  726.         exit 1
  727.         ;;
  728. esac
  729. else
  730.  
  731. # Here we handle the default operating systems that come with various machines.
  732. # The value should be what the vendor currently ships out the door with their
  733. # machine or put another way, the most popular os provided with the machine.
  734.  
  735. # Note that if you're going to try to match "-MANUFACTURER" here (say,
  736. # "-sun"), then you have to tell the case statement up towards the top
  737. # that MANUFACTURER isn't an operating system.  Otherwise, code above
  738. # will signal an error saying that MANUFACTURER isn't an operating
  739. # system, and we'll never get to this point.
  740.  
  741. case $basic_machine in
  742.     *-acorn)
  743.         os=-riscix1.2
  744.         ;;
  745.     arm*-semi)
  746.         os=-aout
  747.         ;;
  748.         pdp11-*)
  749.         os=-none
  750.         ;;
  751.     *-dec | vax-*)
  752.         os=-ultrix4.2
  753.         ;;
  754.     m68*-apollo)
  755.         os=-domain
  756.         ;;
  757.     i386-sun)
  758.         os=-sunos4.0.2
  759.         ;;
  760.     m68000-sun)
  761.         os=-sunos3
  762.         # This also exists in the configure program, but was not the
  763.         # default.
  764.         # os=-sunos4
  765.         ;;
  766.     *-tti)    # must be before sparc entry or we get the wrong os.
  767.         os=-sysv3
  768.         ;;
  769.     sparc-* | *-sun)
  770.         os=-sunos4.1.1
  771.         ;;
  772.     *-ibm)
  773.         os=-aix
  774.         ;;
  775.     *-hp)
  776.         os=-hpux
  777.         ;;
  778.     *-hitachi)
  779.         os=-hiux
  780.         ;;
  781.     i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
  782.         os=-sysv
  783.         ;;
  784.     *-cbm)
  785.         os=-amigados
  786.         ;;
  787.     *-dg)
  788.         os=-dgux
  789.         ;;
  790.     *-dolphin)
  791.         os=-sysv3
  792.         ;;
  793.     m68k-ccur)
  794.         os=-rtu
  795.         ;;
  796.     m88k-omron*)
  797.         os=-luna
  798.         ;;
  799.     *-sequent)
  800.         os=-ptx
  801.         ;;
  802.     *-crds)
  803.         os=-unos
  804.         ;;
  805.     *-ns)
  806.         os=-genix
  807.         ;;
  808.     i370-*)
  809.         os=-mvs
  810.         ;;
  811.     *-next)
  812.         os=-nextstep3
  813.         ;;
  814.         *-gould)
  815.         os=-sysv
  816.         ;;
  817.         *-highlevel)
  818.         os=-bsd
  819.         ;;
  820.     *-encore)
  821.         os=-bsd
  822.         ;;
  823.         *-sgi)
  824.         os=-irix
  825.         ;;
  826.         *-siemens)
  827.         os=-sysv4
  828.         ;;
  829.     *-masscomp)
  830.         os=-rtu
  831.         ;;
  832.     *)
  833.         os=-none
  834.         ;;
  835. esac
  836. fi
  837.  
  838. # Here we handle the case where we know the os, and the CPU type, but not the
  839. # manufacturer.  We pick the logical manufacturer.
  840. vendor=unknown
  841. case $basic_machine in
  842.     *-unknown)
  843.         case $os in
  844.             -riscix*)
  845.                 vendor=acorn
  846.                 ;;
  847.             -sunos*)
  848.                 vendor=sun
  849.                 ;;
  850.             -lynxos*)
  851.                 vendor=lynx
  852.                 ;;
  853.             -aix*)
  854.                 vendor=ibm
  855.                 ;;
  856.             -hpux*)
  857.                 vendor=hp
  858.                 ;;
  859.             -hiux*)
  860.                 vendor=hitachi
  861.                 ;;
  862.             -unos*)
  863.                 vendor=crds
  864.                 ;;
  865.             -dgux*)
  866.                 vendor=dg
  867.                 ;;
  868.             -luna*)
  869.                 vendor=omron
  870.                 ;;
  871.             -genix*)
  872.                 vendor=ns
  873.                 ;;
  874.             -mvs*)
  875.                 vendor=ibm
  876.                 ;;
  877.             -ptx*)
  878.                 vendor=sequent
  879.                 ;;
  880.             -vxworks*)
  881.                 vendor=wrs
  882.                 ;;
  883.         esac
  884.         basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
  885.         ;;
  886. esac
  887.  
  888. echo $basic_machine$os
  889.