tools/thermal: tmon: use $(PKG_CONFIG) instead of hard-coding pkg-config
authorMarkus Mayer <mmayer@broadcom.com>
Wed, 27 Sep 2017 23:02:37 +0000 (16:02 -0700)
committerZhang Rui <rui.zhang@intel.com>
Wed, 18 Oct 2017 01:59:31 +0000 (09:59 +0800)
To ease cross-compiling, make use of the $(PKG_CONFIG) variable rather
than hard-coding calls to pkg-config.

Signed-off-by: Markus Mayer <mmayer@broadcom.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
tools/thermal/tmon/Makefile

index 581da716ea1cc934a44546a9d786a7891b664fe8..1e11bd38a6b4404c374655bac2b8c2906b20a929 100644 (file)
@@ -9,6 +9,7 @@ CFLAGS+= -O1 ${WARNFLAGS}
 # Add "-fstack-protector" only if toolchain supports it.
 CFLAGS+= $(call cc-option,-fstack-protector)
 CC?= $(CROSS_COMPILE)gcc
 # Add "-fstack-protector" only if toolchain supports it.
 CFLAGS+= $(call cc-option,-fstack-protector)
 CC?= $(CROSS_COMPILE)gcc
+PKG_CONFIG?= pkg-config
 
 CFLAGS+=-D VERSION=\"$(VERSION)\"
 LDFLAGS+=
 
 CFLAGS+=-D VERSION=\"$(VERSION)\"
 LDFLAGS+=
@@ -23,12 +24,12 @@ STATIC := --static
 endif
 
 TMON_LIBS=-lm -lpthread
 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)
 
                     echo -lpanel -lncurses)
 
-CFLAGS    += $(shell pkg-config --cflags $(STATIC) panelw ncursesw 2> /dev/null || \
-                    pkg-config --cflags $(STATIC) panel ncurses 2> /dev/null)
+CFLAGS    += $(shell $(PKG_CONFIG) --cflags $(STATIC) panelw ncursesw 2> /dev/null || \
+                    $(PKG_CONFIG) --cflags $(STATIC) panel ncurses 2> /dev/null)
 
 OBJS = tmon.o tui.o sysfs.o pid.o
 OBJS +=
 
 OBJS = tmon.o tui.o sysfs.o pid.o
 OBJS +=