From a459afe5f3097680f41e56b9cafa1198294ce8fc Mon Sep 17 00:00:00 2001 From: Sebastian Harl Date: Mon, 1 Oct 2007 00:08:43 +0200 Subject: [PATCH] Moved contrib/PerlLib/ to bindings/perl/. Added bindings/Makefile.am and bindings/perl/Collectd/Makefile.PL, bindings/perl/Makefile.PL to integrate the Perl modules into the build system and the official distribution. Signed-off-by: Sebastian Harl --- Makefile.am | 2 +- bindings/Makefile.am | 18 +++++++++ .../PerlLib => bindings/perl}/Collectd.pm | 0 bindings/perl/Collectd/Makefile.PL | 9 +++++ .../perl}/Collectd/Unixsock.pm | 0 bindings/perl/Makefile.PL | 9 +++++ configure.in | 37 ++++++++++++++++++- 7 files changed, 72 insertions(+), 3 deletions(-) create mode 100644 bindings/Makefile.am rename {contrib/PerlLib => bindings/perl}/Collectd.pm (100%) create mode 100644 bindings/perl/Collectd/Makefile.PL rename {contrib/PerlLib => bindings/perl}/Collectd/Unixsock.pm (100%) create mode 100644 bindings/perl/Makefile.PL diff --git a/Makefile.am b/Makefile.am index 34c36cc0..dfef7dd4 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,4 +1,4 @@ -SUBDIRS = libltdl src +SUBDIRS = libltdl src bindings INCLUDES = $(LTDLINCL) diff --git a/bindings/Makefile.am b/bindings/Makefile.am new file mode 100644 index 00000000..37e31ea1 --- /dev/null +++ b/bindings/Makefile.am @@ -0,0 +1,18 @@ +EXTRA_DIST = perl/Collectd.pm perl/Makefile.PL perl/Collectd/Makefile.PL perl/Collectd/Unixsock.pm + +all-local: @PERL_BINDINGS@ + +install-exec-local: + [ ! -f perl/Makefile ] || $(MAKE) -C perl install + +clean-local: + [ ! -f perl/Makefile ] || $(MAKE) -C perl realclean + +perl: perl/Makefile + $(MAKE) -C perl + +perl/Makefile: perl/Makefile.PL perl/Collectd/Makefile.PL + cd perl && @PERL@ Makefile.PL PREFIX=$(prefix) @PERL_BINDINGS_OPTIONS@ + +.PHONY: perl + diff --git a/contrib/PerlLib/Collectd.pm b/bindings/perl/Collectd.pm similarity index 100% rename from contrib/PerlLib/Collectd.pm rename to bindings/perl/Collectd.pm diff --git a/bindings/perl/Collectd/Makefile.PL b/bindings/perl/Collectd/Makefile.PL new file mode 100644 index 00000000..be0ec91c --- /dev/null +++ b/bindings/perl/Collectd/Makefile.PL @@ -0,0 +1,9 @@ +use ExtUtils::MakeMaker; + +WriteMakefile( + 'NAME' => 'Collectd::Unixsock', + 'VERSION' => '4.1.2', + 'AUTHOR' => 'Florian Forster ', +); + +# vim: set sw=4 ts=4 tw=78 noexpandtab : diff --git a/contrib/PerlLib/Collectd/Unixsock.pm b/bindings/perl/Collectd/Unixsock.pm similarity index 100% rename from contrib/PerlLib/Collectd/Unixsock.pm rename to bindings/perl/Collectd/Unixsock.pm diff --git a/bindings/perl/Makefile.PL b/bindings/perl/Makefile.PL new file mode 100644 index 00000000..fab2dae4 --- /dev/null +++ b/bindings/perl/Makefile.PL @@ -0,0 +1,9 @@ +use ExtUtils::MakeMaker; + +WriteMakefile( + 'NAME' => 'Collectd', + 'VERSION' => '4.1.2', + 'AUTHOR' => 'Sebastian Harl ', +); + +# vim: set sw=4 ts=4 tw=78 noexpandtab : diff --git a/configure.in b/configure.in index 54d38d58..f67186ed 100644 --- a/configure.in +++ b/configure.in @@ -1145,6 +1145,9 @@ AC_ARG_WITH(libperl, [AS_HELP_STRING([--with-libperl@<:@=PREFIX@:>@], [Path to l [ with_libperl="yes" ]) + +AC_SUBST(PERL, "$perl_interpreter") + if test "x$with_libperl" = "xyes" then SAVE_CFLAGS=$CFLAGS @@ -1817,7 +1820,29 @@ AC_PLUGIN([vserver], [$plugin_vserver], [Linux VServer statistics]) AC_PLUGIN([wireless], [$plugin_wireless], [Wireless statistics]) AC_PLUGIN([xmms], [$with_libxmms], [XMMS statistics]) -AC_OUTPUT(Makefile src/Makefile src/collectd.conf src/liboconfig/Makefile src/liboping/Makefile) +dnl Perl bindings +AC_ARG_WITH(perl-bindings, [AS_HELP_STRING([--with-perl-bindings@<:@=OPTIONS@:>@], [Options passed to "perl Makefile.PL".])], +[ + if test "x$withval" != "xno" && test "x$withval" != "xyes" + then + PERL_BINDINGS_OPTIONS="$withval" + with_perl_bindings="yes" + fi +], +[ + PERL_BINDINGS_OPTIONS="" + with_perl_bindings="yes" +]) +if test "x$with_perl_bindings" = "xyes" +then + PERL_BINDINGS="perl" +else + PERL_BINDINGS="" +fi +AC_SUBST(PERL_BINDINGS) +AC_SUBST(PERL_BINDINGS_OPTIONS) + +AC_OUTPUT(Makefile src/Makefile src/collectd.conf src/liboconfig/Makefile src/liboping/Makefile bindings/Makefile) if test "x$with_liboping" = "xyes" -a "x$with_own_liboping" = "xyes" then @@ -1826,11 +1851,16 @@ fi if test "x$with_libperl" = "xyes" then - with_libperl="yes (version `perl -MConfig -e 'print $Config{version};'`)" + with_libperl="yes (version `$perl_interpreter -MConfig -e 'print $Config{version};'`)" else enable_perl="no (needs libperl)" fi +if test "x$with_perl_bindings" = "xyes" -a "x$PERL_BINDINGS_OPTIONS" != "x" +then + with_perl_bindings="yes ($PERL_BINDINGS_OPTIONS)" +fi + cat <