summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authorroy <roy>2013-10-11 14:32:07 +0000
committerroy <roy>2013-10-11 14:32:07 +0000
commit9aa85e8da9a5ac43b17b26a1355832c247f463ed (patch)
treee3400f97068ba7b2451ca7ee1af171809d93ac82 /mk
parent4311560d2318d33d833a7eb4abf395412e764842 (diff)
downloadpkgsrc-9aa85e8da9a5ac43b17b26a1355832c247f463ed.tar.gz
Map terminfo libraries to the one we really want.
Diffstat (limited to 'mk')
-rw-r--r--mk/terminfo.buildlink3.mk21
1 files changed, 20 insertions, 1 deletions
diff --git a/mk/terminfo.buildlink3.mk b/mk/terminfo.buildlink3.mk
index 15b5562343c..3da4ddf64b8 100644
--- a/mk/terminfo.buildlink3.mk
+++ b/mk/terminfo.buildlink3.mk
@@ -1,4 +1,4 @@
-# $NetBSD: terminfo.buildlink3.mk,v 1.2 2011/07/12 06:42:58 obache Exp $
+# $NetBSD: terminfo.buildlink3.mk,v 1.3 2013/10/11 14:32:07 roy Exp $
#
# This Makefile fragment is meant to be included by packages that require
# any terminfo implementation instead of one particular one. The available
@@ -33,6 +33,7 @@ TERMINFO_BUILDLINK3_MK:= ${TERMINFO_BUILDLINK3_MK}+
# that may be used with curses.buildlink3.mk.
#
_TERMINFO_PKGS?= terminfo ncurses pdcurses
+_TERMINFO_TYPES?= terminfo tinfo
CHECK_BUILTIN.terminfo:= yes
. include "terminfo.builtin.mk"
@@ -64,12 +65,30 @@ TERMINFO_TYPE= none
BUILD_DEFS+= TERMINFO_DEFAULT
BUILD_DEFS_EFFECTS+= TERMINFO_TYPE
+# Most GNU configure scripts will try finding every terminfo 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 terminfo.builtin.mk for details.
+#
+.if empty(TERMINFO_TYPE:Mnone)
+. for _tcap_ in ${_TERMINFO_TYPES}
+. if empty(TERMINFO_TYPE:M${_tcap_})
+BUILDLINK_TRANSFORM+= l:${_tcap_}:${BUILDLINK_LIBNAME.terminfo}
+. endif
+. endfor
+.endif
+
.endif # TERMINFO_BUILDLINK3_MK
.if ${TERMINFO_TYPE} == "none"
PKG_FAIL_REASON= \
"${_TERMINFO_TYPE} is not an acceptable terminfo type for ${PKGNAME}."
.elif ${TERMINFO_TYPE} == "terminfo"
+BUILDLINK_TREE+= terminfo -terminfo
+BUILDLINK_LIBNAME.terminfo?= ${BUILTIN_LIBNAME.terminfo}
+BUILDLINK_LDADD.terminfo?= ${BUILDLINK_LIBNAME.terminfo:S/^/-l/:S/^-l$//}
+BUILDLINK_BUILTIN_MK.terminfo= ../../mk/terminfo.builtin.mk
.elif ${TERMINFO_TYPE} == "ncurses"
USE_NCURSES= yes
. include "../../devel/ncurses/buildlink3.mk"