diff --git a/configure.in b/configure.in
index 02e06fe6df02dd1984a185e70faff31073167b97..2bab6b32cab6f2cbbd7390d1fbdd06f9bf226f38 100644 (file)
--- a/configure.in
+++ b/configure.in
*darwin*)
ac_system="Darwin"
;;
+ *openbsd*)
+ ac_system="OpenBSD"
+ ;;
*)
ac_system="unknown"
esac
AC_SUBST(KERNEL_CFLAGS)
fi
+if test "x$ac_system" = "xSolaris"
+then
+ CPPFLAGS="$CPPFLAGS -D_POSIX_PTHREAD_SEMANTICS"
+fi
+
#
# Checks for header files.
#
])
# For the swap module
-AC_CHECK_HEADERS(sys/swap.h, [], [],
+have_sys_swap_h="yes"
+AC_CHECK_HEADERS(sys/swap.h, [], [have_sys_swap_h="no"],
[
#if HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
])
+if test "x$have_sys_swap_h$ac_system" = "xnoSolaris"
+then
+ AC_MSG_NOTICE([Solaris detected and sys/swap.h not found: Try building a 64bit binary.])
+fi
+
# For load module
# For the processes plugin
# For users module
AC_SUBST(BUILD_WITH_LIBSTATGRAB_LDFLAGS)
fi
+with_libkvm="no"
AC_CHECK_LIB(kvm, kvm_getprocs, [with_kvm_getprocs="yes"], [with_kvm_getprocs="no"])
if test "x$with_kvm_getprocs" = "xyes"
then
AC_DEFINE(HAVE_LIBKVM_GETPROCS, 1,
[Define to 1 if you have the 'kvm' library with the 'kvm_getprocs' symbol (-lkvm)])
+ with_libkvm="yes"
fi
AM_CONDITIONAL(BUILD_WITH_LIBKVM_GETPROCS, test "x$with_kvm_getprocs" = "xyes")
then
AC_DEFINE(HAVE_LIBKVM_GETSWAPINFO, 1,
[Define to 1 if you have the 'kvm' library with the 'kvm_getswapinfo' symbol (-lkvm)])
+ with_libkvm="yes"
fi
AM_CONDITIONAL(BUILD_WITH_LIBKVM_GETSWAPINFO, test "x$with_kvm_getswapinfo" = "xyes")
+AC_CHECK_LIB(kvm, kvm_nlist, [with_kvm_nlist="yes"], [with_kvm_nlist="no"])
+if test "x$with_kvm_nlist" = "xyes"
+then
+ AC_DEFINE(HAVE_LIBKVM_NLIST, 1,
+ [Define to 1 if you have the 'kvm' library with the 'kvm_nlist' symbol (-lkvm)])
+ with_libkvm="yes"
+fi
+AM_CONDITIONAL(BUILD_WITH_LIBKVM_NLIST, test "x$with_kvm_nlist" = "xyes")
+
+AC_CHECK_LIB(kvm, kvm_openfiles, [with_kvm_openfiles="yes"], [with_kvm_openfiles="no"])
+if test "x$with_kvm_openfiles" = "xyes"
+then
+ AC_DEFINE(HAVE_LIBKVM_NLIST, 1,
+ [Define to 1 if you have the 'kvm' library with the 'kvm_openfiles' symbol (-lkvm)])
+ with_libkvm="yes"
+fi
+AM_CONDITIONAL(BUILD_WITH_LIBKVM_OPENFILES, test "x$with_kvm_openfiles" = "xyes")
+
with_sensors_cflags=""
with_sensors_ldflags=""
AC_ARG_WITH(lm-sensors, [AS_HELP_STRING([--with-lm-sensors@<:@=PREFIX@:>@], [Path to lm_sensors.])],
if test $mysql_config_status -ne 0
then
- with_libmysql="no"
+ with_libmysql="no ($with_mysql_config failed)"
else
SAVE_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $with_mysql_cflags"
- AC_CHECK_HEADERS(mysql/mysql.h, [], [with_libmysql="no (mysql/mysql.h not found)"], [])
+ have_mysql_h="no"
+ have_mysql_mysql_h="no"
+ AC_CHECK_HEADERS(mysql.h, [have_mysql_h="yes"])
+
+ if test "x$have_mysql_h" = "xno"
+ then
+ AC_CHECK_HEADERS(mysql/mysql.h, [have_mysql_mysql_h="yes"])
+ fi
+
+ if test "x$have_mysql_h$have_mysql_mysql_h" = "xnono"
+ then
+ with_libmysql="no (mysql.h not found)"
+ fi
CPPFLAGS="$SAVE_CPPFLAGS"
fi
if test $mysql_config_status -ne 0
then
- with_libmysql="no"
+ with_libmysql="no ($with_mysql_config failed)"
else
AC_CHECK_LIB(mysqlclient, mysql_init,
[with_libmysql="yes"],
perl_interpreter="perl"
AC_ARG_WITH(libperl, [AS_HELP_STRING([--with-libperl@<:@=PREFIX@:>@], [Path to libperl.])],
[
- if test "x$withval" != "xno" && test "x$withval" != "xyes"
+ if test -x "$withval"
+ then
+ perl_interpreter="$withval"
+ with_libperl="yes"
+ else if test "x$withval" != "xno" && test "x$withval" != "xyes"
then
LDFLAGS="$LDFLAGS -L$withval/lib"
CPPFLAGS="$CPPFLAGS -I$withval/include"
@@ -1609,7 +1660,7 @@ AC_ARG_WITH(libperl, [AS_HELP_STRING([--with-libperl@<:@=PREFIX@:>@], [Path to l
with_libperl="yes"
else
with_libperl="$withval"
- fi
+ fi; fi
],
[
with_libperl="yes"
perl_interpreter=`which "$perl_interpreter" 2> /dev/null`
if test -x "$perl_interpreter"
then
- AC_MSG_RESULT([yes])
+ AC_MSG_RESULT([yes ($perl_interpreter)])
else
perl_interpreter=""
AC_MSG_RESULT([no])
AC_LINK_IFELSE(
AC_LANG_PROGRAM(
[[
+#define PERL_NO_GET_CONTEXT
#include <EXTERN.h>
#include <perl.h>
#include <XSUB.h>
]],
[[
- PerlInterpreter *perl = NULL;
- Perl_load_module (perl, PERL_LOADMOD_NOIMPORT,
+ dTHX;
+ load_module (PERL_LOADMOD_NOIMPORT,
newSVpv ("Collectd::Plugin::FooBar", 24),
Nullsv);
]]),
[with_libnotify="yes"],
[with_libnotify="no ($LIBNOTIFY_PKG_ERRORS)"])
-with_libupsclient="no (pkg-config isn't available)"
+with_libupsclient_config=""
with_libupsclient_cflags=""
with_libupsclient_libs=""
-if test "x$PKG_CONFIG" != "x"
-then
- pkg-config --exists 'libupsclient' 2>/dev/null
- if test "$?" = "0"
+AC_ARG_WITH(libupsclient, [AS_HELP_STRING([--with-libupsclient@<:@=PREFIX@:>@], [Path to the Net-SNMPD library.])],
+[
+ if test "x$withval" = "xno"
+ then
+ with_libupsclient="no"
+ else if test "x$withval" = "xyes"
then
- with_libupsclient="yes"
+ with_libupsclient="use_pkgconfig"
else
+ if test -x "$withval"
+ then
+ with_libupsclient_config="$withval"
+ with_libupsclient="use_libupsclient_config"
+ else if test -x "$withval/bin/libupsclient-config"
+ then
+ with_libupsclient_config="$withval/bin/net-snmp-config"
+ with_libupsclient="use_libupsclient_config"
+ else
+ AC_MSG_NOTICE([Not checking for libupsclient: Manually configured])
+ with_libupsclient_cflags="-I$withval/include"
+ with_libupsclient_libs="-L$withval/lib -lupsclient"
+ with_libupsclient="yes"
+ fi; fi
+ fi; fi
+],
+[with_libupsclient="use_pkgconfig"])
+
+# configure using libupsclient-config
+if test "x$with_libupsclient" = "xuse_libupsclient_config"
+then
+ AC_MSG_NOTICE([Checking for libupsclient using $with_libupsclient_config])
+ with_libupsclient_cflags="`$with_libupsclient_config --cflags`"
+ if test $? -ne 0
+ then
+ with_libupsclient="no ($with_libupsclient_config failed)"
+ fi
+ with_libupsclient_libs="`$with_libupsclient_config --libs`"
+ if test $? -ne 0
+ then
+ with_libupsclient="no ($with_libupsclient_config failed)"
+ fi
+fi
+if test "x$with_libupsclient" = "xuse_libupsclient_config"
+then
+ with_libupsclient="yes"
+fi
+
+# configure using pkg-config
+if test "x$with_libupsclient" = "xuse_pkgconfig"
+then
+ if test "x$PKG_CONFIG" = "x"
+ then
+ with_libupsclient="no (Don't have pkg-config)"
+ fi
+fi
+if test "x$with_libupsclient" = "xuse_pkgconfig"
+then
+ AC_MSG_NOTICE([Checking for libupsclient using $PKG_CONFIG])
+ $PKG_CONFIG --exists 'libupsclient' 2>/dev/null
+ if test $? -ne 0
+ then
with_libupsclient="no (pkg-config doesn't know library)"
fi
fi
-if test "x$with_libupsclient" = "xyes"
+if test "x$with_libupsclient" = "xuse_pkgconfig"
then
- with_libupsclient_cflags="`pkg-config --cflags 'libupsclient'`"
+ with_libupsclient_cflags="`$PKG_CONFIG --cflags 'libupsclient'`"
if test $? -ne 0
then
- with_libupsclient="no"
+ with_libupsclient="no ($PKG_CONFIG failed)"
fi
- with_libupsclient_libs="`pkg-config --libs 'libupsclient'`"
+ with_libupsclient_libs="`$PKG_CONFIG --libs 'libupsclient'`"
if test $? -ne 0
then
- with_libupsclient="no"
+ with_libupsclient="no ($PKG_CONFIG failed)"
fi
fi
+if test "x$with_libupsclient" = "xuse_pkgconfig"
+then
+ with_libupsclient="yes"
+fi
+
+# with_libupsclient_cflags and with_libupsclient_libs are set up now, let's do
+# the actual checks.
if test "x$with_libupsclient" = "xyes"
then
SAVE_CPPFLAGS="$CPPFLAGS"
])
if test "x$enable_plugin" = "xyes"
then
- AC_DEFINE([HAVE_PLUGIN_]my_toupper([$1]), 1, [Define to 1 if the $1 plugin is enabled.])
+ if test "x$2" = "xyes"
+ then
+ AC_DEFINE([HAVE_PLUGIN_]my_toupper([$1]), 1, [Define to 1 if the $1 plugin is enabled.])
+ else # User passed "yes" but dependency checking yielded "no" => Dependency problem.
+ dependency_error="yes"
+ enable_plugin="no (dependency error)"
+ fi
fi
AM_CONDITIONAL([BUILD_PLUGIN_]my_toupper([$1]), test "x$enable_plugin" = "xyes")
enable_$1="$enable_plugin"
AC_COLLECTD([daemon], [disable], [feature], [daemon mode])
AC_COLLECTD([getifaddrs],[enable], [feature], [getifaddrs under Linux])
+dependency_error="no"
plugin_ascent="no"
plugin_battery="no"
plugin_cpu="no"
fi
fi
+if test "x$ac_system" = "xOpenBSD"
+then
+ plugin_tcpconns="yes"
+fi
+
# Mac OS X devices
if test "x$with_libiokit" = "xyes"
then
plugin_disk="yes"
plugin_interface="yes"
plugin_memory="yes"
- plugin_swap="yes"
plugin_tape="yes"
fi
+if test "x$have_sys_swap_h$with_kstat$ac_system" = "xyesyesSolaris"
+then
+ plugin_swap="yes"
+fi
+
# libstatgrab
if test "x$with_libstatgrab" = "xyes"
then
plugin_processes="yes"
fi
-if test "x$with_libkvm" = "xyes"
+if test "x$with_kvm_getprocs" = "xyes"
then
plugin_processes="yes"
+fi
+
+if test "x$with_kvm_getswapinfo" = "xyes"
+then
plugin_swap="yes"
fi
+if test "x$with_kvm_openfiles$with_kvm_nlist" = "xyesyes"
+then
+ plugin_tcpconns="yes"
+fi
+
if test "x$have_getutent" = "xyes"
then
plugin_users="yes"
AC_PLUGIN([email], [yes], [EMail statistics])
AC_PLUGIN([entropy], [$plugin_entropy], [Entropy statistics])
AC_PLUGIN([exec], [yes], [Execution of external programs])
+AC_PLUGIN([filecount], [yes], [Count files in directories])
AC_PLUGIN([hddtemp], [yes], [Query hddtempd])
AC_PLUGIN([interface], [$plugin_interface], [Interface traffic statistics])
AC_PLUGIN([iptables], [$with_libiptc], [IPTables rule counters])
AC_PLUGIN([postgresql], [$with_libpq], [PostgreSQL database statistics])
AC_PLUGIN([powerdns], [yes], [PowerDNS statistics])
AC_PLUGIN([processes], [$plugin_processes], [Process statistics])
-AC_PLUGIN([qmail], [yes], [QMail queue statistics])
AC_PLUGIN([rrdtool], [$with_rrdtool], [RRDTool output plugin])
AC_PLUGIN([sensors], [$with_lm_sensors], [lm_sensors statistics])
AC_PLUGIN([serial], [$plugin_serial], [serial port traffic])
email . . . . . . . . $enable_email
entropy . . . . . . . $enable_entropy
exec . . . . . . . . $enable_exec
+ filecount . . . . . . $enable_filecount
hddtemp . . . . . . . $enable_hddtemp
interface . . . . . . $enable_interface
iptables . . . . . . $enable_iptables
postgresql . . . . . $enable_postgresql
powerdns . . . . . . $enable_powerdns
processes . . . . . . $enable_processes
- qmail . . . . . . . . $enable_qmail
rrdtool . . . . . . . $enable_rrdtool
sensors . . . . . . . $enable_sensors
serial . . . . . . . $enable_serial
xmms . . . . . . . . $enable_xmms
EOF
+
+if test "x$dependency_error" = "xyes"; then
+ AC_MSG_ERROR("Some plugins are missing dependencies - see above summary for details")
+fi