Skip to content

Commit

Permalink
Java: Fix parallel make with autotools
Browse files Browse the repository at this point in the history
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 libjpeg-turbo#62
  • Loading branch information
dcommander committed Mar 2, 2016
1 parent 056536f commit 7cb8de4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion java/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 7cb8de4

Please sign in to comment.