linux-trace-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] trace-cmd: Add Requires: libtracefs to libtracecmd.pc file
@ 2021-11-09 16:14 Steven Rostedt
  2021-11-10 14:12 ` Yordan Karadzhov
  0 siblings, 1 reply; 5+ messages in thread
From: Steven Rostedt @ 2021-11-09 16:14 UTC (permalink / raw)
  To: Linux Trace Devel

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

In order to not have users of libtracecmd having to also include the
includes and libraries for libtracefs and libraceevent, add a requires
field for libtracefs to the libtracecmd.pc file. As libtracefs requires
libtraceevent, it will pull that one in as well.

Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
 libtracecmd.pc.template | 1 +
 scripts/utils.mk        | 1 +
 2 files changed, 2 insertions(+)

diff --git a/libtracecmd.pc.template b/libtracecmd.pc.template
index dc41076e..bcf4e39d 100644
--- a/libtracecmd.pc.template
+++ b/libtracecmd.pc.template
@@ -6,5 +6,6 @@ Name: libtracecmd
 URL: https://git.kernel.org/pub/scm/utils/trace-cmd/trace-cmd.git/
 Description: Library for creating and reading trace-cmd data files
 Version: LIB_VERSION
+Requires: libtracefs >= LIBTRACEFS_MIN_VERSION
 Cflags: -I${includedir}
 Libs: -L${libdir} -ltracecmd
diff --git a/scripts/utils.mk b/scripts/utils.mk
index 237b2fc9..6865a746 100644
--- a/scripts/utils.mk
+++ b/scripts/utils.mk
@@ -169,6 +169,7 @@ define do_make_pkgconfig_file
 	sed -i "s|INSTALL_PREFIX|${1}|g" ${PKG_CONFIG_FILE}; 		\
 	sed -i "s|LIB_VERSION|${LIBTRACECMD_VERSION}|g" ${PKG_CONFIG_FILE}; \
 	sed -i "s|LIB_DIR|$(libdir)|g" ${PKG_CONFIG_FILE}; \
+	sed -i "s|LIBTRACEFS_MIN_VERSION|$(LIBTRACEFS_MIN_VERSION)|g" ${PKG_CONFIG_FILE}; \
 	sed -i "s|HEADER_DIR|$(includedir)/trace-cmd|g" ${PKG_CONFIG_FILE};
 endef
 
-- 
2.31.1


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

* Re: [PATCH] trace-cmd: Add Requires: libtracefs to libtracecmd.pc file
  2021-11-09 16:14 [PATCH] trace-cmd: Add Requires: libtracefs to libtracecmd.pc file Steven Rostedt
@ 2021-11-10 14:12 ` Yordan Karadzhov
  2021-11-10 16:17   ` Steven Rostedt
  0 siblings, 1 reply; 5+ messages in thread
From: Yordan Karadzhov @ 2021-11-10 14:12 UTC (permalink / raw)
  To: Steven Rostedt, Linux Trace Devel



On 9.11.21 г. 18:14 ч., Steven Rostedt wrote:
> From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>
> 
> In order to not have users of libtracecmd having to also include the
> includes and libraries for libtracefs and libraceevent, add a requires
> field for libtracefs to the libtracecmd.pc file. As libtracefs requires
> libtraceevent, it will pull that one in as well.
> 
> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
> ---
>   libtracecmd.pc.template | 1 +
>   scripts/utils.mk        | 1 +
>   2 files changed, 2 insertions(+)
> 
> diff --git a/libtracecmd.pc.template b/libtracecmd.pc.template
> index dc41076e..bcf4e39d 100644
> --- a/libtracecmd.pc.template
> +++ b/libtracecmd.pc.template
> @@ -6,5 +6,6 @@ Name: libtracecmd
>   URL: https://git.kernel.org/pub/scm/utils/trace-cmd/trace-cmd.git/
>   Description: Library for creating and reading trace-cmd data files
>   Version: LIB_VERSION
> +Requires: libtracefs >= LIBTRACEFS_MIN_VERSION

BTW this works also without the 'lib' prefix:

Requires: tracefs >= LIBTRACEFS_MIN_VERSION

cheers,
Yordan


>   Cflags: -I${includedir}
>   Libs: -L${libdir} -ltracecmd
> diff --git a/scripts/utils.mk b/scripts/utils.mk
> index 237b2fc9..6865a746 100644
> --- a/scripts/utils.mk
> +++ b/scripts/utils.mk
> @@ -169,6 +169,7 @@ define do_make_pkgconfig_file
>   	sed -i "s|INSTALL_PREFIX|${1}|g" ${PKG_CONFIG_FILE}; 		\
>   	sed -i "s|LIB_VERSION|${LIBTRACECMD_VERSION}|g" ${PKG_CONFIG_FILE}; \
>   	sed -i "s|LIB_DIR|$(libdir)|g" ${PKG_CONFIG_FILE}; \
> +	sed -i "s|LIBTRACEFS_MIN_VERSION|$(LIBTRACEFS_MIN_VERSION)|g" ${PKG_CONFIG_FILE}; \
>   	sed -i "s|HEADER_DIR|$(includedir)/trace-cmd|g" ${PKG_CONFIG_FILE};
>   endef
>   
> 

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

* Re: [PATCH] trace-cmd: Add Requires: libtracefs to libtracecmd.pc file
  2021-11-10 14:12 ` Yordan Karadzhov
@ 2021-11-10 16:17   ` Steven Rostedt
  2021-11-11  8:12     ` Yordan Karadzhov
  0 siblings, 1 reply; 5+ messages in thread
From: Steven Rostedt @ 2021-11-10 16:17 UTC (permalink / raw)
  To: Yordan Karadzhov; +Cc: Linux Trace Devel

On Wed, 10 Nov 2021 16:12:12 +0200
Yordan Karadzhov <y.karadz@gmail.com> wrote:

> On 9.11.21 г. 18:14 ч., Steven Rostedt wrote:
> > From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>
> > 
> > In order to not have users of libtracecmd having to also include the
> > includes and libraries for libtracefs and libraceevent, add a requires
> > field for libtracefs to the libtracecmd.pc file. As libtracefs requires
> > libtraceevent, it will pull that one in as well.
> > 
> > Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
> > ---
> >   libtracecmd.pc.template | 1 +
> >   scripts/utils.mk        | 1 +
> >   2 files changed, 2 insertions(+)
> > 
> > diff --git a/libtracecmd.pc.template b/libtracecmd.pc.template
> > index dc41076e..bcf4e39d 100644
> > --- a/libtracecmd.pc.template
> > +++ b/libtracecmd.pc.template
> > @@ -6,5 +6,6 @@ Name: libtracecmd
> >   URL: https://git.kernel.org/pub/scm/utils/trace-cmd/trace-cmd.git/
> >   Description: Library for creating and reading trace-cmd data files
> >   Version: LIB_VERSION
> > +Requires: libtracefs >= LIBTRACEFS_MIN_VERSION  
> 
> BTW this works also without the 'lib' prefix:
> 
> Requires: tracefs >= LIBTRACEFS_MIN_VERSION

I just tried that on Fedora, and get this:

# pkg-config --libs libtracecmd
Package tracefs was not found in the pkg-config search path.
Perhaps you should add the directory containing `tracefs.pc'
to the PKG_CONFIG_PATH environment variable
Package 'tracefs', required by 'libtracecmd', not found

-- Steve

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

* Re: [PATCH] trace-cmd: Add Requires: libtracefs to libtracecmd.pc file
  2021-11-10 16:17   ` Steven Rostedt
@ 2021-11-11  8:12     ` Yordan Karadzhov
  2021-11-11 14:12       ` Steven Rostedt
  0 siblings, 1 reply; 5+ messages in thread
From: Yordan Karadzhov @ 2021-11-11  8:12 UTC (permalink / raw)
  To: Steven Rostedt; +Cc: Linux Trace Devel



On 10.11.21 г. 18:17 ч., Steven Rostedt wrote:
> On Wed, 10 Nov 2021 16:12:12 +0200
> Yordan Karadzhov <y.karadz@gmail.com> wrote:
> 
>> On 9.11.21 г. 18:14 ч., Steven Rostedt wrote:
>>> From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>
>>>
>>> In order to not have users of libtracecmd having to also include the
>>> includes and libraries for libtracefs and libraceevent, add a requires
>>> field for libtracefs to the libtracecmd.pc file. As libtracefs requires
>>> libtraceevent, it will pull that one in as well.
>>>
>>> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
>>> ---
>>>    libtracecmd.pc.template | 1 +
>>>    scripts/utils.mk        | 1 +
>>>    2 files changed, 2 insertions(+)
>>>
>>> diff --git a/libtracecmd.pc.template b/libtracecmd.pc.template
>>> index dc41076e..bcf4e39d 100644
>>> --- a/libtracecmd.pc.template
>>> +++ b/libtracecmd.pc.template
>>> @@ -6,5 +6,6 @@ Name: libtracecmd
>>>    URL: https://git.kernel.org/pub/scm/utils/trace-cmd/trace-cmd.git/
>>>    Description: Library for creating and reading trace-cmd data files
>>>    Version: LIB_VERSION
>>> +Requires: libtracefs >= LIBTRACEFS_MIN_VERSION
>>
>> BTW this works also without the 'lib' prefix:
>>
>> Requires: tracefs >= LIBTRACEFS_MIN_VERSION
> 
> I just tried that on Fedora, and get this:
> 
> # pkg-config --libs libtracecmd
> Package tracefs was not found in the pkg-config search path.
> Perhaps you should add the directory containing `tracefs.pc'
> to the PKG_CONFIG_PATH environment variable
> Package 'tracefs', required by 'libtracecmd', not found

OK, it looks like what matters is really the name of the .pc file (and the 'Name: ...' line). I was confused because 
'json-c.ps' has no 'lib' prefix. Looking into

/usr/local/lib/x86_64-linux-gnu/pkgconfig

I see that most of the configuration files do not have 'lib', however there is also a number of files starting with 
'lib'. I wonder if there is some rule about using this 'lib' prefix.

Thanks!
Yordan


> 
> -- Steve
> 

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

* Re: [PATCH] trace-cmd: Add Requires: libtracefs to libtracecmd.pc file
  2021-11-11  8:12     ` Yordan Karadzhov
@ 2021-11-11 14:12       ` Steven Rostedt
  0 siblings, 0 replies; 5+ messages in thread
From: Steven Rostedt @ 2021-11-11 14:12 UTC (permalink / raw)
  To: Yordan Karadzhov; +Cc: Linux Trace Devel

On Thu, 11 Nov 2021 10:12:46 +0200
Yordan Karadzhov <y.karadz@gmail.com> wrote:

> . Looking into
> 
> /usr/local/lib/x86_64-linux-gnu/pkgconfig
> 
> I see that most of the configuration files do not have 'lib', however there is also a number of files starting with 
> 'lib'. I wonder if there is some rule about using this 'lib' prefix.

Mostly just preference by those creating it. I used it to differentiate the
terms. "tracefs" is the file system that "libtracefs" manipulates.

And libtraceevents is because it's always been that. I'm not even sure if
I'm the one that called it.

It also should match the name of the repos. As we call the repos libtracefs
and libtraceevent, we should have the pkgconfig files match it as well. And
the name of the packages (.deb or .rpm) should match.

-- Steve

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

end of thread, other threads:[~2021-11-11 14:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-11-09 16:14 [PATCH] trace-cmd: Add Requires: libtracefs to libtracecmd.pc file Steven Rostedt
2021-11-10 14:12 ` Yordan Karadzhov
2021-11-10 16:17   ` Steven Rostedt
2021-11-11  8:12     ` Yordan Karadzhov
2021-11-11 14:12       ` 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).