linux-trace-devel.vger.kernel.org archive mirror
 help / color / mirror / 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 related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-04-06 19:59 UTC | newest]

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

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).