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