]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
tools: lib: thermal: use pkg-config to locate libnl3
authorSascha Hauer <s.hauer@pengutronix.de>
Wed, 1 Oct 2025 11:40:55 +0000 (13:40 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 3 Oct 2025 19:26:00 +0000 (21:26 +0200)
To make libthermal more cross compile friendly use pkg-config to locate
libnl3. Only if that fails fall back to hardcoded /usr/include/libnl3.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
tools/lib/thermal/Makefile

index a1f5e388644d31d36f973d3ddce48d036ee0a083..fdde0c4f85b4e511a16c43810590ed45b007a5ad 100644 (file)
@@ -46,8 +46,12 @@ else
   CFLAGS := -g -Wall
 endif
 
+NL3_CFLAGS = $(shell pkg-config --cflags libnl-3.0 2>/dev/null)
+ifeq ($(NL3_CFLAGS),)
+NL3_CFLAGS = -I/usr/include/libnl3
+endif
+
 INCLUDES = \
--I/usr/include/libnl3 \
 -I$(srctree)/tools/lib/thermal/include \
 -I$(srctree)/tools/lib/ \
 -I$(srctree)/tools/include \
@@ -59,6 +63,7 @@ INCLUDES = \
 override CFLAGS += $(EXTRA_WARNINGS)
 override CFLAGS += -Werror -Wall
 override CFLAGS += -fPIC
+override CFLAGS += $(NL3_CFLAGS)
 override CFLAGS += $(INCLUDES)
 override CFLAGS += -fvisibility=hidden
 override CFGLAS += -Wl,-L.