OSDN Git Service

gcc/ChangeLog:
[pf3gnuchains/gcc-fork.git] / gcc / configure.ac
index d1eed72..f357e1e 100644 (file)
@@ -1915,6 +1915,17 @@ else
         AC_PATH_PROG(gcc_cv_ld, $LD_FOR_TARGET)
 fi])
 
+ORIGINAL_PLUGIN_LD_FOR_TARGET=$gcc_cv_ld
+PLUGIN_LD=`basename $gcc_cv_ld`
+AC_ARG_WITH(plugin-ld,
+[  --with-plugin-ld=[[ARG]]  specify the plugin linker],
+[if test x"$withval" != x; then
+   ORIGINAL_PLUGIN_LD_FOR_TARGET="$withval"
+   PLUGIN_LD="$withval"
+ fi])
+AC_SUBST(ORIGINAL_PLUGIN_LD_FOR_TARGET)
+AC_DEFINE_UNQUOTED(PLUGIN_LD, "$PLUGIN_LD", [Specify plugin linker])
+
 ORIGINAL_LD_FOR_TARGET=$gcc_cv_ld
 AC_SUBST(ORIGINAL_LD_FOR_TARGET)
 case "$ORIGINAL_LD_FOR_TARGET" in
@@ -2301,6 +2312,17 @@ AC_DEFINE_UNQUOTED(HAVE_GAS_CFI_PERSONALITY_DIRECTIVE,
     then echo 1; else echo 0; fi`],
   [Define 0/1 if your assembler supports .cfi_personality.])
 
+gcc_GAS_CHECK_FEATURE([cfi sections directive],
+  gcc_cv_as_cfi_sections_directive, ,,
+[      .text
+       .cfi_sections .debug_frame, .eh_frame
+       .cfi_startproc
+       .cfi_endproc])
+AC_DEFINE_UNQUOTED(HAVE_GAS_CFI_SECTIONS_DIRECTIVE,
+  [`if test $gcc_cv_as_cfi_sections_directive = yes;
+    then echo 1; else echo 0; fi`],
+  [Define 0/1 if your assembler supports .cfi_sections.])
+
 # GAS versions up to and including 2.11.0 may mis-optimize
 # .eh_frame data.
 gcc_GAS_CHECK_FEATURE(eh_frame optimization, gcc_cv_as_eh_frame,
@@ -2978,6 +3000,25 @@ changequote(,)dnl
   i[34567]86-*-* | x86_64-*-*)
 changequote([,])dnl
     case $target_os in
+      cygwin*)
+       # Full C++ conformance when using a shared libstdc++-v3 requires some
+       # support from the Cygwin DLL, which in more recent versions exports
+       # wrappers to aid in interposing and redirecting operators new, delete,
+       # etc., as per n2800 #17.6.4.6 [replacement.functions].  Check if we
+       # are configuring for a version of Cygwin that exports the wrappers.
+       if test x$host = x$target; then
+         AC_CHECK_FUNC([__wrap__Znaj],[gcc_ac_cygwin_dll_wrappers=yes],[gcc_ac_cygwin_dll_wrappers=no])
+       else
+         # Can't check presence of libc functions during cross-compile, so
+         # we just have to assume we're building for an up-to-date target.
+         gcc_ac_cygwin_dll_wrappers=yes
+       fi
+       AC_DEFINE_UNQUOTED(USE_CYGWIN_LIBSTDCXX_WRAPPERS,
+         [`if test $gcc_ac_cygwin_dll_wrappers = yes; then echo 1; else echo 0; fi`],
+         [Define if you want to generate code by default that assumes that the
+          Cygwin DLL exports wrappers to support libstdc++ function replacement.])
+    esac
+    case $target_os in
       cygwin* | pe | mingw32*)
        # Recent binutils allows the three-operand form of ".comm" on PE.  This
        # definition is used unconditionally to initialise the default state of
@@ -3036,6 +3077,12 @@ foo:     nop
       [AC_DEFINE(HAVE_AS_IX86_SAHF, 1,
         [Define if your assembler supports the sahf mnemonic.])])
 
+    gcc_GAS_CHECK_FEATURE([swap suffix],
+      gcc_cv_as_ix86_swap,,,
+      [movl.s %esp, %ebp],,
+      [AC_DEFINE(HAVE_AS_IX86_SWAP, 1,
+        [Define if your assembler supports the swap suffix.])])
+
     gcc_GAS_CHECK_FEATURE([different section symbol subtraction],
       gcc_cv_as_ix86_diff_sect_delta,,,
       [.section .rodata
@@ -3238,6 +3285,21 @@ LCF0:
       [AC_DEFINE(HAVE_AS_LWSYNC, 1,
          [Define if your assembler supports LWSYNC instructions.])])
 
+    case $target in
+      *-*-aix*) conftest_s='   .machine "476"
+       .csect .text[[PR]]
+       dci 0';;
+      *) conftest_s='  .machine "476"
+       .text
+       dci 0';;
+    esac
+
+    gcc_GAS_CHECK_FEATURE([data cache invalidate support],
+      gcc_cv_as_powerpc_dci, [9,99,0], -a32,
+      [$conftest_s],,
+      [AC_DEFINE(HAVE_AS_DCI, 1,
+         [Define if your assembler supports the DCI/ICI instructions.])])
+
     gcc_GAS_CHECK_FEATURE([.gnu_attribute support],
       gcc_cv_as_powerpc_gnu_attribute, [2,18,0],,
       [.gnu_attribute 4,1],,
@@ -3315,6 +3377,51 @@ x:
       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 <<EOF
+       .cfi_startproc
+       .cfi_personality 0x80,indirect_ptr
+       .ent test
+test:
+       nop
+       .end test
+       .cfi_endproc
+
+       .section .data,"aw",@progbits
+indirect_ptr:
+       .dc.a personality
+EOF
+        if $gcc_cv_as -KPIC -o conftest.o 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
 
@@ -3985,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
@@ -4157,6 +4272,12 @@ 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],
@@ -4183,14 +4304,8 @@ if test x"$enable_plugin" = x"yes"; then
   fi
 
   # Check -ldl
-  LDFLAGS="$LDFLAGS -ldl"
-  AC_MSG_CHECKING([for -ldl])
-  AC_TRY_LINK(
-    [#include <dlfcn.h>],
-    [volatile int f = 0; if (f) dlopen ("dummy", 0);],
-    [AC_MSG_RESULT([yes]); have_dl=yes],
-    [AC_MSG_RESULT([no])])
-  if test x"$have_dl" = x"yes"; then
+  AC_SEARCH_LIBS([dlopen], [dl])
+  if test x"$ac_cv_search_dlopen" = x"-ldl"; then
     pluginlibs="$pluginlibs -ldl"
   fi
 
@@ -4201,7 +4316,7 @@ if test x"$enable_plugin" = x"yes"; then
     [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"; then
+  if test x"$have_pic_shared" != x"yes" -o x"$ac_cv_search_dlopen" = x"no"; then
     pluginlibs=
     enable_plugin=no
   fi