X-Git-Url: http://git.sourceforge.jp/view?p=pf3gnuchains%2Fgcc-fork.git;a=blobdiff_plain;f=gcc%2Fconfigure.ac;h=f357e1ee5a83443c5e419f4b4c6984e2cc5e35ad;hp=5d0221e78237b1adbd6ce43fd9d31fc4f4d8612e;hb=dd9d9ac28b56faa0c480877b29e1a74fb856214f;hpb=1301d11086d21b258bcc32c416967a18216cca71 diff --git a/gcc/configure.ac b/gcc/configure.ac index 5d0221e7823..f357e1ee5a8 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -24,7 +24,7 @@ # Initialization and sanity checks # -------------------------------- -AC_PREREQ(2.59) +AC_PREREQ(2.64) AC_INIT AC_CONFIG_SRCDIR(tree.c) AC_CONFIG_HEADER(auto-host.h:config.in) @@ -276,6 +276,7 @@ rm -f a.out a.exe b.out # Find the native compiler AC_PROG_CC AM_PROG_CC_C_O +AC_PROG_CXX ACX_PROG_GNAT([-I"$srcdir"/ada]) # autoconf is lame and doesn't give us any substitution variable for this. @@ -310,6 +311,7 @@ AC_CHECK_SIZEOF(int) AC_CHECK_SIZEOF(long) AC_CHECK_TYPES([long long], [AC_CHECK_SIZEOF(long long)]) AC_CHECK_TYPES([__int64], [AC_CHECK_SIZEOF(__int64)]) +GCC_STDINT_TYPES # --------------------- # Warnings and checking @@ -323,24 +325,30 @@ AC_CHECK_TYPES([__int64], [AC_CHECK_SIZEOF(__int64)]) # So, we only use -pedantic if we can disable those warnings. ACX_PROG_CC_WARNING_OPTS( - m4_quote(m4_do([-W -Wall -Wwrite-strings -Wstrict-prototypes ], - [-Wmissing-prototypes -Wcast-qual])), [loose_warn]) + m4_quote(m4_do([-W -Wall -Wwrite-strings -Wcast-qual])), [loose_warn]) ACX_PROG_CC_WARNING_OPTS( - m4_quote(m4_do([-Wold-style-definition -Wc++-compat ], - [-Wmissing-format-attribute])), [strict_warn]) + m4_quote(m4_do([-Wstrict-prototypes -Wmissing-prototypes])), + [c_loose_warn]) +ACX_PROG_CC_WARNING_OPTS( + m4_quote(m4_do([-Wmissing-format-attribute])), [strict_warn]) +ACX_PROG_CC_WARNING_OPTS( + m4_quote(m4_do([-Wold-style-definition -Wc++-compat])), [c_strict_warn]) ACX_PROG_CC_WARNING_ALMOST_PEDANTIC( m4_quote(m4_do([-Wno-long-long -Wno-variadic-macros ], [-Wno-overlength-strings])), [strict_warn]) ACX_PROG_CC_WARNINGS_ARE_ERRORS([manual], [strict_warn]) # The above macros do nothing if the compiler is not GCC. However, the -# Makefile has more goo to add other flags, so this variabl is used to -# enables warnings only for GCC. +# Makefile has more goo to add other flags, so these variables are used +# to enable warnings only for GCC. warn_cflags= +warn_cxxflags= if test "x$GCC" = "xyes"; then warn_cflags='$(GCC_WARN_CFLAGS)' + warn_cxxflags='$(GCC_WARN_CXXFLAGS)' fi AC_SUBST(warn_cflags) +AC_SUBST(warn_cxxflags) # Enable expensive internal checks is_release= @@ -573,6 +581,13 @@ fi # Miscenalleous configure options # ------------------------------- +# See if we are building gcc with C++. +AC_ARG_ENABLE(build-with-cxx, +[ --enable-build-with-cxx build with C++ compiler instead of C compiler], +ENABLE_BUILD_WITH_CXX=$enableval, +ENABLE_BUILD_WITH_CXX=no) +AC_SUBST(ENABLE_BUILD_WITH_CXX) + # With stabs AC_ARG_WITH(stabs, [ --with-stabs arrange to use stabs instead of host debug format], @@ -805,10 +820,10 @@ AC_ARG_ENABLE(languages, esac], [enable_languages=c]) -# Used by documentation targets -AC_SUBST(datarootdir) -AC_SUBST(docdir) -AC_SUBST(htmldir) +AC_ARG_WITH(multilib-list, +[ --with-multilib-list Select multilibs (SH only)], +:, +with_multilib_list=default) # ------------------------- # Checks for other programs @@ -1490,6 +1505,32 @@ static const struct { EOF changequote([,])dnl +changequote(,)dnl +gcc_BASEVER=`cat $srcdir/BASE-VER` +gcc_DEVPHASE=`cat $srcdir/DEV-PHASE` +gcc_DATESTAMP=`cat $srcdir/DATESTAMP` +if test -f $srcdir/REVISION ; then + gcc_REVISION=`cat $srcdir/REVISION` +else + gcc_REVISION="" +fi +cat > plugin-version.h < conftest.s + echo 'x: ld $2,%got_disp(y)($3)' >> conftest.s + echo ' ld $25,%call16(y)($28)' >> conftest.s + echo ' .reloc 1f,R_MIPS_JALR,y' >> conftest.s + echo '1: jalr $25' >> conftest.s + echo ' .reloc 1f,R_MIPS_JALR,x' >> conftest.s + echo '1: jalr $25' >> conftest.s + echo ' .end x' >> conftest.s + if $gcc_cv_as -o conftest.o conftest.s >/dev/null 2>&AS_MESSAGE_LOG_FD \ + && $gcc_cv_ld -shared -o conftest.so conftest.o >/dev/null 2>&AS_MESSAGE_LOG_FD; then + if $gcc_cv_objdump -d conftest.so | grep -q jalr \ + && $gcc_cv_objdump -d conftest.so | grep -q "bal.*"; then + gcc_cv_as_ld_jalr_reloc=yes + fi + fi + rm -f conftest.* + fi + fi + if test $gcc_cv_as_ld_jalr_reloc = yes; then + if test x$target_cpu_default = x; then + target_cpu_default=MASK_RELAX_PIC_CALLS + else + target_cpu_default="($target_cpu_default)|MASK_RELAX_PIC_CALLS" + fi + fi + AC_MSG_RESULT($gcc_cv_as_ld_jalr_reloc) + + AC_CACHE_CHECK([linker for .eh_frame personality relaxation], + [gcc_cv_ld_mips_personality_relaxation], + [gcc_cv_ld_mips_personality_relaxation=no + if test $in_tree_ld = yes ; then + if test "$gcc_cv_gld_major_version" -eq 2 \ + -a "$gcc_cv_gld_minor_version" -ge 21 \ + -o "$gcc_cv_gld_major_version" -gt 2; then + gcc_cv_ld_mips_personality_relaxation=yes + fi + elif test x$gcc_cv_as != x \ + -a x$gcc_cv_ld != x \ + -a x$gcc_cv_readelf != x ; then + cat > conftest.s < /dev/null 2>&1 \ + && $gcc_cv_ld -o conftest conftest.o -shared > /dev/null 2>&1; then + if $gcc_cv_readelf -d conftest 2>&1 \ + | grep TEXTREL > /dev/null 2>&1; then + : + elif $gcc_cv_readelf --relocs conftest 2>&1 \ + | grep 'R_MIPS_REL32 *$' > /dev/null 2>&1; then + : + else + gcc_cv_ld_mips_personality_relaxation=yes + fi + fi + fi + rm -f conftest.s conftest.o conftest]) + if test x$gcc_cv_ld_mips_personality_relaxation = xyes; then + AC_DEFINE(HAVE_LD_PERSONALITY_RELAXATION, 1, + [Define if your linker can relax absolute .eh_frame personality +pointers into PC-relative form.]) + fi ;; esac @@ -3266,6 +3524,32 @@ gcc_GAS_CHECK_FEATURE([.lcomm with alignment], gcc_cv_as_lcomm_with_alignment, [AC_DEFINE(HAVE_GAS_LCOMM_WITH_ALIGNMENT, 1, [Define if your assembler supports .lcomm with an alignment field.])]) +AC_ARG_ENABLE(gnu-unique-object, + [ --enable-gnu-unique-object enable the use of the @gnu_unique_object ELF extension on + glibc systems], + [case $enable_gnu_unique_object in + yes | no) ;; + *) AC_MSG_ERROR(['$enable_gnu_unique_object' is an invalid value for --enable-gnu-unique-object. +Valid choices are 'yes' and 'no'.]) ;; + esac], + [gcc_GAS_CHECK_FEATURE([gnu_unique_object], gcc_cv_as_gnu_unique_object, + [elf,2,19,52],, + [.type foo, @gnu_unique_object],, +# Also check for ld.so support, i.e. glibc 2.11 or higher. + [if test x$host = x$build -a x$host = x$target && + glibcver=`ldd --version 2>/dev/null`; then + glibcmajor=`expr "$glibcver" : "ldd (GNU libc) \([[0-9]]*\)"` + glibcminor=`expr "$glibcver" : "ldd (GNU libc) [[0-9]]*\.\([[0-9]]*\)"` + glibcnum=`expr $glibcmajor \* 1000 + $glibcminor` + if test "$glibcnum" -ge 2011 ; then + enable_gnu_unique_object=yes + fi + fi])]) +if test x$enable_gnu_unique_object = xyes; then + AC_DEFINE(HAVE_GAS_GNU_UNIQUE_OBJECT, 1, + [Define if your assembler supports @gnu_unique_object.]) +fi + AC_CACHE_CHECK([assembler for tolerance to line number 0], [gcc_cv_as_line_zero], [gcc_cv_as_line_zero=no @@ -3473,6 +3757,41 @@ EOF ;; esac +AC_CACHE_CHECK(linker --build-id support, + gcc_cv_ld_buildid, + [gcc_cv_ld_buildid=no + if test $in_tree_ld = yes ; then + if test "$gcc_cv_gld_major_version" -eq 2 -a \ + "$gcc_cv_gld_minor_version" -ge 18 -o \ + "$gcc_cv_gld_major_version" -gt 2 \ + && test $in_tree_ld_is_elf = yes; then + gcc_cv_ld_buildid=yes + fi + elif test x$gcc_cv_ld != x; then + if $gcc_cv_ld --help 2>/dev/null | grep build-id > /dev/null; then + gcc_cv_ld_buildid=yes + fi + fi]) +if test x"$gcc_cv_ld_buildid" = xyes; then + AC_DEFINE(HAVE_LD_BUILDID, 1, + [Define if your linker supports --build-id.]) +fi + +AC_ARG_ENABLE(linker-build-id, +[ --enable-linker-build-id + compiler will always pass --build-id to linker], +[], +enable_linker_build_id=no) + +if test x"$enable_linker_build_id" = xyes; then + if test x"$gcc_cv_ld_buildid" = xyes; then + AC_DEFINE(ENABLE_LD_BUILDID, 1, + [Define if gcc should always pass --build-id to linker.]) + else + AC_MSG_WARN(--build-id is not supported by your linker; --enable-linker-build-id ignored) + fi +fi + AC_CACHE_CHECK(linker --sysroot support, gcc_cv_ld_sysroot, [gcc_cv_ld_sysroot=no @@ -3544,7 +3863,7 @@ AC_CACHE_CHECK(__stack_chk_fail in target C library, # simply assert that glibc does provide this, which is true for all # realistically usable GNU/Hurd configurations. gcc_cv_libc_provides_ssp=yes;; - *-*-darwin*) + *-*-darwin* | *-*-freebsd*) AC_CHECK_FUNC(__stack_chk_fail,[gcc_cv_libc_provides_ssp=yes], [echo "no __stack_chk_fail on this target"]) ;; @@ -3615,6 +3934,13 @@ esac], AC_SUBST(GGC) echo "Using $GGC for garbage collection." +# Libraries to use on the host. This will normally be set by the top +# level Makefile. Here we simply capture the value for our Makefile. +if test -z "${HOST_LIBS+set}"; then + HOST_LIBS= +fi +AC_SUBST(HOST_LIBS) + # Use the system's zlib library. zlibdir=-L../zlib zlibinc="-I\$(srcdir)/../zlib" @@ -3766,6 +4092,14 @@ changequote([,])dnl all_compilers="$all_compilers $compilers" all_outputs="$all_outputs $outputs" all_gtfiles="$all_gtfiles [[$subdir]] $gtfiles" + case ",$enable_languages," in + *,lto,*) + AC_DEFINE(ENABLE_LTO, 1, [Define to enable LTO support.]) + enable_lto=yes + AC_SUBST(enable_lto) + ;; + *) ;; + esac done # Pick up gtfiles for c @@ -3787,7 +4121,7 @@ touch Make-hooks target_list="all.cross start.encap rest.encap tags \ install-common install-man install-info install-pdf dvi pdf \ html uninstall info man srcextra srcman srcinfo \ - mostlyclean clean distclean maintainer-clean" + mostlyclean clean distclean maintainer-clean install-plugin" for t in $target_list do @@ -3842,24 +4176,6 @@ else fi) AC_SUBST(slibdir) -AC_ARG_WITH(datarootdir, -[ --with-datarootdir=DIR Use DIR as the data root [[PREFIX/share]]], -datarootdir="\${prefix}/$with_datarootdir", -datarootdir='$(prefix)/share') -AC_SUBST(datarootdir) - -AC_ARG_WITH(docdir, -[ --with-docdir=DIR Install documentation in DIR [[DATAROOTDIR]]], -docdir="\${prefix}/$with_docdir", -docdir='$(datarootdir)') -AC_SUBST(docdir) - -AC_ARG_WITH(htmldir, -[ --with-htmldir=DIR html documentation in in DIR [[DOCDIR]]], -htmldir="\${prefix}/$with_htmldir", -htmldir='$(docdir)') -AC_SUBST(htmldir) - # Substitute configuration variables AC_SUBST(subdirs) AC_SUBST(srcdir) @@ -3879,6 +4195,9 @@ AC_SUBST(check_languages) AC_SUBST(cpp_install_dir) AC_SUBST(xmake_file) AC_SUBST(tmake_file) +AC_SUBST(TM_ENDIAN_CONFIG) +AC_SUBST(TM_MULTILIB_CONFIG) +AC_SUBST(TM_MULTILIB_EXCEPTIONS_CONFIG) AC_SUBST(extra_gcc_objs) AC_SUBST(extra_headers_list) AC_SUBST(extra_objs) @@ -3940,6 +4259,10 @@ fi AC_ARG_VAR(GMPLIBS,[How to link GMP]) AC_ARG_VAR(GMPINC,[How to find GMP include files]) +case "${GMPLIBS}" in + *-lmpc*) AC_DEFINE(HAVE_mpc, 1, [Define if mpc is in use.]) ;; +esac + AC_ARG_VAR(PPLLIBS,[How to link PPL]) AC_ARG_VAR(PPLINC,[How to find PPL include files]) @@ -3949,6 +4272,74 @@ if test "x${CLOOGLIBS}" != "x" ; then AC_DEFINE(HAVE_cloog, 1, [Define if cloog is in use.]) fi +AC_ARG_VAR(LIBELFLIBS,[How to link libelf]) +AC_ARG_VAR(LIBELFINC,[How to find libelf include files]) +if test "x${LIBELFLIBS}" != "x" ; then + AC_DEFINE(HAVE_libelf, 1, [Define if libelf is in use.]) +fi + +# Check for plugin support +AC_ARG_ENABLE(plugin, +[ --enable-plugin enable plugin support], +enable_plugin=$enableval, +enable_plugin=yes; default_plugin=yes) + +pluginlibs= +if test x"$enable_plugin" = x"yes"; then + # Check that the host supports -rdynamic and -ldl + have_rdynamic=no + have_dl=no + saved_LDFLAGS="$LDFLAGS" + saved_LIBS="$LIBS" + LIBS= + + # Check -rdynamic + LDFLAGS="$LDFLAGS -rdynamic" + AC_MSG_CHECKING([for -rdynamic]) + AC_TRY_LINK([],[return 0;], + [AC_MSG_RESULT([yes]); have_rdynamic=yes], + [AC_MSG_RESULT([no])]) + if test x"$have_rdynamic" = x"yes" ; then + pluginlibs="-rdynamic" + fi + + # Check -ldl + AC_SEARCH_LIBS([dlopen], [dl]) + if test x"$ac_cv_search_dlopen" = x"-ldl"; then + pluginlibs="$pluginlibs -ldl" + fi + + # Check that we can build shared objects with -fPIC -shared + LDFLAGS="$LDFLAGS -fPIC -shared" + AC_MSG_CHECKING([for -fPIC -shared]) + AC_TRY_LINK( + [extern int X;],[return X == 0;], + [AC_MSG_RESULT([yes]); have_pic_shared=yes], + [AC_MSG_RESULT([no]); have_pic_shared=no]) + if test x"$have_pic_shared" != x"yes" -o x"$ac_cv_search_dlopen" = x"no"; then + pluginlibs= + enable_plugin=no + fi + + # If plugin support had been requested but not available, fail. + if test x"$enable_plugin" = x"no" ; then + if test x"$default_plugin" != x"yes"; then + AC_MSG_ERROR([ +Building GCC with plugin support requires a host that supports +-fPIC, -shared, -ldl and -rdynamic.]) + fi + fi + + LDFLAGS="$saved_LDFLAGS" + LIBS="$saved_LIBS" +fi + +AC_SUBST(pluginlibs) +AC_SUBST(enable_plugin) +if test x"$enable_plugin" = x"yes"; then + AC_DEFINE(ENABLE_PLUGIN, 1, [Define to enable plugin support.]) +fi + # Configure the subdirectories # AC_CONFIG_SUBDIRS($subdirs)