From: mjeanson@efficios.com (Michael Jeanson)
Subject: [lttng-dev] [PATCH lttng-ust] Fix: build log4j example when enabled
Date: Thu, 25 Jun 2015 17:13:07 -0400 [thread overview]
Message-ID: <1435266787-16048-1-git-send-email-mjeanson@efficios.com> (raw)
Signed-off-by: Michael Jeanson <mjeanson at efficios.com>
---
.gitignore | 2 +-
doc/examples/Makefile.am | 26 +++++++++++++++++++++++---
doc/examples/java-jul/run | 3 ++-
doc/examples/java-log4j/.intree | 0
doc/examples/java-log4j/run | 5 +++--
5 files changed, 29 insertions(+), 7 deletions(-)
create mode 100644 doc/examples/java-log4j/.intree
diff --git a/.gitignore b/.gitignore
index 166a260..6ff01a4 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 0d22602..9404054 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 1beac85..37a3cfd 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 0000000..e69de29
diff --git a/doc/examples/java-log4j/run b/doc/examples/java-log4j/run
index 128725f..5e3cbeb 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 -
--
1.9.1
next reply other threads:[~2015-06-25 21:13 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-25 21:13 Michael Jeanson [this message]
2015-06-25 21:18 ` Mathieu Desnoyers
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1435266787-16048-1-git-send-email-mjeanson@efficios.com \
--to=mjeanson@efficios.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox