From 5b32a3054c72ca5487f8d6458695a1459c1bd740 Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Fri, 28 Dec 2007 18:21:01 +0100 Subject: [PATCH] build system: Yet another way to solve the src-dir vs. build-dir issue. --- bindings/Makefile.am | 10 +++++++++- configure.in | 15 --------------- 2 files changed, 9 insertions(+), 16 deletions(-) diff --git a/bindings/Makefile.am b/bindings/Makefile.am index 37e31ea1..16872e88 100644 --- a/bindings/Makefile.am +++ b/bindings/Makefile.am @@ -11,8 +11,16 @@ clean-local: perl: perl/Makefile $(MAKE) -C perl -perl/Makefile: perl/Makefile.PL perl/Collectd/Makefile.PL +perl/Makefile: .perl-directory-stamp perl/Makefile.PL perl/Collectd/Makefile.PL cd perl && @PERL@ Makefile.PL PREFIX=$(prefix) @PERL_BINDINGS_OPTIONS@ +.perl-directory-stamp: + if test ! -d perl; then \ + mkdir -p perl/Collectd; \ + cp $(srcdir)/perl/{Collectd.pm,Makefile.PL} perl/; \ + cp $(srcdir)/perl/Collectd/{Unixsock.pm,Makefile.PL} perl/Collectd/; \ + fi + touch $@ + .PHONY: perl diff --git a/configure.in b/configure.in index 3c632c70..75bc00f4 100644 --- a/configure.in +++ b/configure.in @@ -1936,21 +1936,6 @@ then with_perl_bindings="yes ($PERL_BINDINGS_OPTIONS)" fi -if test ".." != "$ac_top_srcdir" -then - # we're not building from the source tree - for file in \ - bindings/perl/Collectd/Makefile.PL \ - bindings/perl/Collectd/Unixsock.pm \ - bindings/perl/Collectd.pm \ - bindings/perl/Makefile.PL - do - dir=`dirname $file` - mkdir -p $dir - cp src/$ac_top_srcdir/$file $file - done -fi - cat <