diff options
Diffstat (limited to 'configure.in')
-rw-r--r-- | configure.in | 71 |
1 files changed, 9 insertions, 62 deletions
diff --git a/configure.in b/configure.in index e02dc895..87b8e2cc 100644 --- a/configure.in +++ b/configure.in | |||
@@ -254,72 +254,19 @@ fi | |||
254 | LIBS="$_SAVEDLIBS" | 254 | LIBS="$_SAVEDLIBS" |
255 | 255 | ||
256 | dnl Check for mysql libraries | 256 | dnl Check for mysql libraries |
257 | _SAVEDLIBS="$LIBS" | 257 | AC_PATH_PROG(MYSQLCONFIG, mysql_config) |
258 | _SAVEDCPPFLAGS="$CPPFLAGS" | 258 | if test -z "$MYSQLCONFIG"; then |
259 | FOUNDMYSQL="no" | 259 | AC_MSG_WARN([Skipping mysql plugin]) |
260 | AC_ARG_WITH(mysql, | 260 | AC_MSG_WARN([install mysql client libs to compile this plugin (see REQUIREMENTS).]) |
261 | ACX_HELP_STRING([--with-mysql=DIR], | 261 | else |
262 | [sets path to mysql installation (assumes lib/lib64 and include subdirs)]), | ||
263 | MYSQL=$withval,) | ||
264 | # Find the mysql client libs | ||
265 | if test -n "$MYSQL"; then | ||
266 | MYSQLLIBDIR=$MYSQL/lib | ||
267 | MYSQLLIB64DIR=$MYSQL/lib64 | ||
268 | elif test -f /usr/lib/libmysqlclient.so -o -f /usr/lib/libmysqlclient.a ; then | ||
269 | MYSQL="/usr" | ||
270 | MYSQLLIBDIR=$MYSQL/lib | ||
271 | MYSQLLIB64DIR=$MYSQL/lib64 | ||
272 | elif test -f /usr/lib/mysql/libmysqlclient.so -o -f /usr/lib/mysql/libmysqlclient.a ; then | ||
273 | MYSQL="/usr" | ||
274 | MYSQLLIBDIR=$MYSQL/lib/mysql | ||
275 | MYSQLLIB64DIR=$MYSQL/lib64/mysql | ||
276 | elif test -f /usr/local/lib/libmysqlclient.so -o -f /usr/local/lib/libmysqlclient.a ; then | ||
277 | MYSQL="/usr/local" | ||
278 | MYSQLLIBDIR=$MYSQL/lib | ||
279 | MYSQLLIB64DIR=$MYSQL/lib64 | ||
280 | elif test -f /usr/local/lib/mysql/libmysqlclient.so -o -f /usr/local/lib/mysql/libmysqlclient.a ; then | ||
281 | MYSQL="/usr/local" | ||
282 | MYSQLLIBDIR=$MYSQL/lib/mysql | ||
283 | MYSQLLIB64DIR=$MYSQL/lib64/mysql | ||
284 | elif test -f /usr/local/mysql/lib/libmysqlclient.so -o -f /usr/local/mysql/lib/libmysqlclient.a ; then | ||
285 | MYSQL="/usr/local/mysql" | ||
286 | MYSQLLIBDIR=$MYSQL/lib | ||
287 | MYSQLLIB64DIR=$MYSQL/lib64 | ||
288 | fi | ||
289 | |||
290 | # Check libs okay | ||
291 | if test -n "$MYSQL" ; then | ||
292 | CPPFLAGS="-L$MYSQLLIBDIR -L$MYSQLLIB64DIR" | ||
293 | AC_CHECK_LIB(mysqlclient,mysql_init,MYSQLLIBS="-lmysqlclient -lz",,-lz) | ||
294 | AC_CHECK_LIB(mysqlclient,mysql_close,MYSQLLIBS="-lmysqlclient") | ||
295 | fi | ||
296 | |||
297 | # Check headers okay | ||
298 | if test "$ac_cv_lib_mysqlclient_mysql_init" = "yes" -o "$ac_cv_lib_mysqlclient_mysql_close" = "yes"; then | ||
299 | CPPFLAGS="-I$MYSQL/include" | ||
300 | AC_CHECK_HEADERS(mysql.h errmsg.h, FOUNDMYSQL="yes" MYSQLINCLUDE="-I$MYSQL/include") | ||
301 | if test x"$FOUNDMYSQL" != x"yes" ; then | ||
302 | AC_CHECK_HEADERS(mysql/mysql.h mysql/errmsg.h, FOUNDMYSQL="yes" MYSQLINCLUDE="-I$MYSQL/include/mysql") | ||
303 | fi | ||
304 | fi | ||
305 | |||
306 | # Setup mysql plugins | ||
307 | if test $FOUNDMYSQL = "yes" ; then | ||
308 | EXTRAS="$EXTRAS check_mysql check_mysql_query" | 262 | EXTRAS="$EXTRAS check_mysql check_mysql_query" |
309 | if test -d $MYSQLLIB64DIR ; then | 263 | MYSQLINCLUDE=`$MYSQLCONFIG --include` |
310 | MYSQLLIBS="-L$MYSQLLIB64DIR -rpath $MYSQLLIB64DIR $MYSQLLIBS" | 264 | MYSQLLIBS=`$MYSQLCONFIG --libs` |
311 | fi | 265 | MYSQLCFLAGS=`$MYSQLCONFIG --cflags` |
312 | if test -d $MYSQLLIBDIR ; then | ||
313 | MYSQLLIBS="-L$MYSQLLIBDIR -rpath $MYSQLLIBDIR $MYSQLLIBS" | ||
314 | fi | ||
315 | AC_SUBST(MYSQLINCLUDE) | 266 | AC_SUBST(MYSQLINCLUDE) |
316 | AC_SUBST(MYSQLLIBS) | 267 | AC_SUBST(MYSQLLIBS) |
317 | else | 268 | AC_SUBST(MYSQLCFLAGS) |
318 | AC_MSG_WARN([Skipping mysql plugin]) | ||
319 | AC_MSG_WARN([install mysql client libs to compile this plugin (see REQUIREMENTS).]) | ||
320 | fi | 269 | fi |
321 | CPPFLAGS="$_SAVEDCPPFLAGS" | ||
322 | LIBS="$_SAVEDLIBS" | ||
323 | 270 | ||
324 | AC_CHECK_HEADERS(unistd.h) | 271 | AC_CHECK_HEADERS(unistd.h) |
325 | 272 | ||