dnl Process this file with autoconf to produce a configure script.
-AC_INIT(collectd, 4.0.0-rc3)
+AC_INIT(collectd, 4.0.2)
AC_CONFIG_SRCDIR(src/collectd.c)
AC_CONFIG_HEADERS(src/config.h)
AM_INIT_AUTOMAKE(dist-bzip2)
AC_PREFIX_DEFAULT("/opt/collectd")
+AC_SYS_LARGEFILE
+
#
# Checks for programs.
#
# For hddtemp module
AC_CHECK_HEADERS(linux/major.h)
+AC_CHECK_HEADERS(libgen.h)
# For the apple_sensors module
AC_CHECK_HEADERS(CoreFoundation/CoreFoundation.h)
AC_CHECK_HEADERS(curl/curl.h)
# For quota module
-AC_CHECK_HEADERS(grp.h pwd.h sys/ucred.h)
+AC_CHECK_HEADERS(pwd.h sys/ucred.h)
AC_CHECK_HEADERS(ctype.h)
AC_CHECK_HEADERS(limits.h)
AC_CHECK_HEADERS(sys/quota.h)
[Wether or not to use mysql library])
AM_CONDITIONAL(BUILD_WITH_LIBMYSQL, test "x$with_libmysql" = "xyes")
+with_own_liboconfig="no"
+liboconfig_LDFLAGS="$LDFLAGS"
+liboconfig_CPPFLAGS="$CPPFLAGS"
+AC_ARG_WITH(liboconfig, [AS_HELP_STRING([--with-liboconfig@<:@=PREFIX@:>@], [Path to liboconfig.])],
+[
+ if test "x$withval" != "xno" && test "x$withval" != "xyes"
+ then
+ if test -d "$withval/lib"
+ then
+ liboconfig_LDFLAGS="$LDFLAGS -L$withval/lib"
+ fi
+ if test -d "$withval/include"
+ then
+ liboconfig_CPPFLAGS="$CPPFLAGS -I$withval/include"
+ fi
+ fi
+ if test "x$withval" = "xno"
+ then
+ AC_MSG_ERROR("liboconfig is required")
+ fi
+],
+[
+ with_liboconfig="yes"
+])
+
+save_LDFLAGS="$LDFLAGS"
+save_CPPFLAGS="$CPPFLAGS"
+LDFLAGS="$liboconfig_LDFLAGS"
+CPPFLAGS="$liboconfig_CPPFLAGS"
+AC_CHECK_LIB(oconfig, oconfig_parse_fh,
+[
+ with_liboconfig="yes"
+ with_own_liboconfig="no"
+],
+[
+ with_liboconfig="yes"
+ with_own_liboconfig="yes"
+ LDFLAGS="$save_LDFLAGS"
+ CPPFLAGS="$save_CPPFLAGS"
+])
+
+AM_CONDITIONAL(BUILD_WITH_OWN_LIBOCONFIG, test "x$with_own_liboconfig" = "xyes")
+if test "x$with_own_liboconfig" = "xyes"
+then
+ with_liboconfig="yes (shipped version)"
+fi
+
#with_liboping="yes"
with_own_liboping="no"
liboping_LDFLAGS="$LDFLAGS"
[Wether or not to use the pcap library])
AM_CONDITIONAL(BUILD_WITH_LIBPCAP, test "x$with_libpcap" = "xyes")
+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"
then
LDFLAGS="$LDFLAGS -L$withval/lib"
CPPFLAGS="$CPPFLAGS -I$withval/include"
+ perl_interpreter="$withval/bin/perl"
with_libperl="yes"
fi
],
then
SAVE_CFLAGS=$CFLAGS
SAVE_LDFLAGS=$LDFLAGS
- CFLAGS="$CFLAGS `perl -MExtUtils::Embed -e ccopts`"
- LDFLAGS="$LDFLAGS `perl -MExtUtils::Embed -e ldopts`"
+ PERL_CFLAGS=`$perl_interpreter -MExtUtils::Embed -e ccopts`
+ PERL_LDFLAGS=`$perl_interpreter -MExtUtils::Embed -e ldopts`
+ CFLAGS="$CFLAGS $PERL_CFLAGS"
+ LDFLAGS="$LDFLAGS $PERL_LDFLAGS"
AC_CACHE_CHECK([for libperl],
[have_libperl],
[[
PerlInterpreter *perl = NULL;
Perl_load_module (perl, PERL_LOADMOD_NOIMPORT,
- Perl_newSVpvf (perl, "Collectd::Plugin::%s", "foo"),
+ newSVpv ("Collectd::Plugin::FooBar", 24),
Nullsv);
]]),
[have_libperl="yes"],
if test "x$have_libperl" = "xyes"
then
AC_DEFINE(HAVE_LIBPERL, 1, [Define if libperl is present and usable.])
+ AC_SUBST(PERL_CFLAGS)
+ AC_SUBST(PERL_LDFLAGS)
else
with_libperl="no"
fi
fi
AM_CONDITIONAL(BUILD_WITH_LIBIPTC, test "x$with_libiptc" = "xyes")
+AC_ARG_WITH(libnetsnmp, [AS_HELP_STRING([--with-libnetsnmp@<:@=PREFIX@:>@], [Path to the Net-SNMPD library.])],
+[
+ if test "x$withval" != "xno" && test "x$withval" != "xyes"
+ then
+ LDFLAGS="$LDFLAGS -L$withval/lib"
+ CPPFLAGS="$CPPFLAGS -I$withval/include"
+ with_libnetsnmp="yes"
+ fi
+],
+[with_libnetsnmp="yes"])
+if test "x$with_libnetsnmp" = "xyes"
+then
+ AC_CHECK_LIB(netsnmp, init_snmp,
+ [
+ AC_DEFINE(HAVE_LIBSNMP, 1, [Define to 1 if you have the Net-SNMP library (-lnetsnmp).])
+ ], [with_libnetsnmp="no (libnetsnmp not found)"])
+fi
+if test "x$with_libnetsnmp" = "xyes"
+then
+ AC_CHECK_HEADERS(net-snmp/net-snmp-config.h,
+ [
+ AC_DEFINE(HAVE_NET_SNMP_NET_SNMP_CONFIG_H, 1, [Define to 1 if you have the <net-snmp/net-snmp-config.h> header file.])
+ ], [with_libnetsnmp="no (net-snmp/net-snmp-config.h not found)"])
+fi
+AM_CONDITIONAL(BUILD_WITH_LIBNETSNMP, test "x$with_libnetsnmp" = "xyes")
+
AC_ARG_WITH(libupsclient, [AS_HELP_STRING([--with-libupsclient@<:@=PREFIX@:>@], [Path to libupsclient.])],
[
if test "x$withval" != "xno" && test "x$withval" != "xyes"
fi
AM_CONDITIONAL(BUILD_WITH_LIBUPSCLIENT, test "x$with_libupsclient" = "xyes")
+### BEGIN of check for libxmms ###
+with_xmms_config="xmms-config"
+with_xmms_prefix=0
+with_xmms_cflags=""
+with_xmms_libs=""
+AC_ARG_WITH(libxmms, [AS_HELP_STRING([--with-libxmms@<:@=PREFIX@:>@], [Path to libxmms.])],
+[
+ if test "x$withval" != "xno" -a "x$withval" != "xyes"
+ then
+ if test -x "$withval/bin/xmms-config"
+ then
+ with_xmms_config="$withval/bin/xmms-config"
+ with_xmms_prefix=1
+ fi
+ fi
+ if test "x$withval" = "xno"
+ then
+ with_libxmms="no"
+ else
+ with_libxmms="yes"
+ fi
+],
+[
+ with_libxmms="yes"
+])
+if test "x$with_libxmms" = "xyes"
+then
+ with_xmms_cflags=`$with_xmms_config --cflags 2>/dev/null`
+ xmms_config_status=$?
+
+ if test $xmms_config_status -ne 0
+ then
+ with_libxmms="no"
+ fi
+fi
+if test "x$with_libxmms" = "xyes"
+then
+ with_xmms_libs=`$with_xmms_config --libs 2>/dev/null`
+ xmms_config_status=$?
+
+ if test $xmms_config_status -ne 0
+ then
+ with_libxmms="no"
+ fi
+fi
+if test "x$with_libxmms" = "xyes"
+then
+ AC_CHECK_LIB(xmms, xmms_remote_get_info,
+ [
+ BUILD_WITH_LIBXMMS_CFLAGS="$with_xmms_cflags"
+ BUILD_WITH_LIBXMMS_LIBS="$with_xmms_libs"
+ AC_SUBST(BUILD_WITH_LIBXMMS_CFLAGS)
+ AC_SUBST(BUILD_WITH_LIBXMMS_LIBS)
+ ],
+ [
+ with_libxmms="no"
+ ],
+ [$with_xmms_libs])
+fi
+with_libxmms_numeric=0
+if test "x$with_libxmms" = "xyes"
+then
+ with_libxmms_numeric=1
+fi
+AC_DEFINE_UNQUOTED(HAVE_LIBXMMS, [$with_libxmms_numeric], [Define to 1 if you have the 'xmms' library (-lxmms).])
+AM_CONDITIONAL(BUILD_WITH_LIBXMMS, test "x$with_libxmms" = "xyes")
+### END of check for libxmms ###
+
# Check for enabled/disabled features
#
AC_COLLECTD([processes], [disable], [module], [processes statistics])
AC_COLLECTD([sensors], [disable], [module], [lm_sensors statistics])
AC_COLLECTD([serial], [disable], [module], [serial statistics])
+AC_COLLECTD([snmp], [disable], [module], [serial statistics])
AC_COLLECTD([logfile], [disable], [module], [logfile log facility])
AC_COLLECTD([swap], [disable], [module], [swap statistics])
AC_COLLECTD([syslog], [disable], [module], [syslog log facility])
AC_COLLECTD([users], [disable], [module], [user count statistics])
AC_COLLECTD([vserver], [disable], [module], [vserver statistics])
AC_COLLECTD([wireless], [disable], [module], [wireless link statistics])
+AC_COLLECTD([xmms], [disable], [module], [wireless link statistics])
AC_OUTPUT(Makefile src/Makefile src/collectd.conf src/liboconfig/Makefile src/liboping/Makefile)
-if test "x$with_libperl" != "xyes"
+if test "x$with_libperl" = "xyes"
then
+ with_libperl="yes (version `perl -MConfig -e 'print $Config{version};'`)"
+else
enable_perl="no (needs libperl)"
fi
libiptc . . . . . . $with_libiptc
libkstat . . . . . $with_kstat
libmysql . . . . . $with_libmysql
+ libnetsnmp . . . . $with_libnetsnmp
+ liboconfig . . . . $with_liboconfig
liboping . . . . . $with_liboping
libpcap . . . . . . $with_libpcap
libperl . . . . . . $with_libperl
libsensors . . . . $with_lm_sensors
libstatgrab . . . . $with_libstatgrab
libupsclient . . . $with_libupsclient
+ libxmms . . . . . . $with_libxmms
Features:
daemon mode . . . . $enable_daemon
processes . . . . . $enable_processes
sensors . . . . . . $enable_sensors
serial . . . . . . $enable_serial
+ snmp . . . . . . . $enable_snmp
swap . . . . . . . $enable_swap
syslog . . . . . . $enable_syslog
tape . . . . . . . $enable_tape
users . . . . . . . $enable_users
vserver . . . . . . $enable_vserver
wireless . . . . . $enable_wireless
+ xmms . . . . . . . $enable_xmms
EOF