perl-module: Copy Perl module from srcdir to builddir before distributing.
authorBen Pfaff <blp@cs.stanford.edu>
Mon, 30 May 2022 18:05:45 +0000 (11:05 -0700)
committerBen Pfaff <blp@cs.stanford.edu>
Mon, 30 May 2022 18:05:45 +0000 (11:05 -0700)
I ran into an issue where the Perl tests were failing in distcheck, but
not in check.  I changed the sources for the Perl module, but distcheck
still used the old ones.  It turns out that "make dist" uses files from
the builddir, which "make dist" wasn't updating from the srcdir because
that only happened when the Perl module was actually built, which "make
dist" and "make distcheck" don't do.

This commit fixes the problem by ensuring that the Perl module files get
updated in the builddir on "make dist".

perl-module/automake.mk

index d9e0882006a07f8a7f62b16be976a2e4fd6a7b81..9bec2192548a56e4844574b00db67af234f363c8 100644 (file)
@@ -57,8 +57,9 @@ PHONY += module-make
 module-make: perl-module/Makefile
        $(AM_V_GEN)cd perl-module && $(MAKE) $(PERL_MAKEFLAGS)
 
-ALL_LOCAL += perl_module_tarball
-perl_module_tarball: $(module_sources) src/libpspp-core.la
+PHONY += module-copy
+DIST_HOOKS += module-copy
+module-copy: $(module_sources)
        @if test x"$(top_builddir)" != x"$(top_srcdir)" ; then \
         for f in $(module_sources); do \
          destdir=`dirname $$f` ;\
@@ -75,6 +76,9 @@ perl_module_tarball: $(module_sources) src/libpspp-core.la
          fi ; \
         done \
        fi
+
+ALL_LOCAL += perl_module_tarball
+perl_module_tarball: src/libpspp-core.la module-copy
        $(AM_V_GEN)$(MAKE) $(PERL_MAKEFLAGS) module-make perl-module/PSPP-Perl-$(VERSION_FOR_PERL).tar.gz
 
 CLEAN_LOCAL += perl_module_clean