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