From 549cbadd2ccc3d0f11b5b1802175ca7afcdcb6a4 Mon Sep 17 00:00:00 2001 From: William Hubbs Date: Sat, 23 Feb 2013 14:04:09 -0600 Subject: [PATCH] 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 --- mk/termcap.mk | 5 +++++ 1 file changed, 5 insertions(+) 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)