diff options
author | jlam <jlam> | 2005-04-15 07:33:43 +0000 |
---|---|---|
committer | jlam <jlam> | 2005-04-15 07:33:43 +0000 |
commit | 8da8e15d35558ce38e8b1102659131a16c5cee34 (patch) | |
tree | 2e4631b4494f32b0b466f238498ebfa178a9dae6 | |
parent | 8409f796243889f6de1d255d3efeaced18084f11 (diff) | |
download | pkgsrc-8da8e15d35558ce38e8b1102659131a16c5cee34.tar.gz |
Allow for USE_TOOLS+=coreutils and USE_TOOLS+=findutils to use pkgsrc
replacements for "core" and "find" utilities, e.g. basename, cat, find,
etc.
-rw-r--r-- | mk/tools/bsd.tools.mk | 4 | ||||
-rw-r--r-- | mk/tools/coreutils.mk | 36 | ||||
-rw-r--r-- | mk/tools/findutils.mk | 31 |
3 files changed, 70 insertions, 1 deletions
diff --git a/mk/tools/bsd.tools.mk b/mk/tools/bsd.tools.mk index a3b976d3124..f498b50e25f 100644 --- a/mk/tools/bsd.tools.mk +++ b/mk/tools/bsd.tools.mk @@ -1,4 +1,4 @@ -# $NetBSD: bsd.tools.mk,v 1.1 2005/04/15 00:00:21 jlam Exp $ +# $NetBSD: bsd.tools.mk,v 1.2 2005/04/15 07:33:43 jlam Exp $ # # This Makefile fragment creates tools under ${TOOLS_DIR} that are # found before similarly-named tools in the system path. @@ -68,6 +68,8 @@ USE_TOOLS?= # empty .include "../../mk/tools/automake.mk" .include "../../mk/tools/autoconf.mk" +.include "../../mk/tools/coreutils.mk" +.include "../../mk/tools/findutils.mk" .include "../../mk/tools/texinfo.mk" .include "../../mk/tools/rpcgen.mk" .include "../../mk/tools/replace.mk" diff --git a/mk/tools/coreutils.mk b/mk/tools/coreutils.mk new file mode 100644 index 00000000000..e5634078668 --- /dev/null +++ b/mk/tools/coreutils.mk @@ -0,0 +1,36 @@ +# $NetBSD: coreutils.mk,v 1.1 2005/04/15 07:33:43 jlam Exp $ +# +# This Makefile fragment unconditionally replaces the system-supplied +# "core" utilities with the ones from the GNU coreutils package when +# "coreutils" is added to USE_TOOLS. +# +# Set TOOLS_DEPENDS.coreutils to "DEPENDS" to get a run-time dependency +# on coreutils. +# + +.if !defined(TOOLS_IGNORE.coreutils) && !empty(USE_TOOLS:Mcoreutils) +. if !empty(PKGPATH:Msysutils/coreutils) +MAKEFLAGS+= TOOLS_IGNORE.coreutils= +. else +TOOLS_DEPENDS.coreutils?= BUILD_DEPENDS +${TOOLS_DEPENDS.coreutils}+= coreutils>=5.2.1:../../sysutils/coreutils + +# List of core utilities for which we'll create symlinks under +# ${TOOLS_DIR}. This isn't every utility provided by coreutils, but +# is instead restricted to just the ones that are also listed in +# mk/platform/*.mk. +# +_TOOLS_COREUTILS+= [ basename cat chgrp chmod chown cp cut date \ + dirname echo env expr false head hostname id ln \ + ls mkdir mv nice pwd rm rmdir sort tail tee \ + test touch tr true tsort wc + +# Create symlinks for each of the coreutils under ${TOOLS_DIR}. +. for _t_ in ${_TOOLS_COREUTILS} +TOOLS_SYMLINK+= ${_t_} +TOOLS_CMD.${_t_}= ${TOOLS_DIR}/bin/${_t_} +TOOLS_REAL_CMD.${_t_}= ${LOCALBASE}/bin/${GNU_PROGRAM_PREFIX}${_t_} +. endfor +. undef _t_ +. endif +.endif diff --git a/mk/tools/findutils.mk b/mk/tools/findutils.mk new file mode 100644 index 00000000000..8523059ceb2 --- /dev/null +++ b/mk/tools/findutils.mk @@ -0,0 +1,31 @@ +# $NetBSD: findutils.mk,v 1.1 2005/04/15 07:33:43 jlam Exp $ +# +# This Makefile fragment unconditionally replaces the system-supplied +# "find" utilities with the ones from the GNU findutils package when +# "findutils" is added to USE_TOOLS. +# +# Set TOOLS_DEPENDS.findutils to "DEPENDS" to get a run-time dependency +# on findutils. +# + +.if !defined(TOOLS_IGNORE.findutils) && !empty(USE_TOOLS:Mfindutils) +. if !empty(PKGPATH:Msysutils/findutils) +MAKEFLAGS+= TOOLS_IGNORE.findutils= +. else +TOOLS_DEPENDS.findutils?= BUILD_DEPENDS +${TOOLS_DEPENDS.findutils}+= findutils>=4.1:../../sysutils/findutils + +# List of find utilities for which we'll create symlinks under +# ${TOOLS_DIR}. +# +_TOOLS_FINDUTILS+= find xargs + +# Create symlinks for each of the findutils under ${TOOLS_DIR}. +. for _t_ in ${_TOOLS_FINDUTILS} +TOOLS_SYMLINK+= ${_t_} +TOOLS_CMD.${_t_}= ${TOOLS_DIR}/bin/${_t_} +TOOLS_REAL_CMD.${_t_}= ${LOCALBASE}/bin/${GNU_PROGRAM_PREFIX}${_t_} +. endfor +. undef _t_ +. endif +.endif |