From: Steven Rostedt <rostedt@goodmis.org>
To: "linux-trace-devel@vger.kernel.org" <linux-trace-devel@vger.kernel.org>
Cc: Daniel Bristot de Oliveira <bristot@redhat.com>
Subject: [PATCH] libtracefs: Add Requires libtraceevent to pkg-config file
Date: Thu, 22 Jul 2021 15:54:35 -0400 [thread overview]
Message-ID: <20210722155435.773e91ec@oasis.local.home> (raw)
From e0e16d1a16749dccd3c00261e6dcb78f2e55e8ec Mon Sep 17 00:00:00 2001
From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>
Date: Thu, 22 Jul 2021 15:44:55 -0400
Subject: [PATCH] libtracefs: Add Requires libtraceevent to pkg-config file
If a developer uses libtracefs only, they should not need to know about
libtraceevent just because libtracefs requires it.
The pkg-config pc file has an option to handle such cases, called
"Requires:". Utilize this feature so that users using libtracefs only need
to do:
CFLAGS = `pkg-config --cflags --libs libtracefs`
And not:
CFLAGS = `pkg-config --cflags --libs libtracefs libtraceevent`
As with the Requires option, pkg-config now produces:
$ pkg-config --cflags --libs libtracefs
-I/usr/local/include/tracefs -I/usr/local/include/traceevent -ltracefs -ltraceevent
Reported-by: Daniel Bristot de Oliveira <bristot@redhat.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
Makefile | 3 ++-
libtracefs.pc.template | 1 +
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index b509388..395b207 100644
--- a/Makefile
+++ b/Makefile
@@ -215,7 +215,8 @@ define do_make_pkgconfig_file
sed -i "s|INSTALL_PREFIX|${1}|g" ${PKG_CONFIG_FILE}; \
sed -i "s|LIB_VERSION|${TRACEFS_VERSION}|g" ${PKG_CONFIG_FILE}; \
sed -i "s|LIB_DIR|${libdir_relative}|g" ${PKG_CONFIG_FILE}; \
- sed -i "s|HEADER_DIR|$(includedir_relative)|g" ${PKG_CONFIG_FILE};
+ sed -i "s|HEADER_DIR|$(includedir_relative)|g" ${PKG_CONFIG_FILE}; \
+ sed -i "s|LIBTRACEEVENT_MIN|$(LIBTRACEEVENT_MIN_VERSION)|g" ${PKG_CONFIG_FILE};
endef
BUILD_PREFIX := $(BUILD_OUTPUT)/build_prefix
diff --git a/libtracefs.pc.template b/libtracefs.pc.template
index a674fee..09b335b 100644
--- a/libtracefs.pc.template
+++ b/libtracefs.pc.template
@@ -6,5 +6,6 @@ Name: libtracefs
URL: https://git.kernel.org/pub/scm/libs/libtrace/libtracefs.git/
Description: Library for accessing ftrace file system
Version: LIB_VERSION
+Requires: libtraceevent > LIBTRACEEVENT_MIN
Cflags: -I${includedir}
Libs: -L${libdir} -ltracefs
--
2.31.1
next reply other threads:[~2021-07-22 19:54 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-22 19:54 Steven Rostedt [this message]
2021-07-23 0:02 ` [PATCH] libtracefs: Add Requires libtraceevent to pkg-config file Daniel Bristot de Oliveira
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=20210722155435.773e91ec@oasis.local.home \
--to=rostedt@goodmis.org \
--cc=bristot@redhat.com \
--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).