diff mbox series

[4/5] kernel-shark: Add 'Requires' to libkshark.pc

Message ID 20211110143747.32833-4-y.karadz@gmail.com (mailing list archive)
State Superseded
Headers show
Series [1/5] kernel-shark: Silence a warning from 'cmake_clean.sh' | expand

Commit Message

Yordan Karadzhov Nov. 10, 2021, 2:37 p.m. UTC
Adding only the requirements for building 'libkshark'. The requirements
for building the GUI are not supposed to be listed here.

Signed-off-by: Yordan Karadzhov (VMware) <y.karadz@gmail.com>
---
 CMakeLists.txt           | 2 ++
 build/libkshark.pc.cmake | 2 ++
 2 files changed, 4 insertions(+)

Comments

Steven Rostedt Nov. 10, 2021, 4:29 p.m. UTC | #1
On Wed, 10 Nov 2021 16:37:46 +0200
"Yordan Karadzhov (VMware)" <y.karadz@gmail.com> wrote:

> --- a/build/libkshark.pc.cmake
> +++ b/build/libkshark.pc.cmake
> @@ -6,5 +6,7 @@ Name: libkshark
>  URL: https://git.kernel.org/pub/scm/utils/trace-cmd/kernel-shark.git/
>  Description: Library for accessing ftrace file system
>  Version: @KS_VERSION_STRING@
> +Requires: tracecmd >= @LIBTRACECMD_MIN_VERSION@

Note, when I added this, I get:

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

But if I switch it to libtracecmd, I get:

  # pkg-config --libs libkshark
  -lkshark -ltracecmd -ltracefs -ltraceevent 

-- Steve

> +Requires: json-c
>  Cflags: -I${includedir}
>  Libs: -L${libdir} -lkshark
> --
diff mbox series

Patch

diff --git a/CMakeLists.txt b/CMakeLists.txt
index bb7b2a1..3723654 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -42,6 +42,8 @@  if (NOT _POLKIT_INSTALL_PREFIX)
 
 endif ()
 
+set(LIBTRACECMD_MIN_VERSION 1.0)
+
 set(CMAKE_MODULE_PATH "${KS_DIR}/build")
 find_package(TraceEvent REQUIRED)
 find_package(TraceFS    REQUIRED)
diff --git a/build/libkshark.pc.cmake b/build/libkshark.pc.cmake
index ad4ce34..0591cf9 100644
--- a/build/libkshark.pc.cmake
+++ b/build/libkshark.pc.cmake
@@ -6,5 +6,7 @@  Name: libkshark
 URL: https://git.kernel.org/pub/scm/utils/trace-cmd/kernel-shark.git/
 Description: Library for accessing ftrace file system
 Version: @KS_VERSION_STRING@
+Requires: tracecmd >= @LIBTRACECMD_MIN_VERSION@
+Requires: json-c
 Cflags: -I${includedir}
 Libs: -L${libdir} -lkshark