linux-trace-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Linux Trace Devel <linux-trace-devel@vger.kernel.org>
Subject: [PATCH] trace-cmd: Use pkg-config --atleast-version to check versions of libraries
Date: Tue, 6 Apr 2021 15:58:56 -0400	[thread overview]
Message-ID: <20210406155856.7735875a@gandalf.local.home> (raw)

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

When checking for libtraceevent and libtracefs, instead of using
pkg-config to simply check if the libraries exist, also make sure the
version for this build exists, as trace-cmd will start needing new
features from these libraries that are not yet implemented.

Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
 Makefile | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/Makefile b/Makefile
index e1b10042..7971f01c 100644
--- a/Makefile
+++ b/Makefile
@@ -20,6 +20,9 @@ export LIBTC_PATCHLEVEL
 export LIBTC_EXTRAVERSION
 export LIBTRACECMD_VERSION
 
+LIBTRACEEVENT_MIN_VERSION = 1.1
+LIBTRACEFS_MIN_VERSION = 1.0
+
 MAKEFLAGS += --no-print-directory
 
 # Makefiles suck: This macro sets a default value of $(2) for the
@@ -227,8 +230,8 @@ export LIBTRACECMD_SHARED_VERSION LIBTRACECMD_SHARED_SO
 LIBTRACEEVENT=libtraceevent
 LIBTRACEFS=libtracefs
 
-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")
+TEST_LIBTRACEEVENT = $(shell sh -c "$(PKG_CONFIG) --atleast-version $(LIBTRACEEVENT_MIN_VERSION) $(LIBTRACEEVENT) > /dev/null 2>&1 && echo y")
+TEST_LIBTRACEFS = $(shell sh -c "$(PKG_CONFIG) --atleast-version $(LIBTRACEFS_MIN_VERSION) $(LIBTRACEFS) > /dev/null 2>&1 && echo y")
 
 ifeq ("$(TEST_LIBTRACEEVENT)", "y")
 LIBTRACEEVENT_CFLAGS = $(shell sh -c "$(PKG_CONFIG) --cflags $(LIBTRACEEVENT)")
@@ -237,7 +240,7 @@ else
 .PHONY: warning
 warning:
 	@echo "********************************************"
-	@echo "** NOTICE: libtraceevent not found on system"
+	@echo "** NOTICE: libtraceevent version $(LIBTRACEEVENT_MIN_VERSION) or higher not found on system"
 	@echo "**"
 	@echo "** Consider installing the latest libtraceevent from your"
 	@echo "** distribution, or from source:"
@@ -256,7 +259,7 @@ else
 .PHONY: warning
 warning:
 	@echo "********************************************"
-	@echo "** NOTICE: libtracefs not found on system"
+	@echo "** NOTICE: libtracefs version $(LIBTRACEFS_MIN_VERSION) or higher not found on system"
 	@echo "**"
 	@echo "** Consider installing the latest libtracefs from your"
 	@echo "** distribution, or from source:"
-- 
2.29.2


                 reply	other threads:[~2021-04-06 19: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=20210406155856.7735875a@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).