From 54df2afaa61c6a03cbb4a33c9b90fa572b6d07b8 Mon Sep 17 00:00:00 2001 From: Jesse Morgan Date: Sat, 17 Dec 2016 21:28:53 -0800 Subject: Berkeley DB 4.8 with rust build script for linux. --- db-4.8.30/dist/aclocal/tls.m4 | 65 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 db-4.8.30/dist/aclocal/tls.m4 (limited to 'db-4.8.30/dist/aclocal/tls.m4') diff --git a/db-4.8.30/dist/aclocal/tls.m4 b/db-4.8.30/dist/aclocal/tls.m4 new file mode 100644 index 0000000..52d232b --- /dev/null +++ b/db-4.8.30/dist/aclocal/tls.m4 @@ -0,0 +1,65 @@ +# Check for thread local storage support. +# Required when building with DB STL support. +# Based in part on: http://autoconf-archive.cryp.to/ax_tls.html +# by Alan Woodland + +AC_DEFUN([AX_TLS], [ + AC_MSG_CHECKING(for thread local storage (TLS) class) + AC_SUBST(TLS_decl) + AC_SUBST(TLS_defn) + ac_cv_tls=none + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + ax_tls_keywords="__thread __declspec(thread) __declspec(__thread)" + for ax_tls_decl_keyword in $ax_tls_keywords ""; do + for ax_tls_defn_keyword in $ax_tls_keywords ""; do + test -z "$ax_tls_decl_keyword" && + test -z "$ax_tls_defn_keyword" && continue + AC_TRY_COMPILE([template class TLSClass { + public: static ] $ax_tls_decl_keyword [ T *tlsvar; + }; + class TLSClass2 { + public: static ] $ax_tls_decl_keyword [int tlsvar; + }; + template ] $ax_tls_defn_keyword [ T* TLSClass::tlsvar = NULL;] + $ax_tls_defn_keyword [int TLSClass2::tlsvar = 1; + static $ax_tls_decl_keyword int x = 0;], + [TLSClass::tlsvar = NULL; TLSClass2::tlsvar = 1;], + [ac_cv_tls=modifier ; break]) + done + test "$ac_cv_tls" = none || break + done + AC_LANG_RESTORE + if test "$ac_cv_tls" = "none" ; then + AC_TRY_COMPILE( + [#include + #include + + static pthread_once_t once_control_ = PTHREAD_ONCE_INIT; + static pthread_key_t key; + + static void init_once(void) { + pthread_key_create(&key, NULL); + } + static void *get_tls() { + return (void *)pthread_getspecific(&key); + } + static void set_tls(void *p) { + pthread_setspecific(&key, p); + }], [], + [ac_cv_tls=pthread]) + fi + + case "$ac_cv_tls" in + none) break ;; + pthread) + TLS_decl="#define HAVE_PTHREAD_TLS" + TLS_defn="" ;; + modifier) + TLS_decl="#define TLS_DECL_MODIFIER $ax_tls_decl_keyword" + TLS_defn="#define TLS_DEFN_MODIFIER $ax_tls_defn_keyword" ;; + esac + + AC_MSG_RESULT([$ac_cv_tls]) +]) + -- cgit v1.2.3