From: Michael Jeanson Date: Thu, 25 Jun 2015 21:13:07 +0000 (-0400) Subject: Fix: build log4j example when enabled X-Git-Tag: v2.7.0-rc1~17 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=be347eb9b64f54c37940f272ba70c74a2f8330a5;p=lttng-ust.git Fix: build log4j example when enabled Signed-off-by: Michael Jeanson Signed-off-by: Mathieu Desnoyers --- diff --git a/.gitignore b/.gitignore index 166a260b..6ff01a4c 100644 --- a/.gitignore +++ b/.gitignore @@ -54,7 +54,7 @@ tests/benchmark/bench2 # Java agent library *.class -liblttng-ust-agent.jar +liblttng-ust-agent*.jar classnoinst.stamp jni-header.stamp jul-jni-header.stamp diff --git a/doc/examples/Makefile.am b/doc/examples/Makefile.am index 0d226021..9404054d 100644 --- a/doc/examples/Makefile.am +++ b/doc/examples/Makefile.am @@ -8,7 +8,7 @@ doc_examples_demo_tracelogdir = ${docdir}/examples/demo-tracelog doc_examples_clock_overridedir = ${docdir}/examples/clock-override doc_examples_getcpu_overridedir = ${docdir}/examples/getcpu-override -if BUILD_JAVA_AGENT +if BUILD_JAVA_AGENT_WITH_JUL doc_examples_java_juldir = ${docdir}/examples/java-jul dist_doc_examples_java_jul_DATA = java-jul/Makefile \ java-jul/Hello.java \ @@ -16,6 +16,14 @@ dist_doc_examples_java_jul_DATA = java-jul/Makefile \ SUBDIRS_JUL = java-jul endif +if BUILD_JAVA_AGENT_WITH_LOG4J +doc_examples_java_log4jdir = ${docdir}/examples/java-log4j +dist_doc_examples_java_log4j_DATA = java-log4j/Makefile \ + java-log4j/Hello.java \ + java-log4j/run +SUBDIRS_LOG4J = java-log4j +endif + dist_doc_examples_DATA = README dist_doc_examples_easy_ust_DATA = easy-ust/Makefile \ @@ -74,7 +82,7 @@ endif all-local: @if [ x"$(srcdir)" != x"$(builddir)" ]; then \ - for subdir in $(SUBDIRS_PROXY) $(SUBDIRS_JUL); do \ + for subdir in $(SUBDIRS_PROXY) $(SUBDIRS_JUL) $(SUBDIRS_LOG4J); do \ cp -pfR $(srcdir)/$$subdir $(builddir); \ done; \ fi; \ @@ -99,6 +107,11 @@ all-local: for subdir in $(SUBDIRS_JUL); do \ (cd $(SUBDIRS_JUL) && $(MAKE) JAVA_CLASSPATH_OVERRIDE="../../../liblttng-ust-java-agent/java" JAVA_JARFILE_OVERRIDE="liblttng-ust-agent.jar" $(AM_MAKEFLAGS) all && cd ..) || exit 1; \ done; \ + fi; \ + if [ x"$(SUBDIRS_LOG4J)" != x"" ]; then \ + for subdir in $(SUBDIRS_LOG4J); do \ + (cd $(SUBDIRS_LOG4J) && $(MAKE) JAVA_CLASSPATH_OVERRIDE="../../../liblttng-ust-java-agent/java" JAVA_JARFILE_OVERRIDE="liblttng-ust-agent.jar" $(AM_MAKEFLAGS) all && cd ..) || exit 1; \ + done; \ fi; clean-local: @@ -114,8 +127,15 @@ clean-local: fi; \ done; \ fi; \ + if [ x"$(SUBDIRS_LOG4J)" != x"" ]; then \ + for subdir in $(SUBDIRS_LOG4J); do \ + if [ -d $$subdir ]; then \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) clean && cd ..) || exit 1; \ + fi; \ + done; \ + fi; \ if [ x"$(srcdir)" != x"$(builddir)" ]; then \ - for subdir in $(SUBDIRS_PROXY) $(SUBDIRS_JUL); do \ + for subdir in $(SUBDIRS_PROXY) $(SUBDIRS_JUL) $(SUBDIRS_LOG4J); do \ rm -rf $(builddir)/$$subdir; \ done; \ fi; diff --git a/doc/examples/java-jul/run b/doc/examples/java-jul/run index 1beac853..37a3cfdf 100755 --- a/doc/examples/java-jul/run +++ b/doc/examples/java-jul/run @@ -16,7 +16,8 @@ if [ -f "$DIR/.intree" ]; then LIBPATH="../../../liblttng-ust-java-agent/jni/jul/.libs" else CLASSPATH="/usr/local/share/java/$JARFILE:/usr/share/java/$JARFILE" - LIBPATH="/usr/local/lib:/usr/lib" + # Use system defined java.library.path + #LIBPATH="/usr/local/lib:/usr/lib" fi java -classpath "$CLASSPATH:." -Djava.library.path="$LIBPATH" Hello diff --git a/doc/examples/java-log4j/.intree b/doc/examples/java-log4j/.intree new file mode 100644 index 00000000..e69de29b diff --git a/doc/examples/java-log4j/run b/doc/examples/java-log4j/run index 128725f1..5e3cbeb4 100755 --- a/doc/examples/java-log4j/run +++ b/doc/examples/java-log4j/run @@ -17,9 +17,10 @@ if [ -f "$DIR/.intree" ]; then LIBPATH="../../../liblttng-ust-java-agent/jni/log4j/.libs" else CLASSPATH="/usr/local/share/java/$JARFILE:/usr/share/java/$JARFILE:$LOG4J" - LIBPATH="/usr/local/lib:/usr/lib" + # Use system defined java.library.path + #LIBPATH="/usr/local/lib:/usr/lib" fi -java -classpath "$CLASSPATH:." Hello +java -classpath "$CLASSPATH:." -Djava.library.path="$LIBPATH" Hello cd -