1 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
2 # 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012,
3 # 2014, 2015, 2016, 2019, 2020 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(config/gcc-plugin.m4)
27 m4_include([libtool.m4])
28 m4_include([ltoptions.m4])
29 m4_include([ltsugar.m4])
30 m4_include([ltversion.m4])
31 m4_include([lt~obsolete.m4])
32 m4_include([config/isl.m4])
34 AC_INIT(move-if-change)
35 AC_DISABLE_OPTION_CHECKING
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" "$@"
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'/"` ;;
54 # Add the quoted argument to the list.
55 TOPLEVEL_CONFIGURE_ARGUMENTS="$TOPLEVEL_CONFIGURE_ARGUMENTS $ac_arg"
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
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
74 test "$host_noncanonical" = "$target_noncanonical" &&
75 test "$program_prefix$program_suffix$program_transform_name" = \
77 program_transform_name=s,y,y,
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.
92 srcpwd=`cd ${srcdir} ; ${PWDCMD-pwd}`
94 # We pass INSTALL explicitly to sub-makes. Make sure that it is not
96 if test "$INSTALL" = "${srcdir}/install-sh -c"; then
97 INSTALL="${srcpwd}/install-sh -c"
100 # Set srcdir to "." if that's what it is.
101 # This is important for multilib support.
103 if test "${pwd}" = "${srcpwd}" ; then
111 ### To add a new directory to the tree, first choose whether it is a target
112 ### or a host dependent tool. Then put it into the appropriate list
113 ### (library or tools, host or target), doing a dependency sort.
115 # Subdirs will be configured in the order listed in build_configdirs,
116 # configdirs, or target_configdirs; see the serialization section below.
118 # Dependency sorting is only needed when *configuration* must be done in
119 # a particular order. In all cases a dependency should be specified in
120 # the Makefile, whether or not it's implicitly specified here.
122 # Double entries in build_configdirs, configdirs, or target_configdirs may
123 # cause circular dependencies and break everything horribly.
125 # these library is used by various programs built for the build
128 build_libs="build-libiberty build-libcpp"
130 # these tools are built for the build environment
131 build_tools="build-texinfo build-flex build-bison build-m4 build-fixincludes"
133 # these libraries are used by various programs built for the host environment
135 host_libs="intl libiberty opcodes bfd readline tcl tk itcl libgui zlib libbacktrace libcpp libdecnumber gmp mpfr mpc isl libelf libiconv libctf"
137 # these tools are built for the host environment
138 # Note, the powerpc-eabi build depends on sim occurring before gdb in order to
139 # know that we are building the simulator.
140 # binutils, gas and ld appear in that order because it makes sense to run
141 # "make check" in that particular order.
142 # If --enable-gold is used, "gold" may replace "ld".
143 host_tools="texinfo flex bison binutils gas ld fixincludes gcc cgen sid sim gdb gdbserver gprof etc expect dejagnu m4 utils guile fastjar gnattools libcc1 gotools"
145 # these libraries are built for the target environment, and are built after
146 # the host libraries and the host tools (which may be a cross compiler)
147 # Note that libiberty is not a target library.
148 target_libraries="target-libgcc \
149 target-libbacktrace \
153 target-liboffloadmic \
157 target-libstdc++-v3 \
158 target-libsanitizer \
168 # these tools are built using the target libraries, and are intended to
169 # run only in the target environment
171 # note: any program that *uses* libraries that are in the "target_libraries"
172 # list belongs in this list.
174 target_tools="target-rda"
176 ################################################################################
178 ## All tools belong in one of the four categories, and are assigned above
179 ## We assign ${configdirs} this way to remove all embedded newlines. This
180 ## is important because configure will choke if they ever get through.
181 ## ${configdirs} is directories we build using the host tools.
182 ## ${target_configdirs} is directories we build using the target tools.
183 configdirs=`echo ${host_libs} ${host_tools}`
184 target_configdirs=`echo ${target_libraries} ${target_tools}`
185 build_configdirs=`echo ${build_libs} ${build_tools}`
187 m4_divert_text([PARSE_ARGS],
190 m4_pushdef([AS_MESSAGE_LOG_FD], [])dnl
191 AC_MSG_ERROR([path to source, $srcdir, contains spaces])
192 m4_popdef([AS_MESSAGE_LOG_FD])dnl
195 ac_subdirs_all=`cd $srcdir && echo */configure | sed 's,/configure,,g'`
198 ################################################################################
200 srcname="gnu development package"
202 # This gets set non-empty for some net releases of packages.
205 # Define is_cross_compiler to save on calls to 'test'.
207 if test x"${host}" = x"${target}" ; then
210 is_cross_compiler=yes
213 # Find the build and target subdir names.
215 # Be sure to cover against remnants of an in-tree build.
216 if test $srcdir != . && test -d $srcdir/host-${host_noncanonical}; then
217 AC_MSG_ERROR([building out of tree but $srcdir contains host-${host_noncanonical}.
218 Use a pristine source tree when building in a separate tree])
221 # Skipdirs are removed silently.
223 # Noconfigdirs are removed loudly.
227 # Make sure we don't let GNU ld be added if we didn't want it.
228 if test x$with_gnu_ld = xno ; then
230 noconfigdirs="$noconfigdirs ld gold"
234 # Make sure we don't let GNU as be added if we didn't want it.
235 if test x$with_gnu_as = xno ; then
237 noconfigdirs="$noconfigdirs gas"
241 AC_ARG_WITH(system-zlib,
242 [AS_HELP_STRING([--with-system-zlib], [use installed libz])])
243 # Make sure we don't let ZLIB be added if we didn't want it.
244 if test x$with_system_zlib = xyes ; then
246 noconfigdirs="$noconfigdirs zlib"
250 [AS_HELP_STRING([--with-zstd], [Support zstd compressed debug sections (default=auto)])])
252 # Don't compile the bundled readline/libreadline.a if --with-system-readline
254 if test x$with_system_readline = xyes ; then
255 noconfigdirs="$noconfigdirs readline"
258 # some tools are so dependent upon X11 that if we're not building with X,
259 # it's not even worth trying to configure, much less build, that tool.
262 yes | "") ;; # the default value for this tree is that X11 is available
264 skipdirs="${skipdirs} tk itcl libgui"
265 # We won't be able to build gdbtk without X.
268 *) echo "*** bad value \"${with_x}\" for -with-x flag; ignored" 1>&2 ;;
271 # Some are only suitable for cross toolchains.
272 # Remove these if host=target.
273 cross_only="target-libgloss target-newlib target-opcodes"
275 case $is_cross_compiler in
276 no) skipdirs="${skipdirs} ${cross_only}" ;;
279 # If both --with-headers and --with-libs are specified, default to
281 if test x"${with_headers}" != x && test x"${with_headers}" != xno \
282 && test x"${with_libs}" != x && test x"${with_libs}" != xno ; then
283 if test x"${with_newlib}" = x ; then
288 # Recognize --with-newlib/--without-newlib.
289 case ${with_newlib} in
290 no) skipdirs="${skipdirs} target-newlib" ;;
291 yes) skipdirs=`echo " ${skipdirs} " | sed -e 's/ target-newlib / /'` ;;
294 AC_ARG_ENABLE(as-accelerator-for,
295 [AS_HELP_STRING([--enable-as-accelerator-for=ARG],
296 [build as offload target compiler.
297 Specify offload host triple by ARG])])
299 AC_ARG_ENABLE(offload-targets,
300 [AS_HELP_STRING([--enable-offload-targets=LIST],
301 [enable offloading to devices from comma-separated LIST of
302 TARGET[=DIR]. Use optional path to find offload target compiler
305 if test x"$enable_offload_targets" = x; then
306 AC_MSG_ERROR([no offload targets specified])
308 ], [enable_offload_targets=])
310 # Handle --enable-gold, --enable-ld.
311 # --disable-gold [--enable-ld]
312 # Build only ld. Default option.
313 # --enable-gold [--enable-ld]
314 # Build both gold and ld. Install gold as "ld.gold", install ld
315 # as "ld.bfd" and "ld".
316 # --enable-gold=default [--enable-ld]
317 # Build both gold and ld. Install gold as "ld.gold" and "ld",
318 # install ld as "ld.bfd".
319 # --enable-gold[=default] --disable-ld
320 # Build only gold, which is then installed as both "ld.gold" and "ld".
321 # --enable-gold --enable-ld=default
322 # Build both gold (installed as "ld.gold") and ld (installed as "ld"
324 # In other words, ld is default
325 # --enable-gold=default --enable-ld=default
330 [AS_HELP_STRING([[--enable-gold[=ARG]]],
331 [build gold @<:@ARG={default,yes,no}@:>@])],
332 ENABLE_GOLD=$enableval,
334 case "${ENABLE_GOLD}" in
336 # Check for ELF target.
339 *-*-elf* | *-*-sysv4* | *-*-unixware* | *-*-eabi* | hppa*64*-*-hpux* \
340 | *-*-linux* | *-*-gnu* | frv-*-uclinux* | *-*-irix5* | *-*-irix6* \
341 | *-*-netbsd* | *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* \
342 | *-*-solaris2* | *-*-nto* | *-*-nacl* | *-*-haiku*)
344 *-*-linux*aout* | *-*-linux*oldld*)
352 if test "$is_elf" = "yes"; then
353 # Check for target supported by gold.
355 i?86-*-* | x86_64-*-* | sparc*-*-* | powerpc*-*-* | arm*-*-* \
356 | aarch64*-*-* | tilegx*-*-* | mips*-*-* | s390*-*-*)
357 configdirs="$configdirs gold"
358 if test x${ENABLE_GOLD} = xdefault; then
369 AC_MSG_ERROR([invalid --enable-gold argument])
374 [AS_HELP_STRING([[--enable-ld[=ARG]]],
375 [build ld @<:@ARG={default,yes,no}@:>@])],
376 ENABLE_LD=$enableval,
379 case "${ENABLE_LD}" in
381 if test x${default_ld} != x; then
382 AC_MSG_ERROR([either gold or ld can be the default ld])
388 if test x${ENABLE_GOLD} != xyes; then
389 AC_MSG_WARN([neither ld nor gold are enabled])
391 configdirs=`echo " ${configdirs} " | sed -e 's/ ld / /'`
394 AC_MSG_ERROR([invalid --enable-ld argument])
398 AC_ARG_ENABLE(gprofng,
399 [AS_HELP_STRING([[--enable-gprofng[=ARG]]],
400 [build gprofng @<:@ARG={yes,no}@:>@])],
401 enable_gprofng=$enableval,
403 if test "$enable_gprofng" = "yes"; then
405 x86_64-*-linux* | i?86-*-linux* | aarch64-*-linux*)
406 configdirs="$configdirs gprofng"
413 # Decide the default method for compressing debug sections.
414 # Provide a configure time option to override our default.
415 AC_ARG_ENABLE(compressed_debug_sections,
416 [AS_HELP_STRING([--enable-compressed-debug-sections={all,gas,gold,ld,none}],
417 [Enable compressed debug sections for gas, gold or ld by
420 if test x"$enable_compressed_debug_sections" = xyes; then
421 AC_MSG_ERROR([no program with compressed debug sections specified])
423 ], [enable_compressed_debug_sections=])
425 # Configure extra directories which are host specific
429 configdirs="$configdirs libtermcap" ;;
432 # A target can indicate whether a language isn't supported for some reason.
433 # Only spaces may be used in this macro; not newlines or tabs.
434 unsupported_languages=
436 # Remove more programs from consideration, based on the host or
437 # target this usually means that a port of the program doesn't
441 i[[3456789]]86-*-msdosdjgpp*)
442 noconfigdirs="$noconfigdirs tcl tk itcl"
446 # Default to --disable-year2038 until we can handle differences between
447 # projects that use gnulib (which understands year 2038) and projects that
449 AC_ARG_ENABLE(year2038,
450 AS_HELP_STRING([--enable-year2038],
451 [enable support for timestamps past the year 2038]),
452 ENABLE_YEAR2038=$enableval,
455 if test "${ENABLE_YEAR2038}" = "no" ; then
459 AC_ARG_ENABLE(libquadmath,
460 AS_HELP_STRING([--disable-libquadmath],
461 [do not build libquadmath directory]),
462 ENABLE_LIBQUADMATH=$enableval,
463 ENABLE_LIBQUADMATH=yes)
464 if test "${ENABLE_LIBQUADMATH}" = "no" ; then
465 noconfigdirs="$noconfigdirs target-libquadmath"
469 AC_ARG_ENABLE(libquadmath-support,
470 AS_HELP_STRING([--disable-libquadmath-support],
471 [disable libquadmath support for Fortran]),
472 ENABLE_LIBQUADMATH_SUPPORT=$enableval,
473 ENABLE_LIBQUADMATH_SUPPORT=yes)
474 enable_libquadmath_support=
475 if test "${ENABLE_LIBQUADMATH_SUPPORT}" = "no" ; then
476 enable_libquadmath_support=no
480 AC_ARG_ENABLE(libada,
481 [AS_HELP_STRING([--enable-libada], [build libada directory])],
482 ENABLE_LIBADA=$enableval,
484 if test "${ENABLE_LIBADA}" != "yes" ; then
485 noconfigdirs="$noconfigdirs gnattools"
488 AC_ARG_ENABLE(libssp,
489 [AS_HELP_STRING([--enable-libssp], [build libssp directory])],
490 ENABLE_LIBSSP=$enableval,
493 AC_ARG_ENABLE(libstdcxx,
494 AS_HELP_STRING([--disable-libstdcxx],
495 [do not build libstdc++-v3 directory]),
496 ENABLE_LIBSTDCXX=$enableval,
497 ENABLE_LIBSTDCXX=default)
498 [if test "${ENABLE_LIBSTDCXX}" = "no" ; then
499 noconfigdirs="$noconfigdirs target-libstdc++-v3"
502 # If this is accelerator compiler and its target is intelmic we enable
503 # target liboffloadmic by default. If this is compiler with offloading
504 # for intelmic we enable host liboffloadmic by default. Otherwise
505 # liboffloadmic is disabled by default.
506 AC_ARG_ENABLE([liboffloadmic],
507 AC_HELP_STRING([[--enable-liboffloadmic[=ARG]]],
508 [build liboffloadmic @<:@ARG={no,host,target}@:>@]),
509 [case "$enableval" in
511 enable_liboffloadmic=$enableval ;;
513 AC_MSG_ERROR([--enable-liboffloadmic=no/host/target]) ;;
515 [if test x"$enable_as_accelerator_for" != x; then
517 *-intelmic-* | *-intelmicemul-*)
518 enable_liboffloadmic=target
519 extra_liboffloadmic_configure_flags="--enable-liboffloadmic=target"
522 enable_liboffloadmic=no
526 case "${enable_offload_targets}" in
527 *-intelmic-* | *-intelmicemul-*)
528 enable_liboffloadmic=host
529 extra_liboffloadmic_configure_flags="--enable-liboffloadmic=host"
532 enable_liboffloadmic=no
536 AC_SUBST(extra_liboffloadmic_configure_flags)
538 # Enable libgomp by default on hosted POSIX systems, and a few others.
539 if test x$enable_libgomp = x ; then
541 *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu | *-*-kopensolaris*-gnu)
543 *-*-netbsd* | *-*-freebsd* | *-*-openbsd* | *-*-dragonfly*)
545 *-*-solaris2* | *-*-hpux11*)
547 *-*-darwin* | *-*-aix*)
552 noconfigdirs="$noconfigdirs target-libgomp"
557 # Disable libatomic on unsupported systems.
558 if test -d ${srcdir}/libatomic; then
559 if test x$enable_libatomic = x; then
560 AC_MSG_CHECKING([for libatomic support])
561 if (srcdir=${srcdir}/libatomic; \
562 . ${srcdir}/configure.tgt; \
563 test -n "$UNSUPPORTED")
566 noconfigdirs="$noconfigdirs target-libatomic"
573 # Disable liboffloadmic on unsupported systems.
574 if test -d ${srcdir}/liboffloadmic; then
575 if test x$enable_liboffloadmic != xno; then
576 AC_MSG_CHECKING([for liboffloadmic support])
577 if (srcdir=${srcdir}/liboffloadmic; \
578 . ${srcdir}/configure.tgt; \
579 test -n "$UNSUPPORTED")
582 noconfigdirs="$noconfigdirs target-liboffloadmic"
589 # Disable libitm on unsupported systems.
590 if test -d ${srcdir}/libitm; then
591 if test x$enable_libitm = x; then
592 AC_MSG_CHECKING([for libitm support])
593 if (srcdir=${srcdir}/libitm; \
594 . ${srcdir}/configure.tgt; \
595 test -n "$UNSUPPORTED")
598 noconfigdirs="$noconfigdirs target-libitm"
605 # Disable libsanitizer on unsupported systems.
606 if test -d ${srcdir}/libsanitizer; then
607 if test x$enable_libsanitizer = x; then
608 AC_MSG_CHECKING([for libsanitizer support])
609 if (srcdir=${srcdir}/libsanitizer; \
610 . ${srcdir}/configure.tgt; \
611 test -n "$UNSUPPORTED")
614 noconfigdirs="$noconfigdirs target-libsanitizer"
621 # Disable libvtv on unsupported systems.
622 if test -d ${srcdir}/libvtv; then
623 if test x$enable_libvtv = x; then
624 AC_MSG_CHECKING([for libvtv support])
625 if (srcdir=${srcdir}/libvtv; \
626 . ${srcdir}/configure.tgt; \
627 test "$VTV_SUPPORTED" != "yes")
630 noconfigdirs="$noconfigdirs target-libvtv"
638 # Disable libhsail-rt on unsupported systems.
639 if test -d ${srcdir}/libhsail-rt; then
640 if test x$enable_libhsail_rt = x; then
641 AC_MSG_CHECKING([for libhsail-rt support])
642 if (srcdir=${srcdir}/libhsail-rt; \
643 . ${srcdir}/configure.tgt; \
644 test -n "$UNSUPPORTED")
647 unsupported_languages="$unsupported_languages brig"
648 # This implicitly disables also target-libhsail-rt as it won't
649 # get added to the build without BRIG FE.
657 # Disable libquadmath for some systems.
660 noconfigdirs="$noconfigdirs target-libquadmath"
662 # libquadmath is unused on AIX and libquadmath build process use of
663 # LD_LIBRARY_PATH can break AIX bootstrap.
664 powerpc-*-aix* | rs6000-*-aix*)
665 noconfigdirs="$noconfigdirs target-libquadmath"
669 # Disable libssp for some systems.
672 # No hosted I/O support.
673 noconfigdirs="$noconfigdirs target-libssp"
675 powerpc-*-aix* | rs6000-*-aix*)
676 noconfigdirs="$noconfigdirs target-libssp"
679 # libssp uses a misaligned load to trigger a fault, but the RL78
680 # doesn't fault for those - instead, it gives a build-time error
681 # for explicit misaligned loads.
682 noconfigdirs="$noconfigdirs target-libssp"
685 # No hosted I/O support.
686 noconfigdirs="$noconfigdirs target-libssp"
690 # Disable libstdc++-v3 for some systems.
691 # Allow user to override this if they pass --enable-libstdc++-v3
692 if test "${ENABLE_LIBSTDCXX}" = "default" ; then
695 # VxWorks uses the Dinkumware C++ library.
696 noconfigdirs="$noconfigdirs target-libstdc++-v3"
699 # the C++ libraries don't build on top of CE's C libraries
700 noconfigdirs="$noconfigdirs target-libstdc++-v3"
703 noconfigdirs="$noconfigdirs target-libstdc++-v3"
706 noconfigdirs="$noconfigdirs target-libstdc++-v3"
711 # Disable Fortran for some systems.
714 # See <http://gcc.gnu.org/ml/gcc-patches/2004-11/msg00572.html>.
715 unsupported_languages="$unsupported_languages fortran"
719 # Disable libffi for some systems.
723 i[[3456789]]86-*-darwin*)
725 x86_64-*-darwin[[912]]*)
728 noconfigdirs="$noconfigdirs target-libffi"
731 noconfigdirs="$noconfigdirs target-libffi"
734 noconfigdirs="$noconfigdirs target-libffi"
737 noconfigdirs="$noconfigdirs target-libffi"
740 noconfigdirs="$noconfigdirs target-libffi"
743 noconfigdirs="$noconfigdirs target-libffi"
746 noconfigdirs="$noconfigdirs target-libffi"
749 noconfigdirs="$noconfigdirs target-libffi"
752 noconfigdirs="$noconfigdirs target-libffi"
755 noconfigdirs="$noconfigdirs target-libffi"
758 noconfigdirs="$noconfigdirs target-libffi"
760 cris-*-* | crisv32-*-*)
764 *) # See PR46792 regarding target-libffi.
765 noconfigdirs="$noconfigdirs target-libffi";;
769 noconfigdirs="$noconfigdirs target-libffi"
774 noconfigdirs="$noconfigdirs target-libffi"
777 noconfigdirs="$noconfigdirs target-libffi"
779 i[[3456789]]86-w64-mingw*)
780 noconfigdirs="$noconfigdirs target-libffi"
782 i[[3456789]]86-*-mingw*)
783 noconfigdirs="$noconfigdirs target-libffi"
786 noconfigdirs="$noconfigdirs target-libffi"
789 noconfigdirs="$noconfigdirs target-libffi"
796 noconfigdirs="$noconfigdirs target-libffi"
799 noconfigdirs="$noconfigdirs target-libffi"
803 # Disable the go frontend on systems where it is known to not work. Please keep
804 # this in sync with contrib/config-list.mk.
806 *-*-darwin* | *-*-cygwin* | *-*-mingw*)
807 unsupported_languages="$unsupported_languages go"
811 # Only allow gdbserver on some systems.
812 if test -d ${srcdir}/gdbserver; then
813 if test x$enable_gdbserver = x; then
814 AC_MSG_CHECKING([for gdbserver support])
815 if (srcdir=${srcdir}/gdbserver; \
816 . ${srcdir}/configure.srv; \
817 test -n "$UNSUPPORTED")
820 noconfigdirs="$noconfigdirs gdbserver"
827 # Disable libgo for some systems where it is known to not work.
828 # For testing, you can easily override this with --enable-libgo.
829 if test x$enable_libgo = x; then
833 noconfigdirs="$noconfigdirs target-libgo"
835 *-*-cygwin* | *-*-mingw*)
836 noconfigdirs="$noconfigdirs target-libgo"
841 # Default libgloss CPU subdirectory.
842 libgloss_dir="$target_cpu"
845 sh*-*-pe|mips*-*-pe|*arm-wince-pe)
854 cris-*-* | crisv32-*-*)
863 m68hc11-*-*|m6811-*-*|m68hc12-*-*|m6812-*-*)
880 # Disable newlib and libgloss for various target OSes.
883 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
885 i[[3456789]]86-*-linux*)
886 # This section makes it possible to build newlib natively on linux.
887 # If we are using a cross compiler then don't configure newlib.
888 if test x${is_cross_compiler} != xno ; then
889 noconfigdirs="$noconfigdirs target-newlib"
891 noconfigdirs="$noconfigdirs target-libgloss"
892 # If we are not using a cross compiler, do configure newlib.
893 # Note however, that newlib will only be configured in this situation
894 # if the --with-newlib option has been given, because otherwise
895 # 'target-newlib' will appear in skipdirs.
897 i[[3456789]]86-*-rdos*)
898 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
900 sh*-*-pe|mips*-*-pe|arm-wince-pe)
901 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
904 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
907 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
910 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
913 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
916 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
919 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
921 *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu | *-*-kopensolaris*-gnu)
922 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
925 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
928 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
931 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
934 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
937 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
940 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
943 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
951 noconfigdirs="$noconfigdirs ld gas gdb gprof"
952 noconfigdirs="$noconfigdirs sim target-rda"
955 noconfigdirs="$noconfigdirs ld gas gdb gprof"
956 noconfigdirs="$noconfigdirs sim target-rda"
959 noconfigdirs="$noconfigdirs ld gas gdb gprof"
960 noconfigdirs="$noconfigdirs sim target-rda"
962 i[[3456789]]86-*-darwin*)
963 noconfigdirs="$noconfigdirs ld gprof"
964 noconfigdirs="$noconfigdirs sim target-rda"
966 x86_64-*-darwin[[912]]*)
967 noconfigdirs="$noconfigdirs ld gas gprof"
968 noconfigdirs="$noconfigdirs sim target-rda"
971 noconfigdirs="$noconfigdirs ld gas gdb gprof"
972 noconfigdirs="$noconfigdirs sim target-rda"
977 if test "x$with_gmp" = x && test "x$with_gmp_dir" = x \
978 && test -f /usr/local/include/gmp.h; then
983 # Remove unsupported stuff on all kaOS configurations.
984 noconfigdirs="$noconfigdirs target-libgloss"
991 noconfigdirs="$noconfigdirs target-libgloss"
994 noconfigdirs="$noconfigdirs target-libgloss"
996 # The tpf target doesn't support gdb yet.
998 noconfigdirs="$noconfigdirs gdb tcl tk libgui itcl"
1001 noconfigdirs="$noconfigdirs target-rda"
1006 # ld works, but does not support shared libraries.
1007 # gas doesn't generate exception information.
1008 noconfigdirs="$noconfigdirs gas ld"
1011 noconfigdirs="$noconfigdirs gdb target-newlib target-libgloss"
1014 # newlib is not 64 bit ready
1015 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
1017 sh*-*-pe|mips*-*-pe|*arm-wince-pe)
1018 noconfigdirs="$noconfigdirs tcl tk itcl libgui sim"
1021 noconfigdirs="$noconfigdirs sim"
1024 noconfigdirs="$noconfigdirs target-libgloss"
1027 noconfigdirs="$noconfigdirs ld target-libgloss"
1030 if test x${with_avrlibc} != xno; then
1031 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
1034 c4x-*-* | tic4x-*-*)
1035 noconfigdirs="$noconfigdirs target-libgloss"
1038 noconfigdirs="$noconfigdirs target-libgloss gdb"
1041 noconfigdirs="$noconfigdirs target-libgloss"
1044 noconfigdirs="$noconfigdirs gdb"
1047 noconfigdirs="$noconfigdirs gdb"
1050 noconfigdirs="$noconfigdirs target-rda gprof"
1053 noconfigdirs="$noconfigdirs"
1056 noconfigdirs="$noconfigdirs target-libgloss"
1059 noconfigdirs="$noconfigdirs target-libgloss"
1061 hppa1.1-*-osf* | hppa1.1-*-bsd* )
1064 noconfigdirs="$noconfigdirs gdb"
1067 noconfigdirs="$noconfigdirs gdb ld"
1075 hppa*-*-openbsd* | \
1081 noconfigdirs="$noconfigdirs ld"
1084 noconfigdirs="$noconfigdirs gdb"
1087 # No gdb support yet.
1088 noconfigdirs="$noconfigdirs readline libgui itcl gdb"
1091 # No ld support yet.
1092 noconfigdirs="$noconfigdirs gdb libgui itcl ld"
1095 # No ld support yet.
1096 noconfigdirs="$noconfigdirs libgui itcl ld"
1098 i[[3456789]]86-w64-mingw*)
1100 i[[3456789]]86-*-mingw*)
1101 target_configdirs="$target_configdirs target-winsup"
1104 target_configdirs="$target_configdirs target-libtermcap target-winsup"
1105 noconfigdirs="$noconfigdirs target-libgloss"
1106 # always build newlib if winsup directory is present.
1107 if test -d "$srcdir/winsup/cygwin"; then
1108 skipdirs=`echo " ${skipdirs} " | sed -e 's/ target-newlib / /'`
1109 elif test -d "$srcdir/newlib"; then
1110 echo "Warning: winsup/cygwin is missing so newlib can't be built."
1113 i[[3456789]]86-*-pe)
1114 noconfigdirs="$noconfigdirs target-libgloss"
1116 i[[3456789]]86-*-sco3.2v5*)
1117 # The linker does not yet know about weak symbols in COFF,
1118 # and is not configured to handle mixed ELF and COFF.
1119 noconfigdirs="$noconfigdirs ld target-libgloss"
1121 i[[3456789]]86-*-sco*)
1122 noconfigdirs="$noconfigdirs gprof target-libgloss"
1124 i[[3456789]]86-*-solaris2* | x86_64-*-solaris2.1[[0-9]]*)
1125 noconfigdirs="$noconfigdirs target-libgloss"
1127 i[[3456789]]86-*-sysv4*)
1128 noconfigdirs="$noconfigdirs target-libgloss"
1130 i[[3456789]]86-*-beos*)
1131 noconfigdirs="$noconfigdirs gdb"
1133 i[[3456789]]86-*-rdos*)
1134 noconfigdirs="$noconfigdirs gdb"
1137 noconfigdirs="$noconfigdirs gdb"
1140 noconfigdirs="$noconfigdirs sim"
1143 noconfigdirs="$noconfigdirs ld gas gdb gprof sim"
1144 noconfigdirs="$noconfigdirs $target_libraries"
1147 noconfigdirs="$noconfigdirs gdb gprof"
1150 # copied from rs6000-*-* entry
1151 noconfigdirs="$noconfigdirs gprof"
1153 powerpc*-*-winnt* | powerpc*-*-pe*)
1154 target_configdirs="$target_configdirs target-winsup"
1155 noconfigdirs="$noconfigdirs gdb tcl tk target-libgloss itcl"
1156 # always build newlib.
1157 skipdirs=`echo " ${skipdirs} " | sed -e 's/ target-newlib / /'`
1159 # This is temporary until we can link against shared libraries
1160 powerpcle-*-solaris*)
1161 noconfigdirs="$noconfigdirs gdb sim tcl tk itcl"
1164 noconfigdirs="$noconfigdirs gdb"
1167 noconfigdirs="$noconfigdirs gprof"
1170 noconfigdirs="$noconfigdirs gprof"
1173 noconfigdirs="$noconfigdirs gprof"
1176 noconfigdirs="$noconfigdirs ld binutils gprof target-libgloss"
1179 noconfigdirs="$noconfigdirs gprof"
1181 mips*-sde-elf* | mips*-mti-elf* | mips*-img-elf*)
1182 if test x$with_newlib = xyes; then
1183 noconfigdirs="$noconfigdirs gprof"
1187 noconfigdirs="$noconfigdirs gprof target-libgloss"
1190 noconfigdirs="$noconfigdirs gprof target-libgloss"
1193 noconfigdirs="$noconfigdirs ld gas gprof target-libgloss"
1197 mips*-*-ultrix* | mips*-*-osf* | mips*-*-ecoff* | mips*-*-pe* \
1198 | mips*-*-irix* | mips*-*-lnews* | mips*-*-riscos*)
1199 noconfigdirs="$noconfigdirs ld gas gprof"
1202 noconfigdirs="$noconfigdirs gprof"
1205 noconfigdirs="$noconfigdirs target-libssp target-libstdc++-v3 target-libobjc"
1212 noconfigdirs="$noconfigdirs target-libgloss" ;;
1216 if test x${is_cross_compiler} = xno ; then
1221 noconfigdirs="$noconfigdirs sim"
1223 tilepro*-*-* | tilegx*-*-*)
1224 noconfigdirs="$noconfigdirs sim"
1227 noconfigdirs="$noconfigdirs bfd binutils gas gdb ld opcodes target-libgloss"
1230 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
1233 noconfigdirs="$noconfigdirs ld"
1237 # If we aren't building newlib, then don't build libgloss, since libgloss
1238 # depends upon some newlib header files.
1239 case "${noconfigdirs}" in
1240 *target-libgloss*) ;;
1241 *target-newlib*) noconfigdirs="$noconfigdirs target-libgloss" ;;
1244 # Work in distributions that contain no compiler tools, like Autoconf.
1245 host_makefile_frag=/dev/null
1246 if test -d ${srcdir}/config ; then
1248 i[[3456789]]86-*-msdosdjgpp*)
1249 host_makefile_frag="config/mh-djgpp"
1252 ACX_CHECK_CYGWIN_CAT_WORKS
1253 host_makefile_frag="config/mh-cygwin"
1256 host_makefile_frag="config/mh-mingw"
1259 host_makefile_frag="config/mh-alpha-linux"
1262 host_makefile_frag="config/mh-pa-hpux10"
1265 host_makefile_frag="config/mh-pa"
1268 host_makefile_frag="config/mh-pa"
1271 host_makefile_frag="config/mh-darwin"
1274 host_makefile_frag="config/mh-ppc-aix"
1277 host_makefile_frag="config/mh-ppc-aix"
1282 if test "${build}" != "${host}" ; then
1283 AR_FOR_BUILD=${AR_FOR_BUILD-ar}
1284 AS_FOR_BUILD=${AS_FOR_BUILD-as}
1285 CC_FOR_BUILD=${CC_FOR_BUILD-gcc}
1286 CXX_FOR_BUILD=${CXX_FOR_BUILD-g++}
1287 GFORTRAN_FOR_BUILD=${GFORTRAN_FOR_BUILD-gfortran}
1288 GOC_FOR_BUILD=${GOC_FOR_BUILD-gccgo}
1289 DLLTOOL_FOR_BUILD=${DLLTOOL_FOR_BUILD-dlltool}
1290 LD_FOR_BUILD=${LD_FOR_BUILD-ld}
1291 NM_FOR_BUILD=${NM_FOR_BUILD-nm}
1292 RANLIB_FOR_BUILD=${RANLIB_FOR_BUILD-ranlib}
1293 WINDRES_FOR_BUILD=${WINDRES_FOR_BUILD-windres}
1294 WINDMC_FOR_BUILD=${WINDMC_FOR_BUILD-windmc}
1296 AR_FOR_BUILD="\$(AR)"
1297 AS_FOR_BUILD="\$(AS)"
1298 CC_FOR_BUILD="\$(CC)"
1299 CXX_FOR_BUILD="\$(CXX)"
1300 GFORTRAN_FOR_BUILD="\$(GFORTRAN)"
1301 GOC_FOR_BUILD="\$(GOC)"
1302 DLLTOOL_FOR_BUILD="\$(DLLTOOL)"
1303 LD_FOR_BUILD="\$(LD)"
1304 NM_FOR_BUILD="\$(NM)"
1305 RANLIB_FOR_BUILD="\$(RANLIB)"
1306 WINDRES_FOR_BUILD="\$(WINDRES)"
1307 WINDMC_FOR_BUILD="\$(WINDMC)"
1313 # We must set the default linker to the linker used by gcc for the correct
1314 # operation of libtool. If LD is not defined and we are using gcc, try to
1315 # set the LD default to the ld used by gcc.
1316 if test -z "$LD"; then
1317 if test "$GCC" = yes; then
1320 gcc_prog_ld=`$CC -print-prog-name=ld 2>&1 | tr -d '\015'` ;;
1322 gcc_prog_ld=`$CC -print-prog-name=ld 2>&1` ;;
1324 case $gcc_prog_ld in
1325 # Accept absolute paths.
1326 [[\\/]* | [A-Za-z]:[\\/]*)]
1327 LD="$gcc_prog_ld" ;;
1332 # Check whether -static-libstdc++ -static-libgcc is supported.
1334 if test "$GCC" = yes; then
1335 saved_LDFLAGS="$LDFLAGS"
1337 LDFLAGS="$LDFLAGS -static-libstdc++ -static-libgcc"
1338 AC_MSG_CHECKING([whether g++ accepts -static-libstdc++ -static-libgcc])
1340 AC_LINK_IFELSE([AC_LANG_SOURCE([
1341 #if (__GNUC__ < 4) || (__GNUC__ == 4 && __GNUC_MINOR__ < 5)
1342 #error -static-libstdc++ not implemented
1345 [AC_MSG_RESULT([yes]); have_static_libs=yes],
1346 [AC_MSG_RESULT([no])])
1349 LDFLAGS="$saved_LDFLAGS"
1353 ACX_PROG_CMP_IGNORE_INITIAL
1355 AC_ARG_ENABLE([bootstrap],
1356 [AS_HELP_STRING([--enable-bootstrap],
1357 [enable bootstrapping @<:@yes if native build@:>@])],,
1358 enable_bootstrap=default)
1360 # Issue errors and warnings for invalid/strange bootstrap combinations.
1361 if test -r $srcdir/gcc/configure; then
1367 case "$have_compiler:$host:$target:$enable_bootstrap" in
1370 # Default behavior. Enable bootstrap if we have a compiler
1371 # and we are in a native configuration.
1372 yes:$build:$build:default)
1373 enable_bootstrap=yes ;;
1376 enable_bootstrap=no ;;
1378 # We have a compiler and we are in a native configuration, bootstrap is ok
1379 yes:$build:$build:yes)
1382 # Other configurations, but we have a compiler. Assume the user knows
1385 AC_MSG_WARN([trying to bootstrap a cross compiler])
1388 # No compiler: if they passed --enable-bootstrap explicitly, fail
1390 AC_MSG_ERROR([cannot bootstrap without a compiler]) ;;
1392 # Fail if wrong command line
1394 AC_MSG_ERROR([invalid option for --enable-bootstrap])
1398 # When bootstrapping with GCC, build stage 1 in C++98 mode to ensure that a
1399 # C++98 compiler can still start the bootstrap.
1400 if test "$enable_bootstrap:$GXX" = "yes:yes"; then
1401 CXX="$CXX -std=gnu++98"
1404 AC_ARG_ENABLE([pgo-build],
1405 [AS_HELP_STRING([--enable-pgo-build[[=lto]]],
1406 [enable the PGO build])],
1407 [enable_pgo_build=$enableval],
1408 [enable_pgo_build=no])
1410 # Issue errors and warnings for invalid/strange PGO build combinations.
1411 case "$have_compiler:$host:$target:$enable_pgo_build" in
1414 # Allow the PGO build only if we aren't building a compiler and
1415 # we are in a native configuration.
1416 no:$build:$build:yes | no:$build:$build:lto) ;;
1418 # Disallow the PGO bootstrap if we are building a compiler.
1419 yes:*:*:yes | yes:*:*:lto)
1420 AC_MSG_ERROR([cannot perform the PGO bootstrap when building a compiler]) ;;
1423 AC_MSG_ERROR([invalid option for --enable-pgo-build])
1427 if test "$enable_pgo_build" != "no"; then
1428 AC_MSG_CHECKING([whether the compiler supports -fprofile-generate])
1429 old_CFLAGS="$CFLAGS"
1430 PGO_BUILD_GEN_CFLAGS="-fprofile-generate"
1431 CFLAGS="$CFLAGS $PGO_BUILD_CFLAGS"
1432 AC_COMPILE_IFELSE([AC_LANG_SOURCE([int foo;])],,
1433 [PGO_BUILD_GEN_CFLAGS=])
1434 CFLAGS="$old_CFLAGS"
1435 if test -n "$PGO_BUILD_GEN_CFLAGS"; then
1436 AC_MSG_RESULT([yes])
1437 PGO_BUILD_USE_CFLAGS="-fprofile-use"
1440 AC_MSG_ERROR([cannot perform the PGO build without -fprofile-generate])
1443 if test "$enable_pgo_build" = "lto"; then
1444 AC_MSG_CHECKING([whether the compiler supports -flto=jobserver -ffat-lto-objects])
1445 old_CFLAGS="$CFLAGS"
1446 PGO_BUILD_LTO_CFLAGS="-flto=jobserver -ffat-lto-objects"
1447 CFLAGS="$CFLAGS $PGO_BUILD_LTO_CFLAGS"
1448 AC_COMPILE_IFELSE([AC_LANG_SOURCE([int foo;])],,
1449 [PGO_BUILD_LTO_CFLAGS=])
1450 CFLAGS="$old_CFLAGS"
1451 if test -n "$PGO_BUILD_LTO_CFLAGS"; then
1452 AC_MSG_RESULT([yes])
1455 AC_MSG_WARN([LTO is disabled for the PGO build])
1459 AC_SUBST(PGO_BUILD_GEN_CFLAGS)
1460 AC_SUBST(PGO_BUILD_USE_CFLAGS)
1461 AC_SUBST(PGO_BUILD_LTO_CFLAGS)
1463 # Used for setting $lt_cv_objdir
1466 # Check for GMP, MPFR and MPC
1467 gmplibs="-lmpc -lmpfr -lgmp"
1471 # Specify a location for mpc
1472 # check for this first so it ends up on the link line before mpfr.
1474 [AS_HELP_STRING([--with-mpc=PATH],
1475 [specify prefix directory for installed MPC package.
1476 Equivalent to --with-mpc-include=PATH/include
1477 plus --with-mpc-lib=PATH/lib])])
1478 AC_ARG_WITH(mpc-include,
1479 [AS_HELP_STRING([--with-mpc-include=PATH],
1480 [specify directory for installed MPC include files])])
1481 AC_ARG_WITH(mpc-lib,
1482 [AS_HELP_STRING([--with-mpc-lib=PATH],
1483 [specify directory for the installed MPC library])])
1485 if test "x$with_mpc" != x; then
1486 gmplibs="-L$with_mpc/lib $gmplibs"
1487 gmpinc="-I$with_mpc/include $gmpinc"
1489 if test "x$with_mpc_include" != x; then
1490 gmpinc="-I$with_mpc_include $gmpinc"
1492 if test "x$with_mpc_lib" != x; then
1493 gmplibs="-L$with_mpc_lib $gmplibs"
1495 if test "x$with_mpc$with_mpc_include$with_mpc_lib" = x && test -d ${srcdir}/mpc; then
1496 gmplibs='-L$$r/$(HOST_SUBDIR)/mpc/src/'"$lt_cv_objdir $gmplibs"
1497 gmpinc='-I$$s/mpc/src '"$gmpinc"
1498 # Do not test the mpc version. Assume that it is sufficient, since
1499 # it is in the source tree, and the library has not been built yet
1500 # but it would be included on the link line in the version check below
1501 # hence making the test fail.
1505 # Specify a location for mpfr
1506 # check for this first so it ends up on the link line before gmp.
1507 AC_ARG_WITH(mpfr-dir,
1508 [AS_HELP_STRING([--with-mpfr-dir=PATH], [this option has been REMOVED])],
1509 [AC_MSG_ERROR([The --with-mpfr-dir=PATH option has been removed.
1510 Use --with-mpfr=PATH or --with-mpfr-include=PATH plus --with-mpfr-lib=PATH])])
1513 [AS_HELP_STRING([--with-mpfr=PATH],
1514 [specify prefix directory for installed MPFR package.
1515 Equivalent to --with-mpfr-include=PATH/include
1516 plus --with-mpfr-lib=PATH/lib])])
1517 AC_ARG_WITH(mpfr-include,
1518 [AS_HELP_STRING([--with-mpfr-include=PATH],
1519 [specify directory for installed MPFR include files])])
1520 AC_ARG_WITH(mpfr-lib,
1521 [AS_HELP_STRING([--with-mpfr-lib=PATH],
1522 [specify directory for the installed MPFR library])])
1524 if test "x$with_mpfr" != x; then
1525 gmplibs="-L$with_mpfr/lib $gmplibs"
1526 gmpinc="-I$with_mpfr/include $gmpinc"
1528 if test "x$with_mpfr_include" != x; then
1529 gmpinc="-I$with_mpfr_include $gmpinc"
1531 if test "x$with_mpfr_lib" != x; then
1532 gmplibs="-L$with_mpfr_lib $gmplibs"
1534 if test "x$with_mpfr$with_mpfr_include$with_mpfr_lib" = x && test -d ${srcdir}/mpfr; then
1535 # MPFR v3.1.0 moved the sources into a src sub-directory.
1536 if ! test -d ${srcdir}/mpfr/src; then
1538 Building GCC with MPFR in the source tree is only handled for MPFR 3.1.0+.])
1540 gmplibs='-L$$r/$(HOST_SUBDIR)/mpfr/src/'"$lt_cv_objdir $gmplibs"
1541 gmpinc='-I$$r/$(HOST_SUBDIR)/mpfr/src -I$$s/mpfr/src '"$gmpinc"
1542 extra_mpc_mpfr_configure_flags='--with-mpfr-include=$$s/mpfr/src --with-mpfr-lib=$$r/$(HOST_SUBDIR)/mpfr/src/'"$lt_cv_objdir"
1543 # Do not test the mpfr version. Assume that it is sufficient, since
1544 # it is in the source tree, and the library has not been built yet
1545 # but it would be included on the link line in the version check below
1546 # hence making the test fail.
1550 # Specify a location for gmp
1551 AC_ARG_WITH(gmp-dir,
1552 [AS_HELP_STRING([--with-gmp-dir=PATH], [this option has been REMOVED])],
1553 [AC_MSG_ERROR([The --with-gmp-dir=PATH option has been removed.
1554 Use --with-gmp=PATH or --with-gmp-include=PATH plus --with-gmp-lib=PATH])])
1557 [AS_HELP_STRING([--with-gmp=PATH],
1558 [specify prefix directory for the installed GMP package.
1559 Equivalent to --with-gmp-include=PATH/include
1560 plus --with-gmp-lib=PATH/lib])])
1561 AC_ARG_WITH(gmp-include,
1562 [AS_HELP_STRING([--with-gmp-include=PATH],
1563 [specify directory for installed GMP include files])])
1564 AC_ARG_WITH(gmp-lib,
1565 [AS_HELP_STRING([--with-gmp-lib=PATH],
1566 [specify directory for the installed GMP library])])
1569 if test "x$with_gmp" != x; then
1570 gmplibs="-L$with_gmp/lib $gmplibs"
1571 gmpinc="-I$with_gmp/include $gmpinc"
1573 if test "x$with_gmp_include" != x; then
1574 gmpinc="-I$with_gmp_include $gmpinc"
1576 if test "x$with_gmp_lib" != x; then
1577 gmplibs="-L$with_gmp_lib $gmplibs"
1579 if test "x$with_gmp$with_gmp_include$with_gmp_lib" = x && test -d ${srcdir}/gmp; then
1580 gmplibs='-L$$r/$(HOST_SUBDIR)/gmp/'"$lt_cv_objdir $gmplibs"
1581 gmpinc='-I$$r/$(HOST_SUBDIR)/gmp -I$$s/gmp '"$gmpinc"
1582 extra_mpfr_configure_flags='--with-gmp-include=$$r/$(HOST_SUBDIR)/gmp --with-gmp-lib=$$r/$(HOST_SUBDIR)/gmp/'"$lt_cv_objdir"
1583 extra_mpc_gmp_configure_flags='--with-gmp-include=$$r/$(HOST_SUBDIR)/gmp --with-gmp-lib=$$r/$(HOST_SUBDIR)/gmp/'"$lt_cv_objdir"
1584 extra_isl_gmp_configure_flags='--with-gmp-builddir=$$r/$(HOST_SUBDIR)/gmp'
1585 # Do not test the gmp version. Assume that it is sufficient, since
1586 # it is in the source tree, and the library has not been built yet
1587 # but it would be included on the link line in the version check below
1588 # hence making the test fail.
1592 if test -d ${srcdir}/gcc && test "x$have_gmp" = xno; then
1594 saved_CFLAGS="$CFLAGS"
1595 CFLAGS="$CFLAGS $gmpinc"
1596 # Check for the recommended and required versions of GMP.
1597 AC_MSG_CHECKING([for the correct version of gmp.h])
1598 AC_TRY_COMPILE([#include "gmp.h"],[
1599 #define GCC_GMP_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
1600 #define GCC_GMP_VERSION GCC_GMP_VERSION_NUM(__GNU_MP_VERSION,__GNU_MP_VERSION_MINOR,__GNU_MP_VERSION_PATCHLEVEL)
1601 #if GCC_GMP_VERSION < GCC_GMP_VERSION_NUM(4,2,3)
1604 ], [AC_TRY_COMPILE([#include <gmp.h>],[
1605 #define GCC_GMP_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
1606 #define GCC_GMP_VERSION GCC_GMP_VERSION_NUM(__GNU_MP_VERSION,__GNU_MP_VERSION_MINOR,__GNU_MP_VERSION_PATCHLEVEL)
1607 #if GCC_GMP_VERSION < GCC_GMP_VERSION_NUM(4,3,2)
1610 ], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([buggy but acceptable])])],
1611 [AC_MSG_RESULT([no]); have_gmp=no])
1613 # If we have GMP, check the MPFR version.
1614 if test x"$have_gmp" = xyes; then
1615 # Check for the recommended and required versions of MPFR.
1616 AC_MSG_CHECKING([for the correct version of mpfr.h])
1617 AC_TRY_COMPILE([#include <gmp.h>
1618 #include <mpfr.h>],[
1619 #if MPFR_VERSION < MPFR_VERSION_NUM(2,4,0)
1622 ], [AC_TRY_COMPILE([#include <gmp.h>
1623 #include <mpfr.h>],[
1624 #if MPFR_VERSION < MPFR_VERSION_NUM(2,4,2)
1627 ], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([buggy but acceptable])])],
1628 [AC_MSG_RESULT([no]); have_gmp=no])
1631 # Check for the MPC header version.
1632 if test x"$have_gmp" = xyes ; then
1633 # Check for the recommended and required versions of MPC.
1634 AC_MSG_CHECKING([for the correct version of mpc.h])
1635 AC_TRY_COMPILE([#include <mpc.h>],[
1636 #if MPC_VERSION < MPC_VERSION_NUM(0,8,0)
1639 ], [AC_TRY_COMPILE([#include <mpc.h>],[
1640 #if MPC_VERSION < MPC_VERSION_NUM(0,8,1)
1643 ], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([buggy but acceptable])])],
1644 [AC_MSG_RESULT([no]); have_gmp=no])
1647 # Now check the MPFR library.
1648 if test x"$have_gmp" = xyes; then
1650 LIBS="$LIBS $gmplibs"
1651 AC_MSG_CHECKING([for the correct version of the gmp/mpfr/mpc libraries])
1652 AC_TRY_LINK([#include <mpc.h>],[
1659 mpfr_atan2 (n, n, x, GMP_RNDN);
1660 mpfr_erfc (n, x, GMP_RNDN);
1661 mpfr_subnormalize (x, t, GMP_RNDN);
1665 mpc_set_ui_ui (c, 1, 1, MPC_RNDNN);
1666 mpc_cosh (c, c, MPC_RNDNN);
1667 mpc_pow (c, c, c, MPC_RNDNN);
1668 mpc_acosh (c, c, MPC_RNDNN);
1670 ], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]); have_gmp=no])
1674 CFLAGS="$saved_CFLAGS"
1676 # The library versions listed in the error message below should match
1677 # the HARD-minimums enforced above.
1678 if test x$have_gmp != xyes; then
1679 AC_MSG_ERROR([Building GCC requires GMP 4.2+, MPFR 2.4.0+ and MPC 0.8.0+.
1680 Try the --with-gmp, --with-mpfr and/or --with-mpc options to specify
1681 their locations. Source code for these libraries can be found at
1682 their respective hosting sites as well as at
1683 ftp://gcc.gnu.org/pub/gcc/infrastructure/. See also
1684 http://gcc.gnu.org/install/prerequisites.html for additional info. If
1685 you obtained GMP, MPFR and/or MPC from a vendor distribution package,
1686 make sure that you have installed both the libraries and the header
1687 files. They may be located in separate packages.])
1691 # Flags needed for both GMP, MPFR and/or MPC.
1694 AC_SUBST(extra_mpfr_configure_flags)
1695 AC_SUBST(extra_mpc_gmp_configure_flags)
1696 AC_SUBST(extra_mpc_mpfr_configure_flags)
1697 AC_SUBST(extra_isl_gmp_configure_flags)
1699 # Libraries to use for stage1 or when not bootstrapping.
1700 AC_ARG_WITH(stage1-libs,
1701 [AS_HELP_STRING([--with-stage1-libs=LIBS], [libraries for stage1])],
1702 [if test "$withval" = "no" -o "$withval" = "yes"; then
1705 stage1_libs=$withval
1708 AC_SUBST(stage1_libs)
1710 # Whether or not to use -static-libstdc++ and -static-libgcc. The
1711 # default is yes if gcc is being built; no otherwise. The reason for
1712 # this default is that gdb is sometimes linked against GNU Source
1713 # Highlight, which is a shared library that uses C++ exceptions. In
1714 # this case, -static-libstdc++ will cause crashes.
1715 AC_ARG_WITH(static-standard-libraries,
1716 [AS_HELP_STRING([--with-static-standard-libraries],
1717 [use -static-libstdc++ and -static-libgcc (default=auto)])],
1718 [], [with_static_standard_libraries=auto])
1719 if test "$with_static_standard_libraries" = auto; then
1720 with_static_standard_libraries=$have_compiler
1723 # Linker flags to use for stage1 or when not bootstrapping.
1724 AC_ARG_WITH(stage1-ldflags,
1725 [AS_HELP_STRING([--with-stage1-ldflags=FLAGS], [linker flags for stage1])],
1726 [if test "$withval" = "no" -o "$withval" = "yes"; then
1729 stage1_ldflags=$withval
1732 # In stage 1, default to linking libstdc++ and libgcc statically with GCC
1733 # if supported. But if the user explicitly specified the libraries to use,
1734 # trust that they are doing what they want.
1735 if test "$with_static_standard_libraries" = yes -a "$stage1_libs" = "" \
1736 -a "$have_static_libs" = yes; then
1737 stage1_ldflags="-static-libstdc++ -static-libgcc"
1739 AC_SUBST(stage1_ldflags)
1741 # Libraries to use for stage2 and later builds.
1742 AC_ARG_WITH(boot-libs,
1743 [AS_HELP_STRING([--with-boot-libs=LIBS], [libraries for stage2 and later])],
1744 [if test "$withval" = "no" -o "$withval" = "yes"; then
1747 poststage1_libs=$withval
1750 AC_SUBST(poststage1_libs)
1752 # Linker flags to use for stage2 and later builds.
1753 AC_ARG_WITH(boot-ldflags,
1754 [AS_HELP_STRING([--with-boot-ldflags=FLAGS],
1755 [linker flags for stage2 and later])],
1756 [if test "$withval" = "no" -o "$withval" = "yes"; then
1759 poststage1_ldflags=$withval
1761 [poststage1_ldflags=
1762 # In stages 2 and 3, default to linking libstdc++ and libgcc
1763 # statically. But if the user explicitly specified the libraries to
1764 # use, trust that they are doing what they want.
1765 if test "$poststage1_libs" = ""; then
1766 poststage1_ldflags="-static-libstdc++ -static-libgcc"
1768 AC_SUBST(poststage1_ldflags)
1770 # GCC GRAPHITE dependency isl.
1771 # Basic setup is inlined here, actual checks are in config/isl.m4
1776 [Specify prefix directory for the installed isl package.
1777 Equivalent to --with-isl-include=PATH/include
1778 plus --with-isl-lib=PATH/lib])])
1780 # Treat --without-isl as a request to disable
1781 # GRAPHITE support and skip all following checks.
1782 if test "x$with_isl" != "xno"; then
1784 dnl Provide configure switches and initialize islinc & isllibs
1785 dnl with user input.
1787 dnl The versions of isl that work for Graphite
1789 dnl Only execute fail-action, if isl has been requested.
1791 AC_MSG_ERROR([Unable to find a usable isl. See config.log for details.])])
1794 # If the isl check failed, disable builds of in-tree variant of isl
1795 if test "x$with_isl" = xno ||
1796 test "x$gcc_cv_isl" = xno; then
1797 noconfigdirs="$noconfigdirs isl"
1804 # Check for LTO support.
1806 [AS_HELP_STRING([--enable-lto], [enable link time optimization support])],
1807 enable_lto=$enableval,
1808 enable_lto=yes; default_enable_lto=yes)
1810 ACX_ELF_TARGET_IFELSE([# ELF platforms build the lto-plugin always.
1811 build_lto_plugin=yes
1812 ],[if test x"$default_enable_lto" = x"yes" ; then
1814 *-apple-darwin[[912]]* | *-cygwin* | *-mingw* | *djgpp*) ;;
1815 # On other non-ELF platforms, LTO has yet to be validated.
1819 # Apart from ELF platforms, only Windows and Darwin support LTO so far.
1820 # It would also be nice to check the binutils support, but we don't
1821 # have gcc_GAS_CHECK_FEATURE available here. For now, we'll just
1822 # warn during gcc/ subconfigure; unless you're bootstrapping with
1823 # -flto it won't be needed until after installation anyway.
1825 *-cygwin* | *-mingw* | *-apple-darwin* | *djgpp*) ;;
1826 *) if test x"$enable_lto" = x"yes"; then
1827 AC_MSG_ERROR([LTO support is not enabled for this target.])
1832 # Among non-ELF, only Windows platforms support the lto-plugin so far.
1833 # Build it unless LTO was explicitly disabled.
1835 *-cygwin* | *-mingw*) build_lto_plugin=$enable_lto ;;
1840 AC_ARG_ENABLE(linker-plugin-configure-flags,
1841 [AS_HELP_STRING([[--enable-linker-plugin-configure-flags=FLAGS]],
1842 [additional flags for configuring linker plugins @<:@none@:>@])],
1843 extra_linker_plugin_configure_flags=$enableval,
1844 extra_linker_plugin_configure_flags=)
1845 AC_SUBST(extra_linker_plugin_configure_flags)
1846 AC_ARG_ENABLE(linker-plugin-flags,
1847 [AS_HELP_STRING([[--enable-linker-plugin-flags=FLAGS]],
1848 [additional flags for configuring and building linker plugins @<:@none@:>@])],
1849 extra_linker_plugin_flags=$enableval,
1850 extra_linker_plugin_flags=)
1851 AC_SUBST(extra_linker_plugin_flags)
1853 # Enable --enable-host-shared.
1854 # Checked early to determine whether jit is an 'all' language
1855 AC_ARG_ENABLE(host-shared,
1856 [AS_HELP_STRING([--enable-host-shared],
1857 [build host code as shared libraries])],
1858 [host_shared=$enableval], [host_shared=no])
1859 AC_SUBST(host_shared)
1861 # By default, C and C++ are the only stage 1 languages.
1862 stage1_languages=,c,
1864 # Target libraries that we bootstrap.
1865 bootstrap_target_libs=,target-libgcc,
1867 # Figure out what language subdirectories are present.
1868 # Look if the user specified --enable-languages="..."; if not, use
1869 # the environment variable $LANGUAGES if defined. $LANGUAGES might
1871 # NB: embedded tabs in this IF block -- do not untabify
1872 if test -d ${srcdir}/gcc; then
1873 if test x"${enable_languages+set}" != xset; then
1874 if test x"${LANGUAGES+set}" = xset; then
1875 enable_languages="${LANGUAGES}"
1876 echo configure.ac: warning: setting LANGUAGES is deprecated, use --enable-languages instead 1>&2
1878 enable_languages=default
1881 if test x"${enable_languages}" = x ||
1882 test x"${enable_languages}" = xyes;
1884 echo configure.ac: --enable-languages needs at least one language argument 1>&2
1888 enable_languages=`echo "${enable_languages}" | sed -e 's/[[ ,]][[ ,]]*/,/g' -e 's/,$//'`
1890 # 'f95' is the old name for the 'fortran' language. We issue a warning
1891 # and make the substitution.
1892 case ,${enable_languages}, in
1894 echo configure.ac: warning: 'f95' as language name is deprecated, use 'fortran' instead 1>&2
1895 enable_languages=`echo "${enable_languages}" | sed -e 's/f95/fortran/g'`
1899 # If bootstrapping, C++ must be enabled.
1900 case ",$enable_languages,:$enable_bootstrap" in
1903 if test -f ${srcdir}/gcc/cp/config-lang.in; then
1904 enable_languages="${enable_languages},c++"
1906 AC_MSG_ERROR([bootstrapping requires c++ sources])
1911 # First scan to see if an enabled language requires some other language.
1912 # We assume that a given config-lang.in will list all the language
1913 # front ends it requires, even if some are required indirectly.
1914 for lang_frag in ${srcdir}/gcc/*/config-lang.in .. ; do
1915 case ${lang_frag} in
1917 # The odd quoting in the next line works around
1918 # an apparent bug in bash 1.12 on linux.
1919 ${srcdir}/gcc/[[*]]/config-lang.in) ;;
1921 # From the config-lang.in, get $language, $lang_requires, and
1922 # $lang_requires_boot_languages.
1925 lang_requires_boot_languages=
1926 # set srcdir during sourcing lang_frag to the gcc dir.
1927 # Sadly overriding srcdir on the . line doesn't work in plain sh as it
1928 # polutes this shell
1929 saved_srcdir=${srcdir}
1930 srcdir=${srcdir}/gcc . ${lang_frag}
1931 srcdir=${saved_srcdir}
1932 for other in ${lang_requires} ${lang_requires_boot_languages}; do
1933 case ,${enable_languages}, in
1938 echo " \`$other' language required by \`$language'; enabling" 1>&2
1939 enable_languages="${enable_languages},${other}"
1943 for other in ${lang_requires_boot_languages} ; do
1944 if test "$other" != "c"; then
1945 case ,${enable_stage1_languages}, in
1950 case ,${enable_languages}, in
1952 echo " '$other' language required by '$language' in stage 1; enabling" 1>&2
1953 enable_stage1_languages="$enable_stage1_languages,${other}"
1964 new_enable_languages=,c,
1966 # If LTO is enabled, add the LTO front end.
1967 if test "$enable_lto" = "yes" ; then
1968 case ,${enable_languages}, in
1970 *) enable_languages="${enable_languages},lto" ;;
1972 if test "${build_lto_plugin}" = "yes" ; then
1973 configdirs="$configdirs lto-plugin"
1977 # If we're building an offloading compiler, add the LTO front end.
1978 if test x"$enable_as_accelerator_for" != x ; then
1979 case ,${enable_languages}, in
1981 *) enable_languages="${enable_languages},lto" ;;
1985 missing_languages=`echo ",$enable_languages," | sed -e s/,default,/,/ -e s/,all,/,/ -e s/,c,/,/ `
1986 potential_languages=,c,
1988 enabled_target_libs=
1989 disabled_target_libs=
1991 for lang_frag in ${srcdir}/gcc/*/config-lang.in .. ; do
1992 case ${lang_frag} in
1994 # The odd quoting in the next line works around
1995 # an apparent bug in bash 1.12 on linux.
1996 ${srcdir}/gcc/[[*]]/config-lang.in) ;;
1998 # From the config-lang.in, get $language, $target_libs,
1999 # $lang_dirs, $boot_language, and $build_by_default
2005 build_by_default=yes
2006 # set srcdir during sourcing. See above about save & restore
2007 saved_srcdir=${srcdir}
2008 srcdir=${srcdir}/gcc . ${lang_frag}
2009 srcdir=${saved_srcdir}
2010 if test x${language} = x; then
2011 echo "${lang_frag} doesn't set \$language." 1>&2
2015 if test "$language" = "c++"; then
2020 # C is always enabled, so no need to add it again
2021 if test "$language" != "c"; then
2022 case ,${enable_languages}, in
2024 # Language was explicitly selected; include it
2028 # All languages are enabled
2032 # 'default' was selected, select it if it is a default language
2033 add_this_lang=${build_by_default}
2038 # Disable languages that need other directories if these aren't available.
2039 for i in $subdir_requires; do
2040 test -f "$srcdir/gcc/$i/config-lang.in" && continue
2041 case ${add_this_lang} in
2043 # Specifically requested language; tell them.
2044 AC_MSG_ERROR([The gcc/$i directory contains parts of $language but is missing])
2047 AC_MSG_WARN([The gcc/$i directory contains parts of $language but is missing])
2048 add_this_lang=unsupported
2052 add_this_lang=unsupported
2057 # Disable Ada if no preexisting GNAT is available.
2058 case ${add_this_lang}:${language}:${have_gnat} in
2060 # Specifically requested language; tell them.
2061 AC_MSG_ERROR([GNAT is required to build $language])
2064 AC_MSG_WARN([GNAT is required to build $language])
2065 add_this_lang=unsupported
2069 add_this_lang=unsupported
2073 # Disable jit if -enable-host-shared not specified
2074 case ${add_this_lang}:${language}:${host_shared} in
2076 # PR jit/64780: explicitly specify --enable-host-shared
2078 Enabling language "jit" requires --enable-host-shared.
2080 --enable-host-shared typically slows the rest of the compiler down by
2081 a few %, so you must explicitly enable it.
2083 If you want to build both the jit and the regular compiler, it is often
2084 best to do this via two separate configure/builds, in separate
2085 directories, to avoid imposing the performance cost of
2086 --enable-host-shared on the regular compiler.])
2089 AC_MSG_WARN([--enable-host-shared required to build $language])
2090 add_this_lang=unsupported
2094 add_this_lang=unsupported
2098 # Disable a language that is unsupported by the target.
2099 case "${add_this_lang}: $unsupported_languages " in
2103 AC_MSG_WARN([${language} not supported for this target])
2104 add_this_lang=unsupported
2108 case $add_this_lang in
2110 # Remove language-dependent dirs.
2111 disabled_target_libs="$disabled_target_libs $target_libs"
2112 noconfigdirs="$noconfigdirs $lang_dirs"
2115 # Remove language-dependent dirs; still show language as supported.
2116 disabled_target_libs="$disabled_target_libs $target_libs"
2117 noconfigdirs="$noconfigdirs $lang_dirs"
2118 potential_languages="${potential_languages}${language},"
2121 new_enable_languages="${new_enable_languages}${language},"
2122 potential_languages="${potential_languages}${language},"
2123 missing_languages=`echo "$missing_languages" | sed "s/,$language,/,/"`
2124 enabled_target_libs="$enabled_target_libs $target_libs"
2125 case "${boot_language}:,$enable_stage1_languages," in
2126 yes:* | *:*,$language,* | *:*,yes, | *:*,all,)
2127 # Add to (comma-separated) list of stage 1 languages.
2128 case ",$stage1_languages," in
2129 *,$language,* | ,yes, | ,all,) ;;
2130 *) stage1_languages="${stage1_languages}${language}," ;;
2132 # We need to bootstrap any supporting libraries.
2133 bootstrap_target_libs="${bootstrap_target_libs}${target_libs},"
2142 # Add target libraries which are only needed for disabled languages
2144 if test -n "$disabled_target_libs"; then
2145 for dir in $disabled_target_libs; do
2146 case " $enabled_target_libs " in
2148 *) noconfigdirs="$noconfigdirs $dir" ;;
2153 AC_ARG_ENABLE(stage1-languages,
2154 [AS_HELP_STRING([[--enable-stage1-languages[=all]]],
2155 [choose additional languages to build during
2156 stage1. Mostly useful for compiler development])],
2157 [case ,${enable_stage1_languages}, in
2159 # Set it to something that will have no effect in the loop below
2160 enable_stage1_languages=c ;;
2162 enable_stage1_languages=`echo $new_enable_languages | \
2163 sed -e "s/^,//" -e "s/,$//" ` ;;
2165 enable_stage1_languages=`echo ,$enable_stage1_languages, | \
2166 sed -e "s/,all,/$new_enable_languages/" -e "s/^,//" -e "s/,$//" ` ;;
2169 # Add "good" languages from enable_stage1_languages to stage1_languages,
2170 # while "bad" languages go in missing_languages. Leave no duplicates.
2171 for i in `echo $enable_stage1_languages | sed 's/,/ /g' `; do
2172 case $potential_languages in
2174 case $stage1_languages in
2176 *) stage1_languages="$stage1_languages$i," ;;
2179 case $missing_languages in
2181 *) missing_languages="$missing_languages$i," ;;
2186 # Remove leading/trailing commas that were added for simplicity
2187 potential_languages=`echo "$potential_languages" | sed -e "s/^,//" -e "s/,$//"`
2188 missing_languages=`echo "$missing_languages" | sed -e "s/^,//" -e "s/,$//"`
2189 stage1_languages=`echo "$stage1_languages" | sed -e "s/^,//" -e "s/,$//"`
2190 new_enable_languages=`echo "$new_enable_languages" | sed -e "s/^,//" -e "s/,$//"`
2192 if test "x$missing_languages" != x; then
2194 The following requested languages could not be built: ${missing_languages}
2195 Supported languages are: ${potential_languages}])
2197 if test "x$new_enable_languages" != "x$enable_languages"; then
2198 echo The following languages will be built: ${new_enable_languages}
2199 enable_languages="$new_enable_languages"
2202 AC_SUBST(stage1_languages)
2203 ac_configure_args=`echo " $ac_configure_args" | sed -e "s/ '--enable-languages=[[^ ]]*'//g" -e "s/$/ '--enable-languages="$enable_languages"'/" `
2206 # Handle --disable-<component> generically.
2207 for dir in $configdirs $build_configdirs $target_configdirs ; do
2208 dirname=`echo $dir | sed -e s/target-//g -e s/build-//g -e s/-/_/g`
2209 varname=`echo $dirname | sed -e s/+/_/g`
2210 if eval test x\${enable_${varname}} "=" xno ; then
2211 noconfigdirs="$noconfigdirs $dir"
2215 # Check for Boehm's garbage collector
2216 AC_ARG_ENABLE(objc-gc,
2217 [AS_HELP_STRING([--enable-objc-gc],
2218 [enable use of Boehm's garbage collector with the
2219 GNU Objective-C runtime])])
2220 AC_ARG_WITH([target-bdw-gc],
2221 [AS_HELP_STRING([--with-target-bdw-gc=PATHLIST],
2222 [specify prefix directory for installed bdw-gc package.
2223 Equivalent to --with-target-bdw-gc-include=PATH/include
2224 plus --with-target-bdw-gc-lib=PATH/lib])])
2225 AC_ARG_WITH([target-bdw-gc-include],
2226 [AS_HELP_STRING([--with-target-bdw-gc-include=PATHLIST],
2227 [specify directories for installed bdw-gc include files])])
2228 AC_ARG_WITH([target-bdw-gc-lib],
2229 [AS_HELP_STRING([--with-target-bdw-gc-lib=PATHLIST],
2230 [specify directories for installed bdw-gc library])])
2232 case ,${enable_languages},:${enable_objc_gc} in *,objc,*:yes|*,objc,*:auto)
2233 AC_MSG_CHECKING([for bdw garbage collector])
2234 if test "x$with_target_bdw_gc$with_target_bdw_gc_include$with_target_bdw_gc_lib" = x; then
2235 dnl no bdw-gw options, assume default locations
2236 AC_MSG_RESULT([using bdw-gc in default locations])
2238 dnl bdw-gw options, first error checking, complete checking in libobjc
2239 if test "x$with_target_bdw_gc_include" = x && test "x$with_target_bdw_gc_lib" != x; then
2240 AC_MSG_ERROR([found --with-target-bdw-gc-lib but --with-target-bdw-gc-include missing])
2241 elif test "x$with_target_bdw_gc_include" != x && test "x$with_target_bdw_gc_lib" = x; then
2242 AC_MSG_ERROR([found --with-target-bdw-gc-include but --with-target-bdw-gc-lib missing])
2244 AC_MSG_RESULT([using paths configured with --with-target-bdw-gc options])
2249 # Disable libitm, libsanitizer, libvtv, liboffloadmic if we're not building C++
2250 case ,${enable_languages}, in
2252 # Disable libitm, libsanitizer if we're not building libstdc++
2253 case "${noconfigdirs}" in
2254 *target-libstdc++-v3*)
2255 noconfigdirs="$noconfigdirs target-libitm target-libsanitizer"
2261 noconfigdirs="$noconfigdirs target-liboffloadmic target-libitm target-libsanitizer target-libvtv"
2265 # If gcc/ is not in the source tree then we'll not be building a
2266 # target compiler, assume in that case we don't want to build any
2267 # target libraries or tools.
2269 # This was added primarily for the benefit for binutils-gdb who reuse
2270 # this configure script, but don't always have target tools available.
2271 if test ! -d ${srcdir}/gcc; then
2272 skipdirs="${skipdirs} ${target_configdirs}"
2275 # Remove the entries in $skipdirs and $noconfigdirs from $configdirs,
2276 # $build_configdirs and $target_configdirs.
2277 # If we have the source for $noconfigdirs entries, add them to $notsupp.
2280 for dir in . $skipdirs $noconfigdirs ; do
2281 dirname=`echo $dir | sed -e s/target-//g -e s/build-//g`
2282 if test $dir != . && echo " ${configdirs} " | grep " ${dir} " >/dev/null 2>&1; then
2283 configdirs=`echo " ${configdirs} " | sed -e "s/ ${dir} / /"`
2284 if test -r $srcdir/$dirname/configure ; then
2285 if echo " ${skipdirs} " | grep " ${dir} " >/dev/null 2>&1; then
2288 notsupp="$notsupp $dir"
2292 if test $dir != . && echo " ${build_configdirs} " | grep " ${dir} " >/dev/null 2>&1; then
2293 build_configdirs=`echo " ${build_configdirs} " | sed -e "s/ ${dir} / /"`
2294 if test -r $srcdir/$dirname/configure ; then
2295 if echo " ${skipdirs} " | grep " ${dir} " >/dev/null 2>&1; then
2298 notsupp="$notsupp $dir"
2302 if test $dir != . && echo " ${target_configdirs} " | grep " ${dir} " >/dev/null 2>&1; then
2303 target_configdirs=`echo " ${target_configdirs} " | sed -e "s/ ${dir} / /"`
2304 if test -r $srcdir/$dirname/configure ; then
2305 if echo " ${skipdirs} " | grep " ${dir} " >/dev/null 2>&1; then
2308 notsupp="$notsupp $dir"
2314 # Quietly strip out all directories which aren't configurable in this tree.
2315 # This relies on all configurable subdirectories being autoconfiscated, which
2317 build_configdirs_all="$build_configdirs"
2319 for i in ${build_configdirs_all} ; do
2320 j=`echo $i | sed -e s/build-//g`
2321 if test -f ${srcdir}/$j/configure ; then
2322 build_configdirs="${build_configdirs} $i"
2326 configdirs_all="$configdirs"
2328 for i in ${configdirs_all} ; do
2329 if test -f ${srcdir}/$i/configure ; then
2330 configdirs="${configdirs} $i"
2334 target_configdirs_all="$target_configdirs"
2336 for i in ${target_configdirs_all} ; do
2337 j=`echo $i | sed -e s/target-//g`
2338 if test -f ${srcdir}/$j/configure ; then
2339 target_configdirs="${target_configdirs} $i"
2343 # libiberty-linker-plugin is special: it doesn't have its own source directory,
2344 # so we have to add it after the preceding checks.
2345 if test x"$extra_linker_plugin_flags$extra_linker_plugin_configure_flags" != x
2347 case " $configdirs " in
2349 # If we can build libiberty, we can also build libiberty-linker-plugin.
2350 configdirs="$configdirs libiberty-linker-plugin"
2351 extra_linker_plugin_configure_flags="$extra_linker_plugin_configure_flags \
2352 --with-libiberty=../libiberty-linker-plugin";;
2354 AC_MSG_ERROR([libiberty missing]);;
2358 # Sometimes we have special requirements for the host libiberty.
2359 extra_host_libiberty_configure_flags=
2360 case " $configdirs " in
2361 *" lto-plugin "* | *" libcc1 "* | *" gdbserver "*)
2362 # When these are to be built as shared libraries, the same applies to
2364 extra_host_libiberty_configure_flags=--enable-shared
2367 AC_SUBST(extra_host_libiberty_configure_flags)
2369 # Sometimes we have special requirements for the host zlib.
2370 extra_host_zlib_configure_flags=
2371 case " $configdirs " in
2373 # When bfd is to be built as a shared library, the same applies to
2375 if test "$enable_shared" = "yes"; then
2376 extra_host_zlib_configure_flags=--enable-host-shared
2380 AC_SUBST(extra_host_zlib_configure_flags)
2382 # Produce a warning message for the subdirs we can't configure.
2383 # This isn't especially interesting in the Cygnus tree, but in the individual
2384 # FSF releases, it's important to let people know when their machine isn't
2385 # supported by the one or two programs in a package.
2387 if test -n "${notsupp}" && test -z "${norecursion}" ; then
2388 # If $appdirs is non-empty, at least one of those directories must still
2389 # be configured, or we error out. (E.g., if the gas release supports a
2390 # specified target in some subdirs but not the gas subdir, we shouldn't
2391 # pretend that all is well.)
2392 if test -n "$appdirs" ; then
2393 for dir in $appdirs ; do
2394 if test -r $dir/Makefile.in ; then
2395 if echo " ${configdirs} " | grep " ${dir} " >/dev/null 2>&1; then
2399 if echo " ${target_configdirs} " | grep " target-${dir} " >/dev/null 2>&1; then
2405 if test -n "$appdirs" ; then
2406 echo "*** This configuration is not supported by this package." 1>&2
2410 # Okay, some application will build, or we don't care to check. Still
2411 # notify of subdirs not getting built.
2412 echo "*** This configuration is not supported in the following subdirectories:" 1>&2
2413 echo " ${notsupp}" 1>&2
2414 echo " (Any other directories should still work fine.)" 1>&2
2422 # To find our prefix, in gcc_cv_tool_prefix.
2427 AC_ARG_WITH([build-sysroot],
2428 [AS_HELP_STRING([--with-build-sysroot=SYSROOT],
2429 [use sysroot as the system root during the build])],
2430 [if test x"$withval" != x ; then
2431 SYSROOT_CFLAGS_FOR_TARGET="--sysroot=$withval"
2433 [SYSROOT_CFLAGS_FOR_TARGET=])
2434 AC_SUBST(SYSROOT_CFLAGS_FOR_TARGET)
2436 AC_ARG_WITH([debug-prefix-map],
2437 [AS_HELP_STRING([--with-debug-prefix-map='A=B C=D ...'],
2438 [map A to B, C to D ... in debug information])],
2439 [if test x"$withval" != x; then
2440 DEBUG_PREFIX_CFLAGS_FOR_TARGET=
2441 for debug_map in $withval; do
2442 DEBUG_PREFIX_CFLAGS_FOR_TARGET="$DEBUG_PREFIX_CFLAGS_FOR_TARGET -fdebug-prefix-map=$debug_map"
2445 [DEBUG_PREFIX_CFLAGS_FOR_TARGET=])
2446 AC_SUBST(DEBUG_PREFIX_CFLAGS_FOR_TARGET)
2448 # During gcc bootstrap, if we use some random cc for stage1 then CFLAGS
2449 # might be empty or "-g". We don't require a C++ compiler, so CXXFLAGS
2450 # might also be empty (or "-g", if a non-GCC C++ compiler is in the path).
2451 # We want to ensure that TARGET libraries (which we know are built with
2452 # gcc) are built with "-O2 -g", so include those options when setting
2453 # CFLAGS_FOR_TARGET and CXXFLAGS_FOR_TARGET.
2454 if test "x$CFLAGS_FOR_TARGET" = x; then
2455 if test "x${is_cross_compiler}" = xyes; then
2456 CFLAGS_FOR_TARGET="-g -O2"
2458 CFLAGS_FOR_TARGET=$CFLAGS
2461 *) CFLAGS_FOR_TARGET="-O2 $CFLAGS_FOR_TARGET" ;;
2464 *" -g "* | *" -g3 "*) ;;
2465 *) CFLAGS_FOR_TARGET="-g $CFLAGS_FOR_TARGET" ;;
2469 AC_SUBST(CFLAGS_FOR_TARGET)
2471 if test "x$CXXFLAGS_FOR_TARGET" = x; then
2472 if test "x${is_cross_compiler}" = xyes; then
2473 CXXFLAGS_FOR_TARGET="-g -O2"
2475 CXXFLAGS_FOR_TARGET=$CXXFLAGS
2476 case " $CXXFLAGS " in
2478 *) CXXFLAGS_FOR_TARGET="-O2 $CXXFLAGS_FOR_TARGET" ;;
2480 case " $CXXFLAGS " in
2481 *" -g "* | *" -g3 "*) ;;
2482 *) CXXFLAGS_FOR_TARGET="-g $CXXFLAGS_FOR_TARGET" ;;
2486 AC_SUBST(CXXFLAGS_FOR_TARGET)
2488 AC_SUBST(LDFLAGS_FOR_TARGET)
2490 # Handle --with-headers=XXX. If the value is not "yes", the contents of
2491 # the named directory are copied to $(tooldir)/sys-include.
2492 if test x"${with_headers}" != x && test x"${with_headers}" != xno ; then
2493 if test x${is_cross_compiler} = xno ; then
2494 echo 1>&2 '***' --with-headers is only supported when cross compiling
2497 if test x"${with_headers}" != xyes ; then
2498 x=${gcc_cv_tool_prefix}
2499 copy_dirs="${copy_dirs} ${with_headers} $x/${target_noncanonical}/sys-include"
2503 # Handle --with-libs=XXX. If the value is not "yes", the contents of
2504 # the name directories are copied to $(tooldir)/lib. Multiple directories
2506 if test x"${with_libs}" != x && test x"${with_libs}" != xno ; then
2507 if test x${is_cross_compiler} = xno ; then
2508 echo 1>&2 '***' --with-libs is only supported when cross compiling
2511 if test x"${with_libs}" != xyes ; then
2512 # Copy the libraries in reverse order, so that files in the first named
2513 # library override files in subsequent libraries.
2514 x=${gcc_cv_tool_prefix}
2515 for l in ${with_libs}; do
2516 copy_dirs="$l $x/${target_noncanonical}/lib ${copy_dirs}"
2521 # Set with_gnu_as, with_gnu_ld, and with_system_zlib as appropriate.
2523 # This is done by determining whether or not the appropriate directory
2524 # is available, and by checking whether or not specific configurations
2525 # have requested that this magic not happen.
2527 # The command line options always override the explicit settings in
2528 # configure.ac, and the settings in configure.ac override this magic.
2530 # If the default for a toolchain is to use GNU as and ld, and you don't
2531 # want to do that, then you should use the --without-gnu-as and
2532 # --without-gnu-ld options for the configure script. Similarly, if
2533 # the default is to use the included zlib and you don't want to do that,
2534 # you should use the --with-system-zlib option for the configure script.
2536 if test x${use_gnu_as} = x &&
2537 echo " ${configdirs} " | grep " gas " > /dev/null 2>&1 ; then
2539 extra_host_args="$extra_host_args --with-gnu-as"
2542 if test x${use_gnu_ld} = x &&
2543 echo " ${configdirs} " | egrep " (go)?ld " > /dev/null 2>&1 ; then
2545 extra_host_args="$extra_host_args --with-gnu-ld"
2548 if test x${use_included_zlib} = x &&
2549 echo " ${configdirs} " | grep " zlib " > /dev/null 2>&1 ; then
2552 with_system_zlib=yes
2553 extra_host_args="$extra_host_args --with-system-zlib"
2556 # If using newlib, add --with-newlib to the extra_host_args so that gcc/configure
2557 # can detect this case.
2559 if test x${with_newlib} != xno && echo " ${target_configdirs} " | grep " target-newlib " > /dev/null 2>&1 ; then
2561 extra_host_args="$extra_host_args --with-newlib"
2564 # Handle ${copy_dirs}
2565 set fnord ${copy_dirs}
2567 while test $# != 0 ; do
2568 if test -f $2/COPIED && test x"`cat $2/COPIED`" = x"$1" ; then
2571 echo Copying $1 to $2
2573 # Use the install script to create the directory and all required
2574 # parent directories.
2575 if test -d $2 ; then
2579 ${srcdir}/install-sh -c -m 644 config.temp $2/COPIED
2582 # Copy the directory, assuming we have tar.
2583 # FIXME: Should we use B in the second tar? Not all systems support it.
2584 (cd $1; tar -cf - .) | (cd $2; tar -xpf -)
2586 # It is the responsibility of the user to correctly adjust all
2587 # symlinks. If somebody can figure out how to handle them correctly
2588 # here, feel free to add the code.
2595 # Determine a target-dependent exec_prefix that the installed
2596 # gcc will search in. Keep this list sorted by triplet, with
2597 # the *-*-osname triplets last.
2600 i[[34567]]86-pc-msdosdjgpp*)
2601 md_exec_prefix=/dev/env/DJDIR/bin
2606 md_exec_prefix=/usr/ccs/bin
2610 extra_arflags_for_target=
2611 extra_nmflags_for_target=
2612 extra_ranlibflags_for_target=
2613 target_makefile_frag=/dev/null
2616 target_makefile_frag="config/mt-spu"
2618 mips*-sde-elf* | mips*-mti-elf* | mips*-img-elf*)
2619 target_makefile_frag="config/mt-sde"
2621 mipsisa*-*-elfoabi*)
2622 target_makefile_frag="config/mt-mips-elfoabi"
2624 mips*-*-*linux* | mips*-*-gnu*)
2625 target_makefile_frag="config/mt-mips-gnu"
2628 target_makefile_frag="config/mt-nios2-elf"
2631 target_makefile_frag="config/mt-android"
2633 *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu | *-*-kopensolaris*-gnu)
2634 target_makefile_frag="config/mt-gnu"
2636 *-*-aix4.[[3456789]]* | *-*-aix[[56789]].*)
2637 # nm and ar from AIX 4.3 and above require -X32_64 flag to all ar and nm
2638 # commands to handle both 32-bit and 64-bit objects. These flags are
2639 # harmless if we're using GNU nm or ar.
2640 extra_arflags_for_target=" -X32_64"
2641 extra_nmflags_for_target=" -B -X32_64"
2645 alphaieee_frag=/dev/null
2648 # This just makes sure to use the -mieee option to build target libs.
2649 # This should probably be set individually by each library.
2650 alphaieee_frag="config/mt-alphaieee"
2654 # If --enable-target-optspace always use -Os instead of -O2 to build
2655 # the target libraries, similarly if it is not specified, use -Os
2656 # on selected platforms.
2657 ospace_frag=/dev/null
2658 case "${enable_target_optspace}:${target}" in
2660 ospace_frag="config/mt-ospace"
2663 ospace_frag="config/mt-d30v"
2665 :m32r-* | :d10v-* | :fr30-* | :i?86*-*-elfiamcu)
2666 ospace_frag="config/mt-ospace"
2671 echo "*** bad value \"${enable_target_optspace}\" for --enable-target-optspace flag; ignored" 1>&2
2675 # Some systems (e.g., one of the i386-aix systems the gas testers are
2676 # using) don't handle "\$" correctly, so don't use it here.
2677 tooldir='${exec_prefix}'/${target_noncanonical}
2678 build_tooldir=${tooldir}
2680 # Create a .gdbinit file which runs the one in srcdir
2681 # and tells GDB to look there for source files.
2683 if test -r ${srcdir}/.gdbinit ; then
2686 *) cat > ./.gdbinit <<EOF
2690 source ${srcdir}/.gdbinit
2696 # Make sure that the compiler is able to generate an executable. If it
2697 # can't, we are probably in trouble. We don't care whether we can run the
2698 # executable--we might be using a cross compiler--we only care whether it
2699 # can be created. At this point the main configure script has set CC.
2701 echo "int main () { return 0; }" > conftest.c
2702 ${CC} -o conftest ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} conftest.c
2703 if test $? = 0 ; then
2704 if test -s conftest || test -s conftest.exe ; then
2710 echo 1>&2 "*** The command '${CC} -o conftest ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} conftest.c' failed."
2711 echo 1>&2 "*** You must set the environment variable CC to a working compiler."
2718 # Decide which environment variable is used to find dynamic libraries.
2720 *-*-hpux*) RPATH_ENVVAR=SHLIB_PATH ;;
2721 *-*-darwin*) RPATH_ENVVAR=DYLD_LIBRARY_PATH ;;
2722 *-*-mingw* | *-*-cygwin ) RPATH_ENVVAR=PATH ;;
2723 *) RPATH_ENVVAR=LD_LIBRARY_PATH ;;
2726 # On systems where the dynamic library environment variable is PATH,
2727 # gcc/ will put dynamic libraries into a subdirectory to avoid adding
2728 # built executables to PATH.
2729 if test "$RPATH_ENVVAR" = PATH; then
2730 GCC_SHLIB_SUBDIR=/shlib
2735 # Adjust the toplevel makefile according to whether bootstrap was selected.
2736 case $enable_bootstrap in
2738 bootstrap_suffix=bootstrap
2739 BUILD_CONFIG=bootstrap-debug
2742 bootstrap_suffix=no-bootstrap
2747 AC_MSG_CHECKING(for default BUILD_CONFIG)
2749 AC_ARG_WITH([build-config],
2750 [AS_HELP_STRING([--with-build-config='NAME NAME2...'],
2751 [use config/NAME.mk build configuration])],
2752 [case $with_build_config in
2753 yes) with_build_config= ;;
2754 no) with_build_config= BUILD_CONFIG= ;;
2757 if test "x${with_build_config}" != x; then
2758 BUILD_CONFIG=$with_build_config
2760 case $BUILD_CONFIG in
2762 if echo "int f (void) { return 0; }" > conftest.c &&
2763 ${CC} -c conftest.c &&
2764 mv conftest.o conftest.o.g0 &&
2765 ${CC} -c -g conftest.c &&
2766 mv conftest.o conftest.o.g &&
2767 ${srcdir}/contrib/compare-debug conftest.o.g0 conftest.o.g > /dev/null 2>&1; then
2772 rm -f conftest.c conftest.o conftest.o.g0 conftest.o.g
2776 AC_MSG_RESULT($BUILD_CONFIG)
2777 AC_SUBST(BUILD_CONFIG)
2779 # Use same top-level configure hooks in libgcc/libstdc++/libvtv.
2780 AC_MSG_CHECKING([for --enable-vtable-verify])
2781 AC_ARG_ENABLE(vtable-verify,
2782 [AS_HELP_STRING([--enable-vtable-verify],
2783 [Enable vtable verification feature])],
2784 [case "$enableval" in
2785 yes) enable_vtable_verify=yes ;;
2786 no) enable_vtable_verify=no ;;
2787 *) enable_vtable_verify=no;;
2789 [enable_vtable_verify=no])
2790 AC_MSG_RESULT($enable_vtable_verify)
2792 # Record target_configdirs and the configure arguments for target and
2793 # build configuration in Makefile.
2794 target_configdirs=`echo "${target_configdirs}" | sed -e 's/target-//g'`
2795 build_configdirs=`echo "${build_configdirs}" | sed -e 's/build-//g'`
2796 bootstrap_fixincludes=no
2798 # If we are building libgomp, bootstrap it.
2799 if echo " ${target_configdirs} " | grep " libgomp " > /dev/null 2>&1 ; then
2800 bootstrap_target_libs=${bootstrap_target_libs}target-libgomp,
2803 # If we are building libsanitizer and $BUILD_CONFIG contains bootstrap-asan
2804 # or bootstrap-ubsan, bootstrap it.
2805 if echo " ${target_configdirs} " | grep " libsanitizer " > /dev/null 2>&1; then
2806 case "$BUILD_CONFIG" in
2807 *bootstrap-asan* | *bootstrap-ubsan* )
2808 bootstrap_target_libs=${bootstrap_target_libs}target-libsanitizer,
2809 bootstrap_fixincludes=yes
2814 # If we are building libvtv and --enable-vtable-verify, bootstrap it.
2815 if echo " ${target_configdirs} " | grep " libvtv " > /dev/null 2>&1 &&
2816 test "$enable_vtable_verify" != no; then
2817 bootstrap_target_libs=${bootstrap_target_libs}target-libvtv,
2820 # Determine whether gdb needs tk/tcl or not.
2821 # Use 'maybe' since enable_gdbtk might be true even if tk isn't available
2822 # and in that case we want gdb to be built without tk. Ugh!
2823 # In fact I believe gdb is the *only* package directly dependent on tk,
2824 # so we should be able to put the 'maybe's in unconditionally and
2825 # leave out the maybe dependencies when enable_gdbtk is false. I'm not
2826 # 100% sure that that's safe though.
2828 gdb_tk="maybe-all-tcl maybe-all-tk maybe-all-itcl maybe-all-libgui"
2829 case "$enable_gdbtk" in
2833 GDB_TK="${gdb_tk}" ;;
2835 # Only add the dependency on gdbtk when GDBtk is part of the gdb
2836 # distro. Eventually someone will fix this and move Insight, nee
2837 # gdbtk to a separate directory.
2838 if test -d ${srcdir}/gdb/gdbtk ; then
2845 CONFIGURE_GDB_TK=`echo ${GDB_TK} | sed s/-all-/-configure-/g`
2846 INSTALL_GDB_TK=`echo ${GDB_TK} | sed s/-all-/-install-/g`
2848 # gdb and gdbserver depend on gnulib and gdbsupport, but as nothing
2849 # else does, only include them if one of these is built. The Makefile
2850 # provides the ordering, so it's enough here to add to the list.
2851 case " ${configdirs} " in
2853 configdirs="${configdirs} gnulib gdbsupport"
2856 configdirs="${configdirs} gnulib gdbsupport"
2859 configdirs="${configdirs} gnulib"
2863 # Strip out unwanted targets.
2865 # While at that, we remove Makefiles if we were started for recursive
2866 # configuration, so that the top-level Makefile reconfigures them,
2867 # like we used to do when configure itself was recursive.
2869 # Loop over modules. We used to use the "$extrasub" feature from Autoconf
2870 # but now we're fixing up the Makefile ourselves with the additional
2871 # commands passed to AC_CONFIG_FILES. Use separate variables
2872 # extrasub-{build,host,target} not because there is any reason to split
2873 # the substitutions up that way, but only to remain below the limit of
2874 # 99 commands in a script, for HP-UX sed.
2876 # Do not nest @if/@endif or @unless/@endunless pairs, because
2877 # configure will not warn you at all.
2879 case "$enable_bootstrap:$ENABLE_GOLD: $configdirs :,$stage1_languages," in
2880 yes:yes:*\ gold\ *:*,c++,*) ;;
2881 yes:yes:*\ gold\ *:*)
2882 AC_MSG_ERROR([in a combined tree, bootstrapping with --enable-gold requires c++ in stage1_languages])
2887 for module in ${build_configdirs} ; do
2888 if test -z "${no_recursion}" \
2889 && test -f ${build_subdir}/${module}/Makefile; then
2890 echo 1>&2 "*** removing ${build_subdir}/${module}/Makefile to force reconfigure"
2891 rm -f ${build_subdir}/${module}/Makefile
2893 extrasub_build="$extrasub_build
2894 /^@if build-$module\$/d
2895 /^@endif build-$module\$/d
2896 /^@unless build-$module\$/,/^@endunless build-$module\$/d
2897 /^@if build-$module-$bootstrap_suffix\$/d
2898 /^@endif build-$module-$bootstrap_suffix\$/d
2899 /^@unless build-$module-$bootstrap_suffix\$/,/^@endunless build-$module-$bootstrap_suffix\$/d"
2902 for module in ${configdirs} ; do
2903 if test -z "${no_recursion}"; then
2904 for file in stage*-${module}/Makefile prev-${module}/Makefile ${module}/Makefile; do
2905 if test -f ${file}; then
2906 echo 1>&2 "*** removing ${file} to force reconfigure"
2911 case ${module},${bootstrap_fixincludes} in
2912 fixincludes,no) host_bootstrap_suffix=no-bootstrap ;;
2913 *) host_bootstrap_suffix=$bootstrap_suffix ;;
2915 extrasub_host="$extrasub_host
2917 /^@endif $module\$/d
2918 /^@unless $module\$/,/^@endunless $module\$/d
2919 /^@if $module-$host_bootstrap_suffix\$/d
2920 /^@endif $module-$host_bootstrap_suffix\$/d
2921 /^@unless $module-$host_bootstrap_suffix\$/,/^@endunless $module-$host_bootstrap_suffix\$/d"
2924 for module in ${target_configdirs} ; do
2925 if test -z "${no_recursion}" \
2926 && test -f ${target_subdir}/${module}/Makefile; then
2927 echo 1>&2 "*** removing ${target_subdir}/${module}/Makefile to force reconfigure"
2928 rm -f ${target_subdir}/${module}/Makefile
2931 # We only bootstrap target libraries listed in bootstrap_target_libs.
2932 case $bootstrap_target_libs in
2933 *,target-$module,*) target_bootstrap_suffix=$bootstrap_suffix ;;
2934 *) target_bootstrap_suffix=no-bootstrap ;;
2937 extrasub_target="$extrasub_target
2938 /^@if target-$module\$/d
2939 /^@endif target-$module\$/d
2940 /^@unless target-$module\$/,/^@endunless target-$module\$/d
2941 /^@if target-$module-$target_bootstrap_suffix\$/d
2942 /^@endif target-$module-$target_bootstrap_suffix\$/d
2943 /^@unless target-$module-$target_bootstrap_suffix\$/,/^@endunless target-$module-$target_bootstrap_suffix\$/d"
2946 # Do the final fixup along with target modules.
2947 extrasub_target="$extrasub_target
2952 if test "$enable_pgo_build" != "no"; then
2953 extrasub_build="$extrasub_build
2955 /^@endif pgo-build\$/d"
2958 # Create the serialization dependencies. This uses a temporary file.
2960 AC_ARG_ENABLE([serial-configure],
2961 [AS_HELP_STRING([[--enable-serial-[{host,target,build}-]configure]],
2962 [force sequential configuration of
2963 sub-packages for the host, target or build
2964 machine, or all sub-packages])])
2966 case ${enable_serial_configure} in
2968 enable_serial_build_configure=yes
2969 enable_serial_host_configure=yes
2970 enable_serial_target_configure=yes
2974 # These force 'configure's to be done one at a time, to avoid problems
2975 # with contention over a shared config.cache.
2977 echo '# serdep.tmp' > serdep.tmp
2979 test "x${enable_serial_build_configure}" = xyes &&
2980 for item in ${build_configdirs} ; do
2983 *) echo "configure-build-${item}: configure-build-${olditem}" >> serdep.tmp ;;
2988 test "x${enable_serial_host_configure}" = xyes &&
2989 for item in ${configdirs} ; do
2992 *) echo "configure-${item}: configure-${olditem}" >> serdep.tmp ;;
2997 test "x${enable_serial_target_configure}" = xyes &&
2998 for item in ${target_configdirs} ; do
3001 *) echo "configure-target-${item}: configure-target-${olditem}" >> serdep.tmp ;;
3005 serialization_dependencies=serdep.tmp
3006 AC_SUBST_FILE(serialization_dependencies)
3008 # Base args. Strip norecursion, cache-file, srcdir, host, build,
3009 # target, nonopt, and variable assignments. These are the ones we
3010 # might not want to pass down to subconfigures. The exception being
3011 # --cache-file=/dev/null, which is used to turn off the use of cache
3012 # files altogether, and which should be passed on to subconfigures.
3013 # Also strip program-prefix, program-suffix, and program-transform-name,
3014 # so that we can pass down a consistent program-transform-name.
3019 eval "set -- $ac_configure_args"
3022 if test X"$skip_next" = X"yes"; then
3026 if test X"$keep_next" = X"yes"; then
3029 ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
3031 baseargs="$baseargs '$ac_arg'"
3032 tbaseargs="$tbaseargs '$ac_arg'"
3037 # Handle separated arguments. Based on the logic generated by
3040 *=* | --config-cache | -C | -disable-* | --disable-* \
3041 | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
3042 | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
3043 | -with-* | --with-* | -without-* | --without-* | --x)
3057 --with-* | --without-*)
3058 libopt=`echo "$ac_arg" | sed -e 's,^--[^-_]*[-_],,' -e 's,=.*$,,'`
3062 lib=`echo "$libopt" | sed 's,[-_]include$,,'`
3065 lib=`echo "$libopt" | sed 's,[-_]lib$,,'`
3074 mpc | mpfr | gmp | isl)
3075 # If we're processing --with-$lib, --with-$lib-include or
3076 # --with-$lib-lib, for one of the libs above, and target is
3077 # different from host, don't pass the current argument to any
3078 # target library's configure.
3079 if test x$is_cross_compiler = xyes; then
3088 --cache-file=/dev/null | \
3089 -cache-file=/dev/null )
3090 # Handled here to avoid the test to skip args below.
3091 baseargs="$baseargs '$ac_arg'"
3092 tbaseargs="$tbaseargs '$ac_arg'"
3093 # Assert: $separate_arg should always be no.
3094 keep_next=$separate_arg
3110 -program-prefix* | \
3111 -program-suffix* | \
3112 -program-transform-name* )
3113 skip_next=$separate_arg
3117 # An option. Add it.
3120 ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
3122 baseargs="$baseargs '$ac_arg'"
3123 if test X"$skip_targ" = Xno; then
3124 tbaseargs="$tbaseargs '$ac_arg'"
3126 keep_next=$separate_arg
3129 # Either a variable assignment, or a nonopt (triplet). Don't
3130 # pass it down; let the Makefile handle this.
3135 # Remove the initial space we just introduced and, as these will be
3136 # expanded by make, quote '$'.
3137 baseargs=`echo "x$baseargs" | sed -e 's/^x *//' -e 's,\\$,$$,g'`
3139 # Add in --program-transform-name, after --program-prefix and
3140 # --program-suffix have been applied to it. Autoconf has already
3141 # doubled dollar signs and backslashes in program_transform_name; we want
3142 # the backslashes un-doubled, and then the entire thing wrapped in single
3143 # quotes, because this will be expanded first by make and then by the shell.
3144 # Also, because we want to override the logic in subdir configure scripts to
3145 # choose program_transform_name, replace any s,x,x, with s,y,y,.
3146 sed -e "s,\\\\\\\\,\\\\,g; s,','\\\\'',g; s/s,x,x,/s,y,y,/" <<EOF_SED > conftestsed.out
3147 ${program_transform_name}
3149 gcc_transform_name=`cat conftestsed.out`
3150 rm -f conftestsed.out
3151 baseargs="$baseargs --program-transform-name='${gcc_transform_name}'"
3152 tbaseargs="$tbaseargs --program-transform-name='${gcc_transform_name}'"
3153 if test "$silent" = yes; then
3154 baseargs="$baseargs --silent"
3155 tbaseargs="$tbaseargs --silent"
3158 baseargs="$baseargs --disable-option-checking"
3159 tbaseargs="$tbaseargs --disable-option-checking"
3161 if test "$enable_year2038" = no; then
3162 baseargs="$baseargs --disable-year2038"
3163 tbaseargs="$tbaseargs --disable-year2038"
3166 # Record and document user additions to sub configure arguments.
3167 AC_ARG_VAR([build_configargs],
3168 [additional configure arguments for build directories])
3169 AC_ARG_VAR([host_configargs],
3170 [additional configure arguments for host directories])
3171 AC_ARG_VAR([target_configargs],
3172 [additional configure arguments for target directories])
3174 # For the build-side libraries, we just need to pretend we're native,
3175 # and not use the same cache file. Multilibs are neither needed nor
3176 # desired. We can't even use the same cache file for all build-side
3177 # libraries, as they're compiled differently; some with C, some with
3178 # C++ or with different feature-enabling options.
3179 build_configargs="$build_configargs --cache-file=./config.cache ${baseargs}"
3181 # For host modules, accept cache file option, or specification as blank.
3182 case "${cache_file}" in
3184 cache_file_option="" ;;
3185 /* | [[A-Za-z]]:[[\\/]]* ) # absolute path
3186 cache_file_option="--cache-file=${cache_file}" ;;
3188 cache_file_option="--cache-file=../${cache_file}" ;;
3191 # Host dirs don't like to share a cache file either, horribly enough.
3192 # This seems to be due to autoconf 2.5x stupidity.
3193 host_configargs="$host_configargs --cache-file=./config.cache ${extra_host_args} ${baseargs}"
3195 target_configargs="$target_configargs ${tbaseargs}"
3197 # Passing a --with-cross-host argument lets the target libraries know
3198 # whether they are being built with a cross-compiler or being built
3199 # native. However, it would be better to use other mechanisms to make the
3200 # sorts of decisions they want to make on this basis. Please consider
3201 # this option to be deprecated. FIXME.
3202 if test x${is_cross_compiler} = xyes ; then
3203 target_configargs="--with-cross-host=${host_noncanonical} ${target_configargs}"
3206 # Special user-friendly check for native x86_64-linux build, if
3207 # multilib is not explicitly enabled.
3208 case "$target:$have_compiler:$host:$target:$enable_multilib" in
3209 x86_64-*linux*:yes:$build:$build:)
3210 # Make sure we have a development environment that handles 32-bit
3212 echo "int main () { return 0; }" > conftest.c
3213 ${CC} -m32 -o conftest ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} conftest.c
3214 if test $? = 0 ; then
3215 if test -s conftest || test -s conftest.exe ; then
3220 if test x${dev64} != xyes ; then
3221 AC_MSG_ERROR([I suspect your system does not have 32-bit development libraries (libc and headers). If you have them, rerun configure with --enable-multilib. If you do not have them, and want to build a 64-bit-only compiler, rerun configure with --disable-multilib.])
3226 # Default to --enable-multilib.
3227 if test x${enable_multilib} = x ; then
3228 target_configargs="--enable-multilib ${target_configargs}"
3231 # Pass --with-newlib if appropriate. Note that target_configdirs has
3232 # changed from the earlier setting of with_newlib.
3233 if test x${with_newlib} != xno && echo " ${target_configdirs} " | grep " newlib " > /dev/null 2>&1 && test -d ${srcdir}/newlib ; then
3234 target_configargs="--with-newlib ${target_configargs}"
3237 # Different target subdirs use different values of certain variables
3238 # (notably CXX). Worse, multilibs use *lots* of different values.
3239 # Worse yet, autoconf 2.5x makes some of these 'precious', meaning that
3240 # it doesn't automatically accept command-line overrides of them.
3241 # This means it's not safe for target subdirs to share a cache file,
3242 # which is disgusting, but there you have it. Hopefully this can be
3243 # fixed in future. It's still worthwhile to use a cache file for each
3244 # directory. I think.
3246 # Pass the appropriate --build, --host, --target and --cache-file arguments.
3247 # We need to pass --target, as newer autoconf's requires consistency
3248 # for target_alias and gcc doesn't manage it consistently.
3249 target_configargs="--cache-file=./config.cache ${target_configargs}"
3252 case " $target_configdirs " in
3254 case " $target_configargs " in
3255 *" --with-newlib "*)
3258 FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -L$$r/$(TARGET_SUBDIR)/winsup/cygwin -isystem $$s/winsup/cygwin/include'
3262 # If we're not building GCC, don't discard standard headers.
3263 if test -d ${srcdir}/gcc; then
3264 FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -nostdinc'
3266 if test "${build}" != "${host}"; then
3267 # On Canadian crosses, CC_FOR_TARGET will have already been set
3268 # by `configure', so we won't have an opportunity to add -Bgcc/
3269 # to it. This is right: we don't want to search that directory
3270 # for binaries, but we want the header files in there, so add
3272 FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -isystem $$r/$(HOST_SUBDIR)/gcc/include -isystem $$r/$(HOST_SUBDIR)/gcc/include-fixed'
3274 # Someone might think of using the pre-installed headers on
3275 # Canadian crosses, in case the installed compiler is not fully
3276 # compatible with the compiler being built. In this case, it
3277 # would be better to flag an error than risking having
3278 # incompatible object files being constructed. We can't
3279 # guarantee that an error will be flagged, but let's hope the
3280 # compiler will do it, when presented with incompatible header
3285 case "${target}-${is_cross_compiler}" in
3286 i[[3456789]]86-*-linux*-no)
3287 # Here host == target, so we don't need to build gcc,
3288 # so we don't want to discard standard headers.
3289 FLAGS_FOR_TARGET=`echo " $FLAGS_FOR_TARGET " | sed -e 's/ -nostdinc / /'`
3292 # If we're building newlib, use its generic headers last, but search
3293 # for any libc-related directories first (so make it the last -B
3295 FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -B$$r/$(TARGET_SUBDIR)/newlib/ -isystem $$r/$(TARGET_SUBDIR)/newlib/targ-include -isystem $$s/newlib/libc/include'
3297 # If we're building libgloss, find the startup file, simulator library
3298 # and linker script.
3299 case " $target_configdirs " in
3301 # Look for startup file, simulator library and maybe linker script.
3302 FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -B$$r/$(TARGET_SUBDIR)/libgloss/'"$libgloss_dir"
3303 # Look for libnosys.a in case the target needs it.
3304 FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -L$$r/$(TARGET_SUBDIR)/libgloss/libnosys'
3305 # Most targets have the linker script in the source directory.
3306 FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -L$$s/libgloss/'"$libgloss_dir"
3317 x86_64-*mingw* | *-w64-mingw*)
3318 # MinGW-w64 does not use newlib, nor does it use winsup. It may,
3319 # however, use a symlink named 'mingw' in ${prefix} .
3320 FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -L${prefix}/${target}/lib -L${prefix}/mingw/lib -isystem ${prefix}/${target}/include -isystem ${prefix}/mingw/include'
3323 # MinGW can't be handled as Cygwin above since it does not use newlib.
3324 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'
3328 # Allow the user to override the flags for
3329 # our build compiler if desired.
3330 if test x"${build}" = x"${host}" ; then
3331 CFLAGS_FOR_BUILD=${CFLAGS_FOR_BUILD-${CFLAGS}}
3332 CPPFLAGS_FOR_BUILD=${CPPFLAGS_FOR_BUILD-${CPPFLAGS}}
3333 CXXFLAGS_FOR_BUILD=${CXXFLAGS_FOR_BUILD-${CXXFLAGS}}
3334 LDFLAGS_FOR_BUILD=${LDFLAGS_FOR_BUILD-${LDFLAGS}}
3337 # On Canadian crosses, we'll be searching the right directories for
3338 # the previously-installed cross compiler, so don't bother to add
3339 # flags for directories within the install tree of the compiler
3340 # being built; programs in there won't even run.
3341 if test "${build}" = "${host}" && test -d ${srcdir}/gcc; then
3342 # Search for pre-installed headers if nothing else fits.
3343 FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -B$(build_tooldir)/bin/ -B$(build_tooldir)/lib/ -isystem $(build_tooldir)/include -isystem $(build_tooldir)/sys-include'
3346 if test "x${use_gnu_ld}" = x &&
3347 echo " ${configdirs} " | grep " ld " > /dev/null ; then
3348 # Arrange for us to find uninstalled linker scripts.
3349 FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -L$$r/$(HOST_SUBDIR)/ld'
3352 # Search for other target-specific linker scripts and such.
3355 FLAGS_FOR_TARGET="$FLAGS_FOR_TARGET -mlibrary"
3359 # Makefile fragments.
3360 for frag in host_makefile_frag target_makefile_frag alphaieee_frag ospace_frag;
3362 eval fragval=\$$frag
3363 if test $fragval != /dev/null; then
3364 eval $frag=${srcdir}/$fragval
3367 AC_SUBST_FILE(host_makefile_frag)
3368 AC_SUBST_FILE(target_makefile_frag)
3369 AC_SUBST_FILE(alphaieee_frag)
3370 AC_SUBST_FILE(ospace_frag)
3372 # Miscellanea: directories, flags, etc.
3373 AC_SUBST(RPATH_ENVVAR)
3374 AC_SUBST(GCC_SHLIB_SUBDIR)
3376 AC_SUBST(build_tooldir)
3377 AC_SUBST(CONFIGURE_GDB_TK)
3379 AC_SUBST(INSTALL_GDB_TK)
3381 # Build module lists & subconfigure args.
3382 AC_SUBST(build_configargs)
3383 AC_SUBST(build_configdirs)
3385 # Host module lists & subconfigure args.
3386 AC_SUBST(host_configargs)
3387 AC_SUBST(configdirs)
3388 AC_SUBST(target_configdirs)
3390 # Target module lists & subconfigure args.
3391 AC_SUBST(target_configargs)
3395 AC_SUBST(AR_FOR_BUILD)
3396 AC_SUBST(AS_FOR_BUILD)
3397 AC_SUBST(CC_FOR_BUILD)
3398 AC_SUBST(CFLAGS_FOR_BUILD)
3399 AC_SUBST(CPPFLAGS_FOR_BUILD)
3400 AC_SUBST(CXXFLAGS_FOR_BUILD)
3401 AC_SUBST(CXX_FOR_BUILD)
3402 AC_SUBST(DLLTOOL_FOR_BUILD)
3403 AC_SUBST(GFORTRAN_FOR_BUILD)
3404 AC_SUBST(GOC_FOR_BUILD)
3405 AC_SUBST(LDFLAGS_FOR_BUILD)
3406 AC_SUBST(LD_FOR_BUILD)
3407 AC_SUBST(NM_FOR_BUILD)
3408 AC_SUBST(RANLIB_FOR_BUILD)
3409 AC_SUBST(WINDMC_FOR_BUILD)
3410 AC_SUBST(WINDRES_FOR_BUILD)
3412 # Generate default definitions for YACC, M4, LEX and other programs that run
3413 # on the build machine. These are used if the Makefile can't locate these
3414 # programs in objdir.
3415 MISSING=`cd $ac_aux_dir && ${PWDCMD-pwd}`/missing
3417 AC_CHECK_PROGS([YACC], ['bison -y' byacc yacc], [$MISSING bison -y])
3418 case " $build_configdirs " in
3419 *" bison "*) YACC='$$r/$(BUILD_SUBDIR)/bison/tests/bison -y' ;;
3422 AC_CHECK_PROGS([BISON], [bison], [$MISSING bison])
3423 case " $build_configdirs " in
3424 *" bison "*) BISON='$$r/$(BUILD_SUBDIR)/bison/tests/bison' ;;
3427 AC_CHECK_PROGS([M4], [gm4 gnum4 m4], [$MISSING m4])
3428 case " $build_configdirs " in
3429 *" m4 "*) M4='$$r/$(BUILD_SUBDIR)/m4/m4' ;;
3432 AC_CHECK_PROGS([LEX], [flex lex], [$MISSING flex])
3433 case " $build_configdirs " in
3434 *" flex "*) LEX='$$r/$(BUILD_SUBDIR)/flex/flex' ;;
3435 *" lex "*) LEX='$$r/$(BUILD_SUBDIR)/lex/lex' ;;
3438 AC_CHECK_PROGS([FLEX], [flex], [$MISSING flex])
3439 case " $build_configdirs " in
3440 *" flex "*) FLEX='$$r/$(BUILD_SUBDIR)/flex/flex' ;;
3443 AC_CHECK_PROGS([MAKEINFO], makeinfo, [$MISSING makeinfo])
3444 case " $build_configdirs " in
3445 *" texinfo "*) MAKEINFO='$$r/$(BUILD_SUBDIR)/texinfo/makeinfo/makeinfo' ;;
3448 # For an installed makeinfo, we require it to be from texinfo 4.7 or
3449 # higher, else we use the "missing" dummy.
3450 if ${MAKEINFO} --version \
3451 | egrep 'texinfo[^0-9]*(4\.([7-9]|[1-9][0-9])|[5-9]|[1-9][0-9])' >/dev/null 2>&1; then
3454 MAKEINFO="$MISSING makeinfo"
3460 # FIXME: expect and dejagnu may become build tools?
3462 AC_CHECK_PROGS(EXPECT, expect, expect)
3463 case " $configdirs " in
3465 test $host = $build && EXPECT='$$r/$(HOST_SUBDIR)/expect/expect'
3469 AC_CHECK_PROGS(RUNTEST, runtest, runtest)
3470 case " $configdirs " in
3472 test $host = $build && RUNTEST='$$s/$(HOST_SUBDIR)/dejagnu/runtest'
3478 NCN_STRICT_CHECK_TOOLS(AR, ar)
3479 NCN_STRICT_CHECK_TOOLS(AS, as)
3480 NCN_STRICT_CHECK_TOOLS(DLLTOOL, dlltool)
3481 NCN_STRICT_CHECK_TOOLS(LD, ld)
3482 NCN_STRICT_CHECK_TOOLS(LIPO, lipo)
3483 NCN_STRICT_CHECK_TOOLS(NM, nm)
3484 NCN_STRICT_CHECK_TOOLS(RANLIB, ranlib, true)
3485 NCN_STRICT_CHECK_TOOLS(STRIP, strip, true)
3486 NCN_STRICT_CHECK_TOOLS(WINDRES, windres)
3487 NCN_STRICT_CHECK_TOOLS(WINDMC, windmc)
3488 NCN_STRICT_CHECK_TOOLS(OBJCOPY, objcopy)
3489 NCN_STRICT_CHECK_TOOLS(OBJDUMP, objdump)
3490 NCN_STRICT_CHECK_TOOLS(READELF, readelf)
3495 AC_SUBST(PKG_CONFIG_PATH)
3497 GCC_PLUGIN_OPTION(PLUGIN_OPTION)
3499 RANLIB_PLUGIN_OPTION=
3500 if test -n "$PLUGIN_OPTION"; then
3501 if $AR --help 2>&1 | grep -q "\--plugin"; then
3502 AR_PLUGIN_OPTION="$PLUGIN_OPTION"
3504 if $RANLIB --help 2>&1 | grep -q "\--plugin"; then
3505 RANLIB_PLUGIN_OPTION="$PLUGIN_OPTION"
3508 if test "$enable_pgo_build" != "no"; then
3509 AC_MSG_ERROR([AR with --plugin and rc is required for LTO build])
3512 AC_SUBST(AR_PLUGIN_OPTION)
3513 AC_SUBST(RANLIB_PLUGIN_OPTION)
3516 AC_ARG_WITH([build-time-tools],
3517 [AS_HELP_STRING([--with-build-time-tools=PATH],
3518 [use given path to find target tools during the build])],
3519 [case x"$withval" in
3522 with_build_time_tools=
3523 AC_MSG_WARN([argument to --with-build-time-tools must be an absolute path])
3526 [with_build_time_tools=])
3528 NCN_STRICT_CHECK_TARGET_TOOLS(CC_FOR_TARGET, cc gcc)
3529 NCN_STRICT_CHECK_TARGET_TOOLS(CXX_FOR_TARGET, c++ g++ cxx gxx)
3530 NCN_STRICT_CHECK_TARGET_TOOLS(GCC_FOR_TARGET, gcc, ${CC_FOR_TARGET})
3531 NCN_STRICT_CHECK_TARGET_TOOLS(GFORTRAN_FOR_TARGET, gfortran)
3532 NCN_STRICT_CHECK_TARGET_TOOLS(GOC_FOR_TARGET, gccgo)
3534 ACX_CHECK_INSTALLED_TARGET_TOOL(AR_FOR_TARGET, ar)
3535 ACX_CHECK_INSTALLED_TARGET_TOOL(AS_FOR_TARGET, as)
3536 ACX_CHECK_INSTALLED_TARGET_TOOL(DLLTOOL_FOR_TARGET, dlltool)
3537 ACX_CHECK_INSTALLED_TARGET_TOOL(LD_FOR_TARGET, ld)
3538 ACX_CHECK_INSTALLED_TARGET_TOOL(LIPO_FOR_TARGET, lipo)
3539 ACX_CHECK_INSTALLED_TARGET_TOOL(NM_FOR_TARGET, nm)
3540 ACX_CHECK_INSTALLED_TARGET_TOOL(OBJCOPY_FOR_TARGET, objcopy)
3541 ACX_CHECK_INSTALLED_TARGET_TOOL(OBJDUMP_FOR_TARGET, objdump)
3542 ACX_CHECK_INSTALLED_TARGET_TOOL(RANLIB_FOR_TARGET, ranlib)
3543 ACX_CHECK_INSTALLED_TARGET_TOOL(READELF_FOR_TARGET, readelf)
3544 ACX_CHECK_INSTALLED_TARGET_TOOL(STRIP_FOR_TARGET, strip)
3545 ACX_CHECK_INSTALLED_TARGET_TOOL(WINDRES_FOR_TARGET, windres)
3546 ACX_CHECK_INSTALLED_TARGET_TOOL(WINDMC_FOR_TARGET, windmc)
3548 RAW_CXX_FOR_TARGET="$CXX_FOR_TARGET"
3550 GCC_TARGET_TOOL(ar, AR_FOR_TARGET, AR, [binutils/ar])
3551 GCC_TARGET_TOOL(as, AS_FOR_TARGET, AS, [gas/as-new])
3552 GCC_TARGET_TOOL(cc, CC_FOR_TARGET, CC, [gcc/xgcc -B$$r/$(HOST_SUBDIR)/gcc/])
3553 dnl see comments for CXX_FOR_TARGET_FLAG_TO_PASS
3554 GCC_TARGET_TOOL(c++, CXX_FOR_TARGET, CXX,
3555 [gcc/xg++ -B$$r/$(HOST_SUBDIR)/gcc/ -nostdinc++ `if test -f $$r/$(TARGET_SUBDIR)/libstdc++-v3/scripts/testsuite_flags; then $(SHELL) $$r/$(TARGET_SUBDIR)/libstdc++-v3/scripts/testsuite_flags --build-includes; else echo -funconfigured-libstdc++-v3 ; fi` -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/libsupc++/.libs],
3557 GCC_TARGET_TOOL(c++ for libstdc++, RAW_CXX_FOR_TARGET, CXX,
3558 [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 -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/libsupc++/.libs],
3560 GCC_TARGET_TOOL(dlltool, DLLTOOL_FOR_TARGET, DLLTOOL, [binutils/dlltool])
3561 GCC_TARGET_TOOL(gcc, GCC_FOR_TARGET, , [gcc/xgcc -B$$r/$(HOST_SUBDIR)/gcc/])
3562 GCC_TARGET_TOOL(gfortran, GFORTRAN_FOR_TARGET, GFORTRAN,
3563 [gcc/gfortran -B$$r/$(HOST_SUBDIR)/gcc/], fortran)
3564 GCC_TARGET_TOOL(gccgo, GOC_FOR_TARGET, GOC,
3565 [gcc/gccgo -B$$r/$(HOST_SUBDIR)/gcc/], go)
3566 GCC_TARGET_TOOL(ld, LD_FOR_TARGET, LD, [ld/ld-new])
3567 GCC_TARGET_TOOL(lipo, LIPO_FOR_TARGET, LIPO)
3568 GCC_TARGET_TOOL(nm, NM_FOR_TARGET, NM, [binutils/nm-new])
3569 GCC_TARGET_TOOL(objcopy, OBJCOPY_FOR_TARGET, OBJCOPY, [binutils/objcopy])
3570 GCC_TARGET_TOOL(objdump, OBJDUMP_FOR_TARGET, OBJDUMP, [binutils/objdump])
3571 GCC_TARGET_TOOL(ranlib, RANLIB_FOR_TARGET, RANLIB, [binutils/ranlib])
3572 GCC_TARGET_TOOL(readelf, READELF_FOR_TARGET, READELF, [binutils/readelf])
3573 GCC_TARGET_TOOL(strip, STRIP_FOR_TARGET, STRIP, [binutils/strip-new])
3574 GCC_TARGET_TOOL(windres, WINDRES_FOR_TARGET, WINDRES, [binutils/windres])
3575 GCC_TARGET_TOOL(windmc, WINDMC_FOR_TARGET, WINDMC, [binutils/windmc])
3577 AC_SUBST(FLAGS_FOR_TARGET)
3578 AC_SUBST(RAW_CXX_FOR_TARGET)
3580 # Certain tools may need extra flags.
3581 AR_FOR_TARGET=${AR_FOR_TARGET}${extra_arflags_for_target}
3582 RANLIB_FOR_TARGET=${RANLIB_FOR_TARGET}${extra_ranlibflags_for_target}
3583 NM_FOR_TARGET=${NM_FOR_TARGET}${extra_nmflags_for_target}
3585 # When building target libraries, except in a Canadian cross, we use
3586 # the same toolchain as the compiler we just built.
3587 COMPILER_AS_FOR_TARGET='$(AS_FOR_TARGET)'
3588 COMPILER_LD_FOR_TARGET='$(LD_FOR_TARGET)'
3589 COMPILER_NM_FOR_TARGET='$(NM_FOR_TARGET)'
3590 if test $host = $build; then
3591 case " $configdirs " in
3593 COMPILER_AS_FOR_TARGET='$$r/$(HOST_SUBDIR)/gcc/as'
3594 COMPILER_LD_FOR_TARGET='$$r/$(HOST_SUBDIR)/gcc/collect-ld'
3595 COMPILER_NM_FOR_TARGET='$$r/$(HOST_SUBDIR)/gcc/nm'${extra_nmflags_for_target}
3600 AC_SUBST(COMPILER_AS_FOR_TARGET)
3601 AC_SUBST(COMPILER_LD_FOR_TARGET)
3602 AC_SUBST(COMPILER_NM_FOR_TARGET)
3604 AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
3605 AC_ARG_ENABLE(maintainer-mode,
3606 [AS_HELP_STRING([--enable-maintainer-mode],
3607 [enable make rules and dependencies not useful
3608 (and sometimes confusing) to the casual installer])],
3609 USE_MAINTAINER_MODE=$enableval,
3610 USE_MAINTAINER_MODE=no)
3611 AC_MSG_RESULT($USE_MAINTAINER_MODE)
3612 AC_SUBST(MAINTAINER_MODE_TRUE)
3613 AC_SUBST(MAINTAINER_MODE_FALSE)
3614 if test "$USE_MAINTAINER_MODE" = yes; then
3615 MAINTAINER_MODE_TRUE=
3616 MAINTAINER_MODE_FALSE='#'
3618 MAINTAINER_MODE_TRUE='#'
3619 MAINTAINER_MODE_FALSE=
3621 MAINT=$MAINTAINER_MODE_TRUE
3624 # ---------------------
3625 # GCC bootstrap support
3626 # ---------------------
3628 # Stage specific cflags for build.
3633 yes) stage1_cflags="-g -Wa,-J" ;;
3634 *) stage1_cflags="-g -J" ;;
3638 AC_SUBST(stage1_cflags)
3640 # Enable --enable-checking in stage1 of the compiler.
3641 AC_ARG_ENABLE(stage1-checking,
3642 [AS_HELP_STRING([[--enable-stage1-checking[=all]]],
3643 [choose additional checking for stage1 of the compiler])],
3644 [stage1_checking=--enable-checking=${enable_stage1_checking}],
3645 [if test "x$enable_checking" = xno || test "x$enable_checking" = x; then
3646 # For --disable-checking or implicit --enable-checking=release, avoid
3647 # setting --enable-checking=gc in the default stage1 checking for LTO
3648 # bootstraps. See PR62077.
3649 case $BUILD_CONFIG in
3651 stage1_checking=--enable-checking=release,misc,gimple,rtlflag,tree,types;;
3653 stage1_checking=--enable-checking=yes,types;;
3655 if test "x$enable_checking" = x && \
3656 test -d ${srcdir}/gcc && \
3657 test x"`cat ${srcdir}/gcc/DEV-PHASE`" = xexperimental; then
3658 stage1_checking=--enable-checking=yes,types,extra
3661 stage1_checking=--enable-checking=$enable_checking,types
3663 AC_SUBST(stage1_checking)
3665 # Enable -Werror in bootstrap stage2 and later.
3666 AC_ARG_ENABLE(werror,
3667 [AS_HELP_STRING([--enable-werror],
3668 [enable -Werror in bootstrap stage2 and later])],
3670 case ${enable_werror} in
3671 yes) stage2_werror_flag="--enable-werror-always" ;;
3672 *) stage2_werror_flag="" ;;
3676 if test -d ${srcdir}/gcc && test x"`cat $srcdir/gcc/DEV-PHASE`" = xexperimental; then
3677 case $BUILD_CONFIG in
3679 stage2_werror_flag="--enable-werror-always" ;;
3681 stage2_werror_flag="--enable-werror-always" ;;
3686 AC_SUBST(stage2_werror_flag)
3688 # Specify what files to not compare during bootstrap.
3690 compare_exclusions="gcc/cc*-checksum\$(objext) | gcc/ada/*tools/*"
3692 hppa*64*-*-hpux*) ;;
3693 hppa*-*-hpux*) compare_exclusions="gcc/cc*-checksum\$(objext) | */libgcc/lib2funcs* | gcc/ada/*tools/* | gcc/function-tests.o" ;;
3694 powerpc*-ibm-aix*) compare_exclusions="gcc/cc*-checksum\$(objext) | gcc/ada/*tools/* | *libgomp*\$(objext)" ;;
3696 AC_SUBST(compare_exclusions)
3698 AC_CONFIG_FILES([Makefile],
3699 [sed "$extrasub_build" Makefile |
3700 sed "$extrasub_host" |
3701 sed "$extrasub_target" > mf$$
3702 mv -f mf$$ Makefile],
3703 [extrasub_build="$extrasub_build"
3704 extrasub_host="$extrasub_host"
3705 extrasub_target="$extrasub_target"])