summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authorjlam <jlam>2004-07-21 19:55:11 +0000
committerjlam <jlam>2004-07-21 19:55:11 +0000
commit38a5601a02efa68903c62356bc3400967a010dab (patch)
treef3c94692f5f55aab969d7252fae579f6634ed374 /mk
parent1188fa5ab4433ece21541c1d8eedbff6610cec7f (diff)
downloadpkgsrc-38a5601a02efa68903c62356bc3400967a010dab.tar.gz
If a package Makefile sets USE_TBL to "yes", then add "tbl" to
${TOOLS_DIR}/bin. It will either point to /usr/bin/tbl or will depend on groff otherwise. This should allow removing dependencies on groff just for the sake of forcing the existence of tbl.
Diffstat (limited to 'mk')
-rw-r--r--mk/tools.mk23
1 files changed, 22 insertions, 1 deletions
diff --git a/mk/tools.mk b/mk/tools.mk
index 9f885a0337c..c40d9b3177b 100644
--- a/mk/tools.mk
+++ b/mk/tools.mk
@@ -1,4 +1,4 @@
-# $NetBSD: tools.mk,v 1.35 2004/06/15 13:41:43 grant Exp $
+# $NetBSD: tools.mk,v 1.36 2004/07/21 19:55:11 jlam Exp $
#
# This Makefile creates a ${TOOLS_DIR} directory and populates the bin
# subdir with tools that hide the ones outside of ${TOOLS_DIR}.
@@ -384,4 +384,25 @@ ${TOOLS_DIR}/bin/make:
fi
.endif
+.if defined(USE_TBL) && !empty(USE_TBL:M[yY][eE][sS])
+. if exists(/usr/bin/tbl)
+_TOOLS_PROGNAME.tbl= /usr/bin/tbl
+. else
+BUILD_DEPENDS+= groff>=1.19nb4:../../textproc/groff
+_TOOLS_PROGNAME.tbl= ${LOCALBASE}/bin/tbl
+. endif
+. if exists(_TOOLS_PROGNAME.tbl)
+TBL:= ${_TOOLS_PROGNAME.tbl}
+. endif
+
+override-tools: ${TOOLS_DIR}/bin/tbl
+${TOOLS_DIR}/bin/tbl:
+ ${_PKG_SILENT}${_PKG_DEBUG} \
+ src="${_TOOLS_PROGNAME.tbl}"; \
+ if [ -x $$src -a ! -f ${.TARGET} ]; then \
+ ${MKDIR} ${.TARGET:H}; \
+ ${LN} -sf $$src ${.TARGET}; \
+ fi
+.endif # USE_TBL
+
.endif # TOOLS_MK