X-Git-Url: https://git.octo.it/?a=blobdiff_plain;ds=sidebyside;f=bindings%2FMakefile.am;h=3876cc2c06d3f6ae70b08243cd18343b1c3f5a6f;hb=ab6ab6ad6428ba0a0987a20a7d1cfa47d6cc6f8b;hp=37e31ea19b0013672da7d4b7f79c9637630a3fc4;hpb=054651e4798cc8b9170c17fc7d8884b1bb1d7a87;p=collectd.git diff --git a/bindings/Makefile.am b/bindings/Makefile.am index 37e31ea1..3876cc2c 100644 --- a/bindings/Makefile.am +++ b/bindings/Makefile.am @@ -1,18 +1,66 @@ -EXTRA_DIST = perl/Collectd.pm perl/Makefile.PL perl/Collectd/Makefile.PL perl/Collectd/Unixsock.pm +SUBDIRS = + +if BUILD_WITH_JAVA +SUBDIRS += java +endif + +EXTRA_DIST = perl/Makefile.PL \ + perl/lib/Collectd.pm \ + perl/lib/Collectd/Unixsock.pm \ + perl/lib/Collectd/Plugins/Monitorus.pm \ + perl/lib/Collectd/Plugins/OpenVZ.pm + +CLEANFILES = \ + buildperl/Collectd.pm \ + buildperl/Collectd/Plugins/OpenVZ.pm \ + buildperl/Collectd/Unixsock.pm \ + buildperl/Makefile.PL \ + .perl-directory-stamp + +DISTCLEANFILES = \ + buildperl/Collectd.pm \ + buildperl/Collectd/Plugins/OpenVZ.pm \ + buildperl/Collectd/Unixsock.pm \ + buildperl/Makefile.PL \ + .perl-directory-stamp all-local: @PERL_BINDINGS@ + install-exec-local: - [ ! -f perl/Makefile ] || $(MAKE) -C perl install + [ ! -f buildperl/Makefile ] || ( cd buildperl && $(MAKE) install ) + +# Perl 'make uninstall' does not work as well as wanted. +# So we do the work here. +uninstall-local: + rm -f $(DESTDIR)$(mandir)/man3/Collectd::Unixsock.3pm + rm -f $(DESTDIR)$(datarootdir)/perl5/Collectd.pm + rm -f $(DESTDIR)$(datarootdir)/perl5/Collectd/Plugins/OpenVZ.pm + rm -f $(DESTDIR)$(datarootdir)/perl5/Collectd/Unixsock.pm + rm -f $(DESTDIR)$(prefix)/lib64/perl5/perllocal.pod + rm -f $(DESTDIR)$(prefix)/lib64/perl5/auto/Collectd/.packlist clean-local: - [ ! -f perl/Makefile ] || $(MAKE) -C perl realclean + rm -rf buildperl + +perl: buildperl/Makefile + cd buildperl && $(MAKE) + +buildperl/Makefile: .perl-directory-stamp buildperl/Makefile.PL \ + $(top_builddir)/config.status + cd buildperl && @PERL@ Makefile.PL INSTALL_BASE=$(prefix) @PERL_BINDINGS_OPTIONS@ -perl: perl/Makefile - $(MAKE) -C perl +buildperl/Makefile.PL: .perl-directory-stamp $(top_builddir)/config.status -perl/Makefile: perl/Makefile.PL perl/Collectd/Makefile.PL - cd perl && @PERL@ Makefile.PL PREFIX=$(prefix) @PERL_BINDINGS_OPTIONS@ +.perl-directory-stamp: + if test ! -d buildperl; then \ + mkdir -p buildperl/Collectd/Plugins; \ + cp $(srcdir)/perl/lib/Collectd.pm buildperl/; \ + cp $(srcdir)/perl/Makefile.PL buildperl/; \ + cp $(srcdir)/perl/lib/Collectd/Unixsock.pm buildperl/Collectd/; \ + cp $(srcdir)/perl/lib/Collectd/Plugins/OpenVZ.pm buildperl/Collectd/Plugins/; \ + fi + touch $@ .PHONY: perl