public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tools/thermal: tmon: Allow overriding pkg-config
@ 2015-08-07 22:58 Florian Fainelli
  2015-08-07 23:13 ` Brian Norris
  0 siblings, 1 reply; 3+ messages in thread
From: Florian Fainelli @ 2015-08-07 22:58 UTC (permalink / raw)
  To: linux-kernel, rui.zhang, jacob.jun.pan
  Cc: gregory.0xf0, Florian Fainelli, Brian Norris, Anand Moon

Some build systems might not ship with a proper pkg-config
infrastructure, so picking up the host pkg-config might cause us to link
with ncursesw which may not be present in the build environment.

Allow an external build system to override the pkg-config value (e.g:
set it to /bin/false if we do not have anything).

Fixes: 96a0d99c72cc ("tools/thermal: tmon: use pkg-config to determine library dependencies")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 tools/thermal/tmon/Makefile | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/tools/thermal/tmon/Makefile b/tools/thermal/tmon/Makefile
index 2e83dd3655a2..3777ab59d08c 100644
--- a/tools/thermal/tmon/Makefile
+++ b/tools/thermal/tmon/Makefile
@@ -11,6 +11,7 @@ TARGET=tmon
 
 INSTALL_PROGRAM=install -m 755 -p
 DEL_FILE=rm -f
+PKG_CONFIG?=pkg-config
 
 # Static builds might require -ltinfo, for instance
 ifneq ($(findstring -static, $(LDFLAGS)),)
@@ -18,8 +19,8 @@ STATIC := --static
 endif
 
 TMON_LIBS=-lm -lpthread
-TMON_LIBS += $(shell pkg-config --libs $(STATIC) panelw ncursesw 2> /dev/null || \
-		     pkg-config --libs $(STATIC) panel ncurses 2> /dev/null || \
+TMON_LIBS += $(shell $(PKG_CONFIG) --libs $(STATIC) panelw ncursesw 2> /dev/null || \
+		     $(PKG_CONFIG) --libs $(STATIC) panel ncurses 2> /dev/null || \
 		     echo -lpanel -lncurses)
 
 OBJS = tmon.o tui.o sysfs.o pid.o
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-08-08 20:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-07 22:58 [PATCH] tools/thermal: tmon: Allow overriding pkg-config Florian Fainelli
2015-08-07 23:13 ` Brian Norris
2015-08-08 20:04   ` Florian Fainelli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox