Code

check_snmp now only prints perfdata for non numeric values (Joerg Linge #1867716)
[nagiosplug.git] / configure.in
index 341add80f8e8c00cd57ded1736040d9c1c250535..afde8374028730e9dc76172bbfae12eddc42b43c 100644 (file)
@@ -1,7 +1,7 @@
 dnl Process this file with autoconf to produce a configure script.
 AC_REVISION ($Revision$)
 AC_PREREQ(2.59)
-AC_INIT(nagios-plugins,1.4.11)
+AC_INIT(nagios-plugins,1.4.12)
 AC_CONFIG_SRCDIR(NPTest.pm)
 AC_CONFIG_FILES(gl/Makefile)
 AC_CONFIG_AUX_DIR(build-aux)
@@ -154,11 +154,18 @@ AC_CHECK_HEADERS(math.h)
 AC_CHECK_LIB(m,floor,MATHLIBS="-lm")
 AC_SUBST(MATHLIBS)
 
-dnl Check for libtap, to run perl-like tests
-AC_CHECK_LIB(tap, plan_tests, 
-       EXTRA_TEST="test_utils test_disk test_tcp test_cmd test_base64"
+dnl INI Parsing
+AC_ARG_ENABLE(extra-opts,
+  AC_HELP_STRING([--enable-extra-opts], 
+               [Enables parsing of plugins ini config files for extra options (default: no)]),
+       [enable_extra_opts=$enableval],
+       [enable_extra_opts=no])
+AM_CONDITIONAL([USE_PARSE_INI],[test "$enable_extra_opts" = "yes"])
+if test "$enable_extra_opts" = "yes" ; then
+       EXTRA_TEST="$EXTRA_TEST test_ini test_opts"
        AC_SUBST(EXTRA_TEST)
-       )
+       AC_DEFINE(NP_EXTRA_OPTS,[1],[Enable INI file parsing.])
+fi
 
 dnl Check for PostgreSQL libraries
 _SAVEDLIBS="$LIBS"
@@ -168,7 +175,7 @@ AC_ARG_WITH(pgsql,
                [sets path to pgsql installation]),
        PGSQL=$withval,)
 AC_CHECK_LIB(crypt,main)
-if test "$ac_cv_lib_crypt_main" = "yes"; then
+if test "$ac_cv_lib_crypt_main" = "yes" -a "x$PGSQL" != "xno"; then
   if test -n "$PGSQL"; then
     LDFLAGS="$LDFLAGS -L$PGSQL/lib"
     CPPFLAGS="$CPPFLAGS -I$PGSQL/include"
@@ -324,6 +331,14 @@ if test "$FOUNDINCLUDE" = "no"; then
   CPPFLAGS="$_SAVEDCPPFLAGS"
 fi
 
+dnl *** The following block comes from wget configure.ac ***
+dnl Unfortunately, as of this writing (OpenSSL 0.9.6), the libcrypto
+dnl shared library doesn't record its dependency on libdl, so we
+dnl need to check for it ourselves so we won't fail to link due to a
+dnl lack of -ldl.  Most OSes use dlopen(), but HP-UX uses
+dnl shl_load().
+AC_CHECK_LIB(dl,dlopen)
+AC_CHECK_LIB(dl,shl_load)
 
 dnl openssl detection/configuration
 if ! test x"$with_openssl" = x"no"; then
@@ -435,6 +450,7 @@ AC_STRUCT_TM
 AC_TYPE_PID_T
 AC_TYPE_SIZE_T
 AC_TYPE_SIGNAL
+AC_TYPE_MBSTATE_T
 
 AC_CACHE_CHECK([for va_copy],ac_cv_HAVE_VA_COPY,[
 AC_TRY_LINK([#include <stdarg.h>
@@ -512,16 +528,49 @@ if test -n "$PS_COMMAND" && test -n "$PS_FORMAT" && test -n "$PS_COLS" && test -
        ac_cv_ps_cols="$PS_COLS"
        AC_MSG_RESULT([(command-line) $ac_cv_ps_command])
 
+dnl Now using the pst3/kmem hack for solaris systems to avoid truncation
+elif test "$ac_cv_uname_s" = "SunOS"; then
+        #
+        # this is a very, very ugly hack, to hardcode the location for plugins
+        #
+        if test "$libexecdir" = '${exec_prefix}/libexec'; then
+                if test "$exec_prefix" = "NONE"; then
+                        if test "$prefix" = "NONE"; then
+                                pst3="$ac_default_prefix/libexec/pst3"
+                        else
+                                pst3="$prefix/libexec/pst3"
+                        fi
+                else
+                        pst3="$exec_prefix/libexec/pst3"
+                fi
+        else
+                pst3="$libexecdir/pst3"
+        fi
+        ac_cv_ps_command="$pst3"
+        ac_cv_ps_format="%s %d %d %d %d %d %f %s %n"
+        ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
+        ac_cv_ps_cols=9
+        AC_MSG_RESULT([using nagios-plugins internal ps command (pst3) for solaris])
+       if test `isainfo -b` = 64 ; then
+               PST3CFLAGS="-m64"
+               AC_SUBST(PST3CFLAGS)
+               AC_MSG_NOTICE([using 64bit pst3])       
+       else
+               AC_MSG_NOTICE([using 32bit pst3])
+       fi
+        EXTRAS_ROOT="$EXTRAS_ROOT pst3"
+
+dnl Removing this for the moment - Ton
 dnl Using /usr/ucb/ps on Solaris systems, to avoid truncation
 dnl Limitation that command name is not available
-elif test "$ac_cv_uname_s" = "SunOS" && /usr/ucb/ps -alxwwn 2>/dev/null | \
-       egrep -i ["^ *F +UID +PID +PPID +%C +PRI +NI +SZ +RSS +WCHAN +S +TT +TIME +COMMAND"] > /dev/null
-then
-       ac_cv_ps_varlist="[&procuid,&procpid,&procppid,&procpcpu,&procvsz,&procrss,procstat,&pos]"
-       ac_cv_ps_command="/usr/ucb/ps -alxwwn"
-       ac_cv_ps_format=["%*s %d %d %d %d %*d %*d %d %d%*[ 0123456789abcdef]%[OSRZT]%*s %*s %n"]
-       ac_cv_ps_cols=8
-       AC_MSG_RESULT([$ac_cv_ps_command])
+dnl elif test "$ac_cv_uname_s" = "SunOS" && /usr/ucb/ps -alxwwn 2>/dev/null | \
+dnl    egrep -i ["^ *F +UID +PID +PPID +%C +PRI +NI +SZ +RSS +WCHAN +S +TT +TIME +COMMAND"] > /dev/null
+dnl then
+dnl    ac_cv_ps_varlist="[&procuid,&procpid,&procppid,&procpcpu,&procvsz,&procrss,procstat,&pos]"
+dnl    ac_cv_ps_command="/usr/ucb/ps -alxwwn"
+dnl    ac_cv_ps_format=["%*s %d %d %d %d %*d %*d %d %d%*[ 0123456789abcdef]%[OSRZT]%*s %*s %n"]
+dnl    ac_cv_ps_cols=8
+dnl    AC_MSG_RESULT([$ac_cv_ps_command])
 
 dnl Some gnu/linux systems (debian for one) don't like -axwo and need axwo.
 dnl so test for this first...
@@ -1476,9 +1525,9 @@ case $host in
                AC_DEFINE(__bsd__,1,[bsd specific code in check_dhcp.c])
        ;;
        *linux*)
-               AC_DEFINE(__linux__,1,[sun specific code in check_dhcp.c])
+               AC_DEFINE(__linux__,1,[linux specific code in check_dhcp.c])
        ;;
-       *sun* | solaris*)
+       *sun* | *solaris*)
                AC_DEFINE(__sun__,1,[sun specific code in check_dhcp.c])
        ;;
        *hpux*)  
@@ -1536,10 +1585,25 @@ dnl External libraries - see ACKNOWLEDGEMENTS
 gl_INIT
 
 dnl Some helpful common compile errors checked here
-if test "$ac_cv_uname_s" = 'SunOS' -a "$ac_cv_prog_ac_ct_AR" = 'false' ; then
+if test "$ac_cv_uname_s" = 'SunOS' -a \( "x$ac_cv_prog_ac_ct_AR" = "x" -o "$ac_cv_prog_ac_ct_AR" = 'false' \) ; then
        AC_MSG_ERROR(No ar found for Solaris - is /usr/ccs/bin in PATH?)
 fi
 
+AC_ARG_ENABLE(libtap,
+  AC_HELP_STRING([--enable-libtap], 
+               [Enables configuring of libtap in external/tap/. Run "make tap" to compile (default: no)]),
+       [enable_libtap=$enableval],
+       [enable_libtap=no])
+dnl Have to define TAP_DIR so that Makefile can pull it as an extra dist
+TAP_DIR=external/tap-1.01
+AC_SUBST(TAP_DIR)
+if test "$enable_libtap" = yes; then
+       dnl Have to have AC_CONFIG_SUBDIRS as a literal
+       AC_CONFIG_SUBDIRS([external/tap-1.01])
+       EXTRA_TEST="test_utils test_disk test_tcp test_cmd test_base64"
+       AC_SUBST(EXTRA_TEST)
+fi
+
 AC_OUTPUT(
   Makefile 
   lib/Makefile 
@@ -1587,6 +1651,7 @@ ACX_FEATURE([with],[ipv6])
 ACX_FEATURE([with],[mysql])
 ACX_FEATURE([with],[openssl])
 ACX_FEATURE([with],[gnutls])
+ACX_FEATURE([enable],[extra-opts])
 ACX_FEATURE([with],[perl])
 ACX_FEATURE([enable],[perl-modules])
 ACX_FEATURE([with],[cgiurl])