dnl Process this file with autoconf to produce a configure script.
-AC_INIT(collectd, 4.0.0-rc2)
+AC_INIT(collectd, 4.0.0-rc3)
AC_CONFIG_SRCDIR(src/collectd.c)
AC_CONFIG_HEADERS(src/config.h)
AM_INIT_AUTOMAKE(dist-bzip2)
[Wether or not to use the pcap library])
AM_CONDITIONAL(BUILD_WITH_LIBPCAP, test "x$with_libpcap" = "xyes")
+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"
+ with_libperl="yes"
+ fi
+],
+[
+ with_libperl="yes"
+])
+if test "x$with_libperl" = "xyes"
+then
+ SAVE_CFLAGS=$CFLAGS
+ SAVE_LDFLAGS=$LDFLAGS
+ CFLAGS="$CFLAGS `perl -MExtUtils::Embed -e ccopts`"
+ LDFLAGS="$LDFLAGS `perl -MExtUtils::Embed -e ldopts`"
+
+ AC_CACHE_CHECK([for libperl],
+ [have_libperl],
+ AC_LINK_IFELSE(
+ AC_LANG_PROGRAM(
+ [[
+#include <EXTERN.h>
+#include <perl.h>
+#include <XSUB.h>
+ ]],
+ [[
+ PerlInterpreter *perl = NULL;
+ Perl_load_module (perl, PERL_LOADMOD_NOIMPORT,
+ Perl_newSVpvf (perl, "Collectd::Plugin::%s", "foo"),
+ Nullsv);
+ ]]),
+ [have_libperl="yes"],
+ [have_libperl="no"]
+ )
+ )
+
+ if test "x$have_libperl" = "xyes"
+ then
+ AC_DEFINE(HAVE_LIBPERL, 1, [Define if libperl is present and usable.])
+ else
+ with_libperl="no"
+ fi
+
+ CFLAGS=$SAVE_CFLAGS
+ LDFLAGS=$SAVE_LDFLAGS
+fi
+AM_CONDITIONAL(BUILD_WITH_LIBPERL, test "x$with_libperl" = "xyes")
+
AC_ARG_WITH(libiptc, [AS_HELP_STRING([--with-libiptc@<:@=PREFIX@:>@], [Path to libiptc.])],
[
if test "x$withval" != "xno" && test "x$withval" != "xyes"
AC_COLLECTD([nfs], [disable], [module], [nfs statistics])
AC_COLLECTD([ntpd], [disable], [module], [ntpd statistics])
AC_COLLECTD([nut], [disable], [module], [network UPS tools statistics])
+AC_COLLECTD([perl], [disable], [module], [embedded perl interpreter])
AC_COLLECTD([ping], [disable], [module], [ping statistics])
AC_COLLECTD([processes], [disable], [module], [processes statistics])
AC_COLLECTD([sensors], [disable], [module], [lm_sensors statistics])
AC_OUTPUT(Makefile src/Makefile src/collectd.conf src/liboconfig/Makefile src/liboping/Makefile)
+if test "x$with_libperl" != "xyes"
+then
+ enable_perl="no (needs libperl)"
+fi
+
cat <<EOF;
Configuration:
libmysql . . . . . $with_libmysql
liboping . . . . . $with_liboping
libpcap . . . . . . $with_libpcap
+ libperl . . . . . . $with_libperl
libpthread . . . . $with_libpthread
librrd . . . . . . $with_rrdtool
libsensors . . . . $with_lm_sensors
nfs . . . . . . . . $enable_nfs
ntpd . . . . . . . $enable_ntpd
nut . . . . . . . . $enable_nut
+ perl . . . . . . . $enable_perl
ping . . . . . . . $enable_ping
processes . . . . . $enable_processes
sensors . . . . . . $enable_sensors