home *** CD-ROM | disk | FTP | other *** search
/ Power Hacker 2003 / Power_Hacker_2003.iso / Exploit and vulnerability / w00w00 / sectools / SRS / server / support / config.sub < prev    next >
Encoding:
Text File  |  2000-01-12  |  19.7 KB  |  972 lines

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