[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250811065915.3333142-3-eugen.hristev@linaro.org>
Date: Mon, 11 Aug 2025 09:59:11 +0300
From: Eugen Hristev <eugen.hristev@...aro.org>
To: rafael@...nel.org,
daniel.lezcano@...aro.org,
linux-pm@...r.kernel.org
Cc: linux-kernel@...r.kernel.org,
Eugen Hristev <eugen.hristev@...aro.org>
Subject: [PATCH 2/6] tools/lib/thermal: Fix dependency to host libnl
The include path should be created according to host pkg-config
especially when building with a different sysroot or cross compiling.
Thus, call the pkg-config to obtain the correct path instead of
accessing directly from root host file system, which is incorrect.
Fixes: 47c4b0de080a ("tools/lib/thermal: Add a thermal library")
Signed-off-by: Eugen Hristev <eugen.hristev@...aro.org>
---
tools/lib/thermal/Makefile | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/tools/lib/thermal/Makefile b/tools/lib/thermal/Makefile
index a1f5e388644d..ea56b55c9fcb 100644
--- a/tools/lib/thermal/Makefile
+++ b/tools/lib/thermal/Makefile
@@ -47,7 +47,6 @@ else
endif
INCLUDES = \
--I/usr/include/libnl3 \
-I$(srctree)/tools/lib/thermal/include \
-I$(srctree)/tools/lib/ \
-I$(srctree)/tools/include \
@@ -55,6 +54,12 @@ INCLUDES = \
-I$(srctree)/tools/arch/$(SRCARCH)/include/uapi \
-I$(srctree)/tools/include/uapi
+VAR_INCLUDES = $(shell pkg-config --cflags libnl-3.0 libnl-genl-3.0 2>/dev/null)
+ifeq ($(VAR_INCLUDES),)
+VAR_INCLUDES = -I/usr/include/libnl3
+endif
+override CFLAGS += $(VAR_INCLUDES)
+
# Append required CFLAGS
override CFLAGS += $(EXTRA_WARNINGS)
override CFLAGS += -Werror -Wall
--
2.43.0
Powered by blists - more mailing lists