diff -ur ndoutils-1.4b3.original/Makefile.in ndoutils-1.4b3/Makefile.in --- ndoutils-1.4b3.original/Makefile.in 2007-01-08 00:35:46.000000000 +0000 +++ ndoutils-1.4b3/Makefile.in 2007-05-10 09:02:17.000000000 +0100 @@ -10,15 +10,15 @@ SRC_INCLUDE=./include/ all: - cd $(SRC_BASE); $(MAKE) ; cd .. + cd $(SRC_BASE) && $(MAKE) clean: - cd $(SRC_BASE); $(MAKE) $@ ; cd .. + cd $(SRC_BASE) && $(MAKE) $@ rm -f core rm -f *~ */*~ include/nagios-*/*~ distclean: clean - cd $(SRC_BASE); $(MAKE) $@ ; cd .. + cd $(SRC_BASE) && $(MAKE) $@ rm -f config.log config.status config.cache $(SRC_INCLUDE)/config.h rm -f Makefile diff -ur ndoutils-1.4b3.original/configure.in ndoutils-1.4b3/configure.in --- ndoutils-1.4b3.original/configure.in 2007-04-10 17:21:33.000000000 +0100 +++ ndoutils-1.4b3/configure.in 2007-05-10 09:06:05.000000000 +0100 @@ -165,52 +165,19 @@ AC_ARG_ENABLE(pgsql,--enable-pgsql enables PostgreSQL database support) AS_IF([test x$enable_pgsql = xno], [USE_PGSQL=no]) -dnl Optional MySQL library and include paths -AC_ARG_WITH(mysql-lib,--with-mysql-lib=DIR sets location of the MySQL client library,[ - DBLDFLAGS="-L${withval}" - LD_RUN_PATH="${withval}${LD_RUN_PATH:+:}${LD_RUN_PATH}" - ]) -if test "$withval" = "" ; then - dnl If no library path specified, add default (RedHat) path for good measure - DBLDFLAGS="$LDFLAGS -L/usr/lib/mysql" -fi -AC_ARG_WITH(mysql-inc,--with-mysql-inc=DIR sets location of the MySQL client include files,[ - DBCFLAGS="${DBCFLAGS} -I${withval}" - ]) - -dnl Optional PostgreSQL library and include paths -AC_ARG_WITH(pgsql-lib,--with-pgsql-lib=DIR sets location of the PostgreSQL client library,[ - DBLDFLAGS="-L${withval}" - LD_RUN_PATH="${withval}${LD_RUN_PATH:+:}${LD_RUN_PATH}" - ]) -AC_ARG_WITH(pgsql-inc,--with-pgsql-inc=DIR sets location of the PostgreSQL client include files,[ - DBCFLAGS="${DBCFLAGS} -I${withval}" - ]) - -save_LDFLAGS="$LDFLAGS" -LDFLAGS="${LDFLAGS} ${DBLDFLAGS}" -save_CPPFLAGS="$CPPFLAGS" -CPPFLAGS="${DBCFLAGS}" -save_CFLAGS="$CFLAGS" -CFLAGS="${DBCFLAGS}" dnl Are we using any MySQL routines? if test $USE_MYSQL = yes; then - - dnl check compress lib for Mac OSX as well... - AC_CHECK_LIB(z,compress) - AC_CHECK_LIB(mysqlclient,mysql_store_result,MYSQLLIBFOUND=yes,MYSQLLIBFOUND=no) - - dnl Did we find the MySQL libraries? - if test x$MYSQLLIBFOUND = xno; then + np_mysqlclient + if test $with_mysql = "no"; then echo "" echo "" echo "*** MySQL library could not be located... **************************" echo "" echo "You chose to compile NDBXT with MySQL support, but I was unable to" echo "locate the MySQL library on your system. If the library is" - echo "installed, use the --with-mysql-lib argument to specify the" - echo "location of the MySQL library." + echo "installed, use the --with-mysql=DIR argument to specify the" + echo "location of the MySQL library. We assume mysql_config is in DIR/bin" echo "" echo "NOTE: After you install the necessary libraries on your system:" echo " 1. Make sure /etc/ld.so.conf has an entry for the directory in" @@ -222,44 +189,37 @@ echo "" echo "TIP: Try the following...." echo "" - echo " ./configure --with-mysql-lib=/usr/lib/mysql" + echo " ./configure --with-mysql=/usr/lib/mysql" echo "" echo "********************************************************************" echo "" echo "" USE_MYSQL=no - fi - - AC_CHECK_HEADER(mysql/mysql.h,MYSQLINCFOUND=yes,MYSQLINCFOUND=no) - - dnl Did we find the MySQL header files? - if test x$MYSQLINCFOUND = xno; then - echo "" - echo "" - echo "*** MySQL include file could not be located... **********************" - echo "" - echo "You chose to compile NDBXT with MySQL support, but I was unable to" - echo "locate on your system. If the include file is" - echo "installed, use the --with-mysql-inc argument to specify the location" - echo "of the MySQL include file." - echo "" - echo "********************************************************************" - echo "" - echo "" - - USE_MYSQL=no - - fi - - dnl We found the MySQL lib! - if test x$USE_MYSQL = xyes; then + else echo "MySQL library and include file(s) were found!" AC_DEFINE_UNQUOTED(USE_MYSQL) - DBLIBS="$DBLIBS -lmysqlclient" + DBLIBS="$DBLIBS $np_mysql_libs" + CFLAGS="$np_mysql_include" fi fi +dnl Optional PostgreSQL library and include paths +AC_ARG_WITH(pgsql-lib,--with-pgsql-lib=DIR sets location of the PostgreSQL client library,[ + DBLDFLAGS="-L${withval}" + LD_RUN_PATH="${withval}${LD_RUN_PATH:+:}${LD_RUN_PATH}" + ]) +AC_ARG_WITH(pgsql-inc,--with-pgsql-inc=DIR sets location of the PostgreSQL client include files,[ + DBCFLAGS="${DBCFLAGS} -I${withval}" + ]) + +save_LDFLAGS="$LDFLAGS" +LDFLAGS="${LDFLAGS} ${DBLDFLAGS}" +save_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="${DBCFLAGS}" +save_CFLAGS="$CFLAGS" +CFLAGS="${DBCFLAGS}" + dnl Are we using any PostgreSQL routines? if test $USE_PGSQL = yes; then diff -ur ndoutils-1.4b3.original/include/config.h.in ndoutils-1.4b3/include/config.h.in --- ndoutils-1.4b3.original/include/config.h.in 2007-01-08 00:35:54.000000000 +0000 +++ ndoutils-1.4b3/include/config.h.in 2007-05-10 09:06:38.000000000 +0100 @@ -246,8 +246,8 @@ #undef HAVE_MYSQL #ifdef USE_MYSQL #define HAVE_MYSQL 1 -#include -#include +#include "mysql.h" +#include "errmsg.h" #endif #undef USE_PGSQL diff -ur ndoutils-1.4b3.original/src/Makefile.in ndoutils-1.4b3/src/Makefile.in --- ndoutils-1.4b3.original/src/Makefile.in 2007-01-08 19:46:35.000000000 +0000 +++ ndoutils-1.4b3/src/Makefile.in 2007-05-10 09:07:09.000000000 +0100 @@ -16,7 +16,7 @@ #CFLAGS=-g -Wall -ansi -pedantic -DHAVE_CONFIG_H # Compiler flags for use with Valgrind -CFLAGS=-O0 -g -DHAVE_CONFIG_H +#CFLAGS=-O0 -g -DHAVE_CONFIG_H MOD_CFLAGS=@MOD_CFLAGS@ LDFLAGS=@LDFLAGS@