diff options
Diffstat (limited to 'configure.in')
-rw-r--r-- | configure.in | 177 |
1 files changed, 115 insertions, 62 deletions
diff --git a/configure.in b/configure.in index 1d4ed00..a157596 100644 --- a/configure.in +++ b/configure.in | |||
@@ -255,67 +255,96 @@ fi | |||
255 | LIBS="$_SAVEDLIBS" | 255 | LIBS="$_SAVEDLIBS" |
256 | CPPFLAGS="$_SAVEDCPPFLAGS" | 256 | CPPFLAGS="$_SAVEDCPPFLAGS" |
257 | 257 | ||
258 | AC_ARG_WITH([dbi], [AS_HELP_STRING([--without-dbi], [Skips the dbi plugin])]) | ||
258 | dnl Check for DBI libraries | 259 | dnl Check for DBI libraries |
259 | _SAVEDLIBS="$LIBS" | 260 | AS_IF([test "x$with_dbi" != "xno"], [ |
260 | AC_CHECK_LIB(dbi,dbi_initialize) | 261 | _SAVEDLIBS="$LIBS" |
261 | if test "$ac_cv_lib_dbi_dbi_initialize" = "yes"; then | 262 | AC_CHECK_LIB(dbi,dbi_initialize) |
262 | EXTRAS="$EXTRAS check_dbi" | 263 | if test "$ac_cv_lib_dbi_dbi_initialize" = "yes"; then |
263 | DBILIBS="-ldbi" | 264 | EXTRAS="$EXTRAS check_dbi" |
264 | AC_SUBST(DBILIBS) | 265 | DBILIBS="-ldbi" |
265 | else | 266 | AC_SUBST(DBILIBS) |
266 | AC_MSG_WARN([Skipping dbi plugin]) | 267 | else |
267 | AC_MSG_WARN([install DBI libs to compile this plugin (see REQUIREMENTS).]) | 268 | AC_MSG_WARN([Skipping dbi plugin]) |
268 | fi | 269 | AC_MSG_WARN([install DBI libs to compile this plugin (see REQUIREMENTS).]) |
269 | LIBS="$_SAVEDLIBS" | 270 | fi |
271 | LIBS="$_SAVEDLIBS" | ||
272 | ]) | ||
273 | |||
274 | AC_ARG_WITH([radius], [AS_HELP_STRING([--without-radius], [Skips the radius plugin])]) | ||
270 | 275 | ||
271 | dnl Check for radius libraries | 276 | dnl Check for radius libraries |
272 | _SAVEDLIBS="$LIBS" | 277 | AS_IF([test "x$with_radius" != "xno"], [ |
273 | AC_CHECK_LIB(radiusclient,rc_read_config) | 278 | _SAVEDLIBS="$LIBS" |
274 | if test "$ac_cv_lib_radiusclient_rc_read_config" = "yes"; then | 279 | AC_CHECK_LIB(radiusclient,rc_read_config) |
275 | EXTRAS="$EXTRAS check_radius" | 280 | if test "$ac_cv_lib_radiusclient_rc_read_config" = "yes"; then |
276 | RADIUSLIBS="-lradiusclient" | ||
277 | AC_SUBST(RADIUSLIBS) | ||
278 | else | ||
279 | AC_CHECK_LIB(radiusclient-ng,rc_read_config) | ||
280 | if test "$ac_cv_lib_radiusclient_ng_rc_read_config" = "yes"; then | ||
281 | EXTRAS="$EXTRAS check_radius" | 281 | EXTRAS="$EXTRAS check_radius" |
282 | RADIUSLIBS="-lradiusclient-ng" | 282 | RADIUSLIBS="-lradiusclient" |
283 | AC_SUBST(RADIUSLIBS) | 283 | AC_SUBST(RADIUSLIBS) |
284 | else | 284 | else |
285 | AC_MSG_WARN([Skipping radius plugin]) | 285 | AC_CHECK_LIB(radiusclient-ng,rc_read_config) |
286 | AC_MSG_WARN([install radius libs to compile this plugin (see REQUIREMENTS).]) | 286 | if test "$ac_cv_lib_radiusclient_ng_rc_read_config" = "yes"; then |
287 | EXTRAS="$EXTRAS check_radius" | ||
288 | RADIUSLIBS="-lradiusclient-ng" | ||
289 | AC_SUBST(RADIUSLIBS) | ||
290 | else | ||
291 | AC_MSG_WARN([Skipping radius plugin]) | ||
292 | AC_MSG_WARN([install radius libs to compile this plugin (see REQUIREMENTS).]) | ||
293 | fi | ||
287 | fi | 294 | fi |
288 | fi | 295 | LIBS="$_SAVEDLIBS" |
289 | LIBS="$_SAVEDLIBS" | 296 | ]) |
297 | |||
298 | AC_ARG_WITH([ldap], [AS_HELP_STRING([--without-ldap], [Skips the LDAP plugin])]) | ||
290 | 299 | ||
291 | dnl Check for LDAP libraries | 300 | dnl Check for LDAP libraries |
292 | _SAVEDLIBS="$LIBS" | 301 | AS_IF([test "x$with_ldap" != "xno"], [ |
293 | AC_CHECK_LIB(ldap,main,,,-llber) | 302 | _SAVEDLIBS="$LIBS" |
294 | if test "$ac_cv_lib_ldap_main" = "yes"; then | 303 | AC_CHECK_LIB(ldap,main,,,-llber) |
295 | LDAPLIBS="-lldap -llber"\ | 304 | if test "$ac_cv_lib_ldap_main" = "yes"; then |
296 | LDAPINCLUDE="-I/usr/include/ldap" | 305 | LDAPLIBS="-lldap -llber"\ |
297 | AC_SUBST(LDAPLIBS) | 306 | LDAPINCLUDE="-I/usr/include/ldap" |
298 | AC_SUBST(LDAPINCLUDE) | 307 | AC_SUBST(LDAPLIBS) |
299 | AC_CHECK_FUNCS(ldap_set_option) | 308 | AC_SUBST(LDAPINCLUDE) |
300 | EXTRAS="$EXTRAS check_ldap" | 309 | AC_CHECK_FUNCS(ldap_set_option) |
301 | AC_CHECK_FUNCS(ldap_init ldap_set_option ldap_get_option ldap_start_tls_s) | 310 | EXTRAS="$EXTRAS check_ldap" |
302 | else | 311 | AC_CHECK_FUNCS(ldap_init ldap_set_option ldap_get_option ldap_start_tls_s) |
303 | AC_MSG_WARN([Skipping LDAP plugin]) | 312 | else |
304 | AC_MSG_WARN([install LDAP libs to compile this plugin (see REQUIREMENTS).]) | 313 | AC_MSG_WARN([Skipping LDAP plugin]) |
305 | fi | 314 | AC_MSG_WARN([install LDAP libs to compile this plugin (see REQUIREMENTS).]) |
306 | LIBS="$_SAVEDLIBS" | 315 | fi |
316 | LIBS="$_SAVEDLIBS" | ||
317 | ]) | ||
307 | 318 | ||
308 | dnl Check for headers used by check_ide_smart | 319 | dnl Check for headers used by check_ide_smart |
309 | AC_CHECK_HEADER(linux/hdreg.h, FOUNDINCLUDE=yes, FOUNDINCLUDE=no) | 320 | case $host in |
310 | if test "$FOUNDINCLUDE" = "yes" ; then | 321 | *linux*) |
311 | AC_CHECK_HEADER(linux/types.h, FOUNDINCLUDE=yes, FOUNDINCLUDE=no) | 322 | AC_CHECK_HEADER(linux/hdreg.h, FOUNDINCLUDE=yes, FOUNDINCLUDE=no) |
312 | fi | 323 | if test "$FOUNDINCLUDE" = "yes" ; then |
324 | AC_CHECK_HEADER(linux/types.h, FOUNDINCLUDE=yes, FOUNDINCLUDE=no) | ||
325 | fi | ||
326 | if test "$FOUNDINCLUDE" = "no" ; then | ||
327 | AC_MSG_WARN([Skipping check_ide_smart plugin.]) | ||
328 | AC_MSG_WARN([check_ide_smart requires linux/hdreg.h and linux/types.h.]) | ||
329 | fi | ||
330 | ;; | ||
331 | *netbsd*) | ||
332 | AC_CHECK_HEADER(dev/ata/atareg.h, FOUNDINCLUDE=yes, FOUNDINCLUDE=no) | ||
333 | if test "$FOUNDINCLUDE" = "yes" ; then | ||
334 | AC_CHECK_HEADER(dev/ic/wdcreg.h, FOUNDINCLUDE=yes, FOUNDINCLUDE=no) | ||
335 | fi | ||
336 | if test "$FOUNDINCLUDE" = "no" ; then | ||
337 | AC_MSG_WARN([Skipping check_ide_smart plugin.]) | ||
338 | AC_MSG_WARN([check_ide_smart requires dev/ata/atareg.h and dev/ic/wdcreg.h]) | ||
339 | fi | ||
340 | ;; | ||
341 | *) | ||
342 | AC_MSG_WARN([Skipping check_ide_smart plugin.]) | ||
343 | AC_MSG_WARN([check_ide_smart works only on Linux and NetBSD]) | ||
344 | esac | ||
313 | 345 | ||
314 | if test "$FOUNDINCLUDE" = "yes" ; then | 346 | if test "$FOUNDINCLUDE" = "yes" ; then |
315 | EXTRAS="$EXTRAS check_ide_smart" | 347 | EXTRAS="$EXTRAS check_ide_smart" |
316 | else | ||
317 | AC_MSG_WARN([Skipping check_ide_smart plugin.]) | ||
318 | AC_MSG_WARN([check_ide_smart is linux specific. It requires linux/hdreg.h and linux/types.h.]) | ||
319 | fi | 348 | fi |
320 | 349 | ||
321 | dnl Check for mysql libraries | 350 | dnl Check for mysql libraries |
@@ -333,6 +362,26 @@ else | |||
333 | AC_SUBST(MYSQLCFLAGS) | 362 | AC_SUBST(MYSQLCFLAGS) |
334 | fi | 363 | fi |
335 | 364 | ||
365 | dnl Check for headers used by check_users | ||
366 | AC_CHECK_HEADERS(utmpx.h) | ||
367 | AM_CONDITIONAL([HAVE_UTMPX], [test "$ac_cv_header_utmpx_h" = "yes"]) | ||
368 | |||
369 | dnl Fallback to who(1) if the system doesn't provide an utmpx(5) interface | ||
370 | if test "$ac_cv_header_utmpx_h" = "no" | ||
371 | then | ||
372 | AC_PATH_PROG(PATH_TO_WHO,who) | ||
373 | |||
374 | if [$PATH_TO_WHO -q 2>/dev/null | egrep -i "^# users=[0-9]+$" >/dev/null] | ||
375 | then | ||
376 | ac_cv_path_to_who="$PATH_TO_WHO -q" | ||
377 | else | ||
378 | ac_cv_path_to_who="$PATH_TO_WHO" | ||
379 | fi | ||
380 | |||
381 | AC_DEFINE_UNQUOTED(WHO_COMMAND,"$ac_cv_path_to_who", | ||
382 | [path and arguments for invoking 'who']) | ||
383 | fi | ||
384 | |||
336 | AC_ARG_WITH([ipv6], | 385 | AC_ARG_WITH([ipv6], |
337 | [AS_HELP_STRING([--with-ipv6], [support IPv6 @<:@default=check@:>@])], | 386 | [AS_HELP_STRING([--with-ipv6], [support IPv6 @<:@default=check@:>@])], |
338 | [], [with_ipv6=check]) | 387 | [], [with_ipv6=check]) |
@@ -1257,10 +1306,18 @@ if test -n "$ac_cv_nslookup_command"; then | |||
1257 | AC_DEFINE_UNQUOTED(NSLOOKUP_COMMAND,"$ac_cv_nslookup_command", [path and args for nslookup]) | 1306 | AC_DEFINE_UNQUOTED(NSLOOKUP_COMMAND,"$ac_cv_nslookup_command", [path and args for nslookup]) |
1258 | fi | 1307 | fi |
1259 | 1308 | ||
1260 | AC_MSG_CHECKING([for number of cpus]) | 1309 | AC_MSG_CHECKING([for number of online cpus]) |
1310 | AC_TRY_COMPILE([#include <unistd.h>], | ||
1311 | [sysconf(_SC_NPROCESSORS_ONLN) > 0;], | ||
1312 | AC_DEFINE(HAVE_SYSCONF__SC_NPROCESSORS_ONLN,1,[Define if sysconf returns number of online cpus]) | ||
1313 | AC_MSG_RESULT([sysconf(_SC_NPROCESSORS_ONLN)]), | ||
1314 | AC_MSG_RESULT([cannot calculate]) | ||
1315 | ) | ||
1316 | |||
1317 | AC_MSG_CHECKING([for number of available cpus]) | ||
1261 | AC_TRY_COMPILE([#include <unistd.h>], | 1318 | AC_TRY_COMPILE([#include <unistd.h>], |
1262 | [sysconf(_SC_NPROCESSORS_CONF) > 0;], | 1319 | [sysconf(_SC_NPROCESSORS_CONF) > 0;], |
1263 | AC_DEFINE(HAVE_SYSCONF__SC_NPROCESSORS_CONF,1,[Define if sysconf returns number of cpus]) | 1320 | AC_DEFINE(HAVE_SYSCONF__SC_NPROCESSORS_CONF,1,[Define if sysconf returns number of available cpus]) |
1264 | AC_MSG_RESULT([sysconf(_SC_NPROCESSORS_CONF)]), | 1321 | AC_MSG_RESULT([sysconf(_SC_NPROCESSORS_CONF)]), |
1265 | AC_MSG_RESULT([cannot calculate]) | 1322 | AC_MSG_RESULT([cannot calculate]) |
1266 | ) | 1323 | ) |
@@ -1297,19 +1354,6 @@ else | |||
1297 | AC_MSG_WARN([Get smbclient from Samba.org to monitor SMB shares]) | 1354 | AC_MSG_WARN([Get smbclient from Samba.org to monitor SMB shares]) |
1298 | fi | 1355 | fi |
1299 | 1356 | ||
1300 | |||
1301 | AC_PATH_PROG(PATH_TO_WHO,who) | ||
1302 | |||
1303 | if [$PATH_TO_WHO -q 2>/dev/null | egrep -i "^# users=[0-9]+$" >/dev/null] | ||
1304 | then | ||
1305 | ac_cv_path_to_who="$PATH_TO_WHO -q" | ||
1306 | else | ||
1307 | ac_cv_path_to_who="$PATH_TO_WHO" | ||
1308 | fi | ||
1309 | |||
1310 | AC_DEFINE_UNQUOTED(WHO_COMMAND,"$ac_cv_path_to_who", | ||
1311 | [path and arguments for invoking 'who']) | ||
1312 | |||
1313 | AC_PATH_PROG(PATH_TO_SNMPGET,snmpget) | 1357 | AC_PATH_PROG(PATH_TO_SNMPGET,snmpget) |
1314 | AC_ARG_WITH(snmpget_command, | 1358 | AC_ARG_WITH(snmpget_command, |
1315 | ACX_HELP_STRING([--with-snmpget-command=PATH], | 1359 | ACX_HELP_STRING([--with-snmpget-command=PATH], |
@@ -1367,13 +1411,22 @@ then | |||
1367 | fi | 1411 | fi |
1368 | 1412 | ||
1369 | AC_PATH_PROG(PATH_TO_FPING,fping) | 1413 | AC_PATH_PROG(PATH_TO_FPING,fping) |
1414 | AC_PATH_PROG(PATH_TO_FPING6,fping6) | ||
1415 | |||
1370 | AC_ARG_WITH(fping_command, | 1416 | AC_ARG_WITH(fping_command, |
1371 | ACX_HELP_STRING([--with-fping-command=PATH], | 1417 | ACX_HELP_STRING([--with-fping-command=PATH], |
1372 | [Path to fping command]), PATH_TO_FPING=$withval) | 1418 | [Path to fping command]), PATH_TO_FPING=$withval) |
1419 | AC_ARG_WITH(fping6_command, | ||
1420 | ACX_HELP_STRING([--with-fping6-command=PATH], | ||
1421 | [Path to fping6 command]), PATH_TO_FPING6=$withval) | ||
1422 | |||
1373 | if test -n "$PATH_TO_FPING" | 1423 | if test -n "$PATH_TO_FPING" |
1374 | then | 1424 | then |
1375 | AC_DEFINE_UNQUOTED(PATH_TO_FPING,"$PATH_TO_FPING",[path to fping]) | 1425 | AC_DEFINE_UNQUOTED(PATH_TO_FPING,"$PATH_TO_FPING",[path to fping]) |
1376 | EXTRAS="$EXTRAS check_fping" | 1426 | EXTRAS="$EXTRAS check_fping" |
1427 | if test x"$with_ipv6" != xno && test -n "$PATH_TO_FPING6"; then | ||
1428 | AC_DEFINE_UNQUOTED(PATH_TO_FPING6,"$PATH_TO_FPING6",[path to fping6]) | ||
1429 | fi | ||
1377 | else | 1430 | else |
1378 | AC_MSG_WARN([Get fping from http://www.fping.com in order to make check_fping plugin]) | 1431 | AC_MSG_WARN([Get fping from http://www.fping.com in order to make check_fping plugin]) |
1379 | fi | 1432 | fi |