aboutsummaryrefslogtreecommitdiff
path: root/configure.in
diff options
context:
space:
mode:
authorGravatar Ton Voon <tonvoon@users.sourceforge.net> 2007-03-06 14:18:11 +0000
committerGravatar Ton Voon <tonvoon@users.sourceforge.net> 2007-03-06 14:18:11 +0000
commit184348053332cf256d3dd8e661ad756949c2b9b2 (patch)
tree98d012696bd7b694380dcdd2f61631e55e481226 /configure.in
parent31ff40189a387f3cc547f5799622a54758d7004c (diff)
downloadmonitoring-plugins-184348053332cf256d3dd8e661ad756949c2b9b2.tar.gz
Detect if check_mysql compile will work at ./configure time, due to some
Redhat systems distributing mysql_config, but not the include files git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1627 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in16
1 files changed, 12 insertions, 4 deletions
diff --git a/configure.in b/configure.in
index 5d1e75df..b0d1c97d 100644
--- a/configure.in
+++ b/configure.in
@@ -242,23 +242,31 @@ if test $with_mysql != "no" ; then
AC_MSG_WARN([Skipping mysql plugin])
AC_MSG_WARN([install mysql client libs to compile this plugin (see REQUIREMENTS).])
else
- with_mysql=$MYSQLCONFIG
- EXTRAS="$EXTRAS check_mysql check_mysql_query"
MYSQLINCLUDE=`$MYSQLCONFIG --include`
# Mysql 3 does not support --include. --cflags should be sufficient
if test $? -ne 0 ; then
MYSQLINCLUDE=""
+ TEMP_INCLUDE="-I$with_mysql/include" # Guessed location
+ else
+ TEMP_INCLUDE=$MYSQLINCLUDE
fi
MYSQLLIBS=`$MYSQLCONFIG --libs`
MYSQLCFLAGS=`$MYSQLCONFIG --cflags`
AC_SUBST(MYSQLINCLUDE)
AC_SUBST(MYSQLLIBS)
AC_SUBST(MYSQLCFLAGS)
+ dnl Test for mysqlclient. Some redhat systems have mysql_config, but no headers
+ _SAVEDCPPFLAGS=$CPPFLAGS
+ _SAVEDLDFLAGS="$LDFLAGS"
+ CPPFLAGS="$CPPFLAGS $TEMP_INCLUDE"
+ LDFLAGS="$LDFLAGS $MYSQLLIBS"
+ AC_CHECK_LIB([mysqlclient], [mysql_init], [with_mysql=$MYSQLCONFIG
+EXTRAS="$EXTRA check_mysql check_mysql_query"], [with_mysql="not found"])
+ CPPFLAGS=$_SAVEDCPPFLAGS
+ LDFLAGS=$_SAVEDLDFLAGS
fi
fi
-AC_CHECK_HEADERS(unistd.h)
-
dnl Check for AF_INET6 support - unistd.h required for Darwin
AC_CACHE_CHECK([for IPv6 support], with_ipv6, [
AC_TRY_COMPILE([#ifdef HAVE_UNISTD_H