summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--configure.in69
1 files changed, 40 insertions, 29 deletions
diff --git a/configure.in b/configure.in
index 2341b25..ca890f7 100644
--- a/configure.in
+++ b/configure.in
@@ -1,5 +1,6 @@
1dnl Process this file with autoconf to produce a configure script. 1dnl Process this file with autoconf to produce a configure script.
2include(`aclocal.m4') 2include(`aclocal.m4')
3include(`getloadavg.m4')
3AC_REVISION ($Revision$) 4AC_REVISION ($Revision$)
4AC_INIT(Helper.pm) 5AC_INIT(Helper.pm)
5PACKAGE_VERSION="1.3.0" 6PACKAGE_VERSION="1.3.0"
@@ -35,14 +36,14 @@ AC_SUBST(WARRANTY)
35SUPPORT="Send email to nagios-users@lists.sourceforge.net if you have questions\nregarding use of this software. To submit patches or suggest improvements,\nsend email to nagiosplug-devel@lists.sourceforge.net\n" 36SUPPORT="Send email to nagios-users@lists.sourceforge.net if you have questions\nregarding use of this software. To submit patches or suggest improvements,\nsend email to nagiosplug-devel@lists.sourceforge.net\n"
36AC_SUBST(SUPPORT) 37AC_SUBST(SUPPORT)
37 38
38AC_ARG_PROGRAM 39dnl AC_ARG_PROGRAM
39 40
40dnl AC_ARG_WITH(nonposix_state_defs,--with-nonposix-state-defs uses POSIXLY incorrect states for netsaint < 0.0.7b2,,AC_DEFINE(POSIX_STATE_DEFS)) 41dnl AC_ARG_WITH(nonposix_state_defs,--with-nonposix-state-defs uses POSIXLY incorrect states for netsaint < 0.0.7b2,,AC_DEFINE(POSIX_STATE_DEFS))
41 42
42dnl CGIURL has changed for Nagios with 1.0 beta 43dnl CGIURL has changed for Nagios with 1.0 beta
43AC_ARG_WITH(cgiurl,--with-cgiurl=<dir> sets URL for cgi programs,cgiurl=$withval,cgiurl=/nagios/cgi-bin) 44AC_ARG_WITH(cgiurl,--with-cgiurl=<dir> sets URL for cgi programs,cgiurl=$withval,cgiurl=/nagios/cgi-bin)
44CGIURL="$cgiurl" 45CGIURL="$cgiurl"
45AC_DEFINE_UNQUOTED(CGIURL,"$CGIURL") 46AC_DEFINE_UNQUOTED(CGIURL,"$CGIURL",[URL of CGI programs])
46 47
47AC_ARG_WITH(nagios_user,--with-nagios-user=<user> sets user name to run nagios,nagios_usr=$withval,nagios_usr=nagios) 48AC_ARG_WITH(nagios_user,--with-nagios-user=<user> sets user name to run nagios,nagios_usr=$withval,nagios_usr=nagios)
48AC_ARG_WITH(nagios_group,--with-nagios-group=<group> sets group name to run nagios,nagios_grp=$withval,nagios_grp=nagios) 49AC_ARG_WITH(nagios_group,--with-nagios-group=<group> sets group name to run nagios,nagios_grp=$withval,nagios_grp=nagios)
@@ -76,7 +77,7 @@ dnl
76dnl Checks for libraries. 77dnl Checks for libraries.
77dnl 78dnl
78 79
79AC_FUNC_GETLOADAVG 80AC_FUNC_GETLOADAVG(plugins)
80 81
81AC_CHECK_LIB(dce,main,SOCKETLIBS="$SOCKETLIBS -ldce") 82AC_CHECK_LIB(dce,main,SOCKETLIBS="$SOCKETLIBS -ldce")
82AC_CHECK_LIB(nsl,main,SOCKETLIBS="$SOCKETLIBS -lnsl") 83AC_CHECK_LIB(nsl,main,SOCKETLIBS="$SOCKETLIBS -lnsl")
@@ -246,7 +247,7 @@ if test "$ac_cv_lib_crypto_CRYPTO_lock" = "yes"; then
246 if test "$ac_cv_lib_ssl_main" = "yes"; then 247 if test "$ac_cv_lib_ssl_main" = "yes"; then
247 if test "$FOUNDINCLUDE" = "yes"; then 248 if test "$FOUNDINCLUDE" = "yes"; then
248 AC_SUBST(SSLLIBS) 249 AC_SUBST(SSLLIBS)
249 AC_DEFINE(HAVE_SSL) 250 AC_DEFINE(HAVE_SSL,1,[Define if SSL libraries are found])
250 fi 251 fi
251 fi 252 fi
252fi 253fi
@@ -268,6 +269,8 @@ AC_TYPE_PID_T
268AC_TYPE_SIZE_T 269AC_TYPE_SIZE_T
269AC_TYPE_SIGNAL 270AC_TYPE_SIGNAL
270 271
272dnl AC_CHECK_MEMBER(struct timeb.millitm,[AC_DEFINE(HAVE_STRUCT_TIMEB_MILLITM)],,[#include <sys/timeb.h>])
273
271dnl EXTRA_LIBRARIES="libgetopt.a libsnprintf.a" 274dnl EXTRA_LIBRARIES="libgetopt.a libsnprintf.a"
272dnl noinst_LIBRARIES="libgetopt.a libsnprintf.a" 275dnl noinst_LIBRARIES="libgetopt.a libsnprintf.a"
273dnl libgetopt_a_SOURCES="getopt.c getopt1.c" 276dnl libgetopt_a_SOURCES="getopt.c getopt1.c"
@@ -278,35 +281,43 @@ dnl AC_SUBST(libgetopt_a_SOURCES)
278dnl AC_SUBST(libgetopt_a_DEPENDENCIES) 281dnl AC_SUBST(libgetopt_a_DEPENDENCIES)
279dnl AC_SUBST(libsnprintf_a_SOURCES) 282dnl AC_SUBST(libsnprintf_a_SOURCES)
280 283
284dnl We used to not do long options unless a compatible lib was found
285dnl Now we provide code and make libgetopt if native is not suitable
281AC_MSG_CHECKING(for getopt_long) 286AC_MSG_CHECKING(for getopt_long)
282AC_TRY_COMPILE([#include <getopt.h> 287AC_TRY_COMPILE([#include <getopt.h>
283#include <stdlib.h>], 288 #include <stdlib.h>],
284[int option_index=0; 289 [int option_index=0;
285static struct option *long_options; 290 static struct option *long_options;
286getopt_long(0,NULL,"+h",long_options,&option_index);], 291 getopt_long(0,NULL,"+h",long_options,&option_index);],
287[AC_DEFINE(HAVE_GETOPT_H) AC_DEFINE(HAVE_GETOPT_LONG) AC_MSG_RESULT(yes)], 292 [AC_DEFINE(HAVE_GETOPT_H,1,[Define if getopt headers are found])
288[AC_DEFINE(HAVE_GETOPT_H) AC_DEFINE(HAVE_GETOPT_LONG) AC_MSG_RESULT(no) import_sources=getopt]) 293 AC_DEFINE(HAVE_GETOPT_LONG,1,[Define if getopt_long_only() is found])
294 AC_MSG_RESULT(yes)],
295 [AC_DEFINE(HAVE_GETOPT_H,1,[Define if getopt headers are found])
296 AC_DEFINE(HAVE_GETOPT_LONG,1,[Define if getopt_long_only() is found])
297 AC_MSG_RESULT(no)
298 import_sources=getopt])
289 299
290AC_CHECK_FUNCS(getopt_long_only,,LIBS="$LIBS -lgetopt" DEPLIBS="$DEPLIBS libgetopt.a") 300AC_CHECK_FUNCS(getopt_long_only,,LIBS="$LIBS -lgetopt" DEPLIBS="$DEPLIBS libgetopt.a")
291 301
292AC_CHECK_FUNC(vsnprintf,,LIBS="$LIBS -lsnprintf" DEPLIBS="$DEPLIBS libsnprintf.a") 302AC_CHECK_FUNC(asprintf,,LIBS="$LIBS -lsnprintf" DEPLIBS="$DEPLIBS libsnprintf.a")
293 303
294dnl Checks for library functions. 304dnl Checks for library functions.
295AC_CHECK_FUNCS(select socket strdup strstr strtod strtol strtoul) 305AC_CHECK_FUNCS(select socket strdup strstr strtod strtol strtoul gettimeofday)
296 306
297AC_MSG_CHECKING(for type of socket size) 307AC_MSG_CHECKING(for type of socket size)
298AC_TRY_COMPILE([#include <stdlib.h> 308AC_TRY_COMPILE([#include <stdlib.h>
299#include <sys/types.h> 309 #include <sys/types.h>
300#include <sys/socket.h> 310 #include <sys/socket.h>],
301], 311 [int a = send(1, (const void *) buffer, (size_t *) 0, (int *) 0);],
302[int a = send(1, (const void *) buffer, (size_t *) 0, (int *) 0);], 312 [AC_DEFINE(SOCKET_SIZE_TYPE, size_t, [Define type of socket size])
303[AC_DEFINE(SOCKET_SIZE_TYPE, size_t) AC_MSG_RESULT(size_t)], 313 AC_MSG_RESULT(size_t)],
304[AC_DEFINE(SOCKET_SIZE_TYPE, int) AC_MSG_RESULT(int)]) 314 [AC_DEFINE(SOCKET_SIZE_TYPE, int, [Define type of socket size])
315 AC_MSG_RESULT(int)])
305 316
306if test -f "/proc/loadavg" 317if test -f "/proc/loadavg"
307then 318then
308 AC_DEFINE(HAVE_PROC_LOADAVG) 319 AC_DEFINE(HAVE_PROC_LOADAVG,1,[Define if /proc/loadavg or similar exists])
309 AC_DEFINE_UNQUOTED(PROC_LOADAVG,"/proc/loadavg") 320 AC_DEFINE_UNQUOTED(PROC_LOADAVG,"/proc/loadavg"[Location of /proc/loadavg])
310fi 321fi
311 322
312AC_PATH_PROG(PATH_TO_PS,ps) 323AC_PATH_PROG(PATH_TO_PS,ps)
@@ -760,35 +771,35 @@ then
760elif [swap -l 2>&1 | egrep -i "swapfile" >/dev/null] 771elif [swap -l 2>&1 | egrep -i "swapfile" >/dev/null]
761then 772then
762 echo "found swap command" 773 echo "found swap command"
763 AC_DEFINE(HAVE_SWAP) 774 AC_DEFINE(HAVE_SWAP,1,[Define if swap/swapinfo command is found])
764 AC_PATH_PROG(PATH_TO_SWAP,swap) 775 AC_PATH_PROG(PATH_TO_SWAP,swap)
765 AC_DEFINE_UNQUOTED(SWAP_COMMAND,"$PATH_TO_SWAP -l") 776 AC_DEFINE_UNQUOTED(SWAP_COMMAND,"$PATH_TO_SWAP -l"[Path to swap/swapinfo binary, with any args])
766 if [swap -l 2>/dev/null | egrep -i "^lswap +path +pri +swaplo +blocks +free +maxswap" >/dev/null] 777 if [swap -l 2>/dev/null | egrep -i "^lswap +path +pri +swaplo +blocks +free +maxswap" >/dev/null]
767 then 778 then
768 AC_DEFINE_UNQUOTED(SWAP_FORMAT,[" %*d %*s %*d,%*d %*d %*d %d %d"]) 779 AC_DEFINE_UNQUOTED(SWAP_FORMAT,[" %*d %*s %*d,%*d %*d %*d %d %d"],[Format string for parsing swap output])
769 echo " using IRIX format" 780 echo " using IRIX format"
770 elif [swap -l 2>/dev/null | egrep -i "^swapfile +dev +swaplo +blocks +free" >/dev/null] 781 elif [swap -l 2>/dev/null | egrep -i "^swapfile +dev +swaplo +blocks +free" >/dev/null]
771 then 782 then
772 AC_DEFINE_UNQUOTED(SWAP_FORMAT,["%*s %*[[0-9,-]] %*d %d %d"]) 783 AC_DEFINE_UNQUOTED(SWAP_FORMAT,["%*s %*[[0-9,-]] %*d %d %d"],[Format string for parsing swap output])
773 echo " using Solaris format" 784 echo " using Solaris format"
774 fi 785 fi
775 EXTRAS="$EXTRAS check_swap" 786 EXTRAS="$EXTRAS check_swap"
776elif [swapinfo -k 2>&1 | egrep -i "Device" >/dev/null] 787elif [swapinfo -k 2>&1 | egrep -i "Device" >/dev/null]
777then 788then
778 echo "found swapinfo command" 789 echo "found swapinfo command"
779 AC_DEFINE(HAVE_SWAP) 790 AC_DEFINE(HAVE_SWAP,1,[Define if swap/swapinfo command is found])
780 AC_PATH_PROG(PATH_TO_SWAP,swapinfo) 791 AC_PATH_PROG(PATH_TO_SWAP,swapinfo)
781 AC_DEFINE_UNQUOTED(SWAP_COMMAND,"$PATH_TO_SWAP -k") 792 AC_DEFINE_UNQUOTED(SWAP_COMMAND,"$PATH_TO_SWAP -k",[Path to swap/swapinfo binary, with any args])
782 if [swapinfo -k 2>/dev/null | egrep -i "^Device +1K-blocks +Used +Avail" >/dev/null] 793 if [swapinfo -k 2>/dev/null | egrep -i "^Device +1K-blocks +Used +Avail" >/dev/null]
783 then 794 then
784 AC_DEFINE_UNQUOTED(SWAP_FORMAT,["%*s %d %*d %d"]) 795 AC_DEFINE_UNQUOTED(SWAP_FORMAT,["%*s %d %*d %d"],[Format string for parsing swap output])
785 echo " using FreeBSD format" 796 echo " using FreeBSD format"
786 fi 797 fi
787 EXTRAS="$EXTRAS check_swap" 798 EXTRAS="$EXTRAS check_swap"
788fi 799fi
789 800
790AC_PATH_PROG(PATH_TO_DIG,dig) 801AC_PATH_PROG(PATH_TO_DIG,dig)
791AC_DEFINE_UNQUOTED(PATH_TO_DIG,"$PATH_TO_DIG") 802AC_DEFINE_UNQUOTED(PATH_TO_DIG,"$PATH_TO_DIG",[Path to dig command, if present])
792if test -n "$PATH_TO_DIG"; then 803if test -n "$PATH_TO_DIG"; then
793 EXTRAS="$EXTRAS check_dig" 804 EXTRAS="$EXTRAS check_dig"
794fi 805fi
@@ -816,6 +827,6 @@ AC_TRY_COMPILE([#ifdef __STDC__
816AC_SUBST(EXTRAS) 827AC_SUBST(EXTRAS)
817AC_SUBST(DEPLIBS) 828AC_SUBST(DEPLIBS)
818 829
819AC_DEFINE_UNQUOTED(PACKAGE_VERSION,"${VERSION}") 830AC_DEFINE_UNQUOTED(PACKAGE_VERSION,"${VERSION}",[package version])
820 831
821AC_OUTPUT(Makefile subst plugins/Makefile plugins-scripts/Makefile plugins-scripts/subst plugins-scripts/utils.pm plugins-scripts/utils.sh command.cfg test.pl,echo timestamp > plugins/stamp-h1;echo timestamp > plugins/stamp-h2;echo timestamp > plugins/stamp-h3;echo timestamp > plugins/stamp-h4;echo timestamp > plugins/stamp-h5;echo timestamp > plugins/stamp-h6;PATH=.:..:$PATH subst.sh command.cfg) 832AC_OUTPUT(Makefile subst plugins/Makefile plugins-scripts/Makefile plugins-scripts/subst plugins-scripts/utils.pm plugins-scripts/utils.sh command.cfg test.pl,echo timestamp > plugins/stamp-h1;echo timestamp > plugins/stamp-h2;echo timestamp > plugins/stamp-h3;echo timestamp > plugins/stamp-h4;echo timestamp > plugins/stamp-h5;echo timestamp > plugins/stamp-h6;PATH=.:..:$PATH subst.sh command.cfg)