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