diff options
-rw-r--r-- | configure.in | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/configure.in b/configure.in index 72552045..a9ffeb1c 100644 --- a/configure.in +++ b/configure.in @@ -155,13 +155,18 @@ else fi LIBS="$_SAVEDLIBS" + dnl Check for mysql libraries _SAVEDLIBS="$LIBS" _SAVEDCPPFLAGS="$CPPFLAGS" -CPPFLAGS="-I/usr/include" -AC_ARG_WITH(mysqllibdir,--with-mysqllibdir=<dir> sets path to mysql libraries,[MYSQLLIBDIR=$withval]) -if test -n "$MYSQLLIBDIR"; then - AC_CHECK_LIB(mysqlclient,mysql_init,MYSQLLIBS="-lmysqlclient -lz" check_mysql_LDFLAGS="-L$MYSQLLIBDIR",,-L$MYSQLLIBDIR -lz) +dnl CPPFLAGS="-I/usr/include" + +AC_ARG_WITH(mysql,--with-mysql=<dir> sets path to mysql installation (assumes lib/mysql and include subdirs),[MYSQL=$withval]) +if test -n "$MYSQL"; then + MYSQLLIBDIR=$MYSQL/lib/mysql + CPPFLAGS="-I$MYSQL/include" + AC_CHECK_LIB(mysqlclient,mysql_init,MYSQLLIBS="-lmysqlclient -lz" check_mysql_LDFLAGS="-L$MYSQLLIBDIR ",,-L$MYSQLLIBDIR -lz) + AC_CHECK_LIB(mysqlclient,mysql_close,MYSQLLIBS="-lmysqlclient") elif test -f /usr/lib/libmysqlclient.so; then AC_CHECK_LIB(mysqlclient,mysql_init,MYSQLLIBS="-lmysqlclient -lz",,-lz) AC_CHECK_LIB(mysqlclient,mysql_close,MYSQLLIBS="-lmysqlclient") @@ -176,21 +181,23 @@ elif test -f /usr/lib/mysql/libmysqlclient.a; then AC_CHECK_LIB(mysqlclient,mysql_close,MYSQLLIBS="-lmysqlclient" check_mysql_LDFLAGS="-L/usr/lib/mysql",,-L/usr/lib/mysql) fi if test "$ac_cv_lib_mysqlclient_mysql_init" = "yes" -o "$ac_cv_lib_mysqlclient_mysql_close" = "yes"; then - AC_CHECK_HEADERS(mysql/mysql.h mysql/errmsg.h) + AC_CHECK_HEADERS(mysql/mysql.h mysql/errmsg.h, MYSQLINCLUDE="-I$MYSQL/include" ) if test "$ac_cv_header_mysql_mysql_h" = "yes" -a "$ac_cv_header_mysql_errmsg_h" = "yes"; then EXTRAS="$EXTRAS check_mysql" + CPPFLAGS="$_SAVEDCPPFLAGS -I$MYSQL/include" AC_SUBST(MYSQLLIBS) AC_SUBST(check_mysql_LDFLAGS) else AC_MSG_WARN([Skipping mysql plugin]) AC_MSG_WARN([install mysql client headers to compile this plugin (see Requirements).]) + CPPFLAGS="$_SAVEDCPPFLAGS" fi else AC_MSG_WARN([Skipping mysql plugin]) AC_MSG_WARN([install mysql client libs to compile this plugin (see Requirements).]) + CPPFLAGS="$_SAVEDCPPFLAGS" fi LIBS="$_SAVEDLIBS" -CPPFLAGS="$_SAVEDCPPFLAGS" dnl Check for OpenSSL location AC_PATH_PROG(OPENSSL,openssl) |