Skip to content

Commit

Permalink
tools/thermal: tmon: use $(PKG_CONFIG) instead of hard-coding pkg-config
Browse files Browse the repository at this point in the history
To ease cross-compiling, make use of the $(PKG_CONFIG) variable rather
than hard-coding calls to pkg-config.

Signed-off-by: Markus Mayer <[email protected]>
Signed-off-by: Zhang Rui <[email protected]>
  • Loading branch information
Markus Mayer authored and zhang-rui committed Oct 18, 2017
1 parent c21568f commit 501a5c7
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions tools/thermal/tmon/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
PKG_CONFIG?= pkg-config

CFLAGS+=-D VERSION=\"$(VERSION)\"
LDFLAGS+=
Expand All @@ -23,12 +24,12 @@ 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)

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 +=
Expand Down

0 comments on commit 501a5c7

Please sign in to comment.