home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 9 / FreshFishVol9-CD2.bin / bbs / gnu / gcc-2.3.3-src.lha / gcc-2.3.3 / configure < prev    next >
Encoding:
Text File  |  1994-02-07  |  30.5 KB  |  1,369 lines

  1. #!/bin/sh
  2. # Configuration script for GNU CC
  3. #   Copyright (C) 1988, 1990, 1991, 1992 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. # Options: --srcdir=DIR        specifies directory where sources are.
  26. #        --host=HOST        specifies host configuration.
  27. #       --target=TARGET    specifies target configuration.
  28. #       --build=TARGET    specifies configuration of machine you are
  29. #                using to compile GCC.
  30. #       --prefix=DIR        specifies directory to install in.
  31. #       --local-prefix=DIR    specifies directory to put local ./include in.
  32. #       --exec-prefix=DIR    specifies directory to install executables in.
  33. #       --with-gnu-ld    arrange to work with GNU ld.
  34. #       --with-gnu-as    arrange to work with GAS.
  35. #       --with-stabs        arrange to use stabs instead of host debug format.
  36. #       --nfp        assume system has no FPU.
  37. #
  38. # If configure succeeds, it leaves its status in config.status.
  39. # If configure fails after disturbing the status quo, 
  40. #     config.status is removed.
  41. #
  42.  
  43. progname=$0
  44.  
  45. # Default --srcdir to the directory where the script is found, 
  46. # if a directory was specified.
  47. # The second sed call is to convert `.//configure' to `./configure'.
  48. srcdir=`echo $0 | sed 's|//|/|' | sed 's|/[^/]*$||'`
  49. if [ x$srcdir = x$0 ]
  50. then
  51. srcdir=
  52. fi
  53.  
  54. host=
  55.  
  56. # Note:  For AmigaDOS we want this to default to /gnu unless we specify
  57. # otherwise to configure.  Changing it in Makefile.in or config/m68k/x-amigados
  58. # is ineffective since configure will always change them back in the final
  59. # generated Makefile, so we have to go to the root of the problem, which is
  60. # here.  -fnf
  61. # Default prefix to /gnu.
  62. prefix=/gnu
  63. # local_prefix specifies where to find the directory /usr/local/include
  64. # We don't use $(prefix) for this
  65. # because we always want GCC to search /usr/local/include
  66. # even if GCC is installed somewhere other than /usr/local.
  67. # Think THREE TIMES before specifying any other value for this!
  68. # DO NOT make this use $prefix!
  69. # Note:  See AmigaDOS note above for this AmigaDOS specific change.  -fnf
  70. local_prefix=/local
  71. # Default is to let the Makefile set exec_prefix from $(prefix)
  72. exec_prefix='$(prefix)'
  73.  
  74. remove=rm
  75. hard_link=cp
  76. symbolic_link=cp
  77. copy=cp
  78.  
  79. # Record all the arguments, to write them in config.status.
  80. arguments=$*
  81.  
  82. #for Test
  83. #remove="echo rm"
  84. #hard_link="echo ln"
  85. #symbolic_link="echo ln -s"
  86.  
  87. target=
  88. host=
  89. build=
  90.  
  91. for arg in $*;
  92. do
  93.   case $next_arg in
  94.   --srcdir)
  95.     srcdir=$arg
  96.     next_arg=
  97.     ;;
  98.   --host)
  99.     host=$arg
  100.     next_arg=
  101.     ;;
  102.   --target)
  103.     target=$arg
  104.     next_arg=
  105.     ;;
  106.   --build)
  107.     build=$arg
  108.     next_arg=
  109.     ;;
  110.   --prefix)
  111.     prefix=$arg
  112.     next_arg=
  113.     ;;
  114.   --local-prefix)
  115.     local_prefix=$arg
  116.     next_arg=
  117.     ;;
  118.   --exec-prefix)
  119.     exec_prefix=$arg
  120.     next_arg=
  121.     ;;
  122.   *)
  123.     case $arg in
  124.      -srcdir | --srcdir | --srcdi | --srcd | --src | --sr | --s)
  125.     next_arg=--srcdir
  126.     ;;
  127.      -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=* | --s=*)
  128.     srcdir=`echo $arg | sed 's/-*s[a-z]*=//'`
  129.     ;;
  130.      -host | --host | --hos | --ho | --h)
  131.     next_arg=--host
  132.     ;;
  133.      -host=* | --host=* | --hos=* | --ho=* | --h=*)
  134.     host=`echo $arg | sed 's/-*h[a-z]*=//'`
  135.     ;; 
  136.      -target | --target | --targe | --targ | --tar | --ta | --t)
  137.     next_arg=--target
  138.     ;;
  139.      -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
  140.     target=`echo $arg | sed 's/-*t[a-z]*=//'`
  141.     ;; 
  142.      -build | --build | --buil | --bui | --bu | --b)
  143.     next_arg=--build
  144.     ;;
  145.      -build=* | --build=* | --buil=* | --bui=* | --bu=* | --b=*)
  146.     build=`echo $arg | sed 's/-*b[a-z]*=//'`
  147.     ;; 
  148.      -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
  149.     next_arg=--prefix
  150.     ;;
  151.      -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
  152.     prefix=`echo $arg | sed 's/-*p[a-z]*=//'`
  153.     ;;
  154.      -local-prefix | --local-prefix | --local-prefi | --local-pref | --local-pre \
  155.     | --local-pr | --local-p | --local- | --local | --loc | --lo | --l)
  156.     next_arg=--local-prefix
  157.     ;;
  158.      -local-prefix=* | --local-prefix=* | --local-prefi=* | --local-pref=* \
  159.     | --local-pre=* | --local-pr=* | --local-p=* | --local-=* | --local=* \
  160.     | --loc=* | --lo=* | --l=*)
  161.     local_prefix=`echo $arg | sed 's/-*l[-a-z]*=//'`
  162.     ;;
  163.      -exec-prefix | --exec-prefix | --exec-prefi | --exec-pref | --exec-pre \
  164.     | --exec-pr | --exec-p | --exec- | --exec | --exe | --ex | --e)
  165.     next_arg=--exec-prefix
  166.     ;;
  167.      -exec-prefix=* | --exec-prefix=* | --exec-prefi=* | --exec-pref=* \
  168.     | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* | --exec=* \
  169.     | --exe=* | --ex=* | --e=*)
  170.     exec_prefix=`echo $arg | sed 's/-*e[-a-z]*=//'`
  171.     ;;
  172.      -with-gnu-ld | --with-gnu-ld | --with-gnu-l)
  173.     gnu_ld=yes
  174.     ;;
  175.      -gas | --gas | --ga | --g | -with-gnu-as | --with-gnu-as | -with-gnu-a)
  176.         gas=yes
  177.     ;;
  178.      -nfp | --nfp | --nf | --n)
  179.     nfp=yes
  180.     ;;
  181.      -with-stabs | -with-stab | -with-sta | -with-st | -with-s \
  182.     | --with-stabs | --with-stab | --with-sta | --with-st | --with-s \
  183.     | -stabs | -stab | -sta | -st  \
  184.     | --stabs | --stab | --sta | --st)
  185.     stabs=yes
  186.     ;;
  187.      -with-* | --with-*) ;; #ignored
  188.      -x | --x) ;; # ignored
  189.      -*)
  190.     echo "Invalid option \`$arg'" 1>&2
  191.     exit 1
  192.     ;;
  193.      *)
  194. # Allow configure HOST TARGET
  195.     if [ x$host = x ]
  196.     then
  197.         host=$target
  198.     fi
  199.     target=$arg
  200.     ;;
  201.     esac
  202.   esac
  203. done
  204.  
  205. # Find the source files, if location was not specified.
  206. if [ x$srcdir = x ]
  207. then
  208.     srcdirdefaulted=1
  209.     srcdir=.
  210.     if [ ! -r tree.c ]
  211.     then
  212.         srcdir=..
  213.     fi
  214. fi
  215. srcdir=../gcc-2.3.3-amiga    #Hack
  216. if [ ! -r ${srcdir}/tree.c ]
  217. then
  218.     if [ x$srcdirdefaulted = x ]
  219.     then
  220.       echo "$progname: Can't find compiler sources in \`${srcdir}'" 1>&2
  221.     else
  222.       echo "$progname: Can't find compiler sources in \`.' or \`..'" 1>&2
  223.     fi
  224.     exit 1
  225. fi
  226.  
  227. if [ -r ${srcdir}/config.status ] && [ x$srcdir != x. ]
  228. then
  229.     echo "$progname: \`configure' has been run in \`${srcdir}'" 1>&2
  230.     exit 1
  231. fi
  232.  
  233. # Complain if an arg is missing
  234. if [ x$target = x ]
  235. then
  236.     echo "No target specified." 1>&2
  237.  
  238.     echo "\
  239. Usage: `basename $progname` [--host=HOST] [--build=BUILD]
  240.        [--prefix=DIR] [--local-pref=DIR] [--exec-pref=DIR]
  241.        [--with-gnu-as] [--with-gnu-ld] [--with-stabs] [--nfp] TARGET" 1>&2
  242.     echo "Where HOST, TARGET and BUILD are three-part configuration names " 1>&2
  243.     if [ -r config.status ]
  244.     then
  245.         tail +2 config.status 1>&2
  246.     fi
  247.     exit 1
  248. fi
  249.  
  250. # Default other arg
  251. if [ x$host = x ]
  252. then
  253.     host=$target
  254. fi
  255. # If $build was not specified, use $host.
  256. if [ x$build = x ]
  257. then
  258.     build=$host
  259. fi
  260.  
  261. build_xm_file=
  262. host_xm_file=
  263. host_xmake_file=
  264. host_broken_install=
  265.  
  266. # Validate the specs, and canonicalize them.
  267. canon_build=`$srcdir/config.sub $build` || exit 1
  268. canon_host=`$srcdir/config.sub $host` || exit 1
  269. canon_target=`$srcdir/config.sub $target` || exit 1
  270.  
  271. # Decode the host machine, then the target machine.
  272. # For the host machine, we save the xm_file variable as host_xm_file;
  273. # then we decode the target machine and forget everything else
  274. # that came from the host machine.
  275. for machine in $canon_build $canon_host $canon_target; do
  276.  
  277.     cpu_type=
  278.     xm_file=
  279.     tm_file=
  280.     out_file=
  281.     xmake_file=
  282.     tmake_file=
  283.     header_files=
  284.     # Set this to force installation and use of collect2.
  285.     use_collect2=
  286.     # Set this to override the default target model.
  287.     target_cpu_default=
  288.     # Set this to force use of install.sh.
  289.     broken_install=
  290.     # Set this to control which fixincludes program to use.
  291.     fixincludes=fixincludes
  292.  
  293.     case $machine in
  294.     # Support site-specific machine types.
  295.     *local*)
  296.         cpu_type=$machine
  297.         xm_file=xm-$machine.h
  298.         tm_file=$machine.h
  299.         if [ -f $srcdir/config/x-$machine ] ; \
  300.         then xmake_file=x-$machine; \
  301.         else true; \
  302.         fi
  303.         if [ -f $srcdir/config/t-$machine ] ; \
  304.         then tmake_file=t-$machine; \
  305.         else true; \
  306.         fi
  307.         ;;
  308.     vax-*-bsd*)            # vaxen running BSD
  309.         tm_file=vax.h
  310.         use_collect2=yes
  311.         ;;
  312.     vax-*-ultrix*)            # vaxen running ultrix
  313.         tm_file=ultrix.h
  314.         use_collect2=yes
  315.         ;;
  316.     vax-*-vms*)            # vaxen running VMS
  317.         xm_file=xm-vax-vms.h
  318.         tm_file=vax-vms.h
  319.         ;;
  320.     vax-*-sysv*)            # vaxen running system V
  321.         xm_file=xm-vaxv.h
  322.         tm_file=vaxv.h
  323.         ;;
  324. # This hasn't been upgraded to GCC 2.
  325. #    tahoe-harris-*)            # Harris tahoe, using COFF.
  326. #        tm_file=harris.h
  327. #        ;;
  328. #    tahoe-*-bsd*)            # tahoe running BSD
  329. #        xm_file=xm-tahoe.h
  330. #        tm_file=tahoe.h
  331. #        ;;
  332.     i[34]86-*-osfrose*)        # 386 using OSF/rose
  333.         tm_file=i386rose.h
  334.         xmake_file=x-i386rose
  335.         tmake_file=t-i386rose
  336.         use_collect2=yes
  337.         ;;
  338.     i[34]86-sequent-bsd*)         # 80386 from Sequent
  339.         xm_file=xm-i386.h
  340.         use_collect2=yes
  341.         if [ x$gas = xyes ]
  342.         then
  343.             tm_file=seq386gas.h
  344.         else
  345.             tm_file=seq386.h
  346.         fi
  347.         ;;
  348.     i[34]86-*-bsd*)
  349.         xm_file=xm-i386.h
  350.         tm_file=i386bsd.h
  351. #        tmake_file=t-libc-ok
  352.         use_collect2=yes
  353.         ;;
  354.     i[34]86-*-mach*)
  355.         xm_file=xm-i386.h
  356.         tm_file=i386mach.h
  357. #        tmake_file=t-libc-ok
  358.         use_collect2=yes
  359.         ;;
  360.     i[34]86-*-sco3.2v4*)         # 80386 running SCO 3.2v4 system
  361.         xm_file=xm-i386sco.h
  362.         tm_file=i386sco4.h
  363.         xmake_file=x-i386s4
  364.         tmake_file=t-i386sco
  365.         fixincludes=fixinc.sco
  366.         broken_install=yes
  367.         ;;
  368.     i[34]86-*-sco*)             # 80386 running SCO system
  369.         xm_file=xm-i386sco.h
  370.         tm_file=i386sco.h
  371.         xmake_file=x-i386sco
  372.         tmake_file=t-i386sco
  373.         broken_install=yes
  374.         ;;
  375.     i[34]86-*-isc*)            # 80386 running ISC system
  376.         xm_file=xm-i386isc.h
  377.         xmake_file=x-i386isc
  378.                 if [ x$gas = xyes ]
  379.         then
  380.             tm_file=i386iscgas.h
  381.             tmake_file=t-i386iscgas
  382.         else
  383.             tm_file=i386isc.h
  384.             tmake_file=t-i386isc
  385.         fi
  386.         broken_install=yes
  387.         ;;
  388.     i[34]86-ibm-aix*)        # IBM PS/2 running AIX
  389.                 if [ x$gas = xyes ]
  390.         then
  391.             tm_file=aix386.h
  392.         else
  393.             tm_file=aix386ng.h
  394.             use_collect2=yes
  395.         fi
  396.         xm_file=xm-aix386.h
  397.         xmake_file=x-aix386
  398.         broken_install=yes
  399.         ;;
  400.     i386-sun-sunos*)        # Sun i386 roadrunner
  401.         xm_file=xm-sun386.h
  402.         tm_file=i386sun.h
  403.         use_collect2=yes
  404.         ;;
  405.     i[34]86-*-linux*)               # Intel 80386's running Linux
  406.         cpu_type=i386
  407.         xm_file=xm-linux.h
  408.         xmake_file=x-linux
  409.         tm_file=i386linux.h
  410.         broken_install=yes
  411.         ;;
  412.     i486-ncr-sysv4*)        # NCR 3000 - i486 running system V.4
  413.         cpu_type=i386
  414.         xm_file=xm-i38v4.h
  415.         xmake_file=x-ncr3000
  416.         tm_file=i386v4.h
  417.         tmake_file=t-svr4
  418.         ;;
  419.     i[34]86-*-sysv4*)        # Intel 80386's running system V.4
  420.         cpu_type=i386
  421.         xm_file=xm-i38v4.h
  422.         tm_file=i386v4.h
  423.         tmake_file=t-svr4
  424.         xmake_file=x-svr4
  425.         ;;
  426.     i[34]86-*-sysv*)        # Intel 80386's running system V
  427.         xm_file=xm-i386v.h
  428.         xmake_file=x-i386v
  429.         tmake_file=t-svr3
  430.         if [ x$gas = xyes ]
  431.         then
  432.             if [ x$stabs = xyes ]
  433.             then
  434.                 tm_file=i386gstabs.h
  435.             else
  436.                 tm_file=i386gas.h
  437.             fi
  438.         else
  439.             tm_file=i386v.h
  440.         fi
  441.         ;;
  442.     i860-*-mach*)
  443.         xm_file=xm-i860.h
  444.         tm_file=i860mach.h
  445.         tmake_file=t-libc-ok
  446.         ;;
  447.     i860-*-sysv3*)
  448.         xm_file=xm-i86v3.h
  449.         xmake_file=x-i860v3
  450.         tm_file=i860v3.h
  451.         tmake_file=t-svr3
  452.         ;;
  453.     i860-*-sysv4*)
  454.         xm_file=xm-i86v4.h
  455.         xmake_file=x-i860v4
  456.         tm_file=i860v4.h
  457.         tmake_file=t-svr4
  458.         ;;
  459.     i860-alliant-*)        # Alliant FX/2800
  460.         xm_file=xm-fx2800.h
  461.         xmake_file=x-fx2800
  462.         tm_file=fx2800.h
  463.         tmake_file=t-fx2800
  464.         ;;
  465.     i860-*-bsd*)
  466.         if [ x$gas = xyes ]
  467.         then
  468.             tm_file=i860bg.h
  469.         else
  470.             tm_file=i860b.h
  471.         fi
  472.         use_collect2=yes
  473.         ;;
  474.     sparc-tti-*)
  475.         tm_file=pbd.h
  476.         xm_file=xm-pbd.h
  477.         use_collect2=yes
  478.         ;;
  479.     elxsi-elxsi-*)
  480.         tm_file=elxsi.h
  481.         xm_file=xm-elxsi.h
  482.         use_collect2=yes
  483.         ;;
  484.     sparc-*-sunos4*)
  485.         tm_file=sparc.h
  486.         use_collect2=yes
  487.         ;;
  488.     sparc-*-sunos3*)
  489.         tm_file=sun4o3.h
  490.         use_collect2=yes
  491.         ;;
  492.     sparc-*-sysv4*)
  493.         xm_file=xm-spcv4.h
  494.         tm_file=sparcv4.h
  495.         tmake_file=t-svr4
  496.         xmake_file=x-sparcv4
  497.         ;;
  498.     sparc-*-solaris2* | sparc-*-sunos5*)
  499.         xm_file=xm-spc-sol2.h
  500.         tm_file=spc-sol2.h
  501.         tmake_file=t-sol2
  502.         xmake_file=x-sparcv4
  503.         fixincludes=fixinc.svr4
  504.         broken_install=yes
  505.         ;;
  506.     m68k-*-amigados)
  507.         xm_file=xm-amigados.h
  508.         out_file=amigados.c
  509.         tm_file=amigados.h
  510.         tmake_file=t-amigados
  511.         xmake_file=x-amigados
  512.         ;;
  513.     m68k-cbm-sysv4*)        # Commodore variant of V.4.
  514.         tm_file=amix.h
  515.         xm_file=xm-amix.h
  516.         xmake_file=x-amix
  517.         tmake_file=t-svr4
  518.         header_files=math-68881.h
  519.         ;;
  520.     m68k-*-sysv4*)            # Motorola m68k's running system V.4
  521.         tm_file=m68kv4.h
  522.         xm_file=xm-m68kv.h
  523.         tmake_file=t-svr4
  524.         header_files=math-68881.h
  525.         ;;
  526.     m68k-bull-sysv*)        # Bull DPX/2
  527.         if [ x$gas = xyes ]
  528.         then
  529.             tm_file=dpx2g.h
  530.         else
  531.             echo dpx2 supported only with GAS 1>&2
  532.             exit 1
  533.             tm_file=dpx2.h
  534.         fi
  535.         xm_file=xm-m68kv.h
  536.         xmake_file=x-dpx2
  537.         use_collect2=yes
  538.         header_files=math-68881.h
  539.         ;;
  540.     m68k-next-*)
  541.         tm_file=next.h
  542.         out_file=next.c
  543.         xm_file=xm-next.h
  544.         tmake_file=t-next
  545.         xmake_file=x-next
  546.         use_collect2=yes
  547.         header_files=math-68881.h
  548.         ;;
  549.     m68k-sun-sunos3*)
  550.         if [ x$nfp = xyes ]
  551.         then
  552.             tm_file=sun3n3.h
  553.         else
  554.             tm_file=sun3o3.h
  555.         fi
  556.         use_collect2=yes
  557.         header_files=math-68881.h
  558.         ;;
  559.     m68k-sun-sunos*)        # For SunOS 4 (the default).
  560.         if [ x$nfp = xyes ]
  561.         then
  562.             tm_file=sun3n.h
  563.         else
  564.             tm_file=sun3.h
  565.         fi
  566.         use_collect2=yes
  567.         header_files=math-68881.h
  568.         ;;
  569.     m68k-sun-mach*)
  570.         tm_file=sun3mach.h
  571.         use_collect2=yes
  572.         header_files=math-68881.h
  573.         ;;
  574.     m68k-tti-*)
  575.         tm_file=pbb.h
  576.         xm_file=xm-m68kv.h
  577.         use_collect2=yes
  578.         header_files=math-68881.h
  579.         ;;
  580.     m68k-hp-hpux*)    # HP 9000 series 300
  581.         xm_file=xm-hp320.h
  582.         if [ x$gas = xyes ]
  583.         then
  584.             xmake_file=x-hp320g
  585.             tmake_file=t-hp320g
  586.             tm_file=hp320g.h
  587.         else
  588.             xmake_file=x-hp320
  589.             tm_file=hp320.h
  590.         fi
  591.         broken_install=yes
  592.         use_collect2=yes
  593.         header_files=math-68881.h
  594.         ;;
  595.     m68k-hp-bsd*)            # HP 9000/3xx running Berkeley Unix
  596.         tm_file=hp3bsd.h
  597.         use_collect2=yes
  598.         header_files=math-68881.h
  599.         ;;
  600.     m68k-isi-bsd*)
  601.         if [ x$nfp = xyes ]
  602.         then
  603.             tm_file=isi-nfp.h
  604.         else
  605.             tm_file=isi.h
  606.         fi
  607.         use_collect2=yes
  608.         header_files=math-68881.h
  609.         ;;
  610.     m68k-sony-newsos3*)
  611.             xm_file=xm-m68k.h
  612.         if [ x$gas = xyes ]
  613.         then
  614.             tm_file=news3gas.h
  615.         else
  616.             tm_file=news3.h
  617.         fi
  618.         use_collect2=yes
  619.         header_files=math-68881.h
  620.         ;;
  621.     m68k-sony-bsd* | m68k-sony-newsos*)
  622.             xm_file=xm-m68k.h
  623.         if [ x$gas = xyes ]
  624.         then
  625.             tm_file=newsgas.h
  626.         else
  627.             tm_file=news.h
  628.         fi
  629.         use_collect2=yes
  630.         header_files=math-68881.h
  631.         ;;
  632.     m68k-altos-sysv*)           # Altos 3068
  633.         if [ x$gas = xyes ]
  634.         then
  635.                 xm_file=xm-altos3068.h
  636.                 tm_file=altos3068.h
  637.         else
  638.             echo "The Altos is supported only with the GNU assembler" 1>&2
  639.             exit 1
  640.         fi
  641.         header_files=math-68881.h
  642.             ;;
  643.     m68k-motorola-sysv*)
  644.         tm_file=mot3300.h
  645.         xm_file=xm-mot3300.h
  646.         use_collect2=yes
  647.         header_files=math-68881.h
  648.         ;;
  649.     m68k-crds-unos*)
  650.         xm_file=xm-crds.h
  651.         xmake_file=x-crds
  652.         tm_file=crds.h
  653.         broken_install=yes
  654.         use_collect2=yes
  655.         header_files=math-68881.h
  656.         ;;
  657.     m68k-apollo-*)
  658.         xmake_file=x-apollo68
  659.         tm_file=apollo68.h
  660.         use_collect2=yes
  661.         header_files=math-68881.h
  662.         ;;
  663.         m68k-plexus-sysv*)
  664.             cpu_type=m68k
  665.         tm_file=plexus.h
  666.         use_collect2=yes
  667.         xm_file=xm-plexus.h
  668.         header_files=math-68881.h
  669.         ;;
  670.     m68k-ncr-sysv*)            # NCR Tower 32 SVR3
  671.         tm_file=tower-as.h
  672.         xm_file=xm-tower.h
  673.         xmake_file=x-tower
  674.         tmake_file=t-svr3
  675.         header_files=math-68881.h
  676.         ;;
  677.     m68k-*-sysv3*)            # Motorola m68k's running system V.3
  678.         tm_file=m68k.h
  679.         xm_file=xm-m68kv.h
  680.         xmake_file=x-m68kv
  681.         tmake_file=t-svr3
  682.         header_files=math-68881.h
  683.         ;;
  684.     m68000-sun-sunos3*)
  685.         cpu_type=m68k
  686.         tm_file=sun2.h
  687.         use_collect2=yes
  688.         header_files=math-68881.h
  689.         ;;
  690.     m68000-sun-sunos4*)
  691.         cpu_type=m68k
  692.         tm_file=sun2o4.h
  693.         use_collect2=yes
  694.         header_files=math-68881.h
  695.         ;;
  696.     m68000-hp-hpux*)        # HP 9000 series 300
  697.         cpu_type=m68k
  698.         xm_file=xm-hp320.h
  699.         if [ x$gas = xyes ]
  700.         then
  701.             xmake_file=x-hp320g
  702.             tm_file=hp310g.h
  703.         else
  704.             xmake_file=x-hp320
  705.             tm_file=hp310.h
  706.         fi
  707.         broken_install=yes
  708.         use_collect2=yes
  709.         header_files=math-68881.h
  710.         ;;
  711.     m68000-hp-bsd*)            # HP 9000/200 running BSD
  712.         cpu_type=m68k
  713.         tm_file=hp2bsd.h
  714.         xmake_file=x-hp2bsd
  715.         use_collect2=yes
  716.         header_files=math-68881.h
  717.         ;;
  718.     m68000-att-sysv*)
  719.         cpu_type=m68k
  720.         xm_file=xm-3b1.h
  721.         if [ x$gas = xyes ]
  722.         then
  723.             tm_file=3b1g.h
  724.         else
  725.             tm_file=3b1.h
  726.         fi
  727.         use_collect2=yes
  728.         header_files=math-68881.h
  729.         ;;
  730.     m68000-convergent-sysv*)
  731.         cpu_type=m68k
  732.         xm_file=xm-3b1.h
  733.         tm_file=ctix.h
  734.         use_collect2=yes
  735.         header_files=math-68881.h
  736.         ;;
  737.     ns32k-encore-osf*)        # Encore with OSF/rose
  738.         tm_file=encrose.h
  739.         xmake_file=x-encrose
  740.         tmake_file=t-encrose
  741.         use_collect2=yes
  742.         ;;
  743.     ns32k-sequent-bsd*)
  744.         tm_file=sequent.h
  745.         use_collect2=yes
  746.         ;;
  747.     ns32k-encore-bsd*)
  748.         tm_file=encore.h
  749.         use_collect2=yes
  750.         ;;
  751. # This has not been updated to GCC 2.
  752. #    ns32k-ns-genix*)
  753. #        xm_file=xm-genix.h
  754. #        xmake_file=x-genix
  755. #        tm_file=genix.h
  756. #        broken_install=yes
  757. #        use_collect2=yes
  758. #        ;;
  759.     ns32k-merlin-*)
  760.         tm_file=merlin.h
  761.         use_collect2=yes
  762.         ;;
  763.     ns32k-tek6100-bsd*)
  764.         tm_file=tek6100.h
  765.         broken_install=yes
  766.         use_collect2=yes
  767.         ;;
  768.     ns32k-tek6200-bsd*)
  769.         tm_file=tek6200.h
  770.         broken_install=yes
  771.         use_collect2=yes
  772.         ;;
  773.     ns32k-pc532-mach*)
  774.         tm_file=pc532-mach.h
  775.         use_collect2=yes
  776.         ;;
  777.     ns32k-pc532-minix*)
  778.         tm_file=pc532-min.h
  779.         xm_file=xm-pc532-min.h
  780.         use_collect2=yes
  781.         ;;
  782.     m88k-*-luna*)
  783.         tm_file=m88kluna.h
  784.         tmake_file=t-m88kluna
  785.         ;;
  786.     m88k-dg-dgux*)
  787.         tm_file=m88kdgux.h
  788.         xmake_file=x-m88kdgux
  789.         broken_install=yes
  790.         ;;
  791.     m88k-*-sysv4*)
  792.         tm_file=m88kv4.h
  793.         xmake_file=x-m88kv4
  794.         tmake_file=t-m88kv4
  795.         ;;
  796.     m88k-dolphin-sysv3*)
  797.         tm_file=m88kdolph.h
  798.         xm_file=xm-m88kv3.h
  799.         xmake_file=x-m88kdolph
  800.         ;;
  801.     m88k-*-sysv3*)
  802.         tm_file=m88kv3.h
  803.         xm_file=xm-m88kv3.h
  804.         ;;
  805. # This hasn't been upgraded to GCC 2.
  806. #    fx80-alliant-*)            # Alliant FX/80
  807. #        tm_file=fx80.h
  808. #        ;;
  809.     arm-*-*)            # Acorn RISC machine
  810.         tm_file=arm.h
  811.         ;;
  812.     c1-convex-*)            # Convex C1
  813.         tm_file=convex1.h
  814.         cpu_type=convex
  815.         use_collect2=yes
  816.         ;;
  817.     c2-convex-*)            # Convex C2
  818.         tm_file=convex2.h
  819.         cpu_type=convex
  820.         use_collect2=yes
  821.         ;;
  822.     c32-convex-*)
  823.         tm_file=convex32.h    # Convex C32xx
  824.         cpu_type=convex
  825.         use_collect2=yes
  826.         ;;
  827.     c34-convex-*)
  828.         tm_file=convex34.h    # Convex C34xx
  829.         cpu_type=convex
  830.         use_collect2=yes
  831.         ;;
  832.     c38-convex-*)
  833.         tm_file=convex38.h    # Convex C38xx
  834.         cpu_type=convex
  835.         use_collect2=yes
  836.         ;;
  837.     mips-sgi-irix4*)        # Mostly like a MIPS.
  838.         if [ x$stabs = xyes ]; then
  839.             tm_file=iris4g.h
  840.         else
  841.             tm_file=iris4.h
  842.         fi
  843.         xm_file=xm-irix4.h
  844.         broken_install=yes
  845.         xmake_file=x-iris
  846.         use_collect2=yes
  847.         ;;
  848.     mips-sgi-*)            # Mostly like a MIPS.
  849.         if [ x$stabs = xyes ]; then
  850.             tm_file=irisgdb.h
  851.         else
  852.             tm_file=iris.h
  853.         fi
  854.         xm_file=xm-iris.h
  855.         broken_install=yes
  856.         xmake_file=x-iris
  857.         use_collect2=yes
  858.         ;;
  859.     mips-dec-ultrix*)        # Decstation.
  860.         if [ x$stabs = xyes ]; then
  861.             tm_file=decstabs.h
  862.         else
  863.             tm_file=decstatn.h
  864.         fi
  865.         tmake_file=t-decstatn
  866.         xmake_file=x-decstatn
  867.         use_collect2=yes
  868.             ;;
  869.     mips-dec-osfrose*)        # Decstation running OSF/1 reference port with OSF/rose.
  870.         tm_file=decrose.h
  871.         xmake_file=x-decrose
  872.         tmake_file=t-decrose
  873.         use_collect2=yes
  874.         ;;
  875.     mips-dec-osf*)            # Decstation running OSF/1 as shipped by DIGITAL
  876.         if [ x$stabs = xyes ]; then
  877.             tm_file=dec-gosf1.h
  878.         else
  879.             tm_file=dec-osf1.h
  880.         fi
  881.         xmake_file=x-dec-osf1
  882.         tmake_file=t-decstatn
  883.         use_collect2=yes
  884.         ;;
  885.     mips-sony-bsd* | mips-sony-newsos*)    # Sony NEWS 3600 or risc/news.
  886.         if [ x$stabs = xyes ]; then
  887.             tm_file=mips-gnews.h
  888.         else
  889.             tm_file=mips-news.h
  890.         fi
  891.         xm_file=xm-mips.h
  892.         use_collect2=yes
  893.         ;;
  894.     mips-sony-sysv*)        # Sony NEWS 3800 with NEWSOS5.0.
  895.                     # That is based on svr4.
  896.         # t-svr4 is not right because this system doesn't use ELF.
  897.         if [ x$stabs = xyes ]; then
  898.             tm_file=mips-gn5.h
  899.         else
  900.             tm_file=mips-n5.h
  901.         fi
  902.         xm_file=xm-mipsnews.h
  903.         use_collect2=yes
  904.         ;;
  905.     mips-*riscos[56789]bsd* | mips-*riscos[56789]-bsd*)
  906.         if [ x$stabs = xyes ]; then    # MIPS BSD 4.3, RISC-OS 5.0
  907.             tm_file=mips-5gbsd.h
  908.         else
  909.             tm_file=mips-5bsd.h
  910.         fi
  911.         use_collect2=yes
  912.             ;;
  913.     mips-*-bsd* | mips-*riscosbsd* | mips-*riscos[1234]bsd* \
  914.         | mips-*riscos-bsd* | mips-*riscos[1234]-bsd*)
  915.         if [ x$stabs = xyes ]; then    # MIPS BSD 4.3, RISC-OS 4.0
  916.             tm_file=mips-gbsd.h
  917.         else
  918.             tm_file=mips-bsd.h
  919.         fi
  920.         use_collect2=yes
  921.             ;;
  922.     mips-*riscos[56789]sysv4* | mips-*riscos[56789]-sysv4*)
  923.         if [ x$stabs = xyes ]; then    # MIPS System V.4., RISC-OS 5.0
  924.             tm_file=mips-5gsvr4.h
  925.         else
  926.             tm_file=mips-5svr4.h
  927.         fi
  928.         xm_file=xm-umips.h
  929.         xmake_file=x-mipsv
  930.         ;;
  931.     mips-*-sysv4* | mips-*riscos[1234]sysv4* | mips-*riscossysv4* \
  932.         | mips-*riscos[1234]-sysv4* | mips-*riscos-sysv4*)
  933.         if [ x$stabs = xyes ]; then    # MIPS System V.4. RISC-OS 4.0
  934.             tm_file=mips-gsvr4.h
  935.         else
  936.             tm_file=mips-svr4.h
  937.         fi
  938.         xm_file=xm-umips.h
  939.         xmake_file=x-mipsv
  940.         ;;
  941.     mips-*riscos[56789]sysv* | mips-*-riscos[56788]-sysv*)
  942.         if [ x$stabs = xyes ]; then    # MIPS System V.3, RISC-OS 5.0
  943.             tm_file=mips-5gsysv.h
  944.         else
  945.             tm_file=mips-5sysv.h
  946.         fi
  947.         xm_file=xm-umips.h
  948.         xmake_file=x-mipsv
  949.         use_collect2=yes
  950.         ;;
  951.     mips-*-sysv* | mips-*riscossysv* | mips-*riscos-sysv*)
  952.         if [ x$stabs = xyes ]; then    # MIPS System V.3, RISC-OS 4.0
  953.             tm_file=mips-gsysv.h
  954.         else
  955.             tm_file=mips-sysv.h
  956.         fi
  957.         xm_file=xm-umips.h
  958.         xmake_file=x-mipsv
  959.         use_collect2=yes
  960.         ;;
  961.     mips-*riscos[56789]*)            # Default MIPS RISC-OS 5.0.
  962.         if [ x$stabs = xyes ]; then
  963.             tm_file=mips-5gdb.h
  964.         else
  965.             tm_file=mips-5.h
  966.         fi
  967.         use_collect2=yes
  968.         ;;
  969.     mips-*-*)                # Default MIPS RISC-OS 4.0.
  970.         if [ x$stabs = xyes ]; then
  971.             tm_file=mips-gdb.h
  972.         else
  973.             tm_file=mips.h
  974.         fi
  975.         use_collect2=yes
  976.         ;;
  977.     pyramid-*-*)
  978.         cpu_type=pyr
  979.         tm_file=pyr.h
  980.         use_collect2=yes
  981.         ;;
  982. # This hasn't been upgraded to GCC 2.
  983. #    tron-*-*)
  984. #        cpu_type=gmicro
  985. #        tm_file=gmicro.h
  986. #        use_collect2=yes
  987. #        ;;
  988.     a29k-*-bsd*)
  989.         tm_file=a29kunix.h
  990.         xm_file=xm-a29kunix.h
  991.         xmake_file=x-a29kunix
  992.         use_collect2=yes
  993.         ;;
  994.     a29k-*-*)            # Default a29k environment.
  995.         use_collect2=yes
  996.         ;;
  997.     romp-*-aos*)
  998.         xm_file=xm-romp.h
  999.         tm_file=romp.h
  1000.         use_collect2=yes
  1001.         ;;
  1002.     romp-*-mach*)
  1003.         xm_file=xm-romp.h
  1004.         tm_file=romp.h
  1005.         xmake_file=x-romp-mach
  1006.         use_collect2=yes
  1007.         ;;
  1008.     rs6000-*-mach*)
  1009.         xm_file=xm-rs6k-m.h
  1010.         tm_file=rs6000-mach.h
  1011.         xmake_file=x-rs6k-mach
  1012.         use_collect2=yes
  1013.         ;;
  1014.     rs6000-ibm-aix32)
  1015.         xm_file=xm-rs6000.h
  1016.         tm_file=rs6000-aix32.h
  1017.         use_collect2=yes
  1018.         ;;
  1019.     rs6000-ibm-aix*)
  1020.         xm_file=xm-rs6000.h
  1021.         tm_file=rs6000.h
  1022.         use_collect2=yes
  1023.         ;;
  1024.     hppa1.1-*-bsd*)
  1025.         cpu_type=pa
  1026.         xm_file=xm-pa.h
  1027.         tm_file=pa1.h
  1028.         xmake_file=x-pa
  1029.         tmake_file=t-pa
  1030.         use_collect2=yes
  1031.         ;;
  1032.     hppa1.0-*-bsd*)
  1033.         cpu_type=pa
  1034.         xm_file=xm-pa.h
  1035.         tm_file=pa.h
  1036.         xmake_file=x-pa
  1037.         tmake_file=t-pa
  1038.         use_collect2=yes
  1039.         ;;
  1040.     hppa1.0-*-hpux7*)
  1041.         cpu_type=pa
  1042.         xm_file=xm-pahpux.h
  1043.         xmake_file=x-pa-hpux
  1044.         tmake_file=t-libc-ok
  1045.         if [ x$gas = xyes ]
  1046.         then
  1047.             tm_file=pa-gux7.h
  1048.         else
  1049.             tm_file=pa-hpux7.h
  1050.         fi
  1051.         broken_install=yes
  1052.         use_collect2=yes
  1053.         ;;
  1054.     hppa1.1-*-hpux*)
  1055.         cpu_type=pa
  1056.         xm_file=xm-pahpux.h
  1057.         xmake_file=x-pa-hpux
  1058.         tmake_file=t-libc-ok
  1059.         if [ x$gas = xyes ]
  1060.         then
  1061.             tm_file=pa1-ghpux.h
  1062.         else
  1063.             tm_file=pa1-hpux.h
  1064.         fi
  1065.         broken_install=yes
  1066.         use_collect2=yes
  1067.         ;;
  1068.     hppa1.0-*-hpux*)
  1069.         cpu_type=pa
  1070.         xm_file=xm-pahpux.h
  1071.         xmake_file=x-pa-hpux
  1072.         tmake_file=t-libc-ok
  1073.         if [ x$gas = xyes ]
  1074.         then
  1075.             tm_file=pa-ghpux.h
  1076.         else
  1077.             tm_file=pa-hpux.h
  1078.         fi
  1079.         broken_install=yes
  1080.         use_collect2=yes
  1081.         ;;
  1082.     we32k-att-sysv*)
  1083.         cpu_type=we32k
  1084.         use_collect2=yes
  1085.         ;;
  1086.     alpha-*-osf*)
  1087.         cpu_type=alpha
  1088.         broken_install=yes
  1089.         use_collect2=yes
  1090.         ;;
  1091.     i960-*-*)            # Default i960 environment.
  1092.         use_collect2=yes
  1093.         ;;
  1094.     *)
  1095.         echo "Configuration $machine not supported" 1>&2
  1096.         exit 1
  1097.         ;;
  1098.     esac
  1099.  
  1100.     case $machine in
  1101.     *-*-sysv4*)
  1102.         fixincludes=fixinc.svr4
  1103.         xmake_try_sysv=x-sysv
  1104.         broken_install=yes
  1105.         ;;
  1106.     *-*-sysv*)
  1107.         broken_install=yes
  1108.         ;;
  1109.     esac
  1110.  
  1111.     # Distinguish i386 from i486.
  1112.     case $machine in
  1113.     i486-*-*)
  1114.         target_cpu_default=2
  1115.         ;;
  1116.     esac
  1117.  
  1118.     # No need for collect2 if we have the GNU linker.
  1119.     case x$gnu_ld in 
  1120.     xyes)
  1121.         use_collect2=
  1122.         ;;
  1123.     esac
  1124.  
  1125. # Default certain vars that apply to both host and target in turn.
  1126.     if [ x$cpu_type = x ]
  1127.     then cpu_type=`echo $machine | sed 's/-.*$//'`
  1128.     fi
  1129.  
  1130. # Save data on machine being used to compile GCC in build_xm_file.
  1131. # Save data on host machine in vars host_xm_file and host_xmake_file.
  1132.     if [ x$pass1done = x ]
  1133.     then
  1134.         if [ x$xm_file = x ]; then build_xm_file=xm-$cpu_type.h
  1135.         else build_xm_file=$xm_file
  1136.         fi
  1137.         pass1done=yes
  1138.     else
  1139.         if [ x$pass2done = x ]
  1140.         then
  1141.             if [ x$xm_file = x ]; then host_xm_file=xm-$cpu_type.h
  1142.             else host_xm_file=$xm_file
  1143.             fi
  1144.             if [ x$xmake_file = x ]
  1145.             then xmake_file=x-$cpu_type
  1146.             fi
  1147.             host_xmake_file=$xmake_file
  1148.             host_broken_install=$broken_install
  1149.             pass2done=yes
  1150.         fi
  1151.     fi
  1152. done
  1153.  
  1154. # Default the target-machine variables that were not explicitly set.
  1155. if [ x$tm_file = x ]
  1156. then tm_file=$cpu_type.h; fi
  1157.  
  1158. if [ x$header_files = x ]
  1159. then header_files=; fi
  1160.  
  1161. if [ x$xm_file = x ]
  1162. then xm_file=xm-$cpu_type.h; fi
  1163.  
  1164. md_file=${cpu_type}.md
  1165.  
  1166. if [ x$out_file = x ]
  1167. then out_file=$cpu_type.c; fi
  1168.  
  1169. if [ x$tmake_file = x ]
  1170. then tmake_file=t-$cpu_type
  1171. fi
  1172.  
  1173.  
  1174. # Set up the list of links to be made.
  1175. # $links is the list of link names, and $files is the list of names to link to.
  1176. files="$host_xm_file $tm_file $md_file $out_file $xm_file $build_xm_file"
  1177. links="config.h tm.h md aux-output.c tconfig.h hconfig.h"
  1178.  
  1179. # Make the links.
  1180. while [ -n "$files" ]
  1181. do
  1182.     # set file to car of files, files to cdr of files
  1183.     set $files; file=$1; shift; files=$*
  1184.     set $links; link=$1; shift; links=$*
  1185.  
  1186.     if [ ! -r ${srcdir}/config/$file ]
  1187.     then
  1188.         echo "$progname: cannot create a link \`$link'," 1>&2
  1189.         echo "since the file \`config/$file' does not exist" 1>&2
  1190.         exit 1
  1191.     fi
  1192.  
  1193.     $remove -f $link
  1194.     rm -f config.status
  1195.     # Make a symlink if possible, otherwise try a hard link
  1196.     $symbolic_link ${srcdir}/config/$file $link 2>/dev/null || $hard_link ${srcdir}/config/$file $link || $copy ${srcdir}/config/$file $link
  1197.  
  1198.     if [ ! -r $link ]
  1199.     then
  1200.         echo "$progname: unable to link \`$link' to \`${srcdir}/config/$file'" 1>&2
  1201.         exit 1
  1202.     fi
  1203.     echo "Linked \`$link' to \`${srcdir}/config/$file'"
  1204. done
  1205.  
  1206. # Create Makefile.tem from Makefile.in.
  1207. # Make it set VPATH if necessary so that the sources are found.
  1208. # Also change its value of srcdir.
  1209. # Also create a .gdbinit file which runs the one in srcdir
  1210. # and tells GDB to look there for source files.
  1211. case $srcdir in
  1212. .)
  1213.     rm -f Makefile.tem
  1214.     cp Makefile.in Makefile.tem
  1215.     chmod +w Makefile.tem
  1216.     ;;
  1217. *)
  1218.     rm -f Makefile.tem
  1219.     echo "VPATH = ${srcdir}" \
  1220.       | cat - ${srcdir}/Makefile.in \
  1221.       | sed "s@^srcdir = \.@srcdir = ${srcdir}@" > Makefile.tem
  1222.     rm -f .gdbinit
  1223.     echo "dir ." > .gdbinit
  1224.     echo "dir ${srcdir}" >> .gdbinit
  1225.     echo "source ${srcdir}/.gdbinit" >> .gdbinit
  1226.     ;;
  1227. esac
  1228.  
  1229. # Conditionalize the makefile for this host machine.
  1230. if [ -f ${srcdir}/config/${host_xmake_file} ]
  1231. then
  1232.     rm -f Makefile.xx
  1233.     sed -e "/####host/  r ${srcdir}/config/${host_xmake_file}" Makefile.tem > Makefile.xx
  1234.     echo "Merged ${host_xmake_file}."
  1235.     rm -f Makefile.tem
  1236.     mv Makefile.xx Makefile.tem
  1237. else
  1238. # Say in the makefile that there is no host_xmake_file,
  1239. # by using a name which (when interpreted relative to $srcdir/config)
  1240. # will duplicate another dependency: $srcdir/Makefile.in.
  1241.     host_xmake_file=../Makefile.in
  1242. fi
  1243.  
  1244. # Add a definition for INSTALL if system wants one.
  1245. # This substitutes for lots of x-* files.
  1246. if [ x$host_broken_install = x ]
  1247. then true
  1248. else
  1249.     rm -f Makefile.xx
  1250.     abssrcdir=`cd ${srcdir}; pwd`
  1251.     sed "s|^INSTALL = .*|INSTALL = ${abssrcdir}/install.sh -c|" Makefile.tem > Makefile.xx
  1252.     rm -f Makefile.tem
  1253.     mv Makefile.xx Makefile.tem
  1254. fi
  1255.  
  1256. # Set EXTRA_HEADERS according to header_files.
  1257. # This substitutes for lots of t-* files.
  1258. if [ x$header_files = x ]
  1259. then true
  1260. else
  1261.     rm -f Makefile.xx
  1262.     sed "s/^EXTRA_HEADERS =/EXTRA_HEADERS = $header_files/" Makefile.tem > Makefile.xx
  1263.     rm -f Makefile.tem
  1264.     mv Makefile.xx Makefile.tem
  1265. fi
  1266.  
  1267. # Add a definition of USE_COLLECT2 if system wants one.
  1268. # Also tell toplev.c what to do.
  1269. # This substitutes for lots of t-* files.
  1270. if [ x$use_collect2 = x ]
  1271. then true
  1272. else
  1273.     rm -f Makefile.xx
  1274.     (echo "USE_COLLECT2 = ld"; echo "MAYBE_USE_COLLECT2 = -DUSE_COLLECT2")\
  1275.         | cat - Makefile.tem > Makefile.xx
  1276.     rm -f Makefile.tem
  1277.     mv Makefile.xx Makefile.tem
  1278. fi
  1279.  
  1280. # Add -DTARGET_CPU_DEFAULT for toplev.c if system wants one.
  1281. # This substitutes for lots of *.h files.
  1282. if [ x$target_cpu_default = x ]
  1283. then true
  1284. else
  1285.     rm -f Makefile.xx
  1286.     (echo "MAYBE_TARGET_DEFAULT = -DTARGET_CPU_DEFAULT=$target_cpu_default")\
  1287.         | cat - Makefile.tem > Makefile.xx
  1288.     rm -f Makefile.tem
  1289.     mv Makefile.xx Makefile.tem
  1290. fi
  1291.  
  1292. # Conditionalize the makefile for this target machine.
  1293. if [ -f ${srcdir}/config/${tmake_file} ]
  1294. then
  1295.     rm -f Makefile.xx
  1296.     sed -e "/####target/  r ${srcdir}/config/${tmake_file}" Makefile.tem > Makefile.xx
  1297.     echo "Merged ${tmake_file}."
  1298.     rm -f Makefile.tem
  1299.     mv Makefile.xx Makefile.tem
  1300. else
  1301. # Say in the makefile that there is no tmake_file,
  1302. # by using a name which (when interpreted relative to $srcdir/config)
  1303. # will duplicate another dependency: $srcdir/Makefile.in.
  1304.     tmake_file=../Makefile.in
  1305. fi
  1306.  
  1307. # Remove all formfeeds, since some Makes get confused by them.
  1308. # Also arrange to give the variables `target', `host_xmake_file',
  1309. # `tmake_file', `prefix', `local_prefix', `exec_prefix', `FIXINCLUDES'
  1310. # values in the Makefile from the values they have in this script.
  1311. rm -f Makefile.xx
  1312. sed -e "s/ //" -e "s/^target=.*$/target=${target}/" \
  1313.     -e "s|^xmake_file=.*$|xmake_file=${host_xmake_file}|" \
  1314.     -e "s|^tmake_file=.*$|tmake_file=${tmake_file}|" \
  1315.     -e "s|^prefix[     ]*=.*|prefix = $prefix|" \
  1316.     -e "s|^local_prefix[     ]*=.*|local_prefix = $local_prefix|" \
  1317.     -e "s|^exec_prefix[     ]*=.*|exec_prefix = $exec_prefix|" \
  1318.     -e "s|^FIXINCLUDES[     ]*=.*|FIXINCLUDES = $fixincludes|" \
  1319.     Makefile.tem > Makefile.xx
  1320. rm -f Makefile.tem
  1321. mv Makefile.xx Makefile.tem
  1322.  
  1323. # Install Makefile for real, after making final changes.
  1324. # Define macro CROSS_COMPILE in compilation if this is a cross-compiler.
  1325. # Also use all.cross instead of all.internal, and add cross-make to Makefile.
  1326. if [ x$host = x$target ]
  1327. then
  1328.     rm -f Makefile
  1329.       if [ x$host = x$build ]
  1330.     then
  1331.         mv Makefile.tem Makefile
  1332.     else
  1333. #        When build gcc with cross-compiler, we need to fix a
  1334. #        few things.
  1335.         echo "build= $build" > Makefile
  1336.         sed -e "/####build/  r ${srcdir}/build-make" Makefile.tem >> Makefile
  1337.         rm -f Makefile.tem Makefile.xx
  1338.     fi
  1339. else
  1340.     rm -f Makefile
  1341.     echo "CROSS=-DCROSS_COMPILE" > Makefile
  1342.     sed -e "/####cross/  r ${srcdir}/cross-make" Makefile.tem >> Makefile
  1343.     rm -f Makefile.tem Makefile.xx
  1344. fi
  1345.  
  1346. echo "Created \`Makefile'."
  1347.  
  1348. if [ xx${vint} != xx ]
  1349. then
  1350.     vintmsg=" (vint)"
  1351. fi
  1352.  
  1353. # Describe the chosen configuration in config.status.
  1354. # Make that file a shellscript which will reestablish the same configuration.
  1355. echo "#!/bin/sh
  1356. # GCC was configured as follows:
  1357. ${srcdir}/configure" $arguments > config.status
  1358. echo echo host=$canon_host target=$canon_target build=$canon_build >> config.status
  1359. chmod a+x config.status
  1360.  
  1361. if [ x$canon_host = x$canon_target ]
  1362. then
  1363.     echo "Links are now set up for target $canon_target."
  1364. else
  1365.     echo "Links are now set up for host $canon_host and target $canon_target."
  1366. fi
  1367.  
  1368. exit 0
  1369.