comparison configure.ac @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents f6334be47118
children 84e7813d76e9
comparison
equal deleted inserted replaced
68:561a7518be6b 111:04ced10e8804
1 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 1 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
2 # 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 2 # 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012,
3 # Free Software Foundation, Inc. 3 # 2014, 2015, 2016 Free Software Foundation, Inc.
4 # 4 #
5 # This file is free software; you can redistribute it and/or modify it 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 6 # under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 3 of the License, or 7 # the Free Software Foundation; either version 3 of the License, or
8 # (at your option) any later version. 8 # (at your option) any later version.
26 m4_include([libtool.m4]) 26 m4_include([libtool.m4])
27 m4_include([ltoptions.m4]) 27 m4_include([ltoptions.m4])
28 m4_include([ltsugar.m4]) 28 m4_include([ltsugar.m4])
29 m4_include([ltversion.m4]) 29 m4_include([ltversion.m4])
30 m4_include([lt~obsolete.m4]) 30 m4_include([lt~obsolete.m4])
31 m4_include([config/cloog.m4]) 31 m4_include([config/isl.m4])
32 32
33 AC_INIT(move-if-change) 33 AC_INIT(move-if-change)
34 AC_PREREQ(2.64) 34 AC_PREREQ(2.64)
35 AC_DISABLE_OPTION_CHECKING 35 AC_DISABLE_OPTION_CHECKING
36 36
87 ACX_PROG_LN 87 ACX_PROG_LN
88 AC_PROG_LN_S 88 AC_PROG_LN_S
89 AC_PROG_SED 89 AC_PROG_SED
90 AC_PROG_AWK 90 AC_PROG_AWK
91 91
92 ### we might need to use some other shell than /bin/sh for running subshells
93 ### If we are on Windows, search for the shell. This will permit people
94 ### to not have /bin/sh, but to be able to see /SOME/PATH/sh configure
95 ### without also having to set CONFIG_SHELL. This code will work when
96 ### using bash, which sets OSTYPE.
97 case "${OSTYPE}" in
98 *win32*)
99 if test x${CONFIG_SHELL} = x ; then
100 if test ! -f /bin/sh ; then
101 if test x${SHELL} != x && test -f ${SHELL} ; then
102 CONFIG_SHELL=${SHELL}
103 export CONFIG_SHELL
104 else
105 for prog in sh sh.exe bash bash.exe; do
106 IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:"
107 for dir in $PATH; do
108 test -z "$dir" && dir=.
109 if test -f $dir/$prog; then
110 CONFIG_SHELL=$dir/$prog
111 export CONFIG_SHELL
112 break
113 fi
114 done
115 IFS="$save_ifs"
116 test -n "${CONFIG_SHELL}" && break
117 done
118 fi
119 fi
120 fi
121 ;;
122 esac
123
124 config_shell=${CONFIG_SHELL-/bin/sh}
125
126 moveifchange=${srcdir}/move-if-change
127
128 srcpwd=`cd ${srcdir} ; ${PWDCMD-pwd}` 92 srcpwd=`cd ${srcdir} ; ${PWDCMD-pwd}`
129 93
130 # We pass INSTALL explicitly to sub-makes. Make sure that it is not 94 # We pass INSTALL explicitly to sub-makes. Make sure that it is not
131 # a relative path. 95 # a relative path.
132 if test "$INSTALL" = "${srcdir}/install-sh -c"; then 96 if test "$INSTALL" = "${srcdir}/install-sh -c"; then
159 # cause circular dependencies and break everything horribly. 123 # cause circular dependencies and break everything horribly.
160 124
161 # these library is used by various programs built for the build 125 # these library is used by various programs built for the build
162 # environment 126 # environment
163 # 127 #
164 build_libs="build-libiberty" 128 build_libs="build-libiberty build-libcpp"
165 129
166 # these tools are built for the build environment 130 # these tools are built for the build environment
167 build_tools="build-texinfo build-byacc build-flex build-bison build-m4 build-fixincludes" 131 build_tools="build-texinfo build-flex build-bison build-m4 build-fixincludes"
168 132
169 # these libraries are used by various programs built for the host environment 133 # these libraries are used by various programs built for the host environment
170 # 134 #f
171 host_libs="intl mmalloc libiberty opcodes bfd readline tcl tk itcl libgui zlib libcpp libdecnumber gmp mpfr mpc ppl cloog libelf libiconv" 135 host_libs="intl libiberty opcodes bfd readline tcl tk itcl libgui zlib libbacktrace libcpp libdecnumber gmp mpfr mpc isl libelf libiconv"
172 136
173 # these tools are built for the host environment 137 # these tools are built for the host environment
174 # Note, the powerpc-eabi build depends on sim occurring before gdb in order to 138 # Note, the powerpc-eabi build depends on sim occurring before gdb in order to
175 # know that we are building the simulator. 139 # know that we are building the simulator.
176 # binutils, gas and ld appear in that order because it makes sense to run 140 # binutils, gas and ld appear in that order because it makes sense to run
177 # "make check" in that particular order. 141 # "make check" in that particular order.
178 # If --enable-gold is used, "gold" may replace "ld". 142 # If --enable-gold is used, "gold" may replace "ld".
179 host_tools="texinfo byacc flex bison binutils gas ld fixincludes gcc cgen sid sim gdb make patch prms send-pr gprof etc expect dejagnu ash bash bzip2 m4 autoconf automake libtool diff rcs fileutils shellutils time textutils wdiff find uudecode hello tar gzip indent recode release sed utils guile perl gawk findutils gettext zip fastjar gnattools" 143 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"
180
181 # libgcj represents the runtime libraries only used by gcj.
182 libgcj="target-libffi \
183 target-zlib \
184 target-qthreads \
185 target-libjava"
186 144
187 # these libraries are built for the target environment, and are built after 145 # these libraries are built for the target environment, and are built after
188 # the host libraries and the host tools (which may be a cross compiler) 146 # the host libraries and the host tools (which may be a cross compiler)
189 # 147 # Note that libiberty is not a target library.
190 target_libraries="target-libgcc \ 148 target_libraries="target-libgcc \
191 target-libiberty \ 149 target-libbacktrace \
192 target-libgloss \ 150 target-libgloss \
193 target-newlib \ 151 target-newlib \
194 target-libgomp \ 152 target-libgomp \
153 target-libcilkrts \
154 target-liboffloadmic \
155 target-libhsail-rt \
156 target-libatomic \
157 target-libitm \
195 target-libstdc++-v3 \ 158 target-libstdc++-v3 \
196 target-libmudflap \ 159 target-libsanitizer \
160 target-libvtv \
161 target-libmpx \
197 target-libssp \ 162 target-libssp \
198 target-libquadmath \ 163 target-libquadmath \
199 target-libgfortran \ 164 target-libgfortran \
200 target-boehm-gc \ 165 target-libffi \
201 ${libgcj} \
202 target-libobjc \ 166 target-libobjc \
203 target-libada \ 167 target-libada \
204 target-libgo" 168 target-libgo"
205 169
206 # these tools are built using the target libraries, and are intended to 170 # these tools are built using the target libraries, and are intended to
207 # run only in the target environment 171 # run only in the target environment
208 # 172 #
209 # note: any program that *uses* libraries that are in the "target_libraries" 173 # note: any program that *uses* libraries that are in the "target_libraries"
210 # list belongs in this list. those programs are also very likely 174 # list belongs in this list.
211 # candidates for the "native_only" list which follows
212 # 175 #
213 target_tools="target-examples target-groff target-gperf target-rda" 176 target_tools="target-rda"
214 177
215 ################################################################################ 178 ################################################################################
216 179
217 ## All tools belong in one of the four categories, and are assigned above 180 ## All tools belong in one of the four categories, and are assigned above
218 ## We assign ${configdirs} this way to remove all embedded newlines. This 181 ## We assign ${configdirs} this way to remove all embedded newlines. This
275 use_gnu_as=no 238 use_gnu_as=no
276 noconfigdirs="$noconfigdirs gas" 239 noconfigdirs="$noconfigdirs gas"
277 fi 240 fi
278 241
279 use_included_zlib= 242 use_included_zlib=
243 AC_ARG_WITH(system-zlib,
244 [AS_HELP_STRING([--with-system-zlib], [use installed libz])])
280 # Make sure we don't let ZLIB be added if we didn't want it. 245 # Make sure we don't let ZLIB be added if we didn't want it.
281 if test x$with_system_zlib = xyes ; then 246 if test x$with_system_zlib = xyes ; then
282 use_included_zlib=no 247 use_included_zlib=no
283 noconfigdirs="$noconfigdirs zlib" 248 noconfigdirs="$noconfigdirs zlib"
284 fi 249 fi
294 enable_gdbtk=no 259 enable_gdbtk=no
295 ;; 260 ;;
296 *) echo "*** bad value \"${with_x}\" for -with-x flag; ignored" 1>&2 ;; 261 *) echo "*** bad value \"${with_x}\" for -with-x flag; ignored" 1>&2 ;;
297 esac 262 esac
298 263
299 # Some tools are only suitable for building in a "native" situation. 264 # Some are only suitable for cross toolchains.
300 # Remove these if host!=target.
301 native_only="autoconf automake libtool fileutils find gawk gettext gzip hello indent m4 rcs recode sed shellutils tar textutils uudecode wdiff target-groff guile perl time ash bash bzip2 prms gnuserv target-gperf"
302
303 # Similarly, some are only suitable for cross toolchains.
304 # Remove these if host=target. 265 # Remove these if host=target.
305 cross_only="target-libgloss target-newlib target-opcodes" 266 cross_only="target-libgloss target-newlib target-opcodes"
306 267
307 case $is_cross_compiler in 268 case $is_cross_compiler in
308 no) skipdirs="${skipdirs} ${cross_only}" ;; 269 no) skipdirs="${skipdirs} ${cross_only}" ;;
309 yes) skipdirs="${skipdirs} ${native_only}" ;;
310 esac 270 esac
311 271
312 # If both --with-headers and --with-libs are specified, default to 272 # If both --with-headers and --with-libs are specified, default to
313 # --without-newlib. 273 # --without-newlib.
314 if test x"${with_headers}" != x && test x"${with_headers}" != xno \ 274 if test x"${with_headers}" != x && test x"${with_headers}" != xno \
321 # Recognize --with-newlib/--without-newlib. 281 # Recognize --with-newlib/--without-newlib.
322 case ${with_newlib} in 282 case ${with_newlib} in
323 no) skipdirs="${skipdirs} target-newlib" ;; 283 no) skipdirs="${skipdirs} target-newlib" ;;
324 yes) skipdirs=`echo " ${skipdirs} " | sed -e 's/ target-newlib / /'` ;; 284 yes) skipdirs=`echo " ${skipdirs} " | sed -e 's/ target-newlib / /'` ;;
325 esac 285 esac
286
287 AC_ARG_ENABLE(as-accelerator-for,
288 [AS_HELP_STRING([--enable-as-accelerator-for=ARG],
289 [build as offload target compiler.
290 Specify offload host triple by ARG])])
291
292 AC_ARG_ENABLE(offload-targets,
293 [AS_HELP_STRING([--enable-offload-targets=LIST],
294 [enable offloading to devices from comma-separated LIST of
295 TARGET[=DIR]. Use optional path to find offload target compiler
296 during the build])],
297 [
298 if test x"$enable_offload_targets" = x; then
299 AC_MSG_ERROR([no offload targets specified])
300 fi
301 ], [enable_offload_targets=])
326 302
327 # Handle --enable-gold, --enable-ld. 303 # Handle --enable-gold, --enable-ld.
328 # --disable-gold [--enable-ld] 304 # --disable-gold [--enable-ld]
329 # Build only ld. Default option. 305 # Build only ld. Default option.
330 # --enable-gold [--enable-ld] 306 # --enable-gold [--enable-ld]
352 yes|default) 328 yes|default)
353 # Check for ELF target. 329 # Check for ELF target.
354 is_elf=no 330 is_elf=no
355 case "${target}" in 331 case "${target}" in
356 *-*-elf* | *-*-sysv4* | *-*-unixware* | *-*-eabi* | hppa*64*-*-hpux* \ 332 *-*-elf* | *-*-sysv4* | *-*-unixware* | *-*-eabi* | hppa*64*-*-hpux* \
357 | *-*-linux* | frv-*-uclinux* | *-*-irix5* | *-*-irix6* \ 333 | *-*-linux* | *-*-gnu* | frv-*-uclinux* | *-*-irix5* | *-*-irix6* \
358 | *-*-netbsd* | *-*-openbsd* | *-*-freebsd* | *-*-solaris2* | *-*-nto*) 334 | *-*-netbsd* | *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* \
335 | *-*-solaris2* | *-*-nto* | *-*-nacl*)
359 case "${target}" in 336 case "${target}" in
360 *-*-linux*aout* | *-*-linux*oldld*) 337 *-*-linux*aout* | *-*-linux*oldld*)
361 ;; 338 ;;
362 *) 339 *)
363 is_elf=yes 340 is_elf=yes
366 esac 343 esac
367 344
368 if test "$is_elf" = "yes"; then 345 if test "$is_elf" = "yes"; then
369 # Check for target supported by gold. 346 # Check for target supported by gold.
370 case "${target}" in 347 case "${target}" in
371 i?86-*-* | x86_64-*-* | sparc*-*-* | powerpc*-*-* | arm*-*-*) 348 i?86-*-* | x86_64-*-* | sparc*-*-* | powerpc*-*-* | arm*-*-* \
349 | aarch64*-*-* | tilegx*-*-* | mips*-*-* | s390*-*-*)
372 configdirs="$configdirs gold" 350 configdirs="$configdirs gold"
373 if test x${ENABLE_GOLD} = xdefault; then 351 if test x${ENABLE_GOLD} = xdefault; then
374 default_ld=gold 352 default_ld=gold
375 fi 353 fi
376 ENABLE_GOLD=yes 354 ENABLE_GOLD=yes
408 *) 386 *)
409 AC_MSG_ERROR([invalid --enable-ld argument]) 387 AC_MSG_ERROR([invalid --enable-ld argument])
410 ;; 388 ;;
411 esac 389 esac
412 390
391 # PR gas/19109
392 # Decide the default method for compressing debug sections.
393 # Provide a configure time option to override our default.
394 AC_ARG_ENABLE(compressed_debug_sections,
395 [AS_HELP_STRING([--enable-compressed-debug-sections={all,gas,gold,ld,none}],
396 [Enable compressed debug sections for gas, gold or ld by
397 default])],
398 [
399 if test x"$enable_compressed_debug_sections" = xyes; then
400 AC_MSG_ERROR([no program with compressed debug sections specified])
401 fi
402 ], [enable_compressed_debug_sections=])
403
413 # Configure extra directories which are host specific 404 # Configure extra directories which are host specific
414 405
415 case "${host}" in 406 case "${host}" in
416 *-cygwin*) 407 *-cygwin*)
417 configdirs="$configdirs libtermcap" ;; 408 configdirs="$configdirs libtermcap" ;;
424 # Remove more programs from consideration, based on the host or 415 # Remove more programs from consideration, based on the host or
425 # target this usually means that a port of the program doesn't 416 # target this usually means that a port of the program doesn't
426 # exist yet. 417 # exist yet.
427 418
428 case "${host}" in 419 case "${host}" in
429 hppa*64*-*-*) 420 i[[3456789]]86-*-msdosdjgpp*)
430 noconfigdirs="$noconfigdirs byacc" 421 noconfigdirs="$noconfigdirs tcl tk itcl"
431 ;;
432 i[[3456789]]86-*-vsta)
433 noconfigdirs="$noconfigdirs tcl expect dejagnu make texinfo bison patch flex byacc send-pr gprof uudecode dejagnu diff guile perl itcl gnuserv gettext"
434 ;;
435 i[[3456789]]86-*-go32* | i[[3456789]]86-*-msdosdjgpp*)
436 noconfigdirs="$noconfigdirs tcl tk expect dejagnu send-pr uudecode guile itcl gnuserv libffi"
437 ;;
438 x86_64-*-mingw*)
439 noconfigdirs="$noconfigdirs expect dejagnu autoconf automake send-pr rcs guile perl texinfo libtool newlib"
440 ;;
441 i[[3456789]]86-*-mingw32*)
442 # noconfigdirs="tcl tk expect dejagnu make texinfo bison patch flex byacc send-pr uudecode dejagnu diff guile perl itcl gnuserv"
443 noconfigdirs="$noconfigdirs expect dejagnu autoconf automake send-pr rcs guile perl texinfo libtool newlib"
444 ;;
445 i[[3456789]]86-*-beos*)
446 noconfigdirs="$noconfigdirs tk itcl libgui gdb"
447 ;;
448 *-*-cygwin*)
449 noconfigdirs="$noconfigdirs autoconf automake send-pr rcs guile perl"
450 ;;
451 *-*-netbsd*)
452 noconfigdirs="$noconfigdirs rcs"
453 ;;
454 ppc*-*-pe)
455 noconfigdirs="$noconfigdirs patch diff make tk tcl expect dejagnu autoconf automake texinfo bison send-pr gprof rcs guile perl itcl gnuserv"
456 ;;
457 powerpc-*-beos*)
458 noconfigdirs="$noconfigdirs tk itcl libgui gdb dejagnu readline"
459 ;; 422 ;;
460 esac 423 esac
461 424
462 425
463 AC_ARG_ENABLE(libquadmath, 426 AC_ARG_ENABLE(libquadmath,
492 AC_ARG_ENABLE(libssp, 455 AC_ARG_ENABLE(libssp,
493 [AS_HELP_STRING([--enable-libssp], [build libssp directory])], 456 [AS_HELP_STRING([--enable-libssp], [build libssp directory])],
494 ENABLE_LIBSSP=$enableval, 457 ENABLE_LIBSSP=$enableval,
495 ENABLE_LIBSSP=yes) 458 ENABLE_LIBSSP=yes)
496 459
497 # Save it here so that, even in case of --enable-libgcj, if the Java 460 AC_ARG_ENABLE(libstdcxx,
498 # front-end isn't enabled, we still get libgcj disabled. 461 AS_HELP_STRING([--disable-libstdcxx],
499 libgcj_saved=$libgcj 462 [do not build libstdc++-v3 directory]),
500 case $enable_libgcj in 463 ENABLE_LIBSTDCXX=$enableval,
501 yes) 464 ENABLE_LIBSTDCXX=default)
502 # If we reset it here, it won't get added to noconfigdirs in the 465 [if test "${ENABLE_LIBSTDCXX}" = "no" ; then
503 # target-specific build rules, so it will be forcibly enabled 466 noconfigdirs="$noconfigdirs target-libstdc++-v3"
504 # (unless the Java language itself isn't enabled). 467 fi]
505 libgcj= 468
506 ;; 469 # If this is accelerator compiler and its target is intelmic we enable
507 no) 470 # target liboffloadmic by default. If this is compiler with offloading
508 # Make sure we get it printed in the list of not supported target libs. 471 # for intelmic we enable host liboffloadmic by default. Otherwise
509 # Don't disable libffi, though, other languages use it. 472 # liboffloadmic is disabled by default.
510 noconfigdirs="$noconfigdirs `echo ${libgcj} | sed -e 's/target-libffi//'`" 473 AC_ARG_ENABLE([liboffloadmic],
511 # Clear libgcj_saved so that even if java is enabled libffi won't be 474 AC_HELP_STRING([[--enable-liboffloadmic[=ARG]]],
512 # built. 475 [build liboffloadmic @<:@ARG={no,host,target}@:>@]),
513 libgcj_saved= 476 [case "$enableval" in
514 ;; 477 no | host | target)
515 esac 478 enable_liboffloadmic=$enableval ;;
516 479 *)
517 480 AC_MSG_ERROR([--enable-liboffloadmic=no/host/target]) ;;
518 # Disable libmudflap on some systems. 481 esac],
519 if test x$enable_libmudflap = x ; then 482 [if test x"$enable_as_accelerator_for" != x; then
520 case "${target}" in 483 case "${target}" in
521 *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu | bfin*-*-uclinux* | *-*-kopensolaris*-gnu) 484 *-intelmic-* | *-intelmicemul-*)
522 # Enable libmudflap by default in GNU and friends. 485 enable_liboffloadmic=target
523 ;; 486 extra_liboffloadmic_configure_flags="--enable-liboffloadmic=target"
524 *-*-freebsd*) 487 ;;
525 # Enable libmudflap by default in FreeBSD.
526 ;;
527 *) 488 *)
528 # Disable it by default everywhere else. 489 enable_liboffloadmic=no
529 noconfigdirs="$noconfigdirs target-libmudflap" 490 ;;
530 ;; 491 esac
492 else
493 case "${enable_offload_targets}" in
494 *-intelmic-* | *-intelmicemul-*)
495 enable_liboffloadmic=host
496 extra_liboffloadmic_configure_flags="--enable-liboffloadmic=host"
497 ;;
498 *)
499 enable_liboffloadmic=no
500 ;;
531 esac 501 esac
532 fi 502 fi])
533 503 AC_SUBST(extra_liboffloadmic_configure_flags)
534 # Disable libgomp on non POSIX hosted systems. 504
505 # Enable libgomp by default on hosted POSIX systems, and a few others.
535 if test x$enable_libgomp = x ; then 506 if test x$enable_libgomp = x ; then
536 # Enable libgomp by default on hosted POSIX systems.
537 case "${target}" in 507 case "${target}" in
538 *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu | *-*-kopensolaris*-gnu) 508 *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu | *-*-kopensolaris*-gnu)
539 ;; 509 ;;
540 *-*-netbsd* | *-*-freebsd* | *-*-openbsd*) 510 *-*-netbsd* | *-*-freebsd* | *-*-openbsd* | *-*-dragonfly*)
541 ;; 511 ;;
542 *-*-solaris2* | *-*-sysv4* | *-*-irix6* | *-*-osf* | *-*-hpux11*) 512 *-*-solaris2* | *-*-hpux11*)
543 ;; 513 ;;
544 *-*-darwin* | *-*-aix*) 514 *-*-darwin* | *-*-aix*)
515 ;;
516 nvptx*-*-*)
545 ;; 517 ;;
546 *) 518 *)
547 noconfigdirs="$noconfigdirs target-libgomp" 519 noconfigdirs="$noconfigdirs target-libgomp"
548 ;; 520 ;;
549 esac 521 esac
550 fi 522 fi
551 523
524 # Disable libatomic on unsupported systems.
525 if test -d ${srcdir}/libatomic; then
526 if test x$enable_libatomic = x; then
527 AC_MSG_CHECKING([for libatomic support])
528 if (srcdir=${srcdir}/libatomic; \
529 . ${srcdir}/configure.tgt; \
530 test -n "$UNSUPPORTED")
531 then
532 AC_MSG_RESULT([no])
533 noconfigdirs="$noconfigdirs target-libatomic"
534 else
535 AC_MSG_RESULT([yes])
536 fi
537 fi
538 fi
539
540 # Disable libcilkrts on unsupported systems.
541 if test -d ${srcdir}/libcilkrts; then
542 if test x$enable_libcilkrts = x; then
543 AC_MSG_CHECKING([for libcilkrts support])
544 if (srcdir=${srcdir}/libcilkrts; \
545 . ${srcdir}/configure.tgt; \
546 test -n "$UNSUPPORTED")
547 then
548 AC_MSG_RESULT([no])
549 noconfigdirs="$noconfigdirs target-libcilkrts"
550 else
551 AC_MSG_RESULT([yes])
552 fi
553 fi
554 fi
555
556 # Disable liboffloadmic on unsupported systems.
557 if test -d ${srcdir}/liboffloadmic; then
558 if test x$enable_liboffloadmic != xno; then
559 AC_MSG_CHECKING([for liboffloadmic support])
560 if (srcdir=${srcdir}/liboffloadmic; \
561 . ${srcdir}/configure.tgt; \
562 test -n "$UNSUPPORTED")
563 then
564 AC_MSG_RESULT([no])
565 noconfigdirs="$noconfigdirs target-liboffloadmic"
566 else
567 AC_MSG_RESULT([yes])
568 fi
569 fi
570 fi
571
572 # Disable libitm on unsupported systems.
573 if test -d ${srcdir}/libitm; then
574 if test x$enable_libitm = x; then
575 AC_MSG_CHECKING([for libitm support])
576 if (srcdir=${srcdir}/libitm; \
577 . ${srcdir}/configure.tgt; \
578 test -n "$UNSUPPORTED")
579 then
580 AC_MSG_RESULT([no])
581 noconfigdirs="$noconfigdirs target-libitm"
582 else
583 AC_MSG_RESULT([yes])
584 fi
585 fi
586 fi
587
588 # Disable libsanitizer on unsupported systems.
589 if test -d ${srcdir}/libsanitizer; then
590 if test x$enable_libsanitizer = x; then
591 AC_MSG_CHECKING([for libsanitizer support])
592 if (srcdir=${srcdir}/libsanitizer; \
593 . ${srcdir}/configure.tgt; \
594 test -n "$UNSUPPORTED")
595 then
596 AC_MSG_RESULT([no])
597 noconfigdirs="$noconfigdirs target-libsanitizer"
598 else
599 AC_MSG_RESULT([yes])
600 fi
601 fi
602 fi
603
604 # Disable libvtv on unsupported systems.
605 if test -d ${srcdir}/libvtv; then
606 if test x$enable_libvtv = x; then
607 AC_MSG_CHECKING([for libvtv support])
608 if (srcdir=${srcdir}/libvtv; \
609 . ${srcdir}/configure.tgt; \
610 test "$VTV_SUPPORTED" != "yes")
611 then
612 AC_MSG_RESULT([no])
613 noconfigdirs="$noconfigdirs target-libvtv"
614 else
615 AC_MSG_RESULT([yes])
616 fi
617 fi
618 fi
619
620
621 # Enable libmpx on supported systems by request.
622 if test -d ${srcdir}/libmpx; then
623 if test x$enable_libmpx = x; then
624 AC_MSG_CHECKING([for libmpx support])
625 if (srcdir=${srcdir}/libmpx; \
626 . ${srcdir}/configure.tgt; \
627 test "$LIBMPX_SUPPORTED" != "yes")
628 then
629 AC_MSG_RESULT([no])
630 noconfigdirs="$noconfigdirs target-libmpx"
631 else
632 AC_MSG_RESULT([yes])
633 fi
634 fi
635 fi
636
637 # Disable libhsail-rt on unsupported systems.
638 if test -d ${srcdir}/libhsail-rt; then
639 if test x$enable_libhsail_rt = x; then
640 AC_MSG_CHECKING([for libhsail-rt support])
641 if (srcdir=${srcdir}/libhsail-rt; \
642 . ${srcdir}/configure.tgt; \
643 test -n "$UNSUPPORTED")
644 then
645 AC_MSG_RESULT([no])
646 unsupported_languages="$unsupported_languages brig"
647 # This implicitly disables also target-libhsail-rt as it won't
648 # get added to the build without BRIG FE.
649 else
650 AC_MSG_RESULT([yes])
651 fi
652 fi
653 fi
654
655
656 # Disable libquadmath for some systems.
657 case "${target}" in
658 avr-*-*)
659 noconfigdirs="$noconfigdirs target-libquadmath"
660 ;;
661 # libquadmath is unused on AIX and libquadmath build process use of
662 # LD_LIBRARY_PATH can break AIX bootstrap.
663 powerpc-*-aix* | rs6000-*-aix*)
664 noconfigdirs="$noconfigdirs target-libquadmath"
665 ;;
666 esac
667
668 # Disable libssp for some systems.
669 case "${target}" in
670 avr-*-*)
671 # No hosted I/O support.
672 noconfigdirs="$noconfigdirs target-libssp"
673 ;;
674 powerpc-*-aix* | rs6000-*-aix*)
675 noconfigdirs="$noconfigdirs target-libssp"
676 ;;
677 rl78-*-*)
678 # libssp uses a misaligned load to trigger a fault, but the RL78
679 # doesn't fault for those - instead, it gives a build-time error
680 # for explicit misaligned loads.
681 noconfigdirs="$noconfigdirs target-libssp"
682 ;;
683 visium-*-*)
684 # No hosted I/O support.
685 noconfigdirs="$noconfigdirs target-libssp"
686 ;;
687 esac
688
689 # Disable libstdc++-v3 for some systems.
690 # Allow user to override this if they pass --enable-libstdc++-v3
691 if test "${ENABLE_LIBSTDCXX}" = "default" ; then
692 case "${target}" in
693 *-*-vxworks*)
694 # VxWorks uses the Dinkumware C++ library.
695 noconfigdirs="$noconfigdirs target-libstdc++-v3"
696 ;;
697 arm*-wince-pe*)
698 # the C++ libraries don't build on top of CE's C libraries
699 noconfigdirs="$noconfigdirs target-libstdc++-v3"
700 ;;
701 avr-*-*)
702 noconfigdirs="$noconfigdirs target-libstdc++-v3"
703 ;;
704 ft32-*-*)
705 noconfigdirs="$noconfigdirs target-libstdc++-v3"
706 ;;
707 esac
708 fi
709
710 # Disable Fortran for some systems.
711 case "${target}" in
712 mmix-*-*)
713 # See <http://gcc.gnu.org/ml/gcc-patches/2004-11/msg00572.html>.
714 unsupported_languages="$unsupported_languages fortran"
715 ;;
716 esac
717
718 # Disable libffi for some systems.
719 case "${target}" in
720 powerpc-*-darwin*)
721 ;;
722 i[[3456789]]86-*-darwin*)
723 ;;
724 x86_64-*-darwin[[912]]*)
725 ;;
726 *-*-darwin*)
727 noconfigdirs="$noconfigdirs target-libffi"
728 ;;
729 *-*-netware*)
730 noconfigdirs="$noconfigdirs target-libffi"
731 ;;
732 *-*-phoenix*)
733 noconfigdirs="$noconfigdirs target-libffi"
734 ;;
735 *-*-rtems*)
736 noconfigdirs="$noconfigdirs target-libffi"
737 ;;
738 *-*-tpf*)
739 noconfigdirs="$noconfigdirs target-libffi"
740 ;;
741 *-*-uclinux*)
742 noconfigdirs="$noconfigdirs target-libffi"
743 ;;
744 *-*-vxworks*)
745 noconfigdirs="$noconfigdirs target-libffi"
746 ;;
747 aarch64*-*-freebsd*)
748 noconfigdirs="$noconfigdirs target-libffi"
749 ;;
750 alpha*-*-*vms*)
751 noconfigdirs="$noconfigdirs target-libffi"
752 ;;
753 arm*-*-freebsd*)
754 noconfigdirs="$noconfigdirs target-libffi"
755 ;;
756 arm-wince-pe)
757 noconfigdirs="$noconfigdirs target-libffi"
758 ;;
759 arm*-*-symbianelf*)
760 noconfigdirs="$noconfigdirs target-libffi"
761 ;;
762 cris-*-* | crisv32-*-*)
763 case "${target}" in
764 *-*-linux*)
765 ;;
766 *) # See PR46792 regarding target-libffi.
767 noconfigdirs="$noconfigdirs target-libffi";;
768 esac
769 ;;
770 hppa*64*-*-hpux*)
771 noconfigdirs="$noconfigdirs target-libffi"
772 ;;
773 hppa*-hp-hpux11*)
774 ;;
775 hppa*-*-hpux*)
776 noconfigdirs="$noconfigdirs target-libffi"
777 ;;
778 ia64*-*-*vms*)
779 noconfigdirs="$noconfigdirs target-libffi"
780 ;;
781 i[[3456789]]86-w64-mingw*)
782 noconfigdirs="$noconfigdirs target-libffi"
783 ;;
784 i[[3456789]]86-*-mingw*)
785 noconfigdirs="$noconfigdirs target-libffi"
786 ;;
787 x86_64-*-mingw*)
788 noconfigdirs="$noconfigdirs target-libffi"
789 ;;
790 mmix-*-*)
791 noconfigdirs="$noconfigdirs target-libffi"
792 ;;
793 powerpc-*-aix*)
794 ;;
795 rs6000-*-aix*)
796 ;;
797 ft32-*-*)
798 noconfigdirs="$noconfigdirs target-libffi"
799 ;;
800 *-*-lynxos*)
801 noconfigdirs="$noconfigdirs target-libffi"
802 ;;
803 esac
804
805 # Disable the go frontend on systems where it is known to not work. Please keep
806 # this in sync with contrib/config-list.mk.
807 case "${target}" in
808 *-*-darwin* | *-*-cygwin* | *-*-mingw*)
809 unsupported_languages="$unsupported_languages go"
810 ;;
811 esac
812
813 # Disable libgo for some systems where it is known to not work.
814 # For testing, you can easily override this with --enable-libgo.
815 if test x$enable_libgo = x; then
816 case "${target}" in
817 *-*-darwin*)
818 # PR 46986
819 noconfigdirs="$noconfigdirs target-libgo"
820 ;;
821 *-*-cygwin* | *-*-mingw*)
822 noconfigdirs="$noconfigdirs target-libgo"
823 ;;
824 esac
825 fi
826
552 # Default libgloss CPU subdirectory. 827 # Default libgloss CPU subdirectory.
553 libgloss_dir="$target_cpu" 828 libgloss_dir="$target_cpu"
554 829
555 case "${target}" in 830 case "${target}" in
556 *-*-chorusos) 831 sh*-*-pe|mips*-*-pe|*arm-wince-pe)
557 noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}" 832 libgloss_dir=wince
558 ;; 833 ;;
559 powerpc-*-darwin*) 834 aarch64*-*-* )
560 noconfigdirs="$noconfigdirs ld gas gdb gprof" 835 libgloss_dir=aarch64
561 noconfigdirs="$noconfigdirs sim target-rda" 836 ;;
562 ;; 837 arm*-*-*)
563 i[[3456789]]86-*-darwin*) 838 libgloss_dir=arm
564 noconfigdirs="$noconfigdirs ld gprof" 839 ;;
565 noconfigdirs="$noconfigdirs sim target-rda" 840 cris-*-* | crisv32-*-*)
566 ;; 841 libgloss_dir=cris
567 x86_64-*-darwin[[912]]*) 842 ;;
568 noconfigdirs="$noconfigdirs ld gas gprof" 843 hppa*-*-*)
569 noconfigdirs="$noconfigdirs sim target-rda" 844 libgloss_dir=pa
570 ;; 845 ;;
571 *-*-darwin*) 846 i[[3456789]]86-*-*)
572 noconfigdirs="$noconfigdirs ld gas gdb gprof" 847 libgloss_dir=i386
573 noconfigdirs="$noconfigdirs sim target-rda" 848 ;;
574 noconfigdirs="$noconfigdirs ${libgcj}" 849 m68hc11-*-*|m6811-*-*|m68hc12-*-*|m6812-*-*)
575 ;; 850 libgloss_dir=m68hc11
576 *-*-freebsd[[12]] | *-*-freebsd[[12]].* | *-*-freebsd*aout*) 851 ;;
577 noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}" 852 m68*-*-* | fido-*-*)
578 ;; 853 libgloss_dir=m68k
579 *-*-freebsd*) 854 ;;
855 mips*-*-*)
856 libgloss_dir=mips
857 ;;
858 powerpc*-*-*)
859 libgloss_dir=rs6000
860 ;;
861 sparc*-*-*)
862 libgloss_dir=sparc
863 ;;
864 esac
865
866 # Disable newlib and libgloss for various target OSes.
867 case "${target}" in
868 alpha*-dec-osf*)
580 noconfigdirs="$noconfigdirs target-newlib target-libgloss" 869 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
581 if test "x$with_gmp" = x && test "x$with_gmp_dir" = x \
582 && test -f /usr/local/include/gmp.h; then
583 with_gmp=/usr/local
584 fi
585
586 # Skip some stuff that's unsupported on some FreeBSD configurations.
587 case "${target}" in
588 i*86-*-*) ;;
589 alpha*-*-*) ;;
590 x86_64-*-*) ;;
591 *)
592 noconfigdirs="$noconfigdirs ${libgcj}"
593 ;;
594 esac
595 ;;
596 *-*-kaos*)
597 # Remove unsupported stuff on all kaOS configurations.
598 skipdirs="target-libiberty ${libgcj} target-libstdc++-v3 target-librx"
599 skipdirs="$skipdirs target-libobjc target-examples target-groff target-gperf"
600 skipdirs="$skipdirs zlib fastjar target-libjava target-boehm-gc target-zlib"
601 noconfigdirs="$noconfigdirs target-libgloss"
602 ;;
603 *-*-netbsd*)
604 # Skip some stuff on all NetBSD configurations.
605 noconfigdirs="$noconfigdirs target-newlib target-libiberty target-libgloss"
606
607 # Skip some stuff that's unsupported on some NetBSD configurations.
608 case "${target}" in
609 i*86-*-netbsdelf*) ;;
610 arm*-*-netbsdelf*) ;;
611 *)
612 noconfigdirs="$noconfigdirs ${libgcj}"
613 ;;
614 esac
615 ;;
616 *-*-netware*)
617 noconfigdirs="$noconfigdirs target-newlib target-libiberty target-libgloss ${libgcj} target-libmudflap"
618 ;;
619 *-*-rtems*)
620 skipdirs="${skipdirs} target-libiberty"
621 noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
622 ;;
623 # The tpf target doesn't support gdb yet.
624 *-*-tpf*)
625 noconfigdirs="$noconfigdirs target-newlib target-libgloss target-libiberty ${libgcj} target-libmudflap gdb tcl tk libgui itcl"
626 ;;
627 *-*-uclinux*)
628 noconfigdirs="$noconfigdirs target-newlib target-libgloss target-rda ${libgcj}"
629 ;;
630 *-*-vxworks*)
631 noconfigdirs="$noconfigdirs target-newlib target-libgloss target-libiberty target-libstdc++-v3 ${libgcj}"
632 ;;
633 alpha*-dec-osf*)
634 # ld works, but does not support shared libraries.
635 # newlib is not 64 bit ready. I'm not sure about fileutils.
636 # gas doesn't generate exception information.
637 noconfigdirs="$noconfigdirs gas ld fileutils target-newlib target-libgloss"
638 ;;
639 alpha*-*-*vms*)
640 noconfigdirs="$noconfigdirs gdb target-newlib target-libgloss ${libgcj}"
641 ;;
642 alpha*-*-linux*)
643 # newlib is not 64 bit ready
644 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
645 ;;
646 alpha*-*-*)
647 # newlib is not 64 bit ready
648 noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}"
649 ;;
650 am33_2.0-*-linux*)
651 noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss"
652 ;;
653 sh-*-linux*)
654 noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss"
655 ;;
656 sh*-*-pe|mips*-*-pe|*arm-wince-pe)
657 noconfigdirs="$noconfigdirs ${libgcj}"
658 noconfigdirs="$noconfigdirs target-examples"
659 noconfigdirs="$noconfigdirs target-libiberty texinfo send-pr"
660 noconfigdirs="$noconfigdirs tcl tk itcl libgui sim"
661 noconfigdirs="$noconfigdirs expect dejagnu"
662 # the C++ libraries don't build on top of CE's C libraries
663 noconfigdirs="$noconfigdirs target-libstdc++-v3"
664 noconfigdirs="$noconfigdirs target-newlib"
665 case "${host}" in
666 *-*-cygwin*) ;; # keep gdb and readline
667 *) noconfigdirs="$noconfigdirs gdb readline"
668 ;;
669 esac
670 libgloss_dir=wince
671 ;;
672 arc-*-*)
673 noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
674 ;;
675 arm-semi-aof )
676 ;;
677 arm-*-coff | strongarm-*-coff | xscale-*-coff)
678 noconfigdirs="$noconfigdirs ${libgcj}"
679 libgloss_dir=arm
680 ;;
681 arm-*-elf* | strongarm-*-elf* | xscale-*-elf* | arm*-*-eabi* )
682 noconfigdirs="$noconfigdirs target-libffi target-qthreads"
683 libgloss_dir=arm
684 ;;
685 arm*-*-linux-gnueabi)
686 noconfigdirs="$noconfigdirs target-qthreads"
687 case ${with_newlib} in
688 no) noconfigdirs="$noconfigdirs target-newlib target-libgloss"
689 esac
690 libgloss_dir=arm
691 ;;
692 arm*-*-symbianelf*)
693 noconfigdirs="$noconfigdirs ${libgcj} target-libiberty"
694 libgloss_dir=arm
695 ;;
696 arm-*-pe*)
697 noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
698 ;;
699 thumb-*-coff)
700 noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
701 ;;
702 thumb-*-elf)
703 noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
704 ;;
705 thumb-*-pe)
706 noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
707 ;;
708 arm-*-riscix*)
709 noconfigdirs="$noconfigdirs ld target-libgloss ${libgcj}"
710 ;;
711 avr-*-*)
712 noconfigdirs="$noconfigdirs target-libiberty target-libstdc++-v3 ${libgcj} target-libssp"
713 ;;
714 bfin-*-*)
715 unsupported_languages="$unsupported_languages java"
716 noconfigdirs="$noconfigdirs target-boehm-gc"
717 if test x${is_cross_compiler} != xno ; then
718 target_configdirs="${target_configdirs} target-bsp target-cygmon"
719 fi
720 ;;
721 c4x-*-* | tic4x-*-*)
722 noconfigdirs="$noconfigdirs target-libstdc++-v3 target-libgloss ${libgcj}"
723 ;;
724 c54x*-*-* | tic54x-*-*)
725 noconfigdirs="$noconfigdirs target-libstdc++-v3 target-libgloss ${libgcj} gcc gdb newlib"
726 ;;
727 cr16-*-*)
728 noconfigdirs="$noconfigdirs ${libgcj} gdb"
729 ;;
730 cris-*-* | crisv32-*-*)
731 unsupported_languages="$unsupported_languages java"
732 case "${target}" in
733 *-*-aout)
734 unsupported_languages="$unsupported_languages fortran"
735 noconfigdirs="$noconfigdirs target-libffi target-boehm-gc";;
736 *-*-elf) # See PR46792 regarding target-libffi.
737 noconfigdirs="$noconfigdirs target-libffi target-boehm-gc";;
738 *-*-linux*)
739 noconfigdirs="$noconfigdirs target-newlib target-libgloss";;
740 *)
741 unsupported_languages="$unsupported_languages fortran"
742 noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss";;
743 esac
744 libgloss_dir=cris
745 ;;
746 crx-*-*)
747 noconfigdirs="$noconfigdirs target-libstdc++-v3 target-mudflap ${libgcj}"
748 ;;
749 d10v-*-*)
750 noconfigdirs="$noconfigdirs target-libstdc++-v3 target-libgloss ${libgcj}"
751 ;;
752 d30v-*-*)
753 noconfigdirs="$noconfigdirs ${libgcj} gdb"
754 ;;
755 ep9312-*-elf | ep9312-*-coff)
756 libgloss_dir=arm
757 ;;
758 fr30-*-elf*)
759 noconfigdirs="$noconfigdirs ${libgcj} gdb"
760 ;;
761 frv-*-*)
762 noconfigdirs="$noconfigdirs ${libgcj}"
763 ;;
764 moxie-*-*)
765 noconfigdirs="$noconfigdirs ${libgcj}"
766 noconfigdirs="$noconfigdirs gprof"
767 ;;
768 h8300*-*-*)
769 noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
770 ;;
771 h8500-*-*)
772 noconfigdirs="$noconfigdirs target-libstdc++-v3 target-libgloss ${libgcj}"
773 ;;
774 hppa1.1-*-osf* | hppa1.1-*-bsd* )
775 ;;
776 hppa*64*-*-linux* | parisc*64*-*-linux*)
777 # In this case, it's because the hppa64-linux target is for
778 # the kernel only at this point and has no libc, and thus no
779 # headers, crt*.o, etc., all of which are needed by these.
780 noconfigdirs="$noconfigdirs target-zlib"
781 ;;
782 parisc*-*-linux* | hppa*-*-linux*)
783 ;;
784 hppa*-*-*elf* | \
785 hppa*-*-lites* | \
786 hppa*-*-openbsd* | \
787 hppa*64*-*-*)
788 noconfigdirs="$noconfigdirs ${libgcj}"
789 ;;
790 hppa*-hp-hpux11*)
791 noconfigdirs="$noconfigdirs ld shellutils"
792 ;;
793 hppa*-*-pro*)
794 libgloss_dir=pa
795 ;;
796 hppa*-*-*)
797 # According to Alexandre Oliva <aoliva@redhat.com>, libjava won't
798 # build on HP-UX 10.20.
799 noconfigdirs="$noconfigdirs ld shellutils ${libgcj}"
800 ;;
801 i960-*-*)
802 noconfigdirs="$noconfigdirs ${libgcj} gdb"
803 ;;
804 ia64*-*-elf*)
805 # No gdb support yet.
806 noconfigdirs="$noconfigdirs readline mmalloc libgui itcl gdb"
807 ;;
808 ia64*-**-hpux*)
809 # No ld support yet.
810 noconfigdirs="$noconfigdirs ${libgcj} libgui itcl ld"
811 ;;
812 ia64*-*-*vms*)
813 # No gdb or ld support yet.
814 noconfigdirs="$noconfigdirs ${libgcj} tix readline mmalloc libgui itcl gdb ld"
815 ;;
816 i370-*-opened*)
817 ;;
818 i[[3456789]]86-*-coff | i[[3456789]]86-*-elf)
819 noconfigdirs="$noconfigdirs ${libgcj}"
820 libgloss_dir=i386
821 ;; 870 ;;
822 i[[3456789]]86-*-linux*) 871 i[[3456789]]86-*-linux*)
823 # The GCC port for glibc1 has no MD_FALLBACK_FRAME_STATE_FOR, so let's
824 # not build java stuff by default.
825 case "${target}" in
826 *-*-*libc1*)
827 noconfigdirs="$noconfigdirs ${libgcj}";;
828 esac
829
830 # This section makes it possible to build newlib natively on linux. 872 # This section makes it possible to build newlib natively on linux.
831 # If we are using a cross compiler then don't configure newlib. 873 # If we are using a cross compiler then don't configure newlib.
832 if test x${is_cross_compiler} != xno ; then 874 if test x${is_cross_compiler} != xno ; then
833 noconfigdirs="$noconfigdirs target-newlib" 875 noconfigdirs="$noconfigdirs target-newlib"
834 fi 876 fi
836 # If we are not using a cross compiler, do configure newlib. 878 # If we are not using a cross compiler, do configure newlib.
837 # Note however, that newlib will only be configured in this situation 879 # Note however, that newlib will only be configured in this situation
838 # if the --with-newlib option has been given, because otherwise 880 # if the --with-newlib option has been given, because otherwise
839 # 'target-newlib' will appear in skipdirs. 881 # 'target-newlib' will appear in skipdirs.
840 ;; 882 ;;
883 i[[3456789]]86-*-rdos*)
884 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
885 ;;
886 sh*-*-pe|mips*-*-pe|arm-wince-pe)
887 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
888 ;;
889 sparc-*-sunos4*)
890 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
891 ;;
892 *-*-aix*)
893 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
894 ;;
895 *-*-beos*)
896 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
897 ;;
898 *-*-chorusos)
899 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
900 ;;
901 *-*-dragonfly*)
902 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
903 ;;
904 *-*-freebsd*)
905 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
906 ;;
907 *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu | *-*-kopensolaris*-gnu)
908 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
909 ;;
910 *-*-lynxos*)
911 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
912 ;;
913 *-*-mingw*)
914 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
915 ;;
916 *-*-netbsd*)
917 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
918 ;;
919 *-*-netware*)
920 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
921 ;;
922 *-*-tpf*)
923 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
924 ;;
925 *-*-uclinux*)
926 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
927 ;;
928 *-*-vxworks*)
929 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
930 ;;
931 esac
932
933 case "${target}" in
934 *-*-chorusos)
935 ;;
936 aarch64-*-darwin*)
937 noconfigdirs="$noconfigdirs ld gas gdb gprof"
938 noconfigdirs="$noconfigdirs sim target-rda"
939 ;;
940 arm-*-darwin*)
941 noconfigdirs="$noconfigdirs ld gas gdb gprof"
942 noconfigdirs="$noconfigdirs sim target-rda"
943 ;;
944 powerpc-*-darwin*)
945 noconfigdirs="$noconfigdirs ld gas gdb gprof"
946 noconfigdirs="$noconfigdirs sim target-rda"
947 ;;
948 i[[3456789]]86-*-darwin*)
949 noconfigdirs="$noconfigdirs ld gprof"
950 noconfigdirs="$noconfigdirs sim target-rda"
951 ;;
952 x86_64-*-darwin[[912]]*)
953 noconfigdirs="$noconfigdirs ld gas gprof"
954 noconfigdirs="$noconfigdirs sim target-rda"
955 ;;
956 *-*-darwin*)
957 noconfigdirs="$noconfigdirs ld gas gdb gprof"
958 noconfigdirs="$noconfigdirs sim target-rda"
959 ;;
960 *-*-dragonfly*)
961 ;;
962 *-*-freebsd*)
963 if test "x$with_gmp" = x && test "x$with_gmp_dir" = x \
964 && test -f /usr/local/include/gmp.h; then
965 with_gmp=/usr/local
966 fi
967 ;;
968 *-*-kaos*)
969 # Remove unsupported stuff on all kaOS configurations.
970 noconfigdirs="$noconfigdirs target-libgloss"
971 ;;
972 *-*-netbsd*)
973 ;;
974 *-*-netware*)
975 ;;
976 *-*-phoenix*)
977 noconfigdirs="$noconfigdirs target-libgloss"
978 ;;
979 *-*-rtems*)
980 noconfigdirs="$noconfigdirs target-libgloss"
981 # this is not caught below because this stanza matches earlier
982 case $target in
983 or1k*-*-*) noconfigdirs="$noconfigdirs gdb" ;;
984 esac
985 ;;
986 # The tpf target doesn't support gdb yet.
987 *-*-tpf*)
988 noconfigdirs="$noconfigdirs gdb tcl tk libgui itcl"
989 ;;
990 *-*-uclinux*)
991 noconfigdirs="$noconfigdirs target-rda"
992 ;;
993 *-*-vxworks*)
994 ;;
995 alpha*-dec-osf*)
996 # ld works, but does not support shared libraries.
997 # gas doesn't generate exception information.
998 noconfigdirs="$noconfigdirs gas ld"
999 ;;
1000 alpha*-*-*vms*)
1001 noconfigdirs="$noconfigdirs gdb target-newlib target-libgloss"
1002 ;;
1003 alpha*-*-*)
1004 # newlib is not 64 bit ready
1005 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
1006 ;;
1007 sh*-*-pe|mips*-*-pe|*arm-wince-pe)
1008 noconfigdirs="$noconfigdirs tcl tk itcl libgui sim"
1009 ;;
1010 arc*-*-*)
1011 noconfigdirs="$noconfigdirs sim"
1012 ;;
1013 arm-*-pe*)
1014 noconfigdirs="$noconfigdirs target-libgloss"
1015 ;;
1016 arm-*-riscix*)
1017 noconfigdirs="$noconfigdirs ld target-libgloss"
1018 ;;
1019 avr-*-*)
1020 if test x${with_avrlibc} != xno; then
1021 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
1022 fi
1023 ;;
1024 c4x-*-* | tic4x-*-*)
1025 noconfigdirs="$noconfigdirs target-libgloss"
1026 ;;
1027 tic54x-*-*)
1028 noconfigdirs="$noconfigdirs target-libgloss gdb"
1029 ;;
1030 d10v-*-*)
1031 noconfigdirs="$noconfigdirs target-libgloss"
1032 ;;
1033 d30v-*-*)
1034 noconfigdirs="$noconfigdirs gdb"
1035 ;;
1036 fr30-*-elf*)
1037 noconfigdirs="$noconfigdirs gdb"
1038 ;;
1039 ft32-*-*)
1040 noconfigdirs="$noconfigdirs target-rda gprof"
1041 ;;
1042 moxie-*-*)
1043 noconfigdirs="$noconfigdirs"
1044 ;;
1045 h8300*-*-*)
1046 noconfigdirs="$noconfigdirs target-libgloss"
1047 ;;
1048 h8500-*-*)
1049 noconfigdirs="$noconfigdirs target-libgloss"
1050 ;;
1051 hppa1.1-*-osf* | hppa1.1-*-bsd* )
1052 ;;
1053 hppa*64*-*-hpux*)
1054 noconfigdirs="$noconfigdirs gdb"
1055 ;;
1056 hppa*-*-hpux11*)
1057 noconfigdirs="$noconfigdirs gdb ld"
1058 ;;
1059 hppa*64*-*-linux*)
1060 ;;
1061 hppa*-*-linux*)
1062 ;;
1063 hppa*-*-*elf* | \
1064 hppa*-*-lites* | \
1065 hppa*-*-openbsd* | \
1066 hppa*64*-*-*)
1067 ;;
1068 hppa*-*-pro*)
1069 ;;
1070 hppa*-*-*)
1071 noconfigdirs="$noconfigdirs ld"
1072 ;;
1073 i960-*-*)
1074 noconfigdirs="$noconfigdirs gdb"
1075 ;;
1076 ia64*-*-elf*)
1077 # No gdb support yet.
1078 noconfigdirs="$noconfigdirs readline libgui itcl gdb"
1079 ;;
1080 ia64*-**-hpux*)
1081 # No ld support yet.
1082 noconfigdirs="$noconfigdirs gdb libgui itcl ld"
1083 ;;
1084 ia64*-*-*vms*)
1085 # No ld support yet.
1086 noconfigdirs="$noconfigdirs libgui itcl ld"
1087 ;;
841 i[[3456789]]86-w64-mingw*) 1088 i[[3456789]]86-w64-mingw*)
842 noconfigdirs="$noconfigdirs expect target-libgloss target-newlib ${libgcj}"
843 ;; 1089 ;;
844 i[[3456789]]86-*-mingw*) 1090 i[[3456789]]86-*-mingw*)
845 target_configdirs="$target_configdirs target-winsup" 1091 target_configdirs="$target_configdirs target-winsup"
846 noconfigdirs="$noconfigdirs expect target-libgloss target-newlib ${libgcj}"
847 ;;
848 x86_64-*-mingw*)
849 noconfigdirs="$noconfigdirs expect target-libgloss target-newlib ${libgcj}"
850 ;; 1092 ;;
851 *-*-cygwin*) 1093 *-*-cygwin*)
852 target_configdirs="$target_configdirs target-libtermcap target-winsup" 1094 target_configdirs="$target_configdirs target-libtermcap target-winsup"
853 noconfigdirs="$noconfigdirs target-gperf target-libgloss" 1095 noconfigdirs="$noconfigdirs target-libgloss"
854 # always build newlib if winsup directory is present. 1096 # always build newlib if winsup directory is present.
855 if test -d "$srcdir/winsup/cygwin"; then 1097 if test -d "$srcdir/winsup/cygwin"; then
856 skipdirs=`echo " ${skipdirs} " | sed -e 's/ target-newlib / /'` 1098 skipdirs=`echo " ${skipdirs} " | sed -e 's/ target-newlib / /'`
857 elif test -d "$srcdir/newlib"; then 1099 elif test -d "$srcdir/newlib"; then
858 echo "Warning: winsup/cygwin is missing so newlib can't be built." 1100 echo "Warning: winsup/cygwin is missing so newlib can't be built."
859 fi 1101 fi
860 ;; 1102 ;;
861 i[[3456789]]86-moss-msdos | i[[3456789]]86-*-moss* | \
862 i[[3456789]]86-*-uwin* | i[[3456789]]86-*-interix* )
863 ;;
864 i[[3456789]]86-*-pe) 1103 i[[3456789]]86-*-pe)
865 noconfigdirs="$noconfigdirs target-libstdc++-v3 target-libgloss ${libgcj}" 1104 noconfigdirs="$noconfigdirs target-libgloss"
866 ;; 1105 ;;
867 i[[3456789]]86-*-sco3.2v5*) 1106 i[[3456789]]86-*-sco3.2v5*)
868 # The linker does not yet know about weak symbols in COFF, 1107 # The linker does not yet know about weak symbols in COFF,
869 # and is not configured to handle mixed ELF and COFF. 1108 # and is not configured to handle mixed ELF and COFF.
870 noconfigdirs="$noconfigdirs ld target-libgloss ${libgcj}" 1109 noconfigdirs="$noconfigdirs ld target-libgloss"
871 ;; 1110 ;;
872 i[[3456789]]86-*-sco*) 1111 i[[3456789]]86-*-sco*)
873 noconfigdirs="$noconfigdirs gprof target-libgloss ${libgcj}" 1112 noconfigdirs="$noconfigdirs gprof target-libgloss"
874 ;; 1113 ;;
875 i[[3456789]]86-*-solaris2*) 1114 i[[3456789]]86-*-solaris2* | x86_64-*-solaris2.1[[0-9]]*)
876 noconfigdirs="$noconfigdirs target-libgloss" 1115 noconfigdirs="$noconfigdirs target-libgloss"
877 ;; 1116 ;;
878 i[[3456789]]86-*-sysv4*) 1117 i[[3456789]]86-*-sysv4*)
879 noconfigdirs="$noconfigdirs target-libgloss ${libgcj}" 1118 noconfigdirs="$noconfigdirs target-libgloss"
880 ;; 1119 ;;
881 i[[3456789]]86-*-beos*) 1120 i[[3456789]]86-*-beos*)
882 noconfigdirs="$noconfigdirs gdb target-newlib target-libgloss ${libgcj}" 1121 noconfigdirs="$noconfigdirs gdb"
883 ;; 1122 ;;
884 i[[3456789]]86-*-rdos*) 1123 i[[3456789]]86-*-rdos*)
885 noconfigdirs="$noconfigdirs gdb target-newlib target-libgloss" 1124 noconfigdirs="$noconfigdirs gdb"
886 ;;
887 m32r-*-*)
888 noconfigdirs="$noconfigdirs ${libgcj}"
889 ;;
890 m68hc11-*-*|m6811-*-*|m68hc12-*-*|m6812-*-*)
891 noconfigdirs="$noconfigdirs target-libiberty target-libstdc++-v3 ${libgcj}"
892 libgloss_dir=m68hc11
893 ;;
894 m68k-*-elf*)
895 noconfigdirs="$noconfigdirs ${libgcj}"
896 ;;
897 m68k-*-coff*)
898 noconfigdirs="$noconfigdirs ${libgcj}"
899 ;;
900 m68*-*-* | fido-*-*)
901 libgloss_dir=m68k
902 ;;
903 mcore-*-pe*)
904 # The EPOC C++ environment does not support exceptions or rtti,
905 # and so building libstdc++-v3 tends not to always work.
906 noconfigdirs="$noconfigdirs target-libstdc++-v3"
907 ;; 1125 ;;
908 mmix-*-*) 1126 mmix-*-*)
909 noconfigdirs="$noconfigdirs target-libffi target-boehm-gc gdb libgloss" 1127 noconfigdirs="$noconfigdirs gdb"
910 unsupported_languages="$unsupported_languages fortran java"
911 ;;
912 mn10200-*-*)
913 noconfigdirs="$noconfigdirs ${libgcj}"
914 ;;
915 mn10300-*-*)
916 noconfigdirs="$noconfigdirs ${libgcj}"
917 ;; 1128 ;;
918 mt-*-*) 1129 mt-*-*)
919 noconfigdirs="$noconfigdirs sim" 1130 noconfigdirs="$noconfigdirs sim"
920 ;; 1131 ;;
921 picochip-*-*)
922 noconfigdirs="$noconfigdirs target-libiberty"
923 ;;
924 powerpc-*-aix*) 1132 powerpc-*-aix*)
925 # copied from rs6000-*-* entry 1133 # copied from rs6000-*-* entry
926 noconfigdirs="$noconfigdirs gprof target-libgloss target-libssp target-newlib ${libgcj}" 1134 noconfigdirs="$noconfigdirs gprof"
927 ;; 1135 ;;
928 powerpc*-*-winnt* | powerpc*-*-pe* | ppc*-*-pe) 1136 powerpc*-*-winnt* | powerpc*-*-pe*)
929 target_configdirs="$target_configdirs target-winsup" 1137 target_configdirs="$target_configdirs target-winsup"
930 noconfigdirs="$noconfigdirs gdb tcl tk make expect target-libgloss itcl gnuserv ${libgcj}" 1138 noconfigdirs="$noconfigdirs gdb tcl tk target-libgloss itcl"
931 # always build newlib. 1139 # always build newlib.
932 skipdirs=`echo " ${skipdirs} " | sed -e 's/ target-newlib / /'` 1140 skipdirs=`echo " ${skipdirs} " | sed -e 's/ target-newlib / /'`
933 ;; 1141 ;;
934 # This is temporary until we can link against shared libraries 1142 # This is temporary until we can link against shared libraries
935 powerpcle-*-solaris*) 1143 powerpcle-*-solaris*)
936 noconfigdirs="$noconfigdirs gdb sim make tcl tk expect itcl gnuserv ${libgcj}" 1144 noconfigdirs="$noconfigdirs gdb sim tcl tk itcl"
937 libgloss_dir=rs6000
938 ;; 1145 ;;
939 powerpc-*-beos*) 1146 powerpc-*-beos*)
940 noconfigdirs="$noconfigdirs gdb target-newlib target-libgloss ${libgcj}" 1147 noconfigdirs="$noconfigdirs gdb"
941 ;;
942 powerpc-*-eabi)
943 noconfigdirs="$noconfigdirs ${libgcj}"
944 libgloss_dir=rs6000
945 ;;
946 powerpc-*-eabi* | powerpcle-*-eabi* | powerpc-*-rtems* )
947 libgloss_dir=rs6000
948 ;; 1148 ;;
949 rs6000-*-lynxos*) 1149 rs6000-*-lynxos*)
950 noconfigdirs="$noconfigdirs target-newlib gprof ${libgcj}" 1150 noconfigdirs="$noconfigdirs gprof"
951 ;; 1151 ;;
952 rs6000-*-aix*) 1152 rs6000-*-aix*)
953 noconfigdirs="$noconfigdirs gprof target-libgloss target-libssp target-newlib ${libgcj}" 1153 noconfigdirs="$noconfigdirs gprof"
954 ;; 1154 ;;
955 rs6000-*-*) 1155 rs6000-*-*)
956 noconfigdirs="$noconfigdirs gprof ${libgcj}" 1156 noconfigdirs="$noconfigdirs gprof"
957 ;; 1157 ;;
958 m68k-apollo-*) 1158 m68k-apollo-*)
959 noconfigdirs="$noconfigdirs ld binutils gprof target-libgloss ${libgcj}" 1159 noconfigdirs="$noconfigdirs ld binutils gprof target-libgloss"
960 ;; 1160 ;;
961 microblaze*) 1161 microblaze*)
962 noconfigdirs="$noconfigdirs gprof target-libssp ${libgcj}" 1162 noconfigdirs="$noconfigdirs gprof"
963 ;; 1163 ;;
964 mips*-sde-elf*) 1164 mips*-sde-elf* | mips*-mti-elf* | mips*-img-elf*)
965 skipdirs="$skipdirs target-libiberty"
966 noconfigdirs="$noconfigdirs ${libgcj}"
967 if test x$with_newlib = xyes; then 1165 if test x$with_newlib = xyes; then
968 noconfigdirs="$noconfigdirs gprof" 1166 noconfigdirs="$noconfigdirs gprof"
969 fi 1167 fi
970 libgloss_dir=mips
971 ;; 1168 ;;
972 mips*-*-irix5*) 1169 mips*-*-irix5*)
973 noconfigdirs="$noconfigdirs gprof target-libgloss ${libgcj}" 1170 noconfigdirs="$noconfigdirs gprof target-libgloss"
974 ;; 1171 ;;
975 mips*-*-irix6*) 1172 mips*-*-irix6*)
976 # Linking libjava exceeds command-line length limits on at least 1173 noconfigdirs="$noconfigdirs gprof target-libgloss"
977 # IRIX 6.2, but not on IRIX 6.5.
978 # Also, boehm-gc won't build on IRIX 6.5, according to Jeffrey Oldham
979 # <oldham@codesourcery.com>
980 noconfigdirs="$noconfigdirs gprof target-libgloss ${libgcj}"
981 ;; 1174 ;;
982 mips*-*-bsd*) 1175 mips*-*-bsd*)
983 noconfigdirs="$noconfigdirs gprof target-libgloss ${libgcj}" 1176 noconfigdirs="$noconfigdirs ld gas gprof target-libgloss"
984 ;; 1177 ;;
985 mips*-*-linux*) 1178 mips*-*-linux*)
986 noconfigdirs="$noconfigdirs target-newlib target-libgloss" 1179 ;;
1180 mips*-*-ultrix* | mips*-*-osf* | mips*-*-ecoff* | mips*-*-pe* \
1181 | mips*-*-irix* | mips*-*-lnews* | mips*-*-riscos*)
1182 noconfigdirs="$noconfigdirs ld gas gprof"
987 ;; 1183 ;;
988 mips*-*-*) 1184 mips*-*-*)
989 noconfigdirs="$noconfigdirs gprof ${libgcj}" 1185 noconfigdirs="$noconfigdirs gprof"
990 libgloss_dir=mips 1186 ;;
991 ;; 1187 nvptx*-*-*)
992 romp-*-*) 1188 noconfigdirs="$noconfigdirs target-libssp target-libstdc++-v3 target-libobjc"
993 noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes target-libgloss ${libgcj}" 1189 ;;
994 ;; 1190 or1k*-*-*)
995 sh-*-* | sh64-*-*) 1191 noconfigdirs="$noconfigdirs gdb"
996 case "${host}" in 1192 ;;
997 i[[3456789]]86-*-vsta) ;; # don't add gprof back in 1193 sh-*-*)
998 i[[3456789]]86-*-go32*) ;; # don't add gprof back in
999 i[[3456789]]86-*-msdosdjgpp*) ;; # don't add gprof back in
1000 *) skipdirs=`echo " ${skipdirs} " | sed -e 's/ gprof / /'` ;;
1001 esac
1002 case "${target}" in 1194 case "${target}" in
1003 sh*-*-elf) 1195 sh*-*-elf)
1004 noconfigdirs="$noconfigdirs ${libgcj}" ;; 1196 ;;
1005 *) 1197 *)
1006 noconfigdirs="$noconfigdirs target-libgloss ${libgcj}" ;; 1198 noconfigdirs="$noconfigdirs target-libgloss" ;;
1007 esac 1199 esac
1008 ;; 1200 ;;
1009 sparclet-*-aout* | sparc86x-*-*)
1010 libgloss_dir=sparc
1011 ;;
1012 sparc-*-elf*)
1013 noconfigdirs="$noconfigdirs ${libgcj}"
1014 ;;
1015 sparc64-*-elf*)
1016 noconfigdirs="$noconfigdirs ${libgcj}"
1017 libgloss_dir=sparc
1018 ;;
1019 sparclite-*-*)
1020 noconfigdirs="$noconfigdirs ${libgcj}"
1021 libgloss_dir=sparc
1022 ;;
1023 sparc-*-sunos4*) 1201 sparc-*-sunos4*)
1024 noconfigdirs="$noconfigdirs ${libgcj}" 1202 if test x${is_cross_compiler} = xno ; then
1025 if test x${is_cross_compiler} != xno ; then
1026 noconfigdirs="$noconfigdirs gdb target-newlib target-libgloss"
1027 else
1028 use_gnu_ld=no 1203 use_gnu_ld=no
1029 fi 1204 fi
1030 ;; 1205 ;;
1031 sparc-*-solaris2.[[0-6]] | sparc-*-solaris2.[[0-6]].*)
1032 noconfigdirs="$noconfigdirs ${libgcj}"
1033 ;;
1034 sparc-*-solaris* | sparc64-*-solaris* | sparcv9-*-solaris*)
1035 ;;
1036 tic6x-*-*) 1206 tic6x-*-*)
1037 noconfigdirs="$noconfigdirs gdb sim ${libgcj}" 1207 noconfigdirs="$noconfigdirs sim"
1208 ;;
1209 tilepro*-*-* | tilegx*-*-*)
1210 noconfigdirs="$noconfigdirs sim"
1038 ;; 1211 ;;
1039 v810-*-*) 1212 v810-*-*)
1040 noconfigdirs="$noconfigdirs bfd binutils gas gcc gdb ld target-libstdc++-v3 opcodes target-libgloss ${libgcj}" 1213 noconfigdirs="$noconfigdirs bfd binutils gas gdb ld opcodes target-libgloss"
1041 ;;
1042 v850*-*-*)
1043 noconfigdirs="$noconfigdirs ${libgcj}"
1044 ;;
1045 vax-*-vms)
1046 noconfigdirs="$noconfigdirs bfd binutils gdb ld target-newlib opcodes target-libgloss ${libgcj}"
1047 ;; 1214 ;;
1048 vax-*-*) 1215 vax-*-*)
1049 noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}"
1050 ;;
1051 xtensa*-*-*)
1052 noconfigdirs="$noconfigdirs ${libgcj}"
1053 ;;
1054 ip2k-*-*)
1055 noconfigdirs="$noconfigdirs target-libiberty target-libstdc++-v3 ${libgcj}"
1056 ;;
1057 *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu | *-*-kopensolaris*-gnu)
1058 noconfigdirs="$noconfigdirs target-newlib target-libgloss" 1216 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
1059 ;;
1060 *-*-lynxos*)
1061 noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}"
1062 ;;
1063 *-*-*)
1064 noconfigdirs="$noconfigdirs ${libgcj}"
1065 ;; 1217 ;;
1066 esac 1218 esac
1067 1219
1068 # If we aren't building newlib, then don't build libgloss, since libgloss 1220 # If we aren't building newlib, then don't build libgloss, since libgloss
1069 # depends upon some newlib header files. 1221 # depends upon some newlib header files.
1071 *target-libgloss*) ;; 1223 *target-libgloss*) ;;
1072 *target-newlib*) noconfigdirs="$noconfigdirs target-libgloss" ;; 1224 *target-newlib*) noconfigdirs="$noconfigdirs target-libgloss" ;;
1073 esac 1225 esac
1074 1226
1075 # Work in distributions that contain no compiler tools, like Autoconf. 1227 # Work in distributions that contain no compiler tools, like Autoconf.
1076 tentative_cc=""
1077 host_makefile_frag=/dev/null 1228 host_makefile_frag=/dev/null
1078 if test -d ${srcdir}/config ; then 1229 if test -d ${srcdir}/config ; then
1079 case "${host}" in 1230 case "${host}" in
1080 m68k-hp-hpux*)
1081 # Avoid "too much defining" errors from HPUX compiler.
1082 tentative_cc="cc -Wp,-H256000"
1083 # If "ar" in $PATH is GNU ar, the symbol table may need rebuilding.
1084 # If it's HP/UX ar, this should be harmless.
1085 RANLIB="ar ts"
1086 ;;
1087 m68k-apollo-sysv*)
1088 tentative_cc="cc -A ansi -A runtype,any -A systype,any -U__STDC__ -DUSG"
1089 ;;
1090 m68k-apollo-bsd*)
1091 #None of the Apollo compilers can compile gas or binutils. The preprocessor
1092 # chokes on bfd, the compiler won't let you assign integers to enums, and
1093 # other problems. Defining CC to gcc is a questionable way to say "don't use
1094 # the apollo compiler" (the preferred version of GCC could be called cc,
1095 # or whatever), but I'm not sure leaving CC as cc is any better...
1096 #CC=cc -A ansi -A runtype,any -A systype,any -U__STDC__ -DNO_STDARG
1097 # Used to have BISON=yacc.
1098 tentative_cc=gcc
1099 ;;
1100 m88k-dg-dgux*)
1101 tentative_cc="gcc -Wall -ansi -D__using_DGUX"
1102 ;;
1103 m88k-harris-cxux*)
1104 # Under CX/UX, we want to tell the compiler to use ANSI mode.
1105 tentative_cc="cc -Xa"
1106 host_makefile_frag="config/mh-cxux"
1107 ;;
1108 m88k-motorola-sysv*)
1109 ;;
1110 mips*-dec-ultrix*)
1111 tentative_cc="cc -Wf,-XNg1000"
1112 host_makefile_frag="config/mh-decstation"
1113 ;;
1114 mips*-nec-sysv4*)
1115 # The C compiler on NEC MIPS SVR4 needs bigger tables.
1116 tentative_cc="cc -ZXNd=5000 -ZXNg=1000"
1117 host_makefile_frag="config/mh-necv4"
1118 ;;
1119 mips*-sgi-irix4*)
1120 # Tell compiler to use K&R C. We can't compile under the SGI Ansi
1121 # environment. Also bump switch table size so that cp-parse will
1122 # compile. Bump string length limit so linker builds.
1123 tentative_cc="cc -cckr -Wf,-XNg1500 -Wf,-XNk1000 -Wf,-XNh2000 -Wf,-XNl8192"
1124 ;;
1125 mips*-*-sysv4*)
1126 host_makefile_frag="config/mh-sysv4"
1127 ;;
1128 mips*-*-sysv*)
1129 # This is for a MIPS running RISC/os 4.52C.
1130
1131 # This is needed for GDB, but needs to be in the top-level make because
1132 # if a library is compiled with the bsd headers and gets linked with the
1133 # sysv system libraries all hell can break loose (e.g. a jmp_buf might be
1134 # a different size).
1135 # ptrace(2) apparently has problems in the BSD environment. No workaround is
1136 # known except to select the sysv environment. Could we use /proc instead?
1137 # These "sysv environments" and "bsd environments" often end up being a pain.
1138 #
1139 # This is not part of CFLAGS because perhaps not all C compilers have this
1140 # option.
1141 tentative_cc="cc -systype sysv"
1142 ;;
1143 i370-ibm-opened*)
1144 tentative_cc="c89"
1145 ;;
1146 i[[3456789]]86-*-sysv5*)
1147 host_makefile_frag="config/mh-sysv5"
1148 ;;
1149 i[[3456789]]86-*-dgux*)
1150 tentative_cc="gcc -Wall -ansi -D__using_DGUX"
1151 host_makefile_frag="config/mh-dgux386"
1152 ;;
1153 i[[3456789]]86-ncr-sysv4.3*)
1154 # The MetaWare compiler will generate a copyright message unless you
1155 # turn it off by adding the -Hnocopyr flag.
1156 tentative_cc="cc -Hnocopyr"
1157 ;;
1158 i[[3456789]]86-ncr-sysv4*)
1159 # for an NCR 3000 (i486/SVR4) system.
1160 # The NCR 3000 ships with a MetaWare compiler installed as /bin/cc.
1161 # This compiler not only emits obnoxious copyright messages every time
1162 # you run it, but it chokes and dies on a whole bunch of GNU source
1163 # files. Default to using the AT&T compiler installed in /usr/ccs/ATT/cc.
1164 tentative_cc="/usr/ccs/ATT/cc"
1165 host_makefile_frag="config/mh-ncr3000"
1166 ;;
1167 i[[3456789]]86-*-sco3.2v5*)
1168 ;;
1169 i[[3456789]]86-*-sco*)
1170 # The native C compiler botches some simple uses of const. Unfortunately,
1171 # it doesn't defined anything like "__sco__" for us to test for in ansidecl.h.
1172 tentative_cc="cc -Dconst="
1173 host_makefile_frag="config/mh-sco"
1174 ;;
1175 i[[3456789]]86-*-udk*)
1176 host_makefile_frag="config/mh-sysv5"
1177 ;;
1178 i[[3456789]]86-*-solaris2*)
1179 host_makefile_frag="config/mh-sysv4"
1180 ;;
1181 i[[3456789]]86-*-msdosdjgpp*) 1231 i[[3456789]]86-*-msdosdjgpp*)
1182 host_makefile_frag="config/mh-djgpp" 1232 host_makefile_frag="config/mh-djgpp"
1183 ;; 1233 ;;
1184 *-cygwin*) 1234 *-cygwin*)
1185 ACX_CHECK_CYGWIN_CAT_WORKS 1235 ACX_CHECK_CYGWIN_CAT_WORKS
1186 host_makefile_frag="config/mh-cygwin" 1236 host_makefile_frag="config/mh-cygwin"
1187 ;; 1237 ;;
1188 *-mingw*) 1238 *-mingw*)
1189 host_makefile_frag="config/mh-mingw" 1239 host_makefile_frag="config/mh-mingw"
1190 ;; 1240 ;;
1191 *-interix*) 1241 alpha*-linux*)
1192 host_makefile_frag="config/mh-interix" 1242 host_makefile_frag="config/mh-alpha-linux"
1193 ;;
1194 vax-*-ultrix2*)
1195 # The old BSD pcc isn't up to compiling parts of gdb so use gcc
1196 tentative_cc=gcc
1197 ;;
1198 *-*-solaris2*)
1199 host_makefile_frag="config/mh-solaris"
1200 ;;
1201 m68k-sun-sunos*)
1202 # Sun's C compiler needs the -J flag to be able to compile cp-parse.c
1203 # without overflowing the jump tables (-J says to use a 32 bit table)
1204 tentative_cc="cc -J"
1205 ;; 1243 ;;
1206 hppa*-hp-hpux10*) 1244 hppa*-hp-hpux10*)
1207 tentative_cc="cc -Wp,-H256000"
1208 host_makefile_frag="config/mh-pa-hpux10" 1245 host_makefile_frag="config/mh-pa-hpux10"
1209 ;; 1246 ;;
1210 hppa*-hp-hpux* | hppa*-*-hiux*) 1247 hppa*-hp-hpux*)
1211 tentative_cc="cc -Wp,-H256000"
1212 host_makefile_frag="config/mh-pa" 1248 host_makefile_frag="config/mh-pa"
1213 ;; 1249 ;;
1214 hppa*-*) 1250 hppa*-*)
1215 host_makefile_frag="config/mh-pa" 1251 host_makefile_frag="config/mh-pa"
1216 ;; 1252 ;;
1217 *-hp-hpux* | *-*-hiux*)
1218 tentative_cc="cc -Wp,-H256000"
1219 ;;
1220 rs6000-*-lynxos*)
1221 # /bin/cc is less than useful for our purposes. Always use GCC
1222 tentative_cc="/usr/cygnus/progressive/bin/gcc"
1223 host_makefile_frag="config/mh-lynxrs6k"
1224 ;;
1225 *-*-darwin*) 1253 *-*-darwin*)
1226 host_makefile_frag="config/mh-darwin" 1254 host_makefile_frag="config/mh-darwin"
1227 ;; 1255 ;;
1228 powerpc-*-aix*) 1256 powerpc-*-aix*)
1229 host_makefile_frag="config/mh-ppc-aix" 1257 host_makefile_frag="config/mh-ppc-aix"
1230 ;; 1258 ;;
1231 rs6000-*-aix*) 1259 rs6000-*-aix*)
1232 host_makefile_frag="config/mh-ppc-aix" 1260 host_makefile_frag="config/mh-ppc-aix"
1233 ;; 1261 ;;
1234 *-*-lynxos*) 1262 esac
1235 # /bin/cc is less than useful for our purposes. Always use GCC
1236 tentative_cc="/bin/gcc"
1237 ;;
1238 *-*-sysv4*)
1239 host_makefile_frag="config/mh-sysv4"
1240 ;;
1241 # This is placed last to prevent interfering with the cases above.
1242 i[[3456789]]86-*-*)
1243 # Build the stage2 and stage3 compilers with -fomit-frame-pointer.
1244 host_makefile_frag="config/mh-x86omitfp"
1245 ;;
1246 esac
1247 fi
1248
1249 # If we aren't going to be using gcc, see if we can extract a definition
1250 # of CC from the fragment.
1251 # Actually, use the 'pre-extracted' version above.
1252 if test -z "${CC}" && test "${build}" = "${host}" ; then
1253 IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:"
1254 found=
1255 for dir in $PATH; do
1256 test -z "$dir" && dir=.
1257 if test -f $dir/gcc; then
1258 found=yes
1259 break
1260 fi
1261 done
1262 IFS="$save_ifs"
1263 if test -z "${found}" && test -n "${tentative_cc}" ; then
1264 CC=$tentative_cc
1265 fi
1266 fi 1263 fi
1267 1264
1268 if test "${build}" != "${host}" ; then 1265 if test "${build}" != "${host}" ; then
1269 AR_FOR_BUILD=${AR_FOR_BUILD-ar} 1266 AR_FOR_BUILD=${AR_FOR_BUILD-ar}
1270 AS_FOR_BUILD=${AS_FOR_BUILD-as} 1267 AS_FOR_BUILD=${AS_FOR_BUILD-as}
1271 CC_FOR_BUILD=${CC_FOR_BUILD-gcc} 1268 CC_FOR_BUILD=${CC_FOR_BUILD-gcc}
1272 CXX_FOR_BUILD=${CXX_FOR_BUILD-g++} 1269 CXX_FOR_BUILD=${CXX_FOR_BUILD-g++}
1273 GCJ_FOR_BUILD=${GCJ_FOR_BUILD-gcj}
1274 GFORTRAN_FOR_BUILD=${GFORTRAN_FOR_BUILD-gfortran} 1270 GFORTRAN_FOR_BUILD=${GFORTRAN_FOR_BUILD-gfortran}
1275 GOC_FOR_BUILD=${GOC_FOR_BUILD-gccgo} 1271 GOC_FOR_BUILD=${GOC_FOR_BUILD-gccgo}
1276 DLLTOOL_FOR_BUILD=${DLLTOOL_FOR_BUILD-dlltool} 1272 DLLTOOL_FOR_BUILD=${DLLTOOL_FOR_BUILD-dlltool}
1277 LD_FOR_BUILD=${LD_FOR_BUILD-ld} 1273 LD_FOR_BUILD=${LD_FOR_BUILD-ld}
1278 NM_FOR_BUILD=${NM_FOR_BUILD-nm} 1274 NM_FOR_BUILD=${NM_FOR_BUILD-nm}
1282 else 1278 else
1283 AR_FOR_BUILD="\$(AR)" 1279 AR_FOR_BUILD="\$(AR)"
1284 AS_FOR_BUILD="\$(AS)" 1280 AS_FOR_BUILD="\$(AS)"
1285 CC_FOR_BUILD="\$(CC)" 1281 CC_FOR_BUILD="\$(CC)"
1286 CXX_FOR_BUILD="\$(CXX)" 1282 CXX_FOR_BUILD="\$(CXX)"
1287 GCJ_FOR_BUILD="\$(GCJ)"
1288 GFORTRAN_FOR_BUILD="\$(GFORTRAN)" 1283 GFORTRAN_FOR_BUILD="\$(GFORTRAN)"
1289 GOC_FOR_BUILD="\$(GOC)" 1284 GOC_FOR_BUILD="\$(GOC)"
1290 DLLTOOL_FOR_BUILD="\$(DLLTOOL)" 1285 DLLTOOL_FOR_BUILD="\$(DLLTOOL)"
1291 LD_FOR_BUILD="\$(LD)" 1286 LD_FOR_BUILD="\$(LD)"
1292 NM_FOR_BUILD="\$(NM)" 1287 NM_FOR_BUILD="\$(NM)"
1315 LD="$gcc_prog_ld" ;; 1310 LD="$gcc_prog_ld" ;;
1316 esac 1311 esac
1317 fi 1312 fi
1318 fi 1313 fi
1319 1314
1315 # Check whether -static-libstdc++ -static-libgcc is supported.
1316 have_static_libs=no
1317 if test "$GCC" = yes; then
1318 saved_LDFLAGS="$LDFLAGS"
1319
1320 LDFLAGS="$LDFLAGS -static-libstdc++ -static-libgcc"
1321 AC_MSG_CHECKING([whether g++ accepts -static-libstdc++ -static-libgcc])
1322 AC_LANG_PUSH(C++)
1323 AC_LINK_IFELSE([
1324 #if (__GNUC__ < 4) || (__GNUC__ == 4 && __GNUC_MINOR__ < 5)
1325 #error -static-libstdc++ not implemented
1326 #endif
1327 int main() {}],
1328 [AC_MSG_RESULT([yes]); have_static_libs=yes],
1329 [AC_MSG_RESULT([no])])
1330 AC_LANG_POP(C++)
1331
1332 LDFLAGS="$saved_LDFLAGS"
1333 fi
1334
1320 ACX_PROG_GNAT 1335 ACX_PROG_GNAT
1321 ACX_PROG_CMP_IGNORE_INITIAL 1336 ACX_PROG_CMP_IGNORE_INITIAL
1322 1337
1323 # See if we are building gcc with C++. 1338 AC_ARG_ENABLE([bootstrap],
1324 AC_ARG_ENABLE(build-with-cxx, 1339 [AS_HELP_STRING([--enable-bootstrap],
1325 [AS_HELP_STRING([--enable-build-with-cxx], 1340 [enable bootstrapping @<:@yes if native build@:>@])],,
1326 [build with C++ compiler instead of C compiler])], 1341 enable_bootstrap=default)
1327 ENABLE_BUILD_WITH_CXX=$enableval, 1342
1328 ENABLE_BUILD_WITH_CXX=no) 1343 # Issue errors and warnings for invalid/strange bootstrap combinations.
1344 if test -r $srcdir/gcc/configure; then
1345 have_compiler=yes
1346 else
1347 have_compiler=no
1348 fi
1349
1350 case "$have_compiler:$host:$target:$enable_bootstrap" in
1351 *:*:*:no) ;;
1352
1353 # Default behavior. Enable bootstrap if we have a compiler
1354 # and we are in a native configuration.
1355 yes:$build:$build:default)
1356 enable_bootstrap=yes ;;
1357
1358 *:*:*:default)
1359 enable_bootstrap=no ;;
1360
1361 # We have a compiler and we are in a native configuration, bootstrap is ok
1362 yes:$build:$build:yes)
1363 ;;
1364
1365 # Other configurations, but we have a compiler. Assume the user knows
1366 # what he's doing.
1367 yes:*:*:yes)
1368 AC_MSG_WARN([trying to bootstrap a cross compiler])
1369 ;;
1370
1371 # No compiler: if they passed --enable-bootstrap explicitly, fail
1372 no:*:*:yes)
1373 AC_MSG_ERROR([cannot bootstrap without a compiler]) ;;
1374
1375 # Fail if wrong command line
1376 *)
1377 AC_MSG_ERROR([invalid option for --enable-bootstrap])
1378 ;;
1379 esac
1380
1381 # When bootstrapping with GCC, build stage 1 in C++98 mode to ensure that a
1382 # C++98 compiler can still start the bootstrap.
1383 if test "$enable_bootstrap:$GXX" = "yes:yes"; then
1384 CXX="$CXX -std=gnu++98"
1385 fi
1329 1386
1330 # Used for setting $lt_cv_objdir 1387 # Used for setting $lt_cv_objdir
1331 _LT_CHECK_OBJDIR 1388 _LT_CHECK_OBJDIR
1332 1389
1333 # Check for GMP, MPFR and MPC 1390 # Check for GMP, MPFR and MPC
1397 fi 1454 fi
1398 if test "x$with_mpfr_lib" != x; then 1455 if test "x$with_mpfr_lib" != x; then
1399 gmplibs="-L$with_mpfr_lib $gmplibs" 1456 gmplibs="-L$with_mpfr_lib $gmplibs"
1400 fi 1457 fi
1401 if test "x$with_mpfr$with_mpfr_include$with_mpfr_lib" = x && test -d ${srcdir}/mpfr; then 1458 if test "x$with_mpfr$with_mpfr_include$with_mpfr_lib" = x && test -d ${srcdir}/mpfr; then
1402 gmplibs='-L$$r/$(HOST_SUBDIR)/mpfr/'"$lt_cv_objdir $gmplibs" 1459 # MPFR v3.1.0 moved the sources into a src sub-directory.
1403 gmpinc='-I$$r/$(HOST_SUBDIR)/mpfr -I$$s/mpfr '"$gmpinc" 1460 if ! test -d ${srcdir}/mpfr/src; then
1404 extra_mpc_mpfr_configure_flags='--with-mpfr-include=$$s/mpfr --with-mpfr-lib=$$r/$(HOST_SUBDIR)/mpfr/'"$lt_cv_objdir" 1461 AC_MSG_ERROR([dnl
1462 Building GCC with MPFR in the source tree is only handled for MPFR 3.1.0+.])
1463 fi
1464 gmplibs='-L$$r/$(HOST_SUBDIR)/mpfr/src/'"$lt_cv_objdir $gmplibs"
1465 gmpinc='-I$$r/$(HOST_SUBDIR)/mpfr/src -I$$s/mpfr/src '"$gmpinc"
1466 extra_mpc_mpfr_configure_flags='--with-mpfr-include=$$s/mpfr/src --with-mpfr-lib=$$r/$(HOST_SUBDIR)/mpfr/src/'"$lt_cv_objdir"
1405 # Do not test the mpfr version. Assume that it is sufficient, since 1467 # Do not test the mpfr version. Assume that it is sufficient, since
1406 # it is in the source tree, and the library has not been built yet 1468 # it is in the source tree, and the library has not been built yet
1407 # but it would be included on the link line in the version check below 1469 # but it would be included on the link line in the version check below
1408 # hence making the test fail. 1470 # hence making the test fail.
1409 have_gmp=yes 1471 have_gmp=yes
1441 if test "x$with_gmp$with_gmp_include$with_gmp_lib" = x && test -d ${srcdir}/gmp; then 1503 if test "x$with_gmp$with_gmp_include$with_gmp_lib" = x && test -d ${srcdir}/gmp; then
1442 gmplibs='-L$$r/$(HOST_SUBDIR)/gmp/'"$lt_cv_objdir $gmplibs" 1504 gmplibs='-L$$r/$(HOST_SUBDIR)/gmp/'"$lt_cv_objdir $gmplibs"
1443 gmpinc='-I$$r/$(HOST_SUBDIR)/gmp -I$$s/gmp '"$gmpinc" 1505 gmpinc='-I$$r/$(HOST_SUBDIR)/gmp -I$$s/gmp '"$gmpinc"
1444 extra_mpfr_configure_flags='--with-gmp-include=$$r/$(HOST_SUBDIR)/gmp --with-gmp-lib=$$r/$(HOST_SUBDIR)/gmp/'"$lt_cv_objdir" 1506 extra_mpfr_configure_flags='--with-gmp-include=$$r/$(HOST_SUBDIR)/gmp --with-gmp-lib=$$r/$(HOST_SUBDIR)/gmp/'"$lt_cv_objdir"
1445 extra_mpc_gmp_configure_flags='--with-gmp-include=$$r/$(HOST_SUBDIR)/gmp --with-gmp-lib=$$r/$(HOST_SUBDIR)/gmp/'"$lt_cv_objdir" 1507 extra_mpc_gmp_configure_flags='--with-gmp-include=$$r/$(HOST_SUBDIR)/gmp --with-gmp-lib=$$r/$(HOST_SUBDIR)/gmp/'"$lt_cv_objdir"
1508 extra_isl_gmp_configure_flags='--with-gmp-builddir=$$r/$(HOST_SUBDIR)/gmp'
1446 # Do not test the gmp version. Assume that it is sufficient, since 1509 # Do not test the gmp version. Assume that it is sufficient, since
1447 # it is in the source tree, and the library has not been built yet 1510 # it is in the source tree, and the library has not been built yet
1448 # but it would be included on the link line in the version check below 1511 # but it would be included on the link line in the version check below
1449 # hence making the test fail. 1512 # hence making the test fail.
1450 have_gmp=yes 1513 have_gmp=yes
1457 # Check for the recommended and required versions of GMP. 1520 # Check for the recommended and required versions of GMP.
1458 AC_MSG_CHECKING([for the correct version of gmp.h]) 1521 AC_MSG_CHECKING([for the correct version of gmp.h])
1459 AC_TRY_COMPILE([#include "gmp.h"],[ 1522 AC_TRY_COMPILE([#include "gmp.h"],[
1460 #define GCC_GMP_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c)) 1523 #define GCC_GMP_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
1461 #define GCC_GMP_VERSION GCC_GMP_VERSION_NUM(__GNU_MP_VERSION,__GNU_MP_VERSION_MINOR,__GNU_MP_VERSION_PATCHLEVEL) 1524 #define GCC_GMP_VERSION GCC_GMP_VERSION_NUM(__GNU_MP_VERSION,__GNU_MP_VERSION_MINOR,__GNU_MP_VERSION_PATCHLEVEL)
1462 #if GCC_GMP_VERSION < GCC_GMP_VERSION_NUM(4,2,0) 1525 #if GCC_GMP_VERSION < GCC_GMP_VERSION_NUM(4,2,3)
1463 choke me 1526 choke me
1464 #endif 1527 #endif
1465 ], [AC_TRY_COMPILE([#include <gmp.h>],[ 1528 ], [AC_TRY_COMPILE([#include <gmp.h>],[
1466 #define GCC_GMP_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c)) 1529 #define GCC_GMP_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
1467 #define GCC_GMP_VERSION GCC_GMP_VERSION_NUM(__GNU_MP_VERSION,__GNU_MP_VERSION_MINOR,__GNU_MP_VERSION_PATCHLEVEL) 1530 #define GCC_GMP_VERSION GCC_GMP_VERSION_NUM(__GNU_MP_VERSION,__GNU_MP_VERSION_MINOR,__GNU_MP_VERSION_PATCHLEVEL)
1475 if test x"$have_gmp" = xyes; then 1538 if test x"$have_gmp" = xyes; then
1476 # Check for the recommended and required versions of MPFR. 1539 # Check for the recommended and required versions of MPFR.
1477 AC_MSG_CHECKING([for the correct version of mpfr.h]) 1540 AC_MSG_CHECKING([for the correct version of mpfr.h])
1478 AC_TRY_COMPILE([#include <gmp.h> 1541 AC_TRY_COMPILE([#include <gmp.h>
1479 #include <mpfr.h>],[ 1542 #include <mpfr.h>],[
1480 #if MPFR_VERSION < MPFR_VERSION_NUM(2,3,1) 1543 #if MPFR_VERSION < MPFR_VERSION_NUM(2,4,0)
1481 choke me 1544 choke me
1482 #endif 1545 #endif
1483 ], [AC_TRY_COMPILE([#include <gmp.h> 1546 ], [AC_TRY_COMPILE([#include <gmp.h>
1484 #include <mpfr.h>],[ 1547 #include <mpfr.h>],[
1485 #if MPFR_VERSION < MPFR_VERSION_NUM(2,4,2) 1548 #if MPFR_VERSION < MPFR_VERSION_NUM(2,4,2)
1535 CFLAGS="$saved_CFLAGS" 1598 CFLAGS="$saved_CFLAGS"
1536 1599
1537 # The library versions listed in the error message below should match 1600 # The library versions listed in the error message below should match
1538 # the HARD-minimums enforced above. 1601 # the HARD-minimums enforced above.
1539 if test x$have_gmp != xyes; then 1602 if test x$have_gmp != xyes; then
1540 AC_MSG_ERROR([Building GCC requires GMP 4.2+, MPFR 2.3.1+ and MPC 0.8.0+. 1603 AC_MSG_ERROR([Building GCC requires GMP 4.2+, MPFR 2.4.0+ and MPC 0.8.0+.
1541 Try the --with-gmp, --with-mpfr and/or --with-mpc options to specify 1604 Try the --with-gmp, --with-mpfr and/or --with-mpc options to specify
1542 their locations. Source code for these libraries can be found at 1605 their locations. Source code for these libraries can be found at
1543 their respective hosting sites as well as at 1606 their respective hosting sites as well as at
1544 ftp://gcc.gnu.org/pub/gcc/infrastructure/. See also 1607 ftp://gcc.gnu.org/pub/gcc/infrastructure/. See also
1545 http://gcc.gnu.org/install/prerequisites.html for additional info. If 1608 http://gcc.gnu.org/install/prerequisites.html for additional info. If
1553 AC_SUBST(gmplibs) 1616 AC_SUBST(gmplibs)
1554 AC_SUBST(gmpinc) 1617 AC_SUBST(gmpinc)
1555 AC_SUBST(extra_mpfr_configure_flags) 1618 AC_SUBST(extra_mpfr_configure_flags)
1556 AC_SUBST(extra_mpc_gmp_configure_flags) 1619 AC_SUBST(extra_mpc_gmp_configure_flags)
1557 AC_SUBST(extra_mpc_mpfr_configure_flags) 1620 AC_SUBST(extra_mpc_mpfr_configure_flags)
1558 1621 AC_SUBST(extra_isl_gmp_configure_flags)
1559 # Allow host libstdc++ to be specified for static linking with PPL.
1560 AC_ARG_WITH(host-libstdcxx,
1561 [AS_HELP_STRING([--with-host-libstdcxx=L],
1562 [use linker arguments L to link with libstdc++
1563 when linking with PPL])])
1564
1565 case $with_host_libstdcxx in
1566 no|yes)
1567 AC_MSG_ERROR([-with-host-libstdcxx needs an argument])
1568 ;;
1569 esac
1570
1571 # Linker flags to use for stage1 or when not boostrapping.
1572 AC_ARG_WITH(stage1-ldflags,
1573 [AS_HELP_STRING([--with-stage1-ldflags=FLAGS], [linker flags for stage1])],
1574 [if test "$withval" = "no" -o "$withval" = "yes"; then
1575 stage1_ldflags=
1576 else
1577 stage1_ldflags=$withval
1578 fi],
1579 [stage1_ldflags=])
1580 AC_SUBST(stage1_ldflags)
1581 1622
1582 # Libraries to use for stage1 or when not bootstrapping. 1623 # Libraries to use for stage1 or when not bootstrapping.
1583 AC_ARG_WITH(stage1-libs, 1624 AC_ARG_WITH(stage1-libs,
1584 [AS_HELP_STRING([--with-stage1-libs=LIBS], [libraries for stage1])], 1625 [AS_HELP_STRING([--with-stage1-libs=LIBS], [libraries for stage1])],
1585 [if test "$withval" = "no" -o "$withval" = "yes"; then 1626 [if test "$withval" = "no" -o "$withval" = "yes"; then
1586 stage1_libs= 1627 stage1_libs=
1587 else 1628 else
1588 stage1_libs=$withval 1629 stage1_libs=$withval
1589 fi], 1630 fi],
1590 [stage1_libs=$with_host_libstdcxx]) 1631 [stage1_libs=])
1591 AC_SUBST(stage1_libs) 1632 AC_SUBST(stage1_libs)
1592 1633
1593 # Libraries to use for stage2 and later builds. This defaults to the 1634 # Linker flags to use for stage1 or when not bootstrapping.
1594 # argument passed to --with-host-libstdcxx. 1635 AC_ARG_WITH(stage1-ldflags,
1636 [AS_HELP_STRING([--with-stage1-ldflags=FLAGS], [linker flags for stage1])],
1637 [if test "$withval" = "no" -o "$withval" = "yes"; then
1638 stage1_ldflags=
1639 else
1640 stage1_ldflags=$withval
1641 fi],
1642 [stage1_ldflags=
1643 # In stage 1, default to linking libstdc++ and libgcc statically with GCC
1644 # if supported. But if the user explicitly specified the libraries to use,
1645 # trust that they are doing what they want.
1646 if test "$stage1_libs" = "" -a "$have_static_libs" = yes; then
1647 stage1_ldflags="-static-libstdc++ -static-libgcc"
1648 fi])
1649 AC_SUBST(stage1_ldflags)
1650
1651 # Libraries to use for stage2 and later builds.
1595 AC_ARG_WITH(boot-libs, 1652 AC_ARG_WITH(boot-libs,
1596 [AS_HELP_STRING([--with-boot-libs=LIBS], [libraries for stage2 and later])], 1653 [AS_HELP_STRING([--with-boot-libs=LIBS], [libraries for stage2 and later])],
1597 [if test "$withval" = "no" -o "$withval" = "yes"; then 1654 [if test "$withval" = "no" -o "$withval" = "yes"; then
1598 poststage1_libs= 1655 poststage1_libs=
1599 else 1656 else
1600 poststage1_libs=$withval 1657 poststage1_libs=$withval
1601 fi], 1658 fi],
1602 [poststage1_libs=$with_host_libstdcxx]) 1659 [poststage1_libs=])
1603 AC_SUBST(poststage1_libs) 1660 AC_SUBST(poststage1_libs)
1604 1661
1605 # Linker flags to use for stage2 and later builds. 1662 # Linker flags to use for stage2 and later builds.
1606 AC_ARG_WITH(boot-ldflags, 1663 AC_ARG_WITH(boot-ldflags,
1607 [AS_HELP_STRING([--with-boot-ldflags=FLAGS], 1664 [AS_HELP_STRING([--with-boot-ldflags=FLAGS],
1618 if test "$poststage1_libs" = ""; then 1675 if test "$poststage1_libs" = ""; then
1619 poststage1_ldflags="-static-libstdc++ -static-libgcc" 1676 poststage1_ldflags="-static-libstdc++ -static-libgcc"
1620 fi]) 1677 fi])
1621 AC_SUBST(poststage1_ldflags) 1678 AC_SUBST(poststage1_ldflags)
1622 1679
1623 # Check for PPL 1680 # GCC GRAPHITE dependency isl.
1624 ppllibs= 1681 # Basic setup is inlined here, actual checks are in config/isl.m4
1625 pplinc= 1682
1626 pwllib= 1683 AC_ARG_WITH(isl,
1627 1684 [AS_HELP_STRING(
1628 AC_ARG_WITH(ppl, 1685 [--with-isl=PATH],
1629 [AS_HELP_STRING([--with-ppl=PATH], 1686 [Specify prefix directory for the installed isl package.
1630 [specify prefix directory for the installed PPL package. 1687 Equivalent to --with-isl-include=PATH/include
1631 Equivalent to --with-ppl-include=PATH/include 1688 plus --with-isl-lib=PATH/lib])])
1632 plus --with-ppl-lib=PATH/lib])]) 1689
1633 AC_ARG_WITH(ppl-include, 1690 # Treat --without-isl as a request to disable
1634 [AS_HELP_STRING([--with-ppl-include=PATH], 1691 # GRAPHITE support and skip all following checks.
1635 [specify directory for installed PPL include files])]) 1692 if test "x$with_isl" != "xno"; then
1636 AC_ARG_WITH(ppl-lib, 1693 # Check for isl
1637 [AS_HELP_STRING([--with-ppl-lib=PATH], 1694 dnl Provide configure switches and initialize islinc & isllibs
1638 [specify directory for the installed PPL library])]) 1695 dnl with user input.
1639 1696 ISL_INIT_FLAGS
1640 AC_ARG_ENABLE(ppl-version-check, 1697 dnl The versions of isl that work for Graphite
1641 [AS_HELP_STRING([--disable-ppl-version-check], 1698 ISL_CHECK_VERSION()
1642 [disable check for PPL version])]) 1699 dnl Only execute fail-action, if isl has been requested.
1643 1700 ISL_IF_FAILED([
1644 case $with_ppl in 1701 AC_MSG_ERROR([Unable to find a usable isl. See config.log for details.])])
1645 yes | no | "") 1702 fi
1646 ;; 1703
1647 *) 1704 # If the isl check failed, disable builds of in-tree variant of isl
1648 ppllibs="-L$with_ppl/lib" 1705 if test "x$with_isl" = xno ||
1649 pplinc="-I$with_ppl/include $pplinc" 1706 test "x$gcc_cv_isl" = xno; then
1650 if test -d "$with_ppl/lib" && test -d "$with_ppl/include"; then 1707 noconfigdirs="$noconfigdirs isl"
1651 with_ppl=yes 1708 islinc=
1652 else 1709 fi
1653 AC_MSG_ERROR([cannot find directories "$with_ppl/lib" or "$with_ppl/include"]) 1710
1654 fi 1711 AC_SUBST(isllibs)
1655 ;; 1712 AC_SUBST(islinc)
1656 esac
1657
1658 if test x"$with_ppl_include" != x; then
1659 pplinc="-I$with_ppl_include $pplinc"
1660 with_ppl=yes
1661 fi
1662
1663 if test "x$with_ppl_lib" != x; then
1664 ppllibs="-L$with_ppl_lib"
1665 with_ppl=yes
1666 fi
1667
1668 if test x"$with_ppl$with_ppl_include$with_ppl_lib" = x && test -d ${srcdir}/ppl; then
1669 if test x"$enable_watchdog" = xyes; then
1670 pwllib="-lpwl"
1671 fi
1672 ppllibs='-L$$r/$(HOST_SUBDIR)/ppl/interfaces/C/'"$lt_cv_objdir"' -L$$r/$(HOST_SUBDIR)/ppl/src/'"$lt_cv_objdir"
1673 pplinc='-I$$r/$(HOST_SUBDIR)/ppl/src -I$$r/$(HOST_SUBDIR)/ppl/interfaces/C '
1674 enable_ppl_version_check=no
1675 with_ppl=yes
1676 fi
1677
1678 if test "x$with_ppl" != xno; then
1679 if test "x$pwllib" = x; then
1680 saved_LDFLAGS="$LDFLAGS"
1681 LDFLAGS="$LDFLAGS $ppllibs"
1682 AC_CHECK_LIB(pwl,PWL_handle_timeout,[pwllib="-lpwl"])
1683 LDFLAGS="$saved_LDFLAGS"
1684 fi
1685
1686 ppllibs="$ppllibs -lppl_c -lppl $pwllib -lgmpxx"
1687
1688 if test "$enable_ppl_version_check" != no; then
1689 saved_CFLAGS="$CFLAGS"
1690 CFLAGS="$CFLAGS $pplinc $gmpinc"
1691 AC_MSG_CHECKING([for version 0.11 (revision 0 or later) of PPL])
1692 AC_TRY_COMPILE([#include "ppl_c.h"],[
1693 #if PPL_VERSION_MAJOR != 0 || PPL_VERSION_MINOR < 11
1694 choke me
1695 #endif
1696 ], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]); ppllibs= ; pplinc= ; with_ppl=no ])
1697 CFLAGS="$saved_CFLAGS"
1698 fi
1699 fi
1700
1701 # Flags needed for PPL
1702 AC_SUBST(ppllibs)
1703 AC_SUBST(pplinc)
1704
1705
1706 # Check for CLOOG
1707
1708 dnl Provide configure switches and initialize clooginc & clooglibs
1709 dnl with user input.
1710 CLOOG_INIT_FLAGS
1711 if test "x$with_ppl" = "xno"; then
1712 dnl Only execute fail-action, if CLooG has been requested.
1713 CLOOG_REQUESTED([graphite_requested=yes], [graphite_requested=no])
1714 if test "${graphite_requested}" = yes; then
1715 AC_MSG_ERROR([Unable to find a usable PPL. See config.log for details.])
1716 fi
1717 with_cloog=no
1718 fi
1719 if test "x${with_cloog}" = x && test "x${with_cloog_include}" = x \
1720 && test "x${with_cloog_lib}" = x && test -d ${srcdir}/cloog; then
1721 clooglibs='-L$$r/$(HOST_SUBDIR)/cloog/'"$lt_cv_objdir"' '
1722 clooginc='-I$$r/$(HOST_SUBDIR)/cloog/include -I$$s/cloog/include '
1723 fi
1724 if test "x$with_cloog" != "xno"; then
1725 dnl The minimal version of CLooG required for Graphite.
1726 dnl
1727 dnl If we use CLooG-Legacy, the provided version information is
1728 dnl ignored.
1729 CLOOG_CHECK_VERSION(0,16,1)
1730
1731 dnl Only execute fail-action, if CLooG has been requested.
1732 CLOOG_IF_FAILED([
1733 AC_MSG_ERROR([Unable to find a usable CLooG. See config.log for details.])])
1734 fi
1735 1713
1736 # Check for LTO support. 1714 # Check for LTO support.
1737 AC_ARG_ENABLE(lto, 1715 AC_ARG_ENABLE(lto,
1738 [AS_HELP_STRING([--enable-lto], [enable link time optimization support])], 1716 [AS_HELP_STRING([--enable-lto], [enable link time optimization support])],
1739 enable_lto=$enableval, 1717 enable_lto=$enableval,
1741 1719
1742 ACX_ELF_TARGET_IFELSE([# ELF platforms build the lto-plugin always. 1720 ACX_ELF_TARGET_IFELSE([# ELF platforms build the lto-plugin always.
1743 build_lto_plugin=yes 1721 build_lto_plugin=yes
1744 ],[if test x"$default_enable_lto" = x"yes" ; then 1722 ],[if test x"$default_enable_lto" = x"yes" ; then
1745 case $target in 1723 case $target in
1746 *-apple-darwin9 | *-cygwin* | *-mingw*) ;; 1724 *-apple-darwin[[912]]* | *-cygwin* | *-mingw* | *djgpp*) ;;
1747 # On other non-ELF platforms, LTO has yet to be validated. 1725 # On other non-ELF platforms, LTO has yet to be validated.
1748 *) enable_lto=no ;; 1726 *) enable_lto=no ;;
1749 esac 1727 esac
1750 else 1728 else
1751 # Apart from ELF platforms, only Windows and Darwin support LTO so far. 1729 # Apart from ELF platforms, only Windows and Darwin support LTO so far.
1752 # It would also be nice to check the binutils support, but we don't 1730 # It would also be nice to check the binutils support, but we don't
1753 # have gcc_GAS_CHECK_FEATURE available here. For now, we'll just 1731 # have gcc_GAS_CHECK_FEATURE available here. For now, we'll just
1754 # warn during gcc/ subconfigure; unless you're bootstrapping with 1732 # warn during gcc/ subconfigure; unless you're bootstrapping with
1755 # -flto it won't be needed until after installation anyway. 1733 # -flto it won't be needed until after installation anyway.
1756 case $target in 1734 case $target in
1757 *-cygwin* | *-mingw* | *-apple-darwin*) ;; 1735 *-cygwin* | *-mingw* | *-apple-darwin* | *djgpp*) ;;
1758 *) if test x"$enable_lto" = x"yes"; then 1736 *) if test x"$enable_lto" = x"yes"; then
1759 AC_MSG_ERROR([LTO support is not enabled for this target.]) 1737 AC_MSG_ERROR([LTO support is not enabled for this target.])
1760 fi 1738 fi
1761 ;; 1739 ;;
1762 esac 1740 esac
1767 *-cygwin* | *-mingw*) build_lto_plugin=$enable_lto ;; 1745 *-cygwin* | *-mingw*) build_lto_plugin=$enable_lto ;;
1768 *) ;; 1746 *) ;;
1769 esac 1747 esac
1770 ]) 1748 ])
1771 1749
1772 1750 AC_ARG_ENABLE(linker-plugin-configure-flags,
1773 # By default, C is the only stage 1 language. 1751 [AS_HELP_STRING([[--enable-linker-plugin-configure-flags=FLAGS]],
1752 [additional flags for configuring linker plugins @<:@none@:>@])],
1753 extra_linker_plugin_configure_flags=$enableval,
1754 extra_linker_plugin_configure_flags=)
1755 AC_SUBST(extra_linker_plugin_configure_flags)
1756 AC_ARG_ENABLE(linker-plugin-flags,
1757 [AS_HELP_STRING([[--enable-linker-plugin-flags=FLAGS]],
1758 [additional flags for configuring and building linker plugins @<:@none@:>@])],
1759 extra_linker_plugin_flags=$enableval,
1760 extra_linker_plugin_flags=)
1761 AC_SUBST(extra_linker_plugin_flags)
1762
1763 # Enable --enable-host-shared.
1764 # Checked early to determine whether jit is an 'all' language
1765 AC_ARG_ENABLE(host-shared,
1766 [AS_HELP_STRING([--enable-host-shared],
1767 [build host code as shared libraries])],
1768 [host_shared=$enableval], [host_shared=no])
1769 AC_SUBST(host_shared)
1770
1771 # By default, C and C++ are the only stage 1 languages.
1774 stage1_languages=,c, 1772 stage1_languages=,c,
1775 1773
1776 # Target libraries that we bootstrap. 1774 # Target libraries that we bootstrap.
1777 bootstrap_target_libs=,target-libgcc, 1775 bootstrap_target_libs=,target-libgcc,
1778 1776
1783 # NB: embedded tabs in this IF block -- do not untabify 1781 # NB: embedded tabs in this IF block -- do not untabify
1784 if test -d ${srcdir}/gcc; then 1782 if test -d ${srcdir}/gcc; then
1785 if test x"${enable_languages+set}" != xset; then 1783 if test x"${enable_languages+set}" != xset; then
1786 if test x"${LANGUAGES+set}" = xset; then 1784 if test x"${LANGUAGES+set}" = xset; then
1787 enable_languages="${LANGUAGES}" 1785 enable_languages="${LANGUAGES}"
1788 echo configure.in: warning: setting LANGUAGES is deprecated, use --enable-languages instead 1>&2 1786 echo configure.ac: warning: setting LANGUAGES is deprecated, use --enable-languages instead 1>&2
1789 else 1787 else
1790 enable_languages=all 1788 enable_languages=default
1791 fi 1789 fi
1792 else 1790 else
1793 if test x"${enable_languages}" = x || 1791 if test x"${enable_languages}" = x ||
1794 test x"${enable_languages}" = xyes; 1792 test x"${enable_languages}" = xyes;
1795 then 1793 then
1796 echo configure.in: --enable-languages needs at least one language argument 1>&2 1794 echo configure.ac: --enable-languages needs at least one language argument 1>&2
1797 exit 1 1795 exit 1
1798 fi 1796 fi
1799 fi 1797 fi
1800 enable_languages=`echo "${enable_languages}" | sed -e 's/[[ ,]][[ ,]]*/,/g' -e 's/,$//'` 1798 enable_languages=`echo "${enable_languages}" | sed -e 's/[[ ,]][[ ,]]*/,/g' -e 's/,$//'`
1801 1799
1802 # 'f95' is the old name for the 'fortran' language. We issue a warning 1800 # 'f95' is the old name for the 'fortran' language. We issue a warning
1803 # and make the substitution. 1801 # and make the substitution.
1804 case ,${enable_languages}, in 1802 case ,${enable_languages}, in
1805 *,f95,*) 1803 *,f95,*)
1806 echo configure.in: warning: 'f95' as language name is deprecated, use 'fortran' instead 1>&2 1804 echo configure.ac: warning: 'f95' as language name is deprecated, use 'fortran' instead 1>&2
1807 enable_languages=`echo "${enable_languages}" | sed -e 's/f95/fortran/g'` 1805 enable_languages=`echo "${enable_languages}" | sed -e 's/f95/fortran/g'`
1806 ;;
1807 esac
1808
1809 # If bootstrapping, C++ must be enabled.
1810 case ",$enable_languages,:$enable_bootstrap" in
1811 *,c++,*:*) ;;
1812 *:yes)
1813 if test -f ${srcdir}/gcc/cp/config-lang.in; then
1814 enable_languages="${enable_languages},c++"
1815 else
1816 AC_MSG_ERROR([bootstrapping requires c++ sources])
1817 fi
1808 ;; 1818 ;;
1809 esac 1819 esac
1810 1820
1811 # First scan to see if an enabled language requires some other language. 1821 # First scan to see if an enabled language requires some other language.
1812 # We assume that a given config-lang.in will list all the language 1822 # We assume that a given config-lang.in will list all the language
1821 # From the config-lang.in, get $language, $lang_requires, and 1831 # From the config-lang.in, get $language, $lang_requires, and
1822 # $lang_requires_boot_languages. 1832 # $lang_requires_boot_languages.
1823 language= 1833 language=
1824 lang_requires= 1834 lang_requires=
1825 lang_requires_boot_languages= 1835 lang_requires_boot_languages=
1826 . ${lang_frag} 1836 # set srcdir during sourcing lang_frag to the gcc dir.
1837 # Sadly overriding srcdir on the . line doesn't work in plain sh as it
1838 # polutes this shell
1839 saved_srcdir=${srcdir}
1840 srcdir=${srcdir}/gcc . ${lang_frag}
1841 srcdir=${saved_srcdir}
1827 for other in ${lang_requires} ${lang_requires_boot_languages}; do 1842 for other in ${lang_requires} ${lang_requires_boot_languages}; do
1828 case ,${enable_languages}, in 1843 case ,${enable_languages}, in
1829 *,$other,*) ;; 1844 *,$other,*) ;;
1845 *,default,*) ;;
1830 *,all,*) ;; 1846 *,all,*) ;;
1831 *,$language,*) 1847 *,$language,*)
1832 echo " \`$other' language required by \`$language'; enabling" 1>&2 1848 echo " \`$other' language required by \`$language'; enabling" 1>&2
1833 enable_languages="${enable_languages},${other}" 1849 enable_languages="${enable_languages},${other}"
1834 ;; 1850 ;;
1836 done 1852 done
1837 for other in ${lang_requires_boot_languages} ; do 1853 for other in ${lang_requires_boot_languages} ; do
1838 if test "$other" != "c"; then 1854 if test "$other" != "c"; then
1839 case ,${enable_stage1_languages}, in 1855 case ,${enable_stage1_languages}, in
1840 *,$other,*) ;; 1856 *,$other,*) ;;
1857 *,default,*) ;;
1841 *,all,*) ;; 1858 *,all,*) ;;
1842 *) 1859 *)
1843 case ,${enable_languages}, in 1860 case ,${enable_languages}, in
1844 *,$language,*) 1861 *,$language,*)
1845 echo " '$other' language required by '$language' in stage 1; enabling" 1>&2 1862 echo " '$other' language required by '$language' in stage 1; enabling" 1>&2
1855 done 1872 done
1856 1873
1857 new_enable_languages=,c, 1874 new_enable_languages=,c,
1858 1875
1859 # If LTO is enabled, add the LTO front end. 1876 # If LTO is enabled, add the LTO front end.
1860 extra_host_libiberty_configure_flags=
1861 if test "$enable_lto" = "yes" ; then 1877 if test "$enable_lto" = "yes" ; then
1862 case ,${enable_languages}, in 1878 case ,${enable_languages}, in
1863 *,lto,*) ;; 1879 *,lto,*) ;;
1864 *) enable_languages="${enable_languages},lto" ;; 1880 *) enable_languages="${enable_languages},lto" ;;
1865 esac 1881 esac
1866 if test "${build_lto_plugin}" = "yes" ; then 1882 if test "${build_lto_plugin}" = "yes" ; then
1867 configdirs="$configdirs lto-plugin" 1883 configdirs="$configdirs lto-plugin"
1868 extra_host_libiberty_configure_flags=--enable-shared
1869 fi 1884 fi
1870 fi 1885 fi
1871 AC_SUBST(extra_host_libiberty_configure_flags) 1886
1872 1887 # If we're building an offloading compiler, add the LTO front end.
1873 missing_languages=`echo ",$enable_languages," | sed -e s/,all,/,/ -e s/,c,/,/ ` 1888 if test x"$enable_as_accelerator_for" != x ; then
1889 case ,${enable_languages}, in
1890 *,lto,*) ;;
1891 *) enable_languages="${enable_languages},lto" ;;
1892 esac
1893 fi
1894
1895 missing_languages=`echo ",$enable_languages," | sed -e s/,default,/,/ -e s/,all,/,/ -e s/,c,/,/ `
1874 potential_languages=,c, 1896 potential_languages=,c,
1875 1897
1876 enabled_target_libs= 1898 enabled_target_libs=
1877 disabled_target_libs= 1899 disabled_target_libs=
1878 1900
1889 target_libs= 1911 target_libs=
1890 lang_dirs= 1912 lang_dirs=
1891 subdir_requires= 1913 subdir_requires=
1892 boot_language=no 1914 boot_language=no
1893 build_by_default=yes 1915 build_by_default=yes
1894 . ${lang_frag} 1916 # set srcdir during sourcing. See above about save & restore
1917 saved_srcdir=${srcdir}
1918 srcdir=${srcdir}/gcc . ${lang_frag}
1919 srcdir=${saved_srcdir}
1895 if test x${language} = x; then 1920 if test x${language} = x; then
1896 echo "${lang_frag} doesn't set \$language." 1>&2 1921 echo "${lang_frag} doesn't set \$language." 1>&2
1897 exit 1 1922 exit 1
1898 fi 1923 fi
1899 1924
1900 if test "$language" = "c++" \ 1925 if test "$language" = "c++"; then
1901 && test "$ENABLE_BUILD_WITH_CXX" = "yes"; then
1902 boot_language=yes 1926 boot_language=yes
1903 fi 1927 fi
1904 1928
1905 case ,${enable_languages}, in 1929 add_this_lang=no
1906 *,${language},*) 1930 # C is always enabled, so no need to add it again
1907 # Language was explicitly selected; include it. 1931 if test "$language" != "c"; then
1908 add_this_lang=yes 1932 case ,${enable_languages}, in
1909 ;; 1933 *,${language},*)
1910 *,all,*) 1934 # Language was explicitly selected; include it
1911 # 'all' was selected, select it if it is a default language 1935 add_this_lang=yes
1912 add_this_lang=${build_by_default} 1936 ;;
1913 ;; 1937 *,all,*)
1914 *) 1938 # All languages are enabled
1915 add_this_lang=no 1939 add_this_lang=all
1916 ;; 1940 ;;
1917 esac 1941 *,default,*)
1942 # 'default' was selected, select it if it is a default language
1943 add_this_lang=${build_by_default}
1944 ;;
1945 esac
1946 fi
1918 1947
1919 # Disable languages that need other directories if these aren't available. 1948 # Disable languages that need other directories if these aren't available.
1920 for i in $subdir_requires; do 1949 for i in $subdir_requires; do
1921 test -f "$srcdir/gcc/$i/config-lang.in" && continue 1950 test -f "$srcdir/gcc/$i/config-lang.in" && continue
1922 case ,${enable_languages}, in 1951 case ${add_this_lang} in
1923 *,${language},*) 1952 yes)
1924 # Specifically requested language; tell them. 1953 # Specifically requested language; tell them.
1925 AC_MSG_ERROR([The gcc/$i directory contains parts of $language but is missing]) 1954 AC_MSG_ERROR([The gcc/$i directory contains parts of $language but is missing])
1955 ;;
1956 all)
1957 AC_MSG_WARN([The gcc/$i directory contains parts of $language but is missing])
1958 add_this_lang=unsupported
1926 ;; 1959 ;;
1927 *) 1960 *)
1928 # Silently disable. 1961 # Silently disable.
1929 add_this_lang=unsupported 1962 add_this_lang=unsupported
1930 ;; 1963 ;;
1931 esac 1964 esac
1932 done 1965 done
1933 1966
1934 # Disable Ada if no preexisting GNAT is available. 1967 # Disable Ada if no preexisting GNAT is available.
1935 case ,${enable_languages},:${language}:${have_gnat} in 1968 case ${add_this_lang}:${language}:${have_gnat} in
1936 *,${language},*:ada:no) 1969 yes:ada:no)
1937 # Specifically requested language; tell them. 1970 # Specifically requested language; tell them.
1938 AC_MSG_ERROR([GNAT is required to build $language]) 1971 AC_MSG_ERROR([GNAT is required to build $language])
1972 ;;
1973 all:ada:no)
1974 AC_MSG_WARN([GNAT is required to build $language])
1975 add_this_lang=unsupported
1939 ;; 1976 ;;
1940 *:ada:no) 1977 *:ada:no)
1941 # Silently disable. 1978 # Silently disable.
1942 add_this_lang=unsupported 1979 add_this_lang=unsupported
1943 ;; 1980 ;;
1944 esac 1981 esac
1945 1982
1946 # Disable a language that is unsupported by the target. 1983 # Disable jit if -enable-host-shared not specified
1947 case " $unsupported_languages " in 1984 case ${add_this_lang}:${language}:${host_shared} in
1948 *" $language "*) 1985 yes:jit:no)
1986 # PR jit/64780: explicitly specify --enable-host-shared
1987 AC_MSG_ERROR([
1988 Enabling language "jit" requires --enable-host-shared.
1989
1990 --enable-host-shared typically slows the rest of the compiler down by
1991 a few %, so you must explicitly enable it.
1992
1993 If you want to build both the jit and the regular compiler, it is often
1994 best to do this via two separate configure/builds, in separate
1995 directories, to avoid imposing the performance cost of
1996 --enable-host-shared on the regular compiler.])
1997 ;;
1998 all:jit:no)
1999 AC_MSG_WARN([--enable-host-shared required to build $language])
2000 add_this_lang=unsupported
2001 ;;
2002 *:jit:no)
2003 # Silently disable.
2004 add_this_lang=unsupported
2005 ;;
2006 esac
2007
2008 # Disable a language that is unsupported by the target.
2009 case "${add_this_lang}: $unsupported_languages " in
2010 no:*) ;;
2011 unsupported:*) ;;
2012 *:*" $language "*)
2013 AC_MSG_WARN([${language} not supported for this target])
1949 add_this_lang=unsupported 2014 add_this_lang=unsupported
1950 ;; 2015 ;;
1951 esac 2016 esac
1952 2017
1953 case $add_this_lang in 2018 case $add_this_lang in
1960 # Remove language-dependent dirs; still show language as supported. 2025 # Remove language-dependent dirs; still show language as supported.
1961 disabled_target_libs="$disabled_target_libs $target_libs" 2026 disabled_target_libs="$disabled_target_libs $target_libs"
1962 noconfigdirs="$noconfigdirs $lang_dirs" 2027 noconfigdirs="$noconfigdirs $lang_dirs"
1963 potential_languages="${potential_languages}${language}," 2028 potential_languages="${potential_languages}${language},"
1964 ;; 2029 ;;
1965 yes) 2030 all|yes)
1966 new_enable_languages="${new_enable_languages}${language}," 2031 new_enable_languages="${new_enable_languages}${language},"
1967 potential_languages="${potential_languages}${language}," 2032 potential_languages="${potential_languages}${language},"
1968 missing_languages=`echo "$missing_languages" | sed "s/,$language,/,/"` 2033 missing_languages=`echo "$missing_languages" | sed "s/,$language,/,/"`
1969 enabled_target_libs="$enabled_target_libs $target_libs" 2034 enabled_target_libs="$enabled_target_libs $target_libs"
1970 case "${boot_language}:,$enable_stage1_languages," in 2035 case "${boot_language}:,$enable_stage1_languages," in
2059 2124
2060 # Check for Boehm's garbage collector 2125 # Check for Boehm's garbage collector
2061 AC_ARG_ENABLE(objc-gc, 2126 AC_ARG_ENABLE(objc-gc,
2062 [AS_HELP_STRING([--enable-objc-gc], 2127 [AS_HELP_STRING([--enable-objc-gc],
2063 [enable use of Boehm's garbage collector with the 2128 [enable use of Boehm's garbage collector with the
2064 GNU Objective-C runtime])], 2129 GNU Objective-C runtime])])
2065 [case ,${enable_languages},:${enable_objc_gc}:${noconfigdirs} in 2130 AC_ARG_WITH([target-bdw-gc],
2066 *,objc,*:*:yes:*target-boehm-gc*) 2131 [AS_HELP_STRING([--with-target-bdw-gc=PATHLIST],
2067 AC_MSG_ERROR([Boehm's garbage collector was requested yet not supported in this configuration]) 2132 [specify prefix directory for installed bdw-gc package.
2068 ;; 2133 Equivalent to --with-target-bdw-gc-include=PATH/include
2069 esac]) 2134 plus --with-target-bdw-gc-lib=PATH/lib])])
2070 2135 AC_ARG_WITH([target-bdw-gc-include],
2071 # Make sure we only build Boehm's garbage collector if required. 2136 [AS_HELP_STRING([--with-target-bdw-gc-include=PATHLIST],
2072 case ,${enable_languages},:${enable_objc_gc} in 2137 [specify directories for installed bdw-gc include files])])
2073 *,objc,*:yes) 2138 AC_ARG_WITH([target-bdw-gc-lib],
2074 # Keep target-boehm-gc if requested for Objective-C. 2139 [AS_HELP_STRING([--with-target-bdw-gc-lib=PATHLIST],
2140 [specify directories for installed bdw-gc library])])
2141
2142 case ,${enable_languages},:${enable_objc_gc} in *,objc,*:yes|*,objc,*:auto)
2143 AC_MSG_CHECKING([for bdw garbage collector])
2144 if test "x$with_target_bdw_gc$with_target_bdw_gc_include$with_target_bdw_gc_lib" = x; then
2145 dnl no bdw-gw options, assume default locations
2146 AC_MSG_RESULT([using bdw-gc in default locations])
2147 else
2148 dnl bdw-gw options, first error checking, complete checking in libobjc
2149 if test "x$with_target_bdw_gc_include" = x && test "x$with_target_bdw_gc_lib" != x; then
2150 AC_MSG_ERROR([found --with-target-bdw-gc-lib but --with-target-bdw-gc-include missing])
2151 elif test "x$with_target_bdw_gc_include" != x && test "x$with_target_bdw_gc_lib" = x; then
2152 AC_MSG_ERROR([found --with-target-bdw-gc-include but --with-target-bdw-gc-lib missing])
2153 else
2154 AC_MSG_RESULT([using paths configured with --with-target-bdw-gc options])
2155 fi
2156 fi
2157 esac
2158
2159 # Disable libcilkrts, libitm, libsanitizer, libvtv, liboffloadmic if we're not building C++
2160 case ,${enable_languages}, in
2161 *,c++,*)
2162 # Disable libcilkrts, libitm, libsanitizer if we're not building libstdc++
2163 case "${noconfigdirs}" in
2164 *target-libstdc++-v3*)
2165 noconfigdirs="$noconfigdirs target-libcilkrts target-libitm target-libsanitizer"
2166 ;;
2167 *) ;;
2168 esac
2075 ;; 2169 ;;
2076 *) 2170 *)
2077 # Otherwise remove target-boehm-gc depending on target-libjava. 2171 noconfigdirs="$noconfigdirs target-libcilkrts target-liboffloadmic target-libitm target-libsanitizer target-libvtv"
2078 if echo " ${noconfigdirs} " | grep "target-libjava" >/dev/null 2>&1; then
2079 noconfigdirs="$noconfigdirs target-boehm-gc"
2080 fi
2081 ;; 2172 ;;
2082 esac 2173 esac
2083 2174
2084 # Remove the entries in $skipdirs and $noconfigdirs from $configdirs, 2175 # Remove the entries in $skipdirs and $noconfigdirs from $configdirs,
2085 # $build_configdirs and $target_configdirs. 2176 # $build_configdirs and $target_configdirs.
2118 fi 2209 fi
2119 fi 2210 fi
2120 fi 2211 fi
2121 done 2212 done
2122 2213
2123 # Sometimes the tools are distributed with libiberty but with no other
2124 # libraries. In that case, we don't want to build target-libiberty.
2125 # Don't let libgcc imply libiberty either.
2126 if test -n "${target_configdirs}" ; then
2127 libgcc=
2128 others=
2129 for i in `echo ${target_configdirs} | sed -e s/target-//g` ; do
2130 if test "$i" = "libgcc"; then
2131 libgcc=target-libgcc
2132 elif test "$i" != "libiberty" ; then
2133 if test -r $srcdir/$i/configure ; then
2134 others=yes;
2135 break;
2136 fi
2137 fi
2138 done
2139 if test -z "${others}" ; then
2140 target_configdirs=$libgcc
2141 fi
2142 fi
2143
2144 # Quietly strip out all directories which aren't configurable in this tree. 2214 # Quietly strip out all directories which aren't configurable in this tree.
2145 # This relies on all configurable subdirectories being autoconfiscated, which 2215 # This relies on all configurable subdirectories being autoconfiscated, which
2146 # is now the case. 2216 # is now the case.
2147 build_configdirs_all="$build_configdirs" 2217 build_configdirs_all="$build_configdirs"
2148 build_configdirs= 2218 build_configdirs=
2167 j=`echo $i | sed -e s/target-//g` 2237 j=`echo $i | sed -e s/target-//g`
2168 if test -f ${srcdir}/$j/configure ; then 2238 if test -f ${srcdir}/$j/configure ; then
2169 target_configdirs="${target_configdirs} $i" 2239 target_configdirs="${target_configdirs} $i"
2170 fi 2240 fi
2171 done 2241 done
2242
2243 # libiberty-linker-plugin is special: it doesn't have its own source directory,
2244 # so we have to add it after the preceding checks.
2245 if test x"$extra_linker_plugin_flags$extra_linker_plugin_configure_flags" != x
2246 then
2247 case " $configdirs " in
2248 *" libiberty "*)
2249 # If we can build libiberty, we can also build libiberty-linker-plugin.
2250 configdirs="$configdirs libiberty-linker-plugin"
2251 extra_linker_plugin_configure_flags="$extra_linker_plugin_configure_flags \
2252 --with-libiberty=../libiberty-linker-plugin";;
2253 *)
2254 AC_MSG_ERROR([libiberty missing]);;
2255 esac
2256 fi
2257
2258 # Sometimes we have special requirements for the host libiberty.
2259 extra_host_libiberty_configure_flags=
2260 extra_host_zlib_configure_flags=
2261 case " $configdirs " in
2262 *" lto-plugin "* | *" libcc1 "*)
2263 # When these are to be built as shared libraries, the same applies to
2264 # libiberty.
2265 extra_host_libiberty_configure_flags=--enable-shared
2266 ;;
2267 *" bfd "*)
2268 # When bfd is to be built as a shared library, the same applies to
2269 # zlib.
2270 if test "$enable_shared" = "yes"; then
2271 extra_host_zlib_configure_flags=--enable-host-shared
2272 fi
2273 ;;
2274 esac
2275 AC_SUBST(extra_host_libiberty_configure_flags)
2276 AC_SUBST(extra_host_zlib_configure_flags)
2172 2277
2173 # Produce a warning message for the subdirs we can't configure. 2278 # Produce a warning message for the subdirs we can't configure.
2174 # This isn't especially interesting in the Cygnus tree, but in the individual 2279 # This isn't especially interesting in the Cygnus tree, but in the individual
2175 # FSF releases, it's important to let people know when their machine isn't 2280 # FSF releases, it's important to let people know when their machine isn't
2176 # supported by the one or two programs in a package. 2281 # supported by the one or two programs in a package.
2241 # might also be empty (or "-g", if a non-GCC C++ compiler is in the path). 2346 # might also be empty (or "-g", if a non-GCC C++ compiler is in the path).
2242 # We want to ensure that TARGET libraries (which we know are built with 2347 # We want to ensure that TARGET libraries (which we know are built with
2243 # gcc) are built with "-O2 -g", so include those options when setting 2348 # gcc) are built with "-O2 -g", so include those options when setting
2244 # CFLAGS_FOR_TARGET and CXXFLAGS_FOR_TARGET. 2349 # CFLAGS_FOR_TARGET and CXXFLAGS_FOR_TARGET.
2245 if test "x$CFLAGS_FOR_TARGET" = x; then 2350 if test "x$CFLAGS_FOR_TARGET" = x; then
2246 CFLAGS_FOR_TARGET=$CFLAGS 2351 if test "x${is_cross_compiler}" = xyes; then
2247 case " $CFLAGS " in 2352 CFLAGS_FOR_TARGET="-g -O2"
2248 *" -O2 "*) ;; 2353 else
2249 *) CFLAGS_FOR_TARGET="-O2 $CFLAGS" ;; 2354 CFLAGS_FOR_TARGET=$CFLAGS
2250 esac 2355 case " $CFLAGS " in
2251 case " $CFLAGS " in 2356 *" -O2 "*) ;;
2252 *" -g "* | *" -g3 "*) ;; 2357 *) CFLAGS_FOR_TARGET="-O2 $CFLAGS_FOR_TARGET" ;;
2253 *) CFLAGS_FOR_TARGET="-g $CFLAGS" ;; 2358 esac
2254 esac 2359 case " $CFLAGS " in
2360 *" -g "* | *" -g3 "*) ;;
2361 *) CFLAGS_FOR_TARGET="-g $CFLAGS_FOR_TARGET" ;;
2362 esac
2363 fi
2255 fi 2364 fi
2256 AC_SUBST(CFLAGS_FOR_TARGET) 2365 AC_SUBST(CFLAGS_FOR_TARGET)
2257 2366
2258 if test "x$CXXFLAGS_FOR_TARGET" = x; then 2367 if test "x$CXXFLAGS_FOR_TARGET" = x; then
2259 CXXFLAGS_FOR_TARGET=$CXXFLAGS 2368 if test "x${is_cross_compiler}" = xyes; then
2260 case " $CXXFLAGS " in 2369 CXXFLAGS_FOR_TARGET="-g -O2"
2261 *" -O2 "*) ;; 2370 else
2262 *) CXXFLAGS_FOR_TARGET="-O2 $CXXFLAGS" ;; 2371 CXXFLAGS_FOR_TARGET=$CXXFLAGS
2263 esac 2372 case " $CXXFLAGS " in
2264 case " $CXXFLAGS " in 2373 *" -O2 "*) ;;
2265 *" -g "* | *" -g3 "*) ;; 2374 *) CXXFLAGS_FOR_TARGET="-O2 $CXXFLAGS_FOR_TARGET" ;;
2266 *) CXXFLAGS_FOR_TARGET="-g $CXXFLAGS" ;; 2375 esac
2267 esac 2376 case " $CXXFLAGS " in
2377 *" -g "* | *" -g3 "*) ;;
2378 *) CXXFLAGS_FOR_TARGET="-g $CXXFLAGS_FOR_TARGET" ;;
2379 esac
2380 fi
2268 fi 2381 fi
2269 AC_SUBST(CXXFLAGS_FOR_TARGET) 2382 AC_SUBST(CXXFLAGS_FOR_TARGET)
2383
2384 AC_SUBST(LDFLAGS_FOR_TARGET)
2270 2385
2271 # Handle --with-headers=XXX. If the value is not "yes", the contents of 2386 # Handle --with-headers=XXX. If the value is not "yes", the contents of
2272 # the named directory are copied to $(tooldir)/sys-include. 2387 # the named directory are copied to $(tooldir)/sys-include.
2273 if test x"${with_headers}" != x && test x"${with_headers}" != xno ; then 2388 if test x"${with_headers}" != x && test x"${with_headers}" != xno ; then
2274 if test x${is_cross_compiler} = xno ; then 2389 if test x${is_cross_compiler} = xno ; then
2304 # This is done by determining whether or not the appropriate directory 2419 # This is done by determining whether or not the appropriate directory
2305 # is available, and by checking whether or not specific configurations 2420 # is available, and by checking whether or not specific configurations
2306 # have requested that this magic not happen. 2421 # have requested that this magic not happen.
2307 # 2422 #
2308 # The command line options always override the explicit settings in 2423 # The command line options always override the explicit settings in
2309 # configure.in, and the settings in configure.in override this magic. 2424 # configure.ac, and the settings in configure.ac override this magic.
2310 # 2425 #
2311 # If the default for a toolchain is to use GNU as and ld, and you don't 2426 # If the default for a toolchain is to use GNU as and ld, and you don't
2312 # want to do that, then you should use the --without-gnu-as and 2427 # want to do that, then you should use the --without-gnu-as and
2313 # --without-gnu-ld options for the configure script. Similarly, if 2428 # --without-gnu-ld options for the configure script. Similarly, if
2314 # the default is to use the included zlib and you don't want to do that, 2429 # the default is to use the included zlib and you don't want to do that,
2376 # Determine a target-dependent exec_prefix that the installed 2491 # Determine a target-dependent exec_prefix that the installed
2377 # gcc will search in. Keep this list sorted by triplet, with 2492 # gcc will search in. Keep this list sorted by triplet, with
2378 # the *-*-osname triplets last. 2493 # the *-*-osname triplets last.
2379 md_exec_prefix= 2494 md_exec_prefix=
2380 case "${target}" in 2495 case "${target}" in
2381 alpha*-*-*vms*)
2382 md_exec_prefix=/gnu/lib/gcc-lib
2383 ;;
2384 i[[34567]]86-pc-msdosdjgpp*) 2496 i[[34567]]86-pc-msdosdjgpp*)
2385 md_exec_prefix=/dev/env/DJDIR/bin 2497 md_exec_prefix=/dev/env/DJDIR/bin
2386 ;; 2498 ;;
2387 i[[34567]]86-*-sco3.2v5*)
2388 if test $with_gnu_as = yes; then
2389 md_exec_prefix=/usr/gnu/bin
2390 else
2391 md_exec_prefix=/usr/ccs/bin/elf
2392 fi
2393 ;;
2394
2395 mn10300-*-* | \
2396 powerpc-*-chorusos* | \
2397 powerpc*-*-eabi* | \
2398 powerpc*-*-sysv* | \
2399 powerpc*-*-kaos* | \
2400 s390x-ibm-tpf*)
2401 md_exec_prefix=/usr/ccs/bin
2402 ;;
2403 sparc64-*-elf*)
2404 ;;
2405 v850*-*-*)
2406 md_exec_prefix=/usr/ccs/bin
2407 ;;
2408 xtensa*-*-elf*)
2409 ;;
2410
2411 *-*-beos* | \
2412 *-*-elf* | \
2413 *-*-hpux* | \ 2499 *-*-hpux* | \
2414 *-*-netware* | \
2415 *-*-nto-qnx* | \ 2500 *-*-nto-qnx* | \
2416 *-*-rtems* | \ 2501 *-*-solaris2*)
2417 *-*-solaris2* | \
2418 *-*-sysv[[45]]* | \
2419 *-*-vxworks* | \
2420 *-wrs-windiss)
2421 md_exec_prefix=/usr/ccs/bin 2502 md_exec_prefix=/usr/ccs/bin
2422 ;; 2503 ;;
2423 esac 2504 esac
2424 2505
2425 extra_arflags_for_target= 2506 extra_arflags_for_target=
2426 extra_nmflags_for_target= 2507 extra_nmflags_for_target=
2427 extra_ranlibflags_for_target= 2508 extra_ranlibflags_for_target=
2428 target_makefile_frag=/dev/null 2509 target_makefile_frag=/dev/null
2429 case "${target}" in 2510 case "${target}" in
2430 mep*-*-*)
2431 target_makefile_frag="config/mt-mep"
2432 ;;
2433 spu-*-*) 2511 spu-*-*)
2434 target_makefile_frag="config/mt-spu" 2512 target_makefile_frag="config/mt-spu"
2435 ;; 2513 ;;
2436 mips*-sde-elf*) 2514 mips*-sde-elf* | mips*-mti-elf* | mips*-img-elf*)
2437 target_makefile_frag="config/mt-sde" 2515 target_makefile_frag="config/mt-sde"
2438 ;; 2516 ;;
2439 mipsisa*-*-elfoabi*) 2517 mipsisa*-*-elfoabi*)
2440 target_makefile_frag="config/mt-mips-elfoabi" 2518 target_makefile_frag="config/mt-mips-elfoabi"
2441 ;; 2519 ;;
2442 mips*-*-*linux* | mips*-*-gnu*) 2520 mips*-*-*linux* | mips*-*-gnu*)
2443 target_makefile_frag="config/mt-mips-gnu" 2521 target_makefile_frag="config/mt-mips-gnu"
2444 ;; 2522 ;;
2445 *-*-netware*) 2523 nios2-*-elf*)
2446 target_makefile_frag="config/mt-netware" 2524 target_makefile_frag="config/mt-nios2-elf"
2525 ;;
2526 *-*-linux-android*)
2527 target_makefile_frag="config/mt-android"
2447 ;; 2528 ;;
2448 *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu | *-*-kopensolaris*-gnu) 2529 *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu | *-*-kopensolaris*-gnu)
2449 target_makefile_frag="config/mt-gnu" 2530 target_makefile_frag="config/mt-gnu"
2450 ;; 2531 ;;
2451 *-*-aix4.[[3456789]]* | *-*-aix[[56789]].*) 2532 *-*-aix4.[[3456789]]* | *-*-aix[[56789]].*)
2452 # nm and ar from AIX 4.3 and above require -X32_64 flag to all ar and nm 2533 # nm and ar from AIX 4.3 and above require -X32_64 flag to all ar and nm
2453 # commands to handle both 32-bit and 64-bit objects. These flags are 2534 # commands to handle both 32-bit and 64-bit objects. These flags are
2454 # harmless if we're using GNU nm or ar. 2535 # harmless if we're using GNU nm or ar.
2455 extra_arflags_for_target=" -X32_64" 2536 extra_arflags_for_target=" -X32_64"
2456 extra_nmflags_for_target=" -B -X32_64" 2537 extra_nmflags_for_target=" -B -X32_64"
2457 ;;
2458 *-*-darwin[[3-9]]*)
2459 # ranlib before Darwin10 requires the -c flag to look at common symbols.
2460 extra_ranlibflags_for_target=" -c"
2461 ;;
2462 mips*-*-pe | sh*-*-pe | *arm-wince-pe)
2463 target_makefile_frag="config/mt-wince"
2464 ;; 2538 ;;
2465 esac 2539 esac
2466 2540
2467 alphaieee_frag=/dev/null 2541 alphaieee_frag=/dev/null
2468 case $target in 2542 case $target in
2482 ospace_frag="config/mt-ospace" 2556 ospace_frag="config/mt-ospace"
2483 ;; 2557 ;;
2484 :d30v-*) 2558 :d30v-*)
2485 ospace_frag="config/mt-d30v" 2559 ospace_frag="config/mt-d30v"
2486 ;; 2560 ;;
2487 :m32r-* | :d10v-* | :fr30-*) 2561 :m32r-* | :d10v-* | :fr30-* | :i?86*-*-elfiamcu)
2488 ospace_frag="config/mt-ospace" 2562 ospace_frag="config/mt-ospace"
2489 ;; 2563 ;;
2490 no:* | :*) 2564 no:* | :*)
2491 ;; 2565 ;;
2492 *) 2566 *)
2493 echo "*** bad value \"${enable_target_optspace}\" for --enable-target-optspace flag; ignored" 1>&2 2567 echo "*** bad value \"${enable_target_optspace}\" for --enable-target-optspace flag; ignored" 1>&2
2494 ;;
2495 esac
2496
2497 # Default to using --with-stabs for certain targets.
2498 if test x${with_stabs} = x ; then
2499 case "${target}" in
2500 mips*-*-irix[[56]]*)
2501 ;;
2502 mips*-*-* | alpha*-*-osf*)
2503 with_stabs=yes;
2504 extra_host_args="${extra_host_args} --with-stabs"
2505 ;;
2506 esac
2507 fi
2508
2509 # hpux11 in 64bit mode has libraries in a weird place. Arrange to find
2510 # them automatically.
2511 case "${host}" in
2512 hppa*64*-*-hpux11*)
2513 extra_host_args="$extra_host_args -x-libraries=/usr/lib/pa20_64 -x-includes=/usr/X11R6/include"
2514 ;; 2568 ;;
2515 esac 2569 esac
2516 2570
2517 # Some systems (e.g., one of the i386-aix systems the gas testers are 2571 # Some systems (e.g., one of the i386-aix systems the gas testers are
2518 # using) don't handle "\$" correctly, so don't use it here. 2572 # using) don't handle "\$" correctly, so don't use it here.
2555 exit 1 2609 exit 1
2556 ;; 2610 ;;
2557 esac 2611 esac
2558 rm -f conftest* 2612 rm -f conftest*
2559 2613
2560 # The Solaris /usr/ucb/cc compiler does not appear to work.
2561 case "${host}" in
2562 sparc-sun-solaris2*)
2563 CCBASE="`echo ${CC-cc} | sed 's/ .*$//'`"
2564 if test "`type $CCBASE | sed 's/^[[^/]]*//'`" = "/usr/ucb/cc" ; then
2565 could_use=
2566 test -d /opt/SUNWspro/bin && could_use="/opt/SUNWspro/bin"
2567 if test -d /opt/cygnus/bin ; then
2568 if test "$could_use" = "" ; then
2569 could_use="/opt/cygnus/bin"
2570 else
2571 could_use="$could_use or /opt/cygnus/bin"
2572 fi
2573 fi
2574 if test "$could_use" = "" ; then
2575 echo "Warning: compilation may fail because you're using"
2576 echo "/usr/ucb/cc. You should change your PATH or CC "
2577 echo "variable and rerun configure."
2578 else
2579 echo "Warning: compilation may fail because you're using"
2580 echo "/usr/ucb/cc, when you should use the C compiler from"
2581 echo "$could_use. You should change your"
2582 echo "PATH or CC variable and rerun configure."
2583 fi
2584 fi
2585 ;;
2586 esac
2587
2588 # Decide which environment variable is used to find dynamic libraries. 2614 # Decide which environment variable is used to find dynamic libraries.
2589 case "${host}" in 2615 case "${host}" in
2590 *-*-hpux*) RPATH_ENVVAR=SHLIB_PATH ;; 2616 *-*-hpux*) RPATH_ENVVAR=SHLIB_PATH ;;
2591 *-*-darwin* | *-*-rhapsody* ) RPATH_ENVVAR=DYLD_LIBRARY_PATH ;; 2617 *-*-darwin*) RPATH_ENVVAR=DYLD_LIBRARY_PATH ;;
2592 *-*-mingw* | *-*-cygwin ) RPATH_ENVVAR=PATH ;; 2618 *-*-mingw* | *-*-cygwin ) RPATH_ENVVAR=PATH ;;
2593 *) RPATH_ENVVAR=LD_LIBRARY_PATH ;; 2619 *) RPATH_ENVVAR=LD_LIBRARY_PATH ;;
2594 esac 2620 esac
2595 2621
2596 # On systems where the dynamic library environment variable is PATH, 2622 # On systems where the dynamic library environment variable is PATH,
2599 if test "$RPATH_ENVVAR" = PATH; then 2625 if test "$RPATH_ENVVAR" = PATH; then
2600 GCC_SHLIB_SUBDIR=/shlib 2626 GCC_SHLIB_SUBDIR=/shlib
2601 else 2627 else
2602 GCC_SHLIB_SUBDIR= 2628 GCC_SHLIB_SUBDIR=
2603 fi 2629 fi
2604
2605 # Record target_configdirs and the configure arguments for target and
2606 # build configuration in Makefile.
2607 target_configdirs=`echo "${target_configdirs}" | sed -e 's/target-//g'`
2608 build_configdirs=`echo "${build_configdirs}" | sed -e 's/build-//g'`
2609
2610 # If we are building libgomp, bootstrap it.
2611 if echo " ${target_configdirs} " | grep " libgomp " > /dev/null 2>&1 ; then
2612 bootstrap_target_libs=${bootstrap_target_libs}target-libgomp,
2613 fi
2614
2615 # Determine whether gdb needs tk/tcl or not.
2616 # Use 'maybe' since enable_gdbtk might be true even if tk isn't available
2617 # and in that case we want gdb to be built without tk. Ugh!
2618 # In fact I believe gdb is the *only* package directly dependent on tk,
2619 # so we should be able to put the 'maybe's in unconditionally and
2620 # leave out the maybe dependencies when enable_gdbtk is false. I'm not
2621 # 100% sure that that's safe though.
2622
2623 gdb_tk="maybe-all-tcl maybe-all-tk maybe-all-itcl maybe-all-libgui"
2624 case "$enable_gdbtk" in
2625 no)
2626 GDB_TK="" ;;
2627 yes)
2628 GDB_TK="${gdb_tk}" ;;
2629 *)
2630 # Only add the dependency on gdbtk when GDBtk is part of the gdb
2631 # distro. Eventually someone will fix this and move Insight, nee
2632 # gdbtk to a separate directory.
2633 if test -d ${srcdir}/gdb/gdbtk ; then
2634 GDB_TK="${gdb_tk}"
2635 else
2636 GDB_TK=""
2637 fi
2638 ;;
2639 esac
2640 CONFIGURE_GDB_TK=`echo ${GDB_TK} | sed s/-all-/-configure-/g`
2641 INSTALL_GDB_TK=`echo ${GDB_TK} | sed s/-all-/-install-/g`
2642
2643 # Strip out unwanted targets.
2644
2645 # While at that, we remove Makefiles if we were started for recursive
2646 # configuration, so that the top-level Makefile reconfigures them,
2647 # like we used to do when configure itself was recursive.
2648
2649 # Loop over modules. We used to use the "$extrasub" feature from Autoconf
2650 # but now we're fixing up the Makefile ourselves with the additional
2651 # commands passed to AC_CONFIG_FILES. Use separate variables
2652 # extrasub-{build,host,target} not because there is any reason to split
2653 # the substitutions up that way, but only to remain below the limit of
2654 # 99 commands in a script, for HP-UX sed.
2655 # Do not nest @if/@endif pairs, because configure will not warn you at all.
2656
2657 AC_ARG_ENABLE([bootstrap],
2658 [AS_HELP_STRING([--enable-bootstrap],
2659 [enable bootstrapping @<:@yes if native build@:>@])],,
2660 enable_bootstrap=default)
2661
2662 # Issue errors and warnings for invalid/strange bootstrap combinations.
2663 case "$configdirs" in
2664 *gcc*) have_compiler=yes ;;
2665 *) have_compiler=no ;;
2666 esac
2667
2668 case "$have_compiler:$host:$target:$enable_bootstrap" in
2669 *:*:*:no) ;;
2670
2671 # Default behavior. Enable bootstrap if we have a compiler
2672 # and we are in a native configuration.
2673 yes:$build:$build:default)
2674 enable_bootstrap=yes ;;
2675
2676 *:*:*:default)
2677 enable_bootstrap=no ;;
2678
2679 # We have a compiler and we are in a native configuration, bootstrap is ok
2680 yes:$build:$build:yes)
2681 ;;
2682
2683 # Other configurations, but we have a compiler. Assume the user knows
2684 # what he's doing.
2685 yes:*:*:yes)
2686 AC_MSG_WARN([trying to bootstrap a cross compiler])
2687 ;;
2688
2689 # No compiler: if they passed --enable-bootstrap explicitly, fail
2690 no:*:*:yes)
2691 AC_MSG_ERROR([cannot bootstrap without a compiler]) ;;
2692
2693 # Fail if wrong command line
2694 *)
2695 AC_MSG_ERROR([invalid option for --enable-bootstrap])
2696 ;;
2697 esac
2698
2699 case ",$enable_languages,:$ENABLE_BUILD_WITH_CXX:$enable_bootstrap" in
2700 *,c++,*:yes:yes) ;;
2701 *:yes:yes)
2702 AC_MSG_ERROR([bootstrapping with --enable-build-with-cxx requires c++ in --enable-languages])
2703 ;;
2704 esac
2705
2706 case "$enable_bootstrap:$ENABLE_GOLD: $configdirs :,$stage1_languages," in
2707 yes:yes:*\ gold\ *:*,c++,*) ;;
2708 yes:yes:*\ gold\ *:*)
2709 AC_MSG_ERROR([in a combined tree, bootstrapping with --enable-gold requires c++ in stage1_languages])
2710 ;;
2711 esac
2712 2630
2713 # Adjust the toplevel makefile according to whether bootstrap was selected. 2631 # Adjust the toplevel makefile according to whether bootstrap was selected.
2714 case $enable_bootstrap in 2632 case $enable_bootstrap in
2715 yes) 2633 yes)
2716 bootstrap_suffix=bootstrap 2634 bootstrap_suffix=bootstrap
2752 esac 2670 esac
2753 fi 2671 fi
2754 AC_MSG_RESULT($BUILD_CONFIG) 2672 AC_MSG_RESULT($BUILD_CONFIG)
2755 AC_SUBST(BUILD_CONFIG) 2673 AC_SUBST(BUILD_CONFIG)
2756 2674
2675 # Use same top-level configure hooks in libgcc/libstdc++/libvtv.
2676 AC_MSG_CHECKING([for --enable-vtable-verify])
2677 AC_ARG_ENABLE(vtable-verify,
2678 [AS_HELP_STRING([--enable-vtable-verify],
2679 [Enable vtable verification feature])],
2680 [case "$enableval" in
2681 yes) enable_vtable_verify=yes ;;
2682 no) enable_vtable_verify=no ;;
2683 *) enable_vtable_verify=no;;
2684 esac],
2685 [enable_vtable_verify=no])
2686 AC_MSG_RESULT($enable_vtable_verify)
2687
2688 # Record target_configdirs and the configure arguments for target and
2689 # build configuration in Makefile.
2690 target_configdirs=`echo "${target_configdirs}" | sed -e 's/target-//g'`
2691 build_configdirs=`echo "${build_configdirs}" | sed -e 's/build-//g'`
2692 bootstrap_fixincludes=no
2693
2694 # If we are building libgomp, bootstrap it.
2695 if echo " ${target_configdirs} " | grep " libgomp " > /dev/null 2>&1 ; then
2696 bootstrap_target_libs=${bootstrap_target_libs}target-libgomp,
2697 fi
2698
2699 # If we are building libsanitizer and $BUILD_CONFIG contains bootstrap-asan
2700 # or bootstrap-ubsan, bootstrap it.
2701 if echo " ${target_configdirs} " | grep " libsanitizer " > /dev/null 2>&1; then
2702 case "$BUILD_CONFIG" in
2703 *bootstrap-asan* | *bootstrap-ubsan* )
2704 bootstrap_target_libs=${bootstrap_target_libs}target-libsanitizer,
2705 bootstrap_fixincludes=yes
2706 ;;
2707 esac
2708 fi
2709
2710 # If we are building libvtv and --enable-vtable-verify, bootstrap it.
2711 if echo " ${target_configdirs} " | grep " libvtv " > /dev/null 2>&1 &&
2712 test "$enable_vtable_verify" != no; then
2713 bootstrap_target_libs=${bootstrap_target_libs}target-libvtv,
2714 fi
2715
2716 # If we are building libmpx and $BUILD_CONFIG contains bootstrap-mpx,
2717 # bootstrap it.
2718 if echo " ${target_configdirs} " | grep " libmpx " > /dev/null 2>&1; then
2719 case "$BUILD_CONFIG" in
2720 *bootstrap-mpx* )
2721 bootstrap_target_libs=${bootstrap_target_libs}target-libmpx,
2722 ;;
2723 esac
2724 fi
2725
2726 # Determine whether gdb needs tk/tcl or not.
2727 # Use 'maybe' since enable_gdbtk might be true even if tk isn't available
2728 # and in that case we want gdb to be built without tk. Ugh!
2729 # In fact I believe gdb is the *only* package directly dependent on tk,
2730 # so we should be able to put the 'maybe's in unconditionally and
2731 # leave out the maybe dependencies when enable_gdbtk is false. I'm not
2732 # 100% sure that that's safe though.
2733
2734 gdb_tk="maybe-all-tcl maybe-all-tk maybe-all-itcl maybe-all-libgui"
2735 case "$enable_gdbtk" in
2736 no)
2737 GDB_TK="" ;;
2738 yes)
2739 GDB_TK="${gdb_tk}" ;;
2740 *)
2741 # Only add the dependency on gdbtk when GDBtk is part of the gdb
2742 # distro. Eventually someone will fix this and move Insight, nee
2743 # gdbtk to a separate directory.
2744 if test -d ${srcdir}/gdb/gdbtk ; then
2745 GDB_TK="${gdb_tk}"
2746 else
2747 GDB_TK=""
2748 fi
2749 ;;
2750 esac
2751 CONFIGURE_GDB_TK=`echo ${GDB_TK} | sed s/-all-/-configure-/g`
2752 INSTALL_GDB_TK=`echo ${GDB_TK} | sed s/-all-/-install-/g`
2753
2754 # Strip out unwanted targets.
2755
2756 # While at that, we remove Makefiles if we were started for recursive
2757 # configuration, so that the top-level Makefile reconfigures them,
2758 # like we used to do when configure itself was recursive.
2759
2760 # Loop over modules. We used to use the "$extrasub" feature from Autoconf
2761 # but now we're fixing up the Makefile ourselves with the additional
2762 # commands passed to AC_CONFIG_FILES. Use separate variables
2763 # extrasub-{build,host,target} not because there is any reason to split
2764 # the substitutions up that way, but only to remain below the limit of
2765 # 99 commands in a script, for HP-UX sed.
2766 # Do not nest @if/@endif pairs, because configure will not warn you at all.
2767
2768 case "$enable_bootstrap:$ENABLE_GOLD: $configdirs :,$stage1_languages," in
2769 yes:yes:*\ gold\ *:*,c++,*) ;;
2770 yes:yes:*\ gold\ *:*)
2771 AC_MSG_ERROR([in a combined tree, bootstrapping with --enable-gold requires c++ in stage1_languages])
2772 ;;
2773 esac
2774
2757 extrasub_build= 2775 extrasub_build=
2758 for module in ${build_configdirs} ; do 2776 for module in ${build_configdirs} ; do
2759 if test -z "${no_recursion}" \ 2777 if test -z "${no_recursion}" \
2760 && test -f ${build_subdir}/${module}/Makefile; then 2778 && test -f ${build_subdir}/${module}/Makefile; then
2761 echo 1>&2 "*** removing ${build_subdir}/${module}/Makefile to force reconfigure" 2779 echo 1>&2 "*** removing ${build_subdir}/${module}/Makefile to force reconfigure"
2775 echo 1>&2 "*** removing ${file} to force reconfigure" 2793 echo 1>&2 "*** removing ${file} to force reconfigure"
2776 rm -f ${file} 2794 rm -f ${file}
2777 fi 2795 fi
2778 done 2796 done
2779 fi 2797 fi
2798 case ${module},${bootstrap_fixincludes} in
2799 fixincludes,no) host_bootstrap_suffix=no-bootstrap ;;
2800 *) host_bootstrap_suffix=$bootstrap_suffix ;;
2801 esac
2780 extrasub_host="$extrasub_host 2802 extrasub_host="$extrasub_host
2781 /^@if $module\$/d 2803 /^@if $module\$/d
2782 /^@endif $module\$/d 2804 /^@endif $module\$/d
2783 /^@if $module-$bootstrap_suffix\$/d 2805 /^@if $module-$host_bootstrap_suffix\$/d
2784 /^@endif $module-$bootstrap_suffix\$/d" 2806 /^@endif $module-$host_bootstrap_suffix\$/d"
2785 done 2807 done
2786 extrasub_target= 2808 extrasub_target=
2787 for module in ${target_configdirs} ; do 2809 for module in ${target_configdirs} ; do
2788 if test -z "${no_recursion}" \ 2810 if test -z "${no_recursion}" \
2789 && test -f ${target_subdir}/${module}/Makefile; then 2811 && test -f ${target_subdir}/${module}/Makefile; then
2922 ;; 2944 ;;
2923 esac 2945 esac
2924 changequote([,]) 2946 changequote([,])
2925 2947
2926 case $lib in 2948 case $lib in
2927 mpc | mpfr | gmp | ppl | cloog) 2949 mpc | mpfr | gmp | isl)
2928 # If we're processing --with-$lib, --with-$lib-include or 2950 # If we're processing --with-$lib, --with-$lib-include or
2929 # --with-$lib-lib, for one of the libs above, and target is 2951 # --with-$lib-lib, for one of the libs above, and target is
2930 # different from host, don't pass the current argument to any 2952 # different from host, don't pass the current argument to any
2931 # target library's configure. 2953 # target library's configure.
2932 if test x$is_cross_compiler = xyes; then 2954 if test x$is_cross_compiler = xyes; then
3018 AC_ARG_VAR([target_configargs], 3040 AC_ARG_VAR([target_configargs],
3019 [additional configure arguments for target directories]) 3041 [additional configure arguments for target directories])
3020 3042
3021 # For the build-side libraries, we just need to pretend we're native, 3043 # For the build-side libraries, we just need to pretend we're native,
3022 # and not use the same cache file. Multilibs are neither needed nor 3044 # and not use the same cache file. Multilibs are neither needed nor
3023 # desired. 3045 # desired. We can't even use the same cache file for all build-side
3024 build_configargs="$build_configargs --cache-file=../config.cache ${baseargs}" 3046 # libraries, as they're compiled differently; some with C, some with
3047 # C++ or with different feature-enabling options.
3048 build_configargs="$build_configargs --cache-file=./config.cache ${baseargs}"
3025 3049
3026 # For host modules, accept cache file option, or specification as blank. 3050 # For host modules, accept cache file option, or specification as blank.
3027 case "${cache_file}" in 3051 case "${cache_file}" in
3028 "") # empty 3052 "") # empty
3029 cache_file_option="" ;; 3053 cache_file_option="" ;;
3046 # this option to be deprecated. FIXME. 3070 # this option to be deprecated. FIXME.
3047 if test x${is_cross_compiler} = xyes ; then 3071 if test x${is_cross_compiler} = xyes ; then
3048 target_configargs="--with-cross-host=${host_noncanonical} ${target_configargs}" 3072 target_configargs="--with-cross-host=${host_noncanonical} ${target_configargs}"
3049 fi 3073 fi
3050 3074
3075 # Special user-friendly check for native x86_64-linux build, if
3076 # multilib is not explicitly enabled.
3077 case "$target:$have_compiler:$host:$target:$enable_multilib" in
3078 x86_64-*linux*:yes:$build:$build:)
3079 # Make sure we have a development environment that handles 32-bit
3080 dev64=no
3081 echo "int main () { return 0; }" > conftest.c
3082 ${CC} -m32 -o conftest ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} conftest.c
3083 if test $? = 0 ; then
3084 if test -s conftest || test -s conftest.exe ; then
3085 dev64=yes
3086 fi
3087 fi
3088 rm -f conftest*
3089 if test x${dev64} != xyes ; then
3090 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.])
3091 fi
3092 ;;
3093 esac
3094
3051 # Default to --enable-multilib. 3095 # Default to --enable-multilib.
3052 if test x${enable_multilib} = x ; then 3096 if test x${enable_multilib} = x ; then
3053 target_configargs="--enable-multilib ${target_configargs}" 3097 target_configargs="--enable-multilib ${target_configargs}"
3054 fi 3098 fi
3055 3099
3078 *" newlib "*) 3122 *" newlib "*)
3079 case " $target_configargs " in 3123 case " $target_configargs " in
3080 *" --with-newlib "*) 3124 *" --with-newlib "*)
3081 case "$target" in 3125 case "$target" in
3082 *-cygwin*) 3126 *-cygwin*)
3083 FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -L$$r/$(TARGET_SUBDIR)/winsup -L$$r/$(TARGET_SUBDIR)/winsup/cygwin -L$$r/$(TARGET_SUBDIR)/winsup/w32api/lib -isystem $$s/winsup/include -isystem $$s/winsup/cygwin/include -isystem $$s/winsup/w32api/include' 3127 FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -L$$r/$(TARGET_SUBDIR)/winsup/cygwin -isystem $$s/winsup/cygwin/include'
3084 ;; 3128 ;;
3085 esac 3129 esac
3086 3130
3087 # If we're not building GCC, don't discard standard headers. 3131 # If we're not building GCC, don't discard standard headers.
3088 if test -d ${srcdir}/gcc; then 3132 if test -d ${srcdir}/gcc; then
3221 AC_SUBST(CC_FOR_BUILD) 3265 AC_SUBST(CC_FOR_BUILD)
3222 AC_SUBST(CFLAGS_FOR_BUILD) 3266 AC_SUBST(CFLAGS_FOR_BUILD)
3223 AC_SUBST(CXXFLAGS_FOR_BUILD) 3267 AC_SUBST(CXXFLAGS_FOR_BUILD)
3224 AC_SUBST(CXX_FOR_BUILD) 3268 AC_SUBST(CXX_FOR_BUILD)
3225 AC_SUBST(DLLTOOL_FOR_BUILD) 3269 AC_SUBST(DLLTOOL_FOR_BUILD)
3226 AC_SUBST(GCJ_FOR_BUILD)
3227 AC_SUBST(GFORTRAN_FOR_BUILD) 3270 AC_SUBST(GFORTRAN_FOR_BUILD)
3228 AC_SUBST(GOC_FOR_BUILD) 3271 AC_SUBST(GOC_FOR_BUILD)
3229 AC_SUBST(LDFLAGS_FOR_BUILD) 3272 AC_SUBST(LDFLAGS_FOR_BUILD)
3230 AC_SUBST(LD_FOR_BUILD) 3273 AC_SUBST(LD_FOR_BUILD)
3231 AC_SUBST(NM_FOR_BUILD) 3274 AC_SUBST(NM_FOR_BUILD)
3232 AC_SUBST(RANLIB_FOR_BUILD) 3275 AC_SUBST(RANLIB_FOR_BUILD)
3233 AC_SUBST(WINDMC_FOR_BUILD) 3276 AC_SUBST(WINDMC_FOR_BUILD)
3234 AC_SUBST(WINDRES_FOR_BUILD) 3277 AC_SUBST(WINDRES_FOR_BUILD)
3235 AC_SUBST(config_shell)
3236 3278
3237 # Generate default definitions for YACC, M4, LEX and other programs that run 3279 # Generate default definitions for YACC, M4, LEX and other programs that run
3238 # on the build machine. These are used if the Makefile can't locate these 3280 # on the build machine. These are used if the Makefile can't locate these
3239 # programs in objdir. 3281 # programs in objdir.
3240 MISSING=`cd $ac_aux_dir && ${PWDCMD-pwd}`/missing 3282 MISSING=`cd $ac_aux_dir && ${PWDCMD-pwd}`/missing
3241 3283
3242 AC_CHECK_PROGS([YACC], ['bison -y' byacc yacc], [$MISSING bison -y]) 3284 AC_CHECK_PROGS([YACC], ['bison -y' byacc yacc], [$MISSING bison -y])
3243 case " $build_configdirs " in 3285 case " $build_configdirs " in
3244 *" bison "*) YACC='$$r/$(BUILD_SUBDIR)/bison/tests/bison -y' ;; 3286 *" bison "*) YACC='$$r/$(BUILD_SUBDIR)/bison/tests/bison -y' ;;
3245 *" byacc "*) YACC='$$r/$(BUILD_SUBDIR)/byacc/byacc' ;;
3246 esac 3287 esac
3247 3288
3248 AC_CHECK_PROGS([BISON], [bison], [$MISSING bison]) 3289 AC_CHECK_PROGS([BISON], [bison], [$MISSING bison])
3249 case " $build_configdirs " in 3290 case " $build_configdirs " in
3250 *" bison "*) BISON='$$r/$(BUILD_SUBDIR)/bison/tests/bison' ;; 3291 *" bison "*) BISON='$$r/$(BUILD_SUBDIR)/bison/tests/bison' ;;
3311 NCN_STRICT_CHECK_TOOLS(STRIP, strip, true) 3352 NCN_STRICT_CHECK_TOOLS(STRIP, strip, true)
3312 NCN_STRICT_CHECK_TOOLS(WINDRES, windres) 3353 NCN_STRICT_CHECK_TOOLS(WINDRES, windres)
3313 NCN_STRICT_CHECK_TOOLS(WINDMC, windmc) 3354 NCN_STRICT_CHECK_TOOLS(WINDMC, windmc)
3314 NCN_STRICT_CHECK_TOOLS(OBJCOPY, objcopy) 3355 NCN_STRICT_CHECK_TOOLS(OBJCOPY, objcopy)
3315 NCN_STRICT_CHECK_TOOLS(OBJDUMP, objdump) 3356 NCN_STRICT_CHECK_TOOLS(OBJDUMP, objdump)
3357 NCN_STRICT_CHECK_TOOLS(READELF, readelf)
3316 AC_SUBST(CC) 3358 AC_SUBST(CC)
3317 AC_SUBST(CXX) 3359 AC_SUBST(CXX)
3318 AC_SUBST(CFLAGS) 3360 AC_SUBST(CFLAGS)
3319 AC_SUBST(CXXFLAGS) 3361 AC_SUBST(CXXFLAGS)
3320 3362
3332 [with_build_time_tools=]) 3374 [with_build_time_tools=])
3333 3375
3334 NCN_STRICT_CHECK_TARGET_TOOLS(CC_FOR_TARGET, cc gcc) 3376 NCN_STRICT_CHECK_TARGET_TOOLS(CC_FOR_TARGET, cc gcc)
3335 NCN_STRICT_CHECK_TARGET_TOOLS(CXX_FOR_TARGET, c++ g++ cxx gxx) 3377 NCN_STRICT_CHECK_TARGET_TOOLS(CXX_FOR_TARGET, c++ g++ cxx gxx)
3336 NCN_STRICT_CHECK_TARGET_TOOLS(GCC_FOR_TARGET, gcc, ${CC_FOR_TARGET}) 3378 NCN_STRICT_CHECK_TARGET_TOOLS(GCC_FOR_TARGET, gcc, ${CC_FOR_TARGET})
3337 NCN_STRICT_CHECK_TARGET_TOOLS(GCJ_FOR_TARGET, gcj)
3338 NCN_STRICT_CHECK_TARGET_TOOLS(GFORTRAN_FOR_TARGET, gfortran) 3379 NCN_STRICT_CHECK_TARGET_TOOLS(GFORTRAN_FOR_TARGET, gfortran)
3339 NCN_STRICT_CHECK_TARGET_TOOLS(GOC_FOR_TARGET, gccgo) 3380 NCN_STRICT_CHECK_TARGET_TOOLS(GOC_FOR_TARGET, gccgo)
3340 3381
3341 ACX_CHECK_INSTALLED_TARGET_TOOL(AR_FOR_TARGET, ar) 3382 ACX_CHECK_INSTALLED_TARGET_TOOL(AR_FOR_TARGET, ar)
3342 ACX_CHECK_INSTALLED_TARGET_TOOL(AS_FOR_TARGET, as) 3383 ACX_CHECK_INSTALLED_TARGET_TOOL(AS_FOR_TARGET, as)
3343 ACX_CHECK_INSTALLED_TARGET_TOOL(DLLTOOL_FOR_TARGET, dlltool) 3384 ACX_CHECK_INSTALLED_TARGET_TOOL(DLLTOOL_FOR_TARGET, dlltool)
3344 ACX_CHECK_INSTALLED_TARGET_TOOL(LD_FOR_TARGET, ld) 3385 ACX_CHECK_INSTALLED_TARGET_TOOL(LD_FOR_TARGET, ld)
3345 ACX_CHECK_INSTALLED_TARGET_TOOL(LIPO_FOR_TARGET, lipo) 3386 ACX_CHECK_INSTALLED_TARGET_TOOL(LIPO_FOR_TARGET, lipo)
3346 ACX_CHECK_INSTALLED_TARGET_TOOL(NM_FOR_TARGET, nm) 3387 ACX_CHECK_INSTALLED_TARGET_TOOL(NM_FOR_TARGET, nm)
3388 ACX_CHECK_INSTALLED_TARGET_TOOL(OBJCOPY_FOR_TARGET, objcopy)
3347 ACX_CHECK_INSTALLED_TARGET_TOOL(OBJDUMP_FOR_TARGET, objdump) 3389 ACX_CHECK_INSTALLED_TARGET_TOOL(OBJDUMP_FOR_TARGET, objdump)
3348 ACX_CHECK_INSTALLED_TARGET_TOOL(RANLIB_FOR_TARGET, ranlib) 3390 ACX_CHECK_INSTALLED_TARGET_TOOL(RANLIB_FOR_TARGET, ranlib)
3391 ACX_CHECK_INSTALLED_TARGET_TOOL(READELF_FOR_TARGET, readelf)
3349 ACX_CHECK_INSTALLED_TARGET_TOOL(STRIP_FOR_TARGET, strip) 3392 ACX_CHECK_INSTALLED_TARGET_TOOL(STRIP_FOR_TARGET, strip)
3350 ACX_CHECK_INSTALLED_TARGET_TOOL(WINDRES_FOR_TARGET, windres) 3393 ACX_CHECK_INSTALLED_TARGET_TOOL(WINDRES_FOR_TARGET, windres)
3351 ACX_CHECK_INSTALLED_TARGET_TOOL(WINDMC_FOR_TARGET, windmc) 3394 ACX_CHECK_INSTALLED_TARGET_TOOL(WINDMC_FOR_TARGET, windmc)
3352 3395
3353 RAW_CXX_FOR_TARGET="$CXX_FOR_TARGET" 3396 RAW_CXX_FOR_TARGET="$CXX_FOR_TARGET"
3355 GCC_TARGET_TOOL(ar, AR_FOR_TARGET, AR, [binutils/ar]) 3398 GCC_TARGET_TOOL(ar, AR_FOR_TARGET, AR, [binutils/ar])
3356 GCC_TARGET_TOOL(as, AS_FOR_TARGET, AS, [gas/as-new]) 3399 GCC_TARGET_TOOL(as, AS_FOR_TARGET, AS, [gas/as-new])
3357 GCC_TARGET_TOOL(cc, CC_FOR_TARGET, CC, [gcc/xgcc -B$$r/$(HOST_SUBDIR)/gcc/]) 3400 GCC_TARGET_TOOL(cc, CC_FOR_TARGET, CC, [gcc/xgcc -B$$r/$(HOST_SUBDIR)/gcc/])
3358 dnl see comments for CXX_FOR_TARGET_FLAG_TO_PASS 3401 dnl see comments for CXX_FOR_TARGET_FLAG_TO_PASS
3359 GCC_TARGET_TOOL(c++, CXX_FOR_TARGET, CXX, 3402 GCC_TARGET_TOOL(c++, CXX_FOR_TARGET, CXX,
3360 [gcc/g++ -B$$r/$(HOST_SUBDIR)/gcc/ -nostdinc++ `if test -f $$r/$(TARGET_SUBDIR)/libstdc++-v3/scripts/testsuite_flags; then $(SHELL) $$r/$(TARGET_SUBDIR)/libstdc++-v3/scripts/testsuite_flags --build-includes; else echo -funconfigured-libstdc++-v3 ; fi` -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs], 3403 [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],
3361 c++) 3404 c++)
3362 GCC_TARGET_TOOL(c++ for libstdc++, RAW_CXX_FOR_TARGET, CXX, 3405 GCC_TARGET_TOOL(c++ for libstdc++, RAW_CXX_FOR_TARGET, CXX,
3363 [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], 3406 [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],
3364 c++) 3407 c++)
3365 GCC_TARGET_TOOL(dlltool, DLLTOOL_FOR_TARGET, DLLTOOL, [binutils/dlltool]) 3408 GCC_TARGET_TOOL(dlltool, DLLTOOL_FOR_TARGET, DLLTOOL, [binutils/dlltool])
3366 GCC_TARGET_TOOL(gcc, GCC_FOR_TARGET, , [gcc/xgcc -B$$r/$(HOST_SUBDIR)/gcc/]) 3409 GCC_TARGET_TOOL(gcc, GCC_FOR_TARGET, , [gcc/xgcc -B$$r/$(HOST_SUBDIR)/gcc/])
3367 GCC_TARGET_TOOL(gcj, GCJ_FOR_TARGET, GCJ,
3368 [gcc/gcj -B$$r/$(HOST_SUBDIR)/gcc/], java)
3369 GCC_TARGET_TOOL(gfortran, GFORTRAN_FOR_TARGET, GFORTRAN, 3410 GCC_TARGET_TOOL(gfortran, GFORTRAN_FOR_TARGET, GFORTRAN,
3370 [gcc/gfortran -B$$r/$(HOST_SUBDIR)/gcc/], fortran) 3411 [gcc/gfortran -B$$r/$(HOST_SUBDIR)/gcc/], fortran)
3371 GCC_TARGET_TOOL(gccgo, GOC_FOR_TARGET, GOC, 3412 GCC_TARGET_TOOL(gccgo, GOC_FOR_TARGET, GOC,
3372 [gcc/gccgo -B$$r/$(HOST_SUBDIR)/gcc/], go) 3413 [gcc/gccgo -B$$r/$(HOST_SUBDIR)/gcc/], go)
3373 GCC_TARGET_TOOL(ld, LD_FOR_TARGET, LD, [ld/ld-new]) 3414 GCC_TARGET_TOOL(ld, LD_FOR_TARGET, LD, [ld/ld-new])
3374 GCC_TARGET_TOOL(lipo, LIPO_FOR_TARGET, LIPO) 3415 GCC_TARGET_TOOL(lipo, LIPO_FOR_TARGET, LIPO)
3375 GCC_TARGET_TOOL(nm, NM_FOR_TARGET, NM, [binutils/nm-new]) 3416 GCC_TARGET_TOOL(nm, NM_FOR_TARGET, NM, [binutils/nm-new])
3417 GCC_TARGET_TOOL(objcopy, OBJCOPY_FOR_TARGET, OBJCOPY, [binutils/objcopy])
3376 GCC_TARGET_TOOL(objdump, OBJDUMP_FOR_TARGET, OBJDUMP, [binutils/objdump]) 3418 GCC_TARGET_TOOL(objdump, OBJDUMP_FOR_TARGET, OBJDUMP, [binutils/objdump])
3377 GCC_TARGET_TOOL(ranlib, RANLIB_FOR_TARGET, RANLIB, [binutils/ranlib]) 3419 GCC_TARGET_TOOL(ranlib, RANLIB_FOR_TARGET, RANLIB, [binutils/ranlib])
3420 GCC_TARGET_TOOL(readelf, READELF_FOR_TARGET, READELF, [binutils/readelf])
3378 GCC_TARGET_TOOL(strip, STRIP_FOR_TARGET, STRIP, [binutils/strip-new]) 3421 GCC_TARGET_TOOL(strip, STRIP_FOR_TARGET, STRIP, [binutils/strip-new])
3379 GCC_TARGET_TOOL(windres, WINDRES_FOR_TARGET, WINDRES, [binutils/windres]) 3422 GCC_TARGET_TOOL(windres, WINDRES_FOR_TARGET, WINDRES, [binutils/windres])
3380 GCC_TARGET_TOOL(windmc, WINDMC_FOR_TARGET, WINDMC, [binutils/windmc]) 3423 GCC_TARGET_TOOL(windmc, WINDMC_FOR_TARGET, WINDMC, [binutils/windmc])
3381 3424
3382 AC_SUBST(FLAGS_FOR_TARGET) 3425 AC_SUBST(FLAGS_FOR_TARGET)
3438 yes) stage1_cflags="-g -Wa,-J" ;; 3481 yes) stage1_cflags="-g -Wa,-J" ;;
3439 *) stage1_cflags="-g -J" ;; 3482 *) stage1_cflags="-g -J" ;;
3440 esac ;; 3483 esac ;;
3441 esac 3484 esac
3442 3485
3443 # This is aimed to mimic bootstrap with a non-GCC compiler to catch problems.
3444 if test "$GCC" = yes -a "$ENABLE_BUILD_WITH_CXX" != yes; then
3445 saved_CFLAGS="$CFLAGS"
3446
3447 # Pass -fkeep-inline-functions for stage 1 if the GCC version supports it.
3448 CFLAGS="$CFLAGS -fkeep-inline-functions"
3449 AC_MSG_CHECKING([whether -fkeep-inline-functions is supported])
3450 AC_TRY_COMPILE([
3451 #if (__GNUC__ < 3) \
3452 || (__GNUC__ == 3 && (__GNUC_MINOR__ < 3 \
3453 || (__GNUC_MINOR__ == 3 && __GNUC_PATCHLEVEL__ < 1)))
3454 #error http://gcc.gnu.org/PR29382
3455 #endif
3456 ],,
3457 [AC_MSG_RESULT([yes]); stage1_cflags="$stage1_cflags -fkeep-inline-functions"],
3458 [AC_MSG_RESULT([no])])
3459
3460 CFLAGS="$saved_CFLAGS"
3461 fi
3462
3463 AC_SUBST(stage1_cflags) 3486 AC_SUBST(stage1_cflags)
3464 3487
3465 # Enable --enable-checking in stage1 of the compiler. 3488 # Enable --enable-checking in stage1 of the compiler.
3466 AC_ARG_ENABLE(stage1-checking, 3489 AC_ARG_ENABLE(stage1-checking,
3467 [AS_HELP_STRING([[--enable-stage1-checking[=all]]], 3490 [AS_HELP_STRING([[--enable-stage1-checking[=all]]],
3468 [choose additional checking for stage1 of the compiler])], 3491 [choose additional checking for stage1 of the compiler])],
3469 [stage1_checking=--enable-checking=${enable_stage1_checking}], 3492 [stage1_checking=--enable-checking=${enable_stage1_checking}],
3470 [if test "x$enable_checking" = xno || test "x$enable_checking" = x; then 3493 [if test "x$enable_checking" = xno || test "x$enable_checking" = x; then
3471 stage1_checking=--enable-checking=yes,types 3494 # For --disable-checking or implicit --enable-checking=release, avoid
3495 # setting --enable-checking=gc in the default stage1 checking for LTO
3496 # bootstraps. See PR62077.
3497 case $BUILD_CONFIG in
3498 *lto*)
3499 stage1_checking=--enable-checking=release,misc,gimple,rtlflag,tree,types;;
3500 *)
3501 stage1_checking=--enable-checking=yes,types;;
3502 esac
3503 if test "x$enable_checking" = x && \
3504 test -d ${srcdir}/gcc && \
3505 test x"`cat ${srcdir}/gcc/DEV-PHASE`" = xexperimental; then
3506 stage1_checking=--enable-checking=yes,types,extra
3507 fi
3472 else 3508 else
3473 stage1_checking=--enable-checking=$enable_checking,types 3509 stage1_checking=--enable-checking=$enable_checking,types
3474 fi]) 3510 fi])
3475 AC_SUBST(stage1_checking) 3511 AC_SUBST(stage1_checking)
3476 3512
3477 # Enable -Werror in bootstrap stage2 and later. 3513 # Enable -Werror in bootstrap stage2 and later.
3478 AC_ARG_ENABLE(werror, 3514 AC_ARG_ENABLE(werror,
3479 [AS_HELP_STRING([--enable-werror], 3515 [AS_HELP_STRING([--enable-werror],
3480 [enable -Werror in bootstrap stage2 and later])], [], 3516 [enable -Werror in bootstrap stage2 and later])],
3481 [if test -d ${srcdir}/gcc && test x"`cat $srcdir/gcc/DEV-PHASE`" = xexperimental; then 3517 [
3482 enable_werror=yes
3483 else
3484 enable_werror=no
3485 fi])
3486 case ${enable_werror} in 3518 case ${enable_werror} in
3487 yes) stage2_werror_flag="--enable-werror-always" ;; 3519 yes) stage2_werror_flag="--enable-werror-always" ;;
3488 *) stage2_werror_flag="" ;; 3520 *) stage2_werror_flag="" ;;
3489 esac 3521 esac
3522 ],
3523 [
3524 if test -d ${srcdir}/gcc && test x"`cat $srcdir/gcc/DEV-PHASE`" = xexperimental; then
3525 case $BUILD_CONFIG in
3526 bootstrap-debug)
3527 stage2_werror_flag="--enable-werror-always" ;;
3528 "")
3529 stage2_werror_flag="--enable-werror-always" ;;
3530 esac
3531 fi
3532 ])
3533
3490 AC_SUBST(stage2_werror_flag) 3534 AC_SUBST(stage2_werror_flag)
3491 3535
3492 # Specify what files to not compare during bootstrap. 3536 # Specify what files to not compare during bootstrap.
3493 3537
3494 compare_exclusions="gcc/cc*-checksum\$(objext) | gcc/ada/*tools/*" 3538 compare_exclusions="gcc/cc*-checksum\$(objext) | gcc/ada/*tools/*"
3495 case "$target" in 3539 case "$target" in
3496 hppa*64*-*-hpux*) ;; 3540 hppa*64*-*-hpux*) ;;
3497 hppa*-*-hpux*) compare_exclusions="gcc/cc*-checksum\$(objext) | */libgcc/lib2funcs* | gcc/ada/*tools/*" ;; 3541 hppa*-*-hpux*) compare_exclusions="gcc/cc*-checksum\$(objext) | */libgcc/lib2funcs* | gcc/ada/*tools/* | gcc/function-tests.o" ;;
3498 esac 3542 powerpc*-ibm-aix*) compare_exclusions="gcc/cc*-checksum\$(objext) | gcc/ada/*tools/* | *libgomp*\$(objext)" ;;
3499 case " $configdirs " in
3500 *" ppl "*) compare_exclusions="$compare_exclusions | ppl/src/ppl-config.o" ;;
3501 esac 3543 esac
3502 AC_SUBST(compare_exclusions) 3544 AC_SUBST(compare_exclusions)
3503 3545
3504 AC_CONFIG_FILES([Makefile], 3546 AC_CONFIG_FILES([Makefile],
3505 [sed "$extrasub_build" Makefile | 3547 [sed "$extrasub_build" Makefile |