summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 5c54fc8)
raw | patch | inline | side by side (parent: 5c54fc8)
author | Florian Forster <octo@crystal.wlan.home.verplant.org> | |
Fri, 20 Apr 2007 06:19:18 +0000 (08:19 +0200) | ||
committer | Florian Forster <octo@crystal.wlan.home.verplant.org> | |
Fri, 20 Apr 2007 06:19:18 +0000 (08:19 +0200) |
configure.in | patch | blob | history | |
src/Makefile.am | patch | blob | history |
diff --git a/configure.in b/configure.in
index 3d8cf403b2d31736f4a8428045a1b1a4038df064..2cb067b7c6ddabd679022956c9e084455eb6f231 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")
+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
diff --git a/src/Makefile.am b/src/Makefile.am
index 99a8de2d05061a557f2efd5230963c0e19e4cb2b..72d67b3be3c0410015048ef75c409009b0a3979d 100644 (file)
--- a/src/Makefile.am
+++ b/src/Makefile.am
pkglib_LTLIBRARIES += perl.la
perl_la_SOURCES = perl.c
perl_la_CFLAGS = $(AM_CFLAGS) \
- $(shell perl -MExtUtils::Embed -e ccopts) \
+ $(PERL_CFLAGS) \
-DXS_VERSION=\"$(VERSION)\" -DVERSION=\"$(VERSION)\"
perl_la_LDFLAGS = -module -avoid-version \
- $(shell perl -MExtUtils::Embed -e ldopts)
+ $(PERL_LDFLAGS)
collectd_LDADD += "-dlopen" perl.la
collectd_DEPENDENCIES += perl.la
endif