OSDN Git Service

gcc:
[pf3gnuchains/gcc-fork.git] / libgcc / configure.ac
index 6bb4844..d96bcb4 100644 (file)
@@ -4,8 +4,10 @@ sinclude(../config/enable.m4)
 sinclude(../config/tls.m4)
 sinclude(../config/acx.m4)
 sinclude(../config/no-executables.m4)
+sinclude(../config/lib-ld.m4)
 sinclude(../config/override.m4)
 sinclude(../config/dfp.m4)
+sinclude(../config/unwind_ipinfo.m4)
 
 AC_PREREQ(2.64)
 AC_INIT([GNU C Runtime Library], 1.0,,[libgcc])
@@ -104,8 +106,39 @@ esac
 
 AC_CANONICAL_HOST
 ACX_NONCANONICAL_HOST
+ACX_NONCANONICAL_TARGET
 GCC_TOPLEV_SUBDIRS
 
+# Calculate toolexeclibdir
+# Also toolexecdir, though it's only used in toolexeclibdir
+case ${version_specific_libs} in
+  yes)
+    # Need the gcc compiler version to know where to install libraries
+    # and header files if --enable-version-specific-runtime-libs option
+    # is selected.
+    toolexecdir='$(libdir)/gcc/$(target_noncanonical)'
+    toolexeclibdir='$(toolexecdir)/$(gcc_version)$(MULTISUBDIR)'
+    ;;
+  no)
+    if test -n "$with_cross_host" &&
+       test x"$with_cross_host" != x"no"; then
+      # Install a library built with a cross compiler in tooldir, not libdir.
+      toolexecdir='$(exec_prefix)/$(target_noncanonical)'
+      toolexeclibdir='$(toolexecdir)/lib'
+    else
+      toolexecdir='$(libdir)/gcc-lib/$(target_noncanonical)'
+      toolexeclibdir='$(libdir)'
+    fi
+    multi_os_directory=`$CC -print-multi-os-directory`
+    case $multi_os_directory in
+      .) ;; # Avoid trailing /.
+      *) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;;
+    esac
+    ;;
+esac
+AC_SUBST(toolexecdir)
+AC_SUBST(toolexeclibdir)
+
 dnl These must be called before AM_PROG_LIBTOOL, because it may want
 dnl to call AC_CHECK_PROG.
 AC_CHECK_TOOL(AR, ar)
@@ -135,11 +168,27 @@ AC_CACHE_CHECK([whether fixed-point is supported], [libgcc_cv_fixed_point],
 fixed_point=$libgcc_cv_fixed_point
 AC_SUBST(fixed_point)
 
+# For platforms with the unwind ABI which includes an unwind library,
+# libunwind, we can choose to use the system libunwind.
+# config.gcc also contains tests of with_system_libunwind.
+GCC_CHECK_UNWIND_GETIPINFO
+
+AC_LIB_PROG_LD_GNU
+
+AC_MSG_CHECKING([for thread model used by GCC])
+target_thread_file=`$CC -v 2>&1 | sed -n 's/^Thread model: //p'`
+AC_MSG_RESULT([$target_thread_file]) 
+
 # Check for assembler CFI support.
 AC_CACHE_CHECK([whether assembler supports CFI directives], [libgcc_cv_cfi],
-              [AC_COMPILE_IFELSE([int i = __GCC_HAVE_DWARF2_CFI_ASM;],
-                                 [libgcc_cv_cfi=yes],
-                                 [libgcc_cv_cfi=no])])
+              [AC_COMPILE_IFELSE(
+[asm("\n\
+       .text\n\
+       .cfi_startproc\n\
+       .cfi_personality 0, symbol\n\
+       .cfi_endproc");],
+  [libgcc_cv_cfi=yes],
+  [libgcc_cv_cfi=no])])
 
 # Check 32bit or 64bit for x86.
 case ${host} in
@@ -164,7 +213,7 @@ esac
 # Link with -nostartfiles -nodefaultlibs since neither are present while
 # building libgcc.
 case ${host} in
-i?86-*-solaris2.1[[0-9]]*)
+i?86-*-solaris2* | x86_64-*-solaris2.1[[0-9]]*)
   cat > conftest.s <<EOF
        .section        .eh_frame,"a",@unwind
        .zero   4
@@ -172,9 +221,7 @@ i?86-*-solaris2.1[[0-9]]*)
        .zero   8
 EOF
   if AC_TRY_COMMAND(${CC-cc} -shared -nostartfiles -nodefaultlibs -o conftest.so conftest.s 1>&AS_MESSAGE_LOG_FD); then
-      # configure expects config files in libgcc/config, so need a relative
-      # path here.
-      tmake_file="${tmake_file} ../../gcc/config/i386/t-crtstuff"
+      tmake_file="${tmake_file} i386/t-crtstuff"
   fi
   ;;
 esac
@@ -232,8 +279,12 @@ tmake_file="${tmake_file_}"
 AC_SUBST(tmake_file)
 
 # Substitute configuration variables
+AC_SUBST(cpu_type)
 AC_SUBST(extra_parts)
 AC_SUBST(asm_hidden_op)
+AC_CONFIG_LINKS([enable-execute-stack.c:$enable_execute_stack])
+AC_CONFIG_LINKS([unwind.h:$unwind_header])
+AC_CONFIG_LINKS([md-unwind-support.h:config/$md_unwind_header])
 
 # We need multilib support.
 AC_CONFIG_FILES([Makefile])