Linux-Trace-Devel Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] libtracefs: Add Requires libtraceevent to pkg-config file
@ 2021-07-22 19:54 Steven Rostedt
  2021-07-23  0:02 ` Daniel Bristot de Oliveira
  0 siblings, 1 reply; 2+ messages in thread
From: Steven Rostedt @ 2021-07-22 19:54 UTC (permalink / raw)
  To: linux-trace-devel; +Cc: Daniel Bristot de Oliveira

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] libtracefs: Add Requires libtraceevent to pkg-config file
  2021-07-22 19:54 [PATCH] libtracefs: Add Requires libtraceevent to pkg-config file Steven Rostedt
@ 2021-07-23  0:02 ` Daniel Bristot de Oliveira
  0 siblings, 0 replies; 2+ messages in thread
From: Daniel Bristot de Oliveira @ 2021-07-23  0:02 UTC (permalink / raw)
  To: Steven Rostedt, linux-trace-devel

On 7/22/21 9:54 PM, Steven Rostedt wrote:
> 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>

it works!

Tested-by: Daniel Bristot de Oliveira <bristot@redhat.com>

-- Daniel Bristot de Oliveira <bristot@redhat.com>


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-22 19:54 [PATCH] libtracefs: Add Requires libtraceevent to pkg-config file Steven Rostedt
2021-07-23  0:02 ` Daniel Bristot de Oliveira

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