openrc/mk/termcap.mk
Johan Bergström ba0a11fc94 Pass ncurses cflags to build
Fixes #25
Note from William Hubbs:
The original patch overwrote CFLAGS. I modified this patch to add the
ncurses cflags to CPPFLAGS instead of overwriting CFLAGS.
2014-10-26 13:04:20 -05:00

18 lines
504 B
Makefile

ifeq (${MKTERMCAP},ncurses)
TERMCAP_CFLAGS:= $(shell pkg-config ncurses --cflags 2> /dev/null)
LTERMCAP:= $(shell pkg-config ncurses --libs 2> /dev/null)
ifeq ($(LTERMCAP),)
LIBTERMCAP?= -lncurses
else
LIBTERMCAP?= $(LTERMCAP)
endif
CPPFLAGS+= -DHAVE_TERMCAP ${TERMCAP_CFLAGS}
LDADD+= ${LIBTERMCAP}
else ifeq (${MKTERMCAP},termcap)
LIBTERMCAP?= -ltermcap
CPPFLAGS+= -DHAVE_TERMCAP
LDADD+= ${LIBTERMCAP}
else ifneq (${MKTERMCAP},)
$(error If MKTERMCAP is defined, it must be ncurses or termcap)
endif