[Nagiosplug-checkins] nagiosplug configure.in, 1.207, 1.208 NEWS, 1.10, 1.11

Ton Voon tonvoon at users.sourceforge.net
Tue Mar 6 15:18:14 CET 2007


Update of /cvsroot/nagiosplug/nagiosplug
In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv23225

Modified Files:
	configure.in NEWS 
Log Message:
Detect if check_mysql compile will work at ./configure time, due to some
Redhat systems distributing mysql_config, but not the include files


Index: NEWS
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/NEWS,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- NEWS	6 Mar 2007 10:48:30 -0000	1.10
+++ NEWS	6 Mar 2007 14:18:11 -0000	1.11
@@ -3,6 +3,7 @@
 ??    ??
 	Fixed MKINSTALLDIRS problem in po/
 	Root plugins installed with world executable
+	./configure now detects if possible to compile check_mysql
 	check_sybase from contrib now maintained in NagiosExchange
 
 1.4.6 5th February 2007

Index: configure.in
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/configure.in,v
retrieving revision 1.207
retrieving revision 1.208
diff -u -d -r1.207 -r1.208
--- configure.in	6 Mar 2007 11:03:35 -0000	1.207
+++ configure.in	6 Mar 2007 14:18:11 -0000	1.208
@@ -242,23 +242,31 @@
     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





More information about the Commits mailing list