summaryrefslogtreecommitdiffstats
path: root/configure.in
diff options
context:
space:
mode:
authorThomas Guyot-Sionnest <dermoth@aei.ca>2008-11-28 10:01:53 (GMT)
committerThomas Guyot-Sionnest <dermoth@aei.ca>2008-11-29 09:38:54 (GMT)
commit2bbf2e6967daa0a9f86874aac409fde245a3bc85 (patch)
tree7fc7a9e96f3bc0e1b6749cbd999c93a292e0d12b /configure.in
parent538b97cea63d68efbd9c9c67d9c41278cfd1ebad (diff)
downloadmonitoring-plugins-2bbf2e6967daa0a9f86874aac409fde245a3bc85.tar.gz
Add Libtap as a bundled library (does not change any behaviour without --enable-libtap)
Detects system library as pre-1.4.13 and does not install the built-in library anymore Tested on: - Linux x86_64, with and without local libtap (System libtap installed) - Linux x86, with and without local libtap (System libtap NOT installed) - Solaris SPARC, with and without local libtap, with and without system libtap installed
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in117
1 files changed, 74 insertions, 43 deletions
diff --git a/configure.in b/configure.in
index 39cd6b7..3ff0636 100644
--- a/configure.in
+++ b/configure.in
@@ -118,7 +118,7 @@ AC_SUBST(PERL, $with_perl)
118 118
119dnl openssl/gnutls 119dnl openssl/gnutls
120AC_ARG_WITH(openssl, 120AC_ARG_WITH(openssl,
121 AC_HELP_STRING([--with-openssl=DIR], 121 AC_HELP_STRING([--with-openssl=DIR],
122 [path to openssl installation]),) 122 [path to openssl installation]),)
123 123
124AC_ARG_WITH(gnutls, 124AC_ARG_WITH(gnutls,
@@ -156,23 +156,41 @@ AC_CHECK_HEADERS(math.h)
156AC_CHECK_LIB(m,floor,MATHLIBS="-lm") 156AC_CHECK_LIB(m,floor,MATHLIBS="-lm")
157AC_SUBST(MATHLIBS) 157AC_SUBST(MATHLIBS)
158 158
159dnl Check for libtap, to run perl-like tests 159dnl Check if we buils local libtap
160AC_CHECK_LIB(tap, plan_tests, 160AC_ARG_ENABLE(libtap,
161 AC_HELP_STRING([--enable-libtap],
162 [Enable built-in libtap for unit-testing (default: autodetect system library).]),
163 [enable_libtap=$enableval],
164 [enable_libtap=no])
165AM_CONDITIONAL([USE_LIBTAP_LOCAL],[test "$enable_libtap" = "yes"])
166
167# If not local, check if we can use the system one
168if test "$enable_libtap" != "yes" ; then
169 dnl Check for libtap, to run perl-like tests
170 AC_CHECK_LIB(tap, plan_tests,
171 enable_libtap="yes"
172 )
173fi
174
175# Finally, define tests if we use libtap
176if test "$enable_libtap" = "yes" ; then
161 EXTRA_TEST="test_utils test_disk test_tcp test_cmd test_base64" 177 EXTRA_TEST="test_utils test_disk test_tcp test_cmd test_base64"
162 AC_SUBST(EXTRA_TEST) 178 AC_SUBST(EXTRA_TEST)
163 ) 179fi
164 180
165dnl INI Parsing 181dnl INI Parsing
166AC_ARG_ENABLE(extra-opts, 182AC_ARG_ENABLE(extra-opts,
167 AC_HELP_STRING([--enable-extra-opts], 183 AC_HELP_STRING([--enable-extra-opts],
168 [Enables parsing of plugins ini config files for extra options (default: no)]), 184 [Enables parsing of plugins ini config files for extra options (default: no)]),
169 [enable_extra_opts=$enableval], 185 [enable_extra_opts=$enableval],
170 [enable_extra_opts=no]) 186 [enable_extra_opts=no])
171AM_CONDITIONAL([USE_PARSE_INI],[test "$enable_extra_opts" = "yes"]) 187AM_CONDITIONAL([USE_PARSE_INI],[test "$enable_extra_opts" = "yes"])
172if test "$enable_extra_opts" = "yes" ; then 188if test "$enable_extra_opts" = "yes" ; then
173 EXTRA_TEST="$EXTRA_TEST test_ini test_opts"
174 AC_SUBST(EXTRA_TEST)
175 AC_DEFINE(NP_EXTRA_OPTS,[1],[Enable INI file parsing.]) 189 AC_DEFINE(NP_EXTRA_OPTS,[1],[Enable INI file parsing.])
190 if test "$enable_libtap" = "yes"; then
191 EXTRA_TEST="$EXTRA_TEST test_ini test_opts"
192 AC_SUBST(EXTRA_TEST)
193 fi
176fi 194fi
177 195
178dnl Check for PostgreSQL libraries 196dnl Check for PostgreSQL libraries
@@ -272,8 +290,8 @@ fi
272if test "$FOUNDINCLUDE" = "yes" ; then 290if test "$FOUNDINCLUDE" = "yes" ; then
273 EXTRAS="$EXTRAS check_ide_smart" 291 EXTRAS="$EXTRAS check_ide_smart"
274else 292else
275 AC_MSG_WARN([Skipping check_ide_smart plugin.]) 293 AC_MSG_WARN([Skipping check_ide_smart plugin.])
276 AC_MSG_WARN([check_ide_smart is linux specific. It requires linux/hdreg.h and linux/types.h.]) 294 AC_MSG_WARN([check_ide_smart is linux specific. It requires linux/hdreg.h and linux/types.h.])
277fi 295fi
278 296
279dnl Check for mysql libraries 297dnl Check for mysql libraries
@@ -467,7 +485,7 @@ ac_cv_HAVE_VA_COPY=yes,
467ac_cv_HAVE_VA_COPY=no)]) 485ac_cv_HAVE_VA_COPY=no)])
468if test x"$ac_cv_HAVE_VA_COPY" = x"yes"; then 486if test x"$ac_cv_HAVE_VA_COPY" = x"yes"; then
469 AC_DEFINE(HAVE_VA_COPY,1,[Whether va_copy() is available]) 487 AC_DEFINE(HAVE_VA_COPY,1,[Whether va_copy() is available])
470else 488else
471 AC_CACHE_CHECK([for __va_copy],ac_cv_HAVE___VA_COPY,[ 489 AC_CACHE_CHECK([for __va_copy],ac_cv_HAVE___VA_COPY,[
472 AC_TRY_LINK([#include <stdarg.h> 490 AC_TRY_LINK([#include <stdarg.h>
473 va_list ap1,ap2;], [__va_copy(ap1,ap2);], 491 va_list ap1,ap2;], [__va_copy(ap1,ap2);],
@@ -513,7 +531,7 @@ AC_PATH_PROG(PATH_TO_PS,ps)
513 531
514AC_MSG_CHECKING(for ps syntax) 532AC_MSG_CHECKING(for ps syntax)
515AC_ARG_WITH(ps_command, 533AC_ARG_WITH(ps_command,
516 ACX_HELP_STRING([--with-ps-command=PATH], 534 ACX_HELP_STRING([--with-ps-command=PATH],
517 [Verbatim command to execute for ps]), 535 [Verbatim command to execute for ps]),
518 PS_COMMAND=$withval) 536 PS_COMMAND=$withval)
519AC_ARG_WITH(ps_format, 537AC_ARG_WITH(ps_format,
@@ -521,7 +539,7 @@ AC_ARG_WITH(ps_format,
521 [Format string for scanning ps output]), 539 [Format string for scanning ps output]),
522 PS_FORMAT=$withval) 540 PS_FORMAT=$withval)
523AC_ARG_WITH(ps_cols, 541AC_ARG_WITH(ps_cols,
524 ACX_HELP_STRING([--with-ps-cols=NUM], 542 ACX_HELP_STRING([--with-ps-cols=NUM],
525 [Number of columns in ps command]), 543 [Number of columns in ps command]),
526 PS_COLS=$withval) 544 PS_COLS=$withval)
527AC_ARG_WITH(ps_varlist, 545AC_ARG_WITH(ps_varlist,
@@ -529,7 +547,7 @@ AC_ARG_WITH(ps_varlist,
529 [Variable list for sscanf of 'ps' output]), 547 [Variable list for sscanf of 'ps' output]),
530 PS_VARLIST=$withval) 548 PS_VARLIST=$withval)
531 549
532if test -n "$PS_COMMAND" && test -n "$PS_FORMAT" && test -n "$PS_COLS" && test -n "$PS_VARLIST"; then 550if test -n "$PS_COMMAND" && test -n "$PS_FORMAT" && test -n "$PS_COLS" && test -n "$PS_VARLIST"; then
533 ac_cv_ps_command="$PS_COMMAND" 551 ac_cv_ps_command="$PS_COMMAND"
534 ac_cv_ps_format="$PS_FORMAT" 552 ac_cv_ps_format="$PS_FORMAT"
535 ac_cv_ps_varlist="$PS_VARLIST" 553 ac_cv_ps_varlist="$PS_VARLIST"
@@ -603,7 +621,7 @@ then
603 ac_cv_ps_cols=9 621 ac_cv_ps_cols=9
604 AC_MSG_RESULT([$ac_cv_ps_command]) 622 AC_MSG_RESULT([$ac_cv_ps_command])
605 623
606dnl Some *BSDs have different format for ps. This is mainly to catch FreeBSD 4. 624dnl Some *BSDs have different format for ps. This is mainly to catch FreeBSD 4.
607dnl Limitation: Only first 16 chars returned for ucomm field 625dnl Limitation: Only first 16 chars returned for ucomm field
608dnl Must come before ps -weo 626dnl Must come before ps -weo
609elif ps -axwo 'stat uid pid ppid vsz rss pcpu ucomm command' 2>/dev/null | \ 627elif ps -axwo 'stat uid pid ppid vsz rss pcpu ucomm command' 2>/dev/null | \
@@ -680,9 +698,9 @@ then
680 ac_cv_ps_cols=9 698 ac_cv_ps_cols=9
681 AC_MSG_RESULT([$ac_cv_ps_command]) 699 AC_MSG_RESULT([$ac_cv_ps_command])
682 700
683dnl Tru64 - needs %*[ +<>] in PS_FORMAT. 701dnl Tru64 - needs %*[ +<>] in PS_FORMAT.
684dnl Has /usr/bin/ps and /sbin/ps - force sbin version 702dnl Has /usr/bin/ps and /sbin/ps - force sbin version
685dnl Can't use vsize and rssize because comes back with text (eg, 1.5M instead 703dnl Can't use vsize and rssize because comes back with text (eg, 1.5M instead
686dnl of 1500). Will need big changes to check_procs to support 704dnl of 1500). Will need big changes to check_procs to support
687elif /sbin/ps -eo 'stat uid pid ppid pcpu etime comm args' 2>/dev/null | \ 705elif /sbin/ps -eo 'stat uid pid ppid pcpu etime comm args' 2>/dev/null | \
688 egrep -i ["^ *S +[UID]+ +[PID]+ +[PID]+ +[%CPU]+ +[ELAPSD]+ +[COMMAND]+ +[COMMAND]+"] > /dev/null 706 egrep -i ["^ *S +[UID]+ +[PID]+ +[PID]+ +[%CPU]+ +[ELAPSD]+ +[COMMAND]+ +[COMMAND]+"] > /dev/null
@@ -808,7 +826,7 @@ then
808 ac_cv_ps_cols=8 826 ac_cv_ps_cols=8
809 AC_MSG_RESULT([$ac_cv_ps_command]) 827 AC_MSG_RESULT([$ac_cv_ps_command])
810 828
811dnl UnixWare 829dnl UnixWare
812elif ps -Al 2>/dev/null | \ 830elif ps -Al 2>/dev/null | \
813 egrep -i ["^ *F +S +UID +PID +PPID +CLS +PRI +NI +C +ADDR +SZ +WCHAN +TTY +TIME +COMD"] >/dev/null 831 egrep -i ["^ *F +S +UID +PID +PPID +CLS +PRI +NI +C +ADDR +SZ +WCHAN +TTY +TIME +COMD"] >/dev/null
814then 832then
@@ -1173,7 +1191,7 @@ fi
1173AC_PATH_PROG(PATH_TO_SMBCLIENT,smbclient) 1191AC_PATH_PROG(PATH_TO_SMBCLIENT,smbclient)
1174AC_ARG_WITH(smbclient_command, 1192AC_ARG_WITH(smbclient_command,
1175 ACX_HELP_STRING([--with-smbclient-command=PATH], 1193 ACX_HELP_STRING([--with-smbclient-command=PATH],
1176 [sets path to smbclient]), 1194 [sets path to smbclient]),
1177 PATH_TO_SMBCLIENT=$withval) 1195 PATH_TO_SMBCLIENT=$withval)
1178if test -n "$PATH_TO_SMBCLIENT" 1196if test -n "$PATH_TO_SMBCLIENT"
1179then 1197then
@@ -1229,7 +1247,7 @@ fi
1229AC_PATH_PROG(PATH_TO_QUAKESTAT,quakestat) 1247AC_PATH_PROG(PATH_TO_QUAKESTAT,quakestat)
1230AC_PATH_PROG(PATH_TO_QSTAT,qstat) 1248AC_PATH_PROG(PATH_TO_QSTAT,qstat)
1231AC_ARG_WITH(qstat_command, 1249AC_ARG_WITH(qstat_command,
1232 ACX_HELP_STRING([--with-qstat-command=PATH], 1250 ACX_HELP_STRING([--with-qstat-command=PATH],
1233 [Path to qstat command]), PATH_TO_QSTAT=$withval) 1251 [Path to qstat command]), PATH_TO_QSTAT=$withval)
1234 1252
1235if test -x "$PATH_TO_QUAKESTAT" 1253if test -x "$PATH_TO_QUAKESTAT"
@@ -1245,7 +1263,7 @@ else
1245 AC_MSG_WARN([Get qstat from http://www.activesw.com/people/steve/qstat.html in order to make check_game plugin]) 1263 AC_MSG_WARN([Get qstat from http://www.activesw.com/people/steve/qstat.html in order to make check_game plugin])
1246fi 1264fi
1247 1265
1248if test $ac_cv_path_to_qstat 1266if test $ac_cv_path_to_qstat
1249then 1267then
1250 AC_DEFINE_UNQUOTED(PATH_TO_QSTAT,"$ac_cv_path_to_qstat", 1268 AC_DEFINE_UNQUOTED(PATH_TO_QSTAT,"$ac_cv_path_to_qstat",
1251 [path to qstat/quakestat]) 1269 [path to qstat/quakestat])
@@ -1404,12 +1422,12 @@ AC_CHECK_MEMBERS([struct swapent.se_nblks],,,[
1404 #include <sys/swap.h> 1422 #include <sys/swap.h>
1405 ]) 1423 ])
1406 1424
1407if test "$ac_cv_have_decl_swapctl" = "yes"; 1425if test "$ac_cv_have_decl_swapctl" = "yes";
1408then 1426then
1409 EXTRAS="$EXTRAS check_swap" 1427 EXTRAS="$EXTRAS check_swap"
1410 AC_MSG_CHECKING([for 2-arg (SVR4) swapctl]) 1428 AC_MSG_CHECKING([for 2-arg (SVR4) swapctl])
1411 if test "$ac_cv_type_swaptbl_t" = "yes" -a \ 1429 if test "$ac_cv_type_swaptbl_t" = "yes" -a \
1412 "$ac_cv_type_swapent_t" = "yes"; 1430 "$ac_cv_type_swapent_t" = "yes";
1413 then 1431 then
1414 AC_MSG_RESULT([yes]) 1432 AC_MSG_RESULT([yes])
1415 ac_cv_check_swap_swapctl_svr4="1"; 1433 ac_cv_check_swap_swapctl_svr4="1";
@@ -1418,7 +1436,7 @@ then
1418 else 1436 else
1419 AC_MSG_RESULT([no]) 1437 AC_MSG_RESULT([no])
1420 AC_MSG_CHECKING([for 3-arg (*BSD) swapctl]) 1438 AC_MSG_CHECKING([for 3-arg (*BSD) swapctl])
1421 if test "$ac_cv_member_struct_swapent_se_nblks" = "yes"; 1439 if test "$ac_cv_member_struct_swapent_se_nblks" = "yes";
1422 then 1440 then
1423 AC_MSG_RESULT([yes]) 1441 AC_MSG_RESULT([yes])
1424 AC_DEFINE([CHECK_SWAP_SWAPCTL_BSD],1, 1442 AC_DEFINE([CHECK_SWAP_SWAPCTL_BSD],1,
@@ -1459,12 +1477,12 @@ dnl end tests for the swapctl system calls
1459dnl 1477dnl
1460 1478
1461 1479
1462if test "x$ac_cv_have_swap" != "x" 1480if test "x$ac_cv_have_swap" != "x"
1463then 1481then
1464 AC_DEFINE(HAVE_SWAP,1,[Define if swap/swapinfo command is found]) 1482 AC_DEFINE(HAVE_SWAP,1,[Define if swap/swapinfo command is found])
1465 EXTRAS="$EXTRAS check_swap" 1483 EXTRAS="$EXTRAS check_swap"
1466fi 1484fi
1467if test "x$ac_cv_swap_command" != "x" 1485if test "x$ac_cv_swap_command" != "x"
1468then 1486then
1469 AC_DEFINE_UNQUOTED(SWAP_COMMAND,"$ac_cv_swap_command", 1487 AC_DEFINE_UNQUOTED(SWAP_COMMAND,"$ac_cv_swap_command",
1470 [Path to swap/swapinfo binary, with any args]) 1488 [Path to swap/swapinfo binary, with any args])
@@ -1509,7 +1527,7 @@ fi
1509AC_PATH_PROG(PATH_TO_APTGET,apt-get) 1527AC_PATH_PROG(PATH_TO_APTGET,apt-get)
1510AC_ARG_WITH(apt-get_command, 1528AC_ARG_WITH(apt-get_command,
1511 ACX_HELP_STRING([--with-apt-get-command=PATH], 1529 ACX_HELP_STRING([--with-apt-get-command=PATH],
1512 [Path to apt-get command]), 1530 [Path to apt-get command]),
1513 with_apt_get_command=$withval, 1531 with_apt_get_command=$withval,
1514 with_apt_get_command=$PATH_TO_APTGET) 1532 with_apt_get_command=$PATH_TO_APTGET)
1515AC_DEFINE_UNQUOTED(PATH_TO_APTGET,"$PATH_TO_APTGET",[Path to apt-get command, if present]) 1533AC_DEFINE_UNQUOTED(PATH_TO_APTGET,"$PATH_TO_APTGET",[Path to apt-get command, if present])
@@ -1538,7 +1556,7 @@ case $host in
1538 *sun* | *solaris*) 1556 *sun* | *solaris*)
1539 AC_DEFINE(__sun__,1,[sun specific code in check_dhcp.c]) 1557 AC_DEFINE(__sun__,1,[sun specific code in check_dhcp.c])
1540 ;; 1558 ;;
1541 *hpux*) 1559 *hpux*)
1542 AC_DEFINE(__hpux__,1,[hpux specific code in check_dhcp.c]) 1560 AC_DEFINE(__hpux__,1,[hpux specific code in check_dhcp.c])
1543 ;; 1561 ;;
1544esac 1562esac
@@ -1558,8 +1576,8 @@ dnl 2.6.9-11 (okay in 2.6.9-5). Redhat investigating root cause
1558dnl We patch plugins/popen.c 1576dnl We patch plugins/popen.c
1559dnl Need to add smp because uname different on those 1577dnl Need to add smp because uname different on those
1560dnl Can force patch to be applied with --enable-redhat-pthread-workaround 1578dnl Can force patch to be applied with --enable-redhat-pthread-workaround
1561AC_ARG_ENABLE(redhat-pthread-workaround, 1579AC_ARG_ENABLE(redhat-pthread-workaround,
1562 AC_HELP_STRING([--enable-redhat-pthread-workaround], 1580 AC_HELP_STRING([--enable-redhat-pthread-workaround],
1563 [force Redhat patch to be applied (default: test system)]), 1581 [force Redhat patch to be applied (default: test system)]),
1564 [ac_cv_enable_redhat_pthread_workaround=$enableval], 1582 [ac_cv_enable_redhat_pthread_workaround=$enableval],
1565 [ac_cv_enable_redhat_pthread_workaround=test]) 1583 [ac_cv_enable_redhat_pthread_workaround=test])
@@ -1581,7 +1599,7 @@ fi
1581 1599
1582dnl Perl modules 1600dnl Perl modules
1583AC_ARG_ENABLE(perl-modules, 1601AC_ARG_ENABLE(perl-modules,
1584 AC_HELP_STRING([--enable-perl-modules], 1602 AC_HELP_STRING([--enable-perl-modules],
1585 [Enables installation of Nagios::Plugin and its dependencies (default: no)]), 1603 [Enables installation of Nagios::Plugin and its dependencies (default: no)]),
1586 [enable_perl_modules=$enableval], 1604 [enable_perl_modules=$enableval],
1587 [enable_perl_modules=no]) 1605 [enable_perl_modules=no])
@@ -1589,6 +1607,18 @@ if test "$enable_perl_modules" = "yes" ; then
1589 AC_SUBST(PERLMODS_DIR,perlmods) 1607 AC_SUBST(PERLMODS_DIR,perlmods)
1590fi 1608fi
1591 1609
1610# From Tap configure
1611# Checks for libraries
1612case "$host" in
1613 *-*-*freebsd4*)
1614 LDFLAGS="$LDFLAGS -pthread"
1615 HAVE_LIBPTHREAD=1
1616 ;;
1617 *)
1618 AC_CHECK_LIB(pthread, main)
1619 ;;
1620esac
1621
1592dnl External libraries - see ACKNOWLEDGEMENTS 1622dnl External libraries - see ACKNOWLEDGEMENTS
1593gl_INIT 1623gl_INIT
1594 1624
@@ -1598,24 +1628,25 @@ if test "$ac_cv_uname_s" = 'SunOS' -a \( "x$ac_cv_prog_ac_ct_AR" = "x" -o "$ac_c
1598fi 1628fi
1599 1629
1600AC_OUTPUT( 1630AC_OUTPUT(
1601 Makefile 1631 Makefile
1602 lib/Makefile 1632 tap/Makefile
1603 plugins/Makefile 1633 lib/Makefile
1634 plugins/Makefile
1604 lib/tests/Makefile 1635 lib/tests/Makefile
1605 plugins-root/Makefile 1636 plugins-root/Makefile
1606 plugins-scripts/Makefile 1637 plugins-scripts/Makefile
1607 plugins-scripts/subst 1638 plugins-scripts/subst
1608 plugins-scripts/utils.pm 1639 plugins-scripts/utils.pm
1609 plugins-scripts/utils.sh 1640 plugins-scripts/utils.sh
1610 perlmods/Makefile 1641 perlmods/Makefile
1611 command.cfg 1642 command.cfg
1612 test.pl 1643 test.pl
1613 pkg/solaris/pkginfo 1644 pkg/solaris/pkginfo
1614 po/Makefile.in 1645 po/Makefile.in
1615) 1646)
1616 1647
1617 1648
1618dnl the ones below that are commented out need to be cleaned up 1649dnl the ones below that are commented out need to be cleaned up
1619dnl in the configure code above to use with_foo instead of ac_cv_foo 1650dnl in the configure code above to use with_foo instead of ac_cv_foo
1620dnl if we want them to show up here. it'd also make the code cleaner. 1651dnl if we want them to show up here. it'd also make the code cleaner.
1621dnl i'll get to that on another rainy day :) -sf 1652dnl i'll get to that on another rainy day :) -sf
@@ -1649,5 +1680,5 @@ ACX_FEATURE([with],[perl])
1649ACX_FEATURE([enable],[perl-modules]) 1680ACX_FEATURE([enable],[perl-modules])
1650ACX_FEATURE([with],[cgiurl]) 1681ACX_FEATURE([with],[cgiurl])
1651ACX_FEATURE([with],[trusted-path]) 1682ACX_FEATURE([with],[trusted-path])
1652 1683ACX_FEATURE([enable],[libtap])
1653 1684