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