From 45a56a76a2ee43b021f1972cfd32d49c809c9283 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 18 Jun 2012 09:33:09 +0200 Subject: Search for libmysqlclient in additional directories Fedora hides them in /usr/lib[64]/mysql for some reason. --- m4/libmysqlclient.m4 | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'm4') 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 -- cgit v1.1