summaryrefslogtreecommitdiffstats
path: root/configure.in
diff options
context:
space:
mode:
authorTon Voon <tonvoon@users.sourceforge.net>2006-03-21 11:42:59 (GMT)
committerTon Voon <tonvoon@users.sourceforge.net>2006-03-21 11:42:59 (GMT)
commitb3b735446741fe89ee837d0522dd0d5b68167d92 (patch)
tree3f94a6f3ee947822cac33a63477c844fa0da2970 /configure.in
parent8250d650614c6e312f744b8dd503919e1b37bae8 (diff)
downloadmonitoring-plugins-b3b735446741fe89ee837d0522dd0d5b68167d92.tar.gz
mysql discovery based on mysql_config (Johan Fischer - 1359414)
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1333 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in71
1 files changed, 9 insertions, 62 deletions
diff --git a/configure.in b/configure.in
index e02dc89..87b8e2c 100644
--- a/configure.in
+++ b/configure.in
@@ -254,72 +254,19 @@ fi
254LIBS="$_SAVEDLIBS" 254LIBS="$_SAVEDLIBS"
255 255
256dnl Check for mysql libraries 256dnl Check for mysql libraries
257_SAVEDLIBS="$LIBS" 257AC_PATH_PROG(MYSQLCONFIG, mysql_config)
258_SAVEDCPPFLAGS="$CPPFLAGS" 258if test -z "$MYSQLCONFIG"; then
259FOUNDMYSQL="no" 259 AC_MSG_WARN([Skipping mysql plugin])
260AC_ARG_WITH(mysql, 260 AC_MSG_WARN([install mysql client libs to compile this plugin (see REQUIREMENTS).])
261 ACX_HELP_STRING([--with-mysql=DIR], 261else
262 [sets path to mysql installation (assumes lib/lib64 and include subdirs)]),
263 MYSQL=$withval,)
264# Find the mysql client libs
265if test -n "$MYSQL"; then
266 MYSQLLIBDIR=$MYSQL/lib
267 MYSQLLIB64DIR=$MYSQL/lib64
268elif test -f /usr/lib/libmysqlclient.so -o -f /usr/lib/libmysqlclient.a ; then
269 MYSQL="/usr"
270 MYSQLLIBDIR=$MYSQL/lib
271 MYSQLLIB64DIR=$MYSQL/lib64
272elif 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
276elif 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
280elif 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
284elif 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
288fi
289
290# Check libs okay
291if 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")
295fi
296
297# Check headers okay
298if 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
304fi
305
306# Setup mysql plugins
307if 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)
317else 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).])
320fi 269fi
321CPPFLAGS="$_SAVEDCPPFLAGS"
322LIBS="$_SAVEDLIBS"
323 270
324AC_CHECK_HEADERS(unistd.h) 271AC_CHECK_HEADERS(unistd.h)
325 272