From af2808859e7a98666785752b8069c473dda94a1f Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 15 Jun 2012 11:16:44 +0200 Subject: 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. --- m4/libmysqlclient.m4 | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'm4/libmysqlclient.m4') 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 +extern pthread_key_t THR_KEY_mysys; +int +main () +{ + return pthread_getspecific (THR_KEY_mysys) != 0; +} +]]), +[ +libmysqlclient_thr_key_visible=yes +]) +fi + ])dnl -- cgit v1.1