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