home *** CD-ROM | disk | FTP | other *** search
/ Education Sampler 1992 [NeXTSTEP] / Education_1992_Sampler.iso / NeXT / GnuSource / cc-61.0.1 / cc / configure < prev    next >
Text File  |  1991-10-18  |  16KB  |  740 lines

  1. #!/bin/sh
  2. # Configuration script for GNU CC
  3. #   Copyright (C) 1988, 1990, 1991 Free Software Foundation, Inc.
  4.  
  5. #This file is part of GNU CC.
  6.  
  7. #GNU CC is free software; you can redistribute it and/or modify
  8. #it under the terms of the GNU General Public License as published by
  9. #the Free Software Foundation; either version 2, or (at your option)
  10. #any later version.
  11.  
  12. #GNU CC is distributed in the hope that it will be useful,
  13. #but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15. #GNU General Public License for more details.
  16.  
  17. #You should have received a copy of the GNU General Public License
  18. #along with GNU CC; see the file COPYING.  If not, write to
  19. #the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  20.  
  21. #
  22. # Shell script to create proper links to machine-dependent files in
  23. # preparation for compiling gcc.
  24. #
  25. # Usage: configure [+srcdir=DIR] [+host=HOST] [+gas] [+nfp] TARGET
  26. #
  27. # If configure succeeds, it leaves its status in config.status.
  28. # If configure fails after disturbing the status quo, 
  29. #     config.status is removed.
  30. #
  31.  
  32. progname=$0
  33.  
  34. remove=rm
  35. hard_link=ln
  36. symbolic_link='ln -s'
  37.  
  38. #for Test
  39. #remove="echo rm"
  40. #hard_link="echo ln"
  41. #symbolic_link="echo ln -s"
  42.  
  43. for arg in $*;
  44. do
  45. # Handle -srcdir, etc, with space between it and argument.
  46.   if [ x$next_srcdir = xyes ]
  47.   then srcdir=$arg; next_srcdir=;
  48. # Handle -host, etc, with space between it and argument.
  49.   else if [ x$next_host = xyes ]
  50.   then host=$arg; next_host=;
  51.   else 
  52.     case $arg in
  53.      -srcdir=* | +srcdir=* | +srcdi=* | +srcd=* | +src=* | +sr=* | +s=*)
  54.     srcdir=`echo $arg | sed 's/[+-]s[a-z]*=//'`
  55.     ;;
  56.      -srcdir | +srcdir | +srcdi | +srcd | +src | +sr | +s)
  57.     next_srcdir=yes
  58.     ;;
  59.      -host | +host | +hos | +ho | +h)
  60.     next_host=yes
  61.     ;;
  62.      -host=* | +host=* | +hos=* | +ho=* | +h=*)
  63.     host=`echo $arg | sed 's/[+-]h[a-z]*=//'`
  64.     ;; 
  65.      -gas | +gas | +ga | +g)
  66.         gas=yes
  67.     ;;
  68.      -nfp | +nfp | +nf | +n)
  69.     nfp=yes
  70.     ;;
  71.      *)
  72. # Allow configure HOST TARGET
  73.     if [ x$host = x ]
  74.     then
  75.         host=$target
  76.     fi
  77.     target=$arg
  78.     ;;
  79.     esac
  80.   fi; fi
  81. done
  82.  
  83. # Complain if an arg is missing
  84. if [ x$target = x ]
  85. then
  86.     echo "No target specified."
  87.     echo "Usage: $progname [+srcdir=DIR] [+host=HOST] [+gas] [+nfp] TARGET"
  88.     echo -n "Where HOST and TARGET are something like "
  89.     echo "\`vax', \`sun3', \`encore', etc."
  90.     if [ -r config.status ]
  91.     then
  92.         cat config.status
  93.     fi
  94.     exit 1
  95. fi
  96.  
  97. # Default other arg
  98. if [ x$host = x ]
  99. then
  100.     host=$target
  101. fi
  102.  
  103. # Find the source files, if location was not specified.
  104. if [ x$srcdir = x ]
  105. then
  106.     srcdirdefaulted=1
  107.     srcdir=.
  108.     if [ ! -r tree.c ]
  109.     then
  110.         srcdir=..
  111.     fi
  112. fi
  113.  
  114. if [ ! -r ${srcdir}/tree.c ]
  115. then
  116.     if [ x$srcdirdefaulted = x ]
  117.     then
  118.       echo "$progname: Can't find compiler sources in \`${srcdir}'." 1>&2
  119.     else
  120.       echo "$progname: Can't find compiler sources in \`.' or \`..'." 1>&2
  121.     fi
  122.     exit 1
  123. fi
  124.  
  125. # Decode the host machine, then the target machine.
  126. # For the host machine, we save the xm_file variable as host_xm_file;
  127. # then we decode the target machine and forget everything else
  128. # that came from the host machine.
  129. for machine in $host $target; do
  130.  
  131.     # Separate what the user gave into CPU/company and OS (if any).
  132.     basic_machine=`echo $machine | sed 's/-[^-]*$//'`
  133.     if [ $basic_machine != $machine ]
  134.     then os=`echo $machine | sed 's/[^-]*-/-/'`
  135.     else os=; fi
  136.  
  137.     # Decode aliases for certain machine/company combinations.
  138.     case $basic_machine in
  139.         iris | iris4d)
  140.             basic_machine=mips/sgi
  141.             ;;
  142.         news | news800)
  143.             basic_machine=m68k/sony
  144.             ;;
  145.         3b1 | 7300 | 7300/att | att-7300)
  146.             basic_machine=m68k/att
  147.             ;;
  148.         delta | 3300 | motorola-3300 | motorola-delta \
  149.               | 3300/motorola | delta/motorola)
  150.             basic_machine=m68k/motorola
  151.             ;;
  152.         vax/dec)
  153.             basic_machine=vax
  154.             ;;
  155.         balance)
  156.             basic_machine=ns32k/sequent
  157.             ;;
  158.         symmetry)
  159.             basic_machine=i386/sequent
  160.             ;;
  161.         sun2)
  162.             basic_machine=m68000/sun
  163.             ;;
  164.         sun3)
  165.             basic_machine=m68k/sun
  166.             ;;
  167.         sun4)
  168.             basic_machine=sparc/sun
  169.             ;;
  170.         pbd)
  171.             basic_machine=sparc/unicom
  172.             ;;
  173.         sun386 | sun386i)
  174.             basic_machine=i386/sun
  175.             ;;
  176.         ps2)
  177.             basic_machine=i386/ibm
  178.             ;;
  179.         next)
  180.             basic_machine=m68k/next
  181.             ;;
  182.         nrw)
  183.             basic_machine=m88k/next
  184.             ;;
  185.         hp9k3[2-9][0-9])
  186.             basic_machine=m68k/hp
  187.             ;;
  188.         hp9k31[0-9] | hp9k2[0-9][0-9])
  189.             basic_machine=m68000/hp
  190.             ;;
  191.         isi68)
  192.             basic_machine=m68k/isi
  193.             ;;
  194.         apollo68)
  195.             basic_machine=m68k/apollo
  196.             ;;
  197.         altos | altos3068)
  198.             basic_machine=m68k/altos
  199.             ;;
  200.         miniframe)
  201.             basic_machine=m68000/convergent
  202.             ;;
  203.         tower | tower-32)
  204.             basic_machine=m68k/ncr
  205.             ;;
  206.         news-3600 | risc-news)
  207.             basic_machine=mips/sony
  208.             ;;
  209.         decstation | decstation-3100 | pmax)
  210.             basic_machine=mips/dec
  211.             ;;
  212.         magnum | m3230)
  213.             basic_machine=mips/mips
  214.             ;;
  215.         gmicro)
  216.             basic_machine=tron
  217.             ;;
  218.         convex-c1)
  219.             basic_machine=c1/convex
  220.             ;;
  221.         convex-c2)
  222.             basic_machine=c2/convex
  223.             ;;
  224.     esac
  225.  
  226.     # Decode manufacturer-specific aliases for certain operating systems.
  227.  
  228.     case $os in
  229.         -newsos*)
  230.             os=-bsd
  231.             ;;
  232.         -ultrix*)
  233.             os=-bsd
  234.             ;;
  235.         -osfrose*)
  236.             os=-osfrose
  237.             ;;
  238.         -osf*)
  239.             os=-bsd
  240.             ;;
  241.         -dynix*)
  242.             os=-bsd
  243.             ;;
  244.         -ctix*)
  245.             os=-sysv
  246.             ;;
  247.     esac
  248.  
  249.     machine=$basic_machine$os
  250.  
  251.     cpu_type=
  252.     xm_file=
  253.     tm_file=
  254.     make_var_file=
  255.  
  256.     case $machine in
  257.     vax | vax-bsd*)            # vaxen running BSD
  258.         ;;
  259.     vax-vms | vms)            # vaxen running VMS
  260.         cpu_type=vax
  261.         xm_file=xm-vms.h
  262.         tm_file=tm-vms.h
  263.         ;;
  264.     vax-sysv* | vaxv)        # vaxen running system V
  265.         cpu_type=vax
  266.         xm_file=xm-vaxv.h
  267.         tm_file=tm-vaxv.h
  268.         ;;
  269.         tahoe | tahoe-bsd*)        # tahoe running BSD
  270.                 ;;
  271.         tahoe/harris*)            # Harris tahoe, using COFF.
  272.         cpu_type=tahoe
  273.                 ;;
  274.     i386/sequent* | i386/sequent-bsd*)  # 80386 from Sequent
  275.         cpu_type=i386
  276.         xm_file=xm-i386.h
  277.         tm_file=tm-seq386.h
  278.         ;;
  279.     i386-mach | i386/*-mach)
  280.         cpu_type=i386
  281.         xm_file=xm-i386.h
  282.         tm_file=tm-i386gas.h
  283.         ;;
  284.     i386/sco | i386/sco-sysv* | i386/*-sco) # 80386 running SCO system
  285.         cpu_type=i386
  286.         xm_file=xm-i386v.h
  287.         tm_file=tm-i386sco.h
  288.         make_var_file=make-i386sco
  289.         ;;
  290.     i386/isc | i386/isc-sysv* | i386/*-isc)    # 80386 running ISC system
  291.         cpu_type=i386
  292.         xm_file=xm-i386v.h
  293.         tm_file=tm-i386isc.h
  294.         make_var_file=make-i386isc
  295.         ;;
  296.     i386/ibm | i386-aix | i386/ibm-aix)    # IBM PS/2 running AIX
  297.         cpu_type=i386
  298.         tm_file=tm-aix386.h
  299.         xm_file=xm-aix386.h
  300.         make_var_file=make-aix386
  301.         ;;
  302.     i386/sun*)
  303.         cpu_type=i386
  304.         xm_file=xm-sun386i.h
  305.         tm_file=tm-sun386i.h
  306.         ;;
  307.     i386-sysv4 | i386/*-sysv4 | i386v4)  # Intel 80386's running system V.4
  308.         cpu_type=i386
  309.         xm_file=xm-i386v.h
  310.         make_var_file=make-i386v
  311.         tm_file=tm-i386v4.h
  312.         ;;
  313.     i386-sysv* | i386/*-sysv* | i386v)  # Intel 80386's running system V
  314.         cpu_type=i386
  315.         xm_file=xm-i386v.h
  316.         make_var_file=make-i386v
  317.         if [ x$gas = xyes ]
  318.         then
  319.             tm_file=tm-i386gas.h
  320.         else
  321.             tm_file=tm-i386v.h
  322.         fi
  323.         ;;
  324.     i860 | i860-sysv* | i860/*-sysv*)
  325.         cpu_type=i860
  326.         if [ x$gas = xyes ]
  327.         then
  328.             tm_file=tm-i860g.h
  329.         else
  330.             tm_file=tm-i860.h
  331.         fi
  332.         ;;
  333.     i860-bsd* | i860/*-bsd*)
  334.         cpu_type=i860
  335.         if [ x$gas = xyes ]
  336.         then
  337.             tm_file=tm-i860bsdg.h
  338.         else
  339.             tm_file=tm-i860bsd.h
  340.         fi
  341.         ;;
  342.     sparc/*-sysv* | sparc-sysv*)
  343.         cpu_type=sparc
  344.         tm_file=tm-sparcv.h
  345.         xm_file=xm-sparcv.h
  346.         ;;
  347.     sparc | sparc/* | sparc-*os4 | sparc/*-*os4)
  348.         cpu_type=sparc
  349.         tm_file=tm-sparc.h
  350.         ;;
  351.     sparc-*os3 | sparc/*-*os3)
  352.         cpu_type=sparc
  353.         tm_file=tm-sun4os3.h
  354.         ;;
  355.     m68k/next)
  356.         cpu_type=m68k
  357.         tm_file=tm-next68.h
  358.         out_file=out-next68.c
  359.         xm_file=xm-next.h
  360.         ;;
  361.     m68k/sun-*os3)
  362.         cpu_type=m68k
  363.         if [ x$nfp = xyes ]
  364.         then
  365.             tm_file=tm-sun3os3nf.h
  366.         else
  367.             tm_file=tm-sun3os3.h
  368.         fi
  369.         ;;
  370.     m68k/sun-mach)
  371.         cpu_type=m68k
  372.         tm_file=tm-sun3mach.h
  373.         ;;
  374.     m68k/sun | m68k/sun-*os4)
  375.         cpu_type=m68k
  376.         if [ x$nfp = xyes ]
  377.         then
  378.             tm_file=tm-sun3nfp.h
  379.         else
  380.             tm_file=tm-sun3.h
  381.         fi
  382.         ;;
  383.     m68k/hp | m68k/hp-hpux*)    # HP 9000 series 300
  384.         cpu_type=m68k
  385.         xm_file=xm-hp9k320.h
  386.         if [ x$gas = xyes ]
  387.         then
  388.             make_var_file=make-hp9k320g
  389.             tm_file=tm-hp9k320g.h
  390.         else
  391.             make_var_file=make-hp9k320
  392.             tm_file=tm-hp9k320.h
  393.         fi
  394.         ;;
  395.     m68k/hp-bsd*)            # HP 9000/3xx running Berkeley Unix
  396.         cpu_type=m68k
  397.         tm_file=tm-hp9k3bsd.h
  398.         ;;
  399.     m68k/isi | m68k/isi-bsd*)
  400.         cpu_type=m68k
  401.         if [ x$nfp = xyes ]
  402.         then
  403.             tm_file=tm-isi68-nfp.h
  404.         else
  405.             tm_file=tm-isi68.h
  406.         fi
  407.         ;;
  408.     m68k/sony | m68k/sony-bsd*)
  409.             xm_file=xm-m68k.h
  410.         cpu_type=m68k
  411.         if [ x$gas = xyes ]
  412.         then
  413.             tm_file=tm-newsgas.h
  414.         else
  415.             tm_file=tm-news.h
  416.         fi
  417.         ;;
  418.     m68k/altos | m68k/altos-sysv*)           # Altos 3068
  419.             cpu_type=m68k
  420.         if [ x$gas = xyes ]
  421.         then
  422.                 xm_file=xm-altos3068.h
  423.                 tm_file=tm-altos3068.h
  424.         else
  425.             echo "The Altos is supported only with the GNU assembler" 1>&2
  426.             exit 1
  427.         fi
  428.             ;;
  429.     m68k/motorola | m68k/motorola-sysv*)
  430.         cpu_type=m68k
  431.         tm_file=tm-mot3300.h
  432.         xm_file=xm-mot3300.h
  433.         ;;
  434.     m68k/crds | m68k/crds-unos | m68k-unos | crds | unos)
  435.         cpu_type=m68k
  436.         xm_file=xm-crds.h
  437.         make_var_file=make-crds
  438.         tm_file=tm-crds.h
  439.         ;;
  440.     m68k/apollo)
  441.         cpu_type=m68k
  442.         make_var_file=make-apollo68
  443.         tm_file=tm-apollo68.h
  444.         ;;
  445.     m68k/ncr | m68k/ncr-sysv*)    # NCR Tower 32 SVR3
  446.         cpu_type=m68k
  447.         tm_file=tm-tower-as.h
  448.         xm_file=xm-tower.h
  449.         ;;
  450.     m68000/sun | m68000/sun-*os3)
  451.         cpu_type=m68k
  452.         tm_file=tm-sun2.h
  453.         ;;
  454.     m68000/sun-*os4)
  455.         cpu_type=m68k
  456.         tm_file=tm-sun2os4.h
  457.         ;;
  458.     m68000/hp | m68000/hp-hpux*)    # HP 9000 series 300
  459.         cpu_type=m68k
  460.         xm_file=xm-hp9k310.h
  461.         if [ x$gas = xyes ]
  462.         then
  463.             make_var_file=make-hp9k320g
  464.             tm_file=tm-hp9k310g.h
  465.         else
  466.             make_var_file=make-hp9k320
  467.             tm_file=tm-hp9k310.h
  468.         fi
  469.         ;;
  470.     m68000/hp-bsd*)            # HP 9000/200 running BSD
  471.         cpu_type=m68k
  472.         tm_file=tm-hp9k2bsd.h
  473.         make_var_file=make-hp9k2bsd
  474.         ;;
  475.     m68000/att | m68000/att-sysv*)
  476.         cpu_type=m68k
  477.         xm_file=xm-3b1.h
  478.         if [ x$gas = xyes ]
  479.         then
  480.             tm_file=tm-3b1g.h
  481.         else
  482.             tm_file=tm-3b1.h
  483.         fi
  484.         ;;
  485.     m68000/convergent | m68000/convergent-sysv*)
  486.         cpu_type=m68k
  487.         xm_file=xm-3b1.h
  488.         tm_file=tm-ctix.h
  489.         ;;
  490.     ns32k/sequent | ns32k/sequent-bsd*)
  491.         cpu_type=ns32k
  492.         tm_file=tm-sequent.h
  493.         ;;
  494.     ns32k/encore | ns32k/encore-bsd* | encore | encore-bsd*)
  495.         cpu_type=ns32k
  496.         tm_file=tm-encore.h
  497.         ;;
  498.     ns32k-genix* | ns32k/*-genix* | genix)
  499.         cpu_type=ns32k
  500.         xm_file=xm-genix.h
  501.         make_var_file=make-genix
  502.         tm_file=tm-genix.h
  503.         ;;
  504.     merlin)
  505.         cpu_type=ns32k
  506.         ;;
  507.     m88k/dg | m88k/dg-dgux* | m88k-dgux*)
  508.         cpu_type=m88k
  509.         make_var_file=make-m88kdgux
  510.         tm_file=tm-m88kdgux.h
  511.         ;;
  512.     m88k-v88r32 | m88k/*-v88r32)
  513.         cpu_type=m88k
  514.         tm_file=tm-v88r32.h
  515.         xm_file=xm-v88r32.h
  516.         ;;
  517.     m88k-sysv* | m88k/*-sysv*)
  518.         cpu_type=m88k
  519.         tm_file=tm-m88ksvr4.h
  520.         xm_file=xm-m88ksvr4.h
  521.         ;;
  522.     m88k/next)
  523.         cpu_type=m88k
  524.         tm_file=tm-next88.h
  525.         out_file=out-next88.c
  526.         xm_file=xm-next.h
  527.         ;;
  528.     alliant | alliant/alliant)    # Alliant FX/8
  529.         cpu_type=alliant
  530.         tm_file=tm-alliant.h
  531.         ;;
  532.     arm | arm/* | arm-*)        # Acorn RISC machine
  533.         cpu_type=arm
  534.         tm_file=tm-arm.h
  535.         ;;
  536.     c1/convex)            # Convex C1
  537.         if [ -r /usr/include/stdlib.h ]
  538.         then
  539.             tm_file=tm-convex1.h
  540.         else
  541.             tm_file=tm-conv1os7.h
  542.         fi
  543.         cpu_type=convex
  544.         ;;
  545.     c2/convex)            # Convex C2
  546.         if [ -r /usr/include/stdlib.h ]
  547.         then
  548.             tm_file=tm-convex2.h
  549.         else
  550.             tm_file=tm-conv2os7.h
  551.         fi
  552.         cpu_type=convex
  553.         ;;
  554.     mips/sgi | mips/sgi-sysv*)    # Mostly like a MIPS.
  555.         cpu_type=mips
  556.         tm_file=tm-iris.h
  557.         xm_file=xm-iris.h
  558.         ;;
  559.     mips | mips/mips)        # Default MIPS environment.
  560.         ;;
  561.     mips/dec | mips/dec-bsd*)    # Decstation.
  562.         cpu_type=mips
  563.         tm_file=tm-decstatn.h
  564.             ;;
  565.     mips/dec-osfrose*)        # Decstation with OSF/1 and OSF/rose object files
  566.         cpu_type=mips
  567.         tm_file=tm-decrose.h
  568.         make_var_file=make-decrose
  569.         ;;
  570.     mips/sony | mips/sony-bsd*)    # Sony NEWS 3600 or risc/news.
  571.         cpu_type=mips
  572.         tm_file=tm-mips-news.h
  573.         ;;
  574.     mips/*-sysv* | mips-sysv*)    # SYSV variant of MIPS system.
  575.         cpu_type=mips
  576.         tm_file=tm-mips-sysv.h
  577.             ;;
  578.     mips/*-bsd* | mips-bsd*)    # BSD 4.3 variant of MIPS system.
  579.         cpu_type=mips
  580.         tm_file=tm-mips-bsd.h
  581.             ;;
  582.     pyramid | pyramid/* | pyramid-*)
  583.         cpu_type=pyr
  584.         tm_file=tm-pyr.h
  585.         ;;
  586.     tron | tron/*)
  587.         cpu_type=gmicro
  588.         tm_file=tm_gmicro.h
  589.         ;;
  590.     a29k-bsd* | a29k/*-bsd*)
  591.         cpu_type=a29k
  592.         tm_file=tm-a29kunix.h
  593.         ;;
  594. #    370)
  595. #        ;;
  596.     esac
  597.     if [ x$pass1done = x ]
  598.     then
  599.         if [ x$cpu_type = x ]; then cpu_type=$host; fi
  600.         if [ x$xm_file = x ]; then host_xm_file=xm-$cpu_type.h
  601.         else host_xm_file=$xm_file
  602.         fi
  603.         if [ x$make_var_file = x ]
  604.         then make_var_file=make-$cpu_type; fi
  605.         host_make_var_file=$make_var_file
  606.         pass1done=yes
  607.     fi
  608. done
  609.  
  610. # Default the machine-specific variables that were not explicitly set.
  611. if [ x$cpu_type = x ]
  612. then cpu_type=$target; fi
  613.  
  614. if [ x$tm_file = x ]
  615. then tm_file=tm-$target.h; fi
  616.  
  617. md_file=${cpu_type}.md
  618.  
  619. if [ x$out_file = x ]
  620. then out_file=out-$cpu_type.c; fi
  621.  
  622.  
  623. # Set up the list of links to be made.
  624. # $links is the list of link names, and $files is the list of names to link to.
  625. if [ xx${vint} = xx ]
  626. then
  627.     files="$host_xm_file $tm_file
  628.         $md_file $out_file"
  629.     links="config.h tm.h md aux-output.c"
  630. else
  631.     files="$host_xm_file tm-vmc.h $tm_file
  632.         $md_file $out_file"
  633.     links="config.h tm.h tm-pre.h md aux-output.c"
  634. fi
  635.  
  636. # Make the links.
  637. while [ -n "$files" ]
  638. do
  639.     # set file to car of files, files to cdr of files
  640.     set $files; file=$1; shift; files=$*
  641.     set $links; link=$1; shift; links=$*
  642.  
  643.     if [ ! -r ${srcdir}/config/$file ]
  644.     then
  645.         echo "$progname: cannot create a link \`$link'," 1>&2
  646.         echo "since the file \`config/$file' does not exist." 1>&2
  647.         exit 1
  648.     fi
  649.  
  650.     $remove -f $link
  651.     rm -f config.status
  652.     # Make a symlink if possible, otherwise try a hard link
  653.     $symbolic_link ${srcdir}/config/$file $link 2>/dev/null || $hard_link ${srcdir}/config/$file $link
  654.  
  655.     if [ ! -r $link ]
  656.     then
  657.         echo "$progname: unable to link \`$link' to \`${srcdir}/config/$file'." 1>&2
  658.         exit 1
  659.     fi
  660.     echo "Linked \`$link' to \`${srcdir}/config/$file'."
  661. done
  662.  
  663. # Install a makefile, and make it set VPATH
  664. # if necessary so that the sources are found.
  665. # Also change its value of srcdir.
  666. # Also create a .gdbinit file which runs the one in srcdir
  667. # and tells GDB to look there for source files.
  668. case $srcdir in
  669. .)
  670.     ;;
  671. *)
  672.     echo "VPATH = ${srcdir}" > x
  673.     cat x ${srcdir}/Makefile.in | sed "s@^srcdir = \.@srcdir = ${srcdir}@" > Makefile.in
  674.     rm x
  675.     rm -f .gdbinit
  676.     echo "dir ." > .gdbinit
  677.     echo "dir ${srcdir}" >> .gdbinit
  678.     echo "source ${srcdir}/.gdbinit" >> .gdbinit
  679.     ;;
  680. esac
  681.  
  682. # Conditionalize the makefile for this machine.
  683. if [ -f ${srcdir}/config/${host_make_var_file} ]
  684. then
  685.     rm -f Makefile.tem
  686.     sed -e "/####/  r ${srcdir}/config/${host_make_var_file}" Makefile.in > Makefile.tem
  687. else
  688.     cp Makefile.in Makefile.tem
  689. fi
  690.  
  691. # Remove all formfeeds, since some Makes get confused by them.
  692. # Also substitute the actual target name, with / changed to --,
  693. # as the value assigned to `$(target)' in the makefile.
  694. target1=`echo $target | sed 's=/=-='`
  695. sed -e "s/ //" -e "s/^target=.*$/target=${target1}/" Makefile.tem > Makefile.tem1
  696.  
  697. # Delete the intermediate files
  698. rm Makefile.tem
  699. if [ x$srcdir != x. ]
  700. then
  701.     rm Makefile.in
  702. fi
  703.  
  704.  
  705. # Define macro CROSS_COMPILE in compilation if this is a cross-compiler.
  706. # Also use all.cross instead of all.internal.
  707. if [ x$host = x$target ]
  708. then
  709.     mv -f Makefile.tem1 Makefile
  710. else
  711.     sed -e "s/=all.internal$/=all.cross/" Makefile.tem1 > Makefile.tem2
  712.     rm -f Makefile
  713.     echo "CROSS=-DCROSS_COMPILE" > Makefile
  714.     cat Makefile.tem2 >> Makefile
  715.     rm Makefile.tem1 Makefile.tem2
  716. fi
  717.  
  718. if [ -f ${srcdir}/config/${host_make_var_file} ]
  719. then
  720.     echo "Created \`Makefile' using \`${host_make_var_file}'."
  721. else
  722.     echo "Created \`Makefile'."
  723. fi
  724.  
  725. if [ xx${vint} != xx ]
  726. then
  727.     vintmsg =" (vint)"
  728. fi
  729.  
  730. if [ x$host = x$target ]
  731. then
  732.     echo "Links are now set up for use with a $target." \
  733.         | tee config.status
  734. else
  735.     echo "Links are now set up for host $host and target $target." \
  736.         | tee config.status
  737. fi
  738.  
  739. exit 0
  740.