summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b72fe13)
raw | patch | inline | side by side (parent: b72fe13)
author | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Tue, 10 Apr 2007 14:56:14 +0000 (16:56 +0200) | ||
committer | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Tue, 10 Apr 2007 14:56:14 +0000 (16:56 +0200) |
configure.in | patch | blob | history | |
src/Makefile.am | patch | blob | history |
diff --git a/configure.in b/configure.in
index ebbf8a761dba07d3312e04e3a6f2e4e00c658d8a..91d13e801a9ed0449c2153d434fdd80769ccabae 100644 (file)
--- a/configure.in
+++ b/configure.in
[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_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
diff --git a/src/Makefile.am b/src/Makefile.am
index 01673e0eb33de5e368c475c2fb0f16c6ebf57054..1016bfe871f49accd408f09b3e69deec817664e4 100644 (file)
--- a/src/Makefile.am
+++ b/src/Makefile.am
collectd_DEPENDENCIES += nut.la
endif
+if BUILD_WITH_LIBPERL
if BUILD_MODULE_PERL
pkglib_LTLIBRARIES += perl.la
perl_la_SOURCES = perl.c
collectd_LDADD += "-dlopen" perl.la
collectd_DEPENDENCIES += perl.la
endif
+endif
if BUILD_MODULE_PING
pkglib_LTLIBRARIES += ping.la