Code

cleaning help and usage
[nagiosplug.git] / configure.in
index d0a2a528b5c10893ff50c745a04e082fbafbdf1f..27b2b40edfc2987522e2cf4f3d3c4b74ecc063a9 100644 (file)
@@ -3,7 +3,7 @@ AC_REVISION ($Revision$)
 AC_PREREQ(2.58)
 AC_INIT(nagios-plugins,1.4.3)
 AC_CONFIG_SRCDIR(NPTest.pm)
-AM_INIT_AUTOMAKE
+AM_INIT_AUTOMAKE([1.8.3])
 AM_CONFIG_HEADER(config.h)
 AC_CANONICAL_HOST
 
@@ -38,7 +38,6 @@ AC_CONFIG_LIBOBJ_DIR(lib)
 AC_FUNC_GETLOADAVG([lib])
 
 ifdef([AC_FUNC_STRTOD],[AC_FUNC_STRTOD],[AM_FUNC_STRTOD])
-dnl AM_WITH_REGEX
 
 PLUGIN_TEST=`echo $srcdir/plugins/t/*.t|sed -e 's,\.*/plugins/,,g'`
 AC_SUBST(PLUGIN_TEST)dnl
@@ -84,7 +83,7 @@ AC_ARG_WITH(trusted_path,
 AC_SUBST(with_trusted_path)
 
 EXTRAS=
-EXTRAS_ROOT=pst3
+EXTRAS_ROOT=
 dnl PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/etc:/usr/local/bin:/usr/local/sbin:$PATH
 
 LDFLAGS="$LDFLAGS -L."
@@ -145,9 +144,6 @@ dnl Check for miscellaneous stuff
 dnl 
 
 case $host_vender-$host_os in
-sun*)
-       AC_DEFINE(__EXTENSIONS__,1,[Sun's netdb.h needs this for getaddrinfo])
-       ;;
 osf*)
        AC_DEFINE(_OSF_SOURCE,1,[OSF needs this for getaddrinfo])
        ;;
@@ -257,11 +253,12 @@ fi
 LIBS="$_SAVEDLIBS"
 
 dnl Check for mysql libraries
+dnl Default is to search path for mysql_config
 AC_ARG_WITH(mysql,
        ACX_HELP_STRING([--with-mysql=DIR],
                [Compiles mysql plugins. Expects DIR/bin/mysql_config]),
        with_mysql=$withval,
-       with_mysql=no)
+       with_mysql=yes)
 if test $with_mysql != "no" ; then
   if test -x $with_mysql/bin/mysql_config ; then
     MYSQLCONFIG="$with_mysql/bin/mysql_config"
@@ -276,6 +273,10 @@ if test $with_mysql != "no" ; then
     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=""
+    fi
     MYSQLLIBS=`$MYSQLCONFIG --libs`
     MYSQLCFLAGS=`$MYSQLCONFIG --cflags`
     AC_SUBST(MYSQLINCLUDE)
@@ -444,7 +445,7 @@ if ! test x"$with_openssl" = x"no"; then
        unset FOUNDINCLUDE
        if test x"$with_openssl" != x"/usr" ; then
                CPPFLAGS="$CPPFLAGS -I$with_openssl/include"
-               LDFLAGS="$LDFLAGS -R$with_openssl/lib"
+               LDFLAGS="$LDFLAGS -L$with_openssl/lib"
        fi
 
        dnl check for openssl in $dir/include/openssl
@@ -529,7 +530,7 @@ dnl
 AC_HEADER_STDC
 AC_HEADER_TIME
 AC_HEADER_SYS_WAIT
-AC_CHECK_HEADERS(signal.h strings.h string.h syslog.h uio.h errno.h regex.h sys/types.h sys/time.h sys/socket.h sys/loadavg.h sys/un.h)
+AC_CHECK_HEADERS(signal.h strings.h string.h syslog.h uio.h errno.h sys/types.h sys/time.h sys/socket.h sys/loadavg.h sys/un.h sys/poll.h)
 AC_CHECK_HEADERS(features.h stdarg.h sys/unistd.h ctype.h stdlib.h)
 
 dnl Checks for typedefs, structures, and compiler characteristics.
@@ -601,7 +602,7 @@ AC_TRY_COMPILE([#include <sys/time.h>],
 
 dnl Checks for library functions.
 AC_CHECK_FUNCS(memmove select socket strdup strstr strtod strtol strtoul floor)
-AC_CHECK_FUNCS(basename)
+AC_CHECK_FUNCS(basename poll)
 
 AC_MSG_CHECKING(return type of socket size)
 AC_TRY_COMPILE([#include <stdlib.h>
@@ -1263,20 +1264,6 @@ AC_ARG_WITH(rpcinfo_command,
                             [sets path to rpcinfo]), PATH_TO_RPCINFO=$withval)
 AC_DEFINE_UNQUOTED(PATH_TO_RPCINFO,"$PATH_TO_RPCINFO",[path to rpcinfo binary])
 
-AC_PATH_PROG(PATH_TO_NTPDATE,ntpdate)
-AC_ARG_WITH(ntpdate_command,
-            ACX_HELP_STRING([--with-ntpdate-command=PATH],
-                            [sets path to ntpdate]), PATH_TO_NTPDATE=$withval)
-AC_PATH_PROGS(PATH_TO_NTPDC,ntpdc xntpdc)
-AC_PATH_PROGS(PATH_TO_NTPQ,ntpq)
-if (test -n "$PATH_TO_NTPDATE" || test -n "$PATH_TO_NTPQ")
-then
-       AC_DEFINE_UNQUOTED(PATH_TO_NTPQ,"$PATH_TO_NTPQ",[path to ntpq binary])
-       AC_DEFINE_UNQUOTED(PATH_TO_NTPDATE,"$PATH_TO_NTPDATE",[path to ntpdate binary])
-else
-       AC_MSG_WARN([Install NTP programs (http://www.ntp.org) if you want to monitor time synchronization])
-fi
-
 AC_PATH_PROG(PATH_TO_LMSTAT,lmstat)
 if test -x "$PATH_TO_LMSTAT"
 then
@@ -1621,6 +1608,18 @@ if test -n "$PATH_TO_DIG"; then
        AC_DEFINE_UNQUOTED(PATH_TO_DIG,"$PATH_TO_DIG",[Path to dig command, if present])
 fi
 
+AC_PATH_PROG(PATH_TO_APTGET,apt-get)
+AC_ARG_WITH(apt-get_command,
+            ACX_HELP_STRING([--with-apt-get-command=PATH],
+                            [Path to apt-get command]), 
+                            with_apt_get_command=$withval,
+                            with_apt_get_command=$PATH_TO_APTGET)
+AC_DEFINE_UNQUOTED(PATH_TO_APTGET,"$PATH_TO_APTGET",[Path to apt-get command, if present])
+if test -n "$PATH_TO_APTGET" ; then
+       EXTRAS="$EXTRAS check_apt"
+fi
+
+
 if test -f plugins/check_nt.c ; then
   EXTRAS="$EXTRAS check_nt"
 elif test -f ../plugins/check_nt.c ; then
@@ -1661,8 +1660,8 @@ AC_SUBST(EXTRAS_ROOT)
 AC_SUBST(EXTRA_NETOBJS)
 AC_SUBST(DEPLIBS)
 
-AM_GNU_GETTEXT([no-libtool], [need-ngettext])
-AM_GNU_GETTEXT_VERSION(0.11.5)
+AM_GNU_GETTEXT([external], [need-ngettext])
+AM_GNU_GETTEXT_VERSION(0.13.1)
 
 dnl Check for Redhat spopen problem
 dnl Wierd problem where ECHILD is returned from a wait call in error
@@ -1709,7 +1708,6 @@ AC_OUTPUT(
   command.cfg 
   test.pl 
   pkg/solaris/pkginfo 
-  intl/Makefile
   po/Makefile.in 
 )
 
@@ -1718,11 +1716,11 @@ dnl the ones below that are commented out need to be cleaned up
 dnl in the configure code above to use with_foo instead of ac_cv_foo
 dnl if we want them to show up here.  it'd also make the code cleaner.
 dnl i'll get to that on another rainy day :) -sf
+ACX_FEATURE([with],[apt-get-command])
 dnl ACX_FEATURE([with],[dig-command])
 dnl ACX_FEATURE([with],[fping-command])
 dnl ACX_FEATURE([with],[mailq-command])
 dnl ACX_FEATURE([with],[nslookup-command])
-dnl ACX_FEATURE([with],[ntpdate-command])
 ACX_FEATURE([with],[ping6-command])
 ACX_FEATURE([with],[ping-command])
 dnl ACX_FEATURE([with],[qstat-command])