All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: linux-trace-devel@vger.kernel.org
Subject: [PATCH 8/9] trace-cmd: Have "make test" use system libraries if present
Date: Wed, 09 Dec 2020 21:29:14 -0500	[thread overview]
Message-ID: <20201210022944.023068632@goodmis.org> (raw)
In-Reply-To: 20201210022906.112066412@goodmis.org

From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>

Update the Makefiles so that "make test" will use the system libraries of
libtraceevent and libtracefs if they are present, and only build them
locally if they are not.

Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
 Makefile       | 5 ++++-
 utest/Makefile | 4 +---
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/Makefile b/Makefile
index c6cdeeaef46d..8d82db567a52 100644
--- a/Makefile
+++ b/Makefile
@@ -215,6 +215,8 @@ LIBTRACEEVENT_LDLAGS = -L$(LIBTRACEEVENT_DIR) -ltraceevent
 LIBTRACEEVENT_STATIC_BUILD = $(LIBTRACEEVENT_STATIC)
 endif
 
+export LIBTRACEEVENT_CFLAGS LIBTRACEEVENT_LDLAGS
+
 ifeq ($(shell sh -c "pkg-config --cflags $(LIBTRACEFS) > /dev/null 2>&1 && echo y"), y)
 LIBTRACEFS_CFLAGS = $(shell sh -c "pkg-config --cflags $(LIBTRACEFS)")
 LIBTRACEFS_LDLAGS = $(shell sh -c "pkg-config --libs $(LIBTRACEFS)")
@@ -224,6 +226,7 @@ LIBTRACEFS_LDLAGS = -L$(LIBTRACEFS_DIR) -ltracefs
 LIBTRACEFS_STATIC_BUILD = $(LIBTRACEFS_STATIC)
 endif
 
+export LIBTRACEFS_CFLAGS LIBTRACEFS_LDLAGS
 
 TRACE_LIBS = -L$(LIBTRACECMD_DIR) -ltracecmd	\
 	     $(LIBTRACEEVENT_LDLAGS) $(LIBTRACEFS_LDLAGS)
@@ -358,7 +361,7 @@ libtracefs.so: $(LIBTRACEFS_SHARED)
 
 libs: $(LIBTRACECMD_SHARED) $(LIBTRACEEVENT_SHARED) $(LIBTRACEFS_SHARED)
 
-test: force $(LIBTRACEEVENT_STATIC) $(LIBTRACEFS_STATIC) $(LIBTRACECMD_STATIC)
+test: force $(LIBTRACEEVENT_STATIC_BUILD) $(LIBTRACEFS_STATIC_BUILD) $(LIBTRACECMD_STATIC)
 ifneq ($(CUNIT_INSTALLED),1)
 	$(error CUnit framework not installed, cannot build unit tests))
 endif
diff --git a/utest/Makefile b/utest/Makefile
index d635650d46e1..55828abb59e3 100644
--- a/utest/Makefile
+++ b/utest/Makefile
@@ -9,9 +9,7 @@ OBJS =
 OBJS += trace-utest.o
 OBJS += tracefs-utest.o
 
-LIBS += -lcunit				\
-	-L$(LIBTRACEFS_DIR) -ltracefs	\
-	-L$(LIBTRACEEVENT_DIR) -ltraceevent
+LIBS += -lcunit $(LIBTRACEEVENT_LDLAGS) $(LIBTRACEFS_LDLAGS)
 
 OBJS := $(OBJS:%.o=$(bdir)/%.o)
 DEPS := $(OBJS:$(bdir)/%.o=$(bdir)/.%.d)
-- 
2.29.2



  parent reply	other threads:[~2020-12-10  2:31 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-10  2:29 [PATCH 0/9] trace-cmd: Clean ups and fixes for installing libraries Steven Rostedt
2020-12-10  2:29 ` [PATCH 1/9] trace-cmd: Fix whitespace in usage message of trace-cmd report --ts-diff Steven Rostedt
2020-12-10  2:29 ` [PATCH 2/9] trace-cmd: Add reference to trace-cmd.org in README Steven Rostedt
2020-12-10  2:29 ` [PATCH 3/9] trace-cmd: Add --ts-check option to report Steven Rostedt
2020-12-10  2:29 ` [PATCH 4/9] trace-cmd: Update .gitignore Steven Rostedt
2020-12-10  2:29 ` [PATCH 5/9] libtracefs: Extend tracefs_iterate_raw_events() to iterate per CPU Steven Rostedt
2020-12-10  2:29 ` [PATCH 6/9] libtracefs: Unit test for tracefs_iterate_raw_events() " Steven Rostedt
2020-12-10  2:29 ` [PATCH 7/9] trace-cmd: Use system trace libraries, if available Steven Rostedt
2020-12-10  2:29 ` Steven Rostedt [this message]
2020-12-10  2:29 ` [PATCH 9/9] trace-cmd: Only install libtraceevent and libtracefs if not in system Steven Rostedt

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=20201210022944.023068632@goodmis.org \
    --to=rostedt@goodmis.org \
    --cc=linux-trace-devel@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.