* [PATCH] tools: lib: thermal: Correct CFLAGS and LDFLAGS in pkg-config template
@ 2025-12-26 7:54 Romain Gantois
2025-12-26 9:09 ` Thomas Petazzoni
2026-01-20 19:38 ` Daniel Lezcano
0 siblings, 2 replies; 3+ messages in thread
From: Romain Gantois @ 2025-12-26 7:54 UTC (permalink / raw)
To: Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba
Cc: Thomas Petazzoni, linux-pm, linux-kernel, Romain Gantois
There are two issues with the current pkg-config template. Firstly, the
-lthermal linker flag is missing. Secondly, the libnl3 include directory
compiler flag references "include" instead of "includedir", which leads to
an unexpanded variable when pkg-config is called.
Add the missing -lthermal flag and correct the libnl3 include directory.
Signed-off-by: Romain Gantois <romain.gantois@bootlin.com>
---
tools/lib/thermal/libthermal.pc.template | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/lib/thermal/libthermal.pc.template b/tools/lib/thermal/libthermal.pc.template
index ac24d0ab17f5..3b8a24d0a8b8 100644
--- a/tools/lib/thermal/libthermal.pc.template
+++ b/tools/lib/thermal/libthermal.pc.template
@@ -8,5 +8,5 @@ Name: libthermal
Description: thermal library
Requires: libnl-3.0 libnl-genl-3.0
Version: @VERSION@
-Libs: -L${libdir} -lnl-genl-3 -lnl-3
-Cflags: -I${includedir} -I${include}/libnl3
+Libs: -L${libdir} -lnl-genl-3 -lnl-3 -lthermal
+Cflags: -I${includedir} -I${includedir}/libnl3
---
base-commit: d113735421da322ea144c9778c433de6ff6bc57b
change-id: 20251226-libthermal-pkgconfig-23259b10478a
Best regards,
--
Romain Gantois <romain.gantois@bootlin.com>
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] tools: lib: thermal: Correct CFLAGS and LDFLAGS in pkg-config template
2025-12-26 7:54 [PATCH] tools: lib: thermal: Correct CFLAGS and LDFLAGS in pkg-config template Romain Gantois
@ 2025-12-26 9:09 ` Thomas Petazzoni
2026-01-20 19:38 ` Daniel Lezcano
1 sibling, 0 replies; 3+ messages in thread
From: Thomas Petazzoni @ 2025-12-26 9:09 UTC (permalink / raw)
To: Romain Gantois
Cc: Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
linux-pm, linux-kernel
Hello Romain,
On Fri, 26 Dec 2025 08:54:32 +0100
Romain Gantois <romain.gantois@bootlin.com> wrote:
> diff --git a/tools/lib/thermal/libthermal.pc.template b/tools/lib/thermal/libthermal.pc.template
> index ac24d0ab17f5..3b8a24d0a8b8 100644
> --- a/tools/lib/thermal/libthermal.pc.template
> +++ b/tools/lib/thermal/libthermal.pc.template
> @@ -8,5 +8,5 @@ Name: libthermal
> Description: thermal library
> Requires: libnl-3.0 libnl-genl-3.0
> Version: @VERSION@
> -Libs: -L${libdir} -lnl-genl-3 -lnl-3
> -Cflags: -I${includedir} -I${include}/libnl3
> +Libs: -L${libdir} -lnl-genl-3 -lnl-3 -lthermal
> +Cflags: -I${includedir} -I${includedir}/libnl3
Actually -lnl-genl-3 -lnl-3 in Libs and -I${includedir}/libnl3 in
Cflags can be removed as well, because the Requires: field contains
libnl-3.0 and libnl-genl-3.0, which will cause pkg-config to
recursively query the libs/cflags for libnl-3.0 and libnl-genl-3.0.
From https://people.freedesktop.org/~dbn/pkg-config-guide.html:
=====================================================================
Cflags: The compiler flags specific to this package and any required
libraries that don't support pkg-config. If the required libraries
support pkg-config, they should be added to Requires or
Requires.private.
Libs: The link flags specific to this package and any required
libraries that don't support pkg-config. The same rule as Cflags
applies here.
=====================================================================
Since libnl-3.0 and libnl-genl-3.0 support pkg-config (otherwise they
wouldn't be listed in Requires:), then those flags should be dropped
from Libs: and Cflags:.
Also, since this is a fix, probably this commit requires a Fixes: tag.
Best regards,
Thomas
--
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] tools: lib: thermal: Correct CFLAGS and LDFLAGS in pkg-config template
2025-12-26 7:54 [PATCH] tools: lib: thermal: Correct CFLAGS and LDFLAGS in pkg-config template Romain Gantois
2025-12-26 9:09 ` Thomas Petazzoni
@ 2026-01-20 19:38 ` Daniel Lezcano
1 sibling, 0 replies; 3+ messages in thread
From: Daniel Lezcano @ 2026-01-20 19:38 UTC (permalink / raw)
To: Romain Gantois, Rafael J. Wysocki, Zhang Rui, Lukasz Luba
Cc: Thomas Petazzoni, linux-pm, linux-kernel
On 12/26/25 08:54, Romain Gantois wrote:
> There are two issues with the current pkg-config template. Firstly, the
> -lthermal linker flag is missing. Secondly, the libnl3 include directory
> compiler flag references "include" instead of "includedir", which leads to
> an unexpanded variable when pkg-config is called.
>
> Add the missing -lthermal flag and correct the libnl3 include directory.
>
> Signed-off-by: Romain Gantois <romain.gantois@bootlin.com>
> ---
Applied, thanks
--
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs
Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-01-20 19:38 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-26 7:54 [PATCH] tools: lib: thermal: Correct CFLAGS and LDFLAGS in pkg-config template Romain Gantois
2025-12-26 9:09 ` Thomas Petazzoni
2026-01-20 19:38 ` Daniel Lezcano
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox