aboutsummaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2012-06-15 11:16:44 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2012-06-15 11:16:44 +0200
commitaf2808859e7a98666785752b8069c473dda94a1f (patch)
tree123979c9700e588ad0f3007c19c096646dd73704 /m4
parent5bfec1c98e05b86b719edb37ce1be8778f91d6ec (diff)
Add support for building against libmysqlclient that lacks THR_KEY_mysys
In certain distributions (specifically Fedora 15 and later), maintainers limit the number of visible symbols. If THR_KEY_mysys is hidden, then we try to create the TLS keys in such an order that it results in the correct behavior. And then hope for the best.
Diffstat (limited to 'm4')
-rw-r--r--m4/libmysqlclient.m422
1 files changed, 22 insertions, 0 deletions
diff --git a/m4/libmysqlclient.m4 b/m4/libmysqlclient.m4
index e08a08e..84b4471 100644
--- a/m4/libmysqlclient.m4
+++ b/m4/libmysqlclient.m4
@@ -82,4 +82,26 @@ else
AC_MSG_RESULT([no])
$3
fi
+
+# Check if the THR_KEY_mysys pthread key symbol is visible.
+#
+libmysqlclient_thr_key_visible=no
+
+if test x"$libmysqlclient_found" = xyes -a x"$1" = xposix; then
+
+CXX_LIBTOOL_LINK_IFELSE(
+AC_LANG_SOURCE([[
+#include <pthread.h>
+extern pthread_key_t THR_KEY_mysys;
+int
+main ()
+{
+ return pthread_getspecific (THR_KEY_mysys) != 0;
+}
+]]),
+[
+libmysqlclient_thr_key_visible=yes
+])
+fi
+
])dnl