Code

Fix for tar on Solaris
[nagiosplug.git] / configure.in
index d0bd0efc6e7dfef6e5b16afd36e8cd5a83526e13..7687ae6ef9715dfa8165054ce45e932257696edd 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.13)
 AC_CONFIG_SRCDIR(NPTest.pm)
 AC_CONFIG_FILES(gl/Makefile)
 AC_CONFIG_AUX_DIR(build-aux)
@@ -154,11 +154,40 @@ 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, 
+dnl Add libtap for tests
+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])
+       dnl This is required so that TAP stuff is compiled before the libs and tests
+       dnl A make install will also install the tap library, but as this is a development tool, this should be okay
+       INCLUDE_TAP_DIR=$TAP_DIR
+       AC_SUBST(INCLUDE_TAP_DIR)
        EXTRA_TEST="test_utils test_disk test_tcp test_cmd test_base64"
        AC_SUBST(EXTRA_TEST)
-       )
+fi
+
+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
+       AC_DEFINE(NP_EXTRA_OPTS,[1],[Enable INI file parsing.])
+       if test "$enable_libtap" = yes; then
+               EXTRA_TEST="$EXTRA_TEST test_ini test_opts"
+               AC_SUBST(EXTRA_TEST)
+       fi
+fi
 
 dnl Check for PostgreSQL libraries
 _SAVEDLIBS="$LIBS"
@@ -168,7 +197,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 +353,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
@@ -1510,9 +1547,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*)  
@@ -1621,6 +1658,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])