X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=configure.ac;h=4bb4865d84fa9cb003d450864d00db21c3201876;hb=631d040f80d99b7b993abd77c9d064fa8bccd711;hp=aea8c176c81054ab1f2080dab27b1669eb5560b3;hpb=d09bbf000469737045fd17ef5b12fdd25db0b989;p=platform%2Fupstream%2Fbinutils.git diff --git a/configure.ac b/configure.ac index aea8c17..4bb4865 100644 --- a/configure.ac +++ b/configure.ac @@ -156,10 +156,12 @@ target_libraries="target-libgcc \ target-libgloss \ target-newlib \ target-libgomp \ + target-libcilkrts \ target-libatomic \ target-libitm \ target-libstdc++-v3 \ - target-libmudflap \ + target-libsanitizer \ + target-libvtv \ target-libssp \ target-libquadmath \ target-libgfortran \ @@ -314,9 +316,9 @@ case "${ENABLE_GOLD}" in is_elf=no case "${target}" in *-*-elf* | *-*-sysv4* | *-*-unixware* | *-*-eabi* | hppa*64*-*-hpux* \ - | *-*-linux* | frv-*-uclinux* | *-*-irix5* | *-*-irix6* \ + | *-*-linux* | *-*-gnu* | frv-*-uclinux* | *-*-irix5* | *-*-irix6* \ | *-*-netbsd* | *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* \ - | *-*-solaris2* | *-*-nto*) + | *-*-solaris2* | *-*-nto* | *-*-nacl*) case "${target}" in *-*-linux*aout* | *-*-linux*oldld*) ;; @@ -329,7 +331,8 @@ case "${ENABLE_GOLD}" in if test "$is_elf" = "yes"; then # Check for target supported by gold. case "${target}" in - i?86-*-* | x86_64-*-* | sparc*-*-* | powerpc*-*-* | arm*-*-* | tilegx*-*-*) + i?86-*-* | x86_64-*-* | sparc*-*-* | powerpc*-*-* | arm*-*-* \ + | aarch64*-*-* | tilegx*-*-*) configdirs="$configdirs gold" if test x${ENABLE_GOLD} = xdefault; then default_ld=gold @@ -427,6 +430,15 @@ AC_ARG_ENABLE(libssp, ENABLE_LIBSSP=$enableval, ENABLE_LIBSSP=yes) +AC_ARG_ENABLE(libstdcxx, +AS_HELP_STRING([--disable-libstdcxx], + [do not build libstdc++-v3 directory]), +ENABLE_LIBSTDCXX=$enableval, +ENABLE_LIBSTDCXX=default) +[if test "${ENABLE_LIBSTDCXX}" = "no" ; then + noconfigdirs="$noconfigdirs libstdc++-v3" +fi] + # Save it here so that, even in case of --enable-libgcj, if the Java # front-end isn't enabled, we still get libgcj disabled. libgcj_saved=$libgcj @@ -462,22 +474,6 @@ if test x$enable_static_libjava != xyes ; then fi AC_SUBST(EXTRA_CONFIGARGS_LIBJAVA) -# Disable libmudflap on some systems. -if test x$enable_libmudflap = x ; then - case "${target}" in - *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu | bfin*-*-uclinux* | *-*-kopensolaris*-gnu) - # Enable libmudflap by default in GNU and friends. - ;; - *-*-freebsd*) - # Enable libmudflap by default in FreeBSD. - ;; - *) - # Disable it by default everywhere else. - noconfigdirs="$noconfigdirs target-libmudflap" - ;; - esac -fi - # Disable libgomp on non POSIX hosted systems. if test x$enable_libgomp = x ; then # Enable libgomp by default on hosted POSIX systems. @@ -512,6 +508,22 @@ if test -d ${srcdir}/libatomic; then fi fi +# Disable libcilkrts on unsupported systems. +if test -d ${srcdir}/libcilkrts; then + if test x$enable_libcilkrts = x; then + AC_MSG_CHECKING([for libcilkrts support]) + if (srcdir=${srcdir}/libcilkrts; \ + . ${srcdir}/configure.tgt; \ + test -n "$UNSUPPORTED") + then + AC_MSG_RESULT([no]) + noconfigdirs="$noconfigdirs target-libcilkrts" + else + AC_MSG_RESULT([yes]) + fi + fi +fi + # Disable libitm on unsupported systems. if test -d ${srcdir}/libitm; then if test x$enable_libitm = x; then @@ -528,8 +540,43 @@ if test -d ${srcdir}/libitm; then fi fi +# Disable libsanitizer on unsupported systems. +if test -d ${srcdir}/libsanitizer; then + if test x$enable_libsanitizer = x; then + AC_MSG_CHECKING([for libsanitizer support]) + if (srcdir=${srcdir}/libsanitizer; \ + . ${srcdir}/configure.tgt; \ + test -n "$UNSUPPORTED") + then + AC_MSG_RESULT([no]) + noconfigdirs="$noconfigdirs target-libsanitizer" + else + AC_MSG_RESULT([yes]) + fi + fi +fi + +# Disable libvtv on unsupported systems. +if test -d ${srcdir}/libvtv; then + if test x$enable_libvtv = x; then + AC_MSG_CHECKING([for libvtv support]) + if (srcdir=${srcdir}/libvtv; \ + . ${srcdir}/configure.tgt; \ + test "$VTV_SUPPORTED" != "yes") + then + AC_MSG_RESULT([no]) + noconfigdirs="$noconfigdirs target-libvtv" + else + AC_MSG_RESULT([yes]) + fi + fi +fi + # Disable libquadmath for some systems. case "${target}" in + avr-*-*) + noconfigdirs="$noconfigdirs target-libquadmath" + ;; # libquadmath is unused on AIX and libquadmath build process use of # LD_LIBRARY_PATH can break AIX bootstrap. powerpc-*-aix* | rs6000-*-aix*) @@ -555,19 +602,22 @@ case "${target}" in esac # Disable libstdc++-v3 for some systems. -case "${target}" in - *-*-vxworks*) - # VxWorks uses the Dinkumware C++ library. - noconfigdirs="$noconfigdirs target-libstdc++-v3" - ;; - arm*-wince-pe*) - # the C++ libraries don't build on top of CE's C libraries - noconfigdirs="$noconfigdirs target-libstdc++-v3" - ;; - avr-*-*) - noconfigdirs="$noconfigdirs target-libstdc++-v3" - ;; -esac +# Allow user to override this if they pass --enable-libstdc++-v3 +if test "${ENABLE_LIBSTDCXX}" = "default" ; then + case "${target}" in + *-*-vxworks*) + # VxWorks uses the Dinkumware C++ library. + noconfigdirs="$noconfigdirs target-libstdc++-v3" + ;; + arm*-wince-pe*) + # the C++ libraries don't build on top of CE's C libraries + noconfigdirs="$noconfigdirs target-libstdc++-v3" + ;; + avr-*-*) + noconfigdirs="$noconfigdirs target-libstdc++-v3" + ;; + esac +fi # Disable Fortran for some systems. case "${target}" in @@ -579,6 +629,8 @@ esac # Disable Java if libffi is not supported. case "${target}" in + aarch64-*-*) + ;; alpha*-*-*) ;; arm*-*-*) @@ -720,6 +772,23 @@ case "${target}" in ;; esac +# Disable libgo for some systems where it is known to not work. +# For testing, you can easily override this with --enable-libgo. +if test x$enable_libgo = x; then + case "${target}" in + *-*-darwin*) + # PR 46986 + noconfigdirs="$noconfigdirs target-libgo" + ;; + *-*-cygwin* | *-*-mingw*) + noconfigdirs="$noconfigdirs target-libgo" + ;; + *-*-aix*) + noconfigdirs="$noconfigdirs target-libgo" + ;; + esac +fi + # Default libgloss CPU subdirectory. libgloss_dir="$target_cpu" @@ -727,6 +796,9 @@ case "${target}" in sh*-*-pe|mips*-*-pe|*arm-wince-pe) libgloss_dir=wince ;; + aarch64*-*-* ) + libgloss_dir=aarch64 + ;; arm*-*-*) libgloss_dir=arm ;; @@ -860,6 +932,10 @@ case "${target}" in ;; *-*-rtems*) noconfigdirs="$noconfigdirs target-libgloss" + # this is not caught below because this stanza matches earlier + case $target in + or1k*-*-*) noconfigdirs="$noconfigdirs gdb" ;; + esac ;; # The tpf target doesn't support gdb yet. *-*-tpf*) @@ -885,7 +961,7 @@ case "${target}" in sh*-*-pe|mips*-*-pe|*arm-wince-pe) noconfigdirs="$noconfigdirs tcl tk itcl libgui sim" ;; - arc-*-*) + arc-*-*|arceb-*-*) noconfigdirs="$noconfigdirs target-libgloss" ;; arm-*-pe*) @@ -894,6 +970,13 @@ case "${target}" in arm-*-riscix*) noconfigdirs="$noconfigdirs ld target-libgloss" ;; + avr-*-rtems*) + ;; + avr-*-*) + if test x${with_avrlibc} != xno; then + noconfigdirs="$noconfigdirs target-newlib target-libgloss" + fi + ;; c4x-*-* | tic4x-*-*) noconfigdirs="$noconfigdirs target-libgloss" ;; @@ -1028,7 +1111,7 @@ case "${target}" in microblaze*) noconfigdirs="$noconfigdirs gprof" ;; - mips*-sde-elf* | mips*-mti-elf*) + mips*-sde-elf* | mips*-mti-elf* | mips*-img-elf*) if test x$with_newlib = xyes; then noconfigdirs="$noconfigdirs gprof" fi @@ -1040,13 +1123,23 @@ case "${target}" in noconfigdirs="$noconfigdirs gprof target-libgloss" ;; mips*-*-bsd*) - noconfigdirs="$noconfigdirs gprof target-libgloss" + noconfigdirs="$noconfigdirs ld gas gprof target-libgloss" ;; mips*-*-linux*) ;; + mips*-*-ultrix* | mips*-*-osf* | mips*-*-ecoff* | mips*-*-pe* \ + | mips*-*-irix* | mips*-*-lnews* | mips*-*-riscos*) + noconfigdirs="$noconfigdirs ld gas gprof" + ;; mips*-*-*) noconfigdirs="$noconfigdirs gprof" ;; + nds32*-*-*) + noconfigdirs="$noconfigdirs gdb" + ;; + or1k*-*-*) + noconfigdirs="$noconfigdirs gdb" + ;; sh-*-* | sh64-*-*) case "${target}" in sh*-*-elf) @@ -1063,7 +1156,7 @@ case "${target}" in tic6x-*-*) noconfigdirs="$noconfigdirs sim" ;; - tilepro-*-* | tilegx-*-*) + tilepro*-*-* | tilegx*-*-*) noconfigdirs="$noconfigdirs sim" ;; v810-*-*) @@ -1168,6 +1261,26 @@ if test -z "$LD"; then fi fi +# Check whether -static-libstdc++ -static-libgcc is supported. +have_static_libs=no +if test "$GCC" = yes; then + saved_LDFLAGS="$LDFLAGS" + + LDFLAGS="$LDFLAGS -static-libstdc++ -static-libgcc" + AC_MSG_CHECKING([whether g++ accepts -static-libstdc++ -static-libgcc]) + AC_LANG_PUSH(C++) + AC_LINK_IFELSE([ +#if (__GNUC__ < 4) || (__GNUC__ == 4 && __GNUC_MINOR__ < 5) +#error -static-libstdc++ not implemented +#endif +int main() {}], + [AC_MSG_RESULT([yes]); have_static_libs=yes], + [AC_MSG_RESULT([no])]) + AC_LANG_POP(C++) + + LDFLAGS="$saved_LDFLAGS" +fi + ACX_PROG_GNAT ACX_PROG_CMP_IGNORE_INITIAL @@ -1354,7 +1467,7 @@ if test -d ${srcdir}/gcc && test "x$have_gmp" = xno; then AC_TRY_COMPILE([#include "gmp.h"],[ #define GCC_GMP_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c)) #define GCC_GMP_VERSION GCC_GMP_VERSION_NUM(__GNU_MP_VERSION,__GNU_MP_VERSION_MINOR,__GNU_MP_VERSION_PATCHLEVEL) - #if GCC_GMP_VERSION < GCC_GMP_VERSION_NUM(4,2,0) + #if GCC_GMP_VERSION < GCC_GMP_VERSION_NUM(4,2,3) choke me #endif ], [AC_TRY_COMPILE([#include ],[ @@ -1464,17 +1577,6 @@ case $with_host_libstdcxx in ;; esac -# Linker flags to use for stage1 or when not boostrapping. -AC_ARG_WITH(stage1-ldflags, -[AS_HELP_STRING([--with-stage1-ldflags=FLAGS], [linker flags for stage1])], -[if test "$withval" = "no" -o "$withval" = "yes"; then - stage1_ldflags= - else - stage1_ldflags=$withval - fi], -[stage1_ldflags=]) -AC_SUBST(stage1_ldflags) - # Libraries to use for stage1 or when not bootstrapping. AC_ARG_WITH(stage1-libs, [AS_HELP_STRING([--with-stage1-libs=LIBS], [libraries for stage1])], @@ -1486,6 +1588,23 @@ AC_ARG_WITH(stage1-libs, [stage1_libs=$with_host_libstdcxx]) AC_SUBST(stage1_libs) +# Linker flags to use for stage1 or when not bootstrapping. +AC_ARG_WITH(stage1-ldflags, +[AS_HELP_STRING([--with-stage1-ldflags=FLAGS], [linker flags for stage1])], +[if test "$withval" = "no" -o "$withval" = "yes"; then + stage1_ldflags= + else + stage1_ldflags=$withval + fi], +[stage1_ldflags= + # In stage 1, default to linking libstdc++ and libgcc statically with GCC + # if supported. But if the user explicitly specified the libraries to use, + # trust that they are doing what they want. + if test "$stage1_libs" = "" -a "$have_static_libs" = yes; then + stage1_ldflags="-static-libstdc++ -static-libgcc" + fi]) +AC_SUBST(stage1_ldflags) + # Libraries to use for stage2 and later builds. This defaults to the # argument passed to --with-host-libstdcxx. AC_ARG_WITH(boot-libs, @@ -1516,44 +1635,77 @@ AC_ARG_WITH(boot-ldflags, fi]) AC_SUBST(poststage1_ldflags) -# Check for ISL -dnl Provide configure switches and initialize islinc & isllibs -dnl with user input. -ISL_INIT_FLAGS -if test "x$with_isl" != "xno"; then - dnl The minimal version of ISL required for Graphite. +# GCC GRAPHITE dependences, ISL and CLOOG which in turn requires ISL. +# Basic setup is inlined here, actual checks are in config/cloog.m4 and +# config/isl.m4 + +AC_ARG_WITH(cloog, + [AS_HELP_STRING( + [--with-cloog=PATH], + [Specify prefix directory for the installed CLooG-ISL package. + Equivalent to --with-cloog-include=PATH/include + plus --with-cloog-lib=PATH/lib])]) +AC_ARG_WITH(isl, + [AS_HELP_STRING( + [--with-isl=PATH], + [Specify prefix directory for the installed ISL package. + Equivalent to --with-isl-include=PATH/include + plus --with-isl-lib=PATH/lib])]) + +# Treat either --without-cloog or --without-isl as a request to disable +# GRAPHITE support and skip all following checks. +if test "x$with_isl" != "xno" && + test "x$with_cloog" != "xno"; then + # Check for ISL + dnl Provide configure switches and initialize islinc & isllibs + dnl with user input. + ISL_INIT_FLAGS + dnl The versions of ISL that work for Graphite ISL_CHECK_VERSION(0,10) - + if test "${gcc_cv_isl}" = no ; then + ISL_CHECK_VERSION(0,11) + if test "${gcc_cv_isl}" = no ; then + ISL_CHECK_VERSION(0,12) + fi + fi dnl Only execute fail-action, if ISL has been requested. ISL_IF_FAILED([ AC_MSG_ERROR([Unable to find a usable ISL. See config.log for details.])]) -fi -# Check for CLOOG -dnl Provide configure switches and initialize clooginc & clooglibs -dnl with user input. -CLOOG_INIT_FLAGS -if test "x$isllibs" = x && test "x$islinc" = x; then - clooglibs= - clooginc= -elif test "x$with_cloog" != "xno"; then - dnl The minimal version of CLooG required for Graphite. - dnl - dnl If we use CLooG-Legacy, the provided version information is - dnl ignored. - CLOOG_CHECK_VERSION(0,17,0) + if test "x$gcc_cv_isl" != "xno"; then + # Check for CLOOG + dnl Provide configure switches and initialize clooginc & clooglibs + dnl with user input. + CLOOG_INIT_FLAGS + dnl The versions of CLooG that work for Graphite. + CLOOG_CHECK_VERSION(0,17,0) + if test "${gcc_cv_cloog}" = no ; then + CLOOG_CHECK_VERSION(0,18,0) + fi - dnl Only execute fail-action, if CLooG has been requested. - CLOOG_IF_FAILED([ - AC_MSG_ERROR([Unable to find a usable CLooG. See config.log for details.])]) + dnl Only execute fail-action, if CLooG has been requested. + CLOOG_IF_FAILED([ + AC_MSG_ERROR([Unable to find a usable CLooG. See config.log for details.])]) + fi fi # If either the ISL or the CLooG check failed, disable builds of in-tree # variants of both -if test "x$clooglibs" = x && test "x$clooginc" = x; then +if test "x$with_isl" = xno || + test "x$with_cloog" = xno || + test "x$gcc_cv_cloog" = xno || + test "x$gcc_cv_isl" = xno; then noconfigdirs="$noconfigdirs cloog isl" + islinc= + clooginc= + clooglibs= fi +AC_SUBST(islinc) +AC_SUBST(clooglibs) +AC_SUBST(clooginc) + + # Check for LTO support. AC_ARG_ENABLE(lto, [AS_HELP_STRING([--enable-lto], [enable link time optimization support])], @@ -1734,6 +1886,7 @@ if test -d ${srcdir}/gcc; then boot_language=yes fi + add_this_lang=no case ,${enable_languages}, in *,${language},*) # Language was explicitly selected; include it @@ -1744,10 +1897,9 @@ if test -d ${srcdir}/gcc; then ;; *,all,*) # 'all' was selected, select it if it is a default language - add_this_lang=${build_by_default} - ;; - *) - add_this_lang=no + if test "$language" != "c"; then + add_this_lang=${build_by_default} + fi ;; esac @@ -1916,11 +2068,11 @@ case ,${enable_languages},:${enable_objc_gc} in ;; esac -# Disable libitm if we're not building C++ +# Disable libitm, libsanitizer, libvtv if we're not building C++ case ,${enable_languages}, in *,c++,*) ;; *) - noconfigdirs="$noconfigdirs target-libitm" + noconfigdirs="$noconfigdirs target-libcilkrts target-libitm target-libsanitizer target-libvtv" ;; esac @@ -2220,7 +2372,7 @@ case "${target}" in spu-*-*) target_makefile_frag="config/mt-spu" ;; - mips*-sde-elf* | mips*-mti-elf*) + mips*-sde-elf* | mips*-mti-elf* | mips*-img-elf*) target_makefile_frag="config/mt-sde" ;; mipsisa*-*-elfoabi*) @@ -2229,6 +2381,9 @@ case "${target}" in mips*-*-*linux* | mips*-*-gnu*) target_makefile_frag="config/mt-mips-gnu" ;; + nios2-*-elf*) + target_makefile_frag="config/mt-nios2-elf" + ;; *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu | *-*-kopensolaris*-gnu) target_makefile_frag="config/mt-gnu" ;; @@ -2331,16 +2486,90 @@ else GCC_SHLIB_SUBDIR= fi +# Adjust the toplevel makefile according to whether bootstrap was selected. +case $enable_bootstrap in + yes) + bootstrap_suffix=bootstrap + BUILD_CONFIG=bootstrap-debug + ;; + no) + bootstrap_suffix=no-bootstrap + BUILD_CONFIG= + ;; +esac + +AC_MSG_CHECKING(for default BUILD_CONFIG) + +AC_ARG_WITH([build-config], + [AS_HELP_STRING([--with-build-config='NAME NAME2...'], + [use config/NAME.mk build configuration])], + [case $with_build_config in + yes) with_build_config= ;; + no) with_build_config= BUILD_CONFIG= ;; + esac]) + +if test "x${with_build_config}" != x; then + BUILD_CONFIG=$with_build_config +else + case $BUILD_CONFIG in + bootstrap-debug) + if echo "int f (void) { return 0; }" > conftest.c && + ${CC} -c conftest.c && + mv conftest.o conftest.o.g0 && + ${CC} -c -g conftest.c && + mv conftest.o conftest.o.g && + ${srcdir}/contrib/compare-debug conftest.o.g0 conftest.o.g > /dev/null 2>&1; then + : + else + BUILD_CONFIG= + fi + rm -f conftest.c conftest.o conftest.o.g0 conftest.o.g + ;; + esac +fi +AC_MSG_RESULT($BUILD_CONFIG) +AC_SUBST(BUILD_CONFIG) + +# Use same top-level configure hooks in libgcc/libstdc++/libvtv. +AC_MSG_CHECKING([for --enable-vtable-verify]) +AC_ARG_ENABLE(vtable-verify, +[ --enable-vtable-verify Enable vtable verification feature ], +[case "$enableval" in + yes) enable_vtable_verify=yes ;; + no) enable_vtable_verify=no ;; + *) enable_vtable_verify=no;; + esac], +[enable_vtable_verify=no]) +AC_MSG_RESULT($enable_vtable_verify) + # Record target_configdirs and the configure arguments for target and # build configuration in Makefile. target_configdirs=`echo "${target_configdirs}" | sed -e 's/target-//g'` build_configdirs=`echo "${build_configdirs}" | sed -e 's/build-//g'` +bootstrap_fixincludes=no # If we are building libgomp, bootstrap it. if echo " ${target_configdirs} " | grep " libgomp " > /dev/null 2>&1 ; then bootstrap_target_libs=${bootstrap_target_libs}target-libgomp, fi +# If we are building libsanitizer and $BUILD_CONFIG contains bootstrap-asan +# or bootstrap-ubsan, bootstrap it. +if echo " ${target_configdirs} " | grep " libsanitizer " > /dev/null 2>&1; then + case "$BUILD_CONFIG" in + *bootstrap-asan* | *bootstrap-ubsan* ) + bootstrap_target_libs=${bootstrap_target_libs}target-libsanitizer, + bootstrap_fixincludes=yes + ;; + esac +fi + +# If we are building libvtv and --enable-vtable-verify, bootstrap it. +if echo " ${target_configdirs} " | grep " libvtv " > /dev/null 2>&1 && + test "$enable_vtable_verify" != no; then + bootstrap_target_libs=${bootstrap_target_libs}target-libvtv, +fi + # Determine whether gdb needs tk/tcl or not. # Use 'maybe' since enable_gdbtk might be true even if tk isn't available # and in that case we want gdb to be built without tk. Ugh! @@ -2390,50 +2619,6 @@ case "$enable_bootstrap:$ENABLE_GOLD: $configdirs :,$stage1_languages," in ;; esac -# Adjust the toplevel makefile according to whether bootstrap was selected. -case $enable_bootstrap in - yes) - bootstrap_suffix=bootstrap - BUILD_CONFIG=bootstrap-debug - ;; - no) - bootstrap_suffix=no-bootstrap - BUILD_CONFIG= - ;; -esac - -AC_MSG_CHECKING(for default BUILD_CONFIG) - -AC_ARG_WITH([build-config], - [AS_HELP_STRING([--with-build-config='NAME NAME2...'], - [use config/NAME.mk build configuration])], - [case $with_build_config in - yes) with_build_config= ;; - no) with_build_config= BUILD_CONFIG= ;; - esac]) - -if test "x${with_build_config}" != x; then - BUILD_CONFIG=$with_build_config -else - case $BUILD_CONFIG in - bootstrap-debug) - if echo "int f (void) { return 0; }" > conftest.c && - ${CC} -c conftest.c && - mv conftest.o conftest.o.g0 && - ${CC} -c -g conftest.c && - mv conftest.o conftest.o.g && - ${srcdir}/contrib/compare-debug conftest.o.g0 conftest.o.g > /dev/null 2>&1; then - : - else - BUILD_CONFIG= - fi - rm -f conftest.c conftest.o conftest.o.g0 conftest.o.g - ;; - esac -fi -AC_MSG_RESULT($BUILD_CONFIG) -AC_SUBST(BUILD_CONFIG) - extrasub_build= for module in ${build_configdirs} ; do if test -z "${no_recursion}" \ @@ -2457,11 +2642,15 @@ for module in ${configdirs} ; do fi done fi + case ${module},${bootstrap_fixincludes} in + fixincludes,no) host_bootstrap_suffix=no-bootstrap ;; + *) host_bootstrap_suffix=$bootstrap_suffix ;; + esac extrasub_host="$extrasub_host /^@if $module\$/d /^@endif $module\$/d -/^@if $module-$bootstrap_suffix\$/d -/^@endif $module-$bootstrap_suffix\$/d" +/^@if $module-$host_bootstrap_suffix\$/d +/^@endif $module-$host_bootstrap_suffix\$/d" done extrasub_target= for module in ${target_configdirs} ; do @@ -2728,6 +2917,26 @@ if test x${is_cross_compiler} = xyes ; then target_configargs="--with-cross-host=${host_noncanonical} ${target_configargs}" fi +# Special user-friendly check for native x86_64-linux build, if +# multilib is not explicitly enabled. +case "$target:$have_compiler:$host:$target:$enable_multilib" in + x86_64-*linux*:yes:$build:$build:) + # Make sure we have a developement environment that handles 32-bit + dev64=no + echo "int main () { return 0; }" > conftest.c + ${CC} -m32 -o conftest ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} conftest.c + if test $? = 0 ; then + if test -s conftest || test -s conftest.exe ; then + dev64=yes + fi + fi + rm -f conftest* + if test x${dev64} != xyes ; then + AC_MSG_ERROR([I suspect your system does not have 32-bit developement 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.]) + fi + ;; +esac + # Default to --enable-multilib. if test x${enable_multilib} = x ; then target_configargs="--enable-multilib ${target_configargs}" @@ -2760,7 +2969,7 @@ case " $target_configdirs " in *" --with-newlib "*) case "$target" in *-cygwin*) - 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' + FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -L$$r/$(TARGET_SUBDIR)/winsup/cygwin -isystem $$s/winsup/cygwin/include' ;; esac @@ -3037,10 +3246,10 @@ GCC_TARGET_TOOL(as, AS_FOR_TARGET, AS, [gas/as-new]) GCC_TARGET_TOOL(cc, CC_FOR_TARGET, CC, [gcc/xgcc -B$$r/$(HOST_SUBDIR)/gcc/]) dnl see comments for CXX_FOR_TARGET_FLAG_TO_PASS GCC_TARGET_TOOL(c++, CXX_FOR_TARGET, CXX, - [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], + [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], c++) GCC_TARGET_TOOL(c++ for libstdc++, RAW_CXX_FOR_TARGET, CXX, - [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], + [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], c++) GCC_TARGET_TOOL(dlltool, DLLTOOL_FOR_TARGET, DLLTOOL, [binutils/dlltool]) GCC_TARGET_TOOL(gcc, GCC_FOR_TARGET, , [gcc/xgcc -B$$r/$(HOST_SUBDIR)/gcc/]) @@ -3150,6 +3359,13 @@ case ${enable_werror} in esac AC_SUBST(stage2_werror_flag) +# Enable --enable-host-shared. +AC_ARG_ENABLE(host-shared, +[AS_HELP_STRING([--enable-host-shared], + [build host code as shared libraries])], +[host_shared=$enableval], [host_shared=no]) +AC_SUBST(host_shared) + # Specify what files to not compare during bootstrap. compare_exclusions="gcc/cc*-checksum\$(objext) | gcc/ada/*tools/*"