summaryrefslogtreecommitdiffstats
path: root/configure.in
diff options
context:
space:
mode:
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in195
1 files changed, 6 insertions, 189 deletions
diff --git a/configure.in b/configure.in
index 356e4e3..228a841 100644
--- a/configure.in
+++ b/configure.in
@@ -1,10 +1,12 @@
1dnl Process this file with autoconf to produce a configure script. 1dnl Process this file with autoconf to produce a configure script.
2AC_REVISION ($Revision$) 2AC_REVISION ($Revision$)
3AC_PREREQ(2.58) 3AC_PREREQ(2.59)
4AC_INIT(nagios-plugins,1.4.5) 4AC_INIT(nagios-plugins,1.4.5)
5AC_CONFIG_SRCDIR(NPTest.pm) 5AC_CONFIG_SRCDIR(NPTest.pm)
6AC_CONFIG_FILES(gl/Makefile)
6AM_INIT_AUTOMAKE([1.8.3]) 7AM_INIT_AUTOMAKE([1.8.3])
7AM_CONFIG_HEADER(config.h) 8AM_CONFIG_HEADER(config.h)
9dnl Not yet - AC_CONFIG_AUX_DIR(build-aux)
8AC_CANONICAL_HOST 10AC_CANONICAL_HOST
9 11
10RELEASE=1 12RELEASE=1
@@ -22,11 +24,8 @@ dnl Figure out how to invoke "install" and what install options to use.
22AC_PROG_INSTALL 24AC_PROG_INSTALL
23AC_SUBST(INSTALL) 25AC_SUBST(INSTALL)
24 26
25dnl Must come very early on due to coreutils requirement
26dnl Takes care of AC_GNU_SOURCE, AC_AIX and AC_MINIX
27gl_USE_SYSTEM_EXTENSIONS
28
29AC_PROG_CC 27AC_PROG_CC
28gl_EARLY
30AC_PROG_CPP 29AC_PROG_CPP
31AC_PROG_GCC_TRADITIONAL 30AC_PROG_GCC_TRADITIONAL
32AC_PROG_LIBTOOL 31AC_PROG_LIBTOOL
@@ -38,9 +37,6 @@ AC_FUNC_MALLOC
38AC_FUNC_REALLOC 37AC_FUNC_REALLOC
39AC_FUNC_ERROR_AT_LINE 38AC_FUNC_ERROR_AT_LINE
40 39
41AC_CONFIG_LIBOBJ_DIR(lib)
42AC_FUNC_GETLOADAVG([lib])
43
44ifdef([AC_FUNC_STRTOD],[AC_FUNC_STRTOD],[AM_FUNC_STRTOD]) 40ifdef([AC_FUNC_STRTOD],[AC_FUNC_STRTOD],[AM_FUNC_STRTOD])
45 41
46PLUGIN_TEST=`echo $srcdir/plugins/t/*.t|sed -e 's,\.*/plugins/,,g'` 42PLUGIN_TEST=`echo $srcdir/plugins/t/*.t|sed -e 's,\.*/plugins/,,g'`
@@ -128,15 +124,6 @@ dnl the order should allow locally installed versions to override distros' ones
128OPENSSL_DIRS="/usr /usr/local /usr/slocal /usr/local/openssl /usr/local/ssl \ 124OPENSSL_DIRS="/usr /usr/local /usr/slocal /usr/local/openssl /usr/local/ssl \
129 /opt /opt/openssl" 125 /opt /opt/openssl"
130 126
131dnl
132dnl Check for miscellaneous stuff
133dnl
134
135case $host_vender-$host_os in
136osf*)
137 AC_DEFINE(_OSF_SOURCE,1,[OSF needs this for getaddrinfo])
138 ;;
139esac
140 127
141dnl 128dnl
142dnl Checks for libraries. 129dnl Checks for libraries.
@@ -297,108 +284,6 @@ if test x"$with_ipv6" != xno ; then
297 AC_DEFINE(USE_IPV6,1,[Enable IPv6 support]) 284 AC_DEFINE(USE_IPV6,1,[Enable IPv6 support])
298fi 285fi
299 286
300dnl #########################################################################
301dnl Check if Posix getaddrinfo() is available. It is also possible to use
302dnl the version from the lwres library distributed with BIND.
303dnl #########################################################################
304AC_ARG_ENABLE([emulate-getaddrinfo],
305 ACX_HELP_STRING([--enable-emulate-getaddrinfo],
306 [enable getaddrinfo emulation (default=no)]),
307 ,
308 enable_emulate_getaddrinfo=no)
309
310AC_ARG_WITH(lwres,
311 ACX_HELP_STRING([--with-lwres=DIR],
312 [use lwres library for getaddrinfo (default=no)]),
313 ,
314 with_lwres=no)
315
316dnl ## enable force to test getaddrinfo.c
317if test x$enable_emulate_getaddrinfo = xforce ; then
318 enable_emulate_getaddrinfo=yes
319 have_getaddrinfo=no
320else
321
322have_getaddrinfo=no
323if test x$with_lwres != xno ; then
324 if test "$with_lwres" != yes ; then
325 CPPFLAGS="-I${with_lwres}/include $CPPFLAGS"
326 LDFLAGS="-L${with_lwres}/lib $LDFLAGS"
327 fi
328 AC_CHECK_HEADERS(lwres/netdb.h, ,
329 [AC_MSG_ERROR([cannot find <lwres/netdb.h>])])
330 AC_CHECK_LIB(lwres, lwres_getaddrinfo, ,
331 [AC_MSG_ERROR([cannot find the lwres library])],
332 -lnsl -lpthread)
333 have_getaddrinfo=yes
334fi
335
336if test x$have_getaddrinfo != xyes ; then
337 AC_SEARCH_LIBS(getaddrinfo, socket resolv bind nsl c_r cr, have_getaddrinfo=yes)
338fi
339
340dnl # Special nonsense for systems that actually have getaddrinfo but
341dnl # redefine the name to something else, e.g. OSF
342if test x$have_getaddrinfo != xyes ; then
343 AC_MSG_CHECKING(if getaddrinfo is redefined in netdb.h)
344 AC_TRY_LINK([
345# include <netdb.h>
346 ], [
347 struct addrinfo hints, *res;
348 int err;
349
350 err = getaddrinfo ("host", "service", &hints, &res);
351 ], [
352 have_getaddrinfo=yes
353 AC_MSG_RESULT(yes)
354 ], [AC_MSG_RESULT(no)])
355fi
356
357fi
358
359if test x$have_getaddrinfo != xno ; then
360 if test x$enable_emulate_getaddrinfo != xno ; then
361 AC_MSG_ERROR([getaddrinfo found but emulate-getaddrinfo was enabled])
362 fi
363 AC_DEFINE(HAVE_GETADDRINFO, 1,
364 [Does system provide RFC 2553/Posix getaddrinfo?])
365else
366 if test x$enable_emulate_getaddrinfo != xyes ; then
367dnl AC_MSG_ERROR([getaddrinfo not found: try --with-lwres or --enable-emulate-getaddrinfo])
368 enable_emulate_getaddrinfo=yes
369 AC_MSG_WARN([enabling getaddrinfo emulation])
370 fi
371 EXTRA_NETOBJS="$EXTRA_NETOBJS getaddrinfo.o"
372fi
373
374if test x"$enable_emulate_getaddrinfo" != xno ; then
375 have_resolver=no
376
377 dnl Try for getipnodebyname
378 AC_SEARCH_LIBS(getipnodebyname, resolv bind nsl c_r cr, have_resolver=yes)
379 if test x"$have_resolver" != xno ; then
380 AC_DEFINE(HAVE_GETIPNODEBYNAME, 1,
381 [Set when getipnodebyname is available])
382 fi
383
384 dnl Try for gethostbyname_r
385 if test x"$have_resolver" = xno ; then
386 AC_SEARCH_LIBS(gethostbyname_r, resolv bind nsl c_r cr,
387 [have_resolver=yes
388 ACX_WHICH_GETHOSTBYNAME_R])
389 fi
390
391 dnl Try for gethostbyname
392 if test x"$have_resolver" = xno ; then
393 if test x"$enable_pthreads" != xno ; then
394 AC_MSG_WARN([using threads but cannot find gethostbyname_r or getipnodebyname])
395 fi
396 AC_SEARCH_LIBS(gethostbyname, resolv bind nsl, ,
397 [AC_MSG_ERROR([cannot find gethostbyname])])
398 fi
399 EXTRA_NETOBJS="$EXTRA_NETOBJS gethostbyname.o"
400
401fi
402 287
403dnl Checks for Kerberos. Must come before openssl checks for Redhat EL 3 288dnl Checks for Kerberos. Must come before openssl checks for Redhat EL 3
404AC_CHECK_HEADERS(krb5.h,FOUNDINCLUDE=yes,FOUNDINCLUDE=no) 289AC_CHECK_HEADERS(krb5.h,FOUNDINCLUDE=yes,FOUNDINCLUDE=no)
@@ -519,7 +404,7 @@ dnl
519AC_HEADER_STDC 404AC_HEADER_STDC
520AC_HEADER_TIME 405AC_HEADER_TIME
521AC_HEADER_SYS_WAIT 406AC_HEADER_SYS_WAIT
522AC_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) 407AC_CHECK_HEADERS(signal.h strings.h string.h syslog.h uio.h errno.h sys/types.h sys/time.h sys/socket.h sys/un.h sys/poll.h)
523AC_CHECK_HEADERS(features.h stdarg.h sys/unistd.h ctype.h stdlib.h) 408AC_CHECK_HEADERS(features.h stdarg.h sys/unistd.h ctype.h stdlib.h)
524 409
525dnl Checks for typedefs, structures, and compiler characteristics. 410dnl Checks for typedefs, structures, and compiler characteristics.
@@ -547,37 +432,6 @@ else
547 fi 432 fi
548fi 433fi
549 434
550AC_CHECK_FUNCS(vsnprintf snprintf asprintf vasprintf)
551AC_CACHE_CHECK([for C99 vsnprintf],ac_cv_HAVE_C99_VSNPRINTF,[
552AC_TRY_RUN([
553#include <sys/types.h>
554#include <stdarg.h>
555void foo(const char *format, ...) {
556 va_list ap;
557 int len;
558 char buf[5];
559
560 va_start(ap, format);
561 len = vsnprintf(buf, 0, format, ap);
562 va_end(ap);
563 if (len != 5) exit(1);
564
565 va_start(ap, format);
566 len = vsnprintf(0, 0, format, ap);
567 va_end(ap);
568 if (len != 5) exit(1);
569
570 if (snprintf(buf, 3, "hello") != 5 || strcmp(buf, "he") != 0) exit(1);
571
572 exit(0);
573}
574main() { foo("hello"); }
575],
576ac_cv_HAVE_C99_VSNPRINTF=yes,ac_cv_HAVE_C99_VSNPRINTF=no,ac_cv_HAVE_C99_VSNPRINTF=cross)])
577if test x"$ac_cv_HAVE_C99_VSNPRINTF" = x"yes"; then
578 AC_DEFINE(HAVE_C99_VSNPRINTF,1,[Define if system has C99 compatible vsnprintf])
579fi
580
581AC_TRY_COMPILE([#include <sys/time.h>], 435AC_TRY_COMPILE([#include <sys/time.h>],
582 [struct timeval *tv; 436 [struct timeval *tv;
583 struct timezone *tz;], 437 struct timezone *tz;],
@@ -606,24 +460,6 @@ AC_TRY_COMPILE([#include <stdlib.h>
606AC_DEFINE_UNQUOTED(SOCKET_SIZE_TYPE, $ac_cv_socket_size_type , 460AC_DEFINE_UNQUOTED(SOCKET_SIZE_TYPE, $ac_cv_socket_size_type ,
607 [Define type of socket size]) 461 [Define type of socket size])
608 462
609AC_ARG_WITH(proc-loadavg,
610 ACX_HELP_STRING([--with-proc-loadavg=PATH],
611 [path to /proc/loadavg or equivalent]),
612 ac_cv_proc_loadavg=$withval)
613AC_MSG_CHECKING([for /proc/loadavg])
614if test -n "$ac_cv_proc_loadavg"; then
615 AC_MSG_RESULT([(command line) $ac_cv_proc_loadavg])
616elif test -f "/proc/loadavg"; then
617 AC_MSG_RESULT([found /proc/loadavg])
618 ac_cv_proc_loadavg="/proc/loadavg"
619else
620 AC_MSG_RESULT([no])
621fi
622
623if test -n "$ac_cv_proc_loadavg"; then
624 AC_DEFINE(HAVE_PROC_LOADAVG,1,[Define if /proc/loadavg or similar exists])
625 AC_DEFINE_UNQUOTED(PROC_LOADAVG,"/proc/loadavg",[Location of /proc/loadavg])
626fi
627 463
628dnl #### Process table test 464dnl #### Process table test
629 465
@@ -1615,21 +1451,6 @@ elif test -f ../plugins/check_nt.c ; then
1615 EXTRAS="$EXTRAS check_nt" 1451 EXTRAS="$EXTRAS check_nt"
1616fi 1452fi
1617 1453
1618AC_MSG_CHECKING(for va_list)
1619AC_TRY_COMPILE([#ifdef __STDC__
1620 #include <stdio.h>
1621 #include <stdlib.h>
1622 #include <stdarg.h>
1623 #else
1624 #include <sys/types.h>
1625 #include <stdio.h>
1626 #include <varargs.h>
1627 #endif],
1628 [va_list args;],
1629 [AC_MSG_RESULT(yes)],
1630 [NEED_VA_LIST=-DNEED_VA_LIST
1631 AC_SUBST(NEED_VA_LIST)
1632 AC_MSG_RESULT(no)])
1633 1454
1634case $host in 1455case $host in
1635 *bsd*) 1456 *bsd*)
@@ -1682,8 +1503,7 @@ elif test "$ac_cv_enable_redhat_pthread_workaround" = "yes" ; then
1682fi 1503fi
1683 1504
1684dnl External libraries - see ACKNOWLEDGEMENTS 1505dnl External libraries - see ACKNOWLEDGEMENTS
1685np_COREUTILS 1506gl_INIT
1686np_CURL
1687 1507
1688dnl Some helpful common compile errors checked here 1508dnl Some helpful common compile errors checked here
1689if test "$ac_cv_uname_s" = 'SunOS' -a "$ac_cv_prog_ac_ct_AR" = 'false' ; then 1509if test "$ac_cv_uname_s" = 'SunOS' -a "$ac_cv_prog_ac_ct_AR" = 'false' ; then
@@ -1693,7 +1513,6 @@ fi
1693AC_OUTPUT( 1513AC_OUTPUT(
1694 Makefile 1514 Makefile
1695 lib/Makefile 1515 lib/Makefile
1696 m4/Makefile
1697 plugins/Makefile 1516 plugins/Makefile
1698 lib/tests/Makefile 1517 lib/tests/Makefile
1699 plugins-root/Makefile 1518 plugins-root/Makefile
@@ -1727,7 +1546,6 @@ dnl ACX_FEATURE([with],[snmpgetnext-command])
1727dnl ACX_FEATURE([with],[ssh-command]) 1546dnl ACX_FEATURE([with],[ssh-command])
1728dnl ACX_FEATURE([with],[uptime-command]) 1547dnl ACX_FEATURE([with],[uptime-command])
1729 1548
1730dnl ACX_FEATURE([with],[proc-loadavg])
1731dnl ACX_FEATURE([with],[proc-meminfo]) 1549dnl ACX_FEATURE([with],[proc-meminfo])
1732dnl ACX_FEATURE([with],[ps-command]) 1550dnl ACX_FEATURE([with],[ps-command])
1733dnl ACX_FEATURE([with],[ps-format]) 1551dnl ACX_FEATURE([with],[ps-format])
@@ -1739,7 +1557,6 @@ ACX_FEATURE([with],[ipv6])
1739ACX_FEATURE([with],[mysql]) 1557ACX_FEATURE([with],[mysql])
1740ACX_FEATURE([with],[openssl]) 1558ACX_FEATURE([with],[openssl])
1741ACX_FEATURE([with],[gnutls]) 1559ACX_FEATURE([with],[gnutls])
1742ACX_FEATURE([enable],[emulate-getaddrinfo])
1743ACX_FEATURE([with],[perl]) 1560ACX_FEATURE([with],[perl])
1744ACX_FEATURE([with],[cgiurl]) 1561ACX_FEATURE([with],[cgiurl])
1745ACX_FEATURE([with],[trusted-path]) 1562ACX_FEATURE([with],[trusted-path])