comparison configure.ac @ 55:77e2b8dfacca gcc-4.4.5

update it from 4.4.3 to 4.5.0
author ryoma <e075725@ie.u-ryukyu.ac.jp>
date Fri, 12 Feb 2010 23:39:51 +0900
parents 58ad6c70ea60
children b7f97abdc517
comparison
equal deleted inserted replaced
52:c156f1bd5cd9 55:77e2b8dfacca
22 m4_include(config/acx.m4) 22 m4_include(config/acx.m4)
23 m4_include(config/override.m4) 23 m4_include(config/override.m4)
24 m4_include(config/proginstall.m4) 24 m4_include(config/proginstall.m4)
25 25
26 AC_INIT(move-if-change) 26 AC_INIT(move-if-change)
27 AC_PREREQ(2.59) 27 AC_PREREQ(2.64)
28 AC_DISABLE_OPTION_CHECKING
28 29
29 progname=$0 30 progname=$0
30 # if PWD already has a value, it is probably wrong. 31 # if PWD already has a value, it is probably wrong.
31 if test -n "$PWD" ; then PWD=`${PWDCMD-pwd}`; fi 32 if test -n "$PWD" ; then PWD=`${PWDCMD-pwd}`; fi
32 33
76 77
77 # Get 'install' or 'install-sh' and its variants. 78 # Get 'install' or 'install-sh' and its variants.
78 AC_PROG_INSTALL 79 AC_PROG_INSTALL
79 ACX_PROG_LN 80 ACX_PROG_LN
80 AC_PROG_LN_S 81 AC_PROG_LN_S
82 AC_PROG_SED
83 AC_PROG_AWK
81 84
82 ### we might need to use some other shell than /bin/sh for running subshells 85 ### we might need to use some other shell than /bin/sh for running subshells
83 ### If we are on Windows, search for the shell. This will permit people 86 ### If we are on Windows, search for the shell. This will permit people
84 ### to not have /bin/sh, but to be able to see /SOME/PATH/sh configure 87 ### to not have /bin/sh, but to be able to see /SOME/PATH/sh configure
85 ### without also having to set CONFIG_SHELL. This code will work when 88 ### without also having to set CONFIG_SHELL. This code will work when
156 # these tools are built for the build environment 159 # these tools are built for the build environment
157 build_tools="build-texinfo build-byacc build-flex build-bison build-m4 build-fixincludes" 160 build_tools="build-texinfo build-byacc build-flex build-bison build-m4 build-fixincludes"
158 161
159 # these libraries are used by various programs built for the host environment 162 # these libraries are used by various programs built for the host environment
160 # 163 #
161 host_libs="intl mmalloc libiberty opcodes bfd readline tcl tk itcl libgui zlib libcpp libdecnumber gmp mpfr ppl cloog libiconv" 164 host_libs="intl mmalloc libiberty opcodes bfd readline tcl tk itcl libgui zlib libcpp libdecnumber gmp mpfr mpc ppl cloog libelf libiconv"
162 165
163 # these tools are built for the host environment 166 # these tools are built for the host environment
164 # Note, the powerpc-eabi build depends on sim occurring before gdb in order to 167 # Note, the powerpc-eabi build depends on sim occurring before gdb in order to
165 # know that we are building the simulator. 168 # know that we are building the simulator.
166 # binutils, gas and ld appear in that order because it makes sense to run 169 # binutils, gas and ld appear in that order because it makes sense to run
167 # "make check" in that particular order. 170 # "make check" in that particular order.
168 # If --enable-gold is used, "gold" will replace "ld". 171 # If --enable-gold is used, "gold" will replace "ld".
169 host_tools="texinfo byacc flex bison binutils gas ld fixincludes gcc 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" 172 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"
170 173
171 # libgcj represents the runtime libraries only used by gcj. 174 # libgcj represents the runtime libraries only used by gcj.
172 libgcj="target-libffi \ 175 libgcj="target-libffi \
173 target-zlib \ 176 target-zlib \
174 target-qthreads \ 177 target-qthreads \
230 is_cross_compiler=yes 233 is_cross_compiler=yes
231 fi 234 fi
232 235
233 # Find the build and target subdir names. 236 # Find the build and target subdir names.
234 GCC_TOPLEV_SUBDIRS 237 GCC_TOPLEV_SUBDIRS
238 # Be sure to cover against remnants of an in-tree build.
239 if test $srcdir != . && test -d $srcdir/host-${host_noncanonical}; then
240 AC_MSG_ERROR([building out of tree but $srcdir contains host-${host_noncanonical}.
241 Use a pristine source tree when building in a separate tree])
242 fi
235 243
236 # Skipdirs are removed silently. 244 # Skipdirs are removed silently.
237 skipdirs= 245 skipdirs=
238 # Noconfigdirs are removed loudly. 246 # Noconfigdirs are removed loudly.
239 noconfigdirs="" 247 noconfigdirs=""
248 use_gnu_as= 256 use_gnu_as=
249 # Make sure we don't let GNU as be added if we didn't want it. 257 # Make sure we don't let GNU as be added if we didn't want it.
250 if test x$with_gnu_as = xno ; then 258 if test x$with_gnu_as = xno ; then
251 use_gnu_as=no 259 use_gnu_as=no
252 noconfigdirs="$noconfigdirs gas" 260 noconfigdirs="$noconfigdirs gas"
261 fi
262
263 use_included_zlib=
264 # Make sure we don't let ZLIB be added if we didn't want it.
265 if test x$with_system_zlib = xyes ; then
266 use_included_zlib=no
267 noconfigdirs="$noconfigdirs zlib"
253 fi 268 fi
254 269
255 # some tools are so dependent upon X11 that if we're not building with X, 270 # some tools are so dependent upon X11 that if we're not building with X,
256 # it's not even worth trying to configure, much less build, that tool. 271 # it's not even worth trying to configure, much less build, that tool.
257 272
303 # Check for ELF target. 318 # Check for ELF target.
304 is_elf=no 319 is_elf=no
305 case "${target}" in 320 case "${target}" in
306 *-*-elf* | *-*-sysv4* | *-*-unixware* | *-*-eabi* | hppa*64*-*-hpux* \ 321 *-*-elf* | *-*-sysv4* | *-*-unixware* | *-*-eabi* | hppa*64*-*-hpux* \
307 | *-*-linux* | frv-*-uclinux* | *-*-irix5* | *-*-irix6* \ 322 | *-*-linux* | frv-*-uclinux* | *-*-irix5* | *-*-irix6* \
308 | *-*-netbsd* | *-*-openbsd* | *-*-freebsd* | *-*-solaris2*) 323 | *-*-netbsd* | *-*-openbsd* | *-*-freebsd* | *-*-solaris2* | *-*-nto*)
309 case "${target}" in 324 case "${target}" in
310 *-*-linux*aout* | *-*-linux*oldld*) 325 *-*-linux*aout* | *-*-linux*oldld*)
311 ;; 326 ;;
312 *) 327 *)
313 is_elf=yes 328 is_elf=yes
316 esac 331 esac
317 332
318 if test "$is_elf" = "yes"; then 333 if test "$is_elf" = "yes"; then
319 # Check for target supported by gold. 334 # Check for target supported by gold.
320 case "${target}" in 335 case "${target}" in
321 i?86-*-* | x86_64-*-* | sparc*-*-* | powerpc*-*-*) 336 i?86-*-* | x86_64-*-* | sparc*-*-* | powerpc*-*-* | arm*-*-*)
322 configdirs="`echo " ${configdirs} " | sed -e 's/ ld / gold /'`" 337 configdirs="`echo " ${configdirs} " | sed -e 's/ ld / gold /'`"
323 ;; 338 ;;
324 esac 339 esac
325 fi 340 fi
326 fi 341 fi
448 ;; 463 ;;
449 powerpc-*-darwin*) 464 powerpc-*-darwin*)
450 noconfigdirs="$noconfigdirs ld gas gdb gprof" 465 noconfigdirs="$noconfigdirs ld gas gdb gprof"
451 noconfigdirs="$noconfigdirs sim target-rda" 466 noconfigdirs="$noconfigdirs sim target-rda"
452 ;; 467 ;;
453 i[[3456789]]86-*-darwin* | x86_64-*-darwin[[912]]*) 468 i[[3456789]]86-*-darwin*)
469 noconfigdirs="$noconfigdirs ld gprof"
470 noconfigdirs="$noconfigdirs sim target-rda"
471 ;;
472 x86_64-*-darwin[[912]]*)
454 noconfigdirs="$noconfigdirs ld gas gprof" 473 noconfigdirs="$noconfigdirs ld gas gprof"
455 noconfigdirs="$noconfigdirs sim target-rda" 474 noconfigdirs="$noconfigdirs sim target-rda"
456 ;; 475 ;;
457 *-*-darwin*) 476 *-*-darwin*)
458 noconfigdirs="$noconfigdirs ld gas gdb gprof" 477 noconfigdirs="$noconfigdirs ld gas gdb gprof"
594 ;; 613 ;;
595 avr-*-*) 614 avr-*-*)
596 noconfigdirs="$noconfigdirs target-libiberty target-libstdc++-v3 ${libgcj} target-libssp" 615 noconfigdirs="$noconfigdirs target-libiberty target-libstdc++-v3 ${libgcj} target-libssp"
597 ;; 616 ;;
598 bfin-*-*) 617 bfin-*-*)
599 noconfigdirs="$noconfigdirs gdb" 618 unsupported_languages="$unsupported_languages java"
619 noconfigdirs="$noconfigdirs target-boehm-gc gdb"
600 if test x${is_cross_compiler} != xno ; then 620 if test x${is_cross_compiler} != xno ; then
601 target_configdirs="${target_configdirs} target-bsp target-cygmon" 621 target_configdirs="${target_configdirs} target-bsp target-cygmon"
602 fi 622 fi
603 ;; 623 ;;
604 c4x-*-* | tic4x-*-*) 624 c4x-*-* | tic4x-*-*)
642 noconfigdirs="$noconfigdirs ${libgcj} gdb" 662 noconfigdirs="$noconfigdirs ${libgcj} gdb"
643 ;; 663 ;;
644 frv-*-*) 664 frv-*-*)
645 noconfigdirs="$noconfigdirs ${libgcj}" 665 noconfigdirs="$noconfigdirs ${libgcj}"
646 ;; 666 ;;
667 moxie-*-*)
668 noconfigdirs="$noconfigdirs ${libgcj}"
669 noconfigdirs="$noconfigdirs gprof"
670 ;;
647 h8300*-*-*) 671 h8300*-*-*)
648 noconfigdirs="$noconfigdirs target-libgloss ${libgcj}" 672 noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
649 ;; 673 ;;
650 h8500-*-*) 674 h8500-*-*)
651 noconfigdirs="$noconfigdirs target-libstdc++-v3 target-libgloss ${libgcj}" 675 noconfigdirs="$noconfigdirs target-libstdc++-v3 target-libgloss ${libgcj}"
715 # If we are not using a cross compiler, do configure newlib. 739 # If we are not using a cross compiler, do configure newlib.
716 # Note however, that newlib will only be configured in this situation 740 # Note however, that newlib will only be configured in this situation
717 # if the --with-newlib option has been given, because otherwise 741 # if the --with-newlib option has been given, because otherwise
718 # 'target-newlib' will appear in skipdirs. 742 # 'target-newlib' will appear in skipdirs.
719 ;; 743 ;;
720 i[[3456789]]86-*-mingw32*) 744 i[[3456789]]86-w64-mingw*)
745 noconfigdirs="$noconfigdirs expect target-libgloss target-newlib ${libgcj}"
746 ;;
747 i[[3456789]]86-*-mingw*)
721 target_configdirs="$target_configdirs target-winsup" 748 target_configdirs="$target_configdirs target-winsup"
722 noconfigdirs="$noconfigdirs expect target-libgloss target-newlib ${libgcj}" 749 noconfigdirs="$noconfigdirs expect target-libgloss target-newlib ${libgcj}"
723 ;; 750 ;;
724 x86_64-*-mingw*) 751 x86_64-*-mingw*)
725 target_configdirs="$target_configdirs target-winsup"
726 noconfigdirs="$noconfigdirs expect target-libgloss target-newlib ${libgcj}" 752 noconfigdirs="$noconfigdirs expect target-libgloss target-newlib ${libgcj}"
727 ;; 753 ;;
728 *-*-cygwin*) 754 *-*-cygwin*)
729 target_configdirs="$target_configdirs target-libtermcap target-winsup" 755 target_configdirs="$target_configdirs target-libtermcap target-winsup"
730 noconfigdirs="$noconfigdirs target-gperf target-libgloss ${libgcj}" 756 noconfigdirs="$noconfigdirs target-gperf target-libgloss"
731 # always build newlib if winsup directory is present. 757 # always build newlib if winsup directory is present.
732 if test -d "$srcdir/winsup/cygwin"; then 758 if test -d "$srcdir/winsup/cygwin"; then
733 skipdirs=`echo " ${skipdirs} " | sed -e 's/ target-newlib / /'` 759 skipdirs=`echo " ${skipdirs} " | sed -e 's/ target-newlib / /'`
734 elif test -d "$srcdir/newlib"; then 760 elif test -d "$srcdir/newlib"; then
735 echo "Warning: winsup/cygwin is missing so newlib can't be built." 761 echo "Warning: winsup/cygwin is missing so newlib can't be built."
736 fi 762 fi
737 ;; 763 ;;
738 i[[3456789]]86-moss-msdos | i[[3456789]]86-*-moss* | \ 764 i[[3456789]]86-moss-msdos | i[[3456789]]86-*-moss* | \
739 i[[3456789]]86-*-uwin* | i[[3456789]]86-*-interix* ) 765 i[[3456789]]86-*-uwin* | i[[3456789]]86-*-interix* )
740 ;; 766 ;;
741 i[[3456789]]86-*-pe) 767 i[[3456789]]86-*-pe)
742 noconfigdirs="$noconfigdirs target-libstdc++-v3 target-libgloss ${libgcj}" 768 noconfigdirs="$noconfigdirs target-libstdc++-v3 target-libgloss ${libgcj}"
795 mt-*-*) 821 mt-*-*)
796 noconfigdirs="$noconfigdirs sim" 822 noconfigdirs="$noconfigdirs sim"
797 ;; 823 ;;
798 powerpc-*-aix*) 824 powerpc-*-aix*)
799 # copied from rs6000-*-* entry 825 # copied from rs6000-*-* entry
800 noconfigdirs="$noconfigdirs gprof target-libgloss target-libssp ${libgcj}" 826 noconfigdirs="$noconfigdirs gprof target-libgloss target-libssp target-newlib ${libgcj}"
801 ;; 827 ;;
802 powerpc*-*-winnt* | powerpc*-*-pe* | ppc*-*-pe) 828 powerpc*-*-winnt* | powerpc*-*-pe* | ppc*-*-pe)
803 target_configdirs="$target_configdirs target-winsup" 829 target_configdirs="$target_configdirs target-winsup"
804 noconfigdirs="$noconfigdirs gdb tcl tk make expect target-libgloss itcl gnuserv ${libgcj}" 830 noconfigdirs="$noconfigdirs gdb tcl tk make expect target-libgloss itcl gnuserv ${libgcj}"
805 # always build newlib. 831 # always build newlib.
822 ;; 848 ;;
823 rs6000-*-lynxos*) 849 rs6000-*-lynxos*)
824 noconfigdirs="$noconfigdirs target-newlib gprof ${libgcj}" 850 noconfigdirs="$noconfigdirs target-newlib gprof ${libgcj}"
825 ;; 851 ;;
826 rs6000-*-aix*) 852 rs6000-*-aix*)
827 noconfigdirs="$noconfigdirs gprof target-libgloss target-libssp ${libgcj}" 853 noconfigdirs="$noconfigdirs gprof target-libgloss target-libssp target-newlib ${libgcj}"
828 ;; 854 ;;
829 rs6000-*-*) 855 rs6000-*-*)
830 noconfigdirs="$noconfigdirs gprof ${libgcj}" 856 noconfigdirs="$noconfigdirs gprof ${libgcj}"
831 ;; 857 ;;
832 m68k-apollo-*) 858 m68k-apollo-*)
833 noconfigdirs="$noconfigdirs ld binutils gprof target-libgloss ${libgcj}" 859 noconfigdirs="$noconfigdirs ld binutils gprof target-libgloss ${libgcj}"
860 ;;
861 microblaze*)
862 noconfigdirs="$noconfigdirs gprof ${libgcj}"
834 ;; 863 ;;
835 mips*-sde-elf*) 864 mips*-sde-elf*)
836 skipdirs="$skipdirs target-libiberty" 865 skipdirs="$skipdirs target-libiberty"
837 noconfigdirs="$noconfigdirs ${libgcj}" 866 noconfigdirs="$noconfigdirs ${libgcj}"
838 if test x$with_newlib = xyes; then 867 if test x$with_newlib = xyes; then
868 i[[3456789]]86-*-vsta) ;; # don't add gprof back in 897 i[[3456789]]86-*-vsta) ;; # don't add gprof back in
869 i[[3456789]]86-*-go32*) ;; # don't add gprof back in 898 i[[3456789]]86-*-go32*) ;; # don't add gprof back in
870 i[[3456789]]86-*-msdosdjgpp*) ;; # don't add gprof back in 899 i[[3456789]]86-*-msdosdjgpp*) ;; # don't add gprof back in
871 *) skipdirs=`echo " ${skipdirs} " | sed -e 's/ gprof / /'` ;; 900 *) skipdirs=`echo " ${skipdirs} " | sed -e 's/ gprof / /'` ;;
872 esac 901 esac
873 noconfigdirs="$noconfigdirs target-libgloss ${libgcj}" 902 case "${target}" in
903 sh*-*-elf)
904 noconfigdirs="$noconfigdirs ${libgcj}" ;;
905 *)
906 noconfigdirs="$noconfigdirs target-libgloss ${libgcj}" ;;
907 esac
874 ;; 908 ;;
875 sparclet-*-aout* | sparc86x-*-*) 909 sparclet-*-aout* | sparc86x-*-*)
876 libgloss_dir=sparc 910 libgloss_dir=sparc
877 ;; 911 ;;
878 sparc-*-elf*) 912 sparc-*-elf*)
1185 fi 1219 fi
1186 1220
1187 ACX_PROG_GNAT 1221 ACX_PROG_GNAT
1188 ACX_PROG_CMP_IGNORE_INITIAL 1222 ACX_PROG_CMP_IGNORE_INITIAL
1189 1223
1190 # Check for GMP and MPFR 1224 # See if we are building gcc with C++.
1191 gmplibs="-lmpfr -lgmp" 1225 AC_ARG_ENABLE(build-with-cxx,
1226 [ --enable-build-with-cxx build with C++ compiler instead of C compiler],
1227 ENABLE_BUILD_WITH_CXX=$enableval,
1228 ENABLE_BUILD_WITH_CXX=no)
1229
1230 # Check for GMP, MPFR and MPC
1231 gmplibs="-lmpc -lmpfr -lgmp"
1192 gmpinc= 1232 gmpinc=
1193 have_gmp=no 1233 have_gmp=no
1234
1235 # Specify a location for mpc
1236 # check for this first so it ends up on the link line before mpfr.
1237 AC_ARG_WITH(mpc, [ --with-mpc=PATH specify prefix directory for installed MPC package.
1238 Equivalent to --with-mpc-include=PATH/include
1239 plus --with-mpc-lib=PATH/lib])
1240 AC_ARG_WITH(mpc_include, [ --with-mpc-include=PATH
1241 specify directory for installed MPC include files])
1242 AC_ARG_WITH(mpc_lib, [ --with-mpc-lib=PATH specify directory for the installed MPC library])
1243
1244 if test "x$with_mpc" != x; then
1245 gmplibs="-L$with_mpc/lib $gmplibs"
1246 gmpinc="-I$with_mpc/include $gmpinc"
1247 fi
1248 if test "x$with_mpc_include" != x; then
1249 gmpinc="-I$with_mpc_include $gmpinc"
1250 fi
1251 if test "x$with_mpc_lib" != x; then
1252 gmplibs="-L$with_mpc_lib $gmplibs"
1253 fi
1254 if test "x$with_mpc$with_mpc_include$with_mpc_lib" = x && test -d ${srcdir}/mpc; then
1255 gmplibs='-L$$r/$(HOST_SUBDIR)/mpc/src/.libs -L$$r/$(HOST_SUBDIR)/mpc/src/_libs '"$gmplibs"
1256 gmpinc='-I$$s/mpc/src '"$gmpinc"
1257 # Do not test the mpc version. Assume that it is sufficient, since
1258 # it is in the source tree, and the library has not been built yet
1259 # but it would be included on the link line in the version check below
1260 # hence making the test fail.
1261 have_gmp=yes
1262 fi
1194 1263
1195 # Specify a location for mpfr 1264 # Specify a location for mpfr
1196 # check for this first so it ends up on the link line before gmp. 1265 # check for this first so it ends up on the link line before gmp.
1197 AC_ARG_WITH(mpfr-dir, [ --with-mpfr-dir=PATH this option has been REMOVED], 1266 AC_ARG_WITH(mpfr-dir, [ --with-mpfr-dir=PATH this option has been REMOVED],
1198 AC_MSG_ERROR([The --with-mpfr-dir=PATH option has been removed. 1267 AC_MSG_ERROR([The --with-mpfr-dir=PATH option has been removed.
1205 specify directory for installed MPFR include files]) 1274 specify directory for installed MPFR include files])
1206 AC_ARG_WITH(mpfr_lib, [ --with-mpfr-lib=PATH specify directory for the installed MPFR library]) 1275 AC_ARG_WITH(mpfr_lib, [ --with-mpfr-lib=PATH specify directory for the installed MPFR library])
1207 1276
1208 if test "x$with_mpfr" != x; then 1277 if test "x$with_mpfr" != x; then
1209 gmplibs="-L$with_mpfr/lib $gmplibs" 1278 gmplibs="-L$with_mpfr/lib $gmplibs"
1210 gmpinc="-I$with_mpfr/include" 1279 gmpinc="-I$with_mpfr/include $gmpinc"
1211 fi 1280 fi
1212 if test "x$with_mpfr_include" != x; then 1281 if test "x$with_mpfr_include" != x; then
1213 gmpinc="-I$with_mpfr_include" 1282 gmpinc="-I$with_mpfr_include $gmpinc"
1214 fi 1283 fi
1215 if test "x$with_mpfr_lib" != x; then 1284 if test "x$with_mpfr_lib" != x; then
1216 gmplibs="-L$with_mpfr_lib $gmplibs" 1285 gmplibs="-L$with_mpfr_lib $gmplibs"
1217 fi 1286 fi
1218 if test "x$with_mpfr$with_mpfr_include$with_mpfr_lib" = x && test -d ${srcdir}/mpfr; then 1287 if test "x$with_mpfr$with_mpfr_include$with_mpfr_lib" = x && test -d ${srcdir}/mpfr; then
1219 gmplibs='-L$$r/$(HOST_SUBDIR)/mpfr/.libs -L$$r/$(HOST_SUBDIR)/mpfr/_libs '"$gmplibs" 1288 gmplibs='-L$$r/$(HOST_SUBDIR)/mpfr/.libs -L$$r/$(HOST_SUBDIR)/mpfr/_libs '"$gmplibs"
1220 gmpinc='-I$$r/$(HOST_SUBDIR)/mpfr -I$$s/mpfr '"$gmpinc" 1289 gmpinc='-I$$r/$(HOST_SUBDIR)/mpfr -I$$s/mpfr '"$gmpinc"
1290 extra_mpc_mpfr_configure_flags='--with-mpfr-include=$$s/mpfr'
1221 # Do not test the mpfr version. Assume that it is sufficient, since 1291 # Do not test the mpfr version. Assume that it is sufficient, since
1222 # it is in the source tree, and the library has not been built yet 1292 # it is in the source tree, and the library has not been built yet
1223 # but it would be included on the link line in the version check below 1293 # but it would be included on the link line in the version check below
1224 # hence making the test fail. 1294 # hence making the test fail.
1225 have_gmp=yes 1295 have_gmp=yes
1249 fi 1319 fi
1250 if test "x$with_gmp$with_gmp_include$with_gmp_lib" = x && test -d ${srcdir}/gmp; then 1320 if test "x$with_gmp$with_gmp_include$with_gmp_lib" = x && test -d ${srcdir}/gmp; then
1251 gmplibs='-L$$r/$(HOST_SUBDIR)/gmp/.libs -L$$r/$(HOST_SUBDIR)/gmp/_libs '"$gmplibs" 1321 gmplibs='-L$$r/$(HOST_SUBDIR)/gmp/.libs -L$$r/$(HOST_SUBDIR)/gmp/_libs '"$gmplibs"
1252 gmpinc='-I$$r/$(HOST_SUBDIR)/gmp -I$$s/gmp '"$gmpinc" 1322 gmpinc='-I$$r/$(HOST_SUBDIR)/gmp -I$$s/gmp '"$gmpinc"
1253 extra_mpfr_configure_flags='--with-gmp-build=$$r/$(HOST_SUBDIR)/gmp' 1323 extra_mpfr_configure_flags='--with-gmp-build=$$r/$(HOST_SUBDIR)/gmp'
1324 extra_mpc_gmp_configure_flags='--with-gmp-include=$$r/$(HOST_SUBDIR)/gmp'
1254 # Do not test the gmp version. Assume that it is sufficient, since 1325 # Do not test the gmp version. Assume that it is sufficient, since
1255 # it is in the source tree, and the library has not been built yet 1326 # it is in the source tree, and the library has not been built yet
1256 # but it would be included on the link line in the version check below 1327 # but it would be included on the link line in the version check below
1257 # hence making the test fail. 1328 # hence making the test fail.
1258 have_gmp=yes 1329 have_gmp=yes
1263 saved_CFLAGS="$CFLAGS" 1334 saved_CFLAGS="$CFLAGS"
1264 CFLAGS="$CFLAGS $gmpinc" 1335 CFLAGS="$CFLAGS $gmpinc"
1265 # Check GMP actually works 1336 # Check GMP actually works
1266 AC_MSG_CHECKING([for correct version of gmp.h]) 1337 AC_MSG_CHECKING([for correct version of gmp.h])
1267 AC_TRY_COMPILE([#include "gmp.h"],[ 1338 AC_TRY_COMPILE([#include "gmp.h"],[
1268 #if __GNU_MP_VERSION < 4 || (__GNU_MP_VERSION == 4 && __GNU_MP_VERSION_MINOR < 1) 1339 #if __GNU_MP_VERSION < 4 || (__GNU_MP_VERSION == 4 && __GNU_MP_VERSION_MINOR < 2)
1269 choke me 1340 choke me
1270 #endif 1341 #endif
1271 ], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]); have_gmp=no]) 1342 ], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]); have_gmp=no])
1272 1343
1344 # If we have GMP, check the MPFR version.
1345 if test x"$have_gmp" = xyes; then
1346 dnl MPFR 2.3.1 is acceptable, but MPFR 2.3.2 is better.
1347 AC_MSG_CHECKING([for correct version of mpfr.h])
1348 AC_TRY_COMPILE([#include <gmp.h>
1349 #include <mpfr.h>],[
1350 #if MPFR_VERSION < MPFR_VERSION_NUM(2,3,1)
1351 choke me
1352 #endif
1353 ], AC_TRY_COMPILE([#include <gmp.h>
1354 #include <mpfr.h>],[
1355 #if MPFR_VERSION < MPFR_VERSION_NUM(2,3,2)
1356 choke me
1357 #endif
1358 ], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([buggy but acceptable])]),
1359 [AC_MSG_RESULT([no]); have_gmp=no])
1360 fi
1361
1362 # Check for the MPC header version.
1363 if test x"$have_gmp" = xyes ; then
1364 AC_MSG_CHECKING([for the correct version of mpc.h])
1365 AC_TRY_COMPILE([#include <mpc.h>],[
1366 #if MPC_VERSION < MPC_VERSION_NUM (0,8,0)
1367 choke me
1368 #endif
1369 ], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]); have_gmp=no])
1370 fi
1371
1372 # Now check the MPFR library.
1273 if test x"$have_gmp" = xyes; then 1373 if test x"$have_gmp" = xyes; then
1274 saved_LIBS="$LIBS" 1374 saved_LIBS="$LIBS"
1275 LIBS="$LIBS $gmplibs" 1375 LIBS="$LIBS $gmplibs"
1276 dnl MPFR 2.3.0 is acceptable, but MPFR 2.3.2 is better. 1376 AC_MSG_CHECKING([for the correct version of the gmp/mpfr/mpc libraries])
1277 AC_MSG_CHECKING([for correct version of mpfr.h]) 1377 AC_TRY_LINK([#include <mpc.h>],[
1278 AC_TRY_LINK([#include <gmp.h>
1279 #include <mpfr.h>],[
1280 #if MPFR_VERSION < MPFR_VERSION_NUM(2,3,0)
1281 choke me
1282 #endif
1283 mpfr_t n; 1378 mpfr_t n;
1284 mpfr_t x; 1379 mpfr_t x;
1380 mpc_t c;
1285 int t; 1381 int t;
1286 mpfr_init (n); 1382 mpfr_init (n);
1287 mpfr_init (x); 1383 mpfr_init (x);
1288 mpfr_atan2 (n, n, x, GMP_RNDN); 1384 mpfr_atan2 (n, n, x, GMP_RNDN);
1289 mpfr_erfc (n, x, GMP_RNDN); 1385 mpfr_erfc (n, x, GMP_RNDN);
1290 mpfr_subnormalize (x, t, GMP_RNDN); 1386 mpfr_subnormalize (x, t, GMP_RNDN);
1291 ], [AC_TRY_LINK([#include <gmp.h> 1387 mpfr_clear(n);
1292 #include <mpfr.h>],[ 1388 mpfr_clear(x);
1293 #if MPFR_VERSION < MPFR_VERSION_NUM(2,3,2) 1389 mpc_init2 (c, 53);
1294 choke me 1390 mpc_set_ui_ui (c, 1, 1, MPC_RNDNN);
1295 #endif 1391 mpc_cosh (c, c, MPC_RNDNN);
1296 mpfr_t n; mpfr_init(n); 1392 mpc_pow (c, c, c, MPC_RNDNN);
1297 ], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([buggy but acceptable])])], 1393 mpc_acosh (c, c, MPC_RNDNN);
1298 [AC_MSG_RESULT([no]); have_gmp=no]) 1394 mpc_clear (c);
1299 LIBS="$saved_LIBS" 1395 ], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]); have_gmp=no])
1300 fi 1396 LIBS="$saved_LIBS"
1397 fi
1398
1301 CFLAGS="$saved_CFLAGS" 1399 CFLAGS="$saved_CFLAGS"
1302 1400
1303 if test x$have_gmp != xyes; then 1401 if test x$have_gmp != xyes; then
1304 AC_MSG_ERROR([Building GCC requires GMP 4.1+ and MPFR 2.3.2+. 1402 AC_MSG_ERROR([Building GCC requires GMP 4.2+, MPFR 2.3.2+ and MPC 0.8.0+.
1305 Try the --with-gmp and/or --with-mpfr options to specify their locations. 1403 Try the --with-gmp, --with-mpfr and/or --with-mpc options to specify
1306 Copies of these libraries' source code can be found at their respective 1404 their locations. Source code for these libraries can be found at
1307 hosting sites as well as at ftp://gcc.gnu.org/pub/gcc/infrastructure/. 1405 their respective hosting sites as well as at
1308 See also http://gcc.gnu.org/install/prerequisites.html for additional info. 1406 ftp://gcc.gnu.org/pub/gcc/infrastructure/. See also
1309 If you obtained GMP and/or MPFR from a vendor distribution package, make 1407 http://gcc.gnu.org/install/prerequisites.html for additional info. If
1310 sure that you have installed both the libraries and the header files. 1408 you obtained GMP, MPFR and/or MPC from a vendor distribution package,
1311 They may be located in separate packages.]) 1409 make sure that you have installed both the libraries and the header
1312 fi 1410 files. They may be located in separate packages.])
1313 fi 1411 fi
1314 1412 fi
1315 # Flags needed for both GMP and/or MPFR 1413
1414 # Flags needed for both GMP, MPFR and/or MPC.
1316 AC_SUBST(gmplibs) 1415 AC_SUBST(gmplibs)
1317 AC_SUBST(gmpinc) 1416 AC_SUBST(gmpinc)
1318 AC_SUBST(extra_mpfr_configure_flags) 1417 AC_SUBST(extra_mpfr_configure_flags)
1418 AC_SUBST(extra_mpc_gmp_configure_flags)
1419 AC_SUBST(extra_mpc_mpfr_configure_flags)
1319 1420
1320 # Allow host libstdc++ to be specified for static linking with PPL. 1421 # Allow host libstdc++ to be specified for static linking with PPL.
1321 AC_ARG_WITH(host-libstdcxx, [ --with-host-libstdcxx=L Use linker arguments L to link with libstdc++ 1422 AC_ARG_WITH(host-libstdcxx, [ --with-host-libstdcxx=L Use linker arguments L to link with libstdc++
1322 when linking with PPL]) 1423 when linking with PPL])
1323 1424
1325 no|yes) 1426 no|yes)
1326 AC_MSG_ERROR([-with-host-libstdcxx needs an argument]) 1427 AC_MSG_ERROR([-with-host-libstdcxx needs an argument])
1327 ;; 1428 ;;
1328 esac 1429 esac
1329 1430
1431 # Linker flags to use for stage1 or when not boostrapping.
1432 AC_ARG_WITH(stage1-ldflags,
1433 [ --with-stage1-ldflags=FLAGS Linker flags for stage1],
1434 [if test "$withval" = "no" -o "$withval" = "yes"; then
1435 stage1_ldflags=
1436 else
1437 stage1_ldflags=$withval
1438 fi],
1439 [stage1_ldflags=])
1440 AC_SUBST(stage1_ldflags)
1441
1442 # Libraries to use for stage1 or when not bootstrapping.
1443 AC_ARG_WITH(stage1-libs,
1444 [ -with-stage1-libs=LIBS Libraries for stage1],
1445 [if test "$withval" = "no" -o "$withval" = "yes"; then
1446 stage1_libs=
1447 else
1448 stage1_libs=$withval
1449 fi],
1450 [stage1_libs=$with_host_libstdcxx])
1451 AC_SUBST(stage1_libs)
1452
1453 # Libraries to use for stage2 and later builds. This defaults to the
1454 # argument passed to --with-host-libstdcxx.
1455 AC_ARG_WITH(boot-libs,
1456 [ --with-boot-libs=LIBS Libraries for stage2 and later],
1457 [if test "$withval" = "no" -o "$withval" = "yes"; then
1458 poststage1_libs=
1459 else
1460 poststage1_libs=$withval
1461 fi],
1462 [poststage1_libs=$with_host_libstdcxx])
1463 AC_SUBST(poststage1_libs)
1464
1465 # Linker flags to use for stage2 and later builds.
1466 AC_ARG_WITH(boot-ldflags,
1467 [ --with-boot-ldflags=FLAGS Linker flags for stage2 and later],
1468 [if test "$withval" = "no" -o "$withval" = "yes"; then
1469 poststage1_ldflags=
1470 else
1471 poststage1_ldflags=$withval
1472 fi],
1473 [poststage1_ldflags=
1474 # With --enable-build-with-cxx, default to linking libstdc++ and
1475 # libgcc statically. But if the user explicitly specified the
1476 # libraries to use, trust that they are doing what they want.
1477 if test "$ENABLE_BUILD_WITH_CXX" = "yes" -a "$poststage1_libs" = ""; then
1478 poststage1_ldflags="-static-libstdc++ -static-libgcc"
1479 fi])
1480 AC_SUBST(poststage1_ldflags)
1481
1330 # Check for PPL 1482 # Check for PPL
1331 ppl_major_version=0 1483 ppl_major_version=0
1332 ppl_minor_version=10 1484 ppl_minor_version=10
1333 ppllibs=" -lppl_c -lppl -lgmpxx $with_host_libstdcxx " 1485 ppllibs=" -lppl_c -lppl -lgmpxx"
1334 pplinc= 1486 pplinc=
1335 1487
1336 AC_ARG_WITH(ppl, [ --with-ppl=PATH Specify prefix directory for the installed PPL package 1488 AC_ARG_WITH(ppl, [ --with-ppl=PATH Specify prefix directory for the installed PPL package
1337 Equivalent to --with-ppl-include=PATH/include 1489 Equivalent to --with-ppl-include=PATH/include
1338 plus --with-ppl-lib=PATH/lib]) 1490 plus --with-ppl-lib=PATH/lib])
1341 1493
1342 case $with_ppl in 1494 case $with_ppl in
1343 no) 1495 no)
1344 ppllibs= 1496 ppllibs=
1345 ;; 1497 ;;
1498 "" | yes)
1499 ;;
1346 *) 1500 *)
1347 ppllibs="-L$with_ppl/lib -lppl_c -lppl -lgmpxx $with_host_libstdcxx" 1501 ppllibs="-L$with_ppl/lib -lppl_c -lppl -lgmpxx"
1348 pplinc="-I$with_ppl/include $pplinc" 1502 pplinc="-I$with_ppl/include $pplinc"
1349 LIBS="$ppllibs $LIBS"
1350 ;; 1503 ;;
1351 esac 1504 esac
1352 if test "x$with_ppl_include" != x; then 1505 if test "x$with_ppl_include" != x; then
1353 pplinc="-I$with_ppl_include $pplinc" 1506 pplinc="-I$with_ppl_include $pplinc"
1354 fi 1507 fi
1355 if test "x$with_ppl_lib" != x; then 1508 if test "x$with_ppl_lib" != x; then
1356 ppllibs="-L$with_ppl_lib -lppl_c -lppl -lgmpxx $with_host_libstdcxx" 1509 ppllibs="-L$with_ppl_lib -lppl_c -lppl -lgmpxx"
1357 LIBS="$ppllibs $LIBS"
1358 fi 1510 fi
1359 if test "x$with_ppl$with_ppl_include$with_ppl_lib" = x && test -d ${srcdir}/ppl; then 1511 if test "x$with_ppl$with_ppl_include$with_ppl_lib" = x && test -d ${srcdir}/ppl; then
1360 ppllibs='-L$$r/$(HOST_SUBDIR)/ppl/.libs -L$$r/$(HOST_SUBDIR)/ppl/_libs -lppl_c -lppl -lgmpxx '"$with_host_libstdcxx " 1512 ppllibs='-L$$r/$(HOST_SUBDIR)/ppl/interfaces/C/.libs -L$$r/$(HOST_SUBDIR)/ppl/interfaces/C/_libs -L$$r/$(HOST_SUBDIR)/ppl/src/.libs -L$$r/$(HOST_SUBDIR)/ppl/src/_libs -lppl_c -lppl -lgmpxx '
1361 pplinc='-I$$r/$(HOST_SUBDIR)/ppl/include -I$$s/ppl/include ' 1513 pplinc='-I$$r/$(HOST_SUBDIR)/ppl/src -I$$r/$(HOST_SUBDIR)/ppl/interfaces/C '
1362 LIBS="$ppllibs $LIBS" 1514 enable_ppl_version_check=no
1363 fi 1515 fi
1364 1516
1365 AC_ARG_ENABLE(ppl-version-check, 1517 AC_ARG_ENABLE(ppl-version-check,
1366 [ --disable-ppl-version-check disable check for PPL version], 1518 [ --disable-ppl-version-check disable check for PPL version],
1367 ENABLE_PPL_CHECK=$enableval, 1519 ENABLE_PPL_CHECK=$enableval,
1368 ENABLE_PPL_CHECK=yes) 1520 ENABLE_PPL_CHECK=yes)
1369 1521
1370 if test "${ENABLE_PPL_CHECK}" = "yes"; then 1522 if test "x$with_ppl" != "xno" -a "${ENABLE_PPL_CHECK}" = "yes"; then
1371 saved_CFLAGS="$CFLAGS" 1523 saved_CFLAGS="$CFLAGS"
1372 CFLAGS="$CFLAGS $pplinc $gmpinc" 1524 CFLAGS="$CFLAGS $pplinc $gmpinc"
1373 AC_MSG_CHECKING([for version $ppl_major_version.$ppl_minor_version of PPL]) 1525 AC_MSG_CHECKING([for version $ppl_major_version.$ppl_minor_version of PPL])
1374 AC_TRY_COMPILE([#include "ppl_c.h"],[ 1526 AC_TRY_COMPILE([#include "ppl_c.h"],[
1375 #if PPL_VERSION_MAJOR != $ppl_major_version || PPL_VERSION_MINOR != $ppl_minor_version 1527 #if PPL_VERSION_MAJOR != $ppl_major_version || PPL_VERSION_MINOR != $ppl_minor_version
1376 choke me 1528 choke me
1377 #endif 1529 #endif
1378 ], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]); ppllibs= ; pplinc= ]) 1530 ], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]); ppllibs= ; pplinc= ; with_ppl=no ])
1379 CFLAGS="$saved_CFLAGS" 1531 CFLAGS="$saved_CFLAGS"
1380 fi 1532 fi
1381 1533
1382 # Flags needed for PPL 1534 # Flags needed for PPL
1383 AC_SUBST(ppllibs) 1535 AC_SUBST(ppllibs)
1392 Equivalent to --with-cloog-include=PATH/include 1544 Equivalent to --with-cloog-include=PATH/include
1393 plus --with-cloog-lib=PATH/lib]) 1545 plus --with-cloog-lib=PATH/lib])
1394 AC_ARG_WITH(cloog_include, [ --with-cloog-include=PATH Specify directory for installed CLooG include files]) 1546 AC_ARG_WITH(cloog_include, [ --with-cloog-include=PATH Specify directory for installed CLooG include files])
1395 AC_ARG_WITH(cloog_lib, [ --with-cloog-lib=PATH Specify the directory for the installed CLooG library]) 1547 AC_ARG_WITH(cloog_lib, [ --with-cloog-lib=PATH Specify the directory for the installed CLooG library])
1396 1548
1549 if test "x$with_ppl" = "xno"; then
1550 with_cloog=no
1551 fi
1552
1397 case $with_cloog in 1553 case $with_cloog in
1398 no) 1554 no)
1399 clooglibs= 1555 clooglibs=
1400 clooginc= 1556 clooginc=
1401 ;; 1557 ;;
1558 "" | yes)
1559 ;;
1402 *) 1560 *)
1403 clooglibs="-L$with_cloog/lib -lcloog" 1561 clooglibs="-L$with_cloog/lib -lcloog"
1404 clooginc="-I$with_cloog/include -DCLOOG_PPL_BACKEND " 1562 clooginc="-I$with_cloog/include -DCLOOG_PPL_BACKEND "
1405 LIBS="$clooglibs $LIBS"
1406 ;; 1563 ;;
1407 esac 1564 esac
1408 if test "x$with_cloog_include" != x; then 1565 if test "x$with_cloog_include" != x; then
1409 clooginc="-I$with_cloog_include -DCLOOG_PPL_BACKEND " 1566 clooginc="-I$with_cloog_include -DCLOOG_PPL_BACKEND "
1410 fi 1567 fi
1411 if test "x$with_cloog_lib" != x; then 1568 if test "x$with_cloog_lib" != x; then
1412 clooglibs="-L$with_cloog_lib -lcloog" 1569 clooglibs="-L$with_cloog_lib -lcloog"
1413 LIBS="$clooglibs $LIBS"
1414 fi 1570 fi
1415 if test "x$with_cloog$with_cloog_include$with_cloog_lib" = x && test -d ${srcdir}/cloog; then 1571 if test "x$with_cloog$with_cloog_include$with_cloog_lib" = x && test -d ${srcdir}/cloog; then
1416 clooglibs='-L$$r/$(HOST_SUBDIR)/cloog/.libs -L$$r/$(HOST_SUBDIR)/cloog/_libs -lcloog ' 1572 clooglibs='-L$$r/$(HOST_SUBDIR)/cloog/.libs -L$$r/$(HOST_SUBDIR)/cloog/_libs -lcloog '
1417 clooginc='-I$$r/$(HOST_SUBDIR)/cloog/include -I$$s/cloog/include -DCLOOG_PPL_BACKEND ' 1573 clooginc='-I$$r/$(HOST_SUBDIR)/cloog/include -I$$s/cloog/include -DCLOOG_PPL_BACKEND '
1418 LIBS="$clooglibs $LIBS" 1574 enable_cloog_version_check=no
1419 fi 1575 fi
1420 1576
1421 AC_ARG_ENABLE(cloog-version-check, 1577 AC_ARG_ENABLE(cloog-version-check,
1422 [ --disable-cloog-version-check disable check for CLooG version], 1578 [ --disable-cloog-version-check disable check for CLooG version],
1423 ENABLE_CLOOG_CHECK=$enableval, 1579 ENABLE_CLOOG_CHECK=$enableval,
1424 ENABLE_CLOOG_CHECK=yes) 1580 ENABLE_CLOOG_CHECK=yes)
1425 1581
1426 if test "${ENABLE_CLOOG_CHECK}" = "yes"; then 1582 if test "x$with_cloog" != "xno" -a "${ENABLE_CLOOG_CHECK}" = "yes"; then
1427 saved_CFLAGS="$CFLAGS" 1583 saved_CFLAGS="$CFLAGS"
1428 CFLAGS="$CFLAGS $clooginc $gmpinc $pplinc" 1584 CFLAGS="$CFLAGS $clooginc $gmpinc $pplinc"
1429 AC_MSG_CHECKING([for correct version of CLooG]) 1585 AC_MSG_CHECKING([for version 0.15.5 (or later revision) of CLooG])
1430 AC_TRY_COMPILE([#include "cloog/cloog.h"],[ 1586 AC_TRY_COMPILE([#include "cloog/cloog.h"],[
1431 #if CLOOG_VERSION_MAJOR != 0 || CLOOG_VERSION_MINOR != 15 1587 #if CLOOG_VERSION_MAJOR != 0 || CLOOG_VERSION_MINOR != 15 || CLOOG_VERSION_REVISION < 5
1432 choke me 1588 choke me
1433 #endif 1589 #endif
1434 ], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]); clooglibs= ; clooginc= ]) 1590 ], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]); clooglibs= ; clooginc= ])
1435 CFLAGS="$saved_CFLAGS" 1591 CFLAGS="$saved_CFLAGS"
1436 fi 1592 fi
1437 1593
1438 # Flags needed for CLOOG 1594 # Flags needed for CLOOG
1439 AC_SUBST(clooglibs) 1595 AC_SUBST(clooglibs)
1440 AC_SUBST(clooginc) 1596 AC_SUBST(clooginc)
1441 1597
1598 # Check for LTO support.
1599 AC_ARG_ENABLE(lto,
1600 [ --enable-lto enable link time optimization support],
1601 enable_lto=$enableval,
1602 enable_lto=yes; default_enable_lto=yes)
1603
1604 if test x"$enable_lto" = x"yes" ; then
1605 # Make sure that libelf.h and gelf.h are available.
1606 AC_ARG_WITH(libelf, [ --with-libelf=PATH Specify prefix directory for the installed libelf package
1607 Equivalent to --with-libelf-include=PATH/include
1608 plus --with-libelf-lib=PATH/lib])
1609
1610 AC_ARG_WITH(libelf_include, [ --with-libelf-include=PATH Specify directory for installed libelf include files])
1611
1612 AC_ARG_WITH(libelf_lib, [ --with-libelf-lib=PATH Specify the directory for the installed libelf library])
1613
1614 saved_CFLAGS="$CFLAGS"
1615 saved_CPPFLAGS="$CPPFLAGS"
1616 saved_LIBS="$LIBS"
1617
1618 case $with_libelf in
1619 "")
1620 libelflibs="-lelf"
1621 libelfinc="-I/usr/include/libelf"
1622 ;;
1623 *)
1624 libelflibs="-L$with_libelf/lib -lelf"
1625 libelfinc="-I$with_libelf/include -I$with_libelf/include/libelf"
1626 LIBS="$libelflibs $LIBS"
1627 ;;
1628 esac
1629
1630 if test "x$with_libelf_include" != x; then
1631 libelfinc="-I$with_libelf_include"
1632 fi
1633
1634 if test "x$with_libelf_lib" != x; then
1635 libelflibs="-L$with_libelf_lib -lelf"
1636 LIBS="$libelflibs $LIBS"
1637 fi
1638
1639 if test "x$with_libelf$with_libelf_include$with_libelf_lib" = x \
1640 && test -d ${srcdir}/libelf; then
1641 libelflibs='-L$$r/$(HOST_SUBDIR)/libelf/lib -lelf '
1642 libelfinc='-D__LIBELF_INTERNAL__ -I$$r/$(HOST_SUBDIR)/libelf/lib -I$$s/libelf/lib'
1643 LIBS="$libelflibs $LIBS"
1644
1645 else
1646
1647 CFLAGS="$CFLAGS $libelfinc"
1648 CPPFLAGS="$CPPFLAGS $libelfinc"
1649 LIBS="$LIBS $libelflibs"
1650
1651 AC_CHECK_HEADERS(libelf.h, [have_libelf_h=yes])
1652 AC_CHECK_HEADERS(gelf.h, [have_gelf_h=yes])
1653
1654 AC_CHECK_HEADERS(libelf/libelf.h, [have_libelf_libelf_h=yes])
1655 AC_CHECK_HEADERS(libelf/gelf.h, [have_libelf_gelf_h=yes])
1656
1657 # If we couldn't find libelf.h and the user forced it, emit an error.
1658 if test x"$have_libelf_h" != x"yes" \
1659 && test x"$have_libelf_libelf_h" != x"yes" ; then
1660 if test x"$default_enable_lto" != x"yes" ; then
1661 AC_MSG_ERROR([LTO support requires libelf.h or libelf/libelf.h.])
1662 else
1663 enable_lto=no
1664 libelflibs=
1665 libelfinc=
1666 fi
1667 fi
1668
1669 # If we couldn't find gelf.h and the user forced it, emit an error.
1670 if test x"$have_gelf_h" != x"yes" \
1671 && test x"$have_libelf_gelf_h" != x"yes" ; then
1672 if test x"$default_enable_lto" != x"yes" ; then
1673 AC_MSG_ERROR([LTO support requires gelf.h or libelf/gelf.h.])
1674 else
1675 enable_lto=no
1676 libelflibs=
1677 libelfinc=
1678 fi
1679 fi
1680
1681 # Check that the detected libelf has the functions we need. We cannot
1682 # rely on just detecting the headers since they do not include
1683 # versioning information. Add functions, if needed.
1684 if test x"$enable_lto" = x"yes" ; then
1685 AC_MSG_CHECKING([for the correct version of libelf])
1686 AC_TRY_LINK(
1687 [#include <libelf.h>],[
1688 elf_errmsg (0);
1689 elf_getscn (0, 0);
1690 elf_nextscn (0, 0);
1691 elf_strptr (0, 0, 0);
1692 elf_getident (0, 0);
1693 elf_getshdrstrndx (0, 0);
1694 elf_begin (0, 0, 0);
1695 elf_ndxscn (0);
1696 elf_end (0);
1697 ],
1698 [AC_MSG_RESULT([yes]);],
1699 [AC_MSG_RESULT([no]); enable_lto=no; libelflibs= ; libelfinc= ]
1700 )
1701
1702 # If we couldn't enable LTO and the user forced it, emit an error.
1703 if test x"$enable_lto" = x"no" \
1704 && test x"$default_enable_lto" != x"yes" ; then
1705 AC_MSG_ERROR([To enable LTO, GCC requires libelf v0.8.12+.
1706 Try the --with-libelf, --with-libelf-include and --with-libelf-lib options
1707 to specify its location.])
1708 fi
1709 fi
1710
1711 CFLAGS="$saved_CFLAGS"
1712 CPPFLAGS="$saved_CPPFLAGS"
1713 LIBS="$saved_LIBS"
1714
1715 fi
1716
1717 # Flags needed for libelf.
1718 AC_SUBST(libelflibs)
1719 AC_SUBST(libelfinc)
1720 fi
1721
1442 1722
1443 # By default, C is the only stage 1 language. 1723 # By default, C is the only stage 1 language.
1444 stage1_languages=,c, 1724 stage1_languages=,c,
1725
1726 # Target libraries that we bootstrap.
1727 bootstrap_target_libs=,target-libgcc,
1445 1728
1446 # Figure out what language subdirectories are present. 1729 # Figure out what language subdirectories are present.
1447 # Look if the user specified --enable-languages="..."; if not, use 1730 # Look if the user specified --enable-languages="..."; if not, use
1448 # the environment variable $LANGUAGES if defined. $LANGUAGES might 1731 # the environment variable $LANGUAGES if defined. $LANGUAGES might
1449 # go away some day. 1732 # go away some day.
1502 ;; 1785 ;;
1503 esac 1786 esac
1504 done 1787 done
1505 1788
1506 new_enable_languages=,c, 1789 new_enable_languages=,c,
1790
1791 # If LTO is enabled, add the LTO front end.
1792 extra_host_libiberty_configure_flags=
1793 if test "$enable_lto" = "yes" ; then
1794 case ,${enable_languages}, in
1795 *,lto,*) ;;
1796 *) enable_languages="${enable_languages},lto" ;;
1797 esac
1798 if test "${ENABLE_GOLD}" = "yes" ; then
1799 configdirs="$configdirs lto-plugin"
1800 extra_host_libiberty_configure_flags=--enable-shared
1801 fi
1802 fi
1803 AC_SUBST(extra_host_libiberty_configure_flags)
1804
1507 missing_languages=`echo ",$enable_languages," | sed -e s/,all,/,/ -e s/,c,/,/ ` 1805 missing_languages=`echo ",$enable_languages," | sed -e s/,all,/,/ -e s/,c,/,/ `
1508 potential_languages=,c, 1806 potential_languages=,c,
1509 1807
1510 for lang_frag in ${srcdir}/gcc/*/config-lang.in .. ; do 1808 for lang_frag in ${srcdir}/gcc/*/config-lang.in .. ; do
1511 case ${lang_frag} in 1809 case ${lang_frag} in
1526 if test x${language} = x; then 1824 if test x${language} = x; then
1527 echo "${lang_frag} doesn't set \$language." 1>&2 1825 echo "${lang_frag} doesn't set \$language." 1>&2
1528 exit 1 1826 exit 1
1529 fi 1827 fi
1530 1828
1829 if test "$language" = "c++" \
1830 && test "$ENABLE_BUILD_WITH_CXX" = "yes"; then
1831 boot_language=yes
1832 fi
1833
1531 case ,${enable_languages}, in 1834 case ,${enable_languages}, in
1532 *,${language},*) 1835 *,${language},*)
1533 # Language was explicitly selected; include it. 1836 # Language was explicitly selected; include it.
1534 add_this_lang=yes 1837 add_this_lang=yes
1535 ;; 1838 ;;
1588 ;; 1891 ;;
1589 yes) 1892 yes)
1590 new_enable_languages="${new_enable_languages}${language}," 1893 new_enable_languages="${new_enable_languages}${language},"
1591 potential_languages="${potential_languages}${language}," 1894 potential_languages="${potential_languages}${language},"
1592 missing_languages=`echo "$missing_languages" | sed "s/,$language,/,/"` 1895 missing_languages=`echo "$missing_languages" | sed "s/,$language,/,/"`
1593 case ${boot_language} in 1896 case "${boot_language}:,$enable_stage1_languages," in
1594 yes) 1897 yes:* | *:*,$language,* | *:*,yes, | *:*,all,)
1595 # Add to (comma-separated) list of stage 1 languages. 1898 # Add to (comma-separated) list of stage 1 languages.
1596 stage1_languages="${stage1_languages}${language}," 1899 case ",$stage1_languages," in
1900 *,$language,* | ,yes, | ,all,) ;;
1901 *) stage1_languages="${stage1_languages}${language}," ;;
1902 esac
1903 # We need to bootstrap any supporting libraries.
1904 bootstrap_target_libs="${bootstrap_target_libs}${target_libs},"
1597 ;; 1905 ;;
1598 esac 1906 esac
1599 ;; 1907 ;;
1600 esac 1908 esac
1601 ;; 1909 ;;
1902 copy_dirs="$l $x/${target_noncanonical}/lib ${copy_dirs}" 2210 copy_dirs="$l $x/${target_noncanonical}/lib ${copy_dirs}"
1903 done 2211 done
1904 fi 2212 fi
1905 fi 2213 fi
1906 2214
1907 # Set with_gnu_as and with_gnu_ld as appropriate. 2215 # Set with_gnu_as, with_gnu_ld, and with_system_zlib as appropriate.
1908 # 2216 #
1909 # This is done by determining whether or not the appropriate directory 2217 # This is done by determining whether or not the appropriate directory
1910 # is available, and by checking whether or not specific configurations 2218 # is available, and by checking whether or not specific configurations
1911 # have requested that this magic not happen. 2219 # have requested that this magic not happen.
1912 # 2220 #
1913 # The command line options always override the explicit settings in 2221 # The command line options always override the explicit settings in
1914 # configure.in, and the settings in configure.in override this magic. 2222 # configure.in, and the settings in configure.in override this magic.
1915 # 2223 #
1916 # If the default for a toolchain is to use GNU as and ld, and you don't 2224 # If the default for a toolchain is to use GNU as and ld, and you don't
1917 # want to do that, then you should use the --without-gnu-as and 2225 # want to do that, then you should use the --without-gnu-as and
1918 # --without-gnu-ld options for the configure script. 2226 # --without-gnu-ld options for the configure script. Similarly, if
2227 # the default is to use the included zlib and you don't want to do that,
2228 # you should use the --with-system-zlib option for the configure script.
1919 2229
1920 if test x${use_gnu_as} = x && 2230 if test x${use_gnu_as} = x &&
1921 echo " ${configdirs} " | grep " gas " > /dev/null 2>&1 ; then 2231 echo " ${configdirs} " | grep " gas " > /dev/null 2>&1 ; then
1922 with_gnu_as=yes 2232 with_gnu_as=yes
1923 extra_host_args="$extra_host_args --with-gnu-as" 2233 extra_host_args="$extra_host_args --with-gnu-as"
1925 2235
1926 if test x${use_gnu_ld} = x && 2236 if test x${use_gnu_ld} = x &&
1927 echo " ${configdirs} " | egrep " (go)?ld " > /dev/null 2>&1 ; then 2237 echo " ${configdirs} " | egrep " (go)?ld " > /dev/null 2>&1 ; then
1928 with_gnu_ld=yes 2238 with_gnu_ld=yes
1929 extra_host_args="$extra_host_args --with-gnu-ld" 2239 extra_host_args="$extra_host_args --with-gnu-ld"
2240 fi
2241
2242 if test x${use_included_zlib} = x &&
2243 echo " ${configdirs} " | grep " zlib " > /dev/null 2>&1 ; then
2244 :
2245 else
2246 with_system_zlib=yes
2247 extra_host_args="$extra_host_args --with-system-zlib"
1930 fi 2248 fi
1931 2249
1932 # If using newlib, add --with-newlib to the extra_host_args so that gcc/configure 2250 # If using newlib, add --with-newlib to the extra_host_args so that gcc/configure
1933 # can detect this case. 2251 # can detect this case.
1934 2252
2234 2552
2235 # While at that, we remove Makefiles if we were started for recursive 2553 # While at that, we remove Makefiles if we were started for recursive
2236 # configuration, so that the top-level Makefile reconfigures them, 2554 # configuration, so that the top-level Makefile reconfigures them,
2237 # like we used to do when configure itself was recursive. 2555 # like we used to do when configure itself was recursive.
2238 2556
2239 # Loop over modules. $extrasub must be used with care, limiting as 2557 # Loop over modules. We used to use the "$extrasub" feature from Autoconf
2240 # much as possible the usage of range addresses. That's because autoconf 2558 # but now we're fixing up the Makefile ourselves with the additional
2241 # splits the sed script to overcome limits in the number of commands, 2559 # commands passed to AC_CONFIG_FILES. Use separate variables
2242 # and relying on carefully-timed sed passes may turn out to be very hard 2560 # extrasub-{build,host,target} not because there is any reason to split
2243 # to maintain later. In this particular case, you just have to be careful 2561 # the substitutions up that way, but only to remain below the limit of
2244 # not to nest @if/@endif pairs, because configure will not warn you at all. 2562 # 99 commands in a script, for HP-UX sed.
2563 # Do not nest @if/@endif pairs, because configure will not warn you at all.
2245 2564
2246 AC_ARG_ENABLE([bootstrap], 2565 AC_ARG_ENABLE([bootstrap],
2247 [ --enable-bootstrap enable bootstrapping @<:@yes if native build@:>@],, 2566 [ --enable-bootstrap enable bootstrapping @<:@yes if native build@:>@],,
2248 enable_bootstrap=default) 2567 enable_bootstrap=default)
2249 2568
2282 *) 2601 *)
2283 AC_MSG_ERROR([invalid option for --enable-bootstrap]) 2602 AC_MSG_ERROR([invalid option for --enable-bootstrap])
2284 ;; 2603 ;;
2285 esac 2604 esac
2286 2605
2606 case ",$enable_languages,:$ENABLE_BUILD_WITH_CXX:$enable_bootstrap" in
2607 *,c++,*:yes:yes) ;;
2608 *:yes:yes)
2609 AC_MSG_ERROR([bootstrapping with --enable-build-with-cxx requires c++ in --enable-languages])
2610 ;;
2611 esac
2612
2613 case "$enable_bootstrap:$ENABLE_GOLD: $configdirs :,$stage1_languages," in
2614 yes:yes:*\ gold\ *:*,c++,*) ;;
2615 yes:yes:*\ gold\ *:*)
2616 AC_MSG_ERROR([in a combined tree, bootstrapping with --enable-gold requires c++ in stage1_languages])
2617 ;;
2618 esac
2619
2287 # Adjust the toplevel makefile according to whether bootstrap was selected. 2620 # Adjust the toplevel makefile according to whether bootstrap was selected.
2288 case "$enable_bootstrap" in 2621 case $enable_bootstrap in
2289 yes) 2622 yes)
2290 bootstrap_suffix=bootstrap ;; 2623 bootstrap_suffix=bootstrap
2624 BUILD_CONFIG=bootstrap-debug
2625 ;;
2291 no) 2626 no)
2292 bootstrap_suffix=no-bootstrap ;; 2627 bootstrap_suffix=no-bootstrap
2293 esac 2628 BUILD_CONFIG=
2294 2629 ;;
2630 esac
2631
2632 AC_MSG_CHECKING(for default BUILD_CONFIG)
2633
2634 AC_ARG_WITH([build-config],
2635 [--with-build-config='NAME NAME2...'
2636 Use config/NAME.mk build configuration],
2637 [case $with_build_config in
2638 yes) with_build_config= ;;
2639 no) with_build_config= BUILD_CONFIG= ;;
2640 esac])
2641
2642 if test "x${with_build_config}" != x; then
2643 BUILD_CONFIG=$with_build_config
2644 else
2645 case $BUILD_CONFIG in
2646 bootstrap-debug)
2647 if echo "int f (void) { return 0; }" > conftest.c &&
2648 ${CC} -c conftest.c &&
2649 mv conftest.o conftest.o.g0 &&
2650 ${CC} -c -g conftest.c &&
2651 mv conftest.o conftest.o.g &&
2652 ${srcdir}/contrib/compare-debug conftest.o.g0 conftest.o.g; then
2653 :
2654 else
2655 BUILD_CONFIG=
2656 fi
2657 rm -f conftest.c conftest.o conftest.o.g0 conftest.o.g
2658 ;;
2659 esac
2660 fi
2661 AC_MSG_RESULT($BUILD_CONFIG)
2662 AC_SUBST(BUILD_CONFIG)
2663
2664 extrasub_build=
2295 for module in ${build_configdirs} ; do 2665 for module in ${build_configdirs} ; do
2296 if test -z "${no_recursion}" \ 2666 if test -z "${no_recursion}" \
2297 && test -f ${build_subdir}/${module}/Makefile; then 2667 && test -f ${build_subdir}/${module}/Makefile; then
2298 echo 1>&2 "*** removing ${build_subdir}/${module}/Makefile to force reconfigure" 2668 echo 1>&2 "*** removing ${build_subdir}/${module}/Makefile to force reconfigure"
2299 rm -f ${build_subdir}/${module}/Makefile 2669 rm -f ${build_subdir}/${module}/Makefile
2300 fi 2670 fi
2301 extrasub="$extrasub 2671 extrasub_build="$extrasub_build
2302 /^@if build-$module\$/d 2672 /^@if build-$module\$/d
2303 /^@endif build-$module\$/d 2673 /^@endif build-$module\$/d
2304 /^@if build-$module-$bootstrap_suffix\$/d 2674 /^@if build-$module-$bootstrap_suffix\$/d
2305 /^@endif build-$module-$bootstrap_suffix\$/d" 2675 /^@endif build-$module-$bootstrap_suffix\$/d"
2306 done 2676 done
2677 extrasub_host=
2307 for module in ${configdirs} ; do 2678 for module in ${configdirs} ; do
2308 if test -z "${no_recursion}"; then 2679 if test -z "${no_recursion}"; then
2309 for file in stage*-${module}/Makefile prev-${module}/Makefile ${module}/Makefile; do 2680 for file in stage*-${module}/Makefile prev-${module}/Makefile ${module}/Makefile; do
2310 if test -f ${file}; then 2681 if test -f ${file}; then
2311 echo 1>&2 "*** removing ${file} to force reconfigure" 2682 echo 1>&2 "*** removing ${file} to force reconfigure"
2312 rm -f ${file} 2683 rm -f ${file}
2313 fi 2684 fi
2314 done 2685 done
2315 fi 2686 fi
2316 extrasub="$extrasub 2687 extrasub_host="$extrasub_host
2317 /^@if $module\$/d 2688 /^@if $module\$/d
2318 /^@endif $module\$/d 2689 /^@endif $module\$/d
2319 /^@if $module-$bootstrap_suffix\$/d 2690 /^@if $module-$bootstrap_suffix\$/d
2320 /^@endif $module-$bootstrap_suffix\$/d" 2691 /^@endif $module-$bootstrap_suffix\$/d"
2321 done 2692 done
2693 extrasub_target=
2322 for module in ${target_configdirs} ; do 2694 for module in ${target_configdirs} ; do
2323 if test -z "${no_recursion}" \ 2695 if test -z "${no_recursion}" \
2324 && test -f ${target_subdir}/${module}/Makefile; then 2696 && test -f ${target_subdir}/${module}/Makefile; then
2325 echo 1>&2 "*** removing ${target_subdir}/${module}/Makefile to force reconfigure" 2697 echo 1>&2 "*** removing ${target_subdir}/${module}/Makefile to force reconfigure"
2326 rm -f ${target_subdir}/${module}/Makefile 2698 rm -f ${target_subdir}/${module}/Makefile
2327 fi 2699 fi
2328 extrasub="$extrasub 2700
2701 # We only bootstrap target libraries listed in bootstrap_target_libs.
2702 case $bootstrap_target_libs in
2703 *,target-$module,*) target_bootstrap_suffix=$bootstrap_suffix ;;
2704 *) target_bootstrap_suffix=no-bootstrap ;;
2705 esac
2706
2707 extrasub_target="$extrasub_target
2329 /^@if target-$module\$/d 2708 /^@if target-$module\$/d
2330 /^@endif target-$module\$/d 2709 /^@endif target-$module\$/d
2331 /^@if target-$module-$bootstrap_suffix\$/d 2710 /^@if target-$module-$target_bootstrap_suffix\$/d
2332 /^@endif target-$module-$bootstrap_suffix\$/d" 2711 /^@endif target-$module-$target_bootstrap_suffix\$/d"
2333 done 2712 done
2334 2713
2335 extrasub="$extrasub 2714 # Do the final fixup along with target modules.
2715 extrasub_target="$extrasub_target
2336 /^@if /,/^@endif /d" 2716 /^@if /,/^@endif /d"
2337 2717
2338 # Create the serialization dependencies. This uses a temporary file. 2718 # Create the serialization dependencies. This uses a temporary file.
2339 2719
2340 AC_ARG_ENABLE([serial-configure], 2720 AC_ARG_ENABLE([serial-configure],
2385 serialization_dependencies=serdep.tmp 2765 serialization_dependencies=serdep.tmp
2386 AC_SUBST_FILE(serialization_dependencies) 2766 AC_SUBST_FILE(serialization_dependencies)
2387 2767
2388 # Base args. Strip norecursion, cache-file, srcdir, host, build, 2768 # Base args. Strip norecursion, cache-file, srcdir, host, build,
2389 # target, nonopt, and variable assignments. These are the ones we 2769 # target, nonopt, and variable assignments. These are the ones we
2390 # might not want to pass down to subconfigures. Also strip 2770 # might not want to pass down to subconfigures. The exception being
2391 # program-prefix, program-suffix, and program-transform-name, so that 2771 # --cache-file=/dev/null, which is used to turn off the use of cache
2392 # we can pass down a consistent program-transform-name. 2772 # files altogether, and which should be passed on to subconfigures.
2773 # Also strip program-prefix, program-suffix, and program-transform-name,
2774 # so that we can pass down a consistent program-transform-name.
2393 baseargs= 2775 baseargs=
2394 keep_next=no 2776 keep_next=no
2395 skip_next=no 2777 skip_next=no
2396 eval "set -- $ac_configure_args" 2778 eval "set -- $ac_configure_args"
2397 for ac_arg 2779 for ac_arg
2426 separate_arg=no 2808 separate_arg=no
2427 ;; 2809 ;;
2428 esac 2810 esac
2429 2811
2430 case "$ac_arg" in 2812 case "$ac_arg" in
2813 --cache-file=/dev/null | \
2814 -cache-file=/dev/null )
2815 # Handled here to avoid the test to skip args below.
2816 baseargs="$baseargs '$ac_arg'"
2817 # Assert: $separate_arg should always be no.
2818 keep_next=$separate_arg
2819 ;;
2431 --no*) 2820 --no*)
2432 continue 2821 continue
2433 ;; 2822 ;;
2434 --c* | \ 2823 --c* | \
2435 --sr* | \ 2824 --sr* | \
2482 rm -f conftestsed.out 2871 rm -f conftestsed.out
2483 baseargs="$baseargs --program-transform-name='${gcc_transform_name}'" 2872 baseargs="$baseargs --program-transform-name='${gcc_transform_name}'"
2484 if test "$silent" = yes; then 2873 if test "$silent" = yes; then
2485 baseargs="$baseargs --silent" 2874 baseargs="$baseargs --silent"
2486 fi 2875 fi
2876 baseargs="$baseargs --disable-option-checking"
2487 2877
2488 # For the build-side libraries, we just need to pretend we're native, 2878 # For the build-side libraries, we just need to pretend we're native,
2489 # and not use the same cache file. Multilibs are neither needed nor 2879 # and not use the same cache file. Multilibs are neither needed nor
2490 # desired. 2880 # desired.
2491 build_configargs="--cache-file=../config.cache ${baseargs}" 2881 build_configargs="--cache-file=../config.cache ${baseargs}"
2544 case " $target_configdirs " in 2934 case " $target_configdirs " in
2545 *" newlib "*) 2935 *" newlib "*)
2546 case " $target_configargs " in 2936 case " $target_configargs " in
2547 *" --with-newlib "*) 2937 *" --with-newlib "*)
2548 case "$target" in 2938 case "$target" in
2549 *-cygwin*) 2939 *-cygwin*)
2550 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' ;; 2940 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'
2941 ;;
2551 esac 2942 esac
2552 2943
2553 # If we're not building GCC, don't discard standard headers. 2944 # If we're not building GCC, don't discard standard headers.
2554 if test -d ${srcdir}/gcc; then 2945 if test -d ${srcdir}/gcc; then
2555 FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -nostdinc' 2946 FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -nostdinc'
2601 esac 2992 esac
2602 ;; 2993 ;;
2603 esac 2994 esac
2604 ;; 2995 ;;
2605 esac 2996 esac
2997
2606 case "$target" in 2998 case "$target" in
2607 *-mingw*) 2999 x86_64-*mingw* | *-w64-mingw*)
2608 # Can't be handled as Cygwin above since Mingw does not use newlib. 3000 # MinGW-w64 does not use newlib, nor does it use winsup. It may,
2609 FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -L$$r/$(TARGET_SUBDIR)/winsup/mingw -L$$r/$(TARGET_SUBDIR)/winsup/w32api/lib -isystem $$s/winsup/mingw/include -isystem $$s/winsup/w32api/include' ;; 3001 # however, use a symlink named 'mingw' in ${prefix} .
3002 FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -L${prefix}/${target}/lib -L${prefix}/mingw/lib -isystem ${prefix}/${target}/include -isystem ${prefix}/mingw/include'
3003 ;;
3004 *-mingw*)
3005 # MinGW can't be handled as Cygwin above since it does not use newlib.
3006 FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -L$$r/$(TARGET_SUBDIR)/winsup/mingw -L$$r/$(TARGET_SUBDIR)/winsup/w32api/lib -isystem $$s/winsup/mingw/include -isystem $$s/winsup/w32api/include'
3007 ;;
2610 esac 3008 esac
2611 3009
2612 # Allow the user to override the flags for 3010 # Allow the user to override the flags for
2613 # our build compiler if desired. 3011 # our build compiler if desired.
2614 if test x"${build}" = x"${host}" ; then 3012 if test x"${build}" = x"${host}" ; then
2726 AC_CHECK_PROGS([MAKEINFO], makeinfo, [$MISSING makeinfo]) 3124 AC_CHECK_PROGS([MAKEINFO], makeinfo, [$MISSING makeinfo])
2727 case " $build_configdirs " in 3125 case " $build_configdirs " in
2728 *" texinfo "*) MAKEINFO='$$r/$(BUILD_SUBDIR)/texinfo/makeinfo/makeinfo' ;; 3126 *" texinfo "*) MAKEINFO='$$r/$(BUILD_SUBDIR)/texinfo/makeinfo/makeinfo' ;;
2729 *) 3127 *)
2730 changequote(,) 3128 changequote(,)
2731 # For an installed makeinfo, we require it to be from texinfo 4.6 or 3129 # For an installed makeinfo, we require it to be from texinfo 4.7 or
2732 # higher, else we use the "missing" dummy. 3130 # higher, else we use the "missing" dummy.
2733 if ${MAKEINFO} --version \ 3131 if ${MAKEINFO} --version \
2734 | egrep 'texinfo[^0-9]*(4\.([6-9]|[1-9][0-9])|[5-9]|[1-9][0-9])' >/dev/null 2>&1; then 3132 | egrep 'texinfo[^0-9]*(4\.([7-9]|[1-9][0-9])|[5-9]|[1-9][0-9])' >/dev/null 2>&1; then
2735 : 3133 :
2736 else 3134 else
2737 MAKEINFO="$MISSING makeinfo" 3135 MAKEINFO="$MISSING makeinfo"
2738 fi 3136 fi
2739 ;; 3137 ;;
2891 *) stage1_cflags="-g -J" ;; 3289 *) stage1_cflags="-g -J" ;;
2892 esac ;; 3290 esac ;;
2893 esac 3291 esac
2894 3292
2895 # This is aimed to mimic bootstrap with a non-GCC compiler to catch problems. 3293 # This is aimed to mimic bootstrap with a non-GCC compiler to catch problems.
2896 if test "$GCC" = yes; then 3294 if test "$GCC" = yes -a "$ENABLE_BUILD_WITH_CXX" != yes; then
2897 saved_CFLAGS="$CFLAGS" 3295 saved_CFLAGS="$CFLAGS"
2898 3296
2899 # Pass -fkeep-inline-functions for stage 1 if the GCC version supports it. 3297 # Pass -fkeep-inline-functions for stage 1 if the GCC version supports it.
2900 CFLAGS="$CFLAGS -fkeep-inline-functions" 3298 CFLAGS="$CFLAGS -fkeep-inline-functions"
2901 AC_MSG_CHECKING([whether -fkeep-inline-functions is supported]) 3299 AC_MSG_CHECKING([whether -fkeep-inline-functions is supported])
2938 yes) stage2_werror_flag="--enable-werror-always" ;; 3336 yes) stage2_werror_flag="--enable-werror-always" ;;
2939 *) stage2_werror_flag="" ;; 3337 *) stage2_werror_flag="" ;;
2940 esac 3338 esac
2941 AC_SUBST(stage2_werror_flag) 3339 AC_SUBST(stage2_werror_flag)
2942 3340
2943 # Flags needed to enable html installing and building 3341 # Specify what files to not compare during bootstrap.
2944 AC_ARG_WITH(datarootdir, 3342
2945 [ --with-datarootdir use datarootdir as the data root directory.], 3343 compare_exclusions="gcc/cc*-checksum\$(objext) | gcc/ada/*tools/*"
2946 [datarootdir="\${prefix}/${withval}"], 3344 case "$target" in
2947 [datarootdir="\${prefix}/share"]) 3345 hppa*64*-*-hpux*) ;;
2948 3346 hppa*-*-hpux*) compare_exclusions="gcc/cc*-checksum\$(objext) | */libgcc/lib2funcs* | gcc/ada/*tools/*" ;;
2949 AC_ARG_WITH(docdir, 3347 esac
2950 [ --with-docdir install documentation in this directory.], 3348 case " $configdirs " in
2951 [docdir="\${prefix}/${withval}"], 3349 *" ppl "*) compare_exclusions="$compare_exclusions | ppl/src/ppl-config.o" ;;
2952 [docdir="\${datarootdir}/doc"]) 3350 esac
2953 3351 AC_SUBST(compare_exclusions)
2954 AC_ARG_WITH(pdfdir, 3352
2955 [ --with-pdfdir install pdf in this directory.], 3353 AC_CONFIG_FILES([Makefile],
2956 [pdfdir="\${prefix}/${withval}"], 3354 [sed "$extrasub_build" Makefile |
2957 [pdfdir="\${docdir}"]) 3355 sed "$extrasub_host" |
2958 3356 sed "$extrasub_target" > mf$$
2959 AC_ARG_WITH(htmldir, 3357 mv -f mf$$ Makefile],
2960 [ --with-htmldir install html in this directory.], 3358 [extrasub_build="$extrasub_build"
2961 [htmldir="\${prefix}/${withval}"], 3359 extrasub_host="$extrasub_host"
2962 [htmldir="\${docdir}"]) 3360 extrasub_target="$extrasub_target"])
2963 3361 AC_OUTPUT
2964 AC_SUBST(datarootdir)
2965 AC_SUBST(docdir)
2966 AC_SUBST(pdfdir)
2967 AC_SUBST(htmldir)
2968
2969 AC_OUTPUT(Makefile)