home *** CD-ROM | disk | FTP | other *** search
/ c't freeware shareware 2001 January / CT_SW0101.ISO / pc / software / kommunik / ftp / kmago112.tgz / kmago112.tar / kmago-1.1.2 / admin / config.sub < prev    next >
Text File  |  2001-01-17  |  27KB  |  1,338 lines

  1. #! /bin/sh
  2. # Configuration validation subroutine script.
  3. #   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000
  4. #   Free Software Foundation, Inc.
  5.  
  6. timestamp='2000-11-26'
  7.  
  8. # This file is (in principle) common to ALL GNU software.
  9. # The presence of a machine in this file suggests that SOME GNU software
  10. # can handle that machine.  It does not imply ALL GNU software can.
  11. #
  12. # This file is free software; you can redistribute it and/or modify
  13. # it under the terms of the GNU General Public License as published by
  14. # the Free Software Foundation; either version 2 of the License, or
  15. # (at your option) any later version.
  16. #
  17. # This program is distributed in the hope that it will be useful,
  18. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  19. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  20. # GNU General Public License for more details.
  21. #
  22. # You should have received a copy of the GNU General Public License
  23. # along with this program; if not, write to the Free Software
  24. # Foundation, Inc., 59 Temple Place - Suite 330,
  25. # Boston, MA 02111-1307, USA.
  26.  
  27. # As a special exception to the GNU General Public License, if you
  28. # distribute this file as part of a program that contains a
  29. # configuration script generated by Autoconf, you may include it under
  30. # the same distribution terms that you use for the rest of that program.
  31.  
  32. # Please send patches to <config-patches@gnu.org>.
  33. #
  34. # Configuration subroutine to validate and canonicalize a configuration type.
  35. # Supply the specified configuration type as an argument.
  36. # If it is invalid, we print an error message on stderr and exit with code 1.
  37. # Otherwise, we print the canonical config type on stdout and succeed.
  38.  
  39. # This file is supposed to be the same for all GNU packages
  40. # and recognize all the CPU types, system types and aliases
  41. # that are meaningful with *any* GNU software.
  42. # Each package is responsible for reporting which valid configurations
  43. # it does not support.  The user should be able to distinguish
  44. # a failure to support a valid configuration from a meaningless
  45. # configuration.
  46.  
  47. # The goal of this file is to map all the various variations of a given
  48. # machine specification into a single specification in the form:
  49. #    CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
  50. # or in some cases, the newer four-part form:
  51. #    CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
  52. # It is wrong to echo any other type of specification.
  53.  
  54. me=`echo "$0" | sed -e 's,.*/,,'`
  55.  
  56. usage="\
  57. Usage: $0 [OPTION] CPU-MFR-OPSYS
  58.        $0 [OPTION] ALIAS
  59.  
  60. Canonicalize a configuration name.
  61.  
  62. Operation modes:
  63.   -h, --help         print this help, then exit
  64.   -t, --time-stamp   print date of last modification, then exit
  65.  
  66. Report bugs and patches to <config-patches@gnu.org>.
  67.  
  68. Copyright (C) 1992, 93, 94, 95, 96, 97, 98, 99, 2000
  69. Free Software Foundation, Inc.  See the source for copying conditions."
  70.  
  71. help="
  72. Try \`$me --help' for more information."
  73.  
  74. # Parse command line
  75. while test $# -gt 0 ; do
  76.   case $1 in
  77.     --time-stamp | --time* | -t )
  78.        echo "$timestamp" ; exit 0 ;;
  79.     --help | --h* | -h )
  80.        echo "$usage"; exit 0 ;;
  81.     -- )     # Stop option processing
  82.        shift; break ;;
  83.     - )    # Use stdin as input.
  84.        break ;;
  85.     -* )
  86.        echo "$me: invalid option $1$help"
  87.        exit 1 ;;
  88.  
  89.     *local*)
  90.        # First pass through any local machine types.
  91.        echo $1
  92.        exit 0;;
  93.  
  94.     * )
  95.        break ;;
  96.   esac
  97. done
  98.  
  99. case $# in
  100.  0) echo "$me: missing argument$help" >&2
  101.     exit 1;;
  102.  1) ;;
  103.  *) echo "$me: too many arguments$help" >&2
  104.     exit 1;;
  105. esac
  106.  
  107. # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
  108. # Here we must recognize all the valid KERNEL-OS combinations.
  109. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
  110. case $maybe_os in
  111.   nto-qnx* | linux-gnu* | storm-chaos*)
  112.     os=-$maybe_os
  113.     basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
  114.     ;;
  115.   *)
  116.     basic_machine=`echo $1 | sed 's/-[^-]*$//'`
  117.     if [ $basic_machine != $1 ]
  118.     then os=`echo $1 | sed 's/.*-/-/'`
  119.     else os=; fi
  120.     ;;
  121. esac
  122.  
  123. ### Let's recognize common machines as not being operating systems so
  124. ### that things like config.sub decstation-3100 work.  We also
  125. ### recognize some manufacturers as not being operating systems, so we
  126. ### can provide default operating systems below.
  127. case $os in
  128.     -sun*os*)
  129.         # Prevent following clause from handling this invalid input.
  130.         ;;
  131.     -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
  132.     -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
  133.     -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
  134.     -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
  135.     -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
  136.     -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
  137.     -apple | -axis)
  138.         os=
  139.         basic_machine=$1
  140.         ;;
  141.     -sim | -cisco | -oki | -wec | -winbond)
  142.         os=
  143.         basic_machine=$1
  144.         ;;
  145.     -scout)
  146.         ;;
  147.     -wrs)
  148.         os=-vxworks
  149.         basic_machine=$1
  150.         ;;
  151.     -hiux*)
  152.         os=-hiuxwe2
  153.         ;;
  154.     -sco5)
  155.         os=-sco3.2v5
  156.         basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
  157.         ;;
  158.     -sco4)
  159.         os=-sco3.2v4
  160.         basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
  161.         ;;
  162.     -sco3.2.[4-9]*)
  163.         os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
  164.         basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
  165.         ;;
  166.     -sco3.2v[4-9]*)
  167.         # Don't forget version if it is 3.2v4 or newer.
  168.         basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
  169.         ;;
  170.     -sco*)
  171.         os=-sco3.2v2
  172.         basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
  173.         ;;
  174.     -udk*)
  175.         basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
  176.         ;;
  177.     -isc)
  178.         os=-isc2.2
  179.         basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
  180.         ;;
  181.     -clix*)
  182.         basic_machine=clipper-intergraph
  183.         ;;
  184.     -isc*)
  185.         basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
  186.         ;;
  187.     -lynx*)
  188.         os=-lynxos
  189.         ;;
  190.     -ptx*)
  191.         basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
  192.         ;;
  193.     -windowsnt*)
  194.         os=`echo $os | sed -e 's/windowsnt/winnt/'`
  195.         ;;
  196.     -psos*)
  197.         os=-psos
  198.         ;;
  199.     -mint | -mint[0-9]*)
  200.         basic_machine=m68k-atari
  201.         os=-mint
  202.         ;;
  203. esac
  204.  
  205. # Decode aliases for certain CPU-COMPANY combinations.
  206. case $basic_machine in
  207.     # Recognize the basic CPU types without company name.
  208.     # Some are omitted here because they have special meanings below.
  209.     tahoe | i860 | ia64 | m32r | m68k | m68000 | m88k | ns32k | arc \
  210.             | arm | arme[lb] | arm[bl]e | armv[2345] | armv[345][lb] | strongarm | xscale \
  211.         | pyramid | mn10200 | mn10300 | tron | a29k \
  212.         | 580 | i960 | h8300 \
  213.         | x86 | ppcbe | mipsbe | mipsle | shbe | shle \
  214.         | hppa | hppa1.0 | hppa1.1 | hppa2.0 | hppa2.0w | hppa2.0n \
  215.         | hppa64 \
  216.         | alpha | alphaev[4-8] | alphaev56 | alphapca5[67] \
  217.         | alphaev6[78] \
  218.         | we32k | ns16k | clipper | i370 | sh | sh[34] \
  219.         | powerpc | powerpcle \
  220.         | 1750a | dsp16xx | pdp11 | mips16 | mips64 | mipsel | mips64el \
  221.         | mips64orion | mips64orionel | mipstx39 | mipstx39el \
  222.         | mips64vr4300 | mips64vr4300el | mips64vr4100 | mips64vr4100el \
  223.         | mips64vr5000 | miprs64vr5000el | mcore \
  224.         | sparc | sparclet | sparclite | sparc64 | sparcv9 | v850 | c4x \
  225.         | thumb | d10v | d30v | fr30 | avr)
  226.         basic_machine=$basic_machine-unknown
  227.         ;;
  228.     m6811 | m68hc11 | m6812 | m68hc12)
  229.         # Motorola 68HC11/12.
  230.         basic_machine=$basic_machine-unknown
  231.         os=-none
  232.         ;;
  233.     m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | z8k | v70 | h8500 | w65 | pj | pjl)
  234.         ;;
  235.  
  236.     # We use `pc' rather than `unknown'
  237.     # because (1) that's what they normally are, and
  238.     # (2) the word "unknown" tends to confuse beginning users.
  239.     i[234567]86 | x86_64)
  240.       basic_machine=$basic_machine-pc
  241.       ;;
  242.     # Object if more than one company name word.
  243.     *-*-*)
  244.         echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
  245.         exit 1
  246.         ;;
  247.     # Recognize the basic CPU types with company name.
  248.     # FIXME: clean up the formatting here.
  249.     vax-* | tahoe-* | i[234567]86-* | i860-* | ia64-* | m32r-* | m68k-* | m68000-* \
  250.           | m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | c[123]* \
  251.           | arm-*  | armbe-* | armle-* | armv*-* | strongarm-* | xscale-* \
  252.           | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \
  253.           | power-* | none-* | 580-* | cray2-* | h8300-* | h8500-* | i960-* \
  254.           | xmp-* | ymp-* \
  255.           | x86-* | ppcbe-* | mipsbe-* | mipsle-* | shbe-* | shle-* \
  256.           | hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* | hppa2.0w-* \
  257.           | hppa2.0n-* | hppa64-* \
  258.           | alpha-* | alphaev[4-8]-* | alphaev56-* | alphapca5[67]-* \
  259.           | alphaev6[78]-* \
  260.           | we32k-* | cydra-* | ns16k-* | pn-* | np1-* | xps100-* \
  261.           | clipper-* | orion-* \
  262.           | sparclite-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \
  263.           | sparc64-* | sparcv9-* | sparc86x-* | mips16-* | mips64-* | mipsel-* \
  264.           | mips64el-* | mips64orion-* | mips64orionel-* \
  265.           | mips64vr4100-* | mips64vr4100el-* | mips64vr4300-* | mips64vr4300el-* \
  266.           | mipstx39-* | mipstx39el-* | mcore-* \
  267.           | f301-* | s390-* | sv1-* | t3e-* \
  268.           | m88110-* | m680[01234]0-* | m683?2-* | m68360-* | z8k-* | d10v-* \
  269.           | thumb-* | v850-* | d30v-* | tic30-* | c30-* | fr30-* \
  270.           | bs2000-* | tic54x-* | c54x-* | x86_64-*)
  271.         ;;
  272.     # Recognize the various machine names and aliases which stand
  273.     # for a CPU type and a company and sometimes even an OS.
  274.     386bsd)
  275.         basic_machine=i386-unknown
  276.         os=-bsd
  277.         ;;
  278.     3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
  279.         basic_machine=m68000-att
  280.         ;;
  281.     3b*)
  282.         basic_machine=we32k-att
  283.         ;;
  284.     a29khif)
  285.         basic_machine=a29k-amd
  286.         os=-udi
  287.         ;;
  288.     adobe68k)
  289.         basic_machine=m68010-adobe
  290.         os=-scout
  291.         ;;
  292.     alliant | fx80)
  293.         basic_machine=fx80-alliant
  294.         ;;
  295.     altos | altos3068)
  296.         basic_machine=m68k-altos
  297.         ;;
  298.     am29k)
  299.         basic_machine=a29k-none
  300.         os=-bsd
  301.         ;;
  302.     amdahl)
  303.         basic_machine=580-amdahl
  304.         os=-sysv
  305.         ;;
  306.     amiga | amiga-*)
  307.         basic_machine=m68k-unknown
  308.         ;;
  309.     amigaos | amigados)
  310.         basic_machine=m68k-unknown
  311.         os=-amigaos
  312.         ;;
  313.     amigaunix | amix)
  314.         basic_machine=m68k-unknown
  315.         os=-sysv4
  316.         ;;
  317.     apollo68)
  318.         basic_machine=m68k-apollo
  319.         os=-sysv
  320.         ;;
  321.     apollo68bsd)
  322.         basic_machine=m68k-apollo
  323.         os=-bsd
  324.         ;;
  325.     aux)
  326.         basic_machine=m68k-apple
  327.         os=-aux
  328.         ;;
  329.     balance)
  330.         basic_machine=ns32k-sequent
  331.         os=-dynix
  332.         ;;
  333.     convex-c1)
  334.         basic_machine=c1-convex
  335.         os=-bsd
  336.         ;;
  337.     convex-c2)
  338.         basic_machine=c2-convex
  339.         os=-bsd
  340.         ;;
  341.     convex-c32)
  342.         basic_machine=c32-convex
  343.         os=-bsd
  344.         ;;
  345.     convex-c34)
  346.         basic_machine=c34-convex
  347.         os=-bsd
  348.         ;;
  349.     convex-c38)
  350.         basic_machine=c38-convex
  351.         os=-bsd
  352.         ;;
  353.     cray | ymp)
  354.         basic_machine=ymp-cray
  355.         os=-unicos
  356.         ;;
  357.     cray2)
  358.         basic_machine=cray2-cray
  359.         os=-unicos
  360.         ;;
  361.     [ctj]90-cray)
  362.         basic_machine=c90-cray
  363.         os=-unicos
  364.         ;;
  365.     crds | unos)
  366.         basic_machine=m68k-crds
  367.         ;;
  368.     cris | cris-* | etrax*)
  369.         basic_machine=cris-axis
  370.         ;;
  371.     da30 | da30-*)
  372.         basic_machine=m68k-da30
  373.         ;;
  374.     decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
  375.         basic_machine=mips-dec
  376.         ;;
  377.     delta | 3300 | motorola-3300 | motorola-delta \
  378.           | 3300-motorola | delta-motorola)
  379.         basic_machine=m68k-motorola
  380.         ;;
  381.     delta88)
  382.         basic_machine=m88k-motorola
  383.         os=-sysv3
  384.         ;;
  385.     dpx20 | dpx20-*)
  386.         basic_machine=rs6000-bull
  387.         os=-bosx
  388.         ;;
  389.     dpx2* | dpx2*-bull)
  390.         basic_machine=m68k-bull
  391.         os=-sysv3
  392.         ;;
  393.     ebmon29k)
  394.         basic_machine=a29k-amd
  395.         os=-ebmon
  396.         ;;
  397.     elxsi)
  398.         basic_machine=elxsi-elxsi
  399.         os=-bsd
  400.         ;;
  401.     encore | umax | mmax)
  402.         basic_machine=ns32k-encore
  403.         ;;
  404.     es1800 | OSE68k | ose68k | ose | OSE)
  405.         basic_machine=m68k-ericsson
  406.         os=-ose
  407.         ;;
  408.     fx2800)
  409.         basic_machine=i860-alliant
  410.         ;;
  411.     genix)
  412.         basic_machine=ns32k-ns
  413.         ;;
  414.     gmicro)
  415.         basic_machine=tron-gmicro
  416.         os=-sysv
  417.         ;;
  418.     h3050r* | hiux*)
  419.         basic_machine=hppa1.1-hitachi
  420.         os=-hiuxwe2
  421.         ;;
  422.     h8300hms)
  423.         basic_machine=h8300-hitachi
  424.         os=-hms
  425.         ;;
  426.     h8300xray)
  427.         basic_machine=h8300-hitachi
  428.         os=-xray
  429.         ;;
  430.     h8500hms)
  431.         basic_machine=h8500-hitachi
  432.         os=-hms
  433.         ;;
  434.     harris)
  435.         basic_machine=m88k-harris
  436.         os=-sysv3
  437.         ;;
  438.     hp300-*)
  439.         basic_machine=m68k-hp
  440.         ;;
  441.     hp300bsd)
  442.         basic_machine=m68k-hp
  443.         os=-bsd
  444.         ;;
  445.     hp300hpux)
  446.         basic_machine=m68k-hp
  447.         os=-hpux
  448.         ;;
  449.     hp3k9[0-9][0-9] | hp9[0-9][0-9])
  450.         basic_machine=hppa1.0-hp
  451.         ;;
  452.     hp9k2[0-9][0-9] | hp9k31[0-9])
  453.         basic_machine=m68000-hp
  454.         ;;
  455.     hp9k3[2-9][0-9])
  456.         basic_machine=m68k-hp
  457.         ;;
  458.     hp9k6[0-9][0-9] | hp6[0-9][0-9])
  459.         basic_machine=hppa1.0-hp
  460.         ;;
  461.     hp9k7[0-79][0-9] | hp7[0-79][0-9])
  462.         basic_machine=hppa1.1-hp
  463.         ;;
  464.     hp9k78[0-9] | hp78[0-9])
  465.         # FIXME: really hppa2.0-hp
  466.         basic_machine=hppa1.1-hp
  467.         ;;
  468.     hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
  469.         # FIXME: really hppa2.0-hp
  470.         basic_machine=hppa1.1-hp
  471.         ;;
  472.     hp9k8[0-9][13679] | hp8[0-9][13679])
  473.         basic_machine=hppa1.1-hp
  474.         ;;
  475.     hp9k8[0-9][0-9] | hp8[0-9][0-9])
  476.         basic_machine=hppa1.0-hp
  477.         ;;
  478.     hppa-next)
  479.         os=-nextstep3
  480.         ;;
  481.     hppaosf)
  482.         basic_machine=hppa1.1-hp
  483.         os=-osf
  484.         ;;
  485.     hppro)
  486.         basic_machine=hppa1.1-hp
  487.         os=-proelf
  488.         ;;
  489.     i370-ibm* | ibm*)
  490.         basic_machine=i370-ibm
  491.         ;;
  492. # I'm not sure what "Sysv32" means.  Should this be sysv3.2?
  493.     i[34567]86v32)
  494.         basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
  495.         os=-sysv32
  496.         ;;
  497.     i[34567]86v4*)
  498.         basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
  499.         os=-sysv4
  500.         ;;
  501.     i[34567]86v)
  502.         basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
  503.         os=-sysv
  504.         ;;
  505.     i[34567]86sol2)
  506.         basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
  507.         os=-solaris2
  508.         ;;
  509.     i386mach)
  510.         basic_machine=i386-mach
  511.         os=-mach
  512.         ;;
  513.     i386-vsta | vsta)
  514.         basic_machine=i386-unknown
  515.         os=-vsta
  516.         ;;
  517.     i386-go32 | go32)
  518.         basic_machine=i386-unknown
  519.         os=-go32
  520.         ;;
  521.     i386-mingw32 | mingw32)
  522.         basic_machine=i386-unknown
  523.         os=-mingw32
  524.         ;;
  525.     i[34567]86-pw32 | pw32)
  526.         basic_machine=i586-unknown
  527.         os=-pw32
  528.         ;;
  529.     iris | iris4d)
  530.         basic_machine=mips-sgi
  531.         case $os in
  532.             -irix*)
  533.             ;;
  534.             *)
  535.             os=-irix4
  536.             ;;
  537.         esac
  538.         ;;
  539.     isi68 | isi)
  540.         basic_machine=m68k-isi
  541.         os=-sysv
  542.         ;;
  543.     m88k-omron*)
  544.         basic_machine=m88k-omron
  545.         ;;
  546.     magnum | m3230)
  547.         basic_machine=mips-mips
  548.         os=-sysv
  549.         ;;
  550.     merlin)
  551.         basic_machine=ns32k-utek
  552.         os=-sysv
  553.         ;;
  554.     miniframe)
  555.         basic_machine=m68000-convergent
  556.         ;;
  557.     *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
  558.         basic_machine=m68k-atari
  559.         os=-mint
  560.         ;;
  561.     mipsel*-linux*)
  562.         basic_machine=mipsel-unknown
  563.         os=-linux-gnu
  564.         ;;
  565.     mips*-linux*)
  566.         basic_machine=mips-unknown
  567.         os=-linux-gnu
  568.         ;;
  569.     mips3*-*)
  570.         basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
  571.         ;;
  572.     mips3*)
  573.         basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
  574.         ;;
  575.     mmix*)
  576.         basic_machine=mmix-knuth
  577.         os=-mmixware
  578.         ;;
  579.     monitor)
  580.         basic_machine=m68k-rom68k
  581.         os=-coff
  582.         ;;
  583.     msdos)
  584.         basic_machine=i386-unknown
  585.         os=-msdos
  586.         ;;
  587.     mvs)
  588.         basic_machine=i370-ibm
  589.         os=-mvs
  590.         ;;
  591.     ncr3000)
  592.         basic_machine=i486-ncr
  593.         os=-sysv4
  594.         ;;
  595.     netbsd386)
  596.         basic_machine=i386-unknown
  597.         os=-netbsd
  598.         ;;
  599.     netwinder)
  600.         basic_machine=armv4l-rebel
  601.         os=-linux
  602.         ;;
  603.     news | news700 | news800 | news900)
  604.         basic_machine=m68k-sony
  605.         os=-newsos
  606.         ;;
  607.     news1000)
  608.         basic_machine=m68030-sony
  609.         os=-newsos
  610.         ;;
  611.     news-3600 | risc-news)
  612.         basic_machine=mips-sony
  613.         os=-newsos
  614.         ;;
  615.     necv70)
  616.         basic_machine=v70-nec
  617.         os=-sysv
  618.         ;;
  619.     next | m*-next )
  620.         basic_machine=m68k-next
  621.         case $os in
  622.             -nextstep* )
  623.             ;;
  624.             -ns2*)
  625.               os=-nextstep2
  626.             ;;
  627.             *)
  628.               os=-nextstep3
  629.             ;;
  630.         esac
  631.         ;;
  632.     nh3000)
  633.         basic_machine=m68k-harris
  634.         os=-cxux
  635.         ;;
  636.     nh[45]000)
  637.         basic_machine=m88k-harris
  638.         os=-cxux
  639.         ;;
  640.     nindy960)
  641.         basic_machine=i960-intel
  642.         os=-nindy
  643.         ;;
  644.     mon960)
  645.         basic_machine=i960-intel
  646.         os=-mon960
  647.         ;;
  648.     nonstopux)
  649.         basic_machine=mips-compaq
  650.         os=-nonstopux
  651.         ;;
  652.     np1)
  653.         basic_machine=np1-gould
  654.         ;;
  655.     nsr-tandem)
  656.         basic_machine=nsr-tandem
  657.         ;;
  658.     op50n-* | op60c-*)
  659.         basic_machine=hppa1.1-oki
  660.         os=-proelf
  661.         ;;
  662.     OSE68000 | ose68000)
  663.         basic_machine=m68000-ericsson
  664.         os=-ose
  665.         ;;
  666.     os68k)
  667.         basic_machine=m68k-none
  668.         os=-os68k
  669.         ;;
  670.     pa-hitachi)
  671.         basic_machine=hppa1.1-hitachi
  672.         os=-hiuxwe2
  673.         ;;
  674.     paragon)
  675.         basic_machine=i860-intel
  676.         os=-osf
  677.         ;;
  678.     pbd)
  679.         basic_machine=sparc-tti
  680.         ;;
  681.     pbb)
  682.         basic_machine=m68k-tti
  683.         ;;
  684.         pc532 | pc532-*)
  685.         basic_machine=ns32k-pc532
  686.         ;;
  687.     pentium | p5 | k5 | k6 | nexgen)
  688.         basic_machine=i586-pc
  689.         ;;
  690.     pentiumpro | p6 | 6x86 | athlon)
  691.         basic_machine=i686-pc
  692.         ;;
  693.     pentiumii | pentium2)
  694.         basic_machine=i686-pc
  695.         ;;
  696.     pentium-* | p5-* | k5-* | k6-* | nexgen-*)
  697.         basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
  698.         ;;
  699.     pentiumpro-* | p6-* | 6x86-* | athlon-*)
  700.         basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
  701.         ;;
  702.     pentiumii-* | pentium2-*)
  703.         basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
  704.         ;;
  705.     pn)
  706.         basic_machine=pn-gould
  707.         ;;
  708.     power)    basic_machine=power-ibm
  709.         ;;
  710.     ppc)    basic_machine=powerpc-unknown
  711.             ;;
  712.     ppc-*)    basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
  713.         ;;
  714.     ppcle | powerpclittle | ppc-le | powerpc-little)
  715.         basic_machine=powerpcle-unknown
  716.             ;;
  717.     ppcle-* | powerpclittle-*)
  718.         basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
  719.         ;;
  720.     ps2)
  721.         basic_machine=i386-ibm
  722.         ;;
  723.     rom68k)
  724.         basic_machine=m68k-rom68k
  725.         os=-coff
  726.         ;;
  727.     rm[46]00)
  728.         basic_machine=mips-siemens
  729.         ;;
  730.     rtpc | rtpc-*)
  731.         basic_machine=romp-ibm
  732.         ;;
  733.     sa29200)
  734.         basic_machine=a29k-amd
  735.         os=-udi
  736.         ;;
  737.     sequent)
  738.         basic_machine=i386-sequent
  739.         ;;
  740.     sh)
  741.         basic_machine=sh-hitachi
  742.         os=-hms
  743.         ;;
  744.     sparclite-wrs)
  745.         basic_machine=sparclite-wrs
  746.         os=-vxworks
  747.         ;;
  748.     sps7)
  749.         basic_machine=m68k-bull
  750.         os=-sysv2
  751.         ;;
  752.     spur)
  753.         basic_machine=spur-unknown
  754.         ;;
  755.     st2000)
  756.         basic_machine=m68k-tandem
  757.         ;;
  758.     stratus)
  759.         basic_machine=i860-stratus
  760.         os=-sysv4
  761.         ;;
  762.     sun2)
  763.         basic_machine=m68000-sun
  764.         ;;
  765.     sun2os3)
  766.         basic_machine=m68000-sun
  767.         os=-sunos3
  768.         ;;
  769.     sun2os4)
  770.         basic_machine=m68000-sun
  771.         os=-sunos4
  772.         ;;
  773.     sun3os3)
  774.         basic_machine=m68k-sun
  775.         os=-sunos3
  776.         ;;
  777.     sun3os4)
  778.         basic_machine=m68k-sun
  779.         os=-sunos4
  780.         ;;
  781.     sun4os3)
  782.         basic_machine=sparc-sun
  783.         os=-sunos3
  784.         ;;
  785.     sun4os4)
  786.         basic_machine=sparc-sun
  787.         os=-sunos4
  788.         ;;
  789.     sun4sol2)
  790.         basic_machine=sparc-sun
  791.         os=-solaris2
  792.         ;;
  793.     sun3 | sun3-*)
  794.         basic_machine=m68k-sun
  795.         ;;
  796.     sun4)
  797.         basic_machine=sparc-sun
  798.         ;;
  799.     sun386 | sun386i | roadrunner)
  800.         basic_machine=i386-sun
  801.         ;;
  802.     sv1)
  803.         basic_machine=sv1-cray
  804.         os=-unicos
  805.         ;;
  806.     symmetry)
  807.         basic_machine=i386-sequent
  808.         os=-dynix
  809.         ;;
  810.     t3e)
  811.         basic_machine=t3e-cray
  812.         os=-unicos
  813.         ;;
  814.     tic54x | c54x*)
  815.         basic_machine=tic54x-unknown
  816.         os=-coff
  817.         ;;
  818.     tx39)
  819.         basic_machine=mipstx39-unknown
  820.         ;;
  821.     tx39el)
  822.         basic_machine=mipstx39el-unknown
  823.         ;;
  824.     tower | tower-32)
  825.         basic_machine=m68k-ncr
  826.         ;;
  827.     udi29k)
  828.         basic_machine=a29k-amd
  829.         os=-udi
  830.         ;;
  831.     ultra3)
  832.         basic_machine=a29k-nyu
  833.         os=-sym1
  834.         ;;
  835.     v810 | necv810)
  836.         basic_machine=v810-nec
  837.         os=-none
  838.         ;;
  839.     vaxv)
  840.         basic_machine=vax-dec
  841.         os=-sysv
  842.         ;;
  843.     vms)
  844.         basic_machine=vax-dec
  845.         os=-vms
  846.         ;;
  847.     vpp*|vx|vx-*)
  848.                basic_machine=f301-fujitsu
  849.                ;;
  850.     vxworks960)
  851.         basic_machine=i960-wrs
  852.         os=-vxworks
  853.         ;;
  854.     vxworks68)
  855.         basic_machine=m68k-wrs
  856.         os=-vxworks
  857.         ;;
  858.     vxworks29k)
  859.         basic_machine=a29k-wrs
  860.         os=-vxworks
  861.         ;;
  862.     w65*)
  863.         basic_machine=w65-wdc
  864.         os=-none
  865.         ;;
  866.     w89k-*)
  867.         basic_machine=hppa1.1-winbond
  868.         os=-proelf
  869.         ;;
  870.     xmp)
  871.         basic_machine=xmp-cray
  872.         os=-unicos
  873.         ;;
  874.         xps | xps100)
  875.         basic_machine=xps100-honeywell
  876.         ;;
  877.     z8k-*-coff)
  878.         basic_machine=z8k-unknown
  879.         os=-sim
  880.         ;;
  881.     none)
  882.         basic_machine=none-none
  883.         os=-none
  884.         ;;
  885.  
  886. # Here we handle the default manufacturer of certain CPU types.  It is in
  887. # some cases the only manufacturer, in others, it is the most popular.
  888.     w89k)
  889.         basic_machine=hppa1.1-winbond
  890.         ;;
  891.     op50n)
  892.         basic_machine=hppa1.1-oki
  893.         ;;
  894.     op60c)
  895.         basic_machine=hppa1.1-oki
  896.         ;;
  897.     mips)
  898.         if [ x$os = x-linux-gnu ]; then
  899.             basic_machine=mips-unknown
  900.         else
  901.             basic_machine=mips-mips
  902.         fi
  903.         ;;
  904.     romp)
  905.         basic_machine=romp-ibm
  906.         ;;
  907.     rs6000)
  908.         basic_machine=rs6000-ibm
  909.         ;;
  910.     vax)
  911.         basic_machine=vax-dec
  912.         ;;
  913.     pdp11)
  914.         basic_machine=pdp11-dec
  915.         ;;
  916.     we32k)
  917.         basic_machine=we32k-att
  918.         ;;
  919.     sh3 | sh4)
  920.         basic_machine=sh-unknown
  921.         ;;
  922.     sparc | sparcv9)
  923.         basic_machine=sparc-sun
  924.         ;;
  925.         cydra)
  926.         basic_machine=cydra-cydrome
  927.         ;;
  928.     orion)
  929.         basic_machine=orion-highlevel
  930.         ;;
  931.     orion105)
  932.         basic_machine=clipper-highlevel
  933.         ;;
  934.     mac | mpw | mac-mpw)
  935.         basic_machine=m68k-apple
  936.         ;;
  937.     pmac | pmac-mpw)
  938.         basic_machine=powerpc-apple
  939.         ;;
  940.     c4x*)
  941.         basic_machine=c4x-none
  942.         os=-coff
  943.         ;;
  944.     *)
  945.         echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
  946.         exit 1
  947.         ;;
  948. esac
  949.  
  950. # Here we canonicalize certain aliases for manufacturers.
  951. case $basic_machine in
  952.     *-digital*)
  953.         basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
  954.         ;;
  955.     *-commodore*)
  956.         basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
  957.         ;;
  958.     *)
  959.         ;;
  960. esac
  961.  
  962. # Decode manufacturer-specific aliases for certain operating systems.
  963.  
  964. if [ x"$os" != x"" ]
  965. then
  966. case $os in
  967.         # First match some system type aliases
  968.         # that might get confused with valid system types.
  969.     # -solaris* is a basic system type, with this one exception.
  970.     -solaris1 | -solaris1.*)
  971.         os=`echo $os | sed -e 's|solaris1|sunos4|'`
  972.         ;;
  973.     -solaris)
  974.         os=-solaris2
  975.         ;;
  976.     -svr4*)
  977.         os=-sysv4
  978.         ;;
  979.     -unixware*)
  980.         os=-sysv4.2uw
  981.         ;;
  982.     -gnu/linux*)
  983.         os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
  984.         ;;
  985.     # First accept the basic system types.
  986.     # The portable systems comes first.
  987.     # Each alternative MUST END IN A *, to match a version number.
  988.     # -sysv* is not here because it comes later, after sysvr4.
  989.     -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
  990.           | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
  991.           | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
  992.           | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
  993.           | -aos* \
  994.           | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
  995.           | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
  996.           | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \
  997.           | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
  998.           | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
  999.           | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
  1000.           | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
  1001.           | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
  1002.           | -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \
  1003.           | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* | -storm-chaos*)
  1004.     # Remember, each alternative MUST END IN *, to match a version number.
  1005.         ;;
  1006.     -qnx*)
  1007.         case $basic_machine in
  1008.             x86-* | i[34567]86-*)
  1009.             ;;
  1010.             *)
  1011.             os=-nto$os
  1012.             ;;
  1013.         esac
  1014.         ;;
  1015.     -nto*)
  1016.         os=-nto-qnx
  1017.         ;;
  1018.     -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
  1019.           | -windows* | -osx | -abug | -netware* | -os9* | -beos* \
  1020.           | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
  1021.         ;;
  1022.     -mac*)
  1023.         os=`echo $os | sed -e 's|mac|macos|'`
  1024.         ;;
  1025.     -linux*)
  1026.         os=`echo $os | sed -e 's|linux|linux-gnu|'`
  1027.         ;;
  1028.     -sunos5*)
  1029.         os=`echo $os | sed -e 's|sunos5|solaris2|'`
  1030.         ;;
  1031.     -sunos6*)
  1032.         os=`echo $os | sed -e 's|sunos6|solaris3|'`
  1033.         ;;
  1034.     -opened*)
  1035.         os=-openedition
  1036.         ;;
  1037.     -wince*)
  1038.         os=-wince
  1039.         ;;
  1040.     -osfrose*)
  1041.         os=-osfrose
  1042.         ;;
  1043.     -osf*)
  1044.         os=-osf
  1045.         ;;
  1046.     -utek*)
  1047.         os=-bsd
  1048.         ;;
  1049.     -dynix*)
  1050.         os=-bsd
  1051.         ;;
  1052.     -acis*)
  1053.         os=-aos
  1054.         ;;
  1055.     -386bsd)
  1056.         os=-bsd
  1057.         ;;
  1058.     -ctix* | -uts*)
  1059.         os=-sysv
  1060.         ;;
  1061.     -ns2 )
  1062.             os=-nextstep2
  1063.         ;;
  1064.     -nsk*)
  1065.         os=-nsk
  1066.         ;;
  1067.     # Preserve the version number of sinix5.
  1068.     -sinix5.*)
  1069.         os=`echo $os | sed -e 's|sinix|sysv|'`
  1070.         ;;
  1071.     -sinix*)
  1072.         os=-sysv4
  1073.         ;;
  1074.     -triton*)
  1075.         os=-sysv3
  1076.         ;;
  1077.     -oss*)
  1078.         os=-sysv3
  1079.         ;;
  1080.     -svr4)
  1081.         os=-sysv4
  1082.         ;;
  1083.     -svr3)
  1084.         os=-sysv3
  1085.         ;;
  1086.     -sysvr4)
  1087.         os=-sysv4
  1088.         ;;
  1089.     # This must come after -sysvr4.
  1090.     -sysv*)
  1091.         ;;
  1092.     -ose*)
  1093.         os=-ose
  1094.         ;;
  1095.     -es1800*)
  1096.         os=-ose
  1097.         ;;
  1098.     -xenix)
  1099.         os=-xenix
  1100.         ;;
  1101.         -*mint | -*MiNT)
  1102.             os=-mint
  1103.         ;;
  1104.     -none)
  1105.         ;;
  1106.     *)
  1107.         # Get rid of the `-' at the beginning of $os.
  1108.         os=`echo $os | sed 's/[^-]*-//'`
  1109.         echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
  1110.         exit 1
  1111.         ;;
  1112. esac
  1113. else
  1114.  
  1115. # Here we handle the default operating systems that come with various machines.
  1116. # The value should be what the vendor currently ships out the door with their
  1117. # machine or put another way, the most popular os provided with the machine.
  1118.  
  1119. # Note that if you're going to try to match "-MANUFACTURER" here (say,
  1120. # "-sun"), then you have to tell the case statement up towards the top
  1121. # that MANUFACTURER isn't an operating system.  Otherwise, code above
  1122. # will signal an error saying that MANUFACTURER isn't an operating
  1123. # system, and we'll never get to this point.
  1124.  
  1125. case $basic_machine in
  1126.     *-acorn)
  1127.         os=-riscix1.2
  1128.         ;;
  1129.     arm*-rebel)
  1130.         os=-linux
  1131.         ;;
  1132.     arm*-semi)
  1133.         os=-aout
  1134.         ;;
  1135.         pdp11-*)
  1136.         os=-none
  1137.         ;;
  1138.     *-dec | vax-*)
  1139.         os=-ultrix4.2
  1140.         ;;
  1141.     m68*-apollo)
  1142.         os=-domain
  1143.         ;;
  1144.     i386-sun)
  1145.         os=-sunos4.0.2
  1146.         ;;
  1147.     m68000-sun)
  1148.         os=-sunos3
  1149.         # This also exists in the configure program, but was not the
  1150.         # default.
  1151.         # os=-sunos4
  1152.         ;;
  1153.     m68*-cisco)
  1154.         os=-aout
  1155.         ;;
  1156.     mips*-cisco)
  1157.         os=-elf
  1158.         ;;
  1159.     mips*-*)
  1160.         os=-elf
  1161.         ;;
  1162.     *-tti)    # must be before sparc entry or we get the wrong os.
  1163.         os=-sysv3
  1164.         ;;
  1165.     sparc-* | *-sun)
  1166.         os=-sunos4.1.1
  1167.         ;;
  1168.     *-be)
  1169.         os=-beos
  1170.         ;;
  1171.     *-ibm)
  1172.         os=-aix
  1173.         ;;
  1174.     *-wec)
  1175.         os=-proelf
  1176.         ;;
  1177.     *-winbond)
  1178.         os=-proelf
  1179.         ;;
  1180.     *-oki)
  1181.         os=-proelf
  1182.         ;;
  1183.     *-hp)
  1184.         os=-hpux
  1185.         ;;
  1186.     *-hitachi)
  1187.         os=-hiux
  1188.         ;;
  1189.     i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
  1190.         os=-sysv
  1191.         ;;
  1192.     *-cbm)
  1193.         os=-amigaos
  1194.         ;;
  1195.     *-dg)
  1196.         os=-dgux
  1197.         ;;
  1198.     *-dolphin)
  1199.         os=-sysv3
  1200.         ;;
  1201.     m68k-ccur)
  1202.         os=-rtu
  1203.         ;;
  1204.     m88k-omron*)
  1205.         os=-luna
  1206.         ;;
  1207.     *-next )
  1208.         os=-nextstep
  1209.         ;;
  1210.     *-sequent)
  1211.         os=-ptx
  1212.         ;;
  1213.     *-crds)
  1214.         os=-unos
  1215.         ;;
  1216.     *-ns)
  1217.         os=-genix
  1218.         ;;
  1219.     i370-*)
  1220.         os=-mvs
  1221.         ;;
  1222.     *-next)
  1223.         os=-nextstep3
  1224.         ;;
  1225.         *-gould)
  1226.         os=-sysv
  1227.         ;;
  1228.         *-highlevel)
  1229.         os=-bsd
  1230.         ;;
  1231.     *-encore)
  1232.         os=-bsd
  1233.         ;;
  1234.         *-sgi)
  1235.         os=-irix
  1236.         ;;
  1237.         *-siemens)
  1238.         os=-sysv4
  1239.         ;;
  1240.     *-masscomp)
  1241.         os=-rtu
  1242.         ;;
  1243.     f301-fujitsu)
  1244.         os=-uxpv
  1245.         ;;
  1246.     *-rom68k)
  1247.         os=-coff
  1248.         ;;
  1249.     *-*bug)
  1250.         os=-coff
  1251.         ;;
  1252.     *-apple)
  1253.         os=-macos
  1254.         ;;
  1255.     *-atari*)
  1256.         os=-mint
  1257.         ;;
  1258.     *)
  1259.         os=-none
  1260.         ;;
  1261. esac
  1262. fi
  1263.  
  1264. # Here we handle the case where we know the os, and the CPU type, but not the
  1265. # manufacturer.  We pick the logical manufacturer.
  1266. vendor=unknown
  1267. case $basic_machine in
  1268.     *-unknown)
  1269.         case $os in
  1270.             -riscix*)
  1271.                 vendor=acorn
  1272.                 ;;
  1273.             -sunos*)
  1274.                 vendor=sun
  1275.                 ;;
  1276.             -aix*)
  1277.                 vendor=ibm
  1278.                 ;;
  1279.             -beos*)
  1280.                 vendor=be
  1281.                 ;;
  1282.             -hpux*)
  1283.                 vendor=hp
  1284.                 ;;
  1285.             -mpeix*)
  1286.                 vendor=hp
  1287.                 ;;
  1288.             -hiux*)
  1289.                 vendor=hitachi
  1290.                 ;;
  1291.             -unos*)
  1292.                 vendor=crds
  1293.                 ;;
  1294.             -dgux*)
  1295.                 vendor=dg
  1296.                 ;;
  1297.             -luna*)
  1298.                 vendor=omron
  1299.                 ;;
  1300.             -genix*)
  1301.                 vendor=ns
  1302.                 ;;
  1303.             -mvs* | -opened*)
  1304.                 vendor=ibm
  1305.                 ;;
  1306.             -ptx*)
  1307.                 vendor=sequent
  1308.                 ;;
  1309.             -vxsim* | -vxworks*)
  1310.                 vendor=wrs
  1311.                 ;;
  1312.             -aux*)
  1313.                 vendor=apple
  1314.                 ;;
  1315.             -hms*)
  1316.                 vendor=hitachi
  1317.                 ;;
  1318.             -mpw* | -macos*)
  1319.                 vendor=apple
  1320.                 ;;
  1321.             -*mint | -*MiNT)
  1322.                 vendor=atari
  1323.                 ;;
  1324.         esac
  1325.         basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
  1326.         ;;
  1327. esac
  1328.  
  1329. echo $basic_machine$os
  1330. exit 0
  1331.  
  1332. # Local variables:
  1333. # eval: (add-hook 'write-file-hooks 'time-stamp)
  1334. # time-stamp-start: "timestamp='"
  1335. # time-stamp-format: "%:y-%02m-%02d"
  1336. # time-stamp-end: "'"
  1337. # End:
  1338.