]> git.ipfire.org Git - thirdparty/gcc.git/blame - configure.ac
* toplev.c (emit_debug_global_declarations): Do not output debug info
[thirdparty/gcc.git] / configure.ac
CommitLineData
77ae4d79 1# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
9b31ae9c 2# 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012,
3# 2014, 2015 Free Software Foundation, Inc.
28e9041c 4#
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
4b072aaf 7# the Free Software Foundation; either version 3 of the License, or
28e9041c 8# (at your option) any later version.
9#
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.
14#
15# You should have received a copy of the GNU General Public License
4b072aaf 16# along with this program; see the file COPYING3. If not see
17# <http://www.gnu.org/licenses/>.
28e9041c 18
19##############################################################################
71ab34df 20### WARNING: this file contains embedded tabs. Do not run untabify on this file.
21
f0cb9b36 22m4_include(config/acx.m4)
23m4_include(config/override.m4)
82eaf560 24m4_include(config/proginstall.m4)
1a4f45ec 25m4_include(config/elf.m4)
c3fc6a63 26m4_include([libtool.m4])
27m4_include([ltoptions.m4])
28m4_include([ltsugar.m4])
29m4_include([ltversion.m4])
30m4_include([lt~obsolete.m4])
87e20041 31m4_include([config/isl.m4])
599a3eac 32
71ab34df 33AC_INIT(move-if-change)
81a71e2b 34AC_PREREQ(2.64)
cd2f3773 35AC_DISABLE_OPTION_CHECKING
b30fcfae 36
4e8a889d 37progname=$0
38# if PWD already has a value, it is probably wrong.
39if test -n "$PWD" ; then PWD=`${PWDCMD-pwd}`; fi
40
41# Export original configure arguments for use by sub-configures.
42# Quote arguments with shell meta charatcers.
43TOPLEVEL_CONFIGURE_ARGUMENTS=
44set -- "$progname" "$@"
45for ac_arg
46do
47 case "$ac_arg" in
48 *" "*|*" "*|*[[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\']]*)
49 ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"`
50 # if the argument is of the form -foo=baz, quote the baz part only
51 ac_arg=`echo "'$ac_arg'" | sed "s/^'\([[-a-zA-Z0-9]]*=\)/\\1'/"` ;;
52 *) ;;
53 esac
54 # Add the quoted argument to the list.
55 TOPLEVEL_CONFIGURE_ARGUMENTS="$TOPLEVEL_CONFIGURE_ARGUMENTS $ac_arg"
56done
57if test "$silent" = yes; then
58 TOPLEVEL_CONFIGURE_ARGUMENTS="$TOPLEVEL_CONFIGURE_ARGUMENTS --silent"
59fi
60# Remove the initial space we just introduced and, as these will be
61# expanded by make, quote '$'.
62TOPLEVEL_CONFIGURE_ARGUMENTS=`echo "x$TOPLEVEL_CONFIGURE_ARGUMENTS" | sed -e 's/^x *//' -e 's,\\$,$$,g'`
63AC_SUBST(TOPLEVEL_CONFIGURE_ARGUMENTS)
64
b30fcfae 65# Find the build, host, and target systems.
66ACX_NONCANONICAL_BUILD
67ACX_NONCANONICAL_HOST
68ACX_NONCANONICAL_TARGET
69
70dnl Autoconf 2.5x and later will set a default program prefix if
71dnl --target was used, even if it was the same as --host. Disable
72dnl that behavior. This must be done before AC_CANONICAL_SYSTEM
73dnl to take effect.
74test "$host_noncanonical" = "$target_noncanonical" &&
75 test "$program_prefix$program_suffix$program_transform_name" = \
76 NONENONEs,x,x, &&
77 program_transform_name=s,y,y,
78
71ab34df 79AC_CANONICAL_SYSTEM
80AC_ARG_PROGRAM
81
b30fcfae 82m4_pattern_allow([^AS_FOR_TARGET$])dnl
93c5e793 83m4_pattern_allow([^AS_FOR_BUILD$])dnl
b30fcfae 84
450e6c84 85# Get 'install' or 'install-sh' and its variants.
86AC_PROG_INSTALL
599a3eac 87ACX_PROG_LN
5965d276 88AC_PROG_LN_S
b181f265 89AC_PROG_SED
90AC_PROG_AWK
450e6c84 91
3a8631fa 92srcpwd=`cd ${srcdir} ; ${PWDCMD-pwd}`
93
94# We pass INSTALL explicitly to sub-makes. Make sure that it is not
95# a relative path.
96if test "$INSTALL" = "${srcdir}/install-sh -c"; then
97 INSTALL="${srcpwd}/install-sh -c"
98fi
99
71ab34df 100# Set srcdir to "." if that's what it is.
101# This is important for multilib support.
102pwd=`${PWDCMD-pwd}`
71ab34df 103if test "${pwd}" = "${srcpwd}" ; then
104 srcdir=.
105fi
106
107topsrcdir=$srcpwd
28e9041c 108
805e22b2 109extra_host_args=
14ac9144 110
28e9041c 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
805e22b2 113### (library or tools, host or target), doing a dependency sort.
114
115# Subdirs will be configured in the order listed in build_configdirs,
116# configdirs, or target_configdirs; see the serialization section below.
117
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.
28e9041c 121
805e22b2 122# Double entries in build_configdirs, configdirs, or target_configdirs may
123# cause circular dependencies and break everything horribly.
28e9041c 124
2f8725b0 125# these library is used by various programs built for the build
126# environment
127#
9245d2c5 128build_libs="build-libiberty build-libcpp"
2f8725b0 129
130# these tools are built for the build environment
4fc99708 131build_tools="build-texinfo build-flex build-bison build-m4 build-fixincludes"
2f8725b0 132
28e9041c 133# these libraries are used by various programs built for the host environment
429cca51 134#f
572cf1f7 135host_libs="intl libiberty opcodes bfd readline tcl tk itcl libgui zlib libbacktrace libcpp libdecnumber gmp mpfr mpc isl libelf libiconv"
28e9041c 136
28e9041c 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.
805e22b2 140# binutils, gas and ld appear in that order because it makes sense to run
141# "make check" in that particular order.
af7c5662 142# If --enable-gold is used, "gold" may replace "ld".
dcfe52b6 143host_tools="texinfo flex bison binutils gas ld fixincludes gcc cgen sid sim gdb gprof etc expect dejagnu m4 utils guile fastjar gnattools libcc1 gotools"
ed37269d 144
4d5a2476 145# libgcj represents the runtime libraries only used by gcj.
146libgcj="target-libffi \
4d5a2476 147 target-zlib \
4d5a2476 148 target-libjava"
149
28e9041c 150# these libraries are built for the target environment, and are built after
151# the host libraries and the host tools (which may be a cross compiler)
5ab7e123 152# Note that libiberty is not a target library.
27bfe7b7 153target_libraries="target-libgcc \
ecd3459e 154 target-libbacktrace \
ed37269d 155 target-libgloss \
156 target-newlib \
a0191bfe 157 target-libgomp \
4710dd51 158 target-libcilkrts \
d3a7dd32 159 target-liboffloadmic \
6db1d2ca 160 target-libatomic \
4c0315d0 161 target-libitm \
54d7d5f2 162 target-libstdc++-v3 \
549e2197 163 target-libsanitizer \
b710ec85 164 target-libvtv \
202baac8 165 target-libmpx \
0d55f4d0 166 target-libssp \
87969c8c 167 target-libquadmath \
4ee9c684 168 target-libgfortran \
dd6d3a67 169 target-boehm-gc \
cdfc500e 170 ${libgcj} \
93341878 171 target-libobjc \
5ff5b630 172 target-libada \
173 target-libgo"
28e9041c 174
328637e8 175# these tools are built using the target libraries, and are intended to
176# run only in the target environment
28e9041c 177#
328637e8 178# note: any program that *uses* libraries that are in the "target_libraries"
6c9785b4 179# list belongs in this list.
28e9041c 180#
4fc99708 181target_tools="target-rda"
28e9041c 182
183################################################################################
184
28e9041c 185## All tools belong in one of the four categories, and are assigned above
186## We assign ${configdirs} this way to remove all embedded newlines. This
187## is important because configure will choke if they ever get through.
188## ${configdirs} is directories we build using the host tools.
189## ${target_configdirs} is directories we build using the target tools.
28e9041c 190configdirs=`echo ${host_libs} ${host_tools}`
328637e8 191target_configdirs=`echo ${target_libraries} ${target_tools}`
2b59cb05 192build_configdirs=`echo ${build_libs} ${build_tools}`
6f4f34a7 193
d2d2630b 194m4_divert_text([PARSE_ARGS],
13d2f2b2 195[case $srcdir in
196 *" "*)
197m4_pushdef([AS_MESSAGE_LOG_FD], [])dnl
198 AC_MSG_ERROR([path to source, $srcdir, contains spaces])
199m4_popdef([AS_MESSAGE_LOG_FD])dnl
200 ;;
201esac
202ac_subdirs_all=`cd $srcdir && echo */configure | sed 's,/configure,,g'`
d2d2630b 203])
204
28e9041c 205################################################################################
206
28e9041c 207srcname="gnu development package"
208
209# This gets set non-empty for some net releases of packages.
210appdirs=""
211
99aa6b34 212# Define is_cross_compiler to save on calls to 'test'.
213is_cross_compiler=
214if test x"${host}" = x"${target}" ; then
215 is_cross_compiler=no
216else
217 is_cross_compiler=yes
218fi
219
2f61b8ca 220# Find the build and target subdir names.
6f4f34a7 221GCC_TOPLEV_SUBDIRS
04a2e841 222# Be sure to cover against remnants of an in-tree build.
223if test $srcdir != . && test -d $srcdir/host-${host_noncanonical}; then
224 AC_MSG_ERROR([building out of tree but $srcdir contains host-${host_noncanonical}.
225Use a pristine source tree when building in a separate tree])
226fi
7bb9dd92 227
13b1b53a 228# Skipdirs are removed silently.
229skipdirs=
230# Noconfigdirs are removed loudly.
231noconfigdirs=""
28e9041c 232
13b1b53a 233use_gnu_ld=
234# Make sure we don't let GNU ld be added if we didn't want it.
235if test x$with_gnu_ld = xno ; then
236 use_gnu_ld=no
3d47fcf5 237 noconfigdirs="$noconfigdirs ld gold"
28e9041c 238fi
239
13b1b53a 240use_gnu_as=
241# Make sure we don't let GNU as be added if we didn't want it.
242if test x$with_gnu_as = xno ; then
243 use_gnu_as=no
244 noconfigdirs="$noconfigdirs gas"
28e9041c 245fi
246
7bfefa9d 247use_included_zlib=
248# Make sure we don't let ZLIB be added if we didn't want it.
249if test x$with_system_zlib = xyes ; then
250 use_included_zlib=no
251 noconfigdirs="$noconfigdirs zlib"
252fi
253
13b1b53a 254# some tools are so dependent upon X11 that if we're not building with X,
255# it's not even worth trying to configure, much less build, that tool.
28e9041c 256
13b1b53a 257case ${with_x} in
258 yes | "") ;; # the default value for this tree is that X11 is available
f6c0123d 259 no)
f843f075 260 skipdirs="${skipdirs} tk itcl libgui"
f6c0123d 261 # We won't be able to build gdbtk without X.
262 enable_gdbtk=no
263 ;;
13b1b53a 264 *) echo "*** bad value \"${with_x}\" for -with-x flag; ignored" 1>&2 ;;
265esac
28e9041c 266
6c9785b4 267# Some are only suitable for cross toolchains.
2a1ac811 268# Remove these if host=target.
269cross_only="target-libgloss target-newlib target-opcodes"
28e9041c 270
13b1b53a 271case $is_cross_compiler in
272 no) skipdirs="${skipdirs} ${cross_only}" ;;
13b1b53a 273esac
28e9041c 274
4ff41e84 275# If both --with-headers and --with-libs are specified, default to
276# --without-newlib.
3bdd04cc 277if test x"${with_headers}" != x && test x"${with_headers}" != xno \
278 && test x"${with_libs}" != x && test x"${with_libs}" != xno ; then
4ff41e84 279 if test x"${with_newlib}" = x ; then
280 with_newlib=no
281 fi
282fi
283
284# Recognize --with-newlib/--without-newlib.
285case ${with_newlib} in
286 no) skipdirs="${skipdirs} target-newlib" ;;
287 yes) skipdirs=`echo " ${skipdirs} " | sed -e 's/ target-newlib / /'` ;;
288esac
289
a3d93be3 290AC_ARG_ENABLE(as-accelerator-for,
291[AS_HELP_STRING([--enable-as-accelerator-for=ARG],
292 [build as offload target compiler.
67cedda8 293 Specify offload host triple by ARG])])
a3d93be3 294
295AC_ARG_ENABLE(offload-targets,
296[AS_HELP_STRING([--enable-offload-targets=LIST],
297 [enable offloading to devices from comma-separated LIST of
298 TARGET[=DIR]. Use optional path to find offload target compiler
299 during the build])],
300[
301 if test x"$enable_offload_targets" = x; then
302 AC_MSG_ERROR([no offload targets specified])
303 fi
304], [enable_offload_targets=])
305
1e369e5f 306# Handle --enable-gold, --enable-ld.
307# --disable-gold [--enable-ld]
308# Build only ld. Default option.
85516948 309# --enable-gold [--enable-ld]
310# Build both gold and ld. Install gold as "ld.gold", install ld
311# as "ld.bfd" and "ld".
312# --enable-gold=default [--enable-ld]
1e369e5f 313# Build both gold and ld. Install gold as "ld.gold" and "ld",
314# install ld as "ld.bfd".
315# --enable-gold[=default] --disable-ld
316# Build only gold, which is then installed as both "ld.gold" and "ld".
317# --enable-gold --enable-ld=default
85516948 318# Build both gold (installed as "ld.gold") and ld (installed as "ld"
319# and ld.bfd).
1e369e5f 320# In other words, ld is default
321# --enable-gold=default --enable-ld=default
322# Error.
323
324default_ld=
3d47fcf5 325AC_ARG_ENABLE(gold,
8747a938 326[AS_HELP_STRING([[--enable-gold[=ARG]]],
327 [build gold @<:@ARG={default,yes,no}@:>@])],
3d47fcf5 328ENABLE_GOLD=$enableval,
329ENABLE_GOLD=no)
1e369e5f 330case "${ENABLE_GOLD}" in
331 yes|default)
af7c5662 332 # Check for ELF target.
333 is_elf=no
334 case "${target}" in
335 *-*-elf* | *-*-sysv4* | *-*-unixware* | *-*-eabi* | hppa*64*-*-hpux* \
e4c33dd2 336 | *-*-linux* | *-*-gnu* | frv-*-uclinux* | *-*-irix5* | *-*-irix6* \
e3a1fe08 337 | *-*-netbsd* | *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* \
9d36d513 338 | *-*-solaris2* | *-*-nto* | *-*-nacl*)
af7c5662 339 case "${target}" in
340 *-*-linux*aout* | *-*-linux*oldld*)
341 ;;
342 *)
343 is_elf=yes
344 ;;
345 esac
346 esac
347
348 if test "$is_elf" = "yes"; then
349 # Check for target supported by gold.
3d47fcf5 350 case "${target}" in
58f62c51 351 i?86-*-* | x86_64-*-* | sparc*-*-* | powerpc*-*-* | arm*-*-* \
352 | aarch64*-*-* | tilegx*-*-*)
1e369e5f 353 configdirs="$configdirs gold"
354 if test x${ENABLE_GOLD} = xdefault; then
355 default_ld=gold
356 fi
af7c5662 357 ENABLE_GOLD=yes
3d47fcf5 358 ;;
359 esac
af7c5662 360 fi
361 ;;
362 no)
363 ;;
364 *)
365 AC_MSG_ERROR([invalid --enable-gold argument])
366 ;;
1e369e5f 367esac
368
369AC_ARG_ENABLE(ld,
8747a938 370[AS_HELP_STRING([[--enable-ld[=ARG]]],
371 [build ld @<:@ARG={default,yes,no}@:>@])],
1e369e5f 372ENABLE_LD=$enableval,
373ENABLE_LD=yes)
374
375case "${ENABLE_LD}" in
376 default)
85516948 377 if test x${default_ld} != x; then
1e369e5f 378 AC_MSG_ERROR([either gold or ld can be the default ld])
379 fi
380 ;;
381 yes)
382 ;;
383 no)
384 if test x${ENABLE_GOLD} != xyes; then
385 AC_MSG_WARN([neither ld nor gold are enabled])
386 fi
387 configdirs=`echo " ${configdirs} " | sed -e 's/ ld / /'`
388 ;;
389 *)
390 AC_MSG_ERROR([invalid --enable-ld argument])
391 ;;
392esac
3d47fcf5 393
28e9041c 394# Configure extra directories which are host specific
395
396case "${host}" in
13b1b53a 397 *-cygwin*)
805e22b2 398 configdirs="$configdirs libtermcap" ;;
28e9041c 399esac
400
ff7dcf6a 401# A target can indicate whether a language isn't supported for some reason.
402# Only spaces may be used in this macro; not newlines or tabs.
403unsupported_languages=
404
28e9041c 405# Remove more programs from consideration, based on the host or
406# target this usually means that a port of the program doesn't
407# exist yet.
408
28e9041c 409case "${host}" in
b2240ff6 410 i[[3456789]]86-*-msdosdjgpp*)
e3a5e6ff 411 noconfigdirs="$noconfigdirs tcl tk itcl"
ed37269d 412 ;;
28e9041c 413esac
414
4ee9c684 415
d9d975ae 416AC_ARG_ENABLE(libquadmath,
417AS_HELP_STRING([--disable-libquadmath],
418 [do not build libquadmath directory]),
419ENABLE_LIBQUADMATH=$enableval,
420ENABLE_LIBQUADMATH=yes)
421if test "${ENABLE_LIBQUADMATH}" = "no" ; then
422 noconfigdirs="$noconfigdirs target-libquadmath"
423fi
424
425
426AC_ARG_ENABLE(libquadmath-support,
427AS_HELP_STRING([--disable-libquadmath-support],
428 [disable libquadmath support for Fortran]),
429ENABLE_LIBQUADMATH_SUPPORT=$enableval,
430ENABLE_LIBQUADMATH_SUPPORT=yes)
431enable_libquadmath_support=
432if test "${ENABLE_LIBQUADMATH_SUPPORT}" = "no" ; then
433 enable_libquadmath_support=no
434fi
435
436
93341878 437AC_ARG_ENABLE(libada,
8747a938 438[AS_HELP_STRING([--enable-libada], [build libada directory])],
93341878 439ENABLE_LIBADA=$enableval,
440ENABLE_LIBADA=yes)
441if test "${ENABLE_LIBADA}" != "yes" ; then
a136b23d 442 noconfigdirs="$noconfigdirs gnattools"
93341878 443fi
444
07da5214 445AC_ARG_ENABLE(libssp,
8747a938 446[AS_HELP_STRING([--enable-libssp], [build libssp directory])],
07da5214 447ENABLE_LIBSSP=$enableval,
448ENABLE_LIBSSP=yes)
07da5214 449
d3cf0a31 450AC_ARG_ENABLE(libstdcxx,
451AS_HELP_STRING([--disable-libstdcxx],
452 [do not build libstdc++-v3 directory]),
453ENABLE_LIBSTDCXX=$enableval,
454ENABLE_LIBSTDCXX=default)
455[if test "${ENABLE_LIBSTDCXX}" = "no" ; then
df148e44 456 noconfigdirs="$noconfigdirs target-libstdc++-v3"
d3cf0a31 457fi]
458
d3a7dd32 459# If this is accelerator compiler and its target is intelmic we enable
460# target liboffloadmic by default. If this is compiler with offloading
461# for intelmic we enable host liboffloadmic by default. Otherwise
462# liboffloadmic is disabled by default.
463AC_ARG_ENABLE([liboffloadmic],
464AC_HELP_STRING([[--enable-liboffloadmic[=ARG]]],
465 [build liboffloadmic @<:@ARG={no,host,target}@:>@]),
466[case "$enableval" in
467 no | host | target)
468 enable_liboffloadmic=$enableval ;;
469 *)
470 AC_MSG_ERROR([--enable-liboffloadmic=no/host/target]) ;;
471esac],
67cedda8 472[if test x"$enable_as_accelerator_for" != x; then
d3a7dd32 473 case "${target}" in
474 *-intelmic-* | *-intelmicemul-*)
475 enable_liboffloadmic=target
476 extra_liboffloadmic_configure_flags="--enable-liboffloadmic=target"
477 ;;
478 *)
479 enable_liboffloadmic=no
480 ;;
481 esac
482else
483 case "${enable_offload_targets}" in
484 *-intelmic-* | *-intelmicemul-*)
485 enable_liboffloadmic=host
486 extra_liboffloadmic_configure_flags="--enable-liboffloadmic=host"
487 ;;
488 *)
489 enable_liboffloadmic=no
490 ;;
491 esac
492fi])
493AC_SUBST(extra_liboffloadmic_configure_flags)
494
f7ec7829 495# Save it here so that, even in case of --enable-libgcj, if the Java
496# front-end isn't enabled, we still get libgcj disabled.
497libgcj_saved=$libgcj
498case $enable_libgcj in
499yes)
500 # If we reset it here, it won't get added to noconfigdirs in the
501 # target-specific build rules, so it will be forcibly enabled
502 # (unless the Java language itself isn't enabled).
503 libgcj=
504 ;;
505no)
506 # Make sure we get it printed in the list of not supported target libs.
604a285a 507 # Don't disable libffi, though, other languages use it.
508 noconfigdirs="$noconfigdirs `echo ${libgcj} | sed -e 's/target-libffi//'`"
8593ce89 509 # Clear libgcj_saved so that even if java is enabled libffi won't be
510 # built.
511 libgcj_saved=
f7ec7829 512 ;;
513esac
514
d7e52ac9 515AC_ARG_ENABLE(static-libjava,
516[AS_HELP_STRING([[--enable-static-libjava[=ARG]]],
517 [build static libjava @<:@default=no@:>@])],
518ENABLE_STATIC_LIBJAVA=$enableval,
519ENABLE_STATIC_LIBJAVA=no)
520enable_static_libjava=
521if test "${ENABLE_STATIC_LIBJAVA}" = "yes" ; then
522 enable_static_libjava=yes
523fi
524
525if test x$enable_static_libjava != xyes ; then
526 EXTRA_CONFIGARGS_LIBJAVA=--disable-static
527fi
528AC_SUBST(EXTRA_CONFIGARGS_LIBJAVA)
4ee9c684 529
50996fe5 530# Disable libgomp on non POSIX hosted systems.
531if test x$enable_libgomp = x ; then
1e8e9920 532 # Enable libgomp by default on hosted POSIX systems.
533 case "${target}" in
3bef4012 534 *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu | *-*-kopensolaris*-gnu)
1e8e9920 535 ;;
e3a1fe08 536 *-*-netbsd* | *-*-freebsd* | *-*-openbsd* | *-*-dragonfly*)
1e8e9920 537 ;;
5641963c 538 *-*-solaris2* | *-*-hpux11*)
1e8e9920 539 ;;
634efbee 540 *-*-darwin* | *-*-aix*)
1e8e9920 541 ;;
542 *)
543 noconfigdirs="$noconfigdirs target-libgomp"
544 ;;
545 esac
50996fe5 546fi
1e8e9920 547
6db1d2ca 548# Disable libatomic on unsupported systems.
549if test -d ${srcdir}/libatomic; then
550 if test x$enable_libatomic = x; then
551 AC_MSG_CHECKING([for libatomic support])
552 if (srcdir=${srcdir}/libatomic; \
553 . ${srcdir}/configure.tgt; \
554 test -n "$UNSUPPORTED")
555 then
556 AC_MSG_RESULT([no])
557 noconfigdirs="$noconfigdirs target-libatomic"
558 else
559 AC_MSG_RESULT([yes])
560 fi
561 fi
562fi
563
4710dd51 564# Disable libcilkrts on unsupported systems.
565if test -d ${srcdir}/libcilkrts; then
566 if test x$enable_libcilkrts = x; then
567 AC_MSG_CHECKING([for libcilkrts support])
568 if (srcdir=${srcdir}/libcilkrts; \
569 . ${srcdir}/configure.tgt; \
570 test -n "$UNSUPPORTED")
571 then
572 AC_MSG_RESULT([no])
573 noconfigdirs="$noconfigdirs target-libcilkrts"
574 else
575 AC_MSG_RESULT([yes])
576 fi
577 fi
578fi
579
d3a7dd32 580# Disable liboffloadmic on unsupported systems.
581if test -d ${srcdir}/liboffloadmic; then
582 if test x$enable_liboffloadmic != xno; then
583 AC_MSG_CHECKING([for liboffloadmic support])
584 if (srcdir=${srcdir}/liboffloadmic; \
585 . ${srcdir}/configure.tgt; \
586 test -n "$UNSUPPORTED")
587 then
588 AC_MSG_RESULT([no])
589 noconfigdirs="$noconfigdirs target-liboffloadmic"
590 else
591 AC_MSG_RESULT([yes])
592 fi
593 fi
594fi
595
42b15c81 596# Disable libitm on unsupported systems.
597if test -d ${srcdir}/libitm; then
598 if test x$enable_libitm = x; then
599 AC_MSG_CHECKING([for libitm support])
600 if (srcdir=${srcdir}/libitm; \
601 . ${srcdir}/configure.tgt; \
602 test -n "$UNSUPPORTED")
603 then
604 AC_MSG_RESULT([no])
605 noconfigdirs="$noconfigdirs target-libitm"
606 else
607 AC_MSG_RESULT([yes])
608 fi
609 fi
4c0315d0 610fi
611
492e75a7 612# Disable libsanitizer on unsupported systems.
613if test -d ${srcdir}/libsanitizer; then
614 if test x$enable_libsanitizer = x; then
615 AC_MSG_CHECKING([for libsanitizer support])
616 if (srcdir=${srcdir}/libsanitizer; \
617 . ${srcdir}/configure.tgt; \
618 test -n "$UNSUPPORTED")
619 then
620 AC_MSG_RESULT([no])
621 noconfigdirs="$noconfigdirs target-libsanitizer"
622 else
623 AC_MSG_RESULT([yes])
624 fi
625 fi
626fi
627
b710ec85 628# Disable libvtv on unsupported systems.
629if test -d ${srcdir}/libvtv; then
630 if test x$enable_libvtv = x; then
631 AC_MSG_CHECKING([for libvtv support])
632 if (srcdir=${srcdir}/libvtv; \
633 . ${srcdir}/configure.tgt; \
6d0992e1 634 test "$VTV_SUPPORTED" != "yes")
b710ec85 635 then
636 AC_MSG_RESULT([no])
637 noconfigdirs="$noconfigdirs target-libvtv"
638 else
639 AC_MSG_RESULT([yes])
640 fi
641 fi
642fi
643
202baac8 644
645# Enable libmpx on supported systems by request.
646if test -d ${srcdir}/libmpx; then
647 if test x$enable_libmpx = xyes; then
648 AC_MSG_CHECKING([for libmpx support])
649 if (srcdir=${srcdir}/libmpx; \
650 . ${srcdir}/configure.tgt; \
651 test "$LIBMPX_SUPPORTED" != "yes")
652 then
653 AC_MSG_RESULT([no])
654 noconfigdirs="$noconfigdirs target-libmpx"
655 else
656 AC_MSG_RESULT([yes])
657 fi
658 else
659 noconfigdirs="$noconfigdirs target-libmpx"
660 fi
661fi
662
663
664
286256c7 665# Disable libquadmath for some systems.
666case "${target}" in
c36ee471 667 avr-*-*)
668 noconfigdirs="$noconfigdirs target-libquadmath"
669 ;;
286256c7 670 # libquadmath is unused on AIX and libquadmath build process use of
671 # LD_LIBRARY_PATH can break AIX bootstrap.
672 powerpc-*-aix* | rs6000-*-aix*)
673 noconfigdirs="$noconfigdirs target-libquadmath"
674 ;;
675esac
676
d5831552 677# Disable libssp for some systems.
678case "${target}" in
679 avr-*-*)
76c19016 680 # No hosted I/O support.
d5831552 681 noconfigdirs="$noconfigdirs target-libssp"
682 ;;
683 powerpc-*-aix* | rs6000-*-aix*)
684 noconfigdirs="$noconfigdirs target-libssp"
685 ;;
78e515f7 686 rl78-*-*)
687 # libssp uses a misaligned load to trigger a fault, but the RL78
688 # doesn't fault for those - instead, it gives a build-time error
689 # for explicit misaligned loads.
690 noconfigdirs="$noconfigdirs target-libssp"
691 ;;
8992df51 692 visium-*-*)
693 # No hosted I/O support.
694 noconfigdirs="$noconfigdirs target-libssp"
695 ;;
d5831552 696esac
697
d5831552 698# Disable libstdc++-v3 for some systems.
d3cf0a31 699# Allow user to override this if they pass --enable-libstdc++-v3
700if test "${ENABLE_LIBSTDCXX}" = "default" ; then
701 case "${target}" in
702 *-*-vxworks*)
703 # VxWorks uses the Dinkumware C++ library.
704 noconfigdirs="$noconfigdirs target-libstdc++-v3"
705 ;;
706 arm*-wince-pe*)
707 # the C++ libraries don't build on top of CE's C libraries
708 noconfigdirs="$noconfigdirs target-libstdc++-v3"
709 ;;
710 avr-*-*)
711 noconfigdirs="$noconfigdirs target-libstdc++-v3"
712 ;;
713 esac
714fi
d5831552 715
716# Disable Fortran for some systems.
717case "${target}" in
718 mmix-*-*)
719 # See <http://gcc.gnu.org/ml/gcc-patches/2004-11/msg00572.html>.
720 unsupported_languages="$unsupported_languages fortran"
721 ;;
722esac
723
91b5b6ec 724# Disable Java if libffi is not supported.
f24be480 725case "${target}" in
45e22a2e 726 aarch64-*-*)
727 ;;
91b5b6ec 728 alpha*-*-*)
729 ;;
730 arm*-*-*)
731 ;;
732 cris-*-*)
733 ;;
734 frv-*-*)
735 ;;
736 hppa*-*-linux*)
737 ;;
738 hppa*-*-hpux*)
739 ;;
740 i?86-*-*)
741 ;;
742 ia64*-*-*)
743 ;;
744 m32r*-*-*)
745 ;;
746 m68k-*-*)
747 ;;
5641963c 748 mips*-*-rtems*)
91b5b6ec 749 ;;
750 mips*-*-linux*)
751 ;;
752 powerpc*-*-linux*)
753 ;;
754 powerpc-*-darwin*)
755 ;;
756 powerpc-*-aix* | rs6000-*-aix*)
757 ;;
758 powerpc-*-freebsd*)
759 ;;
760 powerpc64-*-freebsd*)
761 ;;
762 powerpc*-*-rtems*)
f24be480 763 ;;
91b5b6ec 764 s390-*-* | s390x-*-*)
765 ;;
766 sh-*-* | sh[[34]]*-*-*)
767 ;;
768 sh64-*-* | sh5*-*-*)
769 ;;
770 sparc*-*-*)
771 ;;
772 x86_64-*-*)
773 ;;
774 *-*-*)
775 unsupported_languages="$unsupported_languages java"
776 ;;
777esac
778
779# Disable Java, libgcj or related libraries for some systems.
780case "${target}" in
f24be480 781 powerpc-*-darwin*)
782 ;;
783 i[[3456789]]86-*-darwin*)
784 ;;
785 x86_64-*-darwin[[912]]*)
786 ;;
787 *-*-darwin*)
788 noconfigdirs="$noconfigdirs ${libgcj}"
789 ;;
f24be480 790 *-*-netware*)
791 noconfigdirs="$noconfigdirs ${libgcj}"
792 ;;
793 *-*-rtems*)
794 noconfigdirs="$noconfigdirs ${libgcj}"
795 ;;
796 *-*-tpf*)
797 noconfigdirs="$noconfigdirs ${libgcj}"
798 ;;
799 *-*-uclinux*)
800 noconfigdirs="$noconfigdirs ${libgcj}"
801 ;;
802 *-*-vxworks*)
803 noconfigdirs="$noconfigdirs ${libgcj}"
804 ;;
f24be480 805 alpha*-*-*vms*)
806 noconfigdirs="$noconfigdirs ${libgcj}"
807 ;;
275d0a7c 808 arm*-*-freebsd*)
809 noconfigdirs="$noconfigdirs ${libgcj}"
810 ;;
91b5b6ec 811 arm-wince-pe)
f24be480 812 noconfigdirs="$noconfigdirs ${libgcj}"
813 ;;
f24be480 814 arm*-*-symbianelf*)
815 noconfigdirs="$noconfigdirs ${libgcj}"
816 ;;
f24be480 817 bfin-*-*)
f24be480 818 noconfigdirs="$noconfigdirs target-boehm-gc"
819 ;;
f24be480 820 cris-*-* | crisv32-*-*)
821 unsupported_languages="$unsupported_languages java"
822 case "${target}" in
823 *-*-linux*)
824 ;;
825 *) # See PR46792 regarding target-libffi.
826 noconfigdirs="$noconfigdirs target-libffi target-boehm-gc";;
827 esac
828 ;;
f24be480 829 hppa*64*-*-linux*)
830 # In this case, it's because the hppa64-linux target is for
831 # the kernel only at this point and has no libc, and thus no
832 # headers, crt*.o, etc., all of which are needed by these.
a7e330e9 833 unsupported_languages="$unsupported_languages java"
f24be480 834 ;;
a7e330e9 835 hppa*64*-*-hpux*)
f24be480 836 noconfigdirs="$noconfigdirs ${libgcj}"
837 ;;
838 hppa*-hp-hpux11*)
839 ;;
a7e330e9 840 hppa*-*-hpux*)
f24be480 841 # According to Alexandre Oliva <aoliva@redhat.com>, libjava won't
842 # build on HP-UX 10.20.
843 noconfigdirs="$noconfigdirs ${libgcj}"
844 ;;
f24be480 845 ia64*-*-*vms*)
846 noconfigdirs="$noconfigdirs ${libgcj}"
847 ;;
f24be480 848 i[[3456789]]86-w64-mingw*)
849 noconfigdirs="$noconfigdirs ${libgcj}"
850 ;;
851 i[[3456789]]86-*-mingw*)
852 noconfigdirs="$noconfigdirs ${libgcj}"
853 ;;
854 x86_64-*-mingw*)
855 noconfigdirs="$noconfigdirs ${libgcj}"
856 ;;
f24be480 857 mmix-*-*)
858 noconfigdirs="$noconfigdirs target-libffi target-boehm-gc"
f24be480 859 ;;
860 powerpc-*-aix*)
861 # copied from rs6000-*-* entry
862 noconfigdirs="$noconfigdirs ${libgcj}"
863 ;;
f24be480 864 rs6000-*-aix*)
865 noconfigdirs="$noconfigdirs ${libgcj}"
866 ;;
f24be480 867 *-*-lynxos*)
868 noconfigdirs="$noconfigdirs ${libgcj}"
10e64fba 869 ;;
f24be480 870esac
871
10e64fba 872# Disable the go frontend on systems where it is known to not work. Please keep
873# this in sync with contrib/config-list.mk.
56242c27 874case "${target}" in
875*-*-darwin* | *-*-cygwin* | *-*-mingw* | *-*-aix*)
876 unsupported_languages="$unsupported_languages go"
877 ;;
878esac
879
a6999726 880# Disable libgo for some systems where it is known to not work.
881# For testing, you can easily override this with --enable-libgo.
882if test x$enable_libgo = x; then
883 case "${target}" in
884 *-*-darwin*)
885 # PR 46986
886 noconfigdirs="$noconfigdirs target-libgo"
887 ;;
888 *-*-cygwin* | *-*-mingw*)
889 noconfigdirs="$noconfigdirs target-libgo"
890 ;;
891 *-*-aix*)
892 noconfigdirs="$noconfigdirs target-libgo"
893 ;;
894 esac
895fi
896
1c5767f1 897# Default libgloss CPU subdirectory.
898libgloss_dir="$target_cpu"
4ee9c684 899
e0942c78 900case "${target}" in
901 sh*-*-pe|mips*-*-pe|*arm-wince-pe)
902 libgloss_dir=wince
903 ;;
e26fddfa 904 aarch64*-*-* )
905 libgloss_dir=aarch64
906 ;;
e0942c78 907 arm*-*-*)
908 libgloss_dir=arm
909 ;;
910 cris-*-* | crisv32-*-*)
911 libgloss_dir=cris
912 ;;
913 hppa*-*-*)
914 libgloss_dir=pa
915 ;;
916 i[[3456789]]86-*-*)
917 libgloss_dir=i386
918 ;;
919 m68hc11-*-*|m6811-*-*|m68hc12-*-*|m6812-*-*)
920 libgloss_dir=m68hc11
921 ;;
922 m68*-*-* | fido-*-*)
923 libgloss_dir=m68k
924 ;;
925 mips*-*-*)
926 libgloss_dir=mips
927 ;;
928 powerpc*-*-*)
929 libgloss_dir=rs6000
930 ;;
931 sparc*-*-*)
932 libgloss_dir=sparc
933 ;;
934esac
935
d556f192 936# Disable newlib and libgloss for various target OSes.
28e9041c 937case "${target}" in
d556f192 938 alpha*-dec-osf*)
939 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
940 ;;
941 i[[3456789]]86-*-linux*)
942 # This section makes it possible to build newlib natively on linux.
943 # If we are using a cross compiler then don't configure newlib.
944 if test x${is_cross_compiler} != xno ; then
945 noconfigdirs="$noconfigdirs target-newlib"
946 fi
947 noconfigdirs="$noconfigdirs target-libgloss"
948 # If we are not using a cross compiler, do configure newlib.
949 # Note however, that newlib will only be configured in this situation
950 # if the --with-newlib option has been given, because otherwise
951 # 'target-newlib' will appear in skipdirs.
952 ;;
953 i[[3456789]]86-*-rdos*)
954 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
955 ;;
956 sh*-*-pe|mips*-*-pe|arm-wince-pe)
957 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
958 ;;
959 sparc-*-sunos4*)
960 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
961 ;;
962 *-*-aix*)
963 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
964 ;;
965 *-*-beos*)
966 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
967 ;;
f6dd84a6 968 *-*-chorusos)
71559dce 969 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
f6dd84a6 970 ;;
d556f192 971 *-*-dragonfly*)
972 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
973 ;;
974 *-*-freebsd*)
975 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
976 ;;
977 *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu | *-*-kopensolaris*-gnu)
978 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
979 ;;
980 *-*-lynxos*)
981 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
982 ;;
983 *-*-mingw*)
984 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
985 ;;
986 *-*-netbsd*)
987 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
988 ;;
989 *-*-netware*)
990 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
991 ;;
992 *-*-tpf*)
993 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
994 ;;
995 *-*-uclinux*)
996 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
997 ;;
998 *-*-vxworks*)
999 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
1000 ;;
1001esac
1002
1003case "${target}" in
1004 *-*-chorusos)
1005 ;;
40c500e1 1006 powerpc-*-darwin*)
dba2c8ea 1007 noconfigdirs="$noconfigdirs ld gas gdb gprof"
d28caca4 1008 noconfigdirs="$noconfigdirs sim target-rda"
0894307c 1009 ;;
ea864ded 1010 i[[3456789]]86-*-darwin*)
1011 noconfigdirs="$noconfigdirs ld gprof"
1012 noconfigdirs="$noconfigdirs sim target-rda"
1013 ;;
1014 x86_64-*-darwin[[912]]*)
d9f9f3af 1015 noconfigdirs="$noconfigdirs ld gas gprof"
1016 noconfigdirs="$noconfigdirs sim target-rda"
1017 ;;
fce068fd 1018 *-*-darwin*)
1019 noconfigdirs="$noconfigdirs ld gas gdb gprof"
1020 noconfigdirs="$noconfigdirs sim target-rda"
fce068fd 1021 ;;
e3a1fe08 1022 *-*-dragonfly*)
e3a1fe08 1023 ;;
c01dd063 1024 *-*-freebsd*)
4ee9c684 1025 if test "x$with_gmp" = x && test "x$with_gmp_dir" = x \
1026 && test -f /usr/local/include/gmp.h; then
1027 with_gmp=/usr/local
1028 fi
4ee9c684 1029 ;;
336577be 1030 *-*-kaos*)
1031 # Remove unsupported stuff on all kaOS configurations.
336577be 1032 noconfigdirs="$noconfigdirs target-libgloss"
1033 ;;
1602f15c 1034 *-*-netbsd*)
1602f15c 1035 ;;
634f7a13 1036 *-*-netware*)
28e9041c 1037 ;;
952fead6 1038 *-*-rtems*)
f24be480 1039 noconfigdirs="$noconfigdirs target-libgloss"
3e78a7ce 1040 # this is not caught below because this stanza matches earlier
1041 case $target in
1042 or1k*-*-*) noconfigdirs="$noconfigdirs gdb" ;;
1043 esac
952fead6 1044 ;;
9f88bc9d 1045 # The tpf target doesn't support gdb yet.
1046 *-*-tpf*)
d556f192 1047 noconfigdirs="$noconfigdirs gdb tcl tk libgui itcl"
9f88bc9d 1048 ;;
688429c4 1049 *-*-uclinux*)
d556f192 1050 noconfigdirs="$noconfigdirs target-rda"
688429c4 1051 ;;
28e9041c 1052 *-*-vxworks*)
28e9041c 1053 ;;
8c7cf808 1054 alpha*-dec-osf*)
ebd9f514 1055 # ld works, but does not support shared libraries.
28e9041c 1056 # gas doesn't generate exception information.
d556f192 1057 noconfigdirs="$noconfigdirs gas ld"
28e9041c 1058 ;;
1059 alpha*-*-*vms*)
f24be480 1060 noconfigdirs="$noconfigdirs gdb target-newlib target-libgloss"
28e9041c 1061 ;;
1062 alpha*-*-*)
1063 # newlib is not 64 bit ready
f24be480 1064 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
28e9041c 1065 ;;
8027f1d6 1066 sh*-*-pe|mips*-*-pe|*arm-wince-pe)
f843f075 1067 noconfigdirs="$noconfigdirs tcl tk itcl libgui sim"
8027f1d6 1068 ;;
3c867e46 1069 arc-*-*|arceb-*-*)
17b3d2a8 1070 noconfigdirs="$noconfigdirs target-libgloss"
151ad919 1071 ;;
28e9041c 1072 arm-*-pe*)
f24be480 1073 noconfigdirs="$noconfigdirs target-libgloss"
28e9041c 1074 ;;
ed37269d 1075 arm-*-riscix*)
71559dce 1076 noconfigdirs="$noconfigdirs ld target-libgloss"
ed37269d 1077 ;;
fd28e216 1078 avr-*-rtems*)
1079 ;;
1080 avr-*-*)
1081 if test x${with_avrlibc} != xno; then
1082 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
1083 fi
1084 ;;
6c5e2f80 1085 c4x-*-* | tic4x-*-*)
71559dce 1086 noconfigdirs="$noconfigdirs target-libgloss"
df2ff48f 1087 ;;
71559dce 1088 tic54x-*-*)
1089 noconfigdirs="$noconfigdirs target-libgloss gdb"
df2ff48f 1090 ;;
28e9041c 1091 d10v-*-*)
71559dce 1092 noconfigdirs="$noconfigdirs target-libgloss"
151ad919 1093 ;;
1094 d30v-*-*)
71559dce 1095 noconfigdirs="$noconfigdirs gdb"
28e9041c 1096 ;;
f9254114 1097 fr30-*-elf*)
f24be480 1098 noconfigdirs="$noconfigdirs gdb"
f9254114 1099 ;;
ca2751b6 1100 moxie-*-*)
ca2751b6 1101 noconfigdirs="$noconfigdirs gprof"
1102 ;;
df2ff48f 1103 h8300*-*-*)
f24be480 1104 noconfigdirs="$noconfigdirs target-libgloss"
df2ff48f 1105 ;;
28e9041c 1106 h8500-*-*)
71559dce 1107 noconfigdirs="$noconfigdirs target-libgloss"
28e9041c 1108 ;;
6675f2d9 1109 hppa1.1-*-osf* | hppa1.1-*-bsd* )
6675f2d9 1110 ;;
6bd59761 1111 hppa*64*-*-linux*)
954078d1 1112 ;;
99684e84 1113 hppa*-*-linux*)
08261f02 1114 ;;
28e9041c 1115 hppa*-*-*elf* | \
1ef89cd1 1116 hppa*-*-lites* | \
dc0ea924 1117 hppa*-*-openbsd* | \
1ef89cd1 1118 hppa*64*-*-*)
28e9041c 1119 ;;
75d59721 1120 hppa*-hp-hpux11*)
6c9785b4 1121 noconfigdirs="$noconfigdirs ld"
75d59721 1122 ;;
1c5767f1 1123 hppa*-*-pro*)
1c5767f1 1124 ;;
28e9041c 1125 hppa*-*-*)
f24be480 1126 noconfigdirs="$noconfigdirs ld"
151ad919 1127 ;;
4a9237fb 1128 i960-*-*)
71559dce 1129 noconfigdirs="$noconfigdirs gdb"
4a9237fb 1130 ;;
151ad919 1131 ia64*-*-elf*)
1132 # No gdb support yet.
6c9785b4 1133 noconfigdirs="$noconfigdirs readline libgui itcl gdb"
151ad919 1134 ;;
df2ff48f 1135 ia64*-**-hpux*)
1aca86a6 1136 # No ld support yet.
f24be480 1137 noconfigdirs="$noconfigdirs libgui itcl ld"
df2ff48f 1138 ;;
8408ca00 1139 ia64*-*-*vms*)
3211401d 1140 # No ld support yet.
1141 noconfigdirs="$noconfigdirs libgui itcl ld"
8408ca00 1142 ;;
ec2eb8fb 1143 i[[3456789]]86-w64-mingw*)
ec2eb8fb 1144 ;;
1145 i[[3456789]]86-*-mingw*)
d6d689df 1146 target_configdirs="$target_configdirs target-winsup"
fe284774 1147 ;;
151ad919 1148 *-*-cygwin*)
1149 target_configdirs="$target_configdirs target-libtermcap target-winsup"
6c9785b4 1150 noconfigdirs="$noconfigdirs target-libgloss"
2c10944d 1151 # always build newlib if winsup directory is present.
d6d689df 1152 if test -d "$srcdir/winsup/cygwin"; then
2c10944d 1153 skipdirs=`echo " ${skipdirs} " | sed -e 's/ target-newlib / /'`
3fba36a4 1154 elif test -d "$srcdir/newlib"; then
d6d689df 1155 echo "Warning: winsup/cygwin is missing so newlib can't be built."
2c10944d 1156 fi
fe284774 1157 ;;
f74ea578 1158 i[[3456789]]86-*-pe)
17b3d2a8 1159 noconfigdirs="$noconfigdirs target-libgloss"
28e9041c 1160 ;;
f74ea578 1161 i[[3456789]]86-*-sco3.2v5*)
28e9041c 1162 # The linker does not yet know about weak symbols in COFF,
1163 # and is not configured to handle mixed ELF and COFF.
71559dce 1164 noconfigdirs="$noconfigdirs ld target-libgloss"
28e9041c 1165 ;;
f74ea578 1166 i[[3456789]]86-*-sco*)
71559dce 1167 noconfigdirs="$noconfigdirs gprof target-libgloss"
28e9041c 1168 ;;
14f27bc6 1169 i[[3456789]]86-*-solaris2* | x86_64-*-solaris2.1[[0-9]]*)
ef1760c1 1170 noconfigdirs="$noconfigdirs target-libgloss"
28e9041c 1171 ;;
f74ea578 1172 i[[3456789]]86-*-sysv4*)
71559dce 1173 noconfigdirs="$noconfigdirs target-libgloss"
28e9041c 1174 ;;
f74ea578 1175 i[[3456789]]86-*-beos*)
d556f192 1176 noconfigdirs="$noconfigdirs gdb"
602d002b 1177 ;;
ab0da556 1178 i[[3456789]]86-*-rdos*)
d556f192 1179 noconfigdirs="$noconfigdirs gdb"
1c5767f1 1180 ;;
38135c1e 1181 mmix-*-*)
f24be480 1182 noconfigdirs="$noconfigdirs gdb"
38135c1e 1183 ;;
957985d9 1184 mt-*-*)
f6fa11cb 1185 noconfigdirs="$noconfigdirs sim"
1186 ;;
28e9041c 1187 powerpc-*-aix*)
1188 # copied from rs6000-*-* entry
d556f192 1189 noconfigdirs="$noconfigdirs gprof"
28e9041c 1190 ;;
6bd59761 1191 powerpc*-*-winnt* | powerpc*-*-pe*)
28e9041c 1192 target_configdirs="$target_configdirs target-winsup"
71559dce 1193 noconfigdirs="$noconfigdirs gdb tcl tk target-libgloss itcl"
28e9041c 1194 # always build newlib.
1195 skipdirs=`echo " ${skipdirs} " | sed -e 's/ target-newlib / /'`
1196 ;;
1197 # This is temporary until we can link against shared libraries
1198 powerpcle-*-solaris*)
71559dce 1199 noconfigdirs="$noconfigdirs gdb sim tcl tk itcl"
28e9041c 1200 ;;
1532359f 1201 powerpc-*-beos*)
d556f192 1202 noconfigdirs="$noconfigdirs gdb"
151ad919 1203 ;;
28e9041c 1204 rs6000-*-lynxos*)
d556f192 1205 noconfigdirs="$noconfigdirs gprof"
28e9041c 1206 ;;
1207 rs6000-*-aix*)
d556f192 1208 noconfigdirs="$noconfigdirs gprof"
28e9041c 1209 ;;
1210 rs6000-*-*)
f24be480 1211 noconfigdirs="$noconfigdirs gprof"
28e9041c 1212 ;;
1213 m68k-apollo-*)
71559dce 1214 noconfigdirs="$noconfigdirs ld binutils gprof target-libgloss"
28e9041c 1215 ;;
ba2b484f 1216 microblaze*)
f24be480 1217 noconfigdirs="$noconfigdirs gprof"
ba2b484f 1218 ;;
3e78a7ce 1219 mips*-sde-elf* | mips*-mti-elf* | mips*-img-elf*)
68c9bc25 1220 if test x$with_newlib = xyes; then
1221 noconfigdirs="$noconfigdirs gprof"
1222 fi
68c9bc25 1223 ;;
28e9041c 1224 mips*-*-irix5*)
71559dce 1225 noconfigdirs="$noconfigdirs gprof target-libgloss"
28e9041c 1226 ;;
1227 mips*-*-irix6*)
f24be480 1228 noconfigdirs="$noconfigdirs gprof target-libgloss"
28e9041c 1229 ;;
28e9041c 1230 mips*-*-bsd*)
d6449910 1231 noconfigdirs="$noconfigdirs ld gas gprof target-libgloss"
28e9041c 1232 ;;
857f2cca 1233 mips*-*-linux*)
857f2cca 1234 ;;
d6449910 1235 mips*-*-ultrix* | mips*-*-osf* | mips*-*-ecoff* | mips*-*-pe* \
1236 | mips*-*-irix* | mips*-*-lnews* | mips*-*-riscos*)
1237 noconfigdirs="$noconfigdirs ld gas gprof"
1238 ;;
28e9041c 1239 mips*-*-*)
f24be480 1240 noconfigdirs="$noconfigdirs gprof"
28e9041c 1241 ;;
3e78a7ce 1242 nds32*-*-*)
1243 noconfigdirs="$noconfigdirs gdb"
1244 ;;
8ce80784 1245 nvptx*-*-*)
1246 # nvptx is just a compiler
1247 noconfigdirs="$noconfigdirs target-libssp target-libstdc++-v3 target-libobjc"
1248 ;;
3e78a7ce 1249 or1k*-*-*)
1250 noconfigdirs="$noconfigdirs gdb"
1251 ;;
33974778 1252 sh-*-* | sh64-*-*)
39f6b116 1253 case "${target}" in
1254 sh*-*-elf)
f24be480 1255 ;;
39f6b116 1256 *)
f24be480 1257 noconfigdirs="$noconfigdirs target-libgloss" ;;
39f6b116 1258 esac
28e9041c 1259 ;;
1260 sparc-*-sunos4*)
d556f192 1261 if test x${is_cross_compiler} = xno ; then
28e9041c 1262 use_gnu_ld=no
1263 fi
1264 ;;
fa0a53e3 1265 tic6x-*-*)
ccdfa490 1266 noconfigdirs="$noconfigdirs sim"
fa0a53e3 1267 ;;
2da35515 1268 tilepro*-*-* | tilegx*-*-*)
e5fa74b2 1269 noconfigdirs="$noconfigdirs sim"
1270 ;;
28e9041c 1271 v810-*-*)
71559dce 1272 noconfigdirs="$noconfigdirs bfd binutils gas gdb ld opcodes target-libgloss"
28e9041c 1273 ;;
1274 vax-*-*)
f24be480 1275 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
28e9041c 1276 ;;
28e9041c 1277esac
1278
28e9041c 1279# If we aren't building newlib, then don't build libgloss, since libgloss
1280# depends upon some newlib header files.
1281case "${noconfigdirs}" in
1282 *target-libgloss*) ;;
1283 *target-newlib*) noconfigdirs="$noconfigdirs target-libgloss" ;;
13b1b53a 1284esac
28e9041c 1285
13b1b53a 1286# Work in distributions that contain no compiler tools, like Autoconf.
71ab34df 1287host_makefile_frag=/dev/null
13b1b53a 1288if test -d ${srcdir}/config ; then
1289case "${host}" in
f74ea578 1290 i[[3456789]]86-*-msdosdjgpp*)
13b1b53a 1291 host_makefile_frag="config/mh-djgpp"
1292 ;;
1293 *-cygwin*)
45043b2b 1294 ACX_CHECK_CYGWIN_CAT_WORKS
13b1b53a 1295 host_makefile_frag="config/mh-cygwin"
1296 ;;
5a92bcc2 1297 *-mingw*)
70d8e49e 1298 host_makefile_frag="config/mh-mingw"
06dd9e69 1299 ;;
bed3355c 1300 alpha*-linux*)
539ded76 1301 host_makefile_frag="config/mh-alpha-linux"
1302 ;;
3bed0958 1303 hppa*-hp-hpux10*)
3bed0958 1304 host_makefile_frag="config/mh-pa-hpux10"
13b1b53a 1305 ;;
b2240ff6 1306 hppa*-hp-hpux*)
3bed0958 1307 host_makefile_frag="config/mh-pa"
1308 ;;
1309 hppa*-*)
1310 host_makefile_frag="config/mh-pa"
1311 ;;
16463c8d 1312 *-*-darwin*)
1313 host_makefile_frag="config/mh-darwin"
0222d984 1314 ;;
9d44a802 1315 powerpc-*-aix*)
1316 host_makefile_frag="config/mh-ppc-aix"
1317 ;;
1318 rs6000-*-aix*)
1319 host_makefile_frag="config/mh-ppc-aix"
1320 ;;
13b1b53a 1321esac
1322fi
1323
c24c5e46 1324if test "${build}" != "${host}" ; then
93c5e793 1325 AR_FOR_BUILD=${AR_FOR_BUILD-ar}
1326 AS_FOR_BUILD=${AS_FOR_BUILD-as}
c24c5e46 1327 CC_FOR_BUILD=${CC_FOR_BUILD-gcc}
93c5e793 1328 CXX_FOR_BUILD=${CXX_FOR_BUILD-g++}
1329 GCJ_FOR_BUILD=${GCJ_FOR_BUILD-gcj}
1330 GFORTRAN_FOR_BUILD=${GFORTRAN_FOR_BUILD-gfortran}
5ff5b630 1331 GOC_FOR_BUILD=${GOC_FOR_BUILD-gccgo}
93c5e793 1332 DLLTOOL_FOR_BUILD=${DLLTOOL_FOR_BUILD-dlltool}
1333 LD_FOR_BUILD=${LD_FOR_BUILD-ld}
1334 NM_FOR_BUILD=${NM_FOR_BUILD-nm}
1335 RANLIB_FOR_BUILD=${RANLIB_FOR_BUILD-ranlib}
1336 WINDRES_FOR_BUILD=${WINDRES_FOR_BUILD-windres}
1337 WINDMC_FOR_BUILD=${WINDMC_FOR_BUILD-windmc}
c24c5e46 1338else
93c5e793 1339 AR_FOR_BUILD="\$(AR)"
1340 AS_FOR_BUILD="\$(AS)"
c24c5e46 1341 CC_FOR_BUILD="\$(CC)"
93c5e793 1342 CXX_FOR_BUILD="\$(CXX)"
1343 GCJ_FOR_BUILD="\$(GCJ)"
1344 GFORTRAN_FOR_BUILD="\$(GFORTRAN)"
5ff5b630 1345 GOC_FOR_BUILD="\$(GOC)"
93c5e793 1346 DLLTOOL_FOR_BUILD="\$(DLLTOOL)"
1347 LD_FOR_BUILD="\$(LD)"
1348 NM_FOR_BUILD="\$(NM)"
1349 RANLIB_FOR_BUILD="\$(RANLIB)"
1350 WINDRES_FOR_BUILD="\$(WINDRES)"
1351 WINDMC_FOR_BUILD="\$(WINDMC)"
eae5b2bc 1352fi
c24c5e46 1353
eae5b2bc 1354AC_PROG_CC
1355AC_PROG_CXX
1356
1357# We must set the default linker to the linker used by gcc for the correct
1358# operation of libtool. If LD is not defined and we are using gcc, try to
1359# set the LD default to the ld used by gcc.
1360if test -z "$LD"; then
1361 if test "$GCC" = yes; then
1362 case $build in
1363 *-*-mingw*)
1364 gcc_prog_ld=`$CC -print-prog-name=ld 2>&1 | tr -d '\015'` ;;
1365 *)
1366 gcc_prog_ld=`$CC -print-prog-name=ld 2>&1` ;;
1367 esac
1368 case $gcc_prog_ld in
1369 # Accept absolute paths.
1370 [[\\/]* | [A-Za-z]:[\\/]*)]
1371 LD="$gcc_prog_ld" ;;
1372 esac
1373 fi
c24c5e46 1374fi
1375
13687c85 1376# Check whether -static-libstdc++ -static-libgcc is supported.
1377have_static_libs=no
1378if test "$GCC" = yes; then
1379 saved_LDFLAGS="$LDFLAGS"
1380
1381 LDFLAGS="$LDFLAGS -static-libstdc++ -static-libgcc"
1382 AC_MSG_CHECKING([whether g++ accepts -static-libstdc++ -static-libgcc])
1383 AC_LANG_PUSH(C++)
74f1ea54 1384 AC_LINK_IFELSE([
1385#if (__GNUC__ < 4) || (__GNUC__ == 4 && __GNUC_MINOR__ < 5)
1386#error -static-libstdc++ not implemented
1387#endif
1388int main() {}],
13687c85 1389 [AC_MSG_RESULT([yes]); have_static_libs=yes],
1390 [AC_MSG_RESULT([no])])
1391 AC_LANG_POP(C++)
1392
1393 LDFLAGS="$saved_LDFLAGS"
1394fi
1395
c24c5e46 1396ACX_PROG_GNAT
7bcc3b4a 1397ACX_PROG_CMP_IGNORE_INITIAL
c24c5e46 1398
6c59dfa4 1399AC_ARG_ENABLE([bootstrap],
1400[AS_HELP_STRING([--enable-bootstrap],
1401 [enable bootstrapping @<:@yes if native build@:>@])],,
1402enable_bootstrap=default)
1403
1404# Issue errors and warnings for invalid/strange bootstrap combinations.
d7c9b4c1 1405if test -r $srcdir/gcc/configure; then
1406 have_compiler=yes
1407else
1408 have_compiler=no
1409fi
6c59dfa4 1410
1411case "$have_compiler:$host:$target:$enable_bootstrap" in
1412 *:*:*:no) ;;
1413
1414 # Default behavior. Enable bootstrap if we have a compiler
1415 # and we are in a native configuration.
1416 yes:$build:$build:default)
1417 enable_bootstrap=yes ;;
1418
1419 *:*:*:default)
1420 enable_bootstrap=no ;;
1421
1422 # We have a compiler and we are in a native configuration, bootstrap is ok
1423 yes:$build:$build:yes)
1424 ;;
1425
1426 # Other configurations, but we have a compiler. Assume the user knows
1427 # what he's doing.
1428 yes:*:*:yes)
1429 AC_MSG_WARN([trying to bootstrap a cross compiler])
1430 ;;
1431
1432 # No compiler: if they passed --enable-bootstrap explicitly, fail
1433 no:*:*:yes)
1434 AC_MSG_ERROR([cannot bootstrap without a compiler]) ;;
1435
1436 # Fail if wrong command line
1437 *)
1438 AC_MSG_ERROR([invalid option for --enable-bootstrap])
1439 ;;
1440esac
1441
c3fc6a63 1442# Used for setting $lt_cv_objdir
1443_LT_CHECK_OBJDIR
1444
7601a55c 1445# Check for GMP, MPFR and MPC
16de6a81 1446gmplibs="-lmpc -lmpfr -lgmp"
4ee9c684 1447gmpinc=
d45318b3 1448have_gmp=no
7601a55c 1449
1450# Specify a location for mpc
1451# check for this first so it ends up on the link line before mpfr.
8747a938 1452AC_ARG_WITH(mpc,
1453[AS_HELP_STRING([--with-mpc=PATH],
1454 [specify prefix directory for installed MPC package.
1455 Equivalent to --with-mpc-include=PATH/include
1456 plus --with-mpc-lib=PATH/lib])])
1457AC_ARG_WITH(mpc-include,
1458[AS_HELP_STRING([--with-mpc-include=PATH],
1459 [specify directory for installed MPC include files])])
1460AC_ARG_WITH(mpc-lib,
1461[AS_HELP_STRING([--with-mpc-lib=PATH],
1462 [specify directory for the installed MPC library])])
7601a55c 1463
1464if test "x$with_mpc" != x; then
16de6a81 1465 gmplibs="-L$with_mpc/lib $gmplibs"
1466 gmpinc="-I$with_mpc/include $gmpinc"
7601a55c 1467fi
1468if test "x$with_mpc_include" != x; then
16de6a81 1469 gmpinc="-I$with_mpc_include $gmpinc"
7601a55c 1470fi
1471if test "x$with_mpc_lib" != x; then
16de6a81 1472 gmplibs="-L$with_mpc_lib $gmplibs"
7601a55c 1473fi
1474if test "x$with_mpc$with_mpc_include$with_mpc_lib" = x && test -d ${srcdir}/mpc; then
c3fc6a63 1475 gmplibs='-L$$r/$(HOST_SUBDIR)/mpc/src/'"$lt_cv_objdir $gmplibs"
16de6a81 1476 gmpinc='-I$$s/mpc/src '"$gmpinc"
7601a55c 1477 # Do not test the mpc version. Assume that it is sufficient, since
1478 # it is in the source tree, and the library has not been built yet
1479 # but it would be included on the link line in the version check below
1480 # hence making the test fail.
16de6a81 1481 have_gmp=yes
7601a55c 1482fi
d45318b3 1483
5ca838b8 1484# Specify a location for mpfr
1485# check for this first so it ends up on the link line before gmp.
8747a938 1486AC_ARG_WITH(mpfr-dir,
1487[AS_HELP_STRING([--with-mpfr-dir=PATH], [this option has been REMOVED])],
1488[AC_MSG_ERROR([The --with-mpfr-dir=PATH option has been removed.
1489Use --with-mpfr=PATH or --with-mpfr-include=PATH plus --with-mpfr-lib=PATH])])
1490
1491AC_ARG_WITH(mpfr,
1492[AS_HELP_STRING([--with-mpfr=PATH],
1493 [specify prefix directory for installed MPFR package.
1494 Equivalent to --with-mpfr-include=PATH/include
1495 plus --with-mpfr-lib=PATH/lib])])
1496AC_ARG_WITH(mpfr-include,
1497[AS_HELP_STRING([--with-mpfr-include=PATH],
1498 [specify directory for installed MPFR include files])])
1499AC_ARG_WITH(mpfr-lib,
1500[AS_HELP_STRING([--with-mpfr-lib=PATH],
1501 [specify directory for the installed MPFR library])])
5ca838b8 1502
1503if test "x$with_mpfr" != x; then
1504 gmplibs="-L$with_mpfr/lib $gmplibs"
16de6a81 1505 gmpinc="-I$with_mpfr/include $gmpinc"
5ca838b8 1506fi
a5144c1d 1507if test "x$with_mpfr_include" != x; then
16de6a81 1508 gmpinc="-I$with_mpfr_include $gmpinc"
a5144c1d 1509fi
1510if test "x$with_mpfr_lib" != x; then
1511 gmplibs="-L$with_mpfr_lib $gmplibs"
1512fi
d45318b3 1513if test "x$with_mpfr$with_mpfr_include$with_mpfr_lib" = x && test -d ${srcdir}/mpfr; then
37ca4325 1514 # MPFR v3.1.0 moved the sources into a src sub-directory.
1515 if test -d ${srcdir}/mpfr/src; then
1516 gmplibs='-L$$r/$(HOST_SUBDIR)/mpfr/src/'"$lt_cv_objdir $gmplibs"
1517 gmpinc='-I$$r/$(HOST_SUBDIR)/mpfr/src -I$$s/mpfr/src '"$gmpinc"
1518 extra_mpc_mpfr_configure_flags='--with-mpfr-include=$$s/mpfr/src --with-mpfr-lib=$$r/$(HOST_SUBDIR)/mpfr/src/'"$lt_cv_objdir"
1519 else
1520 gmplibs='-L$$r/$(HOST_SUBDIR)/mpfr/'"$lt_cv_objdir $gmplibs"
1521 gmpinc='-I$$r/$(HOST_SUBDIR)/mpfr -I$$s/mpfr '"$gmpinc"
1522 extra_mpc_mpfr_configure_flags='--with-mpfr-include=$$s/mpfr --with-mpfr-lib=$$r/$(HOST_SUBDIR)/mpfr/'"$lt_cv_objdir"
1523 fi
d45318b3 1524 # Do not test the mpfr version. Assume that it is sufficient, since
1525 # it is in the source tree, and the library has not been built yet
1526 # but it would be included on the link line in the version check below
1527 # hence making the test fail.
1528 have_gmp=yes
1529fi
5ca838b8 1530
4ee9c684 1531# Specify a location for gmp
8747a938 1532AC_ARG_WITH(gmp-dir,
1533[AS_HELP_STRING([--with-gmp-dir=PATH], [this option has been REMOVED])],
1534[AC_MSG_ERROR([The --with-gmp-dir=PATH option has been removed.
1535Use --with-gmp=PATH or --with-gmp-include=PATH plus --with-gmp-lib=PATH])])
1536
1537AC_ARG_WITH(gmp,
1538[AS_HELP_STRING([--with-gmp=PATH],
1539 [specify prefix directory for the installed GMP package.
1540 Equivalent to --with-gmp-include=PATH/include
1541 plus --with-gmp-lib=PATH/lib])])
1542AC_ARG_WITH(gmp-include,
1543[AS_HELP_STRING([--with-gmp-include=PATH],
1544 [specify directory for installed GMP include files])])
1545AC_ARG_WITH(gmp-lib,
1546[AS_HELP_STRING([--with-gmp-lib=PATH],
1547 [specify directory for the installed GMP library])])
4ee9c684 1548
4ee9c684 1549
5ca838b8 1550if test "x$with_gmp" != x; then
1551 gmplibs="-L$with_gmp/lib $gmplibs"
1552 gmpinc="-I$with_gmp/include $gmpinc"
4ee9c684 1553fi
a5144c1d 1554if test "x$with_gmp_include" != x; then
1555 gmpinc="-I$with_gmp_include $gmpinc"
1556fi
1557if test "x$with_gmp_lib" != x; then
1558 gmplibs="-L$with_gmp_lib $gmplibs"
1559fi
d45318b3 1560if test "x$with_gmp$with_gmp_include$with_gmp_lib" = x && test -d ${srcdir}/gmp; then
c3fc6a63 1561 gmplibs='-L$$r/$(HOST_SUBDIR)/gmp/'"$lt_cv_objdir $gmplibs"
d45318b3 1562 gmpinc='-I$$r/$(HOST_SUBDIR)/gmp -I$$s/gmp '"$gmpinc"
b9a8e4c4 1563 extra_mpfr_configure_flags='--with-gmp-include=$$r/$(HOST_SUBDIR)/gmp --with-gmp-lib=$$r/$(HOST_SUBDIR)/gmp/'"$lt_cv_objdir"
c3fc6a63 1564 extra_mpc_gmp_configure_flags='--with-gmp-include=$$r/$(HOST_SUBDIR)/gmp --with-gmp-lib=$$r/$(HOST_SUBDIR)/gmp/'"$lt_cv_objdir"
e4128452 1565 extra_isl_gmp_configure_flags='--with-gmp-builddir=$$r/$(HOST_SUBDIR)/gmp'
d45318b3 1566 # Do not test the gmp version. Assume that it is sufficient, since
1567 # it is in the source tree, and the library has not been built yet
1568 # but it would be included on the link line in the version check below
1569 # hence making the test fail.
1570 have_gmp=yes
1571fi
4ee9c684 1572
16c9b2e3 1573if test -d ${srcdir}/gcc && test "x$have_gmp" = xno; then
d45318b3 1574 have_gmp=yes
1575 saved_CFLAGS="$CFLAGS"
1576 CFLAGS="$CFLAGS $gmpinc"
17b6993a 1577 # Check for the recommended and required versions of GMP.
1578 AC_MSG_CHECKING([for the correct version of gmp.h])
d45318b3 1579 AC_TRY_COMPILE([#include "gmp.h"],[
17b6993a 1580 #define GCC_GMP_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
1581 #define GCC_GMP_VERSION GCC_GMP_VERSION_NUM(__GNU_MP_VERSION,__GNU_MP_VERSION_MINOR,__GNU_MP_VERSION_PATCHLEVEL)
f819bb73 1582 #if GCC_GMP_VERSION < GCC_GMP_VERSION_NUM(4,2,3)
112f3d57 1583 choke me
d45318b3 1584 #endif
4fd35f21 1585 ], [AC_TRY_COMPILE([#include <gmp.h>],[
17b6993a 1586 #define GCC_GMP_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
1587 #define GCC_GMP_VERSION GCC_GMP_VERSION_NUM(__GNU_MP_VERSION,__GNU_MP_VERSION_MINOR,__GNU_MP_VERSION_PATCHLEVEL)
1588 #if GCC_GMP_VERSION < GCC_GMP_VERSION_NUM(4,3,2)
1589 choke me
1590 #endif
4fd35f21 1591 ], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([buggy but acceptable])])],
17b6993a 1592 [AC_MSG_RESULT([no]); have_gmp=no])
d45318b3 1593
7601a55c 1594 # If we have GMP, check the MPFR version.
d45318b3 1595 if test x"$have_gmp" = xyes; then
17b6993a 1596 # Check for the recommended and required versions of MPFR.
1597 AC_MSG_CHECKING([for the correct version of mpfr.h])
7601a55c 1598 AC_TRY_COMPILE([#include <gmp.h>
d45318b3 1599 #include <mpfr.h>],[
cb1d9044 1600 #if MPFR_VERSION < MPFR_VERSION_NUM(2,4,0)
d45318b3 1601 choke me
1602 #endif
4fd35f21 1603 ], [AC_TRY_COMPILE([#include <gmp.h>
7601a55c 1604 #include <mpfr.h>],[
17b6993a 1605 #if MPFR_VERSION < MPFR_VERSION_NUM(2,4,2)
7601a55c 1606 choke me
1607 #endif
4fd35f21 1608 ], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([buggy but acceptable])])],
7601a55c 1609 [AC_MSG_RESULT([no]); have_gmp=no])
1610 fi
1611
1612 # Check for the MPC header version.
16de6a81 1613 if test x"$have_gmp" = xyes ; then
17b6993a 1614 # Check for the recommended and required versions of MPC.
7601a55c 1615 AC_MSG_CHECKING([for the correct version of mpc.h])
1616 AC_TRY_COMPILE([#include <mpc.h>],[
17b6993a 1617 #if MPC_VERSION < MPC_VERSION_NUM(0,8,0)
7601a55c 1618 choke me
1619 #endif
4fd35f21 1620 ], [AC_TRY_COMPILE([#include <mpc.h>],[
17b6993a 1621 #if MPC_VERSION < MPC_VERSION_NUM(0,8,1)
1622 choke me
1623 #endif
4fd35f21 1624 ], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([buggy but acceptable])])],
17b6993a 1625 [AC_MSG_RESULT([no]); have_gmp=no])
7601a55c 1626 fi
1627
1628 # Now check the MPFR library.
1629 if test x"$have_gmp" = xyes; then
1630 saved_LIBS="$LIBS"
1631 LIBS="$LIBS $gmplibs"
16de6a81 1632 AC_MSG_CHECKING([for the correct version of the gmp/mpfr/mpc libraries])
1633 AC_TRY_LINK([#include <mpc.h>],[
78a477ad 1634 mpfr_t n;
1635 mpfr_t x;
16de6a81 1636 mpc_t c;
d45318b3 1637 int t;
78a477ad 1638 mpfr_init (n);
1639 mpfr_init (x);
d45318b3 1640 mpfr_atan2 (n, n, x, GMP_RNDN);
1641 mpfr_erfc (n, x, GMP_RNDN);
1642 mpfr_subnormalize (x, t, GMP_RNDN);
16de6a81 1643 mpfr_clear(n);
1644 mpfr_clear(x);
1645 mpc_init2 (c, 53);
1646 mpc_set_ui_ui (c, 1, 1, MPC_RNDNN);
1647 mpc_cosh (c, c, MPC_RNDNN);
1648 mpc_pow (c, c, c, MPC_RNDNN);
1649 mpc_acosh (c, c, MPC_RNDNN);
1650 mpc_clear (c);
7601a55c 1651 ], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]); have_gmp=no])
1652 LIBS="$saved_LIBS"
d45318b3 1653 fi
7601a55c 1654
d45318b3 1655 CFLAGS="$saved_CFLAGS"
4ee9c684 1656
17b6993a 1657# The library versions listed in the error message below should match
1658# the HARD-minimums enforced above.
d45318b3 1659 if test x$have_gmp != xyes; then
cb1d9044 1660 AC_MSG_ERROR([Building GCC requires GMP 4.2+, MPFR 2.4.0+ and MPC 0.8.0+.
16de6a81 1661Try the --with-gmp, --with-mpfr and/or --with-mpc options to specify
1662their locations. Source code for these libraries can be found at
1663their respective hosting sites as well as at
1664ftp://gcc.gnu.org/pub/gcc/infrastructure/. See also
1665http://gcc.gnu.org/install/prerequisites.html for additional info. If
1666you obtained GMP, MPFR and/or MPC from a vendor distribution package,
1667make sure that you have installed both the libraries and the header
1668files. They may be located in separate packages.])
d45318b3 1669 fi
6a086156 1670fi
1671
7601a55c 1672# Flags needed for both GMP, MPFR and/or MPC.
4ee9c684 1673AC_SUBST(gmplibs)
1674AC_SUBST(gmpinc)
bff7ea4a 1675AC_SUBST(extra_mpfr_configure_flags)
7601a55c 1676AC_SUBST(extra_mpc_gmp_configure_flags)
1677AC_SUBST(extra_mpc_mpfr_configure_flags)
e4128452 1678AC_SUBST(extra_isl_gmp_configure_flags)
4ee9c684 1679
5bc96548 1680# Allow host libstdc++ to be specified for static linking with PPL.
8747a938 1681AC_ARG_WITH(host-libstdcxx,
1682[AS_HELP_STRING([--with-host-libstdcxx=L],
1683 [use linker arguments L to link with libstdc++
1684 when linking with PPL])])
5bc96548 1685
1686case $with_host_libstdcxx in
1687 no|yes)
1688 AC_MSG_ERROR([-with-host-libstdcxx needs an argument])
1689 ;;
1690esac
255b6be7 1691
7ab76cec 1692# Libraries to use for stage1 or when not bootstrapping.
1693AC_ARG_WITH(stage1-libs,
8747a938 1694[AS_HELP_STRING([--with-stage1-libs=LIBS], [libraries for stage1])],
7ab76cec 1695[if test "$withval" = "no" -o "$withval" = "yes"; then
1696 stage1_libs=
1697 else
1698 stage1_libs=$withval
1699 fi],
1700[stage1_libs=$with_host_libstdcxx])
1701AC_SUBST(stage1_libs)
1702
13687c85 1703# Linker flags to use for stage1 or when not bootstrapping.
1704AC_ARG_WITH(stage1-ldflags,
1705[AS_HELP_STRING([--with-stage1-ldflags=FLAGS], [linker flags for stage1])],
1706[if test "$withval" = "no" -o "$withval" = "yes"; then
1707 stage1_ldflags=
1708 else
1709 stage1_ldflags=$withval
1710 fi],
1711[stage1_ldflags=
1712 # In stage 1, default to linking libstdc++ and libgcc statically with GCC
1713 # if supported. But if the user explicitly specified the libraries to use,
1714 # trust that they are doing what they want.
1715 if test "$stage1_libs" = "" -a "$have_static_libs" = yes; then
1716 stage1_ldflags="-static-libstdc++ -static-libgcc"
1717 fi])
1718AC_SUBST(stage1_ldflags)
1719
7ab76cec 1720# Libraries to use for stage2 and later builds. This defaults to the
1721# argument passed to --with-host-libstdcxx.
1722AC_ARG_WITH(boot-libs,
8747a938 1723[AS_HELP_STRING([--with-boot-libs=LIBS], [libraries for stage2 and later])],
7ab76cec 1724[if test "$withval" = "no" -o "$withval" = "yes"; then
1725 poststage1_libs=
1726 else
5110389d 1727 poststage1_libs=$withval
7ab76cec 1728 fi],
1729[poststage1_libs=$with_host_libstdcxx])
1730AC_SUBST(poststage1_libs)
1731
d6dfe18a 1732# Linker flags to use for stage2 and later builds.
1733AC_ARG_WITH(boot-ldflags,
8747a938 1734[AS_HELP_STRING([--with-boot-ldflags=FLAGS],
1735 [linker flags for stage2 and later])],
d6dfe18a 1736[if test "$withval" = "no" -o "$withval" = "yes"; then
1737 poststage1_ldflags=
1738 else
1739 poststage1_ldflags=$withval
1740 fi],
1741[poststage1_ldflags=
7deb2d70 1742 # In stages 2 and 3, default to linking libstdc++ and libgcc
1743 # statically. But if the user explicitly specified the libraries to
1744 # use, trust that they are doing what they want.
1745 if test "$poststage1_libs" = ""; then
d6dfe18a 1746 poststage1_ldflags="-static-libstdc++ -static-libgcc"
1747 fi])
1748AC_SUBST(poststage1_ldflags)
1749
572cf1f7 1750# GCC GRAPHITE dependency ISL.
1751# Basic setup is inlined here, actual checks are in config/isl.m4
83d54ac4 1752
83d54ac4 1753AC_ARG_WITH(isl,
1754 [AS_HELP_STRING(
1755 [--with-isl=PATH],
1756 [Specify prefix directory for the installed ISL package.
1757 Equivalent to --with-isl-include=PATH/include
1758 plus --with-isl-lib=PATH/lib])])
1759
429cca51 1760# Treat --without-isl as a request to disable
83d54ac4 1761# GRAPHITE support and skip all following checks.
429cca51 1762if test "x$with_isl" != "xno"; then
83d54ac4 1763 # Check for ISL
1764 dnl Provide configure switches and initialize islinc & isllibs
1765 dnl with user input.
1766 ISL_INIT_FLAGS
b5e1d8ce 1767 dnl The versions of ISL that work for Graphite
b6de67fd 1768 ISL_CHECK_VERSION()
87e20041 1769 dnl Only execute fail-action, if ISL has been requested.
1770 ISL_IF_FAILED([
1771 AC_MSG_ERROR([Unable to find a usable ISL. See config.log for details.])])
255b6be7 1772fi
255b6be7 1773
572cf1f7 1774# If the ISL check failed, disable builds of in-tree variant of ISL
83d54ac4 1775if test "x$with_isl" = xno ||
83d54ac4 1776 test "x$gcc_cv_isl" = xno; then
572cf1f7 1777 noconfigdirs="$noconfigdirs isl"
83d54ac4 1778 islinc=
429cca51 1779fi
1780
1781AC_SUBST(isllibs)
83d54ac4 1782AC_SUBST(islinc)
83d54ac4 1783
7bfefa9d 1784# Check for LTO support.
1785AC_ARG_ENABLE(lto,
8747a938 1786[AS_HELP_STRING([--enable-lto], [enable link time optimization support])],
7bfefa9d 1787enable_lto=$enableval,
1788enable_lto=yes; default_enable_lto=yes)
1789
25630dc7 1790ACX_ELF_TARGET_IFELSE([# ELF platforms build the lto-plugin always.
1791 build_lto_plugin=yes
1792],[if test x"$default_enable_lto" = x"yes" ; then
4ae8c98f 1793 case $target in
b990d06f 1794 *-apple-darwin9* | *-cygwin* | *-mingw*) ;;
25630dc7 1795 # On other non-ELF platforms, LTO has yet to be validated.
4ae8c98f 1796 *) enable_lto=no ;;
1797 esac
4d992eb6 1798 else
62932e4d 1799 # Apart from ELF platforms, only Windows and Darwin support LTO so far.
1800 # It would also be nice to check the binutils support, but we don't
4d992eb6 1801 # have gcc_GAS_CHECK_FEATURE available here. For now, we'll just
1802 # warn during gcc/ subconfigure; unless you're bootstrapping with
1803 # -flto it won't be needed until after installation anyway.
1804 case $target in
ca42e774 1805 *-cygwin* | *-mingw* | *-apple-darwin*) ;;
4d992eb6 1806 *) if test x"$enable_lto" = x"yes"; then
1807 AC_MSG_ERROR([LTO support is not enabled for this target.])
1808 fi
1809 ;;
1810 esac
1811 fi
ca42e774 1812 # Among non-ELF, only Windows platforms support the lto-plugin so far.
25630dc7 1813 # Build it unless LTO was explicitly disabled.
ca42e774 1814 case $target in
25630dc7 1815 *-cygwin* | *-mingw*) build_lto_plugin=$enable_lto ;;
ca42e774 1816 *) ;;
1817 esac
25630dc7 1818])
7bfefa9d 1819
1015a063 1820AC_ARG_ENABLE(linker-plugin-configure-flags,
1821 [AS_HELP_STRING([[--enable-linker-plugin-configure-flags=FLAGS]],
1822 [additional flags for configuring linker plugins @<:@none@:>@])],
1823 extra_linker_plugin_configure_flags=$enableval,
1824 extra_linker_plugin_configure_flags=)
1825AC_SUBST(extra_linker_plugin_configure_flags)
1826AC_ARG_ENABLE(linker-plugin-flags,
1827 [AS_HELP_STRING([[--enable-linker-plugin-flags=FLAGS]],
1828 [additional flags for configuring and building linker plugins @<:@none@:>@])],
1829 extra_linker_plugin_flags=$enableval,
1830 extra_linker_plugin_flags=)
1831AC_SUBST(extra_linker_plugin_flags)
1832
255b6be7 1833
2b15d2ba 1834# By default, C and C++ are the only stage 1 languages.
9c3a0a29 1835stage1_languages=,c,
2d64c2fd 1836
7ab76cec 1837# Target libraries that we bootstrap.
5c96a839 1838bootstrap_target_libs=,target-libgcc,
7ab76cec 1839
c24c5e46 1840# Figure out what language subdirectories are present.
1841# Look if the user specified --enable-languages="..."; if not, use
1842# the environment variable $LANGUAGES if defined. $LANGUAGES might
1843# go away some day.
1844# NB: embedded tabs in this IF block -- do not untabify
1845if test -d ${srcdir}/gcc; then
1846 if test x"${enable_languages+set}" != xset; then
1847 if test x"${LANGUAGES+set}" = xset; then
1848 enable_languages="${LANGUAGES}"
1849 echo configure.in: warning: setting LANGUAGES is deprecated, use --enable-languages instead 1>&2
1850 else
1851 enable_languages=all
1852 fi
1853 else
1854 if test x"${enable_languages}" = x ||
1855 test x"${enable_languages}" = xyes;
1856 then
1857 echo configure.in: --enable-languages needs at least one language argument 1>&2
1858 exit 1
1859 fi
1860 fi
1861 enable_languages=`echo "${enable_languages}" | sed -e 's/[[ ,]][[ ,]]*/,/g' -e 's/,$//'`
1862
2c718da0 1863 # 'f95' is the old name for the 'fortran' language. We issue a warning
1864 # and make the substitution.
1865 case ,${enable_languages}, in
1866 *,f95,*)
1867 echo configure.in: warning: 'f95' as language name is deprecated, use 'fortran' instead 1>&2
1868 enable_languages=`echo "${enable_languages}" | sed -e 's/f95/fortran/g'`
1869 ;;
1870 esac
1871
2b15d2ba 1872 # If bootstrapping, C++ must be enabled.
1873 case ",$enable_languages,:$enable_bootstrap" in
1874 *,c++,*:*) ;;
1875 *:yes)
6c59dfa4 1876 if test -f ${srcdir}/gcc/cp/config-lang.in; then
1877 enable_languages="${enable_languages},c++"
1878 else
2b15d2ba 1879 AC_MSG_ERROR([bootstrapping requires c++ sources])
6c59dfa4 1880 fi
1881 ;;
1882 esac
1883
c24c5e46 1884 # First scan to see if an enabled language requires some other language.
1885 # We assume that a given config-lang.in will list all the language
1886 # front ends it requires, even if some are required indirectly.
1887 for lang_frag in ${srcdir}/gcc/*/config-lang.in .. ; do
1888 case ${lang_frag} in
1889 ..) ;;
1890 # The odd quoting in the next line works around
1891 # an apparent bug in bash 1.12 on linux.
1892 ${srcdir}/gcc/[[*]]/config-lang.in) ;;
1893 *)
101ddbe4 1894 # From the config-lang.in, get $language, $lang_requires, and
1895 # $lang_requires_boot_languages.
c24c5e46 1896 language=
1897 lang_requires=
101ddbe4 1898 lang_requires_boot_languages=
c24c5e46 1899 . ${lang_frag}
101ddbe4 1900 for other in ${lang_requires} ${lang_requires_boot_languages}; do
c24c5e46 1901 case ,${enable_languages}, in
1902 *,$other,*) ;;
1903 *,all,*) ;;
1904 *,$language,*)
1905 echo " \`$other' language required by \`$language'; enabling" 1>&2
1906 enable_languages="${enable_languages},${other}"
1907 ;;
1908 esac
1909 done
101ddbe4 1910 for other in ${lang_requires_boot_languages} ; do
1911 if test "$other" != "c"; then
1912 case ,${enable_stage1_languages}, in
1913 *,$other,*) ;;
1914 *,all,*) ;;
1915 *)
1916 case ,${enable_languages}, in
1917 *,$language,*)
1918 echo " '$other' language required by '$language' in stage 1; enabling" 1>&2
1919 enable_stage1_languages="$enable_stage1_languages,${other}"
1920 ;;
1921 esac
1922 ;;
1923 esac
1924 fi
1925 done
c24c5e46 1926 ;;
1927 esac
1928 done
1929
9c3a0a29 1930 new_enable_languages=,c,
7bfefa9d 1931
1932 # If LTO is enabled, add the LTO front end.
7bfefa9d 1933 if test "$enable_lto" = "yes" ; then
d6ef094a 1934 case ,${enable_languages}, in
1935 *,lto,*) ;;
1936 *) enable_languages="${enable_languages},lto" ;;
1937 esac
ca42e774 1938 if test "${build_lto_plugin}" = "yes" ; then
7bfefa9d 1939 configdirs="$configdirs lto-plugin"
7bfefa9d 1940 fi
1941 fi
7bfefa9d 1942
dd87c525 1943 # If we're building an offloading compiler, add the LTO front end.
1944 if test x"$enable_as_accelerator_for" != x ; then
1945 case ,${enable_languages}, in
1946 *,lto,*) ;;
1947 *) enable_languages="${enable_languages},lto" ;;
1948 esac
1949 fi
1950
c24c5e46 1951 missing_languages=`echo ",$enable_languages," | sed -e s/,all,/,/ -e s/,c,/,/ `
9c3a0a29 1952 potential_languages=,c,
c24c5e46 1953
604a285a 1954 enabled_target_libs=
1955 disabled_target_libs=
1956
c24c5e46 1957 for lang_frag in ${srcdir}/gcc/*/config-lang.in .. ; do
1958 case ${lang_frag} in
1959 ..) ;;
1960 # The odd quoting in the next line works around
1961 # an apparent bug in bash 1.12 on linux.
1962 ${srcdir}/gcc/[[*]]/config-lang.in) ;;
1963 *)
1964 # From the config-lang.in, get $language, $target_libs,
2d64c2fd 1965 # $lang_dirs, $boot_language, and $build_by_default
c24c5e46 1966 language=
1967 target_libs=
1968 lang_dirs=
5dee13c2 1969 subdir_requires=
9c3a0a29 1970 boot_language=no
1971 build_by_default=yes
c24c5e46 1972 . ${lang_frag}
9c3a0a29 1973 if test x${language} = x; then
1974 echo "${lang_frag} doesn't set \$language." 1>&2
1975 exit 1
1976 fi
1977
ef3c41c7 1978 if test "$language" = "c++"; then
2b15d2ba 1979 boot_language=yes
7ab76cec 1980 fi
1981
a2ecd49c 1982 add_this_lang=no
9c3a0a29 1983 case ,${enable_languages}, in
1984 *,${language},*)
e53d55e7 1985 # Language was explicitly selected; include it
1986 # unless it is C, which is enabled by default.
1987 if test "$language" != "c"; then
1988 add_this_lang=yes
1989 fi
c24c5e46 1990 ;;
9c3a0a29 1991 *,all,*)
1992 # 'all' was selected, select it if it is a default language
a2ecd49c 1993 if test "$language" != "c"; then
1994 add_this_lang=${build_by_default}
1995 fi
c24c5e46 1996 ;;
1997 esac
4ee9c684 1998
5dee13c2 1999 # Disable languages that need other directories if these aren't available.
9333ae0b 2000 for i in $subdir_requires; do
3891e7d9 2001 test -f "$srcdir/gcc/$i/config-lang.in" && continue
5dee13c2 2002 case ,${enable_languages}, in
2003 *,${language},*)
2004 # Specifically requested language; tell them.
2005 AC_MSG_ERROR([The gcc/$i directory contains parts of $language but is missing])
2006 ;;
2007 *)
2008 # Silently disable.
9c3a0a29 2009 add_this_lang=unsupported
5dee13c2 2010 ;;
2011 esac
2012 done
2013
9c3a0a29 2014 # Disable Ada if no preexisting GNAT is available.
2015 case ,${enable_languages},:${language}:${have_gnat} in
2016 *,${language},*:ada:no)
2017 # Specifically requested language; tell them.
2018 AC_MSG_ERROR([GNAT is required to build $language])
2019 ;;
2020 *:ada:no)
2021 # Silently disable.
2022 add_this_lang=unsupported
2023 ;;
2024 esac
2025
ff7dcf6a 2026 # Disable a language that is unsupported by the target.
2027 case " $unsupported_languages " in
2028 *" $language "*)
9c3a0a29 2029 add_this_lang=unsupported
ff7dcf6a 2030 ;;
2031 esac
2032
4ee9c684 2033 case $add_this_lang in
9c3a0a29 2034 unsupported)
c24c5e46 2035 # Remove language-dependent dirs.
604a285a 2036 disabled_target_libs="$disabled_target_libs $target_libs"
2037 noconfigdirs="$noconfigdirs $lang_dirs"
2d64c2fd 2038 ;;
9c3a0a29 2039 no)
2040 # Remove language-dependent dirs; still show language as supported.
604a285a 2041 disabled_target_libs="$disabled_target_libs $target_libs"
2042 noconfigdirs="$noconfigdirs $lang_dirs"
9c3a0a29 2043 potential_languages="${potential_languages}${language},"
2044 ;;
2045 yes)
2046 new_enable_languages="${new_enable_languages}${language},"
2047 potential_languages="${potential_languages}${language},"
2d64c2fd 2048 missing_languages=`echo "$missing_languages" | sed "s/,$language,/,/"`
604a285a 2049 enabled_target_libs="$enabled_target_libs $target_libs"
32027446 2050 case "${boot_language}:,$enable_stage1_languages," in
2051 yes:* | *:*,$language,* | *:*,yes, | *:*,all,)
aff6cf7b 2052 # Add to (comma-separated) list of stage 1 languages.
32027446 2053 case ",$stage1_languages," in
2054 *,$language,* | ,yes, | ,all,) ;;
2055 *) stage1_languages="${stage1_languages}${language}," ;;
2056 esac
7ab76cec 2057 # We need to bootstrap any supporting libraries.
2058 bootstrap_target_libs="${bootstrap_target_libs}${target_libs},"
2d64c2fd 2059 ;;
2060 esac
2061 ;;
c24c5e46 2062 esac
2063 ;;
2064 esac
2065 done
2066
604a285a 2067 # Add target libraries which are only needed for disabled languages
2068 # to noconfigdirs.
2069 if test -n "$disabled_target_libs"; then
2070 for dir in $disabled_target_libs; do
2071 case " $enabled_target_libs " in
2072 *" ${dir} "*) ;;
2073 *) noconfigdirs="$noconfigdirs $dir" ;;
2074 esac
2075 done
2076 fi
2077
9c3a0a29 2078 AC_ARG_ENABLE(stage1-languages,
8747a938 2079 [AS_HELP_STRING([[--enable-stage1-languages[=all]]],
2080 [choose additional languages to build during
2081 stage1. Mostly useful for compiler development])],
9c3a0a29 2082 [case ,${enable_stage1_languages}, in
2083 ,no,|,,)
2084 # Set it to something that will have no effect in the loop below
2085 enable_stage1_languages=c ;;
2086 ,yes,)
2087 enable_stage1_languages=`echo $new_enable_languages | \
2088 sed -e "s/^,//" -e "s/,$//" ` ;;
2089 *,all,*)
2090 enable_stage1_languages=`echo ,$enable_stage1_languages, | \
2091 sed -e "s/,all,/$new_enable_languages/" -e "s/^,//" -e "s/,$//" ` ;;
2092 esac
2093
2094 # Add "good" languages from enable_stage1_languages to stage1_languages,
2095 # while "bad" languages go in missing_languages. Leave no duplicates.
2096 for i in `echo $enable_stage1_languages | sed 's/,/ /g' `; do
2097 case $potential_languages in
2098 *,$i,*)
2099 case $stage1_languages in
2100 *,$i,*) ;;
2101 *) stage1_languages="$stage1_languages$i," ;;
2102 esac ;;
2103 *)
2104 case $missing_languages in
2105 *,$i,*) ;;
2106 *) missing_languages="$missing_languages$i," ;;
2107 esac ;;
2108 esac
2109 done])
2110
2111 # Remove leading/trailing commas that were added for simplicity
2112 potential_languages=`echo "$potential_languages" | sed -e "s/^,//" -e "s/,$//"`
989edd2f 2113 missing_languages=`echo "$missing_languages" | sed -e "s/^,//" -e "s/,$//"`
9c3a0a29 2114 stage1_languages=`echo "$stage1_languages" | sed -e "s/^,//" -e "s/,$//"`
2115 new_enable_languages=`echo "$new_enable_languages" | sed -e "s/^,//" -e "s/,$//"`
2116
c24c5e46 2117 if test "x$missing_languages" != x; then
2118 AC_MSG_ERROR([
e8bfe1fa 2119The following requested languages could not be built: ${missing_languages}
9c3a0a29 2120Supported languages are: ${potential_languages}])
c24c5e46 2121 fi
c24c5e46 2122 if test "x$new_enable_languages" != "x$enable_languages"; then
2123 echo The following languages will be built: ${new_enable_languages}
9c3a0a29 2124 enable_languages="$new_enable_languages"
c24c5e46 2125 fi
9c3a0a29 2126
2127 AC_SUBST(stage1_languages)
b0e9b581 2128 ac_configure_args=`echo " $ac_configure_args" | sed -e "s/ '--enable-languages=[[^ ]]*'//g" -e "s/$/ '--enable-languages="$enable_languages"'/" `
c24c5e46 2129fi
2130
50996fe5 2131# Handle --disable-<component> generically.
2132for dir in $configdirs $build_configdirs $target_configdirs ; do
2133 dirname=`echo $dir | sed -e s/target-//g -e s/build-//g -e s/-/_/g`
d2d2630b 2134 varname=`echo $dirname | sed -e s/+/_/g`
2135 if eval test x\${enable_${varname}} "=" xno ; then
50996fe5 2136 noconfigdirs="$noconfigdirs $dir"
2137 fi
2138done
2139
dd6d3a67 2140# Check for Boehm's garbage collector
2141AC_ARG_ENABLE(objc-gc,
8747a938 2142[AS_HELP_STRING([--enable-objc-gc],
2143 [enable use of Boehm's garbage collector with the
2144 GNU Objective-C runtime])],
dd6d3a67 2145[case ,${enable_languages},:${enable_objc_gc}:${noconfigdirs} in
2146 *,objc,*:*:yes:*target-boehm-gc*)
2147 AC_MSG_ERROR([Boehm's garbage collector was requested yet not supported in this configuration])
2148 ;;
2149esac])
2150
2151# Make sure we only build Boehm's garbage collector if required.
f1716c67 2152case ,${enable_languages},:${enable_objc_gc} in
2153 *,objc,*:yes)
dd6d3a67 2154 # Keep target-boehm-gc if requested for Objective-C.
2155 ;;
dd6d3a67 2156 *)
f1716c67 2157 # Otherwise remove target-boehm-gc depending on target-libjava.
2158 if echo " ${noconfigdirs} " | grep "target-libjava" >/dev/null 2>&1; then
2159 noconfigdirs="$noconfigdirs target-boehm-gc"
2160 fi
dd6d3a67 2161 ;;
2162esac
b33ca042 2163
d3a7dd32 2164# Disable libcilkrts, libitm, libsanitizer, libvtv, liboffloadmic if we're not building C++
b33ca042 2165case ,${enable_languages}, in
df148e44 2166 *,c++,*)
2167 # Disable libcilkrts, libitm, libsanitizer if we're not building libstdc++
2168 case "${noconfigdirs}" in
2169 *target-libstdc++-v3*)
2170 noconfigdirs="$noconfigdirs target-libcilkrts target-libitm target-libsanitizer"
2171 ;;
2172 *) ;;
2173 esac
2174 ;;
b33ca042 2175 *)
d3a7dd32 2176 noconfigdirs="$noconfigdirs target-libcilkrts target-liboffloadmic target-libitm target-libsanitizer target-libvtv"
b33ca042 2177 ;;
2178esac
dd6d3a67 2179
6675f2d9 2180# Remove the entries in $skipdirs and $noconfigdirs from $configdirs,
2181# $build_configdirs and $target_configdirs.
c24c5e46 2182# If we have the source for $noconfigdirs entries, add them to $notsupp.
2183
2184notsupp=""
2185for dir in . $skipdirs $noconfigdirs ; do
6675f2d9 2186 dirname=`echo $dir | sed -e s/target-//g -e s/build-//g`
c24c5e46 2187 if test $dir != . && echo " ${configdirs} " | grep " ${dir} " >/dev/null 2>&1; then
2188 configdirs=`echo " ${configdirs} " | sed -e "s/ ${dir} / /"`
2189 if test -r $srcdir/$dirname/configure ; then
2190 if echo " ${skipdirs} " | grep " ${dir} " >/dev/null 2>&1; then
2191 true
2192 else
2193 notsupp="$notsupp $dir"
2194 fi
2195 fi
2196 fi
6675f2d9 2197 if test $dir != . && echo " ${build_configdirs} " | grep " ${dir} " >/dev/null 2>&1; then
2198 build_configdirs=`echo " ${build_configdirs} " | sed -e "s/ ${dir} / /"`
2199 if test -r $srcdir/$dirname/configure ; then
2200 if echo " ${skipdirs} " | grep " ${dir} " >/dev/null 2>&1; then
2201 true
2202 else
2203 notsupp="$notsupp $dir"
2204 fi
2205 fi
2206 fi
c24c5e46 2207 if test $dir != . && echo " ${target_configdirs} " | grep " ${dir} " >/dev/null 2>&1; then
2208 target_configdirs=`echo " ${target_configdirs} " | sed -e "s/ ${dir} / /"`
2209 if test -r $srcdir/$dirname/configure ; then
2210 if echo " ${skipdirs} " | grep " ${dir} " >/dev/null 2>&1; then
2211 true
2212 else
2213 notsupp="$notsupp $dir"
2214 fi
2215 fi
2216 fi
2217done
2218
c24c5e46 2219# Quietly strip out all directories which aren't configurable in this tree.
2220# This relies on all configurable subdirectories being autoconfiscated, which
2221# is now the case.
2f8725b0 2222build_configdirs_all="$build_configdirs"
2223build_configdirs=
2224for i in ${build_configdirs_all} ; do
2225 j=`echo $i | sed -e s/build-//g`
2226 if test -f ${srcdir}/$j/configure ; then
2227 build_configdirs="${build_configdirs} $i"
2228 fi
2229done
2230
c24c5e46 2231configdirs_all="$configdirs"
2232configdirs=
2233for i in ${configdirs_all} ; do
2234 if test -f ${srcdir}/$i/configure ; then
2235 configdirs="${configdirs} $i"
2236 fi
2237done
2f8725b0 2238
c24c5e46 2239target_configdirs_all="$target_configdirs"
2240target_configdirs=
2241for i in ${target_configdirs_all} ; do
2242 j=`echo $i | sed -e s/target-//g`
2243 if test -f ${srcdir}/$j/configure ; then
2244 target_configdirs="${target_configdirs} $i"
2245 fi
2246done
2247
1015a063 2248# libiberty-linker-plugin is special: it doesn't have its own source directory,
2249# so we have to add it after the preceding checks.
2250if test x"$extra_linker_plugin_flags$extra_linker_plugin_configure_flags" != x
2251then
2252 case " $configdirs " in
2253 *" libiberty "*)
2254 # If we can build libiberty, we can also build libiberty-linker-plugin.
2255 configdirs="$configdirs libiberty-linker-plugin"
2256 extra_linker_plugin_configure_flags="$extra_linker_plugin_configure_flags \
2257 --with-libiberty=../libiberty-linker-plugin";;
2258 *)
2259 AC_MSG_ERROR([libiberty missing]);;
2260 esac
2261fi
2262
944792ef 2263# Sometimes we have special requirements for the host libiberty.
2264extra_host_libiberty_configure_flags=
2265case " $configdirs " in
2266 *" lto-plugin "* | *" libcc1 "*)
2267 # When these are to be built as shared libraries, the same applies to
2268 # libiberty.
2269 extra_host_libiberty_configure_flags=--enable-shared
2270 ;;
2271esac
2272AC_SUBST(extra_host_libiberty_configure_flags)
2273
c24c5e46 2274# Produce a warning message for the subdirs we can't configure.
2275# This isn't especially interesting in the Cygnus tree, but in the individual
2276# FSF releases, it's important to let people know when their machine isn't
2277# supported by the one or two programs in a package.
2278
2279if test -n "${notsupp}" && test -z "${norecursion}" ; then
2280 # If $appdirs is non-empty, at least one of those directories must still
2281 # be configured, or we error out. (E.g., if the gas release supports a
2282 # specified target in some subdirs but not the gas subdir, we shouldn't
2283 # pretend that all is well.)
2284 if test -n "$appdirs" ; then
2285 for dir in $appdirs ; do
2286 if test -r $dir/Makefile.in ; then
2287 if echo " ${configdirs} " | grep " ${dir} " >/dev/null 2>&1; then
2288 appdirs=""
2289 break
2290 fi
2f8725b0 2291 if echo " ${target_configdirs} " | grep " target-${dir} " >/dev/null 2>&1; then
c24c5e46 2292 appdirs=""
2293 break
2294 fi
2295 fi
2296 done
2297 if test -n "$appdirs" ; then
2298 echo "*** This configuration is not supported by this package." 1>&2
2299 exit 1
2300 fi
2301 fi
2302 # Okay, some application will build, or we don't care to check. Still
2303 # notify of subdirs not getting built.
2304 echo "*** This configuration is not supported in the following subdirectories:" 1>&2
2305 echo " ${notsupp}" 1>&2
2306 echo " (Any other directories should still work fine.)" 1>&2
2307fi
2308
2309case "$host" in
2310 *msdosdjgpp*)
2311 enable_gdbtk=no ;;
2312esac
2313
eae5b2bc 2314# To find our prefix, in gcc_cv_tool_prefix.
2315ACX_TOOL_DIRS
2316
c24c5e46 2317copy_dirs=
2318
ffa8502d 2319AC_ARG_WITH([build-sysroot],
8747a938 2320 [AS_HELP_STRING([--with-build-sysroot=SYSROOT],
2321 [use sysroot as the system root during the build])],
ffa8502d 2322 [if test x"$withval" != x ; then
2323 SYSROOT_CFLAGS_FOR_TARGET="--sysroot=$withval"
2324 fi],
2325 [SYSROOT_CFLAGS_FOR_TARGET=])
2326AC_SUBST(SYSROOT_CFLAGS_FOR_TARGET)
2327
5f1f2de5 2328AC_ARG_WITH([debug-prefix-map],
8747a938 2329 [AS_HELP_STRING([--with-debug-prefix-map='A=B C=D ...'],
2330 [map A to B, C to D ... in debug information])],
5f1f2de5 2331 [if test x"$withval" != x; then
2332 DEBUG_PREFIX_CFLAGS_FOR_TARGET=
2333 for debug_map in $withval; do
2334 DEBUG_PREFIX_CFLAGS_FOR_TARGET="$DEBUG_PREFIX_CFLAGS_FOR_TARGET -fdebug-prefix-map=$debug_map"
2335 done
2336 fi],
2337 [DEBUG_PREFIX_CFLAGS_FOR_TARGET=])
2338AC_SUBST(DEBUG_PREFIX_CFLAGS_FOR_TARGET)
2339
c898f165 2340# During gcc bootstrap, if we use some random cc for stage1 then CFLAGS
2341# might be empty or "-g". We don't require a C++ compiler, so CXXFLAGS
2342# might also be empty (or "-g", if a non-GCC C++ compiler is in the path).
2343# We want to ensure that TARGET libraries (which we know are built with
2344# gcc) are built with "-O2 -g", so include those options when setting
2345# CFLAGS_FOR_TARGET and CXXFLAGS_FOR_TARGET.
2346if test "x$CFLAGS_FOR_TARGET" = x; then
f5fad380 2347 if test "x${is_cross_compiler}" = xyes; then
2348 CFLAGS_FOR_TARGET="-g -O2"
2349 else
2350 CFLAGS_FOR_TARGET=$CFLAGS
2351 case " $CFLAGS " in
2352 *" -O2 "*) ;;
2353 *) CFLAGS_FOR_TARGET="-O2 $CFLAGS_FOR_TARGET" ;;
2354 esac
2355 case " $CFLAGS " in
2356 *" -g "* | *" -g3 "*) ;;
2357 *) CFLAGS_FOR_TARGET="-g $CFLAGS_FOR_TARGET" ;;
2358 esac
2359 fi
c898f165 2360fi
2361AC_SUBST(CFLAGS_FOR_TARGET)
2362
2363if test "x$CXXFLAGS_FOR_TARGET" = x; then
f5fad380 2364 if test "x${is_cross_compiler}" = xyes; then
2365 CXXFLAGS_FOR_TARGET="-g -O2"
2366 else
2367 CXXFLAGS_FOR_TARGET=$CXXFLAGS
2368 case " $CXXFLAGS " in
2369 *" -O2 "*) ;;
2370 *) CXXFLAGS_FOR_TARGET="-O2 $CXXFLAGS_FOR_TARGET" ;;
2371 esac
2372 case " $CXXFLAGS " in
2373 *" -g "* | *" -g3 "*) ;;
2374 *) CXXFLAGS_FOR_TARGET="-g $CXXFLAGS_FOR_TARGET" ;;
2375 esac
2376 fi
c898f165 2377fi
2378AC_SUBST(CXXFLAGS_FOR_TARGET)
2379
ed9516f5 2380AC_SUBST(LDFLAGS_FOR_TARGET)
2381
c24c5e46 2382# Handle --with-headers=XXX. If the value is not "yes", the contents of
2383# the named directory are copied to $(tooldir)/sys-include.
2384if test x"${with_headers}" != x && test x"${with_headers}" != xno ; then
2385 if test x${is_cross_compiler} = xno ; then
2386 echo 1>&2 '***' --with-headers is only supported when cross compiling
2387 exit 1
2388 fi
2389 if test x"${with_headers}" != xyes ; then
eae5b2bc 2390 x=${gcc_cv_tool_prefix}
b30fcfae 2391 copy_dirs="${copy_dirs} ${with_headers} $x/${target_noncanonical}/sys-include"
c24c5e46 2392 fi
2393fi
2394
2395# Handle --with-libs=XXX. If the value is not "yes", the contents of
2396# the name directories are copied to $(tooldir)/lib. Multiple directories
2397# are permitted.
2398if test x"${with_libs}" != x && test x"${with_libs}" != xno ; then
2399 if test x${is_cross_compiler} = xno ; then
2400 echo 1>&2 '***' --with-libs is only supported when cross compiling
2401 exit 1
2402 fi
2403 if test x"${with_libs}" != xyes ; then
2404 # Copy the libraries in reverse order, so that files in the first named
2405 # library override files in subsequent libraries.
eae5b2bc 2406 x=${gcc_cv_tool_prefix}
c24c5e46 2407 for l in ${with_libs}; do
b30fcfae 2408 copy_dirs="$l $x/${target_noncanonical}/lib ${copy_dirs}"
c24c5e46 2409 done
2410 fi
2411fi
2412
7bfefa9d 2413# Set with_gnu_as, with_gnu_ld, and with_system_zlib as appropriate.
c47832b1 2414#
2415# This is done by determining whether or not the appropriate directory
2416# is available, and by checking whether or not specific configurations
2417# have requested that this magic not happen.
2418#
2419# The command line options always override the explicit settings in
2420# configure.in, and the settings in configure.in override this magic.
2421#
2422# If the default for a toolchain is to use GNU as and ld, and you don't
2423# want to do that, then you should use the --without-gnu-as and
7bfefa9d 2424# --without-gnu-ld options for the configure script. Similarly, if
2425# the default is to use the included zlib and you don't want to do that,
2426# you should use the --with-system-zlib option for the configure script.
c47832b1 2427
2428if test x${use_gnu_as} = x &&
2429 echo " ${configdirs} " | grep " gas " > /dev/null 2>&1 ; then
2430 with_gnu_as=yes
2431 extra_host_args="$extra_host_args --with-gnu-as"
2432fi
2433
2434if test x${use_gnu_ld} = x &&
3d47fcf5 2435 echo " ${configdirs} " | egrep " (go)?ld " > /dev/null 2>&1 ; then
c47832b1 2436 with_gnu_ld=yes
2437 extra_host_args="$extra_host_args --with-gnu-ld"
2438fi
2439
7bfefa9d 2440if test x${use_included_zlib} = x &&
2441 echo " ${configdirs} " | grep " zlib " > /dev/null 2>&1 ; then
2442 :
2443else
2444 with_system_zlib=yes
2445 extra_host_args="$extra_host_args --with-system-zlib"
2446fi
2447
c47832b1 2448# If using newlib, add --with-newlib to the extra_host_args so that gcc/configure
2449# can detect this case.
2450
2451if test x${with_newlib} != xno && echo " ${target_configdirs} " | grep " target-newlib " > /dev/null 2>&1 ; then
2452 with_newlib=yes
2453 extra_host_args="$extra_host_args --with-newlib"
2454fi
2455
c24c5e46 2456# Handle ${copy_dirs}
2457set fnord ${copy_dirs}
2458shift
2459while test $# != 0 ; do
2460 if test -f $2/COPIED && test x"`cat $2/COPIED`" = x"$1" ; then
2461 :
2462 else
2463 echo Copying $1 to $2
2464
2465 # Use the install script to create the directory and all required
2466 # parent directories.
2467 if test -d $2 ; then
2468 :
2469 else
2470 echo >config.temp
2471 ${srcdir}/install-sh -c -m 644 config.temp $2/COPIED
2472 fi
2473
2474 # Copy the directory, assuming we have tar.
2475 # FIXME: Should we use B in the second tar? Not all systems support it.
2476 (cd $1; tar -cf - .) | (cd $2; tar -xpf -)
2477
2478 # It is the responsibility of the user to correctly adjust all
2479 # symlinks. If somebody can figure out how to handle them correctly
2480 # here, feel free to add the code.
2481
2482 echo $1 > $2/COPIED
2483 fi
2484 shift; shift
2485done
2486
c47832b1 2487# Determine a target-dependent exec_prefix that the installed
2488# gcc will search in. Keep this list sorted by triplet, with
2489# the *-*-osname triplets last.
2490md_exec_prefix=
2491case "${target}" in
09c2d953 2492 i[[34567]]86-pc-msdosdjgpp*)
c47832b1 2493 md_exec_prefix=/dev/env/DJDIR/bin
2494 ;;
c47832b1 2495 *-*-hpux* | \
c47832b1 2496 *-*-nto-qnx* | \
93faf308 2497 *-*-solaris2*)
c47832b1 2498 md_exec_prefix=/usr/ccs/bin
2499 ;;
2500esac
2501
805e22b2 2502extra_arflags_for_target=
2503extra_nmflags_for_target=
b437616a 2504extra_ranlibflags_for_target=
71ab34df 2505target_makefile_frag=/dev/null
13b1b53a 2506case "${target}" in
57c7de11 2507 spu-*-*)
2508 target_makefile_frag="config/mt-spu"
2509 ;;
3e78a7ce 2510 mips*-sde-elf* | mips*-mti-elf* | mips*-img-elf*)
f8520ad7 2511 target_makefile_frag="config/mt-sde"
2512 ;;
3013c2c7 2513 mipsisa*-*-elfoabi*)
2514 target_makefile_frag="config/mt-mips-elfoabi"
2515 ;;
559b0712 2516 mips*-*-*linux* | mips*-*-gnu*)
2517 target_makefile_frag="config/mt-mips-gnu"
2518 ;;
2481a2c1 2519 nios2-*-elf*)
2520 target_makefile_frag="config/mt-nios2-elf"
2521 ;;
3bef4012 2522 *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu | *-*-kopensolaris*-gnu)
cb8a7007 2523 target_makefile_frag="config/mt-gnu"
13b1b53a 2524 ;;
71ab34df 2525 *-*-aix4.[[3456789]]* | *-*-aix[[56789]].*)
805e22b2 2526 # nm and ar from AIX 4.3 and above require -X32_64 flag to all ar and nm
2527 # commands to handle both 32-bit and 64-bit objects. These flags are
2528 # harmless if we're using GNU nm or ar.
2529 extra_arflags_for_target=" -X32_64"
2530 extra_nmflags_for_target=" -B -X32_64"
13b1b53a 2531 ;;
70af7570 2532esac
2533
71ab34df 2534alphaieee_frag=/dev/null
70af7570 2535case $target in
2536 alpha*-*-*)
2537 # This just makes sure to use the -mieee option to build target libs.
2538 # This should probably be set individually by each library.
2539 alphaieee_frag="config/mt-alphaieee"
13b1b53a 2540 ;;
2541esac
b138c834 2542
13b1b53a 2543# If --enable-target-optspace always use -Os instead of -O2 to build
2544# the target libraries, similarly if it is not specified, use -Os
2545# on selected platforms.
71ab34df 2546ospace_frag=/dev/null
13b1b53a 2547case "${enable_target_optspace}:${target}" in
2548 yes:*)
70af7570 2549 ospace_frag="config/mt-ospace"
13b1b53a 2550 ;;
2551 :d30v-*)
70af7570 2552 ospace_frag="config/mt-d30v"
13b1b53a 2553 ;;
2554 :m32r-* | :d10v-* | :fr30-*)
70af7570 2555 ospace_frag="config/mt-ospace"
13b1b53a 2556 ;;
2557 no:* | :*)
2558 ;;
2559 *)
2560 echo "*** bad value \"${enable_target_optspace}\" for --enable-target-optspace flag; ignored" 1>&2
2561 ;;
2562esac
28e9041c 2563
71ab34df 2564# Some systems (e.g., one of the i386-aix systems the gas testers are
2565# using) don't handle "\$" correctly, so don't use it here.
b30fcfae 2566tooldir='${exec_prefix}'/${target_noncanonical}
71ab34df 2567build_tooldir=${tooldir}
2568
71ab34df 2569# Create a .gdbinit file which runs the one in srcdir
2570# and tells GDB to look there for source files.
2571
2572if test -r ${srcdir}/.gdbinit ; then
2573 case ${srcdir} in
2574 .) ;;
2575 *) cat > ./.gdbinit <<EOF
2576# ${NO_EDIT}
2577dir ${srcdir}
2578dir .
2579source ${srcdir}/.gdbinit
2580EOF
2581 ;;
2582 esac
2583fi
2584
28e9041c 2585# Make sure that the compiler is able to generate an executable. If it
2586# can't, we are probably in trouble. We don't care whether we can run the
2587# executable--we might be using a cross compiler--we only care whether it
2588# can be created. At this point the main configure script has set CC.
441f85dc 2589we_are_ok=no
28e9041c 2590echo "int main () { return 0; }" > conftest.c
2591${CC} -o conftest ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} conftest.c
441f85dc 2592if test $? = 0 ; then
2593 if test -s conftest || test -s conftest.exe ; then
2594 we_are_ok=yes
2595 fi
2596fi
2597case $we_are_ok in
2598 no)
2599 echo 1>&2 "*** The command '${CC} -o conftest ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} conftest.c' failed."
2600 echo 1>&2 "*** You must set the environment variable CC to a working compiler."
2601 rm -f conftest*
2602 exit 1
2603 ;;
2604esac
28e9041c 2605rm -f conftest*
2606
7d804f04 2607# Decide which environment variable is used to find dynamic libraries.
949b0daa 2608case "${host}" in
2609 *-*-hpux*) RPATH_ENVVAR=SHLIB_PATH ;;
b2240ff6 2610 *-*-darwin*) RPATH_ENVVAR=DYLD_LIBRARY_PATH ;;
7d804f04 2611 *-*-mingw* | *-*-cygwin ) RPATH_ENVVAR=PATH ;;
949b0daa 2612 *) RPATH_ENVVAR=LD_LIBRARY_PATH ;;
2613esac
949b0daa 2614
7d804f04 2615# On systems where the dynamic library environment variable is PATH,
2616# gcc/ will put dynamic libraries into a subdirectory to avoid adding
2617# built executables to PATH.
2618if test "$RPATH_ENVVAR" = PATH; then
2619 GCC_SHLIB_SUBDIR=/shlib
2620else
2621 GCC_SHLIB_SUBDIR=
2622fi
2623
ee055341 2624# Adjust the toplevel makefile according to whether bootstrap was selected.
2625case $enable_bootstrap in
2626 yes)
2627 bootstrap_suffix=bootstrap
2628 BUILD_CONFIG=bootstrap-debug
2629 ;;
2630 no)
2631 bootstrap_suffix=no-bootstrap
2632 BUILD_CONFIG=
2633 ;;
2634esac
2635
2636AC_MSG_CHECKING(for default BUILD_CONFIG)
2637
2638AC_ARG_WITH([build-config],
2639 [AS_HELP_STRING([--with-build-config='NAME NAME2...'],
2640 [use config/NAME.mk build configuration])],
2641 [case $with_build_config in
2642 yes) with_build_config= ;;
2643 no) with_build_config= BUILD_CONFIG= ;;
2644 esac])
2645
2646if test "x${with_build_config}" != x; then
2647 BUILD_CONFIG=$with_build_config
2648else
2649 case $BUILD_CONFIG in
2650 bootstrap-debug)
2651 if echo "int f (void) { return 0; }" > conftest.c &&
2652 ${CC} -c conftest.c &&
2653 mv conftest.o conftest.o.g0 &&
2654 ${CC} -c -g conftest.c &&
2655 mv conftest.o conftest.o.g &&
2656 ${srcdir}/contrib/compare-debug conftest.o.g0 conftest.o.g > /dev/null 2>&1; then
2657 :
2658 else
2659 BUILD_CONFIG=
2660 fi
2661 rm -f conftest.c conftest.o conftest.o.g0 conftest.o.g
2662 ;;
2663 esac
2664fi
2665AC_MSG_RESULT($BUILD_CONFIG)
2666AC_SUBST(BUILD_CONFIG)
2667
2668# Use same top-level configure hooks in libgcc/libstdc++/libvtv.
2669AC_MSG_CHECKING([for --enable-vtable-verify])
2670AC_ARG_ENABLE(vtable-verify,
2671[ --enable-vtable-verify Enable vtable verification feature ],
2672[case "$enableval" in
2673 yes) enable_vtable_verify=yes ;;
2674 no) enable_vtable_verify=no ;;
2675 *) enable_vtable_verify=no;;
2676 esac],
2677[enable_vtable_verify=no])
2678AC_MSG_RESULT($enable_vtable_verify)
2679
805e22b2 2680# Record target_configdirs and the configure arguments for target and
2681# build configuration in Makefile.
2682target_configdirs=`echo "${target_configdirs}" | sed -e 's/target-//g'`
2f8725b0 2683build_configdirs=`echo "${build_configdirs}" | sed -e 's/build-//g'`
f4ae1a00 2684bootstrap_fixincludes=no
805e22b2 2685
5c96a839 2686# If we are building libgomp, bootstrap it.
2687if echo " ${target_configdirs} " | grep " libgomp " > /dev/null 2>&1 ; then
2688 bootstrap_target_libs=${bootstrap_target_libs}target-libgomp,
2689fi
2690
ee055341 2691# If we are building libsanitizer and $BUILD_CONFIG contains bootstrap-asan
2692# or bootstrap-ubsan, bootstrap it.
2693if echo " ${target_configdirs} " | grep " libsanitizer " > /dev/null 2>&1; then
2694 case "$BUILD_CONFIG" in
2695 *bootstrap-asan* | *bootstrap-ubsan* )
2696 bootstrap_target_libs=${bootstrap_target_libs}target-libsanitizer,
f4ae1a00 2697 bootstrap_fixincludes=yes
ee055341 2698 ;;
2699 esac
579abfee 2700fi
2701
ee055341 2702# If we are building libvtv and --enable-vtable-verify, bootstrap it.
2703if echo " ${target_configdirs} " | grep " libvtv " > /dev/null 2>&1 &&
2704 test "$enable_vtable_verify" != no; then
b710ec85 2705 bootstrap_target_libs=${bootstrap_target_libs}target-libvtv,
2706fi
2707
202baac8 2708# If we are building libmpx, bootstrap it.
2709if echo " ${target_configdirs} " | grep " libmpx " > /dev/null 2>&1; then
2710 bootstrap_target_libs=${bootstrap_target_libs}target-libmpx,
2711fi
2712
805e22b2 2713# Determine whether gdb needs tk/tcl or not.
2714# Use 'maybe' since enable_gdbtk might be true even if tk isn't available
2715# and in that case we want gdb to be built without tk. Ugh!
2716# In fact I believe gdb is the *only* package directly dependent on tk,
2717# so we should be able to put the 'maybe's in unconditionally and
2718# leave out the maybe dependencies when enable_gdbtk is false. I'm not
2719# 100% sure that that's safe though.
8fdaf281 2720
f843f075 2721gdb_tk="maybe-all-tcl maybe-all-tk maybe-all-itcl maybe-all-libgui"
805e22b2 2722case "$enable_gdbtk" in
2723 no)
2724 GDB_TK="" ;;
8fdaf281 2725 yes)
2726 GDB_TK="${gdb_tk}" ;;
805e22b2 2727 *)
8fdaf281 2728 # Only add the dependency on gdbtk when GDBtk is part of the gdb
2729 # distro. Eventually someone will fix this and move Insight, nee
2730 # gdbtk to a separate directory.
2731 if test -d ${srcdir}/gdb/gdbtk ; then
2732 GDB_TK="${gdb_tk}"
2733 else
2734 GDB_TK=""
2735 fi
2736 ;;
805e22b2 2737esac
415470be 2738CONFIGURE_GDB_TK=`echo ${GDB_TK} | sed s/-all-/-configure-/g`
2739INSTALL_GDB_TK=`echo ${GDB_TK} | sed s/-all-/-install-/g`
805e22b2 2740
01b41571 2741# Strip out unwanted targets.
6f4f34a7 2742
2743# While at that, we remove Makefiles if we were started for recursive
2744# configuration, so that the top-level Makefile reconfigures them,
2745# like we used to do when configure itself was recursive.
6f4f34a7 2746
8bb79148 2747# Loop over modules. We used to use the "$extrasub" feature from Autoconf
2748# but now we're fixing up the Makefile ourselves with the additional
2749# commands passed to AC_CONFIG_FILES. Use separate variables
2750# extrasub-{build,host,target} not because there is any reason to split
2751# the substitutions up that way, but only to remain below the limit of
2752# 99 commands in a script, for HP-UX sed.
2753# Do not nest @if/@endif pairs, because configure will not warn you at all.
6f4f34a7 2754
7b5fee3e 2755case "$enable_bootstrap:$ENABLE_GOLD: $configdirs :,$stage1_languages," in
2756 yes:yes:*\ gold\ *:*,c++,*) ;;
2757 yes:yes:*\ gold\ *:*)
2758 AC_MSG_ERROR([in a combined tree, bootstrapping with --enable-gold requires c++ in stage1_languages])
2759 ;;
2760esac
2761
8bb79148 2762extrasub_build=
2f8725b0 2763for module in ${build_configdirs} ; do
6f4f34a7 2764 if test -z "${no_recursion}" \
2765 && test -f ${build_subdir}/${module}/Makefile; then
2766 echo 1>&2 "*** removing ${build_subdir}/${module}/Makefile to force reconfigure"
2767 rm -f ${build_subdir}/${module}/Makefile
2768 fi
8bb79148 2769 extrasub_build="$extrasub_build
01b41571 2770/^@if build-$module\$/d
93f93279 2771/^@endif build-$module\$/d
2772/^@if build-$module-$bootstrap_suffix\$/d
2773/^@endif build-$module-$bootstrap_suffix\$/d"
6f4f34a7 2774done
8bb79148 2775extrasub_host=
6f4f34a7 2776for module in ${configdirs} ; do
9c19a746 2777 if test -z "${no_recursion}"; then
35d84d10 2778 for file in stage*-${module}/Makefile prev-${module}/Makefile ${module}/Makefile; do
9c19a746 2779 if test -f ${file}; then
2780 echo 1>&2 "*** removing ${file} to force reconfigure"
2781 rm -f ${file}
2782 fi
2783 done
6f4f34a7 2784 fi
f4ae1a00 2785 case ${module},${bootstrap_fixincludes} in
2786 fixincludes,no) host_bootstrap_suffix=no-bootstrap ;;
2787 *) host_bootstrap_suffix=$bootstrap_suffix ;;
2788 esac
8bb79148 2789 extrasub_host="$extrasub_host
01b41571 2790/^@if $module\$/d
93f93279 2791/^@endif $module\$/d
f4ae1a00 2792/^@if $module-$host_bootstrap_suffix\$/d
2793/^@endif $module-$host_bootstrap_suffix\$/d"
6f4f34a7 2794done
8bb79148 2795extrasub_target=
6f4f34a7 2796for module in ${target_configdirs} ; do
2797 if test -z "${no_recursion}" \
2798 && test -f ${target_subdir}/${module}/Makefile; then
2799 echo 1>&2 "*** removing ${target_subdir}/${module}/Makefile to force reconfigure"
2800 rm -f ${target_subdir}/${module}/Makefile
2801 fi
7ab76cec 2802
2803 # We only bootstrap target libraries listed in bootstrap_target_libs.
2804 case $bootstrap_target_libs in
2805 *,target-$module,*) target_bootstrap_suffix=$bootstrap_suffix ;;
2806 *) target_bootstrap_suffix=no-bootstrap ;;
2807 esac
2808
8bb79148 2809 extrasub_target="$extrasub_target
01b41571 2810/^@if target-$module\$/d
93f93279 2811/^@endif target-$module\$/d
7ab76cec 2812/^@if target-$module-$target_bootstrap_suffix\$/d
2813/^@endif target-$module-$target_bootstrap_suffix\$/d"
805e22b2 2814done
54f0538b 2815
8bb79148 2816# Do the final fixup along with target modules.
2817extrasub_target="$extrasub_target
01b41571 2818/^@if /,/^@endif /d"
805e22b2 2819
2820# Create the serialization dependencies. This uses a temporary file.
2821
11d8013a 2822AC_ARG_ENABLE([serial-configure],
8747a938 2823[AS_HELP_STRING([[--enable-serial-[{host,target,build}-]configure]],
2824 [force sequential configuration of
2825 sub-packages for the host, target or build
2826 machine, or all sub-packages])])
622c1fa9 2827
2828case ${enable_serial_configure} in
2829 yes)
2830 enable_serial_build_configure=yes
2831 enable_serial_host_configure=yes
2832 enable_serial_target_configure=yes
2833 ;;
2834esac
11d8013a 2835
805e22b2 2836# These force 'configure's to be done one at a time, to avoid problems
2837# with contention over a shared config.cache.
2838rm -f serdep.tmp
11d8013a 2839echo '# serdep.tmp' > serdep.tmp
805e22b2 2840olditem=
622c1fa9 2841test "x${enable_serial_build_configure}" = xyes &&
805e22b2 2842for item in ${build_configdirs} ; do
2843 case ${olditem} in
2844 "") ;;
11d8013a 2845 *) echo "configure-build-${item}: configure-build-${olditem}" >> serdep.tmp ;;
805e22b2 2846 esac
2847 olditem=${item}
2848done
2849olditem=
622c1fa9 2850test "x${enable_serial_host_configure}" = xyes &&
805e22b2 2851for item in ${configdirs} ; do
2852 case ${olditem} in
2853 "") ;;
11d8013a 2854 *) echo "configure-${item}: configure-${olditem}" >> serdep.tmp ;;
805e22b2 2855 esac
2856 olditem=${item}
2857done
2858olditem=
622c1fa9 2859test "x${enable_serial_target_configure}" = xyes &&
805e22b2 2860for item in ${target_configdirs} ; do
2861 case ${olditem} in
2862 "") ;;
11d8013a 2863 *) echo "configure-target-${item}: configure-target-${olditem}" >> serdep.tmp ;;
805e22b2 2864 esac
2865 olditem=${item}
2866done
71ab34df 2867serialization_dependencies=serdep.tmp
2868AC_SUBST_FILE(serialization_dependencies)
949b0daa 2869
11d8013a 2870# Base args. Strip norecursion, cache-file, srcdir, host, build,
b30fcfae 2871# target, nonopt, and variable assignments. These are the ones we
412c2e81 2872# might not want to pass down to subconfigures. The exception being
2873# --cache-file=/dev/null, which is used to turn off the use of cache
2874# files altogether, and which should be passed on to subconfigures.
2875# Also strip program-prefix, program-suffix, and program-transform-name,
2876# so that we can pass down a consistent program-transform-name.
b30fcfae 2877baseargs=
0e4d1862 2878tbaseargs=
b30fcfae 2879keep_next=no
2880skip_next=no
2881eval "set -- $ac_configure_args"
4ff792a4 2882for ac_arg
2883do
b30fcfae 2884 if test X"$skip_next" = X"yes"; then
2885 skip_next=no
2886 continue
2887 fi
2888 if test X"$keep_next" = X"yes"; then
2889 case $ac_arg in
2890 *\'*)
2891 ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
2892 esac
2893 baseargs="$baseargs '$ac_arg'"
0e4d1862 2894 tbaseargs="$tbaseargs '$ac_arg'"
b30fcfae 2895 keep_next=no
2896 continue
2897 fi
2898
2899 # Handle separated arguments. Based on the logic generated by
2900 # autoconf 2.59.
2901 case $ac_arg in
2902 *=* | --config-cache | -C | -disable-* | --disable-* \
2903 | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
2904 | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
2905 | -with-* | --with-* | -without-* | --without-* | --x)
2906 separate_arg=no
2907 ;;
2908 -*)
2909 separate_arg=yes
2910 ;;
2911 *)
2912 separate_arg=no
2913 ;;
2914 esac
2915
0e4d1862 2916 skip_targ=no
2917 case $ac_arg in
2918changequote(,)
2919 --with-* | --without-*)
2920 libopt=`echo "$ac_arg" | sed -e 's,^--[^-_]*[-_],,' -e 's,=.*$,,'`
2921
2922 case $libopt in
2923 *[-_]include)
2924 lib=`echo "$libopt" | sed 's,[-_]include$,,'`
2925 ;;
2926 *[-_]lib)
2927 lib=`echo "$libopt" | sed 's,[-_]lib$,,'`
2928 ;;
2929 *)
2930 lib=$libopt
2931 ;;
2932 esac
2933changequote([,])
2934
2935 case $lib in
572cf1f7 2936 mpc | mpfr | gmp | isl)
0e4d1862 2937 # If we're processing --with-$lib, --with-$lib-include or
2938 # --with-$lib-lib, for one of the libs above, and target is
2939 # different from host, don't pass the current argument to any
2940 # target library's configure.
2941 if test x$is_cross_compiler = xyes; then
2942 skip_targ=yes
2943 fi
2944 ;;
2945 esac
2946 ;;
2947 esac
2948
b30fcfae 2949 case "$ac_arg" in
412c2e81 2950 --cache-file=/dev/null | \
2951 -cache-file=/dev/null )
2952 # Handled here to avoid the test to skip args below.
2953 baseargs="$baseargs '$ac_arg'"
0e4d1862 2954 tbaseargs="$tbaseargs '$ac_arg'"
412c2e81 2955 # Assert: $separate_arg should always be no.
2956 keep_next=$separate_arg
2957 ;;
b30fcfae 2958 --no*)
2959 continue
2960 ;;
2961 --c* | \
2962 --sr* | \
2963 --ho* | \
2964 --bu* | \
2965 --t* | \
2966 --program-* | \
2967 -cache_file* | \
2968 -srcdir* | \
2969 -host* | \
2970 -build* | \
2971 -target* | \
2972 -program-prefix* | \
2973 -program-suffix* | \
2974 -program-transform-name* )
2975 skip_next=$separate_arg
2976 continue
2977 ;;
2978 -*)
2979 # An option. Add it.
2980 case $ac_arg in
2981 *\'*)
2982 ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
2983 esac
2984 baseargs="$baseargs '$ac_arg'"
0e4d1862 2985 if test X"$skip_targ" = Xno; then
2986 tbaseargs="$tbaseargs '$ac_arg'"
2987 fi
b30fcfae 2988 keep_next=$separate_arg
2989 ;;
2990 *)
2991 # Either a variable assignment, or a nonopt (triplet). Don't
2992 # pass it down; let the Makefile handle this.
2993 continue
2994 ;;
2995 esac
2996done
2997# Remove the initial space we just introduced and, as these will be
2998# expanded by make, quote '$'.
2999baseargs=`echo "x$baseargs" | sed -e 's/^x *//' -e 's,\\$,$$,g'`
28e9041c 3000
fbfea1fa 3001# Add in --program-transform-name, after --program-prefix and
3002# --program-suffix have been applied to it. Autoconf has already
3003# doubled dollar signs and backslashes in program_transform_name; we want
3004# the backslashes un-doubled, and then the entire thing wrapped in single
3005# quotes, because this will be expanded first by make and then by the shell.
3006# Also, because we want to override the logic in subdir configure scripts to
3007# choose program_transform_name, replace any s,x,x, with s,y,y,.
3008sed -e "s,\\\\\\\\,\\\\,g; s,','\\\\'',g; s/s,x,x,/s,y,y,/" <<EOF_SED > conftestsed.out
3009${program_transform_name}
3010EOF_SED
3011gcc_transform_name=`cat conftestsed.out`
3012rm -f conftestsed.out
3013baseargs="$baseargs --program-transform-name='${gcc_transform_name}'"
0e4d1862 3014tbaseargs="$tbaseargs --program-transform-name='${gcc_transform_name}'"
af7bb0c0 3015if test "$silent" = yes; then
3016 baseargs="$baseargs --silent"
0e4d1862 3017 tbaseargs="$tbaseargs --silent"
af7bb0c0 3018fi
cd2f3773 3019baseargs="$baseargs --disable-option-checking"
0e4d1862 3020tbaseargs="$tbaseargs --disable-option-checking"
fbfea1fa 3021
372a3f1e 3022# Record and document user additions to sub configure arguments.
3023AC_ARG_VAR([build_configargs],
3024 [additional configure arguments for build directories])
3025AC_ARG_VAR([host_configargs],
3026 [additional configure arguments for host directories])
3027AC_ARG_VAR([target_configargs],
3028 [additional configure arguments for target directories])
3029
31972771 3030# For the build-side libraries, we just need to pretend we're native,
3031# and not use the same cache file. Multilibs are neither needed nor
b85b703b 3032# desired. We can't even use the same cache file for all build-side
3033# libraries, as they're compiled differently; some with C, some with
3034# C++ or with different feature-enabling options.
3035build_configargs="$build_configargs --cache-file=./config.cache ${baseargs}"
64d298c9 3036
805e22b2 3037# For host modules, accept cache file option, or specification as blank.
3038case "${cache_file}" in
3039"") # empty
3040 cache_file_option="" ;;
71ab34df 3041/* | [[A-Za-z]]:[[\\/]]* ) # absolute path
805e22b2 3042 cache_file_option="--cache-file=${cache_file}" ;;
3043*) # relative path
3044 cache_file_option="--cache-file=../${cache_file}" ;;
3045esac
3046
ba1081ef 3047# Host dirs don't like to share a cache file either, horribly enough.
3048# This seems to be due to autoconf 2.5x stupidity.
372a3f1e 3049host_configargs="$host_configargs --cache-file=./config.cache ${extra_host_args} ${baseargs}"
805e22b2 3050
0e4d1862 3051target_configargs="$target_configargs ${tbaseargs}"
31972771 3052
28e9041c 3053# Passing a --with-cross-host argument lets the target libraries know
3054# whether they are being built with a cross-compiler or being built
3055# native. However, it would be better to use other mechanisms to make the
3056# sorts of decisions they want to make on this basis. Please consider
3057# this option to be deprecated. FIXME.
441f85dc 3058if test x${is_cross_compiler} = xyes ; then
b30fcfae 3059 target_configargs="--with-cross-host=${host_noncanonical} ${target_configargs}"
28e9041c 3060fi
3061
87ebeb4c 3062# Special user-friendly check for native x86_64-linux build, if
3063# multilib is not explicitly enabled.
3064case "$target:$have_compiler:$host:$target:$enable_multilib" in
3065 x86_64-*linux*:yes:$build:$build:)
6efd9d79 3066 # Make sure we have a development environment that handles 32-bit
87ebeb4c 3067 dev64=no
3068 echo "int main () { return 0; }" > conftest.c
3069 ${CC} -m32 -o conftest ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} conftest.c
3070 if test $? = 0 ; then
3071 if test -s conftest || test -s conftest.exe ; then
3072 dev64=yes
3073 fi
3074 fi
3075 rm -f conftest*
3076 if test x${dev64} != xyes ; then
6efd9d79 3077 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.])
87ebeb4c 3078 fi
3079 ;;
3080esac
3081
59a40389 3082# Default to --enable-multilib.
3083if test x${enable_multilib} = x ; then
3a7bfd0c 3084 target_configargs="--enable-multilib ${target_configargs}"
59a40389 3085fi
28e9041c 3086
ed37269d 3087# Pass --with-newlib if appropriate. Note that target_configdirs has
3088# changed from the earlier setting of with_newlib.
441f85dc 3089if test x${with_newlib} != xno && echo " ${target_configdirs} " | grep " newlib " > /dev/null 2>&1 && test -d ${srcdir}/newlib ; then
3a7bfd0c 3090 target_configargs="--with-newlib ${target_configargs}"
ed37269d 3091fi
3092
74fef112 3093# Different target subdirs use different values of certain variables
3094# (notably CXX). Worse, multilibs use *lots* of different values.
3095# Worse yet, autoconf 2.5x makes some of these 'precious', meaning that
3096# it doesn't automatically accept command-line overrides of them.
3097# This means it's not safe for target subdirs to share a cache file,
3098# which is disgusting, but there you have it. Hopefully this can be
3099# fixed in future. It's still worthwhile to use a cache file for each
3100# directory. I think.
3101
a8abbd9d 3102# Pass the appropriate --build, --host, --target and --cache-file arguments.
3103# We need to pass --target, as newer autoconf's requires consistency
3104# for target_alias and gcc doesn't manage it consistently.
d45318b3 3105target_configargs="--cache-file=./config.cache ${target_configargs}"
31972771 3106
bc7af389 3107FLAGS_FOR_TARGET=
753fca8a 3108case " $target_configdirs " in
681dbe98 3109 *" newlib "*)
3a7bfd0c 3110 case " $target_configargs " in
681dbe98 3111 *" --with-newlib "*)
bc7af389 3112 case "$target" in
fe284774 3113 *-cygwin*)
db54564d 3114 FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -L$$r/$(TARGET_SUBDIR)/winsup/cygwin -isystem $$s/winsup/cygwin/include'
fe284774 3115 ;;
bc7af389 3116 esac
3117
e2bac683 3118 # If we're not building GCC, don't discard standard headers.
296a0f54 3119 if test -d ${srcdir}/gcc; then
32999451 3120 FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -nostdinc'
e2bac683 3121
3122 if test "${build}" != "${host}"; then
3123 # On Canadian crosses, CC_FOR_TARGET will have already been set
3124 # by `configure', so we won't have an opportunity to add -Bgcc/
3125 # to it. This is right: we don't want to search that directory
3126 # for binaries, but we want the header files in there, so add
3127 # them explicitly.
e619f0a6 3128 FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -isystem $$r/$(HOST_SUBDIR)/gcc/include -isystem $$r/$(HOST_SUBDIR)/gcc/include-fixed'
e2bac683 3129
3130 # Someone might think of using the pre-installed headers on
3131 # Canadian crosses, in case the installed compiler is not fully
3132 # compatible with the compiler being built. In this case, it
3133 # would be better to flag an error than risking having
3134 # incompatible object files being constructed. We can't
3135 # guarantee that an error will be flagged, but let's hope the
3136 # compiler will do it, when presented with incompatible header
3137 # files.
3138 fi
32999451 3139 fi
3140
df2ff48f 3141 case "${target}-${is_cross_compiler}" in
f74ea578 3142 i[[3456789]]86-*-linux*-no)
df2ff48f 3143 # Here host == target, so we don't need to build gcc,
3144 # so we don't want to discard standard headers.
3145 FLAGS_FOR_TARGET=`echo " $FLAGS_FOR_TARGET " | sed -e 's/ -nostdinc / /'`
df2ff48f 3146 ;;
3147 *)
3148 # If we're building newlib, use its generic headers last, but search
3149 # for any libc-related directories first (so make it the last -B
3150 # switch).
3151 FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -B$$r/$(TARGET_SUBDIR)/newlib/ -isystem $$r/$(TARGET_SUBDIR)/newlib/targ-include -isystem $$s/newlib/libc/include'
1c5767f1 3152
3153 # If we're building libgloss, find the startup file, simulator library
3154 # and linker script.
3155 case " $target_configdirs " in
3156 *" libgloss "*)
3157 # Look for startup file, simulator library and maybe linker script.
3158 FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -B$$r/$(TARGET_SUBDIR)/libgloss/'"$libgloss_dir"
3159 # Look for libnosys.a in case the target needs it.
3160 FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -L$$r/$(TARGET_SUBDIR)/libgloss/libnosys'
3161 # Most targets have the linker script in the source directory.
3162 FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -L$$s/libgloss/'"$libgloss_dir"
3163 ;;
3164 esac
df2ff48f 3165 ;;
3166 esac
bc7af389 3167 ;;
681dbe98 3168 esac
3169 ;;
bc7af389 3170esac
fe284774 3171
d6d689df 3172case "$target" in
fe284774 3173 x86_64-*mingw* | *-w64-mingw*)
3174 # MinGW-w64 does not use newlib, nor does it use winsup. It may,
3175 # however, use a symlink named 'mingw' in ${prefix} .
3176 FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -L${prefix}/${target}/lib -L${prefix}/mingw/lib -isystem ${prefix}/${target}/include -isystem ${prefix}/mingw/include'
3177 ;;
3178 *-mingw*)
3179 # MinGW can't be handled as Cygwin above since it does not use newlib.
3180 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'
3181 ;;
d6d689df 3182esac
32999451 3183
d8e9ea04 3184# Allow the user to override the flags for
3185# our build compiler if desired.
823e8b8d 3186if test x"${build}" = x"${host}" ; then
3187 CFLAGS_FOR_BUILD=${CFLAGS_FOR_BUILD-${CFLAGS}}
3188 CXXFLAGS_FOR_BUILD=${CXXFLAGS_FOR_BUILD-${CXXFLAGS}}
3189 LDFLAGS_FOR_BUILD=${LDFLAGS_FOR_BUILD-${LDFLAGS}}
3190fi
d8e9ea04 3191
32999451 3192# On Canadian crosses, we'll be searching the right directories for
3193# the previously-installed cross compiler, so don't bother to add
3194# flags for directories within the install tree of the compiler
3195# being built; programs in there won't even run.
296a0f54 3196if test "${build}" = "${host}" && test -d ${srcdir}/gcc; then
bc7af389 3197 # Search for pre-installed headers if nothing else fits.
5750c7d4 3198 FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -B$(build_tooldir)/bin/ -B$(build_tooldir)/lib/ -isystem $(build_tooldir)/include -isystem $(build_tooldir)/sys-include'
bc7af389 3199fi
32999451 3200
753fca8a 3201if test "x${use_gnu_ld}" = x &&
13b1b53a 3202 echo " ${configdirs} " | grep " ld " > /dev/null ; then
bc7af389 3203 # Arrange for us to find uninstalled linker scripts.
c1eb9e31 3204 FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -L$$r/$(HOST_SUBDIR)/ld'
bc7af389 3205fi
3206
24714a39 3207# Search for other target-specific linker scripts and such.
3208case "${target}" in
38d7211b 3209 mep*)
3210 FLAGS_FOR_TARGET="$FLAGS_FOR_TARGET -mlibrary"
3211 ;;
24714a39 3212esac
3213
71ab34df 3214# Makefile fragments.
03c65091 3215for frag in host_makefile_frag target_makefile_frag alphaieee_frag ospace_frag;
3216do
3217 eval fragval=\$$frag
3218 if test $fragval != /dev/null; then
3219 eval $frag=${srcdir}/$fragval
3220 fi
3221done
71ab34df 3222AC_SUBST_FILE(host_makefile_frag)
3223AC_SUBST_FILE(target_makefile_frag)
3224AC_SUBST_FILE(alphaieee_frag)
3225AC_SUBST_FILE(ospace_frag)
3226
3227# Miscellanea: directories, flags, etc.
71ab34df 3228AC_SUBST(RPATH_ENVVAR)
7d804f04 3229AC_SUBST(GCC_SHLIB_SUBDIR)
71ab34df 3230AC_SUBST(tooldir)
3231AC_SUBST(build_tooldir)
415470be 3232AC_SUBST(CONFIGURE_GDB_TK)
71ab34df 3233AC_SUBST(GDB_TK)
415470be 3234AC_SUBST(INSTALL_GDB_TK)
71ab34df 3235
3236# Build module lists & subconfigure args.
71ab34df 3237AC_SUBST(build_configargs)
2f8725b0 3238AC_SUBST(build_configdirs)
71ab34df 3239
3240# Host module lists & subconfigure args.
3241AC_SUBST(host_configargs)
3242AC_SUBST(configdirs)
1fda3360 3243AC_SUBST(target_configdirs)
71ab34df 3244
3245# Target module lists & subconfigure args.
71ab34df 3246AC_SUBST(target_configargs)
7601142f 3247
71ab34df 3248
3249# Build tools.
93c5e793 3250AC_SUBST(AR_FOR_BUILD)
3251AC_SUBST(AS_FOR_BUILD)
71ab34df 3252AC_SUBST(CC_FOR_BUILD)
93c5e793 3253AC_SUBST(CFLAGS_FOR_BUILD)
3254AC_SUBST(CXXFLAGS_FOR_BUILD)
3255AC_SUBST(CXX_FOR_BUILD)
3256AC_SUBST(DLLTOOL_FOR_BUILD)
3257AC_SUBST(GCJ_FOR_BUILD)
3258AC_SUBST(GFORTRAN_FOR_BUILD)
5ff5b630 3259AC_SUBST(GOC_FOR_BUILD)
93c5e793 3260AC_SUBST(LDFLAGS_FOR_BUILD)
3261AC_SUBST(LD_FOR_BUILD)
3262AC_SUBST(NM_FOR_BUILD)
3263AC_SUBST(RANLIB_FOR_BUILD)
3264AC_SUBST(WINDMC_FOR_BUILD)
3265AC_SUBST(WINDRES_FOR_BUILD)
71ab34df 3266
f5aebe3e 3267# Generate default definitions for YACC, M4, LEX and other programs that run
3268# on the build machine. These are used if the Makefile can't locate these
3269# programs in objdir.
3270MISSING=`cd $ac_aux_dir && ${PWDCMD-pwd}`/missing
3271
3272AC_CHECK_PROGS([YACC], ['bison -y' byacc yacc], [$MISSING bison -y])
3273case " $build_configdirs " in
3274 *" bison "*) YACC='$$r/$(BUILD_SUBDIR)/bison/tests/bison -y' ;;
f5aebe3e 3275esac
3276
3277AC_CHECK_PROGS([BISON], [bison], [$MISSING bison])
3278case " $build_configdirs " in
3279 *" bison "*) BISON='$$r/$(BUILD_SUBDIR)/bison/tests/bison' ;;
3280esac
3281
3282AC_CHECK_PROGS([M4], [gm4 gnum4 m4], [$MISSING m4])
3283case " $build_configdirs " in
3284 *" m4 "*) M4='$$r/$(BUILD_SUBDIR)/m4/m4' ;;
3285esac
3286
3287AC_CHECK_PROGS([LEX], [flex lex], [$MISSING flex])
3288case " $build_configdirs " in
3289 *" flex "*) LEX='$$r/$(BUILD_SUBDIR)/flex/flex' ;;
3290 *" lex "*) LEX='$$r/$(BUILD_SUBDIR)/lex/lex' ;;
3291esac
3292
3293AC_CHECK_PROGS([FLEX], [flex], [$MISSING flex])
3294case " $build_configdirs " in
3295 *" flex "*) FLEX='$$r/$(BUILD_SUBDIR)/flex/flex' ;;
3296esac
3297
3298AC_CHECK_PROGS([MAKEINFO], makeinfo, [$MISSING makeinfo])
3299case " $build_configdirs " in
3300 *" texinfo "*) MAKEINFO='$$r/$(BUILD_SUBDIR)/texinfo/makeinfo/makeinfo' ;;
3301 *)
3302changequote(,)
03caadda 3303 # For an installed makeinfo, we require it to be from texinfo 4.7 or
f5aebe3e 3304 # higher, else we use the "missing" dummy.
3305 if ${MAKEINFO} --version \
03caadda 3306 | egrep 'texinfo[^0-9]*(4\.([7-9]|[1-9][0-9])|[5-9]|[1-9][0-9])' >/dev/null 2>&1; then
f5aebe3e 3307 :
3308 else
3309 MAKEINFO="$MISSING makeinfo"
3310 fi
3311 ;;
3312changequote([,])
3313esac
3314
3315# FIXME: expect and dejagnu may become build tools?
3316
3317AC_CHECK_PROGS(EXPECT, expect, expect)
3318case " $configdirs " in
3319 *" expect "*)
3320 test $host = $build && EXPECT='$$r/$(HOST_SUBDIR)/expect/expect'
3321 ;;
3322esac
3323
3324AC_CHECK_PROGS(RUNTEST, runtest, runtest)
3325case " $configdirs " in
3326 *" dejagnu "*)
8d365775 3327 test $host = $build && RUNTEST='$$s/$(HOST_SUBDIR)/dejagnu/runtest'
f5aebe3e 3328 ;;
3329esac
3330
3331
71ab34df 3332# Host tools.
768691b5 3333NCN_STRICT_CHECK_TOOLS(AR, ar)
3334NCN_STRICT_CHECK_TOOLS(AS, as)
3335NCN_STRICT_CHECK_TOOLS(DLLTOOL, dlltool)
3336NCN_STRICT_CHECK_TOOLS(LD, ld)
f5aebe3e 3337NCN_STRICT_CHECK_TOOLS(LIPO, lipo)
768691b5 3338NCN_STRICT_CHECK_TOOLS(NM, nm)
68645a6b 3339NCN_STRICT_CHECK_TOOLS(RANLIB, ranlib, true)
3340NCN_STRICT_CHECK_TOOLS(STRIP, strip, true)
768691b5 3341NCN_STRICT_CHECK_TOOLS(WINDRES, windres)
75d6a0a9 3342NCN_STRICT_CHECK_TOOLS(WINDMC, windmc)
768691b5 3343NCN_STRICT_CHECK_TOOLS(OBJCOPY, objcopy)
3344NCN_STRICT_CHECK_TOOLS(OBJDUMP, objdump)
3f71364d 3345NCN_STRICT_CHECK_TOOLS(READELF, readelf)
71ab34df 3346AC_SUBST(CC)
3347AC_SUBST(CXX)
3348AC_SUBST(CFLAGS)
3349AC_SUBST(CXXFLAGS)
71ab34df 3350
f5aebe3e 3351# Target tools.
c47832b1 3352AC_ARG_WITH([build-time-tools],
8747a938 3353 [AS_HELP_STRING([--with-build-time-tools=PATH],
3354 [use given path to find target tools during the build])],
c47832b1 3355 [case x"$withval" in
3356 x/*) ;;
3357 *)
3358 with_build_time_tools=
3359 AC_MSG_WARN([argument to --with-build-time-tools must be an absolute path])
3360 ;;
3361 esac],
3362 [with_build_time_tools=])
3363
768691b5 3364NCN_STRICT_CHECK_TARGET_TOOLS(CC_FOR_TARGET, cc gcc)
3365NCN_STRICT_CHECK_TARGET_TOOLS(CXX_FOR_TARGET, c++ g++ cxx gxx)
768691b5 3366NCN_STRICT_CHECK_TARGET_TOOLS(GCC_FOR_TARGET, gcc, ${CC_FOR_TARGET})
3367NCN_STRICT_CHECK_TARGET_TOOLS(GCJ_FOR_TARGET, gcj)
3368NCN_STRICT_CHECK_TARGET_TOOLS(GFORTRAN_FOR_TARGET, gfortran)
5ff5b630 3369NCN_STRICT_CHECK_TARGET_TOOLS(GOC_FOR_TARGET, gccgo)
c47832b1 3370
3371ACX_CHECK_INSTALLED_TARGET_TOOL(AR_FOR_TARGET, ar)
3372ACX_CHECK_INSTALLED_TARGET_TOOL(AS_FOR_TARGET, as)
3373ACX_CHECK_INSTALLED_TARGET_TOOL(DLLTOOL_FOR_TARGET, dlltool)
3374ACX_CHECK_INSTALLED_TARGET_TOOL(LD_FOR_TARGET, ld)
3375ACX_CHECK_INSTALLED_TARGET_TOOL(LIPO_FOR_TARGET, lipo)
3376ACX_CHECK_INSTALLED_TARGET_TOOL(NM_FOR_TARGET, nm)
fc740d70 3377ACX_CHECK_INSTALLED_TARGET_TOOL(OBJCOPY_FOR_TARGET, objcopy)
c47832b1 3378ACX_CHECK_INSTALLED_TARGET_TOOL(OBJDUMP_FOR_TARGET, objdump)
68645a6b 3379ACX_CHECK_INSTALLED_TARGET_TOOL(RANLIB_FOR_TARGET, ranlib)
3f71364d 3380ACX_CHECK_INSTALLED_TARGET_TOOL(READELF_FOR_TARGET, readelf)
c47832b1 3381ACX_CHECK_INSTALLED_TARGET_TOOL(STRIP_FOR_TARGET, strip)
3382ACX_CHECK_INSTALLED_TARGET_TOOL(WINDRES_FOR_TARGET, windres)
75d6a0a9 3383ACX_CHECK_INSTALLED_TARGET_TOOL(WINDMC_FOR_TARGET, windmc)
ef8184c7 3384
f5aebe3e 3385RAW_CXX_FOR_TARGET="$CXX_FOR_TARGET"
3386
3387GCC_TARGET_TOOL(ar, AR_FOR_TARGET, AR, [binutils/ar])
3388GCC_TARGET_TOOL(as, AS_FOR_TARGET, AS, [gas/as-new])
3389GCC_TARGET_TOOL(cc, CC_FOR_TARGET, CC, [gcc/xgcc -B$$r/$(HOST_SUBDIR)/gcc/])
fb093ce7 3390dnl see comments for CXX_FOR_TARGET_FLAG_TO_PASS
f5aebe3e 3391GCC_TARGET_TOOL(c++, CXX_FOR_TARGET, CXX,
b710ec85 3392 [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],
f5aebe3e 3393 c++)
3394GCC_TARGET_TOOL(c++ for libstdc++, RAW_CXX_FOR_TARGET, CXX,
b710ec85 3395 [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],
f5aebe3e 3396 c++)
3397GCC_TARGET_TOOL(dlltool, DLLTOOL_FOR_TARGET, DLLTOOL, [binutils/dlltool])
3398GCC_TARGET_TOOL(gcc, GCC_FOR_TARGET, , [gcc/xgcc -B$$r/$(HOST_SUBDIR)/gcc/])
3399GCC_TARGET_TOOL(gcj, GCJ_FOR_TARGET, GCJ,
3400 [gcc/gcj -B$$r/$(HOST_SUBDIR)/gcc/], java)
3401GCC_TARGET_TOOL(gfortran, GFORTRAN_FOR_TARGET, GFORTRAN,
3402 [gcc/gfortran -B$$r/$(HOST_SUBDIR)/gcc/], fortran)
5ff5b630 3403GCC_TARGET_TOOL(gccgo, GOC_FOR_TARGET, GOC,
3404 [gcc/gccgo -B$$r/$(HOST_SUBDIR)/gcc/], go)
f5aebe3e 3405GCC_TARGET_TOOL(ld, LD_FOR_TARGET, LD, [ld/ld-new])
3406GCC_TARGET_TOOL(lipo, LIPO_FOR_TARGET, LIPO)
3407GCC_TARGET_TOOL(nm, NM_FOR_TARGET, NM, [binutils/nm-new])
9b31ae9c 3408GCC_TARGET_TOOL(objcopy, OBJCOPY_FOR_TARGET, OBJCOPY, [binutils/objcopy])
f5aebe3e 3409GCC_TARGET_TOOL(objdump, OBJDUMP_FOR_TARGET, OBJDUMP, [binutils/objdump])
3410GCC_TARGET_TOOL(ranlib, RANLIB_FOR_TARGET, RANLIB, [binutils/ranlib])
3f71364d 3411GCC_TARGET_TOOL(readelf, READELF_FOR_TARGET, READELF, [binutils/readelf])
2b7a4d59 3412GCC_TARGET_TOOL(strip, STRIP_FOR_TARGET, STRIP, [binutils/strip-new])
f5aebe3e 3413GCC_TARGET_TOOL(windres, WINDRES_FOR_TARGET, WINDRES, [binutils/windres])
75d6a0a9 3414GCC_TARGET_TOOL(windmc, WINDMC_FOR_TARGET, WINDMC, [binutils/windmc])
ef8184c7 3415
f5aebe3e 3416AC_SUBST(FLAGS_FOR_TARGET)
ef8184c7 3417AC_SUBST(RAW_CXX_FOR_TARGET)
49aae208 3418
71ab34df 3419# Certain tools may need extra flags.
3420AR_FOR_TARGET=${AR_FOR_TARGET}${extra_arflags_for_target}
3421RANLIB_FOR_TARGET=${RANLIB_FOR_TARGET}${extra_ranlibflags_for_target}
3422NM_FOR_TARGET=${NM_FOR_TARGET}${extra_nmflags_for_target}
28e9041c 3423
f5aebe3e 3424# When building target libraries, except in a Canadian cross, we use
3425# the same toolchain as the compiler we just built.
3426COMPILER_AS_FOR_TARGET='$(AS_FOR_TARGET)'
3427COMPILER_LD_FOR_TARGET='$(LD_FOR_TARGET)'
3428COMPILER_NM_FOR_TARGET='$(NM_FOR_TARGET)'
3429if test $host = $build; then
3430 case " $configdirs " in
3431 *" gcc "*)
3432 COMPILER_AS_FOR_TARGET='$$r/$(HOST_SUBDIR)/gcc/as'
3433 COMPILER_LD_FOR_TARGET='$$r/$(HOST_SUBDIR)/gcc/collect-ld'
3434 COMPILER_NM_FOR_TARGET='$$r/$(HOST_SUBDIR)/gcc/nm'${extra_nmflags_for_target}
3435 ;;
3436 esac
3437fi
3438
3439AC_SUBST(COMPILER_AS_FOR_TARGET)
3440AC_SUBST(COMPILER_LD_FOR_TARGET)
3441AC_SUBST(COMPILER_NM_FOR_TARGET)
3442
3290c0cf 3443AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
3444AC_ARG_ENABLE(maintainer-mode,
8747a938 3445[AS_HELP_STRING([--enable-maintainer-mode],
3446 [enable make rules and dependencies not useful
3447 (and sometimes confusing) to the casual installer])],
3290c0cf 3448 USE_MAINTAINER_MODE=$enableval,
3449 USE_MAINTAINER_MODE=no)
3450AC_MSG_RESULT($USE_MAINTAINER_MODE)
3451AC_SUBST(MAINTAINER_MODE_TRUE)
3452AC_SUBST(MAINTAINER_MODE_FALSE)
3453if test "$USE_MAINTAINER_MODE" = yes; then
3454 MAINTAINER_MODE_TRUE=
3455 MAINTAINER_MODE_FALSE='#'
3456else
3457 MAINTAINER_MODE_TRUE='#'
3458 MAINTAINER_MODE_FALSE=
3459fi
3460MAINT=$MAINTAINER_MODE_TRUE
3461AC_SUBST(MAINT)dnl
3462
2d64c2fd 3463# ---------------------
3464# GCC bootstrap support
3465# ---------------------
3466
3467# Stage specific cflags for build.
3468stage1_cflags="-g"
3469case $build in
3470 vax-*-*)
3471 case ${GCC} in
3472 yes) stage1_cflags="-g -Wa,-J" ;;
3473 *) stage1_cflags="-g -J" ;;
3474 esac ;;
2d64c2fd 3475esac
f508ba97 3476
2d64c2fd 3477AC_SUBST(stage1_cflags)
3478
39f34cfc 3479# Enable --enable-checking in stage1 of the compiler.
3480AC_ARG_ENABLE(stage1-checking,
8747a938 3481[AS_HELP_STRING([[--enable-stage1-checking[=all]]],
3482 [choose additional checking for stage1 of the compiler])],
39f34cfc 3483[stage1_checking=--enable-checking=${enable_stage1_checking}],
f6be6a96 3484[if test "x$enable_checking" = xno || test "x$enable_checking" = x; then
868af6b6 3485 # For --disable-checking or implicit --enable-checking=release, avoid
3486 # setting --enable-checking=gc in the default stage1 checking for LTO
3487 # bootstraps. See PR62077.
3488 stage1_checking=--enable-checking=release,misc,gimple,rtlflag,tree,types
3489 case $BUILD_CONFIG in
3490 *lto*)
3491 if test "x$enable_checking" = x && \
3492 test -d ${srcdir}/gcc && \
3493 test x"`cat ${srcdir}/gcc/DEV-PHASE`" = xexperimental; then
3494 stage1_checking=--enable-checking=yes,types
3495 fi;;
3496 *) stage1_checking=--enable-checking=yes,types;;
3497 esac
39f34cfc 3498else
f6be6a96 3499 stage1_checking=--enable-checking=$enable_checking,types
39f34cfc 3500fi])
3501AC_SUBST(stage1_checking)
3502
2d64c2fd 3503# Enable -Werror in bootstrap stage2 and later.
2d64c2fd 3504AC_ARG_ENABLE(werror,
8747a938 3505[AS_HELP_STRING([--enable-werror],
3506 [enable -Werror in bootstrap stage2 and later])], [],
dd979235 3507[if test -d ${srcdir}/gcc && test x"`cat $srcdir/gcc/DEV-PHASE`" = xexperimental; then
dc914c6d 3508 enable_werror=yes
3509else
3510 enable_werror=no
3511fi])
c0c5068d 3512case ${enable_werror} in
3513 yes) stage2_werror_flag="--enable-werror-always" ;;
3514 *) stage2_werror_flag="" ;;
2d64c2fd 3515esac
c0c5068d 3516AC_SUBST(stage2_werror_flag)
2d64c2fd 3517
2bd17377 3518# Enable --enable-host-shared.
3519AC_ARG_ENABLE(host-shared,
3520[AS_HELP_STRING([--enable-host-shared],
3521 [build host code as shared libraries])],
3522[host_shared=$enableval], [host_shared=no])
3523AC_SUBST(host_shared)
3524
5c524c74 3525# PR jit/64780: Require the user to explicitly specify
3526# --enable-host-shared if the jit is enabled, hinting
3527# that they might want to do a separate configure/build of
3528# the jit, to avoid users from slowing down the rest of the
3529# compiler by enabling the jit.
3530if test ${host_shared} = "no" ; then
3531 case "${enable_languages}" in
3532 *jit*)
3533 AC_MSG_ERROR([
3534Enabling language "jit" requires --enable-host-shared.
3535
3536--enable-host-shared typically slows the rest of the compiler down by
3537a few %, so you must explicitly enable it.
3538
3539If you want to build both the jit and the regular compiler, it is often
3540best to do this via two separate configure/builds, in separate
3541directories, to avoid imposing the performance cost of
3542--enable-host-shared on the regular compiler.])
3543 ;;
3544 *)
3545 ;;
3546 esac
3547fi
3548
6fe86052 3549# Specify what files to not compare during bootstrap.
3550
3551compare_exclusions="gcc/cc*-checksum\$(objext) | gcc/ada/*tools/*"
3552case "$target" in
3553 hppa*64*-*-hpux*) ;;
3554 hppa*-*-hpux*) compare_exclusions="gcc/cc*-checksum\$(objext) | */libgcc/lib2funcs* | gcc/ada/*tools/*" ;;
286256c7 3555 powerpc*-ibm-aix*) compare_exclusions="gcc/cc*-checksum\$(objext) | gcc/ada/*tools/* | *libgomp*\$(objext)" ;;
6fe86052 3556esac
3557AC_SUBST(compare_exclusions)
3558
8bb79148 3559AC_CONFIG_FILES([Makefile],
3560 [sed "$extrasub_build" Makefile |
3561 sed "$extrasub_host" |
3562 sed "$extrasub_target" > mf$$
3563 mv -f mf$$ Makefile],
3564 [extrasub_build="$extrasub_build"
3565 extrasub_host="$extrasub_host"
3566 extrasub_target="$extrasub_target"])
3567AC_OUTPUT