X-Git-Url: http://git.sourceforge.jp/view?a=blobdiff_plain;f=configure.ac;h=34308c212c542fe9b45c56253911270286f221e2;hb=39c947c304bb79517f0f4a9af83f920a2da911a4;hp=66a9e8db0f2cd279528a57abaef9e984d86cda49;hpb=d6dfe18ab887203c18c4617220f3a48da4a00159;p=pf3gnuchains%2Fgcc-fork.git diff --git a/configure.ac b/configure.ac index 66a9e8db0f2..34308c212c5 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,12 @@ 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]) +m4_include([ltversion.m4]) +m4_include([lt~obsolete.m4]) AC_INIT(move-if-change) AC_PREREQ(2.64) @@ -492,6 +498,7 @@ case "${target}" in case "${target}" in i*86-*-*) ;; alpha*-*-*) ;; + x86_64-*-*) ;; *) noconfigdirs="$noconfigdirs ${libgcj}" ;; @@ -521,6 +528,7 @@ case "${target}" in noconfigdirs="$noconfigdirs target-newlib target-libiberty target-libgloss ${libgcj} target-libmudflap" ;; *-*-rtems*) + skipdirs="${skipdirs} target-libiberty" noconfigdirs="$noconfigdirs target-libgloss ${libgcj}" ;; # The tpf target doesn't support gdb yet. @@ -540,7 +548,7 @@ case "${target}" in noconfigdirs="$noconfigdirs gas ld fileutils target-newlib target-libgloss" ;; alpha*-*-*vms*) - noconfigdirs="$noconfigdirs gdb ld target-newlib target-libgloss ${libgcj}" + noconfigdirs="$noconfigdirs gdb target-newlib target-libgloss ${libgcj}" ;; alpha*-*-linux*) # newlib is not 64 bit ready @@ -933,6 +941,9 @@ case "${target}" in ;; sparc-*-solaris* | sparc64-*-solaris* | sparcv9-*-solaris*) ;; + tic6x-*-*) + noconfigdirs="$noconfigdirs gdb sim ${libgcj}" + ;; v810-*-*) noconfigdirs="$noconfigdirs bfd binutils gas gcc gdb ld target-libstdc++-v3 opcodes target-libgloss ${libgcj}" ;; @@ -1227,13 +1238,13 @@ AC_ARG_ENABLE(build-with-cxx, ENABLE_BUILD_WITH_CXX=$enableval, ENABLE_BUILD_WITH_CXX=no) +# Used for setting $lt_cv_objdir +_LT_CHECK_OBJDIR + # Check for GMP, MPFR and MPC -gmplibs="-lmpfr -lgmp" +gmplibs="-lmpc -lmpfr -lgmp" gmpinc= have_gmp=no -mpclibs=-lmpc -mpcinc= -have_mpc=no # Specify a location for mpc # check for this first so it ends up on the link line before mpfr. @@ -1245,23 +1256,23 @@ AC_ARG_WITH(mpc_include, [ --with-mpc-include=PATH AC_ARG_WITH(mpc_lib, [ --with-mpc-lib=PATH specify directory for the installed MPC library]) if test "x$with_mpc" != x; then - mpclibs="-L$with_mpc/lib -lmpc" - mpcinc="-I$with_mpc/include $mpcinc" + gmplibs="-L$with_mpc/lib $gmplibs" + gmpinc="-I$with_mpc/include $gmpinc" fi if test "x$with_mpc_include" != x; then - mpcinc="-I$with_mpc_include $mpcinc" + gmpinc="-I$with_mpc_include $gmpinc" fi if test "x$with_mpc_lib" != x; then - mpclibs="-L$with_mpc_lib -lmpc" + gmplibs="-L$with_mpc_lib $gmplibs" fi if test "x$with_mpc$with_mpc_include$with_mpc_lib" = x && test -d ${srcdir}/mpc; then - mpclibs='-L$$r/$(HOST_SUBDIR)/mpc/src/.libs -L$$r/$(HOST_SUBDIR)/mpc/src/_libs -lmpc' - mpcinc='-I$$s/mpc/src '"$mpcinc" + gmplibs='-L$$r/$(HOST_SUBDIR)/mpc/src/'"$lt_cv_objdir $gmplibs" + gmpinc='-I$$s/mpc/src '"$gmpinc" # Do not test the mpc version. Assume that it is sufficient, since # it is in the source tree, and the library has not been built yet # but it would be included on the link line in the version check below # hence making the test fail. - have_mpc=yes + have_gmp=yes fi # Specify a location for mpfr @@ -1279,18 +1290,18 @@ AC_ARG_WITH(mpfr_lib, [ --with-mpfr-lib=PATH specify directory for the insta if test "x$with_mpfr" != x; then gmplibs="-L$with_mpfr/lib $gmplibs" - gmpinc="-I$with_mpfr/include" + gmpinc="-I$with_mpfr/include $gmpinc" fi if test "x$with_mpfr_include" != x; then - gmpinc="-I$with_mpfr_include" + gmpinc="-I$with_mpfr_include $gmpinc" fi if test "x$with_mpfr_lib" != x; then gmplibs="-L$with_mpfr_lib $gmplibs" fi if test "x$with_mpfr$with_mpfr_include$with_mpfr_lib" = x && test -d ${srcdir}/mpfr; then - gmplibs='-L$$r/$(HOST_SUBDIR)/mpfr/.libs -L$$r/$(HOST_SUBDIR)/mpfr/_libs '"$gmplibs" + gmplibs='-L$$r/$(HOST_SUBDIR)/mpfr/'"$lt_cv_objdir $gmplibs" gmpinc='-I$$r/$(HOST_SUBDIR)/mpfr -I$$s/mpfr '"$gmpinc" - extra_mpc_mpfr_configure_flags='--with-mpfr-include=$$s/mpfr' + extra_mpc_mpfr_configure_flags='--with-mpfr-include=$$s/mpfr --with-mpfr-lib=$$r/$(HOST_SUBDIR)/mpfr/'"$lt_cv_objdir" # Do not test the mpfr version. Assume that it is sufficient, since # it is in the source tree, and the library has not been built yet # but it would be included on the link line in the version check below @@ -1321,10 +1332,10 @@ if test "x$with_gmp_lib" != x; then gmplibs="-L$with_gmp_lib $gmplibs" fi if test "x$with_gmp$with_gmp_include$with_gmp_lib" = x && test -d ${srcdir}/gmp; then - gmplibs='-L$$r/$(HOST_SUBDIR)/gmp/.libs -L$$r/$(HOST_SUBDIR)/gmp/_libs '"$gmplibs" + gmplibs='-L$$r/$(HOST_SUBDIR)/gmp/'"$lt_cv_objdir $gmplibs" gmpinc='-I$$r/$(HOST_SUBDIR)/gmp -I$$s/gmp '"$gmpinc" extra_mpfr_configure_flags='--with-gmp-build=$$r/$(HOST_SUBDIR)/gmp' - extra_mpc_gmp_configure_flags='--with-gmp-include=$$r/$(HOST_SUBDIR)/gmp' + extra_mpc_gmp_configure_flags='--with-gmp-include=$$r/$(HOST_SUBDIR)/gmp --with-gmp-lib=$$r/$(HOST_SUBDIR)/gmp/'"$lt_cv_objdir" # Do not test the gmp version. Assume that it is sufficient, since # it is in the source tree, and the library has not been built yet # but it would be included on the link line in the version check below @@ -1336,112 +1347,101 @@ 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) choke me #endif - ], AC_TRY_COMPILE([#include + ], [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])]), + ], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([buggy but acceptable])])], [AC_MSG_RESULT([no]); have_gmp=no]) fi # Check for the MPC header version. - if test x"$have_mpc" != xyes ; then - CFLAGS="$CFLAGS $mpcinc" + 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,7,0) + #if MPC_VERSION < MPC_VERSION_NUM(0,8,0) + choke me + #endif + ], [AC_TRY_COMPILE([#include ],[ + #if MPC_VERSION < MPC_VERSION_NUM(0,8,1) choke me #endif - ], [AC_MSG_RESULT([yes]); have_mpc=maybe], - [AC_MSG_RESULT([no]); have_mpc=no; mpclibs= ; mpcinc= ]) + ], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([buggy but acceptable])])], + [AC_MSG_RESULT([no]); have_gmp=no]) fi # Now check the MPFR library. if test x"$have_gmp" = xyes; then saved_LIBS="$LIBS" LIBS="$LIBS $gmplibs" - AC_MSG_CHECKING([for the correct version of the gmp/mpfr libraries]) - AC_TRY_LINK([#include - #include ],[ + AC_MSG_CHECKING([for the correct version of the gmp/mpfr/mpc libraries]) + AC_TRY_LINK([#include ],[ mpfr_t n; mpfr_t x; + mpc_t c; int t; mpfr_init (n); mpfr_init (x); mpfr_atan2 (n, n, x, GMP_RNDN); mpfr_erfc (n, x, GMP_RNDN); mpfr_subnormalize (x, t, GMP_RNDN); + mpfr_clear(n); + mpfr_clear(x); + mpc_init2 (c, 53); + mpc_set_ui_ui (c, 1, 1, MPC_RNDNN); + mpc_cosh (c, c, MPC_RNDNN); + mpc_pow (c, c, c, MPC_RNDNN); + mpc_acosh (c, c, MPC_RNDNN); + mpc_clear (c); ], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]); have_gmp=no]) LIBS="$saved_LIBS" fi - if test x"$have_mpc" = xmaybe; then - saved_LIBS="$LIBS" - LIBS="$LIBS $mpclibs $gmplibs" - AC_MSG_CHECKING([for the correct version of the mpc library]) - AC_TRY_LINK([#include ],[ - mpc_t n; - mpc_init2 (n, 53); - mpc_set_ui_ui (n, 1, 1, MPC_RNDNN); - mpc_sin (n, n, MPC_RNDNN); - mpc_cos (n, n, MPC_RNDNN); - mpc_tan (n, n, MPC_RNDNN); - mpc_sinh (n, n, MPC_RNDNN); - mpc_cosh (n, n, MPC_RNDNN); - mpc_tanh (n, n, MPC_RNDNN); - mpc_exp (n, n, MPC_RNDNN); - mpc_log (n, n, MPC_RNDNN); - mpc_sqrt (n, n, MPC_RNDNN); - mpc_proj (n, n, MPC_RNDNN); - mpc_neg (n, n, MPC_RNDNN); - mpc_sqr (n, n, MPC_RNDNN); - mpc_pow (n, n, n, MPC_RNDNN); - mpc_clear (n); - ], [AC_MSG_RESULT([yes]); have_mpc=yes], - [AC_MSG_RESULT([no]); have_mpc=no; mpclibs= ; mpcinc= ]) - LIBS="$saved_LIBS" - fi - 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+ and MPFR 2.3.2+. -Try the --with-gmp and/or --with-mpfr options to specify their locations. -Copies of these libraries' source code can be found at their respective -hosting sites as well as at ftp://gcc.gnu.org/pub/gcc/infrastructure/. -See also http://gcc.gnu.org/install/prerequisites.html for additional info. -If you obtained GMP and/or MPFR from a vendor distribution package, make -sure that you have installed both the libraries and the header files. -They may be located in separate packages.]) + 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 +ftp://gcc.gnu.org/pub/gcc/infrastructure/. See also +http://gcc.gnu.org/install/prerequisites.html for additional info. If +you obtained GMP, MPFR and/or MPC from a vendor distribution package, +make sure that you have installed both the libraries and the header +files. They may be located in separate packages.]) fi fi -if test x$have_mpc != xyes ; then - mpcinc= - mpclibs= -fi - -gmpinc="$mpcinc $gmpinc" -gmplibs="$mpclibs $gmplibs" - # Flags needed for both GMP, MPFR and/or MPC. AC_SUBST(gmplibs) AC_SUBST(gmpinc) @@ -1540,7 +1540,7 @@ if test "x$with_ppl_lib" != x; then ppllibs="-L$with_ppl_lib -lppl_c -lppl -lgmpxx" fi if test "x$with_ppl$with_ppl_include$with_ppl_lib" = x && test -d ${srcdir}/ppl; then - 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 ' + ppllibs='-L$$r/$(HOST_SUBDIR)/ppl/interfaces/C/'"$lt_cv_objdir"' -L$$r/$(HOST_SUBDIR)/ppl/src/'"$lt_cv_objdir"' -lppl_c -lppl -lgmpxx ' pplinc='-I$$r/$(HOST_SUBDIR)/ppl/src -I$$r/$(HOST_SUBDIR)/ppl/interfaces/C ' enable_ppl_version_check=no fi @@ -1600,7 +1600,7 @@ if test "x$with_cloog_lib" != x; then clooglibs="-L$with_cloog_lib -lcloog" fi if test "x$with_cloog$with_cloog_include$with_cloog_lib" = x && test -d ${srcdir}/cloog; then - clooglibs='-L$$r/$(HOST_SUBDIR)/cloog/.libs -L$$r/$(HOST_SUBDIR)/cloog/_libs -lcloog ' + clooglibs='-L$$r/$(HOST_SUBDIR)/cloog/'"$lt_cv_objdir"' -lcloog ' clooginc='-I$$r/$(HOST_SUBDIR)/cloog/include -I$$s/cloog/include -DCLOOG_PPL_BACKEND ' enable_cloog_version_check=no fi @@ -1613,12 +1613,17 @@ 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= ]) + ], [AC_TRY_COMPILE([#include "cloog/cloog.h"],[ + #if CLOOG_VERSION_MAJOR != 0 || CLOOG_VERSION_MINOR != 15 || CLOOG_VERSION_REVISION < 9 + choke me + #endif + ], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([buggy but acceptable])])], + [AC_MSG_RESULT([no]); clooglibs= ; clooginc= ]) CFLAGS="$saved_CFLAGS" fi @@ -1632,6 +1637,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 @@ -1721,7 +1736,6 @@ if test x"$enable_lto" = x"yes" ; then elf_nextscn (0, 0); elf_strptr (0, 0, 0); elf_getident (0, 0); - elf_getshdrstrndx (0, 0); elf_begin (0, 0, 0); elf_ndxscn (0); elf_end (0); @@ -1730,6 +1744,27 @@ if test x"$enable_lto" = x"yes" ; then [AC_MSG_RESULT([no]); enable_lto=no; libelflibs= ; libelfinc= ] ) + # Check for elf_getshdrstrndx or elf_getshstrndx. The latter's flavor + # is determined in gcc/configure.ac. + if test x"$enable_lto" = x"yes" ; then + AC_MSG_CHECKING([for elf_getshdrstrndx]) + AC_TRY_LINK( + [#include ],[ + elf_getshdrstrndx (0, 0); + ], + [AC_MSG_RESULT([yes]);], + [AC_MSG_RESULT([no]); + AC_MSG_CHECKING([for elf_getshstrndx]) + AC_TRY_LINK( + [#include ],[ + elf_getshstrndx (0, 0); + ], + [AC_MSG_RESULT([yes]);], + [AC_MSG_RESULT([no]); enable_lto=no; libelflibs= ; libelfinc= ] + )] + ) + fi + # If we couldn't enable LTO and the user forced it, emit an error. if test x"$enable_lto" = x"no" \ && test x"$default_enable_lto" != x"yes" ; then @@ -2399,8 +2434,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) @@ -2551,6 +2586,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! @@ -3097,6 +3137,7 @@ AC_SUBST(build_configdirs) # Host module lists & subconfigure args. AC_SUBST(host_configargs) AC_SUBST(configdirs) +AC_SUBST(target_configdirs) # Target module lists & subconfigure args. AC_SUBST(target_configargs) @@ -3193,8 +3234,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) @@ -3230,7 +3271,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)