aboutsummaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2012-06-18 09:33:09 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2012-06-18 09:33:09 +0200
commit45a56a76a2ee43b021f1972cfd32d49c809c9283 (patch)
treea59c39edba39172826734c3197a149f849876af7 /m4
parent1ec822dd7c4d6abc4f1cd42bd398c53fe4897a4a (diff)
Search for libmysqlclient in additional directories
Fedora hides them in /usr/lib[64]/mysql for some reason.
Diffstat (limited to 'm4')
-rw-r--r--m4/libmysqlclient.m424
1 files changed, 23 insertions, 1 deletions
diff --git a/m4/libmysqlclient.m4 b/m4/libmysqlclient.m4
index 84b4471..f75acc9 100644
--- a/m4/libmysqlclient.m4
+++ b/m4/libmysqlclient.m4
@@ -21,6 +21,18 @@ AC_MSG_CHECKING([for lib$libmysqlclient_name])
save_LIBS="$LIBS"
LIBS="-l$libmysqlclient_name $LIBS"
+# Some distributions (e.g., Fedora) hide the library in the mysql/
+# subdirectory.
+#
+libmysqlclient_paths="none /usr/lib/mysql /usr/lib64/mysql"
+
+for path in $libmysqlclient_paths; do
+
+if test x"path" != xnone; then
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS -L$path"
+fi
+
CXX_LIBTOOL_LINK_IFELSE(
AC_LANG_SOURCE([[
#ifdef _WIN32
@@ -44,7 +56,9 @@ libmysqlclient_found=yes
libmysqlclient_include=long
])
-if test x"$libmysqlclient_found" = xno; then
+if test x"$libmysqlclient_found" = xyes; then
+ break;
+fi
CXX_LIBTOOL_LINK_IFELSE(
AC_LANG_SOURCE([[
@@ -69,8 +83,16 @@ libmysqlclient_found=yes
libmysqlclient_include=short
])
+if test x"$libmysqlclient_found" = xyes; then
+ break;
+fi
+
+if test x"path" != xnone; then
+ LDFLAGS="$save_LDFLAGS"
fi
+done
+
if test x"$libmysqlclient_found" = xno; then
LIBS="$save_LIBS"
fi