diff options
-rw-r--r-- | configure.in | 69 |
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 @@ | |||
1 | dnl Process this file with autoconf to produce a configure script. | 1 | dnl Process this file with autoconf to produce a configure script. |
2 | include(`aclocal.m4') | 2 | include(`aclocal.m4') |
3 | include(`getloadavg.m4') | ||
3 | AC_REVISION ($Revision$) | 4 | AC_REVISION ($Revision$) |
4 | AC_INIT(Helper.pm) | 5 | AC_INIT(Helper.pm) |
5 | PACKAGE_VERSION="1.3.0" | 6 | PACKAGE_VERSION="1.3.0" |
@@ -35,14 +36,14 @@ AC_SUBST(WARRANTY) | |||
35 | SUPPORT="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" | 36 | SUPPORT="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" |
36 | AC_SUBST(SUPPORT) | 37 | AC_SUBST(SUPPORT) |
37 | 38 | ||
38 | AC_ARG_PROGRAM | 39 | dnl AC_ARG_PROGRAM |
39 | 40 | ||
40 | dnl 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 | dnl 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 | ||
42 | dnl CGIURL has changed for Nagios with 1.0 beta | 43 | dnl CGIURL has changed for Nagios with 1.0 beta |
43 | AC_ARG_WITH(cgiurl,--with-cgiurl=<dir> sets URL for cgi programs,cgiurl=$withval,cgiurl=/nagios/cgi-bin) | 44 | AC_ARG_WITH(cgiurl,--with-cgiurl=<dir> sets URL for cgi programs,cgiurl=$withval,cgiurl=/nagios/cgi-bin) |
44 | CGIURL="$cgiurl" | 45 | CGIURL="$cgiurl" |
45 | AC_DEFINE_UNQUOTED(CGIURL,"$CGIURL") | 46 | AC_DEFINE_UNQUOTED(CGIURL,"$CGIURL",[URL of CGI programs]) |
46 | 47 | ||
47 | AC_ARG_WITH(nagios_user,--with-nagios-user=<user> sets user name to run nagios,nagios_usr=$withval,nagios_usr=nagios) | 48 | AC_ARG_WITH(nagios_user,--with-nagios-user=<user> sets user name to run nagios,nagios_usr=$withval,nagios_usr=nagios) |
48 | AC_ARG_WITH(nagios_group,--with-nagios-group=<group> sets group name to run nagios,nagios_grp=$withval,nagios_grp=nagios) | 49 | AC_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 | |||
76 | dnl Checks for libraries. | 77 | dnl Checks for libraries. |
77 | dnl | 78 | dnl |
78 | 79 | ||
79 | AC_FUNC_GETLOADAVG | 80 | AC_FUNC_GETLOADAVG(plugins) |
80 | 81 | ||
81 | AC_CHECK_LIB(dce,main,SOCKETLIBS="$SOCKETLIBS -ldce") | 82 | AC_CHECK_LIB(dce,main,SOCKETLIBS="$SOCKETLIBS -ldce") |
82 | AC_CHECK_LIB(nsl,main,SOCKETLIBS="$SOCKETLIBS -lnsl") | 83 | AC_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 |
252 | fi | 253 | fi |
@@ -268,6 +269,8 @@ AC_TYPE_PID_T | |||
268 | AC_TYPE_SIZE_T | 269 | AC_TYPE_SIZE_T |
269 | AC_TYPE_SIGNAL | 270 | AC_TYPE_SIGNAL |
270 | 271 | ||
272 | dnl AC_CHECK_MEMBER(struct timeb.millitm,[AC_DEFINE(HAVE_STRUCT_TIMEB_MILLITM)],,[#include <sys/timeb.h>]) | ||
273 | |||
271 | dnl EXTRA_LIBRARIES="libgetopt.a libsnprintf.a" | 274 | dnl EXTRA_LIBRARIES="libgetopt.a libsnprintf.a" |
272 | dnl noinst_LIBRARIES="libgetopt.a libsnprintf.a" | 275 | dnl noinst_LIBRARIES="libgetopt.a libsnprintf.a" |
273 | dnl libgetopt_a_SOURCES="getopt.c getopt1.c" | 276 | dnl libgetopt_a_SOURCES="getopt.c getopt1.c" |
@@ -278,35 +281,43 @@ dnl AC_SUBST(libgetopt_a_SOURCES) | |||
278 | dnl AC_SUBST(libgetopt_a_DEPENDENCIES) | 281 | dnl AC_SUBST(libgetopt_a_DEPENDENCIES) |
279 | dnl AC_SUBST(libsnprintf_a_SOURCES) | 282 | dnl AC_SUBST(libsnprintf_a_SOURCES) |
280 | 283 | ||
284 | dnl We used to not do long options unless a compatible lib was found | ||
285 | dnl Now we provide code and make libgetopt if native is not suitable | ||
281 | AC_MSG_CHECKING(for getopt_long) | 286 | AC_MSG_CHECKING(for getopt_long) |
282 | AC_TRY_COMPILE([#include <getopt.h> | 287 | AC_TRY_COMPILE([#include <getopt.h> |
283 | #include <stdlib.h>], | 288 | #include <stdlib.h>], |
284 | [int option_index=0; | 289 | [int option_index=0; |
285 | static struct option *long_options; | 290 | static struct option *long_options; |
286 | getopt_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 | ||
290 | AC_CHECK_FUNCS(getopt_long_only,,LIBS="$LIBS -lgetopt" DEPLIBS="$DEPLIBS libgetopt.a") | 300 | AC_CHECK_FUNCS(getopt_long_only,,LIBS="$LIBS -lgetopt" DEPLIBS="$DEPLIBS libgetopt.a") |
291 | 301 | ||
292 | AC_CHECK_FUNC(vsnprintf,,LIBS="$LIBS -lsnprintf" DEPLIBS="$DEPLIBS libsnprintf.a") | 302 | AC_CHECK_FUNC(asprintf,,LIBS="$LIBS -lsnprintf" DEPLIBS="$DEPLIBS libsnprintf.a") |
293 | 303 | ||
294 | dnl Checks for library functions. | 304 | dnl Checks for library functions. |
295 | AC_CHECK_FUNCS(select socket strdup strstr strtod strtol strtoul) | 305 | AC_CHECK_FUNCS(select socket strdup strstr strtod strtol strtoul gettimeofday) |
296 | 306 | ||
297 | AC_MSG_CHECKING(for type of socket size) | 307 | AC_MSG_CHECKING(for type of socket size) |
298 | AC_TRY_COMPILE([#include <stdlib.h> | 308 | AC_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 | ||
306 | if test -f "/proc/loadavg" | 317 | if test -f "/proc/loadavg" |
307 | then | 318 | then |
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]) |
310 | fi | 321 | fi |
311 | 322 | ||
312 | AC_PATH_PROG(PATH_TO_PS,ps) | 323 | AC_PATH_PROG(PATH_TO_PS,ps) |
@@ -760,35 +771,35 @@ then | |||
760 | elif [swap -l 2>&1 | egrep -i "swapfile" >/dev/null] | 771 | elif [swap -l 2>&1 | egrep -i "swapfile" >/dev/null] |
761 | then | 772 | then |
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" |
776 | elif [swapinfo -k 2>&1 | egrep -i "Device" >/dev/null] | 787 | elif [swapinfo -k 2>&1 | egrep -i "Device" >/dev/null] |
777 | then | 788 | then |
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" |
788 | fi | 799 | fi |
789 | 800 | ||
790 | AC_PATH_PROG(PATH_TO_DIG,dig) | 801 | AC_PATH_PROG(PATH_TO_DIG,dig) |
791 | AC_DEFINE_UNQUOTED(PATH_TO_DIG,"$PATH_TO_DIG") | 802 | AC_DEFINE_UNQUOTED(PATH_TO_DIG,"$PATH_TO_DIG",[Path to dig command, if present]) |
792 | if test -n "$PATH_TO_DIG"; then | 803 | if test -n "$PATH_TO_DIG"; then |
793 | EXTRAS="$EXTRAS check_dig" | 804 | EXTRAS="$EXTRAS check_dig" |
794 | fi | 805 | fi |
@@ -816,6 +827,6 @@ AC_TRY_COMPILE([#ifdef __STDC__ | |||
816 | AC_SUBST(EXTRAS) | 827 | AC_SUBST(EXTRAS) |
817 | AC_SUBST(DEPLIBS) | 828 | AC_SUBST(DEPLIBS) |
818 | 829 | ||
819 | AC_DEFINE_UNQUOTED(PACKAGE_VERSION,"${VERSION}") | 830 | AC_DEFINE_UNQUOTED(PACKAGE_VERSION,"${VERSION}",[package version]) |
820 | 831 | ||
821 | AC_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) | 832 | AC_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) |