public inbox for dev@dpdk.org
 help / color / mirror / Atom feed
* [PATCH] power/amd_uncore: detect esmi lib64 using pkgconfig
@ 2026-03-31  4:09 Sivaprasad Tummala
  2026-03-31 23:29 ` Stephen Hemminger
  0 siblings, 1 reply; 2+ messages in thread
From: Sivaprasad Tummala @ 2026-03-31  4:09 UTC (permalink / raw)
  To: dev; +Cc: Anatoly Burakov

Replace manual detection of e_smi_lib64 library from find_library() with
dependency() via pkg-config in meson.

Meson find_library() API may select incompatible libraries,
requiring additional checks. Using pkg-config avoids this
by providing correct build flags via .pc files.

Signed-off-by: Sivaprasad Tummala <sivaprasad.tummala@amd.com>
---
 drivers/power/amd_uncore/meson.build | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/drivers/power/amd_uncore/meson.build b/drivers/power/amd_uncore/meson.build
index cab260b64e..378eb72e50 100644
--- a/drivers/power/amd_uncore/meson.build
+++ b/drivers/power/amd_uncore/meson.build
@@ -7,14 +7,12 @@ if not is_linux
     subdir_done()
 endif
 
-ESMI_header = '#include<e_smi/e_smi.h>'
-lib = cc.find_library('e_smi64', required: false)
-if not lib.found() or not cc.links(min_c_code, dependencies: lib)
+dep = dependency('e_smi_lib64', required: false, method: 'pkg-config')
+if not dep.found()
     build = false
-    reason = 'missing dependency, "libe_smi"'
-else
-    ext_deps += lib
+    reason = 'missing dependency, "e_smi_lib64"'
+    subdir_done()
 endif
-
 sources = files('amd_uncore.c')
+ext_deps += dep
 deps += ['power']
-- 
2.43.0


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

* Re: [PATCH] power/amd_uncore: detect esmi lib64 using pkgconfig
  2026-03-31  4:09 [PATCH] power/amd_uncore: detect esmi lib64 using pkgconfig Sivaprasad Tummala
@ 2026-03-31 23:29 ` Stephen Hemminger
  0 siblings, 0 replies; 2+ messages in thread
From: Stephen Hemminger @ 2026-03-31 23:29 UTC (permalink / raw)
  To: Sivaprasad Tummala; +Cc: dev, Anatoly Burakov

On Tue, 31 Mar 2026 04:09:58 +0000
Sivaprasad Tummala <sivaprasad.tummala@amd.com> wrote:

> Replace manual detection of e_smi_lib64 library from find_library() with
> dependency() via pkg-config in meson.
> 
> Meson find_library() API may select incompatible libraries,
> requiring additional checks. Using pkg-config avoids this
> by providing correct build flags via .pc files.
> 
> Signed-off-by: Sivaprasad Tummala <sivaprasad.tummala@amd.com>

Looks much better. I know Fedora has the library not sure about RHEL, Ubuntu, ...
but they will get there.

The documentation needs updating and a release note (for 26.07)
would make it easier for the user.

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

end of thread, other threads:[~2026-03-31 23:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-31  4:09 [PATCH] power/amd_uncore: detect esmi lib64 using pkgconfig Sivaprasad Tummala
2026-03-31 23:29 ` Stephen Hemminger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox