Skip to content

Commit b31f7f7

Browse files
saschahauerrafaeljw
authored andcommitted
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>
1 parent e649c36 commit b31f7f7

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

tools/lib/thermal/Makefile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,12 @@ else
4646
CFLAGS := -g -Wall
4747
endif
4848

49+
NL3_CFLAGS = $(shell pkg-config --cflags libnl-3.0 2>/dev/null)
50+
ifeq ($(NL3_CFLAGS),)
51+
NL3_CFLAGS = -I/usr/include/libnl3
52+
endif
53+
4954
INCLUDES = \
50-
-I/usr/include/libnl3 \
5155
-I$(srctree)/tools/lib/thermal/include \
5256
-I$(srctree)/tools/lib/ \
5357
-I$(srctree)/tools/include \
@@ -59,6 +63,7 @@ INCLUDES = \
5963
override CFLAGS += $(EXTRA_WARNINGS)
6064
override CFLAGS += -Werror -Wall
6165
override CFLAGS += -fPIC
66+
override CFLAGS += $(NL3_CFLAGS)
6267
override CFLAGS += $(INCLUDES)
6368
override CFLAGS += -fvisibility=hidden
6469
override CFGLAS += -Wl,-L.

0 commit comments

Comments
 (0)