Re: [PATCH] trace-cmd: Add Requires: libtracefs to libtracecmd.pc file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On 10.11.21 г. 18:17 ч., Steven Rostedt wrote:
On Wed, 10 Nov 2021 16:12:12 +0200
Yordan Karadzhov <y.karadz@xxxxxxxxx> wrote:

On 9.11.21 г. 18:14 ч., Steven Rostedt wrote:
From: "Steven Rostedt (VMware)" <rostedt@xxxxxxxxxxx>

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@xxxxxxxxxxx>
---
   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




[Index of Archives]     [Linux USB Development]     [Linux USB Development]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux