summaryrefslogtreecommitdiff
path: root/tools/lib
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2025-10-01 13:40:55 +0200
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2025-10-03 21:26:00 +0200
commitb31f7f725cd932e2c2b41f3e4b66273653953687 (patch)
tree001db5d1f0490cd2a020af4053db0945c837a208 /tools/lib
parente649c3662b4fd9d4e01607c91a0facc7d9005570 (diff)
tools: lib: thermal: use pkg-config to locate libnl3
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>
Diffstat (limited to 'tools/lib')
-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 a1f5e388644d..fdde0c4f85b4 100644
--- a/tools/lib/thermal/Makefile
+++ b/tools/lib/thermal/Makefile
@@ -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.