From: Steven Rostedt <rostedt@goodmis.org>
To: Linux Trace Devel <linux-trace-devel@vger.kernel.org>
Subject: [PATCH] trace-cmd: Add LOCAL_LIBS variable to force building the local libraries
Date: Mon, 21 Dec 2020 09:58:45 -0500 [thread overview]
Message-ID: <20201221095845.1a6f2aa7@gandalf.local.home> (raw)
From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>
In the process of changing the API for libtracefs before it becomes live,
add LOCAL_LIBS make command line variable to allow overriding the check if
libtracevent and libtracefs exist. If LOCAL_LIBS=1 is set on the make
command line, then the local versions of the libraries are built.
This is mostly for debug purposes, so it does not need to be documented.
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
Makefile | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
index 7aef50b3..eb833f67 100644
--- a/Makefile
+++ b/Makefile
@@ -232,7 +232,15 @@ LIBTRACEFS=libtracefs
LIBTRACEFS_DIR = $(obj)/lib/tracefs
LIBTRACEFS_STATIC = $(LIBTRACEFS_DIR)/libtracefs.a
-ifeq ($(shell sh -c "$(PKG_CONFIG) --cflags $(LIBTRACEEVENT) > /dev/null 2>&1 && echo y"), y)
+# In the special case (debugging), that the local versions of the
+# libraries need to be built, adding "LOCAL_LIBS=1" to the make
+# command line will skip the check if they are installed.
+ifneq ("$(origin LOCAL_LIBS)", "command line")
+TEST_LIBTRACEEVENT = $(shell sh -c "$(PKG_CONFIG) --cflags $(LIBTRACEEVENT) > /dev/null 2>&1 && echo y")
+TEST_LIBTRACEFS = $(shell sh -c "$(PKG_CONFIG) --cflags $(LIBTRACEFS) > /dev/null 2>&1 && echo y")
+endif
+
+ifeq ("$(TEST_LIBTRACEEVENT)", "y")
LIBTRACEEVENT_CFLAGS = $(shell sh -c "$(PKG_CONFIG) --cflags $(LIBTRACEEVENT)")
LIBTRACEEVENT_LDLAGS = $(shell sh -c "$(PKG_CONFIG) --libs $(LIBTRACEEVENT)")
else
@@ -243,7 +251,7 @@ endif
export LIBTRACEEVENT_CFLAGS LIBTRACEEVENT_LDLAGS
-ifeq ($(shell sh -c "$(PKG_CONFIG) --cflags $(LIBTRACEFS) > /dev/null 2>&1 && echo y"), y)
+ifeq ("$(TEST_LIBTRACEFS)", "y")
LIBTRACEFS_CFLAGS = $(shell sh -c "$(PKG_CONFIG) --cflags $(LIBTRACEFS)")
LIBTRACEFS_LDLAGS = $(shell sh -c "$(PKG_CONFIG) --libs $(LIBTRACEFS)")
else
--
2.25.4
reply other threads:[~2020-12-21 14:59 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20201221095845.1a6f2aa7@gandalf.local.home \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).