2008-12-15 Paul Pluzhnikov <ppluzhnikov@google.com>
[deliverable/binutils-gdb.git] / gold / configure.ac
index 793784eac25e933663ea253065ec6480355ef925..e19161cd839ba72780c3190aa71213b45d296061 100644 (file)
@@ -53,6 +53,20 @@ if test "$threads" = "yes"; then
 fi
 AM_CONDITIONAL(THREADS, test "$threads" = "yes")
 
+AC_ARG_ENABLE([plugins],
+[  --enable-plugins        linker plugins],
+[case "${enableval}" in
+  yes | "") plugins=yes ;;
+  no) plugins=no ;;
+  *) plugins=yes ;;
+ esac],
+[plugins=no])
+if test "$plugins" = "yes"; then
+  AC_DEFINE(ENABLE_PLUGINS, 1,
+           [Define to enable linker plugins])
+fi
+AM_CONDITIONAL(PLUGINS, test "$plugins" = "yes")
+
 AC_ARG_ENABLE([targets],
 [  --enable-targets        alternative target configurations],
 [case "${enableval}" in
@@ -107,6 +121,9 @@ for targ in $target $canon_targets; do
       AC_MSG_ERROR("unsupported target $targ")
     else
       targetobjs="$targetobjs ${targ_obj}.\$(OBJEXT)"
+      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
@@ -196,6 +213,7 @@ AM_CONDITIONAL(FN_PTRS_IN_SO_WITHOUT_PIC, [
   case $target_cpu in
     i?86) true;;
     x86_64) false;;
+    sparc64) false;;
     *) true;;
   esac])
 
@@ -220,6 +238,22 @@ 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"
@@ -228,18 +262,18 @@ 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],
+dnl only with glibc 2.9 or later.
+AC_CACHE_CHECK([for glibc >= 2.9], [gold_cv_lib_glibc29],
 [AC_COMPILE_IFELSE([
 #include <features.h>
 #if !defined __GLIBC__
 error
-#elif __GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 5)
+#elif __GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 9)
 error
 #endif
-], [gold_cv_lib_glibc25=yes], [gold_cv_lib_glibc25=no])])
+], [gold_cv_lib_glibc29=yes], [gold_cv_lib_glibc29=no])])
 
-AM_CONDITIONAL(TLS_DESCRIPTORS, test "$gold_cv_lib_glibc25" = "yes")
+AM_CONDITIONAL(TLS_DESCRIPTORS, test "$gold_cv_lib_glibc29" = "yes")
 
 dnl Check whether the compiler supports constructor priorities in
 dnl attributes, which were added in gcc 4.3.
@@ -249,6 +283,20 @@ AC_CACHE_CHECK([for constructor priorities], [gold_cv_c_conprio],
 
 AM_CONDITIONAL(CONSTRUCTOR_PRIORITY, test "$gold_cv_c_conprio" = "yes")
 
+dnl Test for the -frandom-seed option.
+AC_CACHE_CHECK([for -frandom-seed support], [gold_cv_c_random_seed],
+[save_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS -frandom-seed=foo"
+AC_COMPILE_IFELSE([int i;], [gold_cv_c_random_seed=yes],
+[gold_cv_c_random_seed=no])
+CFLAGS="$save_CFLAGS"])
+if test "$gold_cv_c_random_seed" = "yes"; then
+  # In Makefile, '$@' will be expanded to be the name of the file
+  # being built, providing a unique seed for each file.
+  RANDOM_SEED_CFLAGS=-frandom-seed=\$@
+fi
+AC_SUBST(RANDOM_SEED_CFLAGS)
+
 AM_BINUTILS_WARNINGS
 
 WARN_CXXFLAGS=`echo ${WARN_CFLAGS} | sed -e 's/-Wstrict-prototypes//' -e 's/-Wmissing-prototypes//'`
This page took 0.024465 seconds and 4 git commands to generate.