X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=bindings%2FMakefile.am;h=07373e87a62bd67c66cee878c0c389ab8e6d1e2d;hb=41b1a6627f6c6139c9c47d018f0b78c423ed19f1;hp=5aa49435fea620fa0d32ecf6a04bf523c248ebb6;hpb=61f5c1a972626212aab60c4d50f45097485b8e51;p=collectd.git diff --git a/bindings/Makefile.am b/bindings/Makefile.am index 5aa49435..07373e87 100644 --- a/bindings/Makefile.am +++ b/bindings/Makefile.am @@ -1,20 +1,69 @@ -EXTRA_DIST = perl/Collectd.pm perl/Makefile.PL perl/Collectd/Makefile.PL perl/Collectd/Unixsock.pm +SUBDIRS = -PERL_SUBDIR = $(srcdir)/perl +if BUILD_WITH_JAVA +SUBDIRS += java +endif + +EXTRA_DIST = perl/Makefile.PL \ + perl/uninstall_mod.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_SUBDIR)/Makefile ] || $(MAKE) -C $(PERL_SUBDIR) 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: + @PERL@ -I$(DESTDIR)$(prefix) $(srcdir)/perl/uninstall_mod.pl Collectd + find $(DESTDIR)$(prefix) -name "perllocal.pod" -exec rm {} \; clean-local: - [ ! -f $(PERL_SUBDIR)/Makefile ] || $(MAKE) -C $(PERL_SUBDIR) realclean + rm -rf buildperl + +perl: buildperl/Makefile + cd buildperl && $(MAKE) + +buildperl/Makefile: .perl-directory-stamp buildperl/Makefile.PL \ + $(top_builddir)/config.status + @# beautify the output a bit + @echo 'cd buildperl && @PERL@ Makefile.PL @PERL_BINDINGS_OPTIONS@' + @cd buildperl && ( if ! @PERL@ Makefile.PL @PERL_BINDINGS_OPTIONS@; then \ + echo ""; \ + echo 'Check whether you have set $$PERL_MM_OPT in your environment and try using ./configure --with-perl-bindings=""'; \ + echo ""; \ + fi ) -@srcdir@/perl: $(PERL_SUBDIR)/Makefile - $(MAKE) -C $(PERL_SUBDIR) +buildperl/Makefile.PL: .perl-directory-stamp $(top_builddir)/config.status -@srcdir@/perl/Makefile: @srcdir@/perl/Makefile.PL @srcdir@/perl/Collectd/Makefile.PL - cd $(PERL_SUBDIR) && @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: @srcdir@/perl +.PHONY: perl