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