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