diff options
author | Ton Voon <tonvoon@users.sourceforge.net> | 2007-03-06 14:18:11 (GMT) |
---|---|---|
committer | Ton Voon <tonvoon@users.sourceforge.net> | 2007-03-06 14:18:11 (GMT) |
commit | 184348053332cf256d3dd8e661ad756949c2b9b2 (patch) | |
tree | 98d012696bd7b694380dcdd2f61631e55e481226 /configure.in | |
parent | 31ff40189a387f3cc547f5799622a54758d7004c (diff) | |
download | monitoring-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.in | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/configure.in b/configure.in index 5d1e75d..b0d1c97 100644 --- a/configure.in +++ b/configure.in | |||
@@ -242,23 +242,31 @@ if test $with_mysql != "no" ; then | |||
242 | AC_MSG_WARN([Skipping mysql plugin]) | 242 | AC_MSG_WARN([Skipping mysql plugin]) |
243 | AC_MSG_WARN([install mysql client libs to compile this plugin (see REQUIREMENTS).]) | 243 | AC_MSG_WARN([install mysql client libs to compile this plugin (see REQUIREMENTS).]) |
244 | else | 244 | else |
245 | with_mysql=$MYSQLCONFIG | ||
246 | EXTRAS="$EXTRAS check_mysql check_mysql_query" | ||
247 | MYSQLINCLUDE=`$MYSQLCONFIG --include` | 245 | MYSQLINCLUDE=`$MYSQLCONFIG --include` |
248 | # Mysql 3 does not support --include. --cflags should be sufficient | 246 | # Mysql 3 does not support --include. --cflags should be sufficient |
249 | if test $? -ne 0 ; then | 247 | if test $? -ne 0 ; then |
250 | MYSQLINCLUDE="" | 248 | MYSQLINCLUDE="" |
249 | TEMP_INCLUDE="-I$with_mysql/include" # Guessed location | ||
250 | else | ||
251 | TEMP_INCLUDE=$MYSQLINCLUDE | ||
251 | fi | 252 | fi |
252 | MYSQLLIBS=`$MYSQLCONFIG --libs` | 253 | MYSQLLIBS=`$MYSQLCONFIG --libs` |
253 | MYSQLCFLAGS=`$MYSQLCONFIG --cflags` | 254 | MYSQLCFLAGS=`$MYSQLCONFIG --cflags` |
254 | AC_SUBST(MYSQLINCLUDE) | 255 | AC_SUBST(MYSQLINCLUDE) |
255 | AC_SUBST(MYSQLLIBS) | 256 | AC_SUBST(MYSQLLIBS) |
256 | AC_SUBST(MYSQLCFLAGS) | 257 | AC_SUBST(MYSQLCFLAGS) |
258 | dnl Test for mysqlclient. Some redhat systems have mysql_config, but no headers | ||
259 | _SAVEDCPPFLAGS=$CPPFLAGS | ||
260 | _SAVEDLDFLAGS="$LDFLAGS" | ||
261 | CPPFLAGS="$CPPFLAGS $TEMP_INCLUDE" | ||
262 | LDFLAGS="$LDFLAGS $MYSQLLIBS" | ||
263 | AC_CHECK_LIB([mysqlclient], [mysql_init], [with_mysql=$MYSQLCONFIG | ||
264 | EXTRAS="$EXTRA check_mysql check_mysql_query"], [with_mysql="not found"]) | ||
265 | CPPFLAGS=$_SAVEDCPPFLAGS | ||
266 | LDFLAGS=$_SAVEDLDFLAGS | ||
257 | fi | 267 | fi |
258 | fi | 268 | fi |
259 | 269 | ||
260 | AC_CHECK_HEADERS(unistd.h) | ||
261 | |||
262 | dnl Check for AF_INET6 support - unistd.h required for Darwin | 270 | dnl Check for AF_INET6 support - unistd.h required for Darwin |
263 | AC_CACHE_CHECK([for IPv6 support], with_ipv6, [ | 271 | AC_CACHE_CHECK([for IPv6 support], with_ipv6, [ |
264 | AC_TRY_COMPILE([#ifdef HAVE_UNISTD_H | 272 | AC_TRY_COMPILE([#ifdef HAVE_UNISTD_H |