Robustify mi-simplerun.
[deliverable/binutils-gdb.git] / gold / configure.ac
index aa7fea07c0c65683ea6ab47c060e23f0f07cf713..96733e43158dc66b7b3973a7429b752f25c44a11 100644 (file)
@@ -107,24 +107,28 @@ for targ in $target $canon_targets; do
       AC_MSG_ERROR("unsupported target $targ")
     else
       targetobjs="$targetobjs ${targ_obj}.\$(OBJEXT)"
-      if test "$targ_size" = "32"; then
-        if test "$targ_big_endian" = "false"; then
-         targ_32_little=yes
-        elif test "$targ_big_endian" = "true"; then
-         targ_32_big=yes
-       else
-         AC_MSG_ERROR("bad configure.tgt endian $targ_big_endian")
-       fi
-      elif test "$targ_size" = "64"; then
-        if test "$targ_big_endian" = "false"; then
-         targ_64_little=yes
-        elif test "$targ_big_endian" = "true"; then
-         targ_64_big=yes
-       else
-         AC_MSG_ERROR("bad configure.tgt endian $targ_big_endian")
-       fi
-      else
-       AC_MSG_ERROR("bad configure.tgt size $targ_size")
+      if test "$targ_extra_obj" != ""; then
+        targetobjs="$targetobjs ${targ_extra_obj}.\$(OBJEXT)"
+      fi
+      if test "$targ_size" = "32" -o "$targ_extra_size" = "32"; then
+         if test "$targ_big_endian" = "true" \
+             -o "$targ_extra_big_endian" = "true"; then
+             targ_32_big=yes
+         fi
+         if test "$targ_big_endian" = "false" \
+             -o "$targ_extra_big_endian" = "false"; then
+             targ_32_little=yes
+         fi
+      fi
+      if test "$targ_size" = "64" -o "$targ_extra_size" = "64"; then
+         if test "$targ_big_endian" = "true" \
+             -o "$targ_extra_big_endian" = "true"; then
+             targ_64_big=yes
+         fi
+         if test "$targ_big_endian" = "false" \
+             -o "$targ_extra_big_endian" = "false"; then
+             targ_64_little=yes
+         fi
       fi
 
       if test "$target" = "$targ"; then
@@ -195,6 +199,7 @@ AM_CONDITIONAL(FN_PTRS_IN_SO_WITHOUT_PIC, [
   case $target_cpu in
     i?86) true;;
     x86_64) false;;
+    sparc64) false;;
     *) true;;
   esac])
 
@@ -219,6 +224,43 @@ error
 
 AM_CONDITIONAL(STATIC_TLS, test "$gold_cv_lib_glibc24" = "yes")
 
+dnl Test for #pragma omp threadprivate
+AC_CACHE_CHECK([for omp support], [gold_cv_c_threadprivate],
+[save_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS -fopenmp"
+AC_COMPILE_IFELSE([
+#include <omp.h>
+int i;
+#pragma omp threadprivate (i)
+], [gold_cv_c_threadprivate=yes], [gold_cv_c_threadprivate=no])
+CFLAGS="$save_CFLAGS"])
+if test "$gold_cv_c_threadprivate" = "yes"; then
+  AC_DEFINE(HAVE_OMP_SUPPORT, 1,
+           [Define if compiler supports #pragma omp threadprivate])
+fi
+AM_CONDITIONAL(OMP_SUPPORT, test "$gold_cv_c_threadprivate" = "yes")
+
+dnl Test for the -ftls-dialect=gnu2 option.
+save_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS -mtls-dialect=gnu2"
+AC_COMPILE_IFELSE([int i;], [have_tls_gnu2=yes], [have_tls_gnu2=no])
+CFLAGS="$save_CFLAGS"
+AM_CONDITIONAL(TLS_GNU2_DIALECT, test "$have_tls_gnu2" = "yes")
+
+dnl On GNU/Linux TLS descriptors are supported by the dynamic loader
+dnl only with glibc 2.5 or later.
+AC_CACHE_CHECK([for glibc >= 2.5], [gold_cv_lib_glibc25],
+[AC_COMPILE_IFELSE([
+#include <features.h>
+#if !defined __GLIBC__
+error
+#elif __GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 5)
+error
+#endif
+], [gold_cv_lib_glibc25=yes], [gold_cv_lib_glibc25=no])])
+
+AM_CONDITIONAL(TLS_DESCRIPTORS, test "$gold_cv_lib_glibc25" = "yes")
+
 dnl Check whether the compiler supports constructor priorities in
 dnl attributes, which were added in gcc 4.3.
 AC_CACHE_CHECK([for constructor priorities], [gold_cv_c_conprio],
This page took 0.023859 seconds and 4 git commands to generate.