* configure.ac: For --enable-gold, handle value `default' instead of
[binutils.git] / configure.ac
blob626bb4e10f1c23796e1d3b4bff4af92237f62432
1 #   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
2 #   2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
3 #   Free Software Foundation, Inc.
5 # This file is free software; you can redistribute it and/or modify it
6 # under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 3 of the License, or
8 # (at your option) any later version.
10 # This program is distributed in the hope that it will be useful, but
11 # WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13 # General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program; see the file COPYING3.  If not see
17 # <http://www.gnu.org/licenses/>.
19 ##############################################################################
20 ### WARNING: this file contains embedded tabs.  Do not run untabify on this file.
22 m4_include(config/acx.m4)
23 m4_include(config/override.m4)
24 m4_include(config/proginstall.m4)
25 m4_include(config/elf.m4)
26 m4_include([libtool.m4])
27 m4_include([ltoptions.m4])
28 m4_include([ltsugar.m4])
29 m4_include([ltversion.m4])
30 m4_include([lt~obsolete.m4])
31 m4_include([config/cloog.m4])
33 AC_INIT(move-if-change)
34 AC_PREREQ(2.64)
35 AC_DISABLE_OPTION_CHECKING
37 progname=$0
38 # if PWD already has a value, it is probably wrong.
39 if test -n "$PWD" ; then PWD=`${PWDCMD-pwd}`; fi
41 # Export original configure arguments for use by sub-configures.
42 # Quote arguments with shell meta charatcers.
43 TOPLEVEL_CONFIGURE_ARGUMENTS=
44 set -- "$progname" "$@"
45 for ac_arg
47   case "$ac_arg" in
48   *" "*|*"      "*|*[[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\']]*)
49     ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"`
50     # if the argument is of the form -foo=baz, quote the baz part only
51     ac_arg=`echo "'$ac_arg'" | sed "s/^'\([[-a-zA-Z0-9]]*=\)/\\1'/"` ;;
52   *) ;;
53   esac
54   # Add the quoted argument to the list.
55   TOPLEVEL_CONFIGURE_ARGUMENTS="$TOPLEVEL_CONFIGURE_ARGUMENTS $ac_arg"
56 done
57 if test "$silent" = yes; then
58   TOPLEVEL_CONFIGURE_ARGUMENTS="$TOPLEVEL_CONFIGURE_ARGUMENTS --silent"
60 # Remove the initial space we just introduced and, as these will be
61 # expanded by make, quote '$'.
62 TOPLEVEL_CONFIGURE_ARGUMENTS=`echo "x$TOPLEVEL_CONFIGURE_ARGUMENTS" | sed -e 's/^x *//' -e 's,\\$,$$,g'`
63 AC_SUBST(TOPLEVEL_CONFIGURE_ARGUMENTS)
65 # Find the build, host, and target systems.
66 ACX_NONCANONICAL_BUILD
67 ACX_NONCANONICAL_HOST
68 ACX_NONCANONICAL_TARGET
70 dnl Autoconf 2.5x and later will set a default program prefix if
71 dnl --target was used, even if it was the same as --host.  Disable
72 dnl that behavior.  This must be done before AC_CANONICAL_SYSTEM
73 dnl to take effect.
74 test "$host_noncanonical" = "$target_noncanonical" &&
75   test "$program_prefix$program_suffix$program_transform_name" = \
76     NONENONEs,x,x, &&
77   program_transform_name=s,y,y,
79 AC_CANONICAL_SYSTEM
80 AC_ARG_PROGRAM
82 m4_pattern_allow([^AS_FOR_TARGET$])dnl
83 m4_pattern_allow([^AS_FOR_BUILD$])dnl
85 # Get 'install' or 'install-sh' and its variants.
86 AC_PROG_INSTALL
87 ACX_PROG_LN
88 AC_PROG_LN_S
89 AC_PROG_SED
90 AC_PROG_AWK
92 ### we might need to use some other shell than /bin/sh for running subshells
93 ### If we are on Windows, search for the shell.  This will permit people
94 ### to not have /bin/sh, but to be able to see /SOME/PATH/sh configure
95 ### without also having to set CONFIG_SHELL.  This code will work when
96 ### using bash, which sets OSTYPE.
97 case "${OSTYPE}" in
98 *win32*)
99   if test x${CONFIG_SHELL} = x ; then
100     if test ! -f /bin/sh ; then
101       if test x${SHELL} != x && test -f ${SHELL} ; then
102         CONFIG_SHELL=${SHELL}
103         export CONFIG_SHELL
104       else
105         for prog in sh sh.exe bash bash.exe; do
106           IFS="${IFS=   }"; save_ifs="$IFS"; IFS="${IFS}:"
107           for dir in $PATH; do
108             test -z "$dir" && dir=.
109             if test -f $dir/$prog; then
110               CONFIG_SHELL=$dir/$prog
111               export CONFIG_SHELL
112               break
113             fi
114           done
115           IFS="$save_ifs"
116           test -n "${CONFIG_SHELL}" && break
117         done
118       fi
119     fi
120   fi
121   ;;
122 esac
124 config_shell=${CONFIG_SHELL-/bin/sh}
126 moveifchange=${srcdir}/move-if-change
128 srcpwd=`cd ${srcdir} ; ${PWDCMD-pwd}`
130 # We pass INSTALL explicitly to sub-makes.  Make sure that it is not
131 # a relative path.
132 if test "$INSTALL" = "${srcdir}/install-sh -c"; then
133   INSTALL="${srcpwd}/install-sh -c"
136 # Set srcdir to "." if that's what it is.
137 # This is important for multilib support.
138 pwd=`${PWDCMD-pwd}`
139 if test "${pwd}" = "${srcpwd}" ; then
140   srcdir=.
143 topsrcdir=$srcpwd
145 extra_host_args=
147 ### To add a new directory to the tree, first choose whether it is a target
148 ### or a host dependent tool.  Then put it into the appropriate list
149 ### (library or tools, host or target), doing a dependency sort.
151 # Subdirs will be configured in the order listed in build_configdirs, 
152 # configdirs, or target_configdirs; see the serialization section below.
154 # Dependency sorting is only needed when *configuration* must be done in 
155 # a particular order.  In all cases a dependency should be specified in 
156 # the Makefile, whether or not it's implicitly specified here.
158 # Double entries in build_configdirs, configdirs, or target_configdirs may
159 # cause circular dependencies and break everything horribly.
161 # these library is used by various programs built for the build
162 # environment
164 build_libs="build-libiberty"
166 # these tools are built for the build environment
167 build_tools="build-texinfo build-byacc build-flex build-bison build-m4 build-fixincludes"
169 # these libraries are used by various programs built for the host environment
171 host_libs="intl mmalloc libiberty opcodes bfd readline tcl tk itcl libgui zlib libcpp libdecnumber gmp mpfr mpc ppl cloog libelf libiconv"
173 # these tools are built for the host environment
174 # Note, the powerpc-eabi build depends on sim occurring before gdb in order to
175 # know that we are building the simulator.
176 # binutils, gas and ld appear in that order because it makes sense to run
177 # "make check" in that particular order.
178 # If --enable-gold is used, "gold" may replace "ld".
179 host_tools="texinfo byacc flex bison binutils gas ld fixincludes gcc cgen sid sim gdb make patch prms send-pr gprof etc expect dejagnu ash bash bzip2 m4 autoconf automake libtool diff rcs fileutils shellutils time textutils wdiff find uudecode hello tar gzip indent recode release sed utils guile perl gawk findutils gettext zip fastjar gnattools"
181 # libgcj represents the runtime libraries only used by gcj.
182 libgcj="target-libffi \
183         target-zlib \
184         target-qthreads \
185         target-libjava"
187 # these libraries are built for the target environment, and are built after
188 # the host libraries and the host tools (which may be a cross compiler)
190 target_libraries="target-libgcc \
191                 target-libiberty \
192                 target-libgloss \
193                 target-newlib \
194                 target-libgomp \
195                 target-libstdc++-v3 \
196                 target-libmudflap \
197                 target-libssp \
198                 target-libquadmath \
199                 target-libgfortran \
200                 target-boehm-gc \
201                 ${libgcj} \
202                 target-libobjc \
203                 target-libada \
204                 target-libgo"
206 # these tools are built using the target libraries, and are intended to
207 # run only in the target environment
209 # note: any program that *uses* libraries that are in the "target_libraries"
210 # list belongs in this list.  those programs are also very likely
211 # candidates for the "native_only" list which follows
213 target_tools="target-examples target-groff target-gperf target-rda"
215 ################################################################################
217 ## All tools belong in one of the four categories, and are assigned above
218 ## We assign ${configdirs} this way to remove all embedded newlines.  This
219 ## is important because configure will choke if they ever get through.
220 ## ${configdirs} is directories we build using the host tools.
221 ## ${target_configdirs} is directories we build using the target tools.
222 configdirs=`echo ${host_libs} ${host_tools}`
223 target_configdirs=`echo ${target_libraries} ${target_tools}`
224 build_configdirs=`echo ${build_libs} ${build_tools}`
226 m4_divert_text([PARSE_ARGS],
227 [case $srcdir in
228   *" "*)
229 m4_pushdef([AS_MESSAGE_LOG_FD], [])dnl
230     AC_MSG_ERROR([path to source, $srcdir, contains spaces])
231 m4_popdef([AS_MESSAGE_LOG_FD])dnl
232     ;;
233 esac
234 ac_subdirs_all=`cd $srcdir && echo */configure | sed 's,/configure,,g'`
237 ################################################################################
239 srcname="gnu development package"
241 # This gets set non-empty for some net releases of packages.
242 appdirs=""
244 # Define is_cross_compiler to save on calls to 'test'.
245 is_cross_compiler=
246 if test x"${host}" = x"${target}" ; then
247   is_cross_compiler=no
248 else
249   is_cross_compiler=yes
250 fi      
252 # Find the build and target subdir names.
253 GCC_TOPLEV_SUBDIRS
254 # Be sure to cover against remnants of an in-tree build.
255 if test $srcdir != .  && test -d $srcdir/host-${host_noncanonical}; then
256   AC_MSG_ERROR([building out of tree but $srcdir contains host-${host_noncanonical}.
257 Use a pristine source tree when building in a separate tree])
260 # Skipdirs are removed silently.
261 skipdirs=
262 # Noconfigdirs are removed loudly.
263 noconfigdirs=""
265 use_gnu_ld=
266 # Make sure we don't let GNU ld be added if we didn't want it.
267 if test x$with_gnu_ld = xno ; then
268   use_gnu_ld=no
269   noconfigdirs="$noconfigdirs ld gold"
272 use_gnu_as=
273 # Make sure we don't let GNU as be added if we didn't want it.
274 if test x$with_gnu_as = xno ; then
275   use_gnu_as=no
276   noconfigdirs="$noconfigdirs gas"
279 use_included_zlib=
280 # Make sure we don't let ZLIB be added if we didn't want it.
281 if test x$with_system_zlib = xyes ; then
282   use_included_zlib=no
283   noconfigdirs="$noconfigdirs zlib"
286 # some tools are so dependent upon X11 that if we're not building with X, 
287 # it's not even worth trying to configure, much less build, that tool.
289 case ${with_x} in
290   yes | "") ;; # the default value for this tree is that X11 is available
291   no)
292     skipdirs="${skipdirs} tk itcl libgui"
293     # We won't be able to build gdbtk without X.
294     enable_gdbtk=no 
295     ;;
296   *)  echo "*** bad value \"${with_x}\" for -with-x flag; ignored" 1>&2 ;;
297 esac
299 # Some tools are only suitable for building in a "native" situation.
300 # Remove these if host!=target.  
301 native_only="autoconf automake libtool fileutils find gawk gettext gzip hello indent m4 rcs recode sed shellutils tar textutils uudecode wdiff target-groff guile perl time ash bash bzip2 prms gnuserv target-gperf"
303 # Similarly, some are only suitable for cross toolchains.
304 # Remove these if host=target.
305 cross_only="target-libgloss target-newlib target-opcodes"
307 case $is_cross_compiler in
308   no) skipdirs="${skipdirs} ${cross_only}" ;;
309   yes) skipdirs="${skipdirs} ${native_only}" ;;
310 esac
312 # If both --with-headers and --with-libs are specified, default to
313 # --without-newlib.
314 if test x"${with_headers}" != x && test x"${with_headers}" != xno \
315    && test x"${with_libs}" != x && test x"${with_libs}" != xno ; then
316   if test x"${with_newlib}" = x ; then
317     with_newlib=no
318   fi
321 # Recognize --with-newlib/--without-newlib.
322 case ${with_newlib} in
323   no) skipdirs="${skipdirs} target-newlib" ;;
324   yes) skipdirs=`echo " ${skipdirs} " | sed -e 's/ target-newlib / /'` ;;
325 esac
327 # Handle --enable-gold, --enable-ld.
328 # --disable-gold [--enable-ld]
329 #     Build only ld.  Default option.
330 # --enable-gold[=default] [--enable-ld]
331 #     Build both gold and ld.  Install gold as "ld.gold" and "ld",
332 #     install ld as "ld.bfd".
333 # --enable-gold[=default] --disable-ld
334 #     Build only gold, which is then installed as both "ld.gold" and "ld".
335 # --enable-gold --enable-ld=default
336 #     Build both gold (installed as "gold") and ld (installed as "ld").
337 #     In other words, ld is default
338 # --enable-gold=default --enable-ld=default
339 #     Error.
341 default_ld=
342 AC_ARG_ENABLE(gold,
343 [[  --enable-gold[=ARG]     build gold [ARG={default,yes,no}]]],
344 ENABLE_GOLD=$enableval,
345 ENABLE_GOLD=no)
346 case "${ENABLE_GOLD}" in
347   yes|default)
348     # Check for ELF target.
349     is_elf=no
350     case "${target}" in
351       *-*-elf* | *-*-sysv4* | *-*-unixware* | *-*-eabi* | hppa*64*-*-hpux* \
352       | *-*-linux* | frv-*-uclinux* | *-*-irix5* | *-*-irix6* \
353       | *-*-netbsd* | *-*-openbsd* | *-*-freebsd* | *-*-solaris2* | *-*-nto*)
354         case "${target}" in
355           *-*-linux*aout* | *-*-linux*oldld*)
356             ;;
357           *)
358             is_elf=yes
359             ;;
360         esac
361     esac
363     if test "$is_elf" = "yes"; then
364       # Check for target supported by gold.
365       case "${target}" in
366         i?86-*-* | x86_64-*-* | sparc*-*-* | powerpc*-*-* | arm*-*-*)
367           configdirs="$configdirs gold"
368           if test x${ENABLE_GOLD} = xdefault; then
369             default_ld=gold
370           fi
371           ENABLE_GOLD=yes
372           ;;
373       esac
374     fi
375     ;;
376   no)
377     ;;
378   *)
379     AC_MSG_ERROR([invalid --enable-gold argument])
380     ;;
381 esac
383 AC_ARG_ENABLE(ld,
384 [[  --enable-ld[=ARG]     build ld [ARG={default,yes,no}]]],
385 ENABLE_LD=$enableval,
386 ENABLE_LD=yes)
388 case "${ENABLE_LD}" in
389   default)
390     if test x${default_ld} != xgold; then
391       AC_MSG_ERROR([either gold or ld can be the default ld])
392     fi
393     ;;
394   yes)
395     ;;
396   no)
397     if test x${ENABLE_GOLD} != xyes; then
398       AC_MSG_WARN([neither ld nor gold are enabled])
399     fi
400     configdirs=`echo " ${configdirs} " | sed -e 's/ ld / /'`
401     ;;
402   *)
403     AC_MSG_ERROR([invalid --enable-ld argument])
404     ;;
405 esac
407 # Configure extra directories which are host specific
409 case "${host}" in
410   *-cygwin*)
411     configdirs="$configdirs libtermcap" ;;
412 esac
414 # A target can indicate whether a language isn't supported for some reason.
415 # Only spaces may be used in this macro; not newlines or tabs.
416 unsupported_languages=
418 # Remove more programs from consideration, based on the host or 
419 # target this usually means that a port of the program doesn't
420 # exist yet.
422 case "${host}" in
423   hppa*64*-*-*)
424     noconfigdirs="$noconfigdirs byacc"
425     ;;
426   i[[3456789]]86-*-vsta)
427     noconfigdirs="$noconfigdirs tcl expect dejagnu make texinfo bison patch flex byacc send-pr gprof uudecode dejagnu diff guile perl itcl gnuserv gettext"
428     ;;
429   i[[3456789]]86-*-go32* | i[[3456789]]86-*-msdosdjgpp*)
430     noconfigdirs="$noconfigdirs tcl tk expect dejagnu send-pr uudecode guile itcl gnuserv libffi"
431     ;;
432   x86_64-*-mingw*)
433     noconfigdirs="$noconfigdirs expect dejagnu autoconf automake send-pr rcs guile perl texinfo libtool newlib"
434     ;;
435   i[[3456789]]86-*-mingw32*)
436     # noconfigdirs="tcl tk expect dejagnu make texinfo bison patch flex byacc send-pr uudecode dejagnu diff guile perl itcl gnuserv"
437     noconfigdirs="$noconfigdirs expect dejagnu autoconf automake send-pr rcs guile perl texinfo libtool newlib"
438     ;;
439   i[[3456789]]86-*-beos*)
440     noconfigdirs="$noconfigdirs tk itcl libgui gdb"
441     ;;
442   *-*-cygwin*)
443     noconfigdirs="$noconfigdirs autoconf automake send-pr rcs guile perl"
444     ;;
445   *-*-netbsd*)
446     noconfigdirs="$noconfigdirs rcs"
447     ;;
448   ppc*-*-pe)
449     noconfigdirs="$noconfigdirs patch diff make tk tcl expect dejagnu autoconf automake texinfo bison send-pr gprof rcs guile perl itcl gnuserv"
450     ;;
451   powerpc-*-beos*)
452     noconfigdirs="$noconfigdirs tk itcl libgui gdb dejagnu readline"
453     ;;
454 esac
457 AC_ARG_ENABLE(libada,
458 [  --enable-libada         build libada directory],
459 ENABLE_LIBADA=$enableval,
460 ENABLE_LIBADA=yes)
461 if test "${ENABLE_LIBADA}" != "yes" ; then
462   noconfigdirs="$noconfigdirs gnattools"
465 AC_ARG_ENABLE(libssp,
466 [  --enable-libssp         build libssp directory],
467 ENABLE_LIBSSP=$enableval,
468 ENABLE_LIBSSP=yes)
470 # Save it here so that, even in case of --enable-libgcj, if the Java
471 # front-end isn't enabled, we still get libgcj disabled.
472 libgcj_saved=$libgcj
473 case $enable_libgcj in
474 yes)
475   # If we reset it here, it won't get added to noconfigdirs in the
476   # target-specific build rules, so it will be forcibly enabled
477   # (unless the Java language itself isn't enabled).
478   libgcj=
479   ;;
481   # Make sure we get it printed in the list of not supported target libs.
482   # Don't disable libffi, though, other languages use it.
483   noconfigdirs="$noconfigdirs `echo ${libgcj} | sed -e 's/target-libffi//'`"
484   ;;
485 esac
488 # Disable libmudflap on some systems.
489 if test x$enable_libmudflap = x ; then
490     case "${target}" in
491     *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu | bfin*-*-uclinux* | *-*-kopensolaris*-gnu)
492         # Enable libmudflap by default in GNU and friends.
493         ;;
494     *-*-freebsd*)
495         # Enable libmudflap by default in FreeBSD.
496         ;;
497     *)
498         # Disable it by default everywhere else.
499         noconfigdirs="$noconfigdirs target-libmudflap"
500         ;;
501     esac
504 # Disable libgomp on non POSIX hosted systems.
505 if test x$enable_libgomp = x ; then
506     # Enable libgomp by default on hosted POSIX systems.
507     case "${target}" in
508     *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu | *-*-kopensolaris*-gnu)
509         ;;
510     *-*-netbsd* | *-*-freebsd* | *-*-openbsd*)
511         ;;
512     *-*-solaris2* | *-*-sysv4* | *-*-irix6* | *-*-osf* | *-*-hpux11*)
513         ;;
514     *-*-darwin* | *-*-aix*)
515         ;;
516     *)
517         noconfigdirs="$noconfigdirs target-libgomp"
518         ;;
519     esac
522 # Default libgloss CPU subdirectory.
523 libgloss_dir="$target_cpu"
525 case "${target}" in
526   *-*-chorusos)
527     noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}"
528     ;;
529   powerpc-*-darwin*)
530     noconfigdirs="$noconfigdirs ld gas gdb gprof"
531     noconfigdirs="$noconfigdirs sim target-rda"
532     ;;
533   i[[3456789]]86-*-darwin*)
534     noconfigdirs="$noconfigdirs ld gprof"
535     noconfigdirs="$noconfigdirs sim target-rda"
536     ;;
537   x86_64-*-darwin[[912]]*)
538     noconfigdirs="$noconfigdirs ld gas gprof"
539     noconfigdirs="$noconfigdirs sim target-rda"
540     ;;
541   *-*-darwin*)
542     noconfigdirs="$noconfigdirs ld gas gdb gprof"
543     noconfigdirs="$noconfigdirs sim target-rda"
544     noconfigdirs="$noconfigdirs ${libgcj}"
545     ;;
546   *-*-freebsd[[12]] | *-*-freebsd[[12]].* | *-*-freebsd*aout*)
547     noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}"
548     ;;
549   *-*-freebsd*)
550     noconfigdirs="$noconfigdirs target-newlib target-libgloss"
551     if test "x$with_gmp" = x && test "x$with_gmp_dir" = x \
552         && test -f /usr/local/include/gmp.h; then
553       with_gmp=/usr/local
554     fi
556     # Skip some stuff that's unsupported on some FreeBSD configurations.
557     case "${target}" in
558       i*86-*-*) ;;
559       alpha*-*-*) ;;
560       x86_64-*-*) ;;
561       *)
562         noconfigdirs="$noconfigdirs ${libgcj}"
563         ;;
564     esac
565     ;;
566   *-*-kaos*)
567     # Remove unsupported stuff on all kaOS configurations.
568     skipdirs="target-libiberty ${libgcj} target-libstdc++-v3 target-librx"
569     skipdirs="$skipdirs target-libobjc target-examples target-groff target-gperf"
570     skipdirs="$skipdirs zlib fastjar target-libjava target-boehm-gc target-zlib"
571     noconfigdirs="$noconfigdirs target-libgloss"
572     ;;
573   *-*-netbsd*)
574     # Skip some stuff on all NetBSD configurations.
575     noconfigdirs="$noconfigdirs target-newlib target-libiberty target-libgloss"
577     # Skip some stuff that's unsupported on some NetBSD configurations.
578     case "${target}" in
579       i*86-*-netbsdelf*) ;;
580       arm*-*-netbsdelf*) ;;
581       *)
582         noconfigdirs="$noconfigdirs ${libgcj}"
583         ;;
584     esac
585     ;;
586   *-*-netware*)
587     noconfigdirs="$noconfigdirs target-newlib target-libiberty target-libgloss ${libgcj} target-libmudflap"
588     ;;
589   *-*-rtems*)
590     skipdirs="${skipdirs} target-libiberty"
591     noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
592     ;;
593     # The tpf target doesn't support gdb yet.
594   *-*-tpf*)
595     noconfigdirs="$noconfigdirs target-newlib target-libgloss target-libiberty ${libgcj} target-libmudflap gdb tcl tk libgui itcl"
596     ;;
597   *-*-uclinux*)
598     noconfigdirs="$noconfigdirs target-newlib target-libgloss target-rda ${libgcj}"
599     ;;
600   *-*-vxworks*)
601     noconfigdirs="$noconfigdirs target-newlib target-libgloss target-libiberty target-libstdc++-v3 ${libgcj}"
602     ;;
603   alpha*-dec-osf*)
604     # ld works, but does not support shared libraries.
605     # newlib is not 64 bit ready.  I'm not sure about fileutils.
606     # gas doesn't generate exception information.
607     noconfigdirs="$noconfigdirs gas ld fileutils target-newlib target-libgloss"
608     ;;
609   alpha*-*-*vms*)
610     noconfigdirs="$noconfigdirs gdb target-newlib target-libgloss ${libgcj}"
611     ;;
612   alpha*-*-linux*)
613     # newlib is not 64 bit ready
614     noconfigdirs="$noconfigdirs target-newlib target-libgloss"
615     ;;
616   alpha*-*-*)
617     # newlib is not 64 bit ready
618     noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}"
619     ;;
620   am33_2.0-*-linux*)
621     noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss"
622     ;;
623   sh-*-linux*)
624     noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss"
625     ;;    
626   sh*-*-pe|mips*-*-pe|*arm-wince-pe)
627     noconfigdirs="$noconfigdirs ${libgcj}"
628     noconfigdirs="$noconfigdirs target-examples"
629     noconfigdirs="$noconfigdirs target-libiberty texinfo send-pr"
630     noconfigdirs="$noconfigdirs tcl tk itcl libgui sim"
631     noconfigdirs="$noconfigdirs expect dejagnu"
632     # the C++ libraries don't build on top of CE's C libraries
633     noconfigdirs="$noconfigdirs target-libstdc++-v3"
634     noconfigdirs="$noconfigdirs target-newlib"
635     case "${host}" in
636       *-*-cygwin*) ;; # keep gdb and readline
637       *) noconfigdirs="$noconfigdirs gdb readline"
638          ;;
639     esac
640     libgloss_dir=wince
641     ;;
642   arc-*-*)
643     noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
644     ;;
645   arm-semi-aof )
646     ;;
647   arm-*-coff | strongarm-*-coff | xscale-*-coff)
648     noconfigdirs="$noconfigdirs ${libgcj}"
649     libgloss_dir=arm
650     ;;
651   arm-*-elf* | strongarm-*-elf* | xscale-*-elf* | arm*-*-eabi* )
652     noconfigdirs="$noconfigdirs target-libffi target-qthreads"
653     libgloss_dir=arm
654     ;;
655   arm*-*-linux-gnueabi)
656     noconfigdirs="$noconfigdirs target-qthreads"
657     case ${with_newlib} in
658       no) noconfigdirs="$noconfigdirs target-newlib target-libgloss"
659     esac
660     libgloss_dir=arm
661     ;;
662   arm*-*-symbianelf*)
663     noconfigdirs="$noconfigdirs ${libgcj} target-libiberty"
664     libgloss_dir=arm
665     ;;
666   arm-*-pe*)
667     noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
668     ;;
669   thumb-*-coff)
670     noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
671     ;;
672   thumb-*-elf)
673     noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
674     ;;
675   thumb-*-pe)
676     noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
677     ;;
678   arm-*-riscix*)
679     noconfigdirs="$noconfigdirs ld target-libgloss ${libgcj}"
680     ;;
681   avr-*-*)
682     noconfigdirs="$noconfigdirs target-libiberty target-libstdc++-v3 ${libgcj} target-libssp"
683     ;;
684   bfin-*-*)
685     unsupported_languages="$unsupported_languages java"
686     noconfigdirs="$noconfigdirs target-boehm-gc gdb"
687     if test x${is_cross_compiler} != xno ; then
688       target_configdirs="${target_configdirs} target-bsp target-cygmon"
689     fi
690     ;;
691   c4x-*-* | tic4x-*-*)
692     noconfigdirs="$noconfigdirs target-libstdc++-v3 target-libgloss ${libgcj}"
693     ;;
694   c54x*-*-* | tic54x-*-*)
695     noconfigdirs="$noconfigdirs target-libstdc++-v3 target-libgloss ${libgcj} gcc gdb newlib"
696     ;;
697   cr16-*-*)
698     noconfigdirs="$noconfigdirs ${libgcj} gdb"
699     ;;
700   cris-*-* | crisv32-*-*)
701     unsupported_languages="$unsupported_languages java"
702     case "${target}" in
703       *-*-aout)
704         unsupported_languages="$unsupported_languages fortran"
705         noconfigdirs="$noconfigdirs target-libffi target-boehm-gc";;
706       *-*-elf)
707         noconfigdirs="$noconfigdirs target-boehm-gc";;
708       *-*-linux*)
709         noconfigdirs="$noconfigdirs target-newlib target-libgloss";;
710       *)
711         unsupported_languages="$unsupported_languages fortran"
712         noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss";;
713     esac
714     libgloss_dir=cris
715     ;;
716   crx-*-*)
717     noconfigdirs="$noconfigdirs target-libstdc++-v3 target-mudflap ${libgcj}"
718     ;;
719   d10v-*-*)
720     noconfigdirs="$noconfigdirs target-libstdc++-v3 target-libgloss ${libgcj}"
721     ;;
722   d30v-*-*)
723     noconfigdirs="$noconfigdirs ${libgcj} gdb"
724     ;;
725   ep9312-*-elf | ep9312-*-coff)
726     libgloss_dir=arm
727     ;;
728   fr30-*-elf*)
729     noconfigdirs="$noconfigdirs ${libgcj} gdb"
730     ;;
731   frv-*-*)
732     noconfigdirs="$noconfigdirs ${libgcj}"
733     ;;
734   moxie-*-*)
735     noconfigdirs="$noconfigdirs ${libgcj}"
736     noconfigdirs="$noconfigdirs gprof"
737     ;;
738   h8300*-*-*)
739     noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
740     ;;
741   h8500-*-*)
742     noconfigdirs="$noconfigdirs target-libstdc++-v3 target-libgloss ${libgcj}"
743     ;;
744   hppa1.1-*-osf* | hppa1.1-*-bsd* )
745     ;;
746   hppa*64*-*-linux* | parisc*64*-*-linux*)
747     # In this case, it's because the hppa64-linux target is for
748     # the kernel only at this point and has no libc, and thus no
749     # headers, crt*.o, etc., all of which are needed by these.
750     noconfigdirs="$noconfigdirs target-zlib"
751     ;;
752   parisc*-*-linux* | hppa*-*-linux*)
753     ;;
754   hppa*-*-*elf* | \
755   hppa*-*-lites* | \
756   hppa*-*-openbsd* | \
757   hppa*64*-*-*)
758     noconfigdirs="$noconfigdirs ${libgcj}"
759     ;;
760   hppa*-hp-hpux11*)
761     noconfigdirs="$noconfigdirs ld shellutils"
762     ;;
763   hppa*-*-pro*)
764     libgloss_dir=pa
765     ;;
766   hppa*-*-*)
767     # According to Alexandre Oliva <aoliva@redhat.com>, libjava won't
768     # build on HP-UX 10.20.
769     noconfigdirs="$noconfigdirs ld shellutils ${libgcj}"
770     ;;
771   i960-*-*)
772     noconfigdirs="$noconfigdirs ${libgcj} gdb"
773     ;;
774   ia64*-*-elf*)
775     # No gdb support yet.
776     noconfigdirs="$noconfigdirs readline mmalloc libgui itcl gdb"
777     ;;
778   ia64*-**-hpux*)
779     # No gdb or ld support yet.
780     noconfigdirs="$noconfigdirs ${libgcj} readline mmalloc libgui itcl gdb ld"
781     ;;
782   ia64*-*-*vms*)
783     # No gdb or ld support yet.
784     noconfigdirs="$noconfigdirs ${libgcj} tix readline mmalloc libgui itcl gdb ld"
785     ;;
786   i370-*-opened*)
787     ;;
788   i[[3456789]]86-*-coff | i[[3456789]]86-*-elf)
789     noconfigdirs="$noconfigdirs ${libgcj}"
790     libgloss_dir=i386
791     ;;
792   i[[3456789]]86-*-linux*)
793     # The GCC port for glibc1 has no MD_FALLBACK_FRAME_STATE_FOR, so let's
794     # not build java stuff by default.
795     case "${target}" in
796       *-*-*libc1*)
797         noconfigdirs="$noconfigdirs ${libgcj}";;
798     esac
800     # This section makes it possible to build newlib natively on linux.
801     # If we are using a cross compiler then don't configure newlib.
802     if test x${is_cross_compiler} != xno ; then
803       noconfigdirs="$noconfigdirs target-newlib"
804     fi
805     noconfigdirs="$noconfigdirs target-libgloss"
806     # If we are not using a cross compiler, do configure newlib.
807     # Note however, that newlib will only be configured in this situation
808     # if the --with-newlib option has been given, because otherwise
809     # 'target-newlib' will appear in skipdirs.
810     ;;
811   i[[3456789]]86-w64-mingw*)
812     noconfigdirs="$noconfigdirs expect target-libgloss target-newlib ${libgcj}"
813     ;;
814   i[[3456789]]86-*-mingw*)
815     target_configdirs="$target_configdirs target-winsup"
816     noconfigdirs="$noconfigdirs expect target-libgloss target-newlib ${libgcj}"
817     ;;
818   x86_64-*-mingw*)
819     noconfigdirs="$noconfigdirs expect target-libgloss target-newlib ${libgcj}"
820     ;;
821   *-*-cygwin*)
822     target_configdirs="$target_configdirs target-libtermcap target-winsup"
823     noconfigdirs="$noconfigdirs target-gperf target-libgloss"
824     # always build newlib if winsup directory is present.
825     if test -d "$srcdir/winsup/cygwin"; then
826       skipdirs=`echo " ${skipdirs} " | sed -e 's/ target-newlib / /'`
827     elif test -d "$srcdir/newlib"; then
828       echo "Warning: winsup/cygwin is missing so newlib can't be built."
829     fi
830     ;;
831   i[[3456789]]86-moss-msdos | i[[3456789]]86-*-moss* | \
832   i[[3456789]]86-*-uwin* | i[[3456789]]86-*-interix* )
833     ;;
834   i[[3456789]]86-*-pe)
835     noconfigdirs="$noconfigdirs target-libstdc++-v3 target-libgloss ${libgcj}"
836     ;;
837   i[[3456789]]86-*-sco3.2v5*)
838     # The linker does not yet know about weak symbols in COFF,
839     # and is not configured to handle mixed ELF and COFF.
840     noconfigdirs="$noconfigdirs ld target-libgloss ${libgcj}"
841     ;;
842   i[[3456789]]86-*-sco*)
843     noconfigdirs="$noconfigdirs gprof target-libgloss ${libgcj}"
844     ;;
845   i[[3456789]]86-*-solaris2*)
846     noconfigdirs="$noconfigdirs target-libgloss"
847     ;;
848   i[[3456789]]86-*-sysv4*)
849     noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
850     ;;
851   i[[3456789]]86-*-beos*)
852     noconfigdirs="$noconfigdirs gdb target-newlib target-libgloss ${libgcj}"
853     ;;
854   i[[3456789]]86-*-rdos*)
855     noconfigdirs="$noconfigdirs gdb target-newlib target-libgloss"
856     ;;
857   m32r-*-*)
858     noconfigdirs="$noconfigdirs ${libgcj}"
859     ;;
860   m68hc11-*-*|m6811-*-*|m68hc12-*-*|m6812-*-*)
861     noconfigdirs="$noconfigdirs target-libiberty target-libstdc++-v3 ${libgcj}"
862     libgloss_dir=m68hc11
863     ;;
864   m68k-*-elf*)
865     noconfigdirs="$noconfigdirs ${libgcj}"
866     ;;
867   m68k-*-coff*)
868     noconfigdirs="$noconfigdirs ${libgcj}"
869     ;;
870   m68*-*-* | fido-*-*)
871     libgloss_dir=m68k
872     ;;
873   mcore-*-pe*)
874   # The EPOC C++ environment does not support exceptions or rtti,
875   # and so building libstdc++-v3 tends not to always work.
876     noconfigdirs="$noconfigdirs target-libstdc++-v3"
877     ;;
878   mmix-*-*)
879     noconfigdirs="$noconfigdirs target-libffi target-boehm-gc gdb libgloss"
880     unsupported_languages="$unsupported_languages fortran java"
881     ;;
882   mn10200-*-*)
883     noconfigdirs="$noconfigdirs ${libgcj}"
884     ;;
885   mn10300-*-*)
886     noconfigdirs="$noconfigdirs ${libgcj}"
887     ;;
888   mt-*-*)
889     noconfigdirs="$noconfigdirs sim"
890     ;;
891   powerpc-*-aix*)
892     # copied from rs6000-*-* entry
893     noconfigdirs="$noconfigdirs gprof target-libgloss target-libssp target-newlib ${libgcj}"
894     ;;
895   powerpc*-*-winnt* | powerpc*-*-pe* | ppc*-*-pe)
896     target_configdirs="$target_configdirs target-winsup"
897     noconfigdirs="$noconfigdirs gdb tcl tk make expect target-libgloss itcl gnuserv ${libgcj}"
898     # always build newlib.
899     skipdirs=`echo " ${skipdirs} " | sed -e 's/ target-newlib / /'`
900     ;;
901     # This is temporary until we can link against shared libraries
902   powerpcle-*-solaris*)
903     noconfigdirs="$noconfigdirs gdb sim make tcl tk expect itcl gnuserv ${libgcj}"
904     libgloss_dir=rs6000
905     ;;
906   powerpc-*-beos*)
907     noconfigdirs="$noconfigdirs gdb target-newlib target-libgloss ${libgcj}"
908     ;;
909   powerpc-*-eabi)
910     noconfigdirs="$noconfigdirs ${libgcj}"
911     libgloss_dir=rs6000
912     ;;
913   powerpc-*-eabi* | powerpcle-*-eabi* | powerpc-*-rtems* )
914     libgloss_dir=rs6000
915     ;;
916   rs6000-*-lynxos*)
917     noconfigdirs="$noconfigdirs target-newlib gprof ${libgcj}"
918     ;;
919   rs6000-*-aix*)
920     noconfigdirs="$noconfigdirs gprof target-libgloss target-libssp target-newlib ${libgcj}"
921     ;;
922   rs6000-*-*)
923     noconfigdirs="$noconfigdirs gprof ${libgcj}"
924     ;;
925   m68k-apollo-*)
926     noconfigdirs="$noconfigdirs ld binutils gprof target-libgloss ${libgcj}"
927     ;;
928   microblaze*)
929     noconfigdirs="$noconfigdirs gprof target-libssp ${libgcj}"
930     ;;
931   mips*-sde-elf*)
932     skipdirs="$skipdirs target-libiberty"
933     noconfigdirs="$noconfigdirs ${libgcj}"
934     if test x$with_newlib = xyes; then
935       noconfigdirs="$noconfigdirs gprof"
936     fi
937     libgloss_dir=mips
938     ;;
939   mips*-*-irix5*)
940     noconfigdirs="$noconfigdirs gprof target-libgloss ${libgcj}"
941     ;;
942   mips*-*-irix6*)
943     # Linking libjava exceeds command-line length limits on at least
944     # IRIX 6.2, but not on IRIX 6.5.
945     # Also, boehm-gc won't build on IRIX 6.5, according to Jeffrey Oldham
946     # <oldham@codesourcery.com>
947     noconfigdirs="$noconfigdirs gprof target-libgloss ${libgcj}"
948     ;;
949   mips*-*-bsd*)
950     noconfigdirs="$noconfigdirs gprof target-libgloss ${libgcj}"
951     ;;
952   mips*-*-linux*)
953     noconfigdirs="$noconfigdirs target-newlib target-libgloss"
954     ;;
955   mips*-*-*)
956     noconfigdirs="$noconfigdirs gprof ${libgcj}"
957     libgloss_dir=mips
958     ;;
959   romp-*-*)
960     noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes target-libgloss ${libgcj}"
961     ;;
962   sh-*-* | sh64-*-*)
963     case "${host}" in
964       i[[3456789]]86-*-vsta) ;; # don't add gprof back in
965       i[[3456789]]86-*-go32*) ;; # don't add gprof back in
966       i[[3456789]]86-*-msdosdjgpp*) ;; # don't add gprof back in
967       *) skipdirs=`echo " ${skipdirs} " | sed -e 's/ gprof / /'` ;;
968     esac
969     case "${target}" in
970       sh*-*-elf)
971          noconfigdirs="$noconfigdirs ${libgcj}" ;;
972       *)
973          noconfigdirs="$noconfigdirs target-libgloss ${libgcj}" ;;
974     esac
975     ;;
976   sparclet-*-aout* | sparc86x-*-*)
977     libgloss_dir=sparc
978     ;;
979   sparc-*-elf*)
980     noconfigdirs="$noconfigdirs ${libgcj}"
981     ;;
982   sparc64-*-elf*)
983     noconfigdirs="$noconfigdirs ${libgcj}"
984     libgloss_dir=sparc
985     ;;
986   sparclite-*-*)
987     noconfigdirs="$noconfigdirs ${libgcj}"
988     libgloss_dir=sparc
989     ;;
990   sparc-*-sunos4*)
991     noconfigdirs="$noconfigdirs ${libgcj}"
992     if test x${is_cross_compiler} != xno ; then
993            noconfigdirs="$noconfigdirs gdb target-newlib target-libgloss"
994     else
995            use_gnu_ld=no
996     fi
997     ;;
998   sparc-*-solaris2.[[0-6]] | sparc-*-solaris2.[[0-6]].*)
999     noconfigdirs="$noconfigdirs ${libgcj}"
1000     ;;
1001   sparc-*-solaris* | sparc64-*-solaris* | sparcv9-*-solaris*)
1002     ;;
1003   tic6x-*-*)
1004     noconfigdirs="$noconfigdirs gdb sim ${libgcj}"
1005     ;;
1006   v810-*-*)
1007     noconfigdirs="$noconfigdirs bfd binutils gas gcc gdb ld target-libstdc++-v3 opcodes target-libgloss ${libgcj}"
1008     ;;
1009   v850*-*-*)
1010     noconfigdirs="$noconfigdirs ${libgcj}"
1011     ;;
1012   vax-*-vms)
1013     noconfigdirs="$noconfigdirs bfd binutils gdb ld target-newlib opcodes target-libgloss ${libgcj}"
1014     ;;
1015   vax-*-*)
1016     noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}"
1017     ;;
1018   xtensa*-*-*)
1019     noconfigdirs="$noconfigdirs ${libgcj}"
1020     ;;
1021   ip2k-*-*)
1022     noconfigdirs="$noconfigdirs target-libiberty target-libstdc++-v3 ${libgcj}"
1023     ;;
1024   *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu | *-*-kopensolaris*-gnu)
1025     noconfigdirs="$noconfigdirs target-newlib target-libgloss"
1026     ;;
1027   *-*-lynxos*)
1028     noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}"
1029     ;; 
1030   *-*-*)
1031     noconfigdirs="$noconfigdirs ${libgcj}"
1032     ;;
1033 esac
1035 # If we aren't building newlib, then don't build libgloss, since libgloss
1036 # depends upon some newlib header files.
1037 case "${noconfigdirs}" in
1038   *target-libgloss*) ;;
1039   *target-newlib*) noconfigdirs="$noconfigdirs target-libgloss" ;;
1040 esac
1042 # Work in distributions that contain no compiler tools, like Autoconf.
1043 tentative_cc=""
1044 host_makefile_frag=/dev/null
1045 if test -d ${srcdir}/config ; then
1046 case "${host}" in
1047   m68k-hp-hpux*)
1048     # Avoid "too much defining" errors from HPUX compiler.
1049     tentative_cc="cc -Wp,-H256000"
1050     # If "ar" in $PATH is GNU ar, the symbol table may need rebuilding.
1051     # If it's HP/UX ar, this should be harmless.
1052     RANLIB="ar ts"
1053     ;;
1054   m68k-apollo-sysv*)
1055     tentative_cc="cc -A ansi -A runtype,any -A systype,any -U__STDC__ -DUSG"
1056     ;;
1057   m68k-apollo-bsd*)
1058     #None of the Apollo compilers can compile gas or binutils.  The preprocessor
1059     # chokes on bfd, the compiler won't let you assign integers to enums, and
1060     # other problems.  Defining CC to gcc is a questionable way to say "don't use
1061     # the apollo compiler" (the preferred version of GCC could be called cc,
1062     # or whatever), but I'm not sure leaving CC as cc is any better...
1063     #CC=cc -A ansi -A runtype,any -A systype,any -U__STDC__ -DNO_STDARG
1064     # Used to have BISON=yacc.
1065     tentative_cc=gcc
1066     ;;
1067   m88k-dg-dgux*)
1068     tentative_cc="gcc -Wall -ansi -D__using_DGUX"
1069     ;;
1070   m88k-harris-cxux*)
1071     # Under CX/UX, we want to tell the compiler to use ANSI mode.
1072     tentative_cc="cc -Xa"
1073     host_makefile_frag="config/mh-cxux"
1074     ;;
1075   m88k-motorola-sysv*)
1076     ;;
1077   mips*-dec-ultrix*)
1078     tentative_cc="cc -Wf,-XNg1000"
1079     host_makefile_frag="config/mh-decstation"
1080     ;;
1081   mips*-nec-sysv4*)
1082     # The C compiler on NEC MIPS SVR4 needs bigger tables.
1083     tentative_cc="cc -ZXNd=5000 -ZXNg=1000"
1084     host_makefile_frag="config/mh-necv4"
1085     ;;
1086   mips*-sgi-irix4*)
1087     # Tell compiler to use K&R C.  We can't compile under the SGI Ansi
1088     # environment.  Also bump switch table size so that cp-parse will
1089     # compile.  Bump string length limit so linker builds.
1090     tentative_cc="cc -cckr -Wf,-XNg1500 -Wf,-XNk1000 -Wf,-XNh2000 -Wf,-XNl8192"
1091     ;;
1092   mips*-*-sysv4*)
1093     host_makefile_frag="config/mh-sysv4"
1094     ;;
1095   mips*-*-sysv*)
1096     # This is for a MIPS running RISC/os 4.52C.
1098     # This is needed for GDB, but needs to be in the top-level make because
1099     # if a library is compiled with the bsd headers and gets linked with the
1100     # sysv system libraries all hell can break loose (e.g. a jmp_buf might be
1101     # a different size).
1102     # ptrace(2) apparently has problems in the BSD environment.  No workaround is
1103     # known except to select the sysv environment.  Could we use /proc instead?
1104     # These "sysv environments" and "bsd environments" often end up being a pain.
1105     #
1106     # This is not part of CFLAGS because perhaps not all C compilers have this
1107     # option.
1108     tentative_cc="cc -systype sysv"
1109     ;;
1110   i370-ibm-opened*)
1111     tentative_cc="c89"
1112     ;;
1113   i[[3456789]]86-*-sysv5*)
1114     host_makefile_frag="config/mh-sysv5"
1115     ;;
1116   i[[3456789]]86-*-dgux*)
1117     tentative_cc="gcc -Wall -ansi -D__using_DGUX"
1118     host_makefile_frag="config/mh-dgux386"
1119     ;;
1120   i[[3456789]]86-ncr-sysv4.3*)
1121     # The MetaWare compiler will generate a copyright message unless you
1122     # turn it off by adding the -Hnocopyr flag.
1123     tentative_cc="cc -Hnocopyr"
1124     ;;
1125   i[[3456789]]86-ncr-sysv4*)
1126     # for an NCR 3000 (i486/SVR4) system.
1127     # The NCR 3000 ships with a MetaWare compiler installed as /bin/cc.
1128     # This compiler not only emits obnoxious copyright messages every time
1129     # you run it, but it chokes and dies on a whole bunch of GNU source
1130     # files.  Default to using the AT&T compiler installed in /usr/ccs/ATT/cc.
1131     tentative_cc="/usr/ccs/ATT/cc"
1132     host_makefile_frag="config/mh-ncr3000"
1133     ;;
1134   i[[3456789]]86-*-sco3.2v5*)
1135     ;;
1136   i[[3456789]]86-*-sco*)
1137     # The native C compiler botches some simple uses of const.  Unfortunately,
1138     # it doesn't defined anything like "__sco__" for us to test for in ansidecl.h.
1139     tentative_cc="cc -Dconst="
1140     host_makefile_frag="config/mh-sco"
1141     ;;
1142   i[[3456789]]86-*-udk*)
1143     host_makefile_frag="config/mh-sysv5"
1144     ;;
1145   i[[3456789]]86-*-solaris2*)
1146     host_makefile_frag="config/mh-sysv4"
1147     ;;
1148   i[[3456789]]86-*-msdosdjgpp*)
1149     host_makefile_frag="config/mh-djgpp"
1150     ;;
1151   *-cygwin*)
1152     ACX_CHECK_CYGWIN_CAT_WORKS
1153     host_makefile_frag="config/mh-cygwin"
1154     ;;
1155   *-mingw*)
1156     host_makefile_frag="config/mh-mingw"
1157     ;;
1158   *-interix*)
1159     host_makefile_frag="config/mh-interix"
1160     ;;
1161   vax-*-ultrix2*)
1162     # The old BSD pcc isn't up to compiling parts of gdb so use gcc
1163     tentative_cc=gcc
1164     ;;
1165   *-*-solaris2*)
1166     host_makefile_frag="config/mh-solaris"
1167     ;;
1168   m68k-sun-sunos*)
1169     # Sun's C compiler needs the -J flag to be able to compile cp-parse.c
1170     # without overflowing the jump tables (-J says to use a 32 bit table)
1171     tentative_cc="cc -J"
1172     ;;
1173   hppa*-hp-hpux10*)
1174     tentative_cc="cc -Wp,-H256000"
1175     host_makefile_frag="config/mh-pa-hpux10"
1176     ;;
1177   hppa*-hp-hpux* | hppa*-*-hiux*)
1178     tentative_cc="cc -Wp,-H256000"
1179     host_makefile_frag="config/mh-pa"
1180     ;;
1181   hppa*-*)      
1182     host_makefile_frag="config/mh-pa"
1183     ;;
1184   *-hp-hpux* | *-*-hiux*)
1185     tentative_cc="cc -Wp,-H256000"
1186     ;;
1187   rs6000-*-lynxos*)
1188     # /bin/cc is less than useful for our purposes.  Always use GCC
1189     tentative_cc="/usr/cygnus/progressive/bin/gcc"
1190     host_makefile_frag="config/mh-lynxrs6k"
1191     ;;
1192   *-*-darwin*)
1193     host_makefile_frag="config/mh-darwin"
1194     ;;
1195   powerpc-*-aix*)
1196     host_makefile_frag="config/mh-ppc-aix"
1197     ;;
1198   rs6000-*-aix*)
1199     host_makefile_frag="config/mh-ppc-aix"
1200     ;;
1201   *-*-lynxos*)
1202     # /bin/cc is less than useful for our purposes.  Always use GCC
1203     tentative_cc="/bin/gcc"
1204     ;;
1205   *-*-sysv4*)
1206     host_makefile_frag="config/mh-sysv4"
1207     ;;
1208   # This is placed last to prevent interfering with the cases above.
1209   i[[3456789]]86-*-*)
1210     # Build the stage2 and stage3 compilers with -fomit-frame-pointer.
1211     host_makefile_frag="config/mh-x86omitfp"
1212     ;;
1213 esac
1216 # If we aren't going to be using gcc, see if we can extract a definition
1217 # of CC from the fragment.
1218 # Actually, use the 'pre-extracted' version above.
1219 if test -z "${CC}" && test "${build}" = "${host}" ; then
1220   IFS="${IFS=   }"; save_ifs="$IFS"; IFS="${IFS}:"
1221   found=
1222   for dir in $PATH; do
1223     test -z "$dir" && dir=.
1224     if test -f $dir/gcc; then
1225       found=yes
1226       break
1227     fi
1228   done
1229   IFS="$save_ifs"
1230   if test -z "${found}" && test -n "${tentative_cc}" ; then
1231     CC=$tentative_cc
1232   fi
1235 if test "${build}" != "${host}" ; then
1236   AR_FOR_BUILD=${AR_FOR_BUILD-ar}
1237   AS_FOR_BUILD=${AS_FOR_BUILD-as}
1238   CC_FOR_BUILD=${CC_FOR_BUILD-gcc}
1239   CXX_FOR_BUILD=${CXX_FOR_BUILD-g++}
1240   GCJ_FOR_BUILD=${GCJ_FOR_BUILD-gcj}
1241   GFORTRAN_FOR_BUILD=${GFORTRAN_FOR_BUILD-gfortran}
1242   GOC_FOR_BUILD=${GOC_FOR_BUILD-gccgo}
1243   DLLTOOL_FOR_BUILD=${DLLTOOL_FOR_BUILD-dlltool}
1244   LD_FOR_BUILD=${LD_FOR_BUILD-ld}
1245   NM_FOR_BUILD=${NM_FOR_BUILD-nm}
1246   RANLIB_FOR_BUILD=${RANLIB_FOR_BUILD-ranlib}
1247   WINDRES_FOR_BUILD=${WINDRES_FOR_BUILD-windres}
1248   WINDMC_FOR_BUILD=${WINDMC_FOR_BUILD-windmc}
1249 else
1250   AR_FOR_BUILD="\$(AR)"
1251   AS_FOR_BUILD="\$(AS)"
1252   CC_FOR_BUILD="\$(CC)"
1253   CXX_FOR_BUILD="\$(CXX)"
1254   GCJ_FOR_BUILD="\$(GCJ)"
1255   GFORTRAN_FOR_BUILD="\$(GFORTRAN)"
1256   GOC_FOR_BUILD="\$(GOC)"
1257   DLLTOOL_FOR_BUILD="\$(DLLTOOL)"
1258   LD_FOR_BUILD="\$(LD)"
1259   NM_FOR_BUILD="\$(NM)"
1260   RANLIB_FOR_BUILD="\$(RANLIB)"
1261   WINDRES_FOR_BUILD="\$(WINDRES)"
1262   WINDMC_FOR_BUILD="\$(WINDMC)"
1265 AC_PROG_CC
1266 AC_PROG_CXX
1268 # We must set the default linker to the linker used by gcc for the correct
1269 # operation of libtool.  If LD is not defined and we are using gcc, try to
1270 # set the LD default to the ld used by gcc.
1271 if test -z "$LD"; then
1272   if test "$GCC" = yes; then
1273     case $build in
1274     *-*-mingw*)
1275       gcc_prog_ld=`$CC -print-prog-name=ld 2>&1 | tr -d '\015'` ;;
1276     *)
1277       gcc_prog_ld=`$CC -print-prog-name=ld 2>&1` ;;
1278     esac
1279     case $gcc_prog_ld in
1280     # Accept absolute paths.
1281     [[\\/]* | [A-Za-z]:[\\/]*)]
1282       LD="$gcc_prog_ld" ;;
1283     esac
1284   fi
1287 ACX_PROG_GNAT
1288 ACX_PROG_CMP_IGNORE_INITIAL
1290 # See if we are building gcc with C++.
1291 AC_ARG_ENABLE(build-with-cxx,
1292 [  --enable-build-with-cxx build with C++ compiler instead of C compiler],
1293 ENABLE_BUILD_WITH_CXX=$enableval,
1294 ENABLE_BUILD_WITH_CXX=no)
1296 # Used for setting $lt_cv_objdir
1297 _LT_CHECK_OBJDIR
1299 # Check for GMP, MPFR and MPC
1300 gmplibs="-lmpc -lmpfr -lgmp"
1301 gmpinc=
1302 have_gmp=no
1304 # Specify a location for mpc
1305 # check for this first so it ends up on the link line before mpfr.
1306 AC_ARG_WITH(mpc, [  --with-mpc=PATH        specify prefix directory for installed MPC package.
1307                           Equivalent to --with-mpc-include=PATH/include
1308                           plus --with-mpc-lib=PATH/lib])
1309 AC_ARG_WITH(mpc-include, [  --with-mpc-include=PATH
1310                           specify directory for installed MPC include files])
1311 AC_ARG_WITH(mpc-lib, [  --with-mpc-lib=PATH    specify directory for the installed MPC library])
1313 if test "x$with_mpc" != x; then
1314   gmplibs="-L$with_mpc/lib $gmplibs"
1315   gmpinc="-I$with_mpc/include $gmpinc"
1317 if test "x$with_mpc_include" != x; then
1318   gmpinc="-I$with_mpc_include $gmpinc"
1320 if test "x$with_mpc_lib" != x; then
1321   gmplibs="-L$with_mpc_lib $gmplibs"
1323 if test "x$with_mpc$with_mpc_include$with_mpc_lib" = x && test -d ${srcdir}/mpc; then
1324   gmplibs='-L$$r/$(HOST_SUBDIR)/mpc/src/'"$lt_cv_objdir $gmplibs"
1325   gmpinc='-I$$s/mpc/src '"$gmpinc"
1326   # Do not test the mpc version.  Assume that it is sufficient, since
1327   # it is in the source tree, and the library has not been built yet
1328   # but it would be included on the link line in the version check below
1329   # hence making the test fail.
1330   have_gmp=yes
1333 # Specify a location for mpfr
1334 # check for this first so it ends up on the link line before gmp.
1335 AC_ARG_WITH(mpfr-dir, [  --with-mpfr-dir=PATH    this option has been REMOVED],
1336   AC_MSG_ERROR([The --with-mpfr-dir=PATH option has been removed.
1337 Use --with-mpfr=PATH or --with-mpfr-include=PATH plus --with-mpfr-lib=PATH]))
1339 AC_ARG_WITH(mpfr, [  --with-mpfr=PATH        specify prefix directory for installed MPFR package.
1340                           Equivalent to --with-mpfr-include=PATH/include
1341                           plus --with-mpfr-lib=PATH/lib])
1342 AC_ARG_WITH(mpfr-include, [  --with-mpfr-include=PATH
1343                           specify directory for installed MPFR include files])
1344 AC_ARG_WITH(mpfr-lib, [  --with-mpfr-lib=PATH    specify directory for the installed MPFR library])
1346 if test "x$with_mpfr" != x; then
1347   gmplibs="-L$with_mpfr/lib $gmplibs"
1348   gmpinc="-I$with_mpfr/include $gmpinc"
1350 if test "x$with_mpfr_include" != x; then
1351   gmpinc="-I$with_mpfr_include $gmpinc"
1353 if test "x$with_mpfr_lib" != x; then
1354   gmplibs="-L$with_mpfr_lib $gmplibs"
1356 if test "x$with_mpfr$with_mpfr_include$with_mpfr_lib" = x && test -d ${srcdir}/mpfr; then
1357   gmplibs='-L$$r/$(HOST_SUBDIR)/mpfr/'"$lt_cv_objdir $gmplibs"
1358   gmpinc='-I$$r/$(HOST_SUBDIR)/mpfr -I$$s/mpfr '"$gmpinc"
1359   extra_mpc_mpfr_configure_flags='--with-mpfr-include=$$s/mpfr --with-mpfr-lib=$$r/$(HOST_SUBDIR)/mpfr/'"$lt_cv_objdir"
1360   # Do not test the mpfr version.  Assume that it is sufficient, since
1361   # it is in the source tree, and the library has not been built yet
1362   # but it would be included on the link line in the version check below
1363   # hence making the test fail.
1364   have_gmp=yes
1367 # Specify a location for gmp
1368 AC_ARG_WITH(gmp-dir, [  --with-gmp-dir=PATH     this option has been REMOVED],
1369   AC_MSG_ERROR([The --with-gmp-dir=PATH option has been removed.
1370 Use --with-gmp=PATH or --with-gmp-include=PATH plus --with-gmp-lib=PATH]))
1372 AC_ARG_WITH(gmp, [  --with-gmp=PATH         specify prefix directory for the installed GMP package.
1373                           Equivalent to --with-gmp-include=PATH/include
1374                           plus --with-gmp-lib=PATH/lib])
1375 AC_ARG_WITH(gmp-include, [  --with-gmp-include=PATH specify directory for installed GMP include files])
1376 AC_ARG_WITH(gmp-lib, [  --with-gmp-lib=PATH     specify directory for the installed GMP library])
1379 if test "x$with_gmp" != x; then
1380   gmplibs="-L$with_gmp/lib $gmplibs"
1381   gmpinc="-I$with_gmp/include $gmpinc"
1383 if test "x$with_gmp_include" != x; then
1384   gmpinc="-I$with_gmp_include $gmpinc"
1386 if test "x$with_gmp_lib" != x; then
1387   gmplibs="-L$with_gmp_lib $gmplibs"
1389 if test "x$with_gmp$with_gmp_include$with_gmp_lib" = x && test -d ${srcdir}/gmp; then
1390   gmplibs='-L$$r/$(HOST_SUBDIR)/gmp/'"$lt_cv_objdir $gmplibs"
1391   gmpinc='-I$$r/$(HOST_SUBDIR)/gmp -I$$s/gmp '"$gmpinc"
1392   extra_mpfr_configure_flags='--with-gmp-include=$$r/$(HOST_SUBDIR)/gmp --with-gmp-lib=$$r/$(HOST_SUBDIR)/gmp/'"$lt_cv_objdir"
1393   extra_mpc_gmp_configure_flags='--with-gmp-include=$$r/$(HOST_SUBDIR)/gmp --with-gmp-lib=$$r/$(HOST_SUBDIR)/gmp/'"$lt_cv_objdir"
1394   # Do not test the gmp version.  Assume that it is sufficient, since
1395   # it is in the source tree, and the library has not been built yet
1396   # but it would be included on the link line in the version check below
1397   # hence making the test fail.
1398   have_gmp=yes
1401 if test -d ${srcdir}/gcc && test "x$have_gmp" = xno; then
1402   have_gmp=yes
1403   saved_CFLAGS="$CFLAGS"
1404   CFLAGS="$CFLAGS $gmpinc"
1405   # Check for the recommended and required versions of GMP.
1406   AC_MSG_CHECKING([for the correct version of gmp.h])
1407   AC_TRY_COMPILE([#include "gmp.h"],[
1408   #define GCC_GMP_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
1409   #define GCC_GMP_VERSION GCC_GMP_VERSION_NUM(__GNU_MP_VERSION,__GNU_MP_VERSION_MINOR,__GNU_MP_VERSION_PATCHLEVEL)
1410   #if GCC_GMP_VERSION < GCC_GMP_VERSION_NUM(4,2,0)
1411   choke me
1412   #endif
1413   ], [AC_TRY_COMPILE([#include <gmp.h>],[
1414   #define GCC_GMP_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
1415   #define GCC_GMP_VERSION GCC_GMP_VERSION_NUM(__GNU_MP_VERSION,__GNU_MP_VERSION_MINOR,__GNU_MP_VERSION_PATCHLEVEL)
1416   #if GCC_GMP_VERSION < GCC_GMP_VERSION_NUM(4,3,2)
1417   choke me
1418   #endif
1419   ], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([buggy but acceptable])])],
1420    [AC_MSG_RESULT([no]); have_gmp=no])
1422   # If we have GMP, check the MPFR version.
1423   if test x"$have_gmp" = xyes; then
1424     # Check for the recommended and required versions of MPFR.
1425     AC_MSG_CHECKING([for the correct version of mpfr.h])
1426     AC_TRY_COMPILE([#include <gmp.h>
1427     #include <mpfr.h>],[
1428     #if MPFR_VERSION < MPFR_VERSION_NUM(2,3,1)
1429     choke me
1430     #endif
1431     ], [AC_TRY_COMPILE([#include <gmp.h>
1432     #include <mpfr.h>],[
1433     #if MPFR_VERSION < MPFR_VERSION_NUM(2,4,2)
1434     choke me
1435     #endif
1436     ], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([buggy but acceptable])])],
1437      [AC_MSG_RESULT([no]); have_gmp=no])
1438   fi
1440   # Check for the MPC header version.
1441   if test x"$have_gmp" = xyes ; then
1442     # Check for the recommended and required versions of MPC.
1443     AC_MSG_CHECKING([for the correct version of mpc.h])
1444     AC_TRY_COMPILE([#include <mpc.h>],[
1445     #if MPC_VERSION < MPC_VERSION_NUM(0,8,0)
1446     choke me
1447     #endif
1448     ], [AC_TRY_COMPILE([#include <mpc.h>],[
1449     #if MPC_VERSION < MPC_VERSION_NUM(0,8,1)
1450     choke me
1451     #endif
1452     ], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([buggy but acceptable])])],
1453      [AC_MSG_RESULT([no]); have_gmp=no])
1454   fi
1456   # Now check the MPFR library.
1457   if test x"$have_gmp" = xyes; then
1458     saved_LIBS="$LIBS"
1459     LIBS="$LIBS $gmplibs"
1460     AC_MSG_CHECKING([for the correct version of the gmp/mpfr/mpc libraries])
1461     AC_TRY_LINK([#include <mpc.h>],[
1462     mpfr_t n;
1463     mpfr_t x;
1464     mpc_t c;
1465     int t;
1466     mpfr_init (n);
1467     mpfr_init (x);
1468     mpfr_atan2 (n, n, x, GMP_RNDN);
1469     mpfr_erfc (n, x, GMP_RNDN);
1470     mpfr_subnormalize (x, t, GMP_RNDN);
1471     mpfr_clear(n);
1472     mpfr_clear(x);
1473     mpc_init2 (c, 53);
1474     mpc_set_ui_ui (c, 1, 1, MPC_RNDNN);
1475     mpc_cosh (c, c, MPC_RNDNN);
1476     mpc_pow (c, c, c, MPC_RNDNN);
1477     mpc_acosh (c, c, MPC_RNDNN);
1478     mpc_clear (c);
1479     ], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]); have_gmp=no])
1480     LIBS="$saved_LIBS"
1481   fi
1483   CFLAGS="$saved_CFLAGS"
1485 # The library versions listed in the error message below should match
1486 # the HARD-minimums enforced above.
1487   if test x$have_gmp != xyes; then
1488     AC_MSG_ERROR([Building GCC requires GMP 4.2+, MPFR 2.3.1+ and MPC 0.8.0+.
1489 Try the --with-gmp, --with-mpfr and/or --with-mpc options to specify
1490 their locations.  Source code for these libraries can be found at
1491 their respective hosting sites as well as at
1492 ftp://gcc.gnu.org/pub/gcc/infrastructure/.  See also
1493 http://gcc.gnu.org/install/prerequisites.html for additional info.  If
1494 you obtained GMP, MPFR and/or MPC from a vendor distribution package,
1495 make sure that you have installed both the libraries and the header
1496 files.  They may be located in separate packages.])
1497   fi
1500 # Flags needed for both GMP, MPFR and/or MPC.
1501 AC_SUBST(gmplibs)
1502 AC_SUBST(gmpinc)
1503 AC_SUBST(extra_mpfr_configure_flags)
1504 AC_SUBST(extra_mpc_gmp_configure_flags)
1505 AC_SUBST(extra_mpc_mpfr_configure_flags)
1507 # Allow host libstdc++ to be specified for static linking with PPL.
1508 AC_ARG_WITH(host-libstdcxx, [  --with-host-libstdcxx=L Use linker arguments L to link with libstdc++
1509                           when linking with PPL])
1511 case $with_host_libstdcxx in
1512   no|yes)
1513     AC_MSG_ERROR([-with-host-libstdcxx needs an argument])
1514     ;;
1515 esac
1517 # Linker flags to use for stage1 or when not boostrapping.
1518 AC_ARG_WITH(stage1-ldflags,
1519 [  --with-stage1-ldflags=FLAGS Linker flags for stage1],
1520 [if test "$withval" = "no" -o "$withval" = "yes"; then
1521    stage1_ldflags=
1522  else
1523    stage1_ldflags=$withval
1524  fi],
1525 [stage1_ldflags=])
1526 AC_SUBST(stage1_ldflags)
1528 # Libraries to use for stage1 or when not bootstrapping.
1529 AC_ARG_WITH(stage1-libs,
1530 [  -with-stage1-libs=LIBS      Libraries for stage1],
1531 [if test "$withval" = "no" -o "$withval" = "yes"; then
1532    stage1_libs=
1533  else
1534    stage1_libs=$withval
1535  fi],
1536 [stage1_libs=$with_host_libstdcxx])
1537 AC_SUBST(stage1_libs)
1539 # Libraries to use for stage2 and later builds.  This defaults to the
1540 # argument passed to --with-host-libstdcxx.
1541 AC_ARG_WITH(boot-libs,
1542 [  --with-boot-libs=LIBS     Libraries for stage2 and later],
1543 [if test "$withval" = "no" -o "$withval" = "yes"; then
1544    poststage1_libs=
1545  else
1546    poststage1_libs=$withval
1547  fi],
1548 [poststage1_libs=$with_host_libstdcxx])
1549 AC_SUBST(poststage1_libs)
1551 # Linker flags to use for stage2 and later builds.
1552 AC_ARG_WITH(boot-ldflags,
1553 [  --with-boot-ldflags=FLAGS Linker flags for stage2 and later],
1554 [if test "$withval" = "no" -o "$withval" = "yes"; then
1555    poststage1_ldflags=
1556  else
1557    poststage1_ldflags=$withval
1558  fi],
1559 [poststage1_ldflags=
1560  # With --enable-build-with-cxx, default to linking libstdc++ and
1561  # libgcc statically.  But if the user explicitly specified the
1562  # libraries to use, trust that they are doing what they want.
1563  if test "$ENABLE_BUILD_WITH_CXX" = "yes" -a "$poststage1_libs" = ""; then
1564    poststage1_ldflags="-static-libstdc++ -static-libgcc"
1565  fi])
1566 AC_SUBST(poststage1_ldflags)
1568 # Check for PPL
1569 ppllibs=" -lppl_c -lppl -lgmpxx"
1570 pplinc=
1572 AC_ARG_WITH(ppl, [  --with-ppl=PATH         Specify prefix directory for the installed PPL package
1573                           Equivalent to --with-ppl-include=PATH/include
1574                           plus --with-ppl-lib=PATH/lib])
1575 AC_ARG_WITH(ppl-include, [  --with-ppl-include=PATH Specify directory for installed PPL include files])
1576 AC_ARG_WITH(ppl-lib, [  --with-ppl-lib=PATH     Specify the directory for the installed PPL library])
1578 case $with_ppl in 
1579   no)
1580     ppllibs=
1581     ;;
1582   "" | yes)
1583     ;;
1584   *)
1585     ppllibs="-L$with_ppl/lib -lppl_c -lppl -lgmpxx"
1586     pplinc="-I$with_ppl/include $pplinc"
1587     ;;
1588 esac
1589 if test "x$with_ppl_include" != x; then
1590   pplinc="-I$with_ppl_include $pplinc"
1592 if test "x$with_ppl_lib" != x; then
1593   ppllibs="-L$with_ppl_lib -lppl_c -lppl -lgmpxx"
1595 if test "x$with_ppl$with_ppl_include$with_ppl_lib" = x && test -d ${srcdir}/ppl; then
1596   ppllibs='-L$$r/$(HOST_SUBDIR)/ppl/interfaces/C/'"$lt_cv_objdir"' -L$$r/$(HOST_SUBDIR)/ppl/src/'"$lt_cv_objdir"' -lppl_c -lppl -lgmpxx '
1597   pplinc='-I$$r/$(HOST_SUBDIR)/ppl/src -I$$r/$(HOST_SUBDIR)/ppl/interfaces/C '
1598   enable_ppl_version_check=no
1601 AC_ARG_ENABLE(ppl-version-check,
1602 [  --disable-ppl-version-check    disable check for PPL version],
1603 ENABLE_PPL_CHECK=$enableval,
1604 ENABLE_PPL_CHECK=yes)
1606 if test "x$with_ppl" != "xno" -a "${ENABLE_PPL_CHECK}" = "yes"; then
1607   saved_CFLAGS="$CFLAGS"
1608   CFLAGS="$CFLAGS $pplinc $gmpinc"
1609   AC_MSG_CHECKING([for version 0.10 (or later revision) of PPL])
1610   AC_TRY_COMPILE([#include "ppl_c.h"],[
1611   #if PPL_VERSION_MAJOR != 0 || PPL_VERSION_MINOR < 10
1612   choke me
1613   #endif
1614   ], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]); ppllibs= ; pplinc= ; with_ppl=no ])
1615   CFLAGS="$saved_CFLAGS"
1618 # Flags needed for PPL
1619 AC_SUBST(ppllibs)
1620 AC_SUBST(pplinc)
1623 # Check for CLOOG
1625 dnl Provide configure switches and initialize clooginc & clooglibs
1626 dnl with user input.
1627 CLOOG_INIT_FLAGS
1628 if test "x$with_ppl" = "xno"; then
1629   with_cloog=no
1631 if test "x${with_cloog}" = x && test "x${with_cloog_include}" = x \
1632   && test "x${with_cloog_lib}" = x && test -d ${srcdir}/cloog; then
1633   clooglibs='-L$$r/$(HOST_SUBDIR)/cloog/'"$lt_cv_objdir"' '
1634   clooginc='-I$$r/$(HOST_SUBDIR)/cloog/include -I$$s/cloog/include '
1636 if test "x$with_cloog" != "xno"; then
1637   dnl Version check for CLooG-Org
1638   dnl As long as there is no new release of CLooG,
1639   dnl we will check for 0.14.0.
1640   dnl
1641   dnl The first git revision that will work with
1642   dnl GCC is: bd91b845a65805c290d43fc1bef8139864a163fb
1643   dnl This is enforced implictly, as this is the commit that
1644   dnl introduced the versioning information used within our
1645   dnl checks.
1646   dnl
1647   dnl If we're using CLooG-Legacy, the provided version information
1648   dnl will be ignored.
1649   CLOOG_CHECK_VERSION(0,14,0)
1651   dnl Only execute fail-action, if CLooG has been
1652   dnl requested.
1653   CLOOG_IF_FAILED([
1654     AC_MSG_ERROR([Unable to find a usable CLooG. See config.log for details.])])
1657 # Check for LTO support.
1658 AC_ARG_ENABLE(lto,
1659 [  --enable-lto            enable link time optimization support],
1660 enable_lto=$enableval,
1661 enable_lto=yes; default_enable_lto=yes)
1663 ACX_ELF_TARGET_IFELSE([# ELF platforms build the lto-plugin always.
1664   build_lto_plugin=yes
1665 ],[if test x"$default_enable_lto" = x"yes" ; then
1666     case $target in
1667       *-apple-darwin* | *-cygwin* | *-mingw*) ;;
1668       # On other non-ELF platforms, LTO has yet to be validated.
1669       *) enable_lto=no ;;
1670     esac
1671   else
1672   # Apart from ELF platforms, only Windows and Darwin support LTO so far.
1673   # It would also be nice to check the binutils support, but we don't
1674   # have gcc_GAS_CHECK_FEATURE available here.  For now, we'll just
1675   # warn during gcc/ subconfigure; unless you're bootstrapping with
1676   # -flto it won't be needed until after installation anyway.
1677     case $target in
1678       *-cygwin* | *-mingw* | *-apple-darwin*) ;;
1679       *) if test x"$enable_lto" = x"yes"; then
1680         AC_MSG_ERROR([LTO support is not enabled for this target.])
1681         fi
1682       ;;
1683     esac
1684   fi
1685   # Among non-ELF, only Windows platforms support the lto-plugin so far.
1686   # Build it unless LTO was explicitly disabled.
1687   case $target in
1688     *-cygwin* | *-mingw*) build_lto_plugin=$enable_lto ;;
1689     *) ;;
1690   esac
1694 # By default, C is the only stage 1 language.
1695 stage1_languages=,c,
1697 # Target libraries that we bootstrap.
1698 bootstrap_target_libs=,target-libgcc,
1700 # Figure out what language subdirectories are present.
1701 # Look if the user specified --enable-languages="..."; if not, use
1702 # the environment variable $LANGUAGES if defined. $LANGUAGES might
1703 # go away some day.
1704 # NB:  embedded tabs in this IF block -- do not untabify
1705 if test -d ${srcdir}/gcc; then
1706   if test x"${enable_languages+set}" != xset; then
1707     if test x"${LANGUAGES+set}" = xset; then
1708       enable_languages="${LANGUAGES}"
1709         echo configure.in: warning: setting LANGUAGES is deprecated, use --enable-languages instead 1>&2
1710     else
1711       enable_languages=all
1712     fi
1713   else
1714     if test x"${enable_languages}" = x ||
1715        test x"${enable_languages}" = xyes;
1716        then
1717       echo configure.in: --enable-languages needs at least one language argument 1>&2
1718       exit 1
1719     fi
1720   fi
1721   enable_languages=`echo "${enable_languages}" | sed -e 's/[[   ,]][[   ,]]*/,/g' -e 's/,$//'`
1723   # 'f95' is the old name for the 'fortran' language. We issue a warning
1724   # and make the substitution.
1725   case ,${enable_languages}, in
1726     *,f95,*)
1727       echo configure.in: warning: 'f95' as language name is deprecated, use 'fortran' instead 1>&2
1728       enable_languages=`echo "${enable_languages}" | sed -e 's/f95/fortran/g'`
1729       ;;
1730   esac
1732   # First scan to see if an enabled language requires some other language.
1733   # We assume that a given config-lang.in will list all the language
1734   # front ends it requires, even if some are required indirectly.
1735   for lang_frag in ${srcdir}/gcc/*/config-lang.in .. ; do
1736     case ${lang_frag} in
1737       ..) ;;
1738       # The odd quoting in the next line works around
1739       # an apparent bug in bash 1.12 on linux.
1740       ${srcdir}/gcc/[[*]]/config-lang.in) ;;
1741       *)
1742         # From the config-lang.in, get $language, $lang_requires, and
1743         # $lang_requires_boot_languages.
1744         language=
1745         lang_requires=
1746         lang_requires_boot_languages=
1747         . ${lang_frag}
1748         for other in ${lang_requires} ${lang_requires_boot_languages}; do
1749           case ,${enable_languages}, in
1750             *,$other,*) ;;
1751             *,all,*) ;;
1752             *,$language,*)
1753               echo " \`$other' language required by \`$language'; enabling" 1>&2
1754               enable_languages="${enable_languages},${other}"
1755               ;;
1756           esac
1757         done
1758         for other in ${lang_requires_boot_languages} ; do
1759           if test "$other" != "c"; then
1760             case ,${enable_stage1_languages}, in
1761               *,$other,*) ;;
1762               *,all,*) ;;
1763               *)
1764                 case ,${enable_languages}, in
1765                   *,$language,*)
1766                     echo " '$other' language required by '$language' in stage 1; enabling" 1>&2
1767                     enable_stage1_languages="$enable_stage1_languages,${other}"
1768                     ;;
1769                 esac
1770                 ;;
1771             esac
1772           fi
1773         done
1774         ;;
1775     esac
1776   done
1778   new_enable_languages=,c,
1780   # If LTO is enabled, add the LTO front end.
1781   extra_host_libiberty_configure_flags=
1782   if test "$enable_lto" = "yes" ; then
1783     case ,${enable_languages}, in
1784       *,lto,*) ;;
1785       *) enable_languages="${enable_languages},lto" ;;
1786     esac
1787     if test "${build_lto_plugin}" = "yes" ; then
1788       configdirs="$configdirs lto-plugin"
1789       extra_host_libiberty_configure_flags=--enable-shared
1790     fi
1791   fi
1792   AC_SUBST(extra_host_libiberty_configure_flags)
1794   missing_languages=`echo ",$enable_languages," | sed -e s/,all,/,/ -e s/,c,/,/ `
1795   potential_languages=,c,
1797   enabled_target_libs=
1798   disabled_target_libs=
1800   for lang_frag in ${srcdir}/gcc/*/config-lang.in .. ; do
1801     case ${lang_frag} in
1802       ..) ;;
1803       # The odd quoting in the next line works around
1804       # an apparent bug in bash 1.12 on linux.
1805       ${srcdir}/gcc/[[*]]/config-lang.in) ;;
1806       *)
1807         # From the config-lang.in, get $language, $target_libs, 
1808         # $lang_dirs, $boot_language, and $build_by_default
1809         language=
1810         target_libs=
1811         lang_dirs=
1812         subdir_requires=
1813         boot_language=no
1814         build_by_default=yes
1815         . ${lang_frag}
1816         if test x${language} = x; then
1817           echo "${lang_frag} doesn't set \$language." 1>&2
1818           exit 1
1819         fi
1821         if test "$language" = "c++" \
1822            && test "$ENABLE_BUILD_WITH_CXX" = "yes"; then
1823           boot_language=yes
1824         fi
1826         case ,${enable_languages}, in
1827           *,${language},*)
1828             # Language was explicitly selected; include it.
1829             add_this_lang=yes
1830             ;;
1831           *,all,*)
1832             # 'all' was selected, select it if it is a default language
1833             add_this_lang=${build_by_default}
1834             ;;
1835           *)
1836             add_this_lang=no
1837             ;;
1838         esac
1840         # Disable languages that need other directories if these aren't available.
1841         for i in $subdir_requires; do
1842           test -f "$srcdir/gcc/$i/config-lang.in" && continue
1843           case ,${enable_languages}, in
1844             *,${language},*)
1845               # Specifically requested language; tell them.
1846               AC_MSG_ERROR([The gcc/$i directory contains parts of $language but is missing])
1847               ;;
1848             *)
1849               # Silently disable.
1850               add_this_lang=unsupported
1851               ;;
1852           esac
1853         done
1855         # Disable Ada if no preexisting GNAT is available.
1856         case ,${enable_languages},:${language}:${have_gnat} in
1857           *,${language},*:ada:no)
1858             # Specifically requested language; tell them.
1859             AC_MSG_ERROR([GNAT is required to build $language])
1860             ;;
1861           *:ada:no)
1862             # Silently disable.
1863             add_this_lang=unsupported
1864             ;;
1865         esac
1867         # Disable a language that is unsupported by the target.
1868         case " $unsupported_languages " in
1869           *" $language "*)
1870             add_this_lang=unsupported
1871             ;;
1872         esac
1874         case $add_this_lang in
1875           unsupported)
1876             # Remove language-dependent dirs.
1877             disabled_target_libs="$disabled_target_libs $target_libs"
1878             noconfigdirs="$noconfigdirs $lang_dirs"
1879             ;;
1880           no)
1881             # Remove language-dependent dirs; still show language as supported.
1882             disabled_target_libs="$disabled_target_libs $target_libs"
1883             noconfigdirs="$noconfigdirs $lang_dirs"
1884             potential_languages="${potential_languages}${language},"
1885             ;;
1886           yes)
1887             new_enable_languages="${new_enable_languages}${language},"
1888             potential_languages="${potential_languages}${language},"
1889             missing_languages=`echo "$missing_languages" | sed "s/,$language,/,/"`
1890             enabled_target_libs="$enabled_target_libs $target_libs"
1891             case "${boot_language}:,$enable_stage1_languages," in
1892               yes:* | *:*,$language,* | *:*,yes, | *:*,all,)
1893                 # Add to (comma-separated) list of stage 1 languages.
1894                 case ",$stage1_languages," in
1895                   *,$language,* | ,yes, | ,all,) ;;
1896                   *) stage1_languages="${stage1_languages}${language}," ;;
1897                 esac
1898                 # We need to bootstrap any supporting libraries.
1899                 bootstrap_target_libs="${bootstrap_target_libs}${target_libs},"
1900                 ;;
1901             esac
1902             ;;
1903         esac
1904         ;;
1905     esac
1906   done
1908   # Add target libraries which are only needed for disabled languages
1909   # to noconfigdirs.
1910   if test -n "$disabled_target_libs"; then
1911     for dir in $disabled_target_libs; do
1912       case " $enabled_target_libs " in
1913       *" ${dir} "*) ;;
1914       *) noconfigdirs="$noconfigdirs $dir" ;;
1915       esac
1916     done
1917   fi
1919   AC_ARG_ENABLE(stage1-languages,
1920 [  --enable-stage1-languages@<:@=all@:>@   choose additional languages to build during
1921                           stage1.  Mostly useful for compiler development.],
1922   [case ,${enable_stage1_languages}, in
1923     ,no,|,,)
1924       # Set it to something that will have no effect in the loop below
1925       enable_stage1_languages=c ;;
1926     ,yes,)
1927       enable_stage1_languages=`echo $new_enable_languages | \
1928         sed -e "s/^,//" -e "s/,$//" ` ;;
1929     *,all,*)
1930       enable_stage1_languages=`echo ,$enable_stage1_languages, | \
1931         sed -e "s/,all,/$new_enable_languages/" -e "s/^,//" -e "s/,$//" ` ;;
1932   esac
1934   # Add "good" languages from enable_stage1_languages to stage1_languages,
1935   # while "bad" languages go in missing_languages.  Leave no duplicates.
1936   for i in `echo $enable_stage1_languages | sed 's/,/ /g' `; do
1937     case $potential_languages in
1938       *,$i,*)
1939         case $stage1_languages in
1940           *,$i,*) ;;
1941           *) stage1_languages="$stage1_languages$i," ;;
1942         esac ;;
1943       *)
1944         case $missing_languages in
1945           *,$i,*) ;;
1946           *) missing_languages="$missing_languages$i," ;;
1947         esac ;;
1948      esac
1949   done])
1951   # Remove leading/trailing commas that were added for simplicity
1952   potential_languages=`echo "$potential_languages" | sed -e "s/^,//" -e "s/,$//"`
1953   missing_languages=`echo "$missing_languages" | sed -e "s/^,//" -e "s/,$//"`
1954   stage1_languages=`echo "$stage1_languages" | sed -e "s/^,//" -e "s/,$//"`
1955   new_enable_languages=`echo "$new_enable_languages" | sed -e "s/^,//" -e "s/,$//"`
1957   if test "x$missing_languages" != x; then
1958     AC_MSG_ERROR([
1959 The following requested languages could not be built: ${missing_languages}
1960 Supported languages are: ${potential_languages}])
1961   fi
1962   if test "x$new_enable_languages" != "x$enable_languages"; then
1963     echo The following languages will be built: ${new_enable_languages}
1964     enable_languages="$new_enable_languages"
1965   fi
1967   AC_SUBST(stage1_languages)
1968   ac_configure_args=`echo " $ac_configure_args" | sed -e "s/ '--enable-languages=[[^ ]]*'//g" -e "s/$/ '--enable-languages="$enable_languages"'/" `
1971 # Handle --disable-<component> generically.
1972 for dir in $configdirs $build_configdirs $target_configdirs ; do
1973   dirname=`echo $dir | sed -e s/target-//g -e s/build-//g -e s/-/_/g`
1974   varname=`echo $dirname | sed -e s/+/_/g`
1975   if eval test x\${enable_${varname}} "=" xno ; then
1976     noconfigdirs="$noconfigdirs $dir"
1977   fi
1978 done
1980 # Check for Boehm's garbage collector
1981 AC_ARG_ENABLE(objc-gc,
1982 [  --enable-objc-gc        enable use of Boehm's garbage collector with the
1983                           GNU Objective-C runtime],
1984 [case ,${enable_languages},:${enable_objc_gc}:${noconfigdirs} in
1985   *,objc,*:*:yes:*target-boehm-gc*)
1986     AC_MSG_ERROR([Boehm's garbage collector was requested yet not supported in this configuration])
1987     ;;
1988 esac])
1990 # Make sure we only build Boehm's garbage collector if required.
1991 case ,${enable_languages},:${enable_objc_gc} in
1992   *,objc,*:yes)
1993     # Keep target-boehm-gc if requested for Objective-C.
1994     ;;
1995   *)
1996     # Otherwise remove target-boehm-gc depending on target-libjava.
1997     if echo " ${noconfigdirs} " | grep "target-libjava" >/dev/null 2>&1; then
1998       noconfigdirs="$noconfigdirs target-boehm-gc"
1999     fi
2000     ;;
2001 esac
2003 # Remove the entries in $skipdirs and $noconfigdirs from $configdirs,
2004 # $build_configdirs and $target_configdirs.
2005 # If we have the source for $noconfigdirs entries, add them to $notsupp.
2007 notsupp=""
2008 for dir in . $skipdirs $noconfigdirs ; do
2009   dirname=`echo $dir | sed -e s/target-//g -e s/build-//g`
2010   if test $dir != .  && echo " ${configdirs} " | grep " ${dir} " >/dev/null 2>&1; then
2011     configdirs=`echo " ${configdirs} " | sed -e "s/ ${dir} / /"`
2012     if test -r $srcdir/$dirname/configure ; then
2013       if echo " ${skipdirs} " | grep " ${dir} " >/dev/null 2>&1; then
2014         true
2015       else
2016         notsupp="$notsupp $dir"
2017       fi
2018     fi
2019   fi
2020   if test $dir != .  && echo " ${build_configdirs} " | grep " ${dir} " >/dev/null 2>&1; then
2021     build_configdirs=`echo " ${build_configdirs} " | sed -e "s/ ${dir} / /"`
2022     if test -r $srcdir/$dirname/configure ; then
2023       if echo " ${skipdirs} " | grep " ${dir} " >/dev/null 2>&1; then
2024         true
2025       else
2026         notsupp="$notsupp $dir"
2027       fi
2028     fi
2029   fi
2030   if test $dir != . && echo " ${target_configdirs} " | grep " ${dir} " >/dev/null 2>&1; then
2031     target_configdirs=`echo " ${target_configdirs} " | sed -e "s/ ${dir} / /"`
2032     if test -r $srcdir/$dirname/configure ; then
2033       if echo " ${skipdirs} " | grep " ${dir} " >/dev/null 2>&1; then
2034         true
2035       else
2036         notsupp="$notsupp $dir"
2037       fi
2038     fi
2039   fi
2040 done
2042 # Sometimes the tools are distributed with libiberty but with no other
2043 # libraries.  In that case, we don't want to build target-libiberty.
2044 # Don't let libgcc imply libiberty either.
2045 if test -n "${target_configdirs}" ; then
2046   libgcc=
2047   others=
2048   for i in `echo ${target_configdirs} | sed -e s/target-//g` ; do
2049     if test "$i" = "libgcc"; then
2050       libgcc=target-libgcc
2051     elif test "$i" != "libiberty" ; then
2052       if test -r $srcdir/$i/configure ; then
2053         others=yes;
2054         break;
2055       fi
2056     fi
2057   done
2058   if test -z "${others}" ; then
2059     target_configdirs=$libgcc
2060   fi
2063 # Quietly strip out all directories which aren't configurable in this tree.
2064 # This relies on all configurable subdirectories being autoconfiscated, which
2065 # is now the case.
2066 build_configdirs_all="$build_configdirs"
2067 build_configdirs=
2068 for i in ${build_configdirs_all} ; do
2069   j=`echo $i | sed -e s/build-//g` 
2070   if test -f ${srcdir}/$j/configure ; then
2071     build_configdirs="${build_configdirs} $i"
2072   fi
2073 done
2075 configdirs_all="$configdirs"
2076 configdirs=
2077 for i in ${configdirs_all} ; do
2078   if test -f ${srcdir}/$i/configure ; then
2079     configdirs="${configdirs} $i"
2080   fi
2081 done
2083 target_configdirs_all="$target_configdirs"
2084 target_configdirs=
2085 for i in ${target_configdirs_all} ; do
2086   j=`echo $i | sed -e s/target-//g` 
2087   if test -f ${srcdir}/$j/configure ; then
2088     target_configdirs="${target_configdirs} $i"
2089   fi
2090 done
2092 # Produce a warning message for the subdirs we can't configure.
2093 # This isn't especially interesting in the Cygnus tree, but in the individual
2094 # FSF releases, it's important to let people know when their machine isn't
2095 # supported by the one or two programs in a package.
2097 if test -n "${notsupp}" && test -z "${norecursion}" ; then
2098   # If $appdirs is non-empty, at least one of those directories must still
2099   # be configured, or we error out.  (E.g., if the gas release supports a
2100   # specified target in some subdirs but not the gas subdir, we shouldn't
2101   # pretend that all is well.)
2102   if test -n "$appdirs" ; then
2103     for dir in $appdirs ; do
2104       if test -r $dir/Makefile.in ; then
2105         if echo " ${configdirs} " | grep " ${dir} " >/dev/null 2>&1; then
2106           appdirs=""
2107           break
2108         fi
2109         if echo " ${target_configdirs} " | grep " target-${dir} " >/dev/null 2>&1; then
2110           appdirs=""
2111           break
2112         fi
2113       fi
2114     done
2115     if test -n "$appdirs" ; then
2116       echo "*** This configuration is not supported by this package." 1>&2
2117       exit 1
2118     fi
2119   fi
2120   # Okay, some application will build, or we don't care to check.  Still
2121   # notify of subdirs not getting built.
2122   echo "*** This configuration is not supported in the following subdirectories:" 1>&2
2123   echo "    ${notsupp}" 1>&2
2124   echo "    (Any other directories should still work fine.)" 1>&2
2127 case "$host" in
2128   *msdosdjgpp*)
2129     enable_gdbtk=no ;;
2130 esac
2132 # To find our prefix, in gcc_cv_tool_prefix.
2133 ACX_TOOL_DIRS
2135 copy_dirs=
2137 AC_ARG_WITH([build-sysroot], 
2138   [  --with-build-sysroot=SYSROOT
2139                           use sysroot as the system root during the build],
2140   [if test x"$withval" != x ; then
2141      SYSROOT_CFLAGS_FOR_TARGET="--sysroot=$withval"
2142    fi],
2143   [SYSROOT_CFLAGS_FOR_TARGET=])
2144 AC_SUBST(SYSROOT_CFLAGS_FOR_TARGET)
2146 AC_ARG_WITH([debug-prefix-map],
2147   [  --with-debug-prefix-map='A=B C=D ...'
2148                              map A to B, C to D ... in debug information],
2149   [if test x"$withval" != x; then
2150      DEBUG_PREFIX_CFLAGS_FOR_TARGET=
2151      for debug_map in $withval; do
2152        DEBUG_PREFIX_CFLAGS_FOR_TARGET="$DEBUG_PREFIX_CFLAGS_FOR_TARGET -fdebug-prefix-map=$debug_map"
2153      done
2154    fi],
2155   [DEBUG_PREFIX_CFLAGS_FOR_TARGET=])
2156 AC_SUBST(DEBUG_PREFIX_CFLAGS_FOR_TARGET)
2158 # During gcc bootstrap, if we use some random cc for stage1 then CFLAGS
2159 # might be empty or "-g".  We don't require a C++ compiler, so CXXFLAGS
2160 # might also be empty (or "-g", if a non-GCC C++ compiler is in the path).
2161 # We want to ensure that TARGET libraries (which we know are built with
2162 # gcc) are built with "-O2 -g", so include those options when setting
2163 # CFLAGS_FOR_TARGET and CXXFLAGS_FOR_TARGET.
2164 if test "x$CFLAGS_FOR_TARGET" = x; then
2165   CFLAGS_FOR_TARGET=$CFLAGS
2166   case " $CFLAGS " in
2167     *" -O2 "*) ;;
2168     *) CFLAGS_FOR_TARGET="-O2 $CFLAGS" ;;
2169   esac
2170   case " $CFLAGS " in
2171     *" -g "* | *" -g3 "*) ;;
2172     *) CFLAGS_FOR_TARGET="-g $CFLAGS" ;;
2173   esac
2175 AC_SUBST(CFLAGS_FOR_TARGET)
2177 if test "x$CXXFLAGS_FOR_TARGET" = x; then
2178   CXXFLAGS_FOR_TARGET=$CXXFLAGS
2179   case " $CXXFLAGS " in
2180     *" -O2 "*) ;;
2181     *) CXXFLAGS_FOR_TARGET="-O2 $CXXFLAGS" ;;
2182   esac
2183   case " $CXXFLAGS " in
2184     *" -g "* | *" -g3 "*) ;;
2185     *) CXXFLAGS_FOR_TARGET="-g $CXXFLAGS" ;;
2186   esac
2188 AC_SUBST(CXXFLAGS_FOR_TARGET)
2190 # Handle --with-headers=XXX.  If the value is not "yes", the contents of
2191 # the named directory are copied to $(tooldir)/sys-include.
2192 if test x"${with_headers}" != x && test x"${with_headers}" != xno ; then
2193   if test x${is_cross_compiler} = xno ; then
2194     echo 1>&2 '***' --with-headers is only supported when cross compiling
2195     exit 1
2196   fi
2197   if test x"${with_headers}" != xyes ; then
2198     x=${gcc_cv_tool_prefix}
2199     copy_dirs="${copy_dirs} ${with_headers} $x/${target_noncanonical}/sys-include"
2200   fi
2203 # Handle --with-libs=XXX.  If the value is not "yes", the contents of
2204 # the name directories are copied to $(tooldir)/lib.  Multiple directories
2205 # are permitted.
2206 if test x"${with_libs}" != x && test x"${with_libs}" != xno ; then
2207   if test x${is_cross_compiler} = xno ; then
2208     echo 1>&2 '***' --with-libs is only supported when cross compiling
2209     exit 1
2210   fi
2211   if test x"${with_libs}" != xyes ; then
2212     # Copy the libraries in reverse order, so that files in the first named
2213     # library override files in subsequent libraries.
2214     x=${gcc_cv_tool_prefix}
2215     for l in ${with_libs}; do
2216       copy_dirs="$l $x/${target_noncanonical}/lib ${copy_dirs}"
2217     done
2218   fi
2221 # Set with_gnu_as, with_gnu_ld, and with_system_zlib as appropriate.
2223 # This is done by determining whether or not the appropriate directory
2224 # is available, and by checking whether or not specific configurations
2225 # have requested that this magic not happen.
2227 # The command line options always override the explicit settings in 
2228 # configure.in, and the settings in configure.in override this magic.
2230 # If the default for a toolchain is to use GNU as and ld, and you don't 
2231 # want to do that, then you should use the --without-gnu-as and
2232 # --without-gnu-ld options for the configure script.  Similarly, if
2233 # the default is to use the included zlib and you don't want to do that,
2234 # you should use the --with-system-zlib option for the configure script.
2236 if test x${use_gnu_as} = x &&
2237    echo " ${configdirs} " | grep " gas " > /dev/null 2>&1 ; then
2238   with_gnu_as=yes
2239   extra_host_args="$extra_host_args --with-gnu-as"
2242 if test x${use_gnu_ld} = x &&
2243    echo " ${configdirs} " | egrep " (go)?ld " > /dev/null 2>&1 ; then
2244   with_gnu_ld=yes
2245   extra_host_args="$extra_host_args --with-gnu-ld"
2248 if test x${use_included_zlib} = x &&
2249    echo " ${configdirs} " | grep " zlib " > /dev/null 2>&1 ; then
2250   :
2251 else
2252   with_system_zlib=yes
2253   extra_host_args="$extra_host_args --with-system-zlib"
2256 # If using newlib, add --with-newlib to the extra_host_args so that gcc/configure
2257 # can detect this case.
2259 if test x${with_newlib} != xno && echo " ${target_configdirs} " | grep " target-newlib " > /dev/null 2>&1 ; then
2260   with_newlib=yes
2261   extra_host_args="$extra_host_args --with-newlib"
2264 # Handle ${copy_dirs}
2265 set fnord ${copy_dirs}
2266 shift
2267 while test $# != 0 ; do
2268   if test -f $2/COPIED && test x"`cat $2/COPIED`" = x"$1" ; then
2269     :
2270   else
2271     echo Copying $1 to $2
2273     # Use the install script to create the directory and all required
2274     # parent directories.
2275     if test -d $2 ; then
2276       :
2277     else
2278       echo >config.temp
2279       ${srcdir}/install-sh -c -m 644 config.temp $2/COPIED
2280     fi
2282     # Copy the directory, assuming we have tar.
2283     # FIXME: Should we use B in the second tar?  Not all systems support it.
2284     (cd $1; tar -cf - .) | (cd $2; tar -xpf -)
2286     # It is the responsibility of the user to correctly adjust all
2287     # symlinks.  If somebody can figure out how to handle them correctly
2288     # here, feel free to add the code.
2290     echo $1 > $2/COPIED
2291   fi
2292   shift; shift
2293 done
2295 # Determine a target-dependent exec_prefix that the installed
2296 # gcc will search in.  Keep this list sorted by triplet, with
2297 # the *-*-osname triplets last.
2298 md_exec_prefix=
2299 case "${target}" in
2300   alpha*-*-*vms*)
2301     md_exec_prefix=/gnu/lib/gcc-lib
2302     ;;
2303   i[[34567]]86-pc-msdosdjgpp*)
2304     md_exec_prefix=/dev/env/DJDIR/bin
2305     ;;
2306   i[[34567]]86-*-sco3.2v5*)
2307     if test $with_gnu_as = yes; then
2308       md_exec_prefix=/usr/gnu/bin
2309     else
2310       md_exec_prefix=/usr/ccs/bin/elf
2311     fi
2312     ;;
2314   mn10300-*-* | \
2315   powerpc-*-chorusos* | \
2316   powerpc*-*-eabi* | \
2317   powerpc*-*-sysv* | \
2318   powerpc*-*-kaos* | \
2319   s390x-ibm-tpf*)
2320     md_exec_prefix=/usr/ccs/bin
2321     ;;
2322   sparc64-*-elf*)
2323     ;;
2324   v850*-*-*)
2325     md_exec_prefix=/usr/ccs/bin
2326     ;;
2327   xtensa*-*-elf*)
2328     ;;
2330   *-*-beos* | \
2331   *-*-elf* | \
2332   *-*-hpux* | \
2333   *-*-netware* | \
2334   *-*-nto-qnx* | \
2335   *-*-rtems* | \
2336   *-*-solaris2* | \
2337   *-*-sysv[[45]]* | \
2338   *-*-vxworks* | \
2339   *-wrs-windiss)
2340     md_exec_prefix=/usr/ccs/bin
2341     ;;
2342 esac
2344 extra_arflags_for_target=
2345 extra_nmflags_for_target=
2346 extra_ranlibflags_for_target=
2347 target_makefile_frag=/dev/null
2348 case "${target}" in
2349   mep*-*-*)
2350     target_makefile_frag="config/mt-mep"
2351     ;;
2352   spu-*-*)
2353     target_makefile_frag="config/mt-spu"
2354     ;;
2355   mips*-sde-elf*)
2356     target_makefile_frag="config/mt-sde"
2357     ;;
2358   mipsisa*-*-elfoabi*)
2359     target_makefile_frag="config/mt-mips-elfoabi"
2360     ;;
2361   mips*-*-*linux* | mips*-*-gnu*)
2362     target_makefile_frag="config/mt-mips-gnu"
2363     ;;
2364   *-*-netware*)
2365     target_makefile_frag="config/mt-netware"
2366     ;;
2367   *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu | *-*-kopensolaris*-gnu)
2368     target_makefile_frag="config/mt-gnu"
2369     ;;
2370   *-*-aix4.[[3456789]]* | *-*-aix[[56789]].*)
2371     # nm and ar from AIX 4.3 and above require -X32_64 flag to all ar and nm 
2372     # commands to handle both 32-bit and 64-bit objects.  These flags are
2373     # harmless if we're using GNU nm or ar.
2374     extra_arflags_for_target=" -X32_64"
2375     extra_nmflags_for_target=" -B -X32_64"
2376     ;;
2377   *-*-darwin[[3-9]]*)
2378     # ranlib before Darwin10 requires the -c flag to look at common symbols.
2379     extra_ranlibflags_for_target=" -c"
2380     ;;
2381   mips*-*-pe | sh*-*-pe | *arm-wince-pe)
2382     target_makefile_frag="config/mt-wince"
2383     ;;
2384 esac
2386 alphaieee_frag=/dev/null
2387 case $target in
2388   alpha*-*-*)
2389     # This just makes sure to use the -mieee option to build target libs.
2390     # This should probably be set individually by each library.
2391     alphaieee_frag="config/mt-alphaieee"
2392     ;;
2393 esac
2395 # If --enable-target-optspace always use -Os instead of -O2 to build
2396 # the target libraries, similarly if it is not specified, use -Os
2397 # on selected platforms.
2398 ospace_frag=/dev/null
2399 case "${enable_target_optspace}:${target}" in
2400   yes:*)
2401     ospace_frag="config/mt-ospace"
2402     ;;
2403   :d30v-*)
2404     ospace_frag="config/mt-d30v"
2405     ;;
2406   :m32r-* | :d10v-* | :fr30-*)
2407     ospace_frag="config/mt-ospace"
2408     ;;
2409   no:* | :*)
2410     ;;
2411   *)
2412     echo "*** bad value \"${enable_target_optspace}\" for --enable-target-optspace flag; ignored" 1>&2
2413     ;;
2414 esac
2416 # Default to using --with-stabs for certain targets.
2417 if test x${with_stabs} = x ; then
2418   case "${target}" in
2419   mips*-*-irix[[56]]*)
2420     ;;
2421   mips*-*-* | alpha*-*-osf*)
2422     with_stabs=yes;
2423     extra_host_args="${extra_host_args} --with-stabs"
2424     ;;
2425   esac
2428 # hpux11 in 64bit mode has libraries in a weird place.  Arrange to find
2429 # them automatically.
2430 case "${host}" in
2431   hppa*64*-*-hpux11*)   
2432     extra_host_args="$extra_host_args -x-libraries=/usr/lib/pa20_64 -x-includes=/usr/X11R6/include"
2433     ;;
2434 esac
2436 # Some systems (e.g., one of the i386-aix systems the gas testers are
2437 # using) don't handle "\$" correctly, so don't use it here.
2438 tooldir='${exec_prefix}'/${target_noncanonical}
2439 build_tooldir=${tooldir}
2441 # Create a .gdbinit file which runs the one in srcdir
2442 # and tells GDB to look there for source files.
2444 if test -r ${srcdir}/.gdbinit ; then
2445   case ${srcdir} in
2446     .) ;;
2447     *) cat > ./.gdbinit <<EOF
2448 # ${NO_EDIT}
2449 dir ${srcdir}
2450 dir .
2451 source ${srcdir}/.gdbinit
2453     ;;
2454   esac
2457 # Make sure that the compiler is able to generate an executable.  If it
2458 # can't, we are probably in trouble.  We don't care whether we can run the
2459 # executable--we might be using a cross compiler--we only care whether it
2460 # can be created.  At this point the main configure script has set CC.
2461 we_are_ok=no
2462 echo "int main () { return 0; }" > conftest.c
2463 ${CC} -o conftest ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} conftest.c
2464 if test $? = 0 ; then
2465   if test -s conftest || test -s conftest.exe ; then
2466     we_are_ok=yes
2467   fi
2468 fi 
2469 case $we_are_ok in
2470   no)
2471     echo 1>&2 "*** The command '${CC} -o conftest ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} conftest.c' failed."
2472     echo 1>&2 "*** You must set the environment variable CC to a working compiler."
2473     rm -f conftest*
2474     exit 1
2475     ;;
2476 esac
2477 rm -f conftest*
2479 # The Solaris /usr/ucb/cc compiler does not appear to work.
2480 case "${host}" in
2481   sparc-sun-solaris2*)
2482       CCBASE="`echo ${CC-cc} | sed 's/ .*$//'`"
2483       if test "`type $CCBASE | sed 's/^[[^/]]*//'`" = "/usr/ucb/cc" ; then
2484           could_use=
2485           test -d /opt/SUNWspro/bin && could_use="/opt/SUNWspro/bin"
2486           if test -d /opt/cygnus/bin ; then
2487               if test "$could_use" = "" ; then
2488                   could_use="/opt/cygnus/bin"
2489               else
2490                   could_use="$could_use or /opt/cygnus/bin"
2491               fi
2492           fi
2493         if test "$could_use" = "" ; then
2494             echo "Warning: compilation may fail because you're using"
2495             echo "/usr/ucb/cc.  You should change your PATH or CC "
2496             echo "variable and rerun configure."
2497         else
2498             echo "Warning: compilation may fail because you're using"
2499             echo "/usr/ucb/cc, when you should use the C compiler from"
2500             echo "$could_use.  You should change your"
2501             echo "PATH or CC variable and rerun configure."
2502         fi
2503       fi
2504   ;;
2505 esac
2507 # Decide which environment variable is used to find dynamic libraries.
2508 case "${host}" in
2509   *-*-hpux*) RPATH_ENVVAR=SHLIB_PATH ;;
2510   *-*-darwin* | *-*-rhapsody* ) RPATH_ENVVAR=DYLD_LIBRARY_PATH ;;
2511   *-*-mingw* | *-*-cygwin ) RPATH_ENVVAR=PATH ;;
2512   *) RPATH_ENVVAR=LD_LIBRARY_PATH ;;
2513 esac
2515 # On systems where the dynamic library environment variable is PATH,
2516 # gcc/ will put dynamic libraries into a subdirectory to avoid adding
2517 # built executables to PATH.
2518 if test "$RPATH_ENVVAR" = PATH; then
2519   GCC_SHLIB_SUBDIR=/shlib
2520 else
2521   GCC_SHLIB_SUBDIR=
2524 # Record target_configdirs and the configure arguments for target and
2525 # build configuration in Makefile.
2526 target_configdirs=`echo "${target_configdirs}" | sed -e 's/target-//g'`
2527 build_configdirs=`echo "${build_configdirs}" | sed -e 's/build-//g'`
2529 # If we are building libgomp, bootstrap it.
2530 if echo " ${target_configdirs} " | grep " libgomp " > /dev/null 2>&1 ; then
2531   bootstrap_target_libs=${bootstrap_target_libs}target-libgomp,
2534 # Determine whether gdb needs tk/tcl or not.
2535 # Use 'maybe' since enable_gdbtk might be true even if tk isn't available
2536 # and in that case we want gdb to be built without tk.  Ugh!
2537 # In fact I believe gdb is the *only* package directly dependent on tk,
2538 # so we should be able to put the 'maybe's in unconditionally and
2539 # leave out the maybe dependencies when enable_gdbtk is false.  I'm not
2540 # 100% sure that that's safe though.
2542 gdb_tk="maybe-all-tcl maybe-all-tk maybe-all-itcl maybe-all-libgui"
2543 case "$enable_gdbtk" in
2544   no)
2545     GDB_TK="" ;;
2546   yes)
2547     GDB_TK="${gdb_tk}" ;;
2548   *)
2549     # Only add the dependency on gdbtk when GDBtk is part of the gdb
2550     # distro.  Eventually someone will fix this and move Insight, nee
2551     # gdbtk to a separate directory.
2552     if test -d ${srcdir}/gdb/gdbtk ; then
2553       GDB_TK="${gdb_tk}"
2554     else
2555       GDB_TK=""
2556     fi
2557     ;;
2558 esac
2559 CONFIGURE_GDB_TK=`echo ${GDB_TK} | sed s/-all-/-configure-/g`
2560 INSTALL_GDB_TK=`echo ${GDB_TK} | sed s/-all-/-install-/g`
2562 # Strip out unwanted targets.
2564 # While at that, we remove Makefiles if we were started for recursive
2565 # configuration, so that the top-level Makefile reconfigures them,
2566 # like we used to do when configure itself was recursive.
2568 # Loop over modules.  We used to use the "$extrasub" feature from Autoconf
2569 # but now we're fixing up the Makefile ourselves with the additional
2570 # commands passed to AC_CONFIG_FILES.  Use separate variables
2571 # extrasub-{build,host,target} not because there is any reason to split
2572 # the substitutions up that way, but only to remain below the limit of
2573 # 99 commands in a script, for HP-UX sed.
2574 # Do not nest @if/@endif pairs, because configure will not warn you at all.
2576 AC_ARG_ENABLE([bootstrap],
2577 [  --enable-bootstrap      enable bootstrapping @<:@yes if native build@:>@],,
2578 enable_bootstrap=default)
2580 # Issue errors and warnings for invalid/strange bootstrap combinations.
2581 case "$configdirs" in
2582   *gcc*) have_compiler=yes ;;
2583   *) have_compiler=no ;;
2584 esac
2586 case "$have_compiler:$host:$target:$enable_bootstrap" in
2587   *:*:*:no) ;;
2589   # Default behavior.  Enable bootstrap if we have a compiler
2590   # and we are in a native configuration.
2591   yes:$build:$build:default)
2592     enable_bootstrap=yes ;;
2594   *:*:*:default)
2595     enable_bootstrap=no ;;
2597   # We have a compiler and we are in a native configuration, bootstrap is ok
2598   yes:$build:$build:yes)
2599     ;;
2601   # Other configurations, but we have a compiler.  Assume the user knows
2602   # what he's doing.
2603   yes:*:*:yes)
2604     AC_MSG_WARN([trying to bootstrap a cross compiler])
2605     ;;
2607   # No compiler: if they passed --enable-bootstrap explicitly, fail
2608   no:*:*:yes)
2609     AC_MSG_ERROR([cannot bootstrap without a compiler]) ;;
2611   # Fail if wrong command line
2612   *)
2613     AC_MSG_ERROR([invalid option for --enable-bootstrap])
2614     ;;
2615 esac
2617 case ",$enable_languages,:$ENABLE_BUILD_WITH_CXX:$enable_bootstrap" in
2618   *,c++,*:yes:yes) ;;
2619   *:yes:yes)
2620     AC_MSG_ERROR([bootstrapping with --enable-build-with-cxx requires c++ in --enable-languages])
2621     ;;
2622 esac
2624 case "$enable_bootstrap:$ENABLE_GOLD: $configdirs :,$stage1_languages," in
2625   yes:yes:*\ gold\ *:*,c++,*) ;;
2626   yes:yes:*\ gold\ *:*)
2627     AC_MSG_ERROR([in a combined tree, bootstrapping with --enable-gold requires c++ in stage1_languages])
2628     ;;
2629 esac
2631 # Adjust the toplevel makefile according to whether bootstrap was selected.
2632 case $enable_bootstrap in
2633   yes)
2634     bootstrap_suffix=bootstrap
2635     BUILD_CONFIG=bootstrap-debug
2636     ;;
2637   no)
2638     bootstrap_suffix=no-bootstrap
2639     BUILD_CONFIG=
2640     ;;
2641 esac
2643 AC_MSG_CHECKING(for default BUILD_CONFIG)
2645 AC_ARG_WITH([build-config],
2646   [--with-build-config='NAME NAME2...'
2647                           Use config/NAME.mk build configuration],
2648   [case $with_build_config in
2649    yes) with_build_config= ;;
2650    no) with_build_config= BUILD_CONFIG= ;;
2651    esac])
2653 if test "x${with_build_config}" != x; then
2654   BUILD_CONFIG=$with_build_config
2655 else
2656   case $BUILD_CONFIG in
2657   bootstrap-debug)
2658     if echo "int f (void) { return 0; }" > conftest.c &&
2659        ${CC} -c conftest.c &&
2660        mv conftest.o conftest.o.g0 &&
2661        ${CC} -c -g conftest.c &&
2662        mv conftest.o conftest.o.g &&
2663        ${srcdir}/contrib/compare-debug conftest.o.g0 conftest.o.g > /dev/null 2>&1; then
2664       :
2665     else
2666       BUILD_CONFIG=
2667     fi
2668     rm -f conftest.c conftest.o conftest.o.g0 conftest.o.g
2669     ;;
2670   esac
2672 AC_MSG_RESULT($BUILD_CONFIG)
2673 AC_SUBST(BUILD_CONFIG)
2675 extrasub_build=
2676 for module in ${build_configdirs} ; do
2677   if test -z "${no_recursion}" \
2678      && test -f ${build_subdir}/${module}/Makefile; then
2679     echo 1>&2 "*** removing ${build_subdir}/${module}/Makefile to force reconfigure"
2680     rm -f ${build_subdir}/${module}/Makefile
2681   fi
2682   extrasub_build="$extrasub_build
2683 /^@if build-$module\$/d
2684 /^@endif build-$module\$/d
2685 /^@if build-$module-$bootstrap_suffix\$/d
2686 /^@endif build-$module-$bootstrap_suffix\$/d"
2687 done
2688 extrasub_host=
2689 for module in ${configdirs} ; do
2690   if test -z "${no_recursion}"; then
2691     for file in stage*-${module}/Makefile prev-${module}/Makefile ${module}/Makefile; do
2692       if test -f ${file}; then
2693         echo 1>&2 "*** removing ${file} to force reconfigure"
2694         rm -f ${file}
2695       fi
2696     done
2697   fi
2698   extrasub_host="$extrasub_host
2699 /^@if $module\$/d
2700 /^@endif $module\$/d
2701 /^@if $module-$bootstrap_suffix\$/d
2702 /^@endif $module-$bootstrap_suffix\$/d"
2703 done
2704 extrasub_target=
2705 for module in ${target_configdirs} ; do
2706   if test -z "${no_recursion}" \
2707      && test -f ${target_subdir}/${module}/Makefile; then
2708     echo 1>&2 "*** removing ${target_subdir}/${module}/Makefile to force reconfigure"
2709     rm -f ${target_subdir}/${module}/Makefile
2710   fi
2712   # We only bootstrap target libraries listed in bootstrap_target_libs.
2713   case $bootstrap_target_libs in
2714     *,target-$module,*) target_bootstrap_suffix=$bootstrap_suffix ;;
2715     *) target_bootstrap_suffix=no-bootstrap ;;
2716   esac
2718   extrasub_target="$extrasub_target
2719 /^@if target-$module\$/d
2720 /^@endif target-$module\$/d
2721 /^@if target-$module-$target_bootstrap_suffix\$/d
2722 /^@endif target-$module-$target_bootstrap_suffix\$/d"
2723 done
2725 # Do the final fixup along with target modules.
2726 extrasub_target="$extrasub_target
2727 /^@if /,/^@endif /d"
2729 # Create the serialization dependencies.  This uses a temporary file.
2731 AC_ARG_ENABLE([serial-configure],
2732 [  --enable-serial-@<:@{host,target,build}-@:>@configure
2733                           force sequential configuration of
2734                           sub-packages for the host, target or build
2735                           machine, or all sub-packages])
2737 case ${enable_serial_configure} in
2738   yes)
2739     enable_serial_build_configure=yes
2740     enable_serial_host_configure=yes
2741     enable_serial_target_configure=yes
2742     ;;
2743 esac
2745 # These force 'configure's to be done one at a time, to avoid problems
2746 # with contention over a shared config.cache.
2747 rm -f serdep.tmp
2748 echo '# serdep.tmp' > serdep.tmp
2749 olditem=
2750 test "x${enable_serial_build_configure}" = xyes &&
2751 for item in ${build_configdirs} ; do
2752   case ${olditem} in
2753     "") ;;
2754     *) echo "configure-build-${item}: configure-build-${olditem}" >> serdep.tmp ;;
2755   esac
2756   olditem=${item}
2757 done
2758 olditem=
2759 test "x${enable_serial_host_configure}" = xyes &&
2760 for item in ${configdirs} ; do
2761   case ${olditem} in
2762     "") ;;
2763     *) echo "configure-${item}: configure-${olditem}" >> serdep.tmp ;;
2764   esac
2765   olditem=${item}
2766 done
2767 olditem=
2768 test "x${enable_serial_target_configure}" = xyes &&
2769 for item in ${target_configdirs} ; do
2770   case ${olditem} in
2771     "") ;;
2772     *) echo "configure-target-${item}: configure-target-${olditem}" >> serdep.tmp ;;
2773   esac
2774   olditem=${item}
2775 done
2776 serialization_dependencies=serdep.tmp
2777 AC_SUBST_FILE(serialization_dependencies)
2779 # Base args.  Strip norecursion, cache-file, srcdir, host, build,
2780 # target, nonopt, and variable assignments.  These are the ones we
2781 # might not want to pass down to subconfigures.  The exception being
2782 # --cache-file=/dev/null, which is used to turn off the use of cache
2783 # files altogether, and which should be passed on to subconfigures.
2784 # Also strip program-prefix, program-suffix, and program-transform-name,
2785 # so that we can pass down a consistent program-transform-name.
2786 baseargs=
2787 keep_next=no
2788 skip_next=no
2789 eval "set -- $ac_configure_args"
2790 for ac_arg
2792   if test X"$skip_next" = X"yes"; then
2793     skip_next=no
2794     continue
2795   fi
2796   if test X"$keep_next" = X"yes"; then
2797     case $ac_arg in
2798       *\'*)
2799         ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
2800     esac
2801     baseargs="$baseargs '$ac_arg'"
2802     keep_next=no
2803     continue
2804   fi
2806   # Handle separated arguments.  Based on the logic generated by
2807   # autoconf 2.59.
2808   case $ac_arg in
2809     *=* | --config-cache | -C | -disable-* | --disable-* \
2810       | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
2811       | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
2812       | -with-* | --with-* | -without-* | --without-* | --x)
2813       separate_arg=no
2814       ;;
2815     -*)
2816       separate_arg=yes
2817       ;;
2818     *)
2819       separate_arg=no
2820       ;;
2821   esac
2823   case "$ac_arg" in
2824     --cache-file=/dev/null | \
2825     -cache-file=/dev/null )
2826       # Handled here to avoid the test to skip args below.
2827       baseargs="$baseargs '$ac_arg'"
2828       # Assert: $separate_arg should always be no.
2829       keep_next=$separate_arg
2830       ;;
2831     --no*)
2832       continue
2833       ;;
2834     --c* | \
2835     --sr* | \
2836     --ho* | \
2837     --bu* | \
2838     --t* | \
2839     --program-* | \
2840     -cache_file* | \
2841     -srcdir* | \
2842     -host* | \
2843     -build* | \
2844     -target* | \
2845     -program-prefix* | \
2846     -program-suffix* | \
2847     -program-transform-name* )
2848       skip_next=$separate_arg
2849       continue
2850       ;;
2851     -*)
2852       # An option.  Add it.
2853       case $ac_arg in
2854         *\'*)
2855           ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
2856       esac
2857       baseargs="$baseargs '$ac_arg'"
2858       keep_next=$separate_arg
2859       ;;
2860     *)
2861       # Either a variable assignment, or a nonopt (triplet).  Don't
2862       # pass it down; let the Makefile handle this.
2863       continue
2864       ;;
2865   esac
2866 done
2867 # Remove the initial space we just introduced and, as these will be
2868 # expanded by make, quote '$'.
2869 baseargs=`echo "x$baseargs" | sed -e 's/^x *//' -e 's,\\$,$$,g'`
2871 # Add in --program-transform-name, after --program-prefix and
2872 # --program-suffix have been applied to it.  Autoconf has already
2873 # doubled dollar signs and backslashes in program_transform_name; we want
2874 # the backslashes un-doubled, and then the entire thing wrapped in single
2875 # quotes, because this will be expanded first by make and then by the shell. 
2876 # Also, because we want to override the logic in subdir configure scripts to
2877 # choose program_transform_name, replace any s,x,x, with s,y,y,.
2878 sed -e "s,\\\\\\\\,\\\\,g; s,','\\\\'',g; s/s,x,x,/s,y,y,/" <<EOF_SED > conftestsed.out
2879 ${program_transform_name}
2880 EOF_SED
2881 gcc_transform_name=`cat conftestsed.out`
2882 rm -f conftestsed.out
2883 baseargs="$baseargs --program-transform-name='${gcc_transform_name}'"
2884 if test "$silent" = yes; then
2885   baseargs="$baseargs --silent"
2887 baseargs="$baseargs --disable-option-checking"
2889 # Record and document user additions to sub configure arguments.
2890 AC_ARG_VAR([build_configargs],
2891            [additional configure arguments for build directories])
2892 AC_ARG_VAR([host_configargs],
2893            [additional configure arguments for host directories])
2894 AC_ARG_VAR([target_configargs],
2895            [additional configure arguments for target directories])
2897 # For the build-side libraries, we just need to pretend we're native,
2898 # and not use the same cache file.  Multilibs are neither needed nor
2899 # desired.
2900 build_configargs="$build_configargs --cache-file=../config.cache ${baseargs}"
2902 # For host modules, accept cache file option, or specification as blank.
2903 case "${cache_file}" in
2904 "") # empty
2905   cache_file_option="" ;;
2906 /* | [[A-Za-z]]:[[\\/]]* ) # absolute path
2907   cache_file_option="--cache-file=${cache_file}" ;;
2908 *) # relative path
2909   cache_file_option="--cache-file=../${cache_file}" ;;
2910 esac
2912 # Host dirs don't like to share a cache file either, horribly enough.
2913 # This seems to be due to autoconf 2.5x stupidity.
2914 host_configargs="$host_configargs --cache-file=./config.cache ${extra_host_args} ${baseargs}"
2916 target_configargs="$target_configargs ${baseargs}"
2918 # Passing a --with-cross-host argument lets the target libraries know
2919 # whether they are being built with a cross-compiler or being built
2920 # native.  However, it would be better to use other mechanisms to make the
2921 # sorts of decisions they want to make on this basis.  Please consider
2922 # this option to be deprecated.  FIXME.
2923 if test x${is_cross_compiler} = xyes ; then
2924   target_configargs="--with-cross-host=${host_noncanonical} ${target_configargs}"
2927 # Default to --enable-multilib.
2928 if test x${enable_multilib} = x ; then
2929   target_configargs="--enable-multilib ${target_configargs}"
2932 # Pass --with-newlib if appropriate.  Note that target_configdirs has
2933 # changed from the earlier setting of with_newlib.
2934 if test x${with_newlib} != xno && echo " ${target_configdirs} " | grep " newlib " > /dev/null 2>&1 && test -d ${srcdir}/newlib ; then
2935   target_configargs="--with-newlib ${target_configargs}"
2938 # Different target subdirs use different values of certain variables
2939 # (notably CXX).  Worse, multilibs use *lots* of different values.
2940 # Worse yet, autoconf 2.5x makes some of these 'precious', meaning that
2941 # it doesn't automatically accept command-line overrides of them.
2942 # This means it's not safe for target subdirs to share a cache file,
2943 # which is disgusting, but there you have it.  Hopefully this can be
2944 # fixed in future.  It's still worthwhile to use a cache file for each
2945 # directory.  I think.
2947 # Pass the appropriate --build, --host, --target and --cache-file arguments.
2948 # We need to pass --target, as newer autoconf's requires consistency
2949 # for target_alias and gcc doesn't manage it consistently.
2950 target_configargs="--cache-file=./config.cache ${target_configargs}"
2952 FLAGS_FOR_TARGET=
2953 case " $target_configdirs " in
2954  *" newlib "*)
2955   case " $target_configargs " in
2956   *" --with-newlib "*)
2957    case "$target" in
2958     *-cygwin*)
2959       FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -L$$r/$(TARGET_SUBDIR)/winsup -L$$r/$(TARGET_SUBDIR)/winsup/cygwin -L$$r/$(TARGET_SUBDIR)/winsup/w32api/lib -isystem $$s/winsup/include -isystem $$s/winsup/cygwin/include -isystem $$s/winsup/w32api/include'
2960       ;;
2961    esac
2963    # If we're not building GCC, don't discard standard headers.
2964    if test -d ${srcdir}/gcc; then
2965      FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -nostdinc'
2967      if test "${build}" != "${host}"; then
2968        # On Canadian crosses, CC_FOR_TARGET will have already been set
2969        # by `configure', so we won't have an opportunity to add -Bgcc/
2970        # to it.  This is right: we don't want to search that directory
2971        # for binaries, but we want the header files in there, so add
2972        # them explicitly.
2973        FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -isystem $$r/$(HOST_SUBDIR)/gcc/include -isystem $$r/$(HOST_SUBDIR)/gcc/include-fixed'
2975        # Someone might think of using the pre-installed headers on
2976        # Canadian crosses, in case the installed compiler is not fully
2977        # compatible with the compiler being built.  In this case, it
2978        # would be better to flag an error than risking having
2979        # incompatible object files being constructed.  We can't
2980        # guarantee that an error will be flagged, but let's hope the
2981        # compiler will do it, when presented with incompatible header
2982        # files.
2983      fi
2984    fi
2986    case "${target}-${is_cross_compiler}" in
2987    i[[3456789]]86-*-linux*-no)
2988       # Here host == target, so we don't need to build gcc,
2989       # so we don't want to discard standard headers.
2990       FLAGS_FOR_TARGET=`echo " $FLAGS_FOR_TARGET " | sed -e 's/ -nostdinc / /'`
2991       ;;
2992    *)
2993       # If we're building newlib, use its generic headers last, but search
2994       # for any libc-related directories first (so make it the last -B
2995       # switch).
2996       FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -B$$r/$(TARGET_SUBDIR)/newlib/ -isystem $$r/$(TARGET_SUBDIR)/newlib/targ-include -isystem $$s/newlib/libc/include'
2998       # If we're building libgloss, find the startup file, simulator library
2999       # and linker script.
3000       case " $target_configdirs " in
3001         *" libgloss "*)
3002         # Look for startup file, simulator library and maybe linker script.
3003         FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -B$$r/$(TARGET_SUBDIR)/libgloss/'"$libgloss_dir"
3004         # Look for libnosys.a in case the target needs it.
3005         FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -L$$r/$(TARGET_SUBDIR)/libgloss/libnosys'
3006         # Most targets have the linker script in the source directory.
3007         FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -L$$s/libgloss/'"$libgloss_dir"
3008         ;;
3009       esac
3010       ;;
3011    esac
3012    ;;
3013   esac
3014   ;;
3015 esac
3017 case "$target" in
3018   x86_64-*mingw* | *-w64-mingw*)
3019   # MinGW-w64 does not use newlib, nor does it use winsup. It may,
3020   # however, use a symlink named 'mingw' in ${prefix} .
3021     FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -L${prefix}/${target}/lib -L${prefix}/mingw/lib -isystem ${prefix}/${target}/include -isystem ${prefix}/mingw/include'
3022     ;;
3023   *-mingw*)
3024   # MinGW can't be handled as Cygwin above since it does not use newlib.
3025     FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -L$$r/$(TARGET_SUBDIR)/winsup/mingw -L$$r/$(TARGET_SUBDIR)/winsup/w32api/lib -isystem $$s/winsup/mingw/include -isystem $$s/winsup/w32api/include'
3026     ;;
3027 esac
3029 # Allow the user to override the flags for
3030 # our build compiler if desired.
3031 if test x"${build}" = x"${host}" ; then
3032   CFLAGS_FOR_BUILD=${CFLAGS_FOR_BUILD-${CFLAGS}}
3033   CXXFLAGS_FOR_BUILD=${CXXFLAGS_FOR_BUILD-${CXXFLAGS}}
3034   LDFLAGS_FOR_BUILD=${LDFLAGS_FOR_BUILD-${LDFLAGS}}
3037 # On Canadian crosses, we'll be searching the right directories for
3038 # the previously-installed cross compiler, so don't bother to add
3039 # flags for directories within the install tree of the compiler
3040 # being built; programs in there won't even run.
3041 if test "${build}" = "${host}" && test -d ${srcdir}/gcc; then
3042   # Search for pre-installed headers if nothing else fits.
3043   FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -B$(build_tooldir)/bin/ -B$(build_tooldir)/lib/ -isystem $(build_tooldir)/include -isystem $(build_tooldir)/sys-include'
3046 if test "x${use_gnu_ld}" = x &&
3047    echo " ${configdirs} " | grep " ld " > /dev/null ; then
3048   # Arrange for us to find uninstalled linker scripts.
3049   FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -L$$r/$(HOST_SUBDIR)/ld'
3052 # Search for other target-specific linker scripts and such.
3053 case "${target}" in
3054   mep*)
3055     FLAGS_FOR_TARGET="$FLAGS_FOR_TARGET -mlibrary"
3056     ;;
3057 esac
3059 # Makefile fragments.
3060 for frag in host_makefile_frag target_makefile_frag alphaieee_frag ospace_frag;
3062   eval fragval=\$$frag
3063   if test $fragval != /dev/null; then
3064     eval $frag=${srcdir}/$fragval
3065   fi
3066 done
3067 AC_SUBST_FILE(host_makefile_frag)
3068 AC_SUBST_FILE(target_makefile_frag)
3069 AC_SUBST_FILE(alphaieee_frag)
3070 AC_SUBST_FILE(ospace_frag)
3072 # Miscellanea: directories, flags, etc.
3073 AC_SUBST(RPATH_ENVVAR)
3074 AC_SUBST(GCC_SHLIB_SUBDIR)
3075 AC_SUBST(tooldir)
3076 AC_SUBST(build_tooldir)
3077 AC_SUBST(CONFIGURE_GDB_TK)
3078 AC_SUBST(GDB_TK)
3079 AC_SUBST(INSTALL_GDB_TK)
3081 # Build module lists & subconfigure args.
3082 AC_SUBST(build_configargs)
3083 AC_SUBST(build_configdirs)
3085 # Host module lists & subconfigure args.
3086 AC_SUBST(host_configargs)
3087 AC_SUBST(configdirs)
3088 AC_SUBST(target_configdirs)
3090 # Target module lists & subconfigure args.
3091 AC_SUBST(target_configargs)
3094 # Build tools.
3095 AC_SUBST(AR_FOR_BUILD)
3096 AC_SUBST(AS_FOR_BUILD)
3097 AC_SUBST(CC_FOR_BUILD)
3098 AC_SUBST(CFLAGS_FOR_BUILD)
3099 AC_SUBST(CXXFLAGS_FOR_BUILD)
3100 AC_SUBST(CXX_FOR_BUILD)
3101 AC_SUBST(DLLTOOL_FOR_BUILD)
3102 AC_SUBST(GCJ_FOR_BUILD)
3103 AC_SUBST(GFORTRAN_FOR_BUILD)
3104 AC_SUBST(GOC_FOR_BUILD)
3105 AC_SUBST(LDFLAGS_FOR_BUILD)
3106 AC_SUBST(LD_FOR_BUILD)
3107 AC_SUBST(NM_FOR_BUILD)
3108 AC_SUBST(RANLIB_FOR_BUILD)
3109 AC_SUBST(WINDMC_FOR_BUILD)
3110 AC_SUBST(WINDRES_FOR_BUILD)
3111 AC_SUBST(config_shell)
3113 # Generate default definitions for YACC, M4, LEX and other programs that run
3114 # on the build machine.  These are used if the Makefile can't locate these
3115 # programs in objdir.
3116 MISSING=`cd $ac_aux_dir && ${PWDCMD-pwd}`/missing
3118 AC_CHECK_PROGS([YACC], ['bison -y' byacc yacc], [$MISSING bison -y])
3119 case " $build_configdirs " in
3120   *" bison "*) YACC='$$r/$(BUILD_SUBDIR)/bison/tests/bison -y' ;;
3121   *" byacc "*) YACC='$$r/$(BUILD_SUBDIR)/byacc/byacc' ;;
3122 esac
3124 AC_CHECK_PROGS([BISON], [bison], [$MISSING bison])
3125 case " $build_configdirs " in
3126   *" bison "*) BISON='$$r/$(BUILD_SUBDIR)/bison/tests/bison' ;;
3127 esac
3129 AC_CHECK_PROGS([M4], [gm4 gnum4 m4], [$MISSING m4])
3130 case " $build_configdirs " in
3131   *" m4 "*) M4='$$r/$(BUILD_SUBDIR)/m4/m4' ;;
3132 esac
3134 AC_CHECK_PROGS([LEX], [flex lex], [$MISSING flex])
3135 case " $build_configdirs " in
3136   *" flex "*) LEX='$$r/$(BUILD_SUBDIR)/flex/flex' ;;
3137   *" lex "*) LEX='$$r/$(BUILD_SUBDIR)/lex/lex' ;;
3138 esac
3140 AC_CHECK_PROGS([FLEX], [flex], [$MISSING flex])
3141 case " $build_configdirs " in
3142   *" flex "*) FLEX='$$r/$(BUILD_SUBDIR)/flex/flex' ;;
3143 esac
3145 AC_CHECK_PROGS([MAKEINFO], makeinfo, [$MISSING makeinfo])
3146 case " $build_configdirs " in
3147   *" texinfo "*) MAKEINFO='$$r/$(BUILD_SUBDIR)/texinfo/makeinfo/makeinfo' ;;
3148   *)
3149 changequote(,)
3150     # For an installed makeinfo, we require it to be from texinfo 4.7 or
3151     # higher, else we use the "missing" dummy.
3152     if ${MAKEINFO} --version \
3153        | egrep 'texinfo[^0-9]*(4\.([7-9]|[1-9][0-9])|[5-9]|[1-9][0-9])' >/dev/null 2>&1; then
3154       :
3155     else
3156       MAKEINFO="$MISSING makeinfo"
3157     fi
3158     ;;
3159 changequote([,])
3160 esac
3162 # FIXME: expect and dejagnu may become build tools?
3164 AC_CHECK_PROGS(EXPECT, expect, expect)
3165 case " $configdirs " in
3166   *" expect "*)
3167     test $host = $build && EXPECT='$$r/$(HOST_SUBDIR)/expect/expect'
3168     ;;
3169 esac
3171 AC_CHECK_PROGS(RUNTEST, runtest, runtest)
3172 case " $configdirs " in
3173   *" dejagnu "*)
3174     test $host = $build && RUNTEST='$$s/$(HOST_SUBDIR)/dejagnu/runtest'
3175     ;;
3176 esac
3179 # Host tools.
3180 NCN_STRICT_CHECK_TOOLS(AR, ar)
3181 NCN_STRICT_CHECK_TOOLS(AS, as)
3182 NCN_STRICT_CHECK_TOOLS(DLLTOOL, dlltool)
3183 NCN_STRICT_CHECK_TOOLS(LD, ld)
3184 NCN_STRICT_CHECK_TOOLS(LIPO, lipo)
3185 NCN_STRICT_CHECK_TOOLS(NM, nm)
3186 NCN_STRICT_CHECK_TOOLS(RANLIB, ranlib, true)
3187 NCN_STRICT_CHECK_TOOLS(STRIP, strip, true)
3188 NCN_STRICT_CHECK_TOOLS(WINDRES, windres)
3189 NCN_STRICT_CHECK_TOOLS(WINDMC, windmc)
3190 NCN_STRICT_CHECK_TOOLS(OBJCOPY, objcopy)
3191 NCN_STRICT_CHECK_TOOLS(OBJDUMP, objdump)
3192 AC_SUBST(CC)
3193 AC_SUBST(CXX)
3194 AC_SUBST(CFLAGS)
3195 AC_SUBST(CXXFLAGS)
3197 # Target tools.
3198 AC_ARG_WITH([build-time-tools], 
3199   [  --with-build-time-tools=PATH
3200                           use given path to find target tools during the build],
3201   [case x"$withval" in
3202      x/*) ;;
3203      *)
3204        with_build_time_tools=
3205        AC_MSG_WARN([argument to --with-build-time-tools must be an absolute path])
3206        ;;
3207    esac],
3208   [with_build_time_tools=])
3210 NCN_STRICT_CHECK_TARGET_TOOLS(CC_FOR_TARGET, cc gcc)
3211 NCN_STRICT_CHECK_TARGET_TOOLS(CXX_FOR_TARGET, c++ g++ cxx gxx)
3212 NCN_STRICT_CHECK_TARGET_TOOLS(GCC_FOR_TARGET, gcc, ${CC_FOR_TARGET})
3213 NCN_STRICT_CHECK_TARGET_TOOLS(GCJ_FOR_TARGET, gcj)
3214 NCN_STRICT_CHECK_TARGET_TOOLS(GFORTRAN_FOR_TARGET, gfortran)
3215 NCN_STRICT_CHECK_TARGET_TOOLS(GOC_FOR_TARGET, gccgo)
3217 ACX_CHECK_INSTALLED_TARGET_TOOL(AR_FOR_TARGET, ar)
3218 ACX_CHECK_INSTALLED_TARGET_TOOL(AS_FOR_TARGET, as)
3219 ACX_CHECK_INSTALLED_TARGET_TOOL(DLLTOOL_FOR_TARGET, dlltool)
3220 ACX_CHECK_INSTALLED_TARGET_TOOL(LD_FOR_TARGET, ld)
3221 ACX_CHECK_INSTALLED_TARGET_TOOL(LIPO_FOR_TARGET, lipo)
3222 ACX_CHECK_INSTALLED_TARGET_TOOL(NM_FOR_TARGET, nm)
3223 ACX_CHECK_INSTALLED_TARGET_TOOL(OBJDUMP_FOR_TARGET, objdump)
3224 ACX_CHECK_INSTALLED_TARGET_TOOL(RANLIB_FOR_TARGET, ranlib)
3225 ACX_CHECK_INSTALLED_TARGET_TOOL(STRIP_FOR_TARGET, strip)
3226 ACX_CHECK_INSTALLED_TARGET_TOOL(WINDRES_FOR_TARGET, windres)
3227 ACX_CHECK_INSTALLED_TARGET_TOOL(WINDMC_FOR_TARGET, windmc)
3229 RAW_CXX_FOR_TARGET="$CXX_FOR_TARGET"
3231 GCC_TARGET_TOOL(ar, AR_FOR_TARGET, AR, [binutils/ar])
3232 GCC_TARGET_TOOL(as, AS_FOR_TARGET, AS, [gas/as-new])
3233 GCC_TARGET_TOOL(cc, CC_FOR_TARGET, CC, [gcc/xgcc -B$$r/$(HOST_SUBDIR)/gcc/])
3234 GCC_TARGET_TOOL(c++, CXX_FOR_TARGET, CXX,
3235                 [gcc/g++ -B$$r/$(HOST_SUBDIR)/gcc/ -nostdinc++ `test ! -f $$r/$(TARGET_SUBDIR)/libstdc++-v3/scripts/testsuite_flags || $(SHELL) $$r/$(TARGET_SUBDIR)/libstdc++-v3/scripts/testsuite_flags --build-includes` -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs],
3236                 c++)
3237 GCC_TARGET_TOOL(c++ for libstdc++, RAW_CXX_FOR_TARGET, CXX,
3238                 [gcc/xgcc -shared-libgcc -B$$r/$(HOST_SUBDIR)/gcc -nostdinc++ -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs],
3239                 c++)
3240 GCC_TARGET_TOOL(dlltool, DLLTOOL_FOR_TARGET, DLLTOOL, [binutils/dlltool])
3241 GCC_TARGET_TOOL(gcc, GCC_FOR_TARGET, , [gcc/xgcc -B$$r/$(HOST_SUBDIR)/gcc/])
3242 GCC_TARGET_TOOL(gcj, GCJ_FOR_TARGET, GCJ,
3243                 [gcc/gcj -B$$r/$(HOST_SUBDIR)/gcc/], java)
3244 GCC_TARGET_TOOL(gfortran, GFORTRAN_FOR_TARGET, GFORTRAN,
3245                 [gcc/gfortran -B$$r/$(HOST_SUBDIR)/gcc/], fortran)
3246 GCC_TARGET_TOOL(gccgo, GOC_FOR_TARGET, GOC,
3247                 [gcc/gccgo -B$$r/$(HOST_SUBDIR)/gcc/], go)
3248 GCC_TARGET_TOOL(ld, LD_FOR_TARGET, LD, [ld/ld-new])
3249 GCC_TARGET_TOOL(lipo, LIPO_FOR_TARGET, LIPO)
3250 GCC_TARGET_TOOL(nm, NM_FOR_TARGET, NM, [binutils/nm-new])
3251 GCC_TARGET_TOOL(objdump, OBJDUMP_FOR_TARGET, OBJDUMP, [binutils/objdump])
3252 GCC_TARGET_TOOL(ranlib, RANLIB_FOR_TARGET, RANLIB, [binutils/ranlib])
3253 GCC_TARGET_TOOL(strip, STRIP_FOR_TARGET, STRIP, [binutils/strip-new])
3254 GCC_TARGET_TOOL(windres, WINDRES_FOR_TARGET, WINDRES, [binutils/windres])
3255 GCC_TARGET_TOOL(windmc, WINDMC_FOR_TARGET, WINDMC, [binutils/windmc])
3257 AC_SUBST(FLAGS_FOR_TARGET)
3258 AC_SUBST(RAW_CXX_FOR_TARGET)
3260 # Certain tools may need extra flags.
3261 AR_FOR_TARGET=${AR_FOR_TARGET}${extra_arflags_for_target}
3262 RANLIB_FOR_TARGET=${RANLIB_FOR_TARGET}${extra_ranlibflags_for_target}
3263 NM_FOR_TARGET=${NM_FOR_TARGET}${extra_nmflags_for_target}
3265 # When building target libraries, except in a Canadian cross, we use
3266 # the same toolchain as the compiler we just built.
3267 COMPILER_AS_FOR_TARGET='$(AS_FOR_TARGET)'
3268 COMPILER_LD_FOR_TARGET='$(LD_FOR_TARGET)'
3269 COMPILER_NM_FOR_TARGET='$(NM_FOR_TARGET)'
3270 if test $host = $build; then
3271   case " $configdirs " in
3272     *" gcc "*)
3273       COMPILER_AS_FOR_TARGET='$$r/$(HOST_SUBDIR)/gcc/as'
3274       COMPILER_LD_FOR_TARGET='$$r/$(HOST_SUBDIR)/gcc/collect-ld'
3275       COMPILER_NM_FOR_TARGET='$$r/$(HOST_SUBDIR)/gcc/nm'${extra_nmflags_for_target}
3276       ;;
3277   esac
3280 AC_SUBST(COMPILER_AS_FOR_TARGET)
3281 AC_SUBST(COMPILER_LD_FOR_TARGET)
3282 AC_SUBST(COMPILER_NM_FOR_TARGET)
3284 AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
3285 AC_ARG_ENABLE(maintainer-mode,
3286 [  --enable-maintainer-mode enable make rules and dependencies not useful
3287                           (and sometimes confusing) to the casual installer],
3288       USE_MAINTAINER_MODE=$enableval,
3289       USE_MAINTAINER_MODE=no)
3290 AC_MSG_RESULT($USE_MAINTAINER_MODE)
3291 AC_SUBST(MAINTAINER_MODE_TRUE)
3292 AC_SUBST(MAINTAINER_MODE_FALSE)
3293 if test "$USE_MAINTAINER_MODE" = yes; then
3294   MAINTAINER_MODE_TRUE=
3295   MAINTAINER_MODE_FALSE='#'
3296 else
3297   MAINTAINER_MODE_TRUE='#'
3298   MAINTAINER_MODE_FALSE=
3299 fi      
3300 MAINT=$MAINTAINER_MODE_TRUE
3301 AC_SUBST(MAINT)dnl
3303 # ---------------------
3304 # GCC bootstrap support
3305 # ---------------------
3307 # Stage specific cflags for build.
3308 stage1_cflags="-g"
3309 case $build in
3310   vax-*-*)
3311     case ${GCC} in
3312       yes) stage1_cflags="-g -Wa,-J" ;;
3313       *) stage1_cflags="-g -J" ;;
3314     esac ;;
3315 esac
3317 # This is aimed to mimic bootstrap with a non-GCC compiler to catch problems.
3318 if test "$GCC" = yes -a "$ENABLE_BUILD_WITH_CXX" != yes; then
3319   saved_CFLAGS="$CFLAGS"
3321   # Pass -fkeep-inline-functions for stage 1 if the GCC version supports it.
3322   CFLAGS="$CFLAGS -fkeep-inline-functions"
3323   AC_MSG_CHECKING([whether -fkeep-inline-functions is supported])
3324   AC_TRY_COMPILE([
3325 #if (__GNUC__ < 3) \
3326     || (__GNUC__ == 3 && (__GNUC_MINOR__ < 3 \
3327                           || (__GNUC_MINOR__ == 3 && __GNUC_PATCHLEVEL__ < 1)))
3328 #error http://gcc.gnu.org/PR29382
3329 #endif
3330     ],,
3331     [AC_MSG_RESULT([yes]); stage1_cflags="$stage1_cflags -fkeep-inline-functions"],
3332     [AC_MSG_RESULT([no])])
3334   CFLAGS="$saved_CFLAGS"
3337 AC_SUBST(stage1_cflags)
3339 # Enable --enable-checking in stage1 of the compiler.
3340 AC_ARG_ENABLE(stage1-checking,
3341 [  --enable-stage1-checking@<:@=all@:>@   choose additional checking for stage1
3342                           of the compiler],
3343 [stage1_checking=--enable-checking=${enable_stage1_checking}],
3344 [if test "x$enable_checking" = xno || test "x$enable_checking" = x; then
3345   stage1_checking=--enable-checking=yes,types
3346 else
3347   stage1_checking=--enable-checking=$enable_checking,types
3348 fi])
3349 AC_SUBST(stage1_checking)
3351 # Enable -Werror in bootstrap stage2 and later.
3352 AC_ARG_ENABLE(werror,
3353 [  --enable-werror         enable -Werror in bootstrap stage2 and later], [],
3354 [if test -d ${srcdir}/gcc && test x"`cat $srcdir/gcc/DEV-PHASE`" = xexperimental; then
3355   enable_werror=yes
3356 else
3357   enable_werror=no
3358 fi])
3359 case ${enable_werror} in
3360   yes) stage2_werror_flag="--enable-werror-always" ;;
3361   *) stage2_werror_flag="" ;;
3362 esac
3363 AC_SUBST(stage2_werror_flag)
3365 # Specify what files to not compare during bootstrap.
3367 compare_exclusions="gcc/cc*-checksum\$(objext) | gcc/ada/*tools/*"
3368 case "$target" in
3369   hppa*64*-*-hpux*) ;;
3370   hppa*-*-hpux*) compare_exclusions="gcc/cc*-checksum\$(objext) | */libgcc/lib2funcs* | gcc/ada/*tools/*" ;;
3371 esac
3372 case " $configdirs " in
3373 *" ppl "*) compare_exclusions="$compare_exclusions | ppl/src/ppl-config.o" ;;
3374 esac
3375 AC_SUBST(compare_exclusions)
3377 AC_CONFIG_FILES([Makefile],
3378   [sed "$extrasub_build" Makefile |
3379    sed "$extrasub_host" |
3380    sed "$extrasub_target" > mf$$
3381    mv -f mf$$ Makefile],
3382   [extrasub_build="$extrasub_build"
3383    extrasub_host="$extrasub_host"
3384    extrasub_target="$extrasub_target"])
3385 AC_OUTPUT