From Craig Silverstein: Minimal --script implementation.
[deliverable/binutils-gdb.git] / gold / configure.ac
index 0e0bc7ef0d79af22029b9e36a60d6d6dc99accc0..e230b5f55bcfec3711f8ae2115ac595cc719ea6a 100644 (file)
@@ -38,6 +38,21 @@ AC_DEFINE_UNQUOTED(TARGET_SYSTEM_ROOT, "$sysroot",
 AC_DEFINE_UNQUOTED(TARGET_SYSTEM_ROOT_RELOCATABLE, $sysroot_relocatable,
   [Whether the system root can be relocated])
 
+dnl For now threads are a configure time option.
+AC_ARG_ENABLE([threads],
+[  --enable-threads        multi-threaded linking],
+[case "${enableval}" in
+  yes | "") threads=yes ;;
+  no) threads=no ;;
+  *) threads=yes ;;
+ esac],
+[threads=no])
+if test "$threads" = "yes"; then
+  AC_DEFINE(ENABLE_THREADS, 1,
+           [Define to do multi-threaded linking])
+fi
+AM_CONDITIONAL(THREADS, test "$threads" = "yes")
+
 AC_ARG_ENABLE([targets],
 [  --enable-targets        alternative target configurations],
 [case "${enableval}" in
@@ -129,6 +144,9 @@ AC_PROG_YACC
 AC_PROG_RANLIB
 AC_PROG_INSTALL
 AC_PROG_LN_S
+
+AC_GNU_SOURCE
+
 ZW_GNU_GETTEXT_SISTER_DIR
 AM_PO_SUBDIRS
 
@@ -152,8 +170,25 @@ AM_CONDITIONAL(FN_PTRS_IN_SO_WITHOUT_PIC, [
   esac])
 
 dnl Test for __thread support.
-AC_COMPILE_IFELSE([__thread int i = 1;], [tls=yes], [tls=no])
-AM_CONDITIONAL(TLS, test "$tls" = "yes")
+AC_CACHE_CHECK([for thread support], [gold_cv_c_thread],
+[AC_COMPILE_IFELSE([__thread int i = 1;],
+[gold_cv_c_thread=yes], [gold_cv_c_thread=no])])
+
+AM_CONDITIONAL(TLS, test "$gold_cv_c_thread" = "yes")
+
+dnl On GNU/Linux TLS in static programs only works when using glibc
+dnl 2.4 or later.
+AC_CACHE_CHECK([for glibc >= 2.4], [gold_cv_lib_glibc24],
+[AC_COMPILE_IFELSE([
+#include <features.h>
+#if !defined __GLIBC__
+error
+#elif __GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 4)
+error
+#endif
+], [gold_cv_lib_glibc24=yes], [gold_cv_lib_glibc24=no])])
+
+AM_CONDITIONAL(STATIC_TLS, test "$gold_cv_lib_glibc24" = "yes")
 
 AM_BINUTILS_WARNINGS
 
@@ -171,14 +206,20 @@ AC_LANG_PUSH(C++)
 
 AC_CHECK_HEADERS(tr1/unordered_set tr1/unordered_map)
 AC_CHECK_HEADERS(ext/hash_map ext/hash_set)
+AC_CHECK_FUNCS(mallinfo)
 
 dnl Test whether the compiler can specify a member templates to call.
-AC_COMPILE_IFELSE([
+AC_CACHE_CHECK([template member calls], [gold_cv_c_membertemplates],
+[AC_COMPILE_IFELSE([
 class c { public: template<int i> void fn(); };
 template<int i> void foo(c cv) { cv.fn<i>(); }
 template void foo<1>(c cv);],
-[AC_DEFINE(HAVE_MEMBER_TEMPLATE_SPECIFICATIONS, [],
-  [Whether the C++ compiler can call a template member with no arguments])])
+[gold_cv_c_membertemplates=yes], [gold_cv_c_membertemplates=no])])
+
+if test "$gold_cv_c_membertemplates" = "yes"; then
+  AC_DEFINE(HAVE_MEMBER_TEMPLATE_SPECIFICATIONS, [],
+    [Whether the C++ compiler can call a template member with no arguments])
+fi
 
 AC_LANG_POP(C++)
 
This page took 0.02464 seconds and 4 git commands to generate.