2016-04-11 06:22:33 +02:00
|
|
|
# $NetBSD: termcap.buildlink3.mk,v 1.11 2016/04/11 04:22:34 dbj Exp $
|
2008-02-29 23:41:13 +01:00
|
|
|
#
|
|
|
|
# This Makefile fragment is meant to be included by packages that require
|
|
|
|
# a termcap implementation that supports the basic termcap functions:
|
|
|
|
#
|
|
|
|
# tgetent, tgetstr, tgetflag, tgetnum, tgoto, tputs
|
|
|
|
#
|
|
|
|
# === Variables set by this file ===
|
|
|
|
#
|
|
|
|
# TERMCAP_TYPE
|
2008-03-05 17:23:52 +01:00
|
|
|
# The name of the selected termcap implementation.
|
2008-02-29 23:41:13 +01:00
|
|
|
|
|
|
|
TERMCAP_BUILDLINK3_MK:= ${TERMCAP_BUILDLINK3_MK}+
|
|
|
|
|
|
|
|
.include "bsd.fast.prefs.mk"
|
|
|
|
|
|
|
|
.if !empty(TERMCAP_BUILDLINK3_MK:M+)
|
|
|
|
|
2008-03-05 17:23:52 +01:00
|
|
|
# _TERMCAP_TYPES is an exhaustive list of all of the termcap
|
|
|
|
# implementations that may be found.
|
|
|
|
#
|
2010-02-07 10:46:13 +01:00
|
|
|
_TERMCAP_TYPES?= terminfo curses termcap termlib tinfo
|
2008-03-05 17:23:52 +01:00
|
|
|
|
2008-02-29 23:41:13 +01:00
|
|
|
CHECK_BUILTIN.termcap:= yes
|
|
|
|
. include "termcap.builtin.mk"
|
|
|
|
CHECK_BUILTIN.termcap:= no
|
|
|
|
|
2008-03-05 17:23:52 +01:00
|
|
|
.if !empty(USE_BUILTIN.termcap:M[yY][eE][sS])
|
|
|
|
. if defined(BUILTIN_LIBNAME.termcap)
|
|
|
|
TERMCAP_TYPE= ${BUILTIN_LIBNAME.termcap}
|
|
|
|
. else
|
|
|
|
TERMCAP_TYPE= none
|
|
|
|
. endif
|
|
|
|
.else
|
|
|
|
TERMCAP_TYPE= curses # pkgsrc termcap is curses
|
|
|
|
.endif
|
2008-03-05 18:38:58 +01:00
|
|
|
BUILD_DEFS_EFFECTS+= TERMCAP_TYPE
|
2008-03-05 17:23:52 +01:00
|
|
|
|
|
|
|
# Most GNU configure scripts will try finding every termcap implementation,
|
|
|
|
# so prevent them from finding any except for the one we decide upon.
|
|
|
|
#
|
|
|
|
# There is special handling for packages that can be provided by pkgsrc,
|
|
|
|
# e.g. curses -- see termcap.builtin.mk for details.
|
|
|
|
#
|
|
|
|
. for _tcap_ in ${_TERMCAP_TYPES:Ntermcap:Ncurses}
|
2013-10-16 18:51:28 +02:00
|
|
|
. if empty(TERMCAP_TYPE:M${_tcap_}) \
|
2013-10-19 21:12:41 +02:00
|
|
|
&& (!defined(TERMINFO_TYPE) || empty(TERMINFO_TYPE:M${_tcap_})) \
|
|
|
|
&& (!defined(CURSES_TYPE) || empty(CURSES_TYPE:M${_tcap_}))
|
2008-03-05 17:23:52 +01:00
|
|
|
BUILDLINK_TRANSFORM+= rm:-l${_tcap_}
|
|
|
|
. endif
|
|
|
|
. endfor
|
|
|
|
BUILDLINK_TRANSFORM+= l:termcap:${BUILDLINK_LIBNAME.termcap}
|
|
|
|
|
2008-02-29 23:41:13 +01:00
|
|
|
.endif # TERMCAP_BUILDLINK3_MK
|
|
|
|
|
|
|
|
.if ${TERMCAP_TYPE} == "none"
|
2016-04-11 06:22:33 +02:00
|
|
|
PKG_FAIL_REASON+= "No usable termcap library found on the system."
|
2010-02-07 10:46:13 +01:00
|
|
|
.elif (${TERMCAP_TYPE} == "terminfo") || \
|
|
|
|
(${TERMCAP_TYPE} == "termlib") || \
|
2008-03-02 08:05:28 +01:00
|
|
|
(${TERMCAP_TYPE} == "termcap") || \
|
2008-02-29 23:41:13 +01:00
|
|
|
(${TERMCAP_TYPE} == "tinfo")
|
2009-03-20 20:23:50 +01:00
|
|
|
BUILDLINK_TREE+= termcap -termcap
|
2008-02-29 23:41:13 +01:00
|
|
|
BUILDLINK_LIBNAME.termcap?= ${BUILTIN_LIBNAME.termcap}
|
|
|
|
BUILDLINK_LDADD.termcap?= ${BUILDLINK_LIBNAME.termcap:S/^/-l/:S/^-l$//}
|
|
|
|
BUILDLINK_BUILTIN_MK.termcap= ../../mk/termcap.builtin.mk
|
|
|
|
.elif ${TERMCAP_TYPE} == "curses"
|
|
|
|
. include "../../mk/curses.buildlink3.mk"
|
|
|
|
BUILDLINK_PREFIX.termcap?= ${BUILDLINK_PREFIX.curses}
|
|
|
|
BUILDLINK_LIBNAME.termcap?= ${BUILDLINK_LIBNAME.curses}
|
|
|
|
BUILDLINK_LDADD.termcap?= ${BUILDLINK_LDADD.curses}
|
|
|
|
.endif
|