aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Hubbs <w.d.hubbs@gmail.com>2013-02-23 14:04:09 -0600
committerWilliam Hubbs <w.d.hubbs@gmail.com>2013-02-23 17:10:35 -0600
commit549cbadd2ccc3d0f11b5b1802175ca7afcdcb6a4 (patch)
tree5d0762cc194bc75db477736c8dc2e9b260d76bfe
parentfac96b4df4b61db399bfa18549be162e9861b0b5 (diff)
build: use pkg-config to find ncurses libraries if it is available
If ncurses was built with the --with-termlib switch enabled, tgoto, tgetent and tgetstr move to libtinfo. Fortunately, ncurses provides a pkg-config file which we can use if pkg-config is installed. If it is not, we still link to -lncurses for now, so pkg-config is not a hard requirement. Reported-by: jan.paesmans@gmail.com X-Gentoo-Bug: 455912 X-Gentoo-Bug: https://bugs.gentoo.org/show_bug.cgi?id=455912
-rw-r--r--mk/termcap.mk5
1 files changed, 5 insertions, 0 deletions
diff --git a/mk/termcap.mk b/mk/termcap.mk
index b716276b..6f590da6 100644
--- a/mk/termcap.mk
+++ b/mk/termcap.mk
@@ -1,5 +1,10 @@
ifeq (${MKTERMCAP},ncurses)
+ LTERMCAP:= $(shell pkg-config ncurses --libs 2> /dev/null)
+ifeq ($(LTERMCAP),)
LIBTERMCAP?= -lncurses
+else
+LIBTERMCAP?= $(LTERMCAP)
+endif
CPPFLAGS+= -DHAVE_TERMCAP
LDADD+= ${LIBTERMCAP}
else ifeq (${MKTERMCAP},termcap)