From 7cb8de4ae0a21257ced2e4f34cb0e884f18b6bd0 Mon Sep 17 00:00:00 2001 From: DRC Date: Wed, 2 Mar 2016 09:53:11 -0600 Subject: [PATCH] Java: Fix parallel make with autotools Running 'make -j{jobs}' on a build that was configured with Java (--with-java) would previously cause an error: make: *** No rule to make target `TJExample.class', needed by `turbojpeg.jar'. It seems that parallel make doesn't understand that the files in $(JAVA_CLASSES) are all generated from the same invocation of javac, so it tries to parallelize the building of those files (which of course doesn't work.) This patch instead makes turbojpeg.jar depend on classnoinst.stamp. This effectively creates a synchronization fence, since that file is only created when all of the class files have been built. Fixes #62 --- java/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java/Makefile.am b/java/Makefile.am index 475dd3fe..d3fc59c7 100644 --- a/java/Makefile.am +++ b/java/Makefile.am @@ -44,7 +44,7 @@ JAVA_CLASSES = org/libjpegturbo/turbojpeg/TJ.class \ all: all-am turbojpeg.jar -turbojpeg.jar: $(JAVA_CLASSES) ${srcdir}/MANIFEST.MF +turbojpeg.jar: classnoinst.stamp ${srcdir}/MANIFEST.MF $(JAR) cfm turbojpeg.jar ${srcdir}/MANIFEST.MF $(JAVA_CLASSES) clean-local: