From e1e5bd338fe507d23ac72c964efa5c7009c30bba Mon Sep 17 00:00:00 2001 From: Haru Date: Fri, 24 Oct 2014 00:42:18 +0200 Subject: Added support for other libmysqlclient variants - This allows Hercules to correctly detect MariaDB and other drop-in replacements in distributions that rename their libmysqlclient (i.e. Debian / Ubuntu renaming it to libmariadbclient). - Closes issue #368 - Due to a bug in Ubuntu 14.04 LTS (incorrect output by the mariadb-provided version of `mysql_config --libs` and missing dependencies of libmariadbclient-dev), users of said distribution will have to manually specify ./configure LIBS="-lssl -lcrypto" as well as manually install the libssl-dev package, if they wish to use libmariadbclient-dev, as it will be unable to link otherwise (note: this issue isn't Hercules-specific) - Special thanks to Andrei Karas Signed-off-by: Haru --- configure | 45 +++++---------------------------------------- configure.in | 6 +++--- 2 files changed, 8 insertions(+), 43 deletions(-) diff --git a/configure b/configure index 630fbb5b9..52050b25c 100755 --- a/configure +++ b/configure @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.in d84fa6f. +# From configure.in 2ae9f0c. # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69. # @@ -7395,45 +7395,10 @@ else MYSQL_VERSION="unknown" fi -MYSQL_OLD_LDFLAGS="$LDFLAGS" ; LDFLAGS="$LDFLAGS $MYSQL_LIBS" +MYSQL_OLD_LIBS="$LIBS" ; LIBS="$LIBS $MYSQL_LIBS" MYSQL_OLD_CPPFLAGS="$CPPFLAGS" ; CPPFLAGS="$CPPFLAGS $MYSQL_CFLAGS" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for mysql_init in -lmysqlclient" >&5 -$as_echo_n "checking for mysql_init in -lmysqlclient... " >&6; } -if ${ac_cv_lib_mysqlclient_mysql_init+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lmysqlclient $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char mysql_init (); -int -main () -{ -return mysql_init (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_mysqlclient_mysql_init=yes -else - ac_cv_lib_mysqlclient_mysql_init=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mysqlclient_mysql_init" >&5 -$as_echo "$ac_cv_lib_mysqlclient_mysql_init" >&6; } -if test "x$ac_cv_lib_mysqlclient_mysql_init" = xyes; then : +ac_fn_c_check_func "$LINENO" "mysql_init" "ac_cv_func_mysql_init" +if test "x$ac_cv_func_mysql_init" = xyes; then : HAVE_MYSQL="yes" fi @@ -7446,7 +7411,7 @@ fi CPPFLAGS="$MYSQL_OLD_CPPFLAGS" -LDFLAGS="$MYSQL_OLD_LDFLAGS" +LIBS="$MYSQL_OLD_LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking MySQL library (required)" >&5 $as_echo_n "checking MySQL library (required)... " >&6; } diff --git a/configure.in b/configure.in index cd1dbea1d..ec3b1f735 100644 --- a/configure.in +++ b/configure.in @@ -1256,12 +1256,12 @@ else MYSQL_VERSION="unknown" fi -MYSQL_OLD_LDFLAGS="$LDFLAGS" ; LDFLAGS="$LDFLAGS $MYSQL_LIBS" +MYSQL_OLD_LIBS="$LIBS" ; LIBS="$LIBS $MYSQL_LIBS" MYSQL_OLD_CPPFLAGS="$CPPFLAGS" ; CPPFLAGS="$CPPFLAGS $MYSQL_CFLAGS" -AC_CHECK_LIB([mysqlclient], [mysql_init], [HAVE_MYSQL="yes"], []) +AC_CHECK_FUNC([mysql_init], [HAVE_MYSQL="yes"]) AC_CHECK_HEADER([mysql.h], [], [HAVE_MYSQL=""]) CPPFLAGS="$MYSQL_OLD_CPPFLAGS" -LDFLAGS="$MYSQL_OLD_LDFLAGS" +LIBS="$MYSQL_OLD_LIBS" AC_MSG_CHECKING([MySQL library (required)]) if test "$HAVE_MYSQL" = "yes" ; then -- cgit v1.2.3-60-g2f50