X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=configure.ac;h=a5d75ee71d91407dd03f2101e8167eab594fc549;hb=92f4e989f6eda10ef771c68f99c23d59cce40dc8;hp=1bb8f8a5f7df91e7eddae5b521caf53ae31e8de6;hpb=d35e937f74be8b03c594eb2b070db34c4e0541d6;p=deliverable%2Fbinutils-gdb.git diff --git a/configure.ac b/configure.ac index 1bb8f8a5f7..a5d75ee71d 100644 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,6 @@ # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, -# 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 +# Free Software Foundation, Inc. # # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -22,6 +22,7 @@ m4_include(config/acx.m4) m4_include(config/override.m4) m4_include(config/proginstall.m4) +m4_include(config/elf.m4) m4_include([libtool.m4]) m4_include([ltoptions.m4]) m4_include([ltsugar.m4]) @@ -497,6 +498,7 @@ case "${target}" in case "${target}" in i*86-*-*) ;; alpha*-*-*) ;; + x86_64-*-*) ;; *) noconfigdirs="$noconfigdirs ${libgcj}" ;; @@ -1341,18 +1343,27 @@ if test -d ${srcdir}/gcc && test "x$have_gmp" = xno; then have_gmp=yes saved_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $gmpinc" - # Check GMP actually works - AC_MSG_CHECKING([for correct version of gmp.h]) + # Check for the recommended and required versions of GMP. + AC_MSG_CHECKING([for the correct version of gmp.h]) AC_TRY_COMPILE([#include "gmp.h"],[ - #if __GNU_MP_VERSION < 4 || (__GNU_MP_VERSION == 4 && __GNU_MP_VERSION_MINOR < 2) + #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) choke me #endif - ], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]); have_gmp=no]) + ], AC_TRY_COMPILE([#include ],[ + #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,3,2) + choke me + #endif + ], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([buggy but acceptable])]), + [AC_MSG_RESULT([no]); have_gmp=no]) # If we have GMP, check the MPFR version. if test x"$have_gmp" = xyes; then - dnl MPFR 2.3.1 is acceptable, but MPFR 2.3.2 is better. - AC_MSG_CHECKING([for correct version of mpfr.h]) + # Check for the recommended and required versions of MPFR. + AC_MSG_CHECKING([for the correct version of mpfr.h]) AC_TRY_COMPILE([#include #include ],[ #if MPFR_VERSION < MPFR_VERSION_NUM(2,3,1) @@ -1360,7 +1371,7 @@ if test -d ${srcdir}/gcc && test "x$have_gmp" = xno; then #endif ], AC_TRY_COMPILE([#include #include ],[ - #if MPFR_VERSION < MPFR_VERSION_NUM(2,3,2) + #if MPFR_VERSION < MPFR_VERSION_NUM(2,4,2) choke me #endif ], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([buggy but acceptable])]), @@ -1369,12 +1380,18 @@ if test -d ${srcdir}/gcc && test "x$have_gmp" = xno; then # Check for the MPC header version. if test x"$have_gmp" = xyes ; then + # Check for the recommended and required versions of MPC. AC_MSG_CHECKING([for the correct version of mpc.h]) AC_TRY_COMPILE([#include ],[ - #if MPC_VERSION < MPC_VERSION_NUM (0,8,0) + #if MPC_VERSION < MPC_VERSION_NUM(0,8,0) choke me #endif - ], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]); have_gmp=no]) + ], AC_TRY_COMPILE([#include ],[ + #if MPC_VERSION < MPC_VERSION_NUM(0,8,1) + choke me + #endif + ], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([buggy but acceptable])]), + [AC_MSG_RESULT([no]); have_gmp=no]) fi # Now check the MPFR library. @@ -1406,8 +1423,10 @@ if test -d ${srcdir}/gcc && test "x$have_gmp" = xno; then CFLAGS="$saved_CFLAGS" +# The library versions listed in the error message below should match +# the HARD-minimums enforced above. if test x$have_gmp != xyes; then - AC_MSG_ERROR([Building GCC requires GMP 4.2+, MPFR 2.3.2+ and MPC 0.8.0+. + AC_MSG_ERROR([Building GCC requires GMP 4.2+, MPFR 2.3.1+ and MPC 0.8.0+. Try the --with-gmp, --with-mpfr and/or --with-mpc options to specify their locations. Source code for these libraries can be found at their respective hosting sites as well as at @@ -1458,21 +1477,6 @@ AC_ARG_WITH(stage1-libs, [stage1_libs=$with_host_libstdcxx]) AC_SUBST(stage1_libs) -# Linker flags to use for stage2 and later builds. -AC_ARG_WITH(boot-ldflags, -[ --with-boot-ldflags=FLAGS Linker flags for stage2 and later], -[if test "$withval" = "no" -o "$withval" = "yes"; then - poststage1_ldflags= - else - poststage1_ldflags=$withval - fi], -[if test "$ENABLE_BUILD_WITH_CXX" = "yes"; then - poststage1_ldflags=-static-libstdc++ - else - poststage1_ldflags= - fi]) -AC_SUBST(poststage1_ldflags) - # Libraries to use for stage2 and later builds. This defaults to the # argument passed to --with-host-libstdcxx. AC_ARG_WITH(boot-libs, @@ -1485,6 +1489,23 @@ AC_ARG_WITH(boot-libs, [poststage1_libs=$with_host_libstdcxx]) AC_SUBST(poststage1_libs) +# Linker flags to use for stage2 and later builds. +AC_ARG_WITH(boot-ldflags, +[ --with-boot-ldflags=FLAGS Linker flags for stage2 and later], +[if test "$withval" = "no" -o "$withval" = "yes"; then + poststage1_ldflags= + else + poststage1_ldflags=$withval + fi], +[poststage1_ldflags= + # With --enable-build-with-cxx, default to linking libstdc++ and + # libgcc statically. But if the user explicitly specified the + # libraries to use, trust that they are doing what they want. + if test "$ENABLE_BUILD_WITH_CXX" = "yes" -a "$poststage1_libs" = ""; then + poststage1_ldflags="-static-libstdc++ -static-libgcc" + fi]) +AC_SUBST(poststage1_ldflags) + # Check for PPL ppl_major_version=0 ppl_minor_version=10 @@ -1588,9 +1609,9 @@ ENABLE_CLOOG_CHECK=yes) if test "x$with_cloog" != "xno" -a "${ENABLE_CLOOG_CHECK}" = "yes"; then saved_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $clooginc $gmpinc $pplinc" - AC_MSG_CHECKING([for correct version of CLooG]) + AC_MSG_CHECKING([for version 0.15.5 (or later revision) of CLooG]) AC_TRY_COMPILE([#include "cloog/cloog.h"],[ - #if CLOOG_VERSION_MAJOR != 0 || CLOOG_VERSION_MINOR != 15 + #if CLOOG_VERSION_MAJOR != 0 || CLOOG_VERSION_MINOR != 15 || CLOOG_VERSION_REVISION < 5 choke me #endif ], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]); clooglibs= ; clooginc= ]) @@ -1607,6 +1628,16 @@ AC_ARG_ENABLE(lto, enable_lto=$enableval, enable_lto=yes; default_enable_lto=yes) +ACX_ELF_TARGET_IFELSE([], +if test x"$default_enable_lto" = x"yes" ; then + enable_lto=no +else + if test x"$enable_lto" = x"yes"; then + AC_MSG_ERROR([LTO support requires an ELF target.]) + fi +fi +default_enable_lto=no) + if test x"$enable_lto" = x"yes" ; then # Make sure that libelf.h and gelf.h are available. AC_ARG_WITH(libelf, [ --with-libelf=PATH Specify prefix directory for the installed libelf package @@ -1730,7 +1761,7 @@ fi stage1_languages=,c, # Target libraries that we bootstrap. -bootstrap_target_libs=,target-libgcc,target-libgomp, +bootstrap_target_libs=,target-libgcc, # Figure out what language subdirectories are present. # Look if the user specified --enable-languages="..."; if not, use @@ -2374,8 +2405,8 @@ case "${target}" in extra_arflags_for_target=" -X32_64" extra_nmflags_for_target=" -B -X32_64" ;; - *-*-darwin*) - # ranlib from Darwin requires the -c flag to look at common symbols. + *-*-darwin[[3-9]]*) + # ranlib before Darwin10 requires the -c flag to look at common symbols. extra_ranlibflags_for_target=" -c" ;; mips*-*-pe | sh*-*-pe | *arm-wince-pe) @@ -2526,6 +2557,11 @@ fi target_configdirs=`echo "${target_configdirs}" | sed -e 's/target-//g'` build_configdirs=`echo "${build_configdirs}" | sed -e 's/build-//g'` +# 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 + # 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! @@ -3169,8 +3205,8 @@ NCN_STRICT_CHECK_TOOLS(DLLTOOL, dlltool) NCN_STRICT_CHECK_TOOLS(LD, ld) NCN_STRICT_CHECK_TOOLS(LIPO, lipo) NCN_STRICT_CHECK_TOOLS(NM, nm) -NCN_STRICT_CHECK_TOOLS(RANLIB, ranlib, :) -NCN_STRICT_CHECK_TOOLS(STRIP, strip, :) +NCN_STRICT_CHECK_TOOLS(RANLIB, ranlib, true) +NCN_STRICT_CHECK_TOOLS(STRIP, strip, true) NCN_STRICT_CHECK_TOOLS(WINDRES, windres) NCN_STRICT_CHECK_TOOLS(WINDMC, windmc) NCN_STRICT_CHECK_TOOLS(OBJCOPY, objcopy) @@ -3206,7 +3242,7 @@ ACX_CHECK_INSTALLED_TARGET_TOOL(LD_FOR_TARGET, ld) ACX_CHECK_INSTALLED_TARGET_TOOL(LIPO_FOR_TARGET, lipo) ACX_CHECK_INSTALLED_TARGET_TOOL(NM_FOR_TARGET, nm) ACX_CHECK_INSTALLED_TARGET_TOOL(OBJDUMP_FOR_TARGET, objdump) -ACX_CHECK_INSTALLED_TARGET_TOOL(RANLIB_FOR_TARGET, ranlib, :) +ACX_CHECK_INSTALLED_TARGET_TOOL(RANLIB_FOR_TARGET, ranlib) ACX_CHECK_INSTALLED_TARGET_TOOL(STRIP_FOR_TARGET, strip) ACX_CHECK_INSTALLED_TARGET_TOOL(WINDRES_FOR_TARGET, windres) ACX_CHECK_INSTALLED_TARGET_TOOL(WINDMC_FOR_TARGET, windmc)