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 5/6] libtracefs: Use pkg-config to find libtraceevent
Date: Tue, 08 Dec 2020 16:54:09 -0500	[thread overview]
Message-ID: <20201208215504.983661503@goodmis.org> (raw)
In-Reply-To: 20201208215404.135186972@goodmis.org

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

As libtracefs is dependent on libtraceevent, use the proper pkg-config
method to find where libtraceevent is installed.

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

diff --git a/Makefile b/Makefile
index f6b6a9ede5c0..be57682d37c9 100644
--- a/Makefile
+++ b/Makefile
@@ -62,6 +62,13 @@ pkgconfig_dir ?= $(word 1,$(shell $(PKG_CONFIG) 		\
 PKG_CONFIG_SOURCE_FILE = libtracefs.pc
 PKG_CONFIG_FILE := $(addprefix $(OUTPUT),$(PKG_CONFIG_SOURCE_FILE))
 
+LIBTRACEEVENT_INCLUDES = $(shell $(PKG_CONFIG) --cflags libtraceevent)
+LIBTRACEEVENT_LIBS = $(shell $(PKG_CONFIG) --libs libtraceevent)
+
+ifeq ("$(LIBTRACEEVENT_INCLUDES)","")
+$(error libtraceevent.so not installed)
+endif
+
 ifeq ($(prefix),/usr/local)
 etcdir ?= /etc
 else
@@ -128,7 +135,7 @@ export prefix bindir src obj bdir
 LIBTRACEFS_STATIC = $(bdir)/libtracefs.a
 LIBTRACEFS_SHARED = $(bdir)/libtracefs.so.$(TRACEFS_VERSION)
 
-TRACE_LIBS = -L$(bdir) -ltracefs
+TRACE_LIBS = $(LIBTRACEEVENT_LIBS)
 
 export LIBS TRACE_LIBS
 export LIBTRACEFS_STATIC LIBTRACEFS_SHARED
@@ -155,7 +162,7 @@ export CFLAGS
 export INCLUDES
 
 # Required CFLAGS
-override CFLAGS += -D_GNU_SOURCE
+override CFLAGS += -D_GNU_SOURCE $(LIBTRACEEVENT_INCLUDES)
 
 # Append required CFLAGS
 override CFLAGS += $(INCLUDES)
-- 
2.28.0



  parent reply	other threads:[~2020-12-08 21:56 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-08 21:54 [PATCH 0/6] libtracefs: Clean up of the source directory Steven Rostedt
2020-12-08 21:54 ` [PATCH 1/6] libtracefs: Move features.mk into scripts directory Steven Rostedt
2020-12-08 21:54 ` [PATCH 2/6] libtracefs: Remove LIBTRACEFS_DIR as it is the same as bdir Steven Rostedt
2020-12-08 21:54 ` [PATCH 3/6] libtracefs: Use LIBTRACEFS_STATIC/SHARED instead of open coding them Steven Rostedt
2020-12-08 21:54 ` [PATCH 4/6] libtracefs: Move source files to new src/ directory Steven Rostedt
2020-12-08 21:54 ` Steven Rostedt [this message]
2020-12-08 21:54 ` [PATCH 6/6] libtracefs: Have make clean remove the .so.X file Steven Rostedt
2020-12-09 14:49 ` [PATCH 0/6] libtracefs: Clean up of the source directory Tzvetomir Stoyanov

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=20201208215504.983661503@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.