perl_module_tarball invokes module-make in a submake. In turn, until now
module-make has depended on src/libpspp-core.la. But if a parallel build
is in progress, then the parent make is likely also building the same
library. Sometimes the race in linking this library causes build failures.
The ideal solution would be to avoid the submake. We could do this, by
giving the files in the build different names from those in the source
directory (e.g. distributing the files with .dist extensions, or copying
them into or out of a subdirectory).
This commit instead implements a minimal fix, by making the dependency on
src/libpspp-core.la part of the top-level perl_module_tarball target,
instead of part of the submake's module-make target.
With this commit, 10 consecutive test runs on my laptop completed
successfully. Without this commit, about 50% of nontrivial builds fail.
cd perl-module && $(MAKE) $(AM_MAKEFLAGS) tardist
PHONY += module-make
-module-make: perl-module/Makefile src/libpspp-core.la
+module-make: perl-module/Makefile
cd perl-module && $(MAKE) $(AM_MAKEFLAGS)
ALL_LOCAL += perl_module_tarball
-perl_module_tarball: $(module_sources)
+perl_module_tarball: $(module_sources) src/libpspp-core.la
if test x"$(top_builddir)" != x"$(top_srcdir)" ; then \
for f in $(module_sources); do \
destdir=`dirname $$f` ;\