Linux-Trace-Devel Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] trace-cmd: Use pkg-config --atleast-version to check versions of libraries
@ 2021-04-06 19:58 Steven Rostedt
  0 siblings, 0 replies; only message in thread
From: Steven Rostedt @ 2021-04-06 19:58 UTC (permalink / raw)
  To: Linux Trace Devel

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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, back to index

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-06 19:58 [PATCH] trace-cmd: Use pkg-config --atleast-version to check versions of libraries Steven Rostedt

Linux-Trace-Devel Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-trace-devel/0 linux-trace-devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-trace-devel linux-trace-devel/ https://lore.kernel.org/linux-trace-devel \
		linux-trace-devel@vger.kernel.org
	public-inbox-index linux-trace-devel

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-trace-devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git