summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authorjlam <jlam>2005-07-16 22:33:18 +0000
committerjlam <jlam>2005-07-16 22:33:18 +0000
commit21b5eb51ee3a533ab24da856bf629fe8426b56fc (patch)
tree525552ef812db6447e3b7bd6e59e216e548b5e0e /mk
parent5a6a75e39a0029a2d9f570d2cf041cd83a29e4d6 (diff)
downloadpkgsrc-21b5eb51ee3a533ab24da856bf629fe8426b56fc.tar.gz
There is still one small but important distinction between some of the
tools listed in USE_TOOLS -- some of them are required by the pkgsrc infrastructure in variable assignment statements that look like: VARIABLE!= ${AWK} ... These tools are actually *required* by pkgsrc to be installed on the system before it can even work (bootstrap situation). For these tools, only override the "TOOL" name representing the tool if we're really using the pkgsrc version of the tool. We accomplish this by adding a new :pkgsrc modifier that is appended to these tools listed in USE_TOOLS. We also list these tools in bsd.prefs.mk so that all packages pick them up fairly early on.
Diffstat (limited to 'mk')
-rw-r--r--mk/bsd.prefs.mk5
-rw-r--r--mk/tools/replace.mk18
2 files changed, 15 insertions, 8 deletions
diff --git a/mk/bsd.prefs.mk b/mk/bsd.prefs.mk
index 87a392e43bb..9e7cc217fce 100644
--- a/mk/bsd.prefs.mk
+++ b/mk/bsd.prefs.mk
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.prefs.mk,v 1.196 2005/07/15 18:27:55 jlam Exp $
+# $NetBSD: bsd.prefs.mk,v 1.197 2005/07/16 22:33:18 jlam Exp $
#
# Make file, included to get the site preferences, if any. Should
# only be included by package Makefiles before any .if defined()
@@ -567,4 +567,7 @@ PREPEND_PATH+= ${USE_X11:D${X11BASE}/bin} ${LOCALBASE}/bin
# Make variable definitions cache
.include "${PKGSRCDIR}/mk/bsd.makevars.mk"
+_PKGSRC_USE_TOOLS= awk cut echo pwd sed tr uname
+USE_TOOLS+= ${_PKGSRC_USE_TOOLS:S/$/:pkgsrc/}
+
.endif # BSD_PKG_MK
diff --git a/mk/tools/replace.mk b/mk/tools/replace.mk
index 6bbe7b2a4f9..da44cdba103 100644
--- a/mk/tools/replace.mk
+++ b/mk/tools/replace.mk
@@ -1,4 +1,4 @@
-# $NetBSD: replace.mk,v 1.111 2005/07/16 05:34:59 jlam Exp $
+# $NetBSD: replace.mk,v 1.112 2005/07/16 22:33:18 jlam Exp $
#
# Copyright (c) 2005 The NetBSD Foundation, Inc.
# All rights reserved.
@@ -114,9 +114,13 @@ MAKEVARS+= _USE_TOOLS
######################################################################
-# Set the type of dependency requested for the tool.
+# Set the type of dependency requested for the tool. The type of
+# dependency is determined by the modifier specified for each tool:
#
-.for _t_ in ${USE_TOOLS:N*\:*} ${USE_TOOLS:M*\:build}
+# BUILD_DEPENDS: :build (default), :pkgsrc
+# DEPENDS: :run
+#
+.for _t_ in ${USE_TOOLS:N*\:*} ${USE_TOOLS:M*\:build} ${USE_TOOLS:M*\:pkgsrc}
_TOOLS_DEPMETHOD.${_t_:C/:.*//}= BUILD_DEPENDS
.endfor
.for _t_ in ${USE_TOOLS:M*\:run}
@@ -1226,11 +1230,11 @@ ${_TOOLS_DEPMETHOD.${_t_}}+= ${_dep_}
######################################################################
-# For each tool, make sure that the "TOOL" name points to the real
-# command, e.g., AWK, SED, etc., provided that "TOOL" has been
-# associated with <tool>.
+# For each tool that pkgsrc requires, make sure that the "TOOL" name
+# points to the real command, e.g., AWK, SED, etc., provided that
+# "TOOL" has been associated with <tool>.
#
-.for _t_ in ${_USE_TOOLS}
+.for _t_ in ${USE_TOOLS:M*\:pkgsrc:C/:.*//:O:u}
_TOOLS_USE_PKGSRC.${_t_}?= no
. if defined(_TOOLS_VARNAME.${_t_})
. if !empty(_TOOLS_USE_PKGSRC.${_t_}:M[nN][oO])