home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 7 / FreshFishVol7.bin / bbs / gnu / gcc-2.3.3-src.lha / GNU / src / amiga / gcc-2.3.3 / configure < prev    next >
Text File  |  1994-02-06  |  31KB  |  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.