pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/mk Separate out the part of bsd.tools.mk that actually...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/8684100080cb
branches:  trunk
changeset: 513937:8684100080cb
user:      jlam <jlam%pkgsrc.org@localhost>
date:      Tue Jun 06 06:30:29 2006 +0000

description:
Separate out the part of bsd.tools.mk that actually created the tools
into a new file pkgsrc/mk/tools/create.mk.  This leaves bsd.tools.mk
as a file that pulls in all of the other ones.  Also move the
tools-related targets from bsd.pkg.mk into bsd.tools.mk.

The tools cookie file has been removed, as well as hooks for
{pre,do,post}-tools.  Instead, there is now only a single public target
"tools" which may be invoked.  Invoking "tools" will always cause all
of the tools in ${TOOLS_DIR} to be created.

The "tools" step has been moved and is now just after the "depends"
step and before sources are extracted.  This is the earliest place
where the "tools" step can be taken, and it allows the created tools
to be used in all steps/phases after it, starting with "extract".  As
a consequence, we should just invoke tools by their bare names in
targets, e.g. awk, sed, patch, etc., instead of with the ${VARIABLE}
names, e.g. ${AWK}, ${SED}, ${PATCH}, etc.

diffstat:

 mk/bsd.pkg.mk         |   33 +------
 mk/bsd.prefs.mk       |    8 +-
 mk/extract/extract.mk |    3 +-
 mk/tools/bsd.tools.mk |  210 +++++++++++--------------------------------------
 mk/tools/create.mk    |  180 ++++++++++++++++++++++++++++++++++++++++++
 mk/tools/replace.mk   |    4 +-
 6 files changed, 245 insertions(+), 193 deletions(-)

diffs (truncated from 606 to 300 lines):

diff -r e4a44c96fb1e -r 8684100080cb mk/bsd.pkg.mk
--- a/mk/bsd.pkg.mk     Tue Jun 06 05:37:17 2006 +0000
+++ b/mk/bsd.pkg.mk     Tue Jun 06 06:30:29 2006 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: bsd.pkg.mk,v 1.1841 2006/06/06 04:48:19 jlam Exp $
+#      $NetBSD: bsd.pkg.mk,v 1.1842 2006/06/06 06:30:29 jlam Exp $
 #
 # This file is in the public domain.
 #
@@ -290,7 +290,6 @@
 .  endif
 .endif
 
-_TOOLS_COOKIE=         ${WRKDIR}/.tools_done
 _WRAPPER_COOKIE=       ${WRKDIR}/.wrapper_done
 _CONFIGURE_COOKIE=     ${WRKDIR}/.configure_done
 _BUILD_COOKIE=         ${WRKDIR}/.build_done
@@ -738,7 +737,7 @@
 # Disable wrapper
 .PHONY: wrapper
 .if defined(NO_BUILD) && !target(wrapper)
-wrapper: tools
+wrapper: patch
        ${_PKG_SILENT}${_PKG_DEBUG}${TOUCH} ${TOUCH_FLAGS} ${_WRAPPER_COOKIE}
 .endif
 
@@ -1163,16 +1162,12 @@
 
 .include "${PKGSRCDIR}/mk/bsd.pkg.update.mk"
 
-.PHONY: acquire-tools-lock
 .PHONY: acquire-wrapper-lock acquire-configure-lock acquire-build-lock
-acquire-tools-lock: acquire-lock
 acquire-wrapper-lock: acquire-lock
 acquire-configure-lock: acquire-lock
 acquire-build-lock: acquire-lock
 
-.PHONY: release-tools-lock
 .PHONY: release-wrapper-lock release-configure-lock release-build-lock
-release-tools-lock: release-lock
 release-wrapper-lock: release-lock
 release-configure-lock: release-lock
 release-build-lock: release-lock
@@ -1186,14 +1181,9 @@
 # call the necessary targets/scripts.
 ################################################################
 
-.PHONY: tools
-.if !target(tools)
-tools: patch acquire-tools-lock ${_TOOLS_COOKIE} release-tools-lock
-.endif
-
 .PHONY: wrapper
 .if !target(wrapper)
-wrapper: tools acquire-wrapper-lock ${_WRAPPER_COOKIE} release-wrapper-lock
+wrapper: patch acquire-wrapper-lock ${_WRAPPER_COOKIE} release-wrapper-lock
 .endif
 
 .PHONY: configure
@@ -1214,9 +1204,6 @@
 test: build ${_TEST_COOKIE}
 .endif
 
-${_TOOLS_COOKIE}:
-       ${_PKG_SILENT}${_PKG_DEBUG}cd ${.CURDIR} && ${MAKE} ${MAKEFLAGS} real-tools PKG_PHASE=tools
-
 ${_WRAPPER_COOKIE}:
        ${_PKG_SILENT}${_PKG_DEBUG}cd ${.CURDIR} && ${SETENV} ${BUILD_ENV} ${MAKE} ${MAKEFLAGS} real-wrapper PKG_PHASE=wrapper
 
@@ -1277,10 +1264,8 @@
 ${_TEST_COOKIE}:
        ${_PKG_SILENT}${_PKG_DEBUG}cd ${.CURDIR} && ${SETENV} ${BUILD_ENV} ${MAKE} ${MAKEFLAGS} real-test PKG_PHASE=test
 
-.PHONY: tools-message wrapper-message
+.PHONY: wrapper-message
 .PHONY: configure-message build-message test-message
-tools-message:
-       @${PHASE_MSG} "Overriding tools for ${PKGNAME}"
 wrapper-message:
        @${PHASE_MSG} "Creating toolchain wrappers for ${PKGNAME}"
 configure-message:
@@ -1290,10 +1275,8 @@
 test-message:
        @${PHASE_MSG} "Testing for ${PKGNAME}"
 
-.PHONY: tools-cookie wrapper-cookie
+.PHONY: wrapper-cookie
 .PHONY: configure-cookie build-cookie test-cookie
-tools-cookie:
-       ${_PKG_SILENT}${_PKG_DEBUG} ${TOUCH} ${TOUCH_FLAGS} ${_TOOLS_COOKIE}
 wrapper-cookie:
        ${_PKG_SILENT}${_PKG_DEBUG} ${TOUCH} ${TOUCH_FLAGS} ${_WRAPPER_COOKIE}
 configure-cookie:
@@ -1303,7 +1286,6 @@
 test-cookie:
        ${_PKG_SILENT}${_PKG_DEBUG} ${TOUCH} ${TOUCH_FLAGS} ${_TEST_COOKIE}
 
-.ORDER: tools-message tools-vars pre-tools do-tools post-tools tools-cookie
 .ORDER: wrapper-message wrapper-vars pre-wrapper do-wrapper post-wrapper wrapper-cookie
 .ORDER: configure-message configure-vars pre-configure pre-configure-override do-configure post-configure configure-cookie
 .ORDER: build-message build-vars pre-build do-build post-build build-cookie
@@ -1312,9 +1294,8 @@
 # Please note that the order of the following targets is important, and
 # should not be modified (.ORDER is not recognised by make(1) in a serial
 # make i.e. without -j n)
-.PHONY: real-tools real-wrapper
+.PHONY: real-wrapper
 .PHONY: real-configure real-build real-test
-real-tools: tools-message tools-vars pre-tools do-tools post-tools tools-cookie
 real-wrapper: wrapper-message wrapper-vars pre-wrapper do-wrapper post-wrapper wrapper-cookie
 real-configure: configure-message configure-vars pre-configure pre-configure-override do-configure post-configure configure-cookie
 real-build: build-message build-vars pre-build do-build post-build build-cookie
@@ -1346,7 +1327,7 @@
 
 # Empty pre-* and post-* targets
 
-.for name in tools wrapper configure build test
+.for name in wrapper configure build test
 
 .  if !target(pre-${name})
 pre-${name}:
diff -r e4a44c96fb1e -r 8684100080cb mk/bsd.prefs.mk
--- a/mk/bsd.prefs.mk   Tue Jun 06 05:37:17 2006 +0000
+++ b/mk/bsd.prefs.mk   Tue Jun 06 06:30:29 2006 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.prefs.mk,v 1.224 2006/06/06 04:48:19 jlam Exp $
+# $NetBSD: bsd.prefs.mk,v 1.225 2006/06/06 06:30:29 jlam Exp $
 #
 # Make file, included to get the site preferences, if any.  Should
 # only be included by package Makefiles before any .if defined()
@@ -343,10 +343,10 @@
 # equal to" <phase>.
 #
 ALL_PHASES=            ${PHASES_AFTER_FETCH}
-PHASES_AFTER_FETCH=    fetch ${PHASES_AFTER_EXTRACT}
+PHASES_AFTER_FETCH=    fetch ${PHASES_AFTER_TOOLS}
+PHASES_AFTER_TOOLS=    tools ${PHASES_AFTER_EXTRACT}
 PHASES_AFTER_EXTRACT=  extract ${PHASES_AFTER_PATCH}
-PHASES_AFTER_PATCH=    patch ${PHASES_AFTER_TOOLS}
-PHASES_AFTER_TOOLS=    tools ${PHASES_AFTER_WRAPPER}
+PHASES_AFTER_PATCH=    patch ${PHASES_AFTER_WRAPPER}
 PHASES_AFTER_WRAPPER=  wrapper ${PHASES_AFTER_CONFIGURE}
 PHASES_AFTER_CONFIGURE=        configure ${PHASES_AFTER_BUILD}
 PHASES_AFTER_BUILD=    build ${PHASES_AFTER_INSTALL}
diff -r e4a44c96fb1e -r 8684100080cb mk/extract/extract.mk
--- a/mk/extract/extract.mk     Tue Jun 06 05:37:17 2006 +0000
+++ b/mk/extract/extract.mk     Tue Jun 06 06:30:29 2006 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: extract.mk,v 1.1 2006/06/06 03:05:48 jlam Exp $
+# $NetBSD: extract.mk,v 1.2 2006/06/06 06:30:29 jlam Exp $
 #
 # The following variables may be set by the package Makefile and
 # specify how extraction happens:
@@ -45,6 +45,7 @@
 _EXTRACT_TARGETS+=     checksum
 _EXTRACT_TARGETS+=     ${WRKDIR}
 _EXTRACT_TARGETS+=     depends
+_EXTRACT_TARGETS+=     tools
 _EXTRACT_TARGETS+=     acquire-extract-lock
 _EXTRACT_TARGETS+=     ${_EXTRACT_COOKIE}
 _EXTRACT_TARGETS+=     release-extract-lock
diff -r e4a44c96fb1e -r 8684100080cb mk/tools/bsd.tools.mk
--- a/mk/tools/bsd.tools.mk     Tue Jun 06 05:37:17 2006 +0000
+++ b/mk/tools/bsd.tools.mk     Tue Jun 06 06:30:29 2006 +0000
@@ -1,6 +1,6 @@
-# $NetBSD: bsd.tools.mk,v 1.34 2006/04/13 18:45:01 jlam Exp $
+# $NetBSD: bsd.tools.mk,v 1.35 2006/06/06 06:30:29 jlam Exp $
 #
-# Copyright (c) 2005 The NetBSD Foundation, Inc.
+# Copyright (c) 2005, 2006 The NetBSD Foundation, Inc.
 # All rights reserved.
 #
 # This code is derived from software contributed to The NetBSD Foundation
@@ -35,59 +35,13 @@
 # POSSIBILITY OF SUCH DAMAGE.
 #
 
-#
-# This Makefile fragment creates tools under ${TOOLS_DIR} that are
-# found before similarly-named tools in the system path.
-#
-#    TOOLS_CREATE is a whitespace-separated list of tools for which a
-#       corresponding tool is created.  Either a wrapper script or a
-#       symlink is created depending on the tool that is being
-#      overridden.
-#
-# The following variables specify the details of each <tool>:
-#
-#    TOOLS_CMD.<tool> is the path to the tool under ${TOOLS_DIR}.  This
-#      variable is optional, and if left unspecified it defaults to
-#      ${TOOLS_DIRS}/bin/<tool>.
-#
-#    TOOLS_ALIASES.<tool> is a whitespace-separated list of names for
-#      which <tool> should also be created under ${TOOLS_DIR}.
-#
-#    TOOLS_PATH.<tool> is the path to the actual command that is
-#      invoked when ${TOOLS_CMD.<tool>} is called.  If <tool> should
-#      be a symlink, then this variable is required and should be a
-#      full path.  If <tool> should be a wrapper, then this variable
-#      is required unless TOOLS_SCRIPT.<tool> is defined (see below).
-#
-# The following variables specify further details of each <tool> and
-# if set, cause a wrapper script to be created.
+# This Makefile fragment is included to bsd.pkg.mk and defines the
+# relevant variables and targets for the "tools" phase.
 #
-#    TOOLS_ARGS.<tool> additional arguments that are passed to the real
-#      command ahead of any command-line arguments.  This variable is
-#      optional.
-#
-#    TOOLS_SCRIPT.<tool> specifies the Bourne-shell scriptlet to embed
-#      in the wrapper script that is executed when <tool> is called.
-#      This variable is optional, and if left unspecified, then this
-#      is built up from TOOLS_PATH.<tool> and TOOLS_ARGS.<tool> by
-#      default.
-#
-# The following variables provide shortcuts for creating certain classes
-# of tools:
+# The following are the "public" targets provided by this module:
 #
-#    TOOLS_NOOP is a list of tools that do nothing and return true.
-#
-#    TOOLS_BROKEN is a list of tools that do nothing and return false.
+#    tools
 #
-#    TOOLS_GNU_MISSING is a list of tools for which the GNU missing
-#      script is invoked in place of the real tool.  This is used
-#      primarily to hide GNU auto* tools.
-#
-
-.if !defined(BSD_TOOLS_MK)
-BSD_TOOLS_MK=  defined
-
-.include "../../mk/bsd.prefs.mk"
 
 # Prepend ${TOOLS_DIR}/bin to the PATH so that our scripts are found
 # first when searching for executables.
@@ -98,122 +52,58 @@
 TOOLS_SHELL?=          ${SH}
 _TOOLS_WRAP_LOG=       ${WRKLOG}
 
-.PHONY: do-tools override-tools
-do-tools: override-tools
-override-tools: .OPTIONAL
-
 USE_TOOLS?=            # empty
 
-# Include the other mk/tools/*.mk files here that help specify the
-# wrappers and symlinks that will be created by this file.  Order
-# matters!
-#
-.include "../../mk/tools/automake.mk"
-.include "../../mk/tools/autoconf.mk"
-.include "../../mk/tools/texinfo.mk"
-.include "../../mk/tools/gettext.mk"
-.include "../../mk/tools/ldconfig.mk"
-.include "../../mk/tools/rpcgen.mk"
-.include "../../mk/tools/strip.mk"
-.include "../../mk/tools/imake.mk"
-.include "../../mk/tools/replace.mk"
-.include "../../mk/tools/perl.mk"
-.include "../../mk/tools/pkg-config.mk"
-.include "../../mk/tools/make.mk"
-
 ######################################################################
-
-.for _t_ in ${TOOLS_NOOP}
-TOOLS_CREATE+=         ${_t_}
-TOOLS_SCRIPT.${_t_}?=  exit 0
-.endfor
-
-.for _t_ in ${TOOLS_BROKEN}
-TOOLS_CREATE+=         ${_t_}
-TOOLS_SCRIPT.${_t_}?=  exit 1
-.endfor
+### tools (PUBLIC)
+######################################################################
+### tools is a public target to create a private directory of tools
+### specified by USE_TOOLS.
+###
+_TOOLS_TARGETS+=       acquire-tools-lock
+_TOOLS_TARGETS+=       real-tools
+_TOOLS_TARGETS+=       release-tools-lock
 
-.for _t_ in ${TOOLS_GNU_MISSING}
-TOOLS_CREATE+=         ${_t_}
-TOOLS_PATH.${_t_}?=    ${PKGSRCDIR}/mk/gnu-config/missing
-TOOLS_SCRIPT.${_t_}?=  ${TOOLS_PATH.${_t_}} ${_t_:T:C/-[0-9].*$//}
-.endfor
-
-######################################################################
+.PHONY: tools
+.if !target(tools)
+tools: ${_TOOLS_TARGETS}
+.endif 
 
-# These tools are used in the targets that actually create the wrappers
-# and symlinks.  We define them here so that as a fallback, we'll just
-# use the ones in the PATH.  This makes the tools framework more
-# standalone.



Home | Main Index | Thread Index | Old Index