summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2025-10-01 13:40:55 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-11-13 15:34:35 -0500
commit9285548962479fa6e164dd8c4e3595593a82eed4 (patch)
tree9e891251cdb247d3ec9d0829c594e359f1c62c81
parentf36678ddde84c61bbdd4766cf8af0ce68395dc07 (diff)
downloadlinux-9285548962479fa6e164dd8c4e3595593a82eed4.tar.gz
linux-9285548962479fa6e164dd8c4e3595593a82eed4.tar.bz2
linux-9285548962479fa6e164dd8c4e3595593a82eed4.zip
tools: lib: thermal: use pkg-config to locate libnl3
[ Upstream commit b31f7f725cd932e2c2b41f3e4b66273653953687 ] 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> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--tools/lib/thermal/Makefile7
1 files changed, 6 insertions, 1 deletions
diff --git a/tools/lib/thermal/Makefile b/tools/lib/thermal/Makefile
index 1694889847ca..8d21ea1950a3 100644
--- a/tools/lib/thermal/Makefile
+++ b/tools/lib/thermal/Makefile
@@ -59,8 +59,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 \
@@ -72,6 +76,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.