fix: Java examples CLASSPATH override
authorMichael Jeanson <mjeanson@efficios.com>
Wed, 22 Apr 2020 20:32:51 +0000 (16:32 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 22 Apr 2020 20:46:54 +0000 (16:46 -0400)
Variables provided to make as arguments, called 'command variables' can't
be reassigned a new value in the Makefile. Since the CLASSPATH is now
passed this way in the glue between automake and the example makefiles,
use different names for the internal variables.

Change-Id: Id6289273f211f544a66d933a96f06df75243415f
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
doc/examples/java-jul/Makefile
doc/examples/java-log4j/Makefile

index 8597c7af51e99ea1d809029bb0638926768690f0..5a594ff3e2f200ef3d62f5cfa25d2c78fa5826e2 100644 (file)
@@ -22,20 +22,20 @@ JARFILE_COMMON=lttng-ust-agent-common.jar
 
 # Check if the top level makefile overrides the JUL Jar file's path.
 ifeq "$(JAVA_CLASSPATH_OVERRIDE_JUL)" ""
-       CLASSPATH=/usr/local/share/java/$(JARFILE_JUL):/usr/share/java/$(JARFILE_JUL)
+       JUL_CP = /usr/local/share/java/$(JARFILE_JUL):/usr/share/java/$(JARFILE_JUL)
 else
-       CLASSPATH=$(JAVA_CLASSPATH_OVERRIDE_JUL)/$(JARFILE_JUL)
+       JUL_CP = $(JAVA_CLASSPATH_OVERRIDE_JUL)/$(JARFILE_JUL)
 endif
 
 # Check if the top level makefile overrides the Common Jar file's path.
 ifeq "$(JAVA_CLASSPATH_OVERRIDE_COMMON)" ""
-       CLASSPATH:=$(CLASSPATH):/usr/local/share/java/$(JARFILE_COMMON):/usr/share/java/$(JARFILE_COMMON)
+       COMMON_CP = /usr/local/share/java/$(JARFILE_COMMON):/usr/share/java/$(JARFILE_COMMON)
 else
-       CLASSPATH:=$(CLASSPATH):$(JAVA_CLASSPATH_OVERRIDE_COMMON)/$(JARFILE_COMMON)
+       COMMON_CP = $(JAVA_CLASSPATH_OVERRIDE_COMMON)/$(JARFILE_COMMON)
 endif
 
 JFLAGS = -g
-JC = javac -classpath "$(CLASSPATH):."
+JC = javac -classpath "$(CLASSPATH):$(JUL_CP):$(COMMON_CP):."
 .SUFFIXES: .java .class
 .java.class:
        $(JC) $(JFLAGS) $*.java
index 59ffdf79c2ed95dc322c7733dfffad669fb83948..39c2e788bf66a50964d6d610195be1a4f965e88d 100644 (file)
@@ -27,20 +27,20 @@ endif
 
 # Check if the top level makefile overrides the Log4j Jar file's path.
 ifeq "$(JAVA_CLASSPATH_OVERRIDE_LOG4J)" ""
-       CLASSPATH:=$(CLASSPATH):/usr/local/share/java/$(JARFILE_LOG4J):/usr/share/java/$(JARFILE_LOG4J)
+       LOG4J_CP = /usr/local/share/java/$(JARFILE_LOG4J):/usr/share/java/$(JARFILE_LOG4J)
 else
-       CLASSPATH:=$(CLASSPATH):$(JAVA_CLASSPATH_OVERRIDE_LOG4J)/$(JARFILE_LOG4J)
+       LOG4J_CP = $(JAVA_CLASSPATH_OVERRIDE_LOG4J)/$(JARFILE_LOG4J)
 endif
 
 # Check if the top level makefile overrides the Common Jar file's path.
 ifeq "$(JAVA_CLASSPATH_OVERRIDE_COMMON)" ""
-       CLASSPATH:=$(CLASSPATH):/usr/local/share/java/$(JARFILE_COMMON):/usr/share/java/$(JARFILE_COMMON)
+       COMMON_CP = /usr/local/share/java/$(JARFILE_COMMON):/usr/share/java/$(JARFILE_COMMON)
 else
-       CLASSPATH:=$(CLASSPATH):$(JAVA_CLASSPATH_OVERRIDE_COMMON)/$(JARFILE_COMMON)
+       COMMON_CP = $(JAVA_CLASSPATH_OVERRIDE_COMMON)/$(JARFILE_COMMON)
 endif
 
 JFLAGS = -g
-JC = javac -classpath "$(CLASSPATH):."
+JC = javac -classpath "$(CLASSPATH):$(LOG4J_CP):$(COMMON_CP):."
 .SUFFIXES: .java .class
 .java.class:
        $(JC) $(JFLAGS) $*.java
This page took 0.026252 seconds and 4 git commands to generate.