diff options
author | jlam <jlam@pkgsrc.org> | 2003-08-16 09:08:47 +0000 |
---|---|---|
committer | jlam <jlam@pkgsrc.org> | 2003-08-16 09:08:47 +0000 |
commit | 2a7a699d859169081ffd39a24c407ec31340af3c (patch) | |
tree | 09d25cb0827af04bf3f9d2b0cf4cb701f3b2d6b6 | |
parent | c30216b1e4571bb63592c73df2fb85a1506fb5dd (diff) | |
download | pkgsrc-2a7a699d859169081ffd39a24c407ec31340af3c.tar.gz |
Sync to HEAD for tools.mk changes.
-rw-r--r-- | mk/bsd.pkg.defaults.mk | 2 | ||||
-rw-r--r-- | mk/bsd.pkg.mk | 132 | ||||
-rw-r--r-- | mk/bsd.prefs.mk | 7 | ||||
-rw-r--r-- | mk/buildlink2/bsd.buildlink2.mk | 95 | ||||
-rw-r--r-- | mk/buildlink2/libtool.sh | 5 | ||||
-rw-r--r-- | mk/buildlink2/wrapper.sh | 5 | ||||
-rw-r--r-- | mk/bulk/bsd.bulk-pkg.mk | 2 | ||||
-rwxr-xr-x | mk/bulk/mksandbox | 2 | ||||
-rw-r--r-- | mk/texinfo.mk | 2 | ||||
-rw-r--r-- | mk/tools.mk | 316 |
10 files changed, 246 insertions, 322 deletions
diff --git a/mk/bsd.pkg.defaults.mk b/mk/bsd.pkg.defaults.mk index 384802bcab2..c50622a3958 100644 --- a/mk/bsd.pkg.defaults.mk +++ b/mk/bsd.pkg.defaults.mk @@ -1,4 +1,4 @@ -# $NetBSD: bsd.pkg.defaults.mk,v 1.160.2.6 2003/08/14 07:37:00 jlam Exp $ +# $NetBSD: bsd.pkg.defaults.mk,v 1.160.2.7 2003/08/16 09:08:47 jlam Exp $ # # A file providing defaults for pkgsrc and the packages collection. diff --git a/mk/bsd.pkg.mk b/mk/bsd.pkg.mk index 21542c9fc8b..c7d6f8d6f13 100644 --- a/mk/bsd.pkg.mk +++ b/mk/bsd.pkg.mk @@ -1,4 +1,4 @@ -# $NetBSD: bsd.pkg.mk,v 1.1216.2.17 2003/08/14 13:09:48 jlam Exp $ +# $NetBSD: bsd.pkg.mk,v 1.1216.2.18 2003/08/16 09:08:48 jlam Exp $ # # This file is in the public domain. # @@ -333,6 +333,7 @@ INSTALL_COOKIE= ${WRKDIR}/.install_done TEST_COOKIE= ${WRKDIR}/.test_done BUILD_COOKIE= ${WRKDIR}/.build_done PATCH_COOKIE= ${WRKDIR}/.patch_done +TOOLS_COOKIE= ${WRKDIR}/.tools_done PACKAGE_COOKIE= ${WRKDIR}/.package_done INTERACTIVE_COOKIE= .interactive_stage NULL_COOKIE= ${WRKDIR}/.null @@ -591,9 +592,6 @@ PLIST_SUBST+= PERL5_SITEARCH=${PERL5_SITEARCH:S/^${LOCALBASE}\///} PLIST_SUBST+= PERL5_ARCHLIB=${PERL5_ARCHLIB:S/^${LOCALBASE}\///} .endif -# base vs. GNU tools -. include "../../mk/tools.mk" - # Handle info files # INFO_FILES?= # default to no info files to handle @@ -1258,6 +1256,8 @@ NO_BUILDLINK= # defined . endif .endif +.include "../../mk/tools.mk" + .MAIN: all # Use aliases, so that all versions of English are acceptable @@ -1431,10 +1431,17 @@ checksum: fetch @${DO_NADA} .endif +# Disable tools +.PHONY: tools +.if defined(NO_TOOLS) && !target(tools) +tools: patch + ${_PKG_SILENT}${_PKG_DEBUG}${TOUCH} ${TOUCH_FLAGS} ${TOOLS_COOKIE} +.endif + # Disable buildlink .PHONY: buildlink .if defined(NO_BUILDLINK) && !target(buildlink) -buildlink: patch +buildlink: tools ${_PKG_SILENT}${_PKG_DEBUG}${TOUCH} ${TOUCH_FLAGS} ${BUILDLINK_COOKIE} .endif @@ -2210,77 +2217,6 @@ do-pkgconfig-override: . endfor .endif -.if empty(USE_BUILDLINK2:M[nN][oO]) || empty(_USE_BUILDLINK3:M[nN][oO]) -# -# By default, prevent invocation of GNU "auto*" driven by the generated -# Makefiles during the build process by touching various auto{conf,make} -# source files to make them up-to-date. Packages that require regenerating -# the configure script and Makefile.in files should make the appropriate -# calls to auto{conf,make} in a pre-configure target. -# -# The rationale for the choice of patterns is: -# -# Before configure script is run: -# * configure.in might be generated from configure.in.in, -# * aclocal.m4 is generated by aclocal from acinclude.m4 and -# configure.in, -# * stamp-h.in, stamp-h[0-9].in are the automake timestamp files -# for config.h.in, -# * config.h.in is generated by autoheader from configure.in -# * Makefile.in is generated from Makefile.am, -# * the configure script is generated by autoconf from configure.in, -# aclocal.m4, and various other *.m4 files. -# -# After configure script is run: -# * config.status is generated by the configure script, -# * Makefile, stamp-h, stamp-h[0-9] are generated by config.status. -# * config.h are generated by config.status. -# -# NOTE: If you change the patterns listed below, then it's recommended that -# you verify that the changes are correct by trying to build the -# following packages: -# -# sysutils/fileutils, www/curl, x11/lesstif, x11/kdelibs2 -# -AUTOMAKE_OVERRIDE?= YES -. if empty(AUTOMAKE_OVERRIDE:M[nN][oO]) -AUTOMAKE_PATTERNS+= aclocal.m4 -AUTOMAKE_PATTERNS+= configure.in -AUTOMAKE_PATTERNS+= Makefile.in -AUTOMAKE_PATTERNS+= stamp-h.in stamp-h\[0-9\].in -AUTOMAKE_PATTERNS+= stamp-vti -AUTOMAKE_PATTERNS+= config.h.in -AUTOMAKE_PATTERNS+= ${CONFIGURE_SCRIPT:T} - -_CONFIGURE_PREREQ+= automake-pre-override -.PHONY: automake-pre-override -automake-pre-override: -. if defined(HAS_CONFIGURE) - ${_PKG_SILENT}${_PKG_DEBUG} \ - (for _PATTERN in ${AUTOMAKE_PATTERNS}; do \ - ${FIND} ${WRKSRC} -type f -name "$$_PATTERN" -print; \ - done; echo ${NULL_COOKIE} ) | \ - ${XARGS} ${TOUCH} ${TOUCH_FLAGS} -. endif - -AUTOMAKE_POST_PATTERNS+= config.status -AUTOMAKE_POST_PATTERNS+= Makefile -AUTOMAKE_POST_PATTERNS+= stamp-h stamp-h[0-9] -AUTOMAKE_POST_PATTERNS+= config.h - -_CONFIGURE_POSTREQ+= automake-post-override -.PHONY: automake-post-override -automake-post-override: -. if defined(HAS_CONFIGURE) - ${_PKG_SILENT}${_PKG_DEBUG} \ - (for _PATTERN in ${AUTOMAKE_POST_PATTERNS}; do \ - ${FIND} ${WRKSRC} -type f -name "$$_PATTERN" -print; \ - done; echo ${NULL_COOKIE} ) | \ - ${XARGS} ${TOUCH} ${TOUCH_FLAGS} -. endif -. endif # AUTOMAKE_OVERRIDE -.endif # USE_BUILDLINK != "no" - # By adding this target, it makes sure the the above PREREQ's work. .PHONY: pre-configure-override pre-configure-override: ${_CONFIGURE_PREREQ} @@ -2872,12 +2808,14 @@ show-shlib-type: . endif # libc.dylib .endif -.PHONY: acquire-extract-lock acquire-patch-lock acquire-buildlink-lock -.PHONY: acquire-configure-lock acquire-build-lock +.PHONY: acquire-extract-lock acquire-patch-lock acquire-tools-lock +.PHONY: acquire-buildlink-lock acquire-configure-lock acquire-build-lock acquire-extract-lock: ${_ACQUIRE_LOCK} acquire-patch-lock: ${_ACQUIRE_LOCK} +acquire-tools-lock: + ${_ACQUIRE_LOCK} acquire-buildlink-lock: ${_ACQUIRE_LOCK} acquire-configure-lock: @@ -2885,12 +2823,14 @@ acquire-configure-lock: acquire-build-lock: ${_ACQUIRE_LOCK} -.PHONY: release-extract-lock release-patch-lock release-buildlink-lock -.PHONY: release-configure-lock release-build-lock +.PHONY: release-extract-lock release-patch-lock release-tools-lock +.PHONY: release-buildlink-lock release-configure-lock release-build-lock release-extract-lock: ${_RELEASE_LOCK} release-patch-lock: ${_RELEASE_LOCK} +release-tools-lock: + ${_RELEASE_LOCK} release-buildlink-lock: ${_RELEASE_LOCK} release-configure-lock: @@ -2923,9 +2863,14 @@ extract: checksum ${WRKDIR} acquire-extract-lock ${EXTRACT_COOKIE} release-extra patch: extract acquire-patch-lock ${PATCH_COOKIE} release-patch-lock .endif +.PHONY: tools +.if !target(tools) +tools: patch acquire-tools-lock ${TOOLS_COOKIE} release-tools-lock +.endif + .PHONY: buildlink .if !target(buildlink) -buildlink: patch acquire-buildlink-lock ${BUILDLINK_COOKIE} release-buildlink-lock +buildlink: tools acquire-buildlink-lock ${BUILDLINK_COOKIE} release-buildlink-lock .endif .PHONY: configure @@ -2980,6 +2925,9 @@ ${EXTRACT_COOKIE}: ${PATCH_COOKIE}: ${_PKG_SILENT}${_PKG_DEBUG}cd ${.CURDIR} && ${MAKE} ${MAKEFLAGS} real-patch +${TOOLS_COOKIE}: + ${_PKG_SILENT}${_PKG_DEBUG}cd ${.CURDIR} && ${MAKE} ${MAKEFLAGS} real-tools + ${BUILDLINK_COOKIE}: ${_PKG_SILENT}${_PKG_DEBUG}cd ${.CURDIR} && ${MAKE} ${MAKEFLAGS} real-buildlink @@ -3019,12 +2967,14 @@ ${INSTALL_COOKIE}: ${PACKAGE_COOKIE}: ${_PKG_SILENT}${_PKG_DEBUG}cd ${.CURDIR} && ${MAKE} ${MAKEFLAGS} real-package -.PHONY: extract-message patch-message buildlink-message configure-message -.PHONY: build-message test-message +.PHONY: extract-message patch-message tools-message buildlink-message +.PHONY: configure-message build-message test-message extract-message: @${ECHO_MSG} "${_PKGSRC_IN}> Extracting for ${PKGNAME}" patch-message: @${ECHO_MSG} "${_PKGSRC_IN}> Patching for ${PKGNAME}" +tools-message: + @${ECHO_MSG} "${_PKGSRC_IN}> Overriding tools for ${PKGNAME}" buildlink-message: @${ECHO_MSG} "${_PKGSRC_IN}> Buildlinking for ${PKGNAME}" configure-message: @@ -3034,12 +2984,14 @@ build-message: test-message: @${ECHO_MSG} "${_PKGSRC_IN}> Testing for ${PKGNAME}" -.PHONY: extract-cookie patch-cookie buildlink-cookie configure-cookie -.PHONY: build-cookie test-cookie +.PHONY: extract-cookie patch-cookie tools-cookie buildlink-cookie +.PHONY: configure-cookie build-cookie test-cookie extract-cookie: ${_PKG_SILENT}${_PKG_DEBUG}${ECHO} ${PKGNAME} >> ${EXTRACT_COOKIE} patch-cookie: ${_PKG_SILENT}${_PKG_DEBUG} ${TOUCH} ${TOUCH_FLAGS} ${PATCH_COOKIE} +tools-cookie: + ${_PKG_SILENT}${_PKG_DEBUG} ${TOUCH} ${TOUCH_FLAGS} ${TOOLS_COOKIE} buildlink-cookie: ${_PKG_SILENT}${_PKG_DEBUG} ${TOUCH} ${TOUCH_FLAGS} ${BUILDLINK_COOKIE} configure-cookie: @@ -3052,6 +3004,7 @@ test-cookie: .ORDER: pre-fetch do-fetch post-fetch .ORDER: extract-message install-depends pre-extract do-extract post-extract extract-cookie .ORDER: patch-message pre-patch do-patch post-patch patch-cookie +.ORDER: tools-message pre-tools do-tools post-tools tools-cookie .ORDER: buildlink-message pre-buildlink do-buildlink post-buildlink buildlink-cookie .ORDER: configure-message pre-configure pre-configure-override do-configure post-configure configure-cookie .ORDER: build-message pre-build do-build post-build build-cookie @@ -3060,12 +3013,13 @@ test-cookie: # 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-fetch real-extract real-patch real-buildlink real-configure -.PHONY: real-build real-test real-install real-package real-replace -.PHONY: real-undo-replace +.PHONY: real-fetch real-extract real-patch real-tools real-buildlink +.PHONY: real-configure real-build real-test real-install real-package +.PHONY: real-replace real-undo-replace real-fetch: pre-fetch do-fetch post-fetch real-extract: extract-message install-depends pre-extract do-extract post-extract extract-cookie real-patch: patch-message pre-patch do-patch post-patch patch-cookie +real-tools: tools-message pre-tools do-tools post-tools tools-cookie real-buildlink: buildlink-message pre-buildlink do-buildlink post-buildlink buildlink-cookie real-configure: configure-message pre-configure pre-configure-override do-configure post-configure configure-cookie real-build: build-message pre-build do-build post-build build-cookie @@ -3142,7 +3096,7 @@ do-su-undo-replace: # Empty pre-* and post-* targets -.for name in fetch extract patch buildlink configure build test install-script install package +.for name in fetch extract patch tools buildlink configure build test install-script install package . if !target(pre-${name}) pre-${name}: diff --git a/mk/bsd.prefs.mk b/mk/bsd.prefs.mk index ca2509853c1..666f5dc8400 100644 --- a/mk/bsd.prefs.mk +++ b/mk/bsd.prefs.mk @@ -1,4 +1,4 @@ -# $NetBSD: bsd.prefs.mk,v 1.118.2.5 2003/08/14 07:08:17 jlam Exp $ +# $NetBSD: bsd.prefs.mk,v 1.118.2.6 2003/08/16 09:08:50 jlam Exp $ # # Make file, included to get the site preferences, if any. Should # only be included by package Makefiles before any .if defined() @@ -349,6 +349,11 @@ WRKDIR_BASENAME?= work WRKDIR?= ${BUILD_DIR}/${WRKDIR_BASENAME} +# There are many uses for a common log file, so define one that may be +# picked up and used by tools.mk, bsd.buildlink2.mk, etc. +# +WRKLOG?= ${WRKDIR}/.work.log + # Sun C++ compilers don't support passing ld flags with -Wl to CC. # .if defined(USE_SUNPRO) diff --git a/mk/buildlink2/bsd.buildlink2.mk b/mk/buildlink2/bsd.buildlink2.mk index d60a2a00afa..27f5080fd80 100644 --- a/mk/buildlink2/bsd.buildlink2.mk +++ b/mk/buildlink2/bsd.buildlink2.mk @@ -1,4 +1,4 @@ -# $NetBSD: bsd.buildlink2.mk,v 1.90.4.6 2003/08/14 07:37:06 jlam Exp $ +# $NetBSD: bsd.buildlink2.mk,v 1.90.4.7 2003/08/16 09:08:50 jlam Exp $ # # An example package buildlink2.mk file: # @@ -638,7 +638,7 @@ _BLNK_WRAP_CACHE_TRANSFORM= ${BUILDLINK_DIR}/bin/.cache-trans _BLNK_WRAP_POST_CACHE= ${BUILDLINK_DIR}/bin/.post-cache _BLNK_WRAP_LOGIC= ${BUILDLINK_DIR}/bin/.logic _BLNK_WRAP_LOGIC_TRANSFORM= ${BUILDLINK_DIR}/bin/.logic-trans -_BLNK_WRAP_LOG= ${BUILDLINK_DIR}/.wrapper.log +_BLNK_WRAP_LOG= ${WRKLOG} _BLNK_LIBTOOL_DO_INSTALL= ${BUILDLINK_DIR}/bin/.libtool-do-install _BLNK_LIBTOOL_FIX_LA= ${BUILDLINK_DIR}/bin/.libtool-fix-la _BLNK_FAKE_LA= ${BUILDLINK_DIR}/bin/.fake-la @@ -1036,94 +1036,3 @@ buildlink-check: @if [ -f ${_BLNK_WRAP_LOG} ]; then \ ${GREP} ${_BLNK_CHECK_PATTERNS} ${_BLNK_WRAP_LOG} || ${TRUE}; \ fi - -# Create shell scripts in ${BUILDLINK_DIR} that simply return an error -# status for each of the GNU auto* tools, which should cause GNU configure -# scripts to think that they can't be found. -# -AUTOMAKE_OVERRIDE?= yes -_GNU_MISSING= ${.CURDIR}/../../mk/gnu-config/missing -_HIDE_PROGS.autoconf= bin/autoconf bin/autoconf-2.13 \ - bin/autoheader bin/autoheader-2.13 \ - bin/autom4te \ - bin/autoreconf bin/autoreconf-2.13 \ - bin/autoscan bin/autoscan-2.13 \ - bin/autoupdate bin/autoupdate-2.13 \ - bin/ifnames bin/ifnames-2.13 -_HIDE_PROGS.automake= bin/aclocal bin/aclocal-1.4 \ - bin/aclocal-1.5 \ - bin/aclocal-1.6 \ - bin/aclocal-1.7 \ - bin/automake bin/automake-1.4 \ - bin/automake-1.5 \ - bin/automake-1.6 \ - bin/automake-1.7 - -.if empty(AUTOMAKE_OVERRIDE:M[nN][oO]) -do-buildlink: hide-autotools -.endif - -hide-autotools: # empty - -.for _autotool_ in autoconf automake -hide-autotools: hide-${_autotool_} -. for _prog_ in ${_HIDE_PROGS.${_autotool_}} -hide-${_autotool_}: ${BUILDLINK_DIR}/${_prog_} -${BUILDLINK_DIR}/${_prog_}: ${_GNU_MISSING} - ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} - ${_PKG_SILENT}${_PKG_DEBUG} \ - ${ECHO} "#!${BUILDLINK_SHELL}" > ${.TARGET} - ${_PKG_SILENT}${_PKG_DEBUG} \ - ${ECHO} "exec ${_GNU_MISSING} ${_prog_:T:C/-[0-9].*$//}" >> ${.TARGET} - ${_PKG_SILENT}${_PKG_DEBUG}${CHMOD} +x ${.TARGET} -. endfor -.endfor - -# install-info and makeinfo handling. -# -# Create an install-info script that is a "no operation" command -# as registration of info files is handled by the INSTALL script. -CONFIGURE_ENV+= INSTALL_INFO="${BUILDLINK_DIR}/bin/install-info" -MAKE_ENV+= INSTALL_INFO="${BUILDLINK_DIR}/bin/install-info" - -do-buildlink: hide-install-info - -hide-install-info: ${BUILDLINK_DIR}/bin/install-info -${BUILDLINK_DIR}/bin/install-info: - ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} - ${_PKG_SILENT}${_PKG_DEBUG} \ - ${ECHO} "#!${BUILDLINK_SHELL}" > ${.TARGET} - ${_PKG_SILENT}${_PKG_DEBUG} \ - ${ECHO} '${ECHO} "==> Noop install-info $$*" >> ${_BLNK_WRAP_LOG}' >> ${.TARGET} - ${_PKG_SILENT}${_PKG_DEBUG}${CHMOD} +x ${.TARGET} - -# Create a makeinfo script that will invoke the right makeinfo -# command if USE_MAKEINFO is 'yes' or will exit on error if not. -CONFIGURE_ENV+= MAKEINFO="${BUILDLINK_DIR}/bin/makeinfo" -MAKE_ENV+= MAKEINFO="${BUILDLINK_DIR}/bin/makeinfo" - -.if empty(USE_MAKEINFO:M[nN][oO]) -do-buildlink: makeinfo-wrapper -makeinfo-wrapper: ${BUILDLINK_DIR}/bin/makeinfo -${BUILDLINK_DIR}/bin/makeinfo: - ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} - ${_PKG_SILENT}${_PKG_DEBUG} \ - ${ECHO} "#!${BUILDLINK_SHELL}" > ${.TARGET} - ${_PKG_SILENT}${_PKG_DEBUG} \ - ${ECHO} 'echo "${MAKEINFO} $$*" >> ${_BLNK_WRAP_LOG}' >> ${.TARGET} - ${_PKG_SILENT}${_PKG_DEBUG} \ - ${ECHO} 'exec ${MAKEINFO} "$$@"' >> ${.TARGET} - ${_PKG_SILENT}${_PKG_DEBUG}${CHMOD} +x ${.TARGET} -.else # !USE_MAKEINFO -do-buildlink: hide-makeinfo -hide-makeinfo: ${BUILDLINK_DIR}/bin/makeinfo -${BUILDLINK_DIR}/bin/makeinfo: ${_GNU_MISSING} - ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} - ${_PKG_SILENT}${_PKG_DEBUG} \ - ${ECHO} "#!${BUILDLINK_SHELL}" > ${.TARGET} - ${_PKG_SILENT}${_PKG_DEBUG} \ - ${ECHO} '${ECHO} "==> [buildlink2] Error: makeinfo $$*" >> ${_BLNK_WRAP_LOG}' >> ${.TARGET} - ${_PKG_SILENT}${_PKG_DEBUG} \ - ${ECHO} 'exit 1' >> ${.TARGET} - ${_PKG_SILENT}${_PKG_DEBUG}${CHMOD} +x ${.TARGET} -.endif # USE_MAKEINFO diff --git a/mk/buildlink2/libtool.sh b/mk/buildlink2/libtool.sh index 1e5b20e76fa..aecc92f4807 100644 --- a/mk/buildlink2/libtool.sh +++ b/mk/buildlink2/libtool.sh @@ -1,6 +1,6 @@ #!@BUILDLINK_SHELL@ # -# $NetBSD: libtool.sh,v 1.8 2002/12/26 17:08:57 jlam Exp $ +# $NetBSD: libtool.sh,v 1.8.6.1 2003/08/16 09:08:51 jlam Exp $ Xsed='@SED@ -e 1s/^X//' sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g' @@ -15,7 +15,8 @@ cache="@_BLNK_WRAP_CACHE@" post_cache="@_BLNK_WRAP_POST_CACHE@" logic="@_BLNK_WRAP_LOGIC@" post_logic="@_BLNK_WRAP_POST_LOGIC@" -wrapperlog="@_BLNK_WRAP_LOG@" + +wrapperlog="${BUILDLINK_WRAPPER_LOG-@_BLNK_WRAP_LOG@}" libtool_fix_la="@_BLNK_LIBTOOL_FIX_LA@" libtool_do_install="@_BLNK_LIBTOOL_DO_INSTALL@" diff --git a/mk/buildlink2/wrapper.sh b/mk/buildlink2/wrapper.sh index 79e0b9ed893..e86da234836 100644 --- a/mk/buildlink2/wrapper.sh +++ b/mk/buildlink2/wrapper.sh @@ -1,6 +1,6 @@ #!@BUILDLINK_SHELL@ # -# $NetBSD: wrapper.sh,v 1.7 2003/01/01 07:16:57 jlam Exp $ +# $NetBSD: wrapper.sh,v 1.7.6.1 2003/08/16 09:08:51 jlam Exp $ Xsed='@SED@ -e 1s/^X//' sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g' @@ -15,7 +15,8 @@ cache="@_BLNK_WRAP_CACHE@" post_cache="@_BLNK_WRAP_POST_CACHE@" logic="@_BLNK_WRAP_LOGIC@" post_logic="@_BLNK_WRAP_POST_LOGIC@" -wrapperlog="@_BLNK_WRAP_LOG@" + +wrapperlog="${BUILDLINK_WRAPPER_LOG-@_BLNK_WRAP_LOG@}" updatecache=${BUILDLINK_UPDATE_CACHE-yes} cacheall=${BUILDLINK_CACHE_ALL-no} diff --git a/mk/bulk/bsd.bulk-pkg.mk b/mk/bulk/bsd.bulk-pkg.mk index c71314752bc..605799ef2e1 100644 --- a/mk/bulk/bsd.bulk-pkg.mk +++ b/mk/bulk/bsd.bulk-pkg.mk @@ -1,4 +1,4 @@ -# $NetBSD: bsd.bulk-pkg.mk,v 1.45.2.2 2003/08/14 07:37:07 jlam Exp $ +# $NetBSD: bsd.bulk-pkg.mk,v 1.45.2.3 2003/08/16 09:08:51 jlam Exp $ # # Copyright (c) 1999, 2000 Hubert Feyrer <hubertf@netbsd.org> diff --git a/mk/bulk/mksandbox b/mk/bulk/mksandbox index 3b3f6524f76..c9327799635 100755 --- a/mk/bulk/mksandbox +++ b/mk/bulk/mksandbox @@ -1,6 +1,6 @@ #! /bin/sh -# $NetBSD: mksandbox,v 1.20.4.2 2003/08/14 07:37:07 jlam Exp $ +# $NetBSD: mksandbox,v 1.20.4.3 2003/08/16 09:08:52 jlam Exp $ # # # Copyright (c) 2002 Alistair G. Crooks. All rights reserved. diff --git a/mk/texinfo.mk b/mk/texinfo.mk index 0871408ddfc..d088e164357 100644 --- a/mk/texinfo.mk +++ b/mk/texinfo.mk @@ -1,4 +1,4 @@ -# $NetBSD: texinfo.mk,v 1.14.2.2 2003/08/14 07:37:04 jlam Exp $ +# $NetBSD: texinfo.mk,v 1.14.2.3 2003/08/16 09:08:50 jlam Exp $ # # This Makefile fragment is included by bsd.pkg.mk when INFO_FILES is # not empty or USE_MAKEINFO is not "no". diff --git a/mk/tools.mk b/mk/tools.mk index b82458ff1f6..9861cd42ce7 100644 --- a/mk/tools.mk +++ b/mk/tools.mk @@ -1,175 +1,229 @@ -# $NetBSD: tools.mk,v 1.4.2.2 2003/08/14 07:37:05 jlam Exp $ +# $NetBSD: tools.mk,v 1.4.2.3 2003/08/16 09:08:50 jlam Exp $ # -# handle platforms with broken tools in the base system, such as sed -# and awk. -# -# symlink the suitable versions of tools into .buildlink/bin (if they -# exist in the base system) and allow packages to force the use of -# pkgsrc GNU tools when they are not present in the base system by -# defining e.g. USE_GNU_TOOLS+="awk sed". version numbers are not -# considered. +# This Makefile creates a ${TOOLS_DIR} directory and populates the bin +# subdir with tools that hide the ones outside of ${TOOLS_DIR}. + +.if !defined(TOOLS_MK) +TOOLS_MK= # defined + +# Prepend ${TOOLS_DIR}/bin to the PATH so that our scripts are found +# first when search for executables. # -# this functionality is buildlink2 only. +TOOLS_DIR= ${WRKDIR}/.tools +PATH:= ${TOOLS_DIR}/bin:${PATH} + +TOOLS_SHELL?= ${SH} +_TOOLS_WRAP_LOG= ${WRKLOG} + +.PHONY: do-tools +.if !target(do-tools) +do-tools: override-tools +.endif + +.PHONY: override-tools +override-tools: # empty + +# Create shell scripts in ${TOOLS_DIR}/bin that simply return an error +# status for each of the GNU auto* tools, which should cause GNU configure +# scripts to think that they can't be found. # -# packages should always use eg. +AUTOMAKE_OVERRIDE?= yes +_GNU_MISSING= ${.CURDIR}/../../mk/gnu-config/missing +_HIDE_PROGS.autoconf= bin/autoconf bin/autoconf-2.13 \ + bin/autoheader bin/autoheader-2.13 \ + bin/autom4te \ + bin/autoreconf bin/autoreconf-2.13 \ + bin/autoscan bin/autoscan-2.13 \ + bin/autoupdate bin/autoupdate-2.13 \ + bin/ifnames bin/ifnames-2.13 +_HIDE_PROGS.automake= bin/aclocal bin/aclocal-1.4 \ + bin/aclocal-1.5 \ + bin/aclocal-1.6 \ + bin/aclocal-1.7 \ + bin/automake bin/automake-1.4 \ + bin/automake-1.5 \ + bin/automake-1.6 \ + bin/automake-1.7 + +.if empty(AUTOMAKE_OVERRIDE:M[nN][oO]) +. for _autotool_ in autoconf automake +. for _prog_ in ${_HIDE_PROGS.${_autotool_}} +override-tools: ${TOOLS_DIR}/${_prog_} +${TOOLS_DIR}/${_prog_}: ${_GNU_MISSING} + ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} + ${_PKG_SILENT}${_PKG_DEBUG} \ + ( ${ECHO} '#!${TOOLS_SHELL}'; \ + ${ECHO} 'exec ${_GNU_MISSING} ${_prog_:T:C/-[0-9].*$//}' \ + ) > ${.TARGET} + ${_PKG_SILENT}${_PKG_DEBUG}${CHMOD} +x ${.TARGET} +. endfor +. endfor +.endif # AUTOMAKE_OVERRIDE != NO + +# Create an install-info script that is a "no operation" command, +# as registration of info files is handled by the INSTALL script. # -# USE_GNU_TOOLS+= grep +CONFIGURE_ENV+= INSTALL_INFO="${TOOLS_DIR}/bin/install-info" +MAKE_ENV+= INSTALL_INFO="${TOOLS_DIR}/bin/install-info" + +override-tools: ${TOOLS_DIR}/bin/install-info +${TOOLS_DIR}/bin/install-info: + ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} + ${_PKG_SILENT}${_PKG_DEBUG} \ + ( ${ECHO} '#!${TOOLS_SHELL}'; \ + ${ECHO} 'wrapperlog="$${TOOLS_WRAPPER_LOG-${_TOOLS_WRAP_LOG}}"'; \ + ${ECHO} '${ECHO} "==> No-op install-info $$*" >> $$wrapperlog' \ + ) > ${.TARGET} + ${_PKG_SILENT}${_PKG_DEBUG}${CHMOD} +x ${.TARGET} + +# Create a makeinfo script that will invoke the right makeinfo +# command if USE_MAKEINFO is 'yes' or will exit on error if not. # -# to be sure not to override the setting passed by the user. +CONFIGURE_ENV+= MAKEINFO="${TOOLS_DIR}/bin/makeinfo" +MAKE_ENV+= MAKEINFO="${TOOLS_DIR}/bin/makeinfo" + +override-tools: ${TOOLS_DIR}/bin/makeinfo +.if empty(USE_MAKEINFO:M[nN][oO]) +${TOOLS_DIR}/bin/makeinfo: + ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} + ${_PKG_SILENT}${_PKG_DEBUG} \ + ( ${ECHO} "#!${TOOLS_SHELL}"; \ + ${ECHO} 'wrapperlog="$${TOOLS_WRAPPER_LOG-${_TOOLS_WRAP_LOG}}"'; \ + ${ECHO} '${ECHO} "${MAKEINFO} $$*" >> $$wrapperlog'; \ + ${ECHO} 'exec ${MAKEINFO} "$$@"' \ + ) > ${.TARGET} + ${_PKG_SILENT}${_PKG_DEBUG}${CHMOD} +x ${.TARGET} +.else # !USE_MAKEINFO +${TOOLS_DIR}/bin/makeinfo: ${_GNU_MISSING} + ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} + ${_PKG_SILENT}${_PKG_DEBUG} \ + ( ${ECHO} "#!${TOOLS_SHELL}"; \ + ${ECHO} 'wrapperlog="$${TOOLS_WRAPPER_LOG-${_TOOLS_WRAP_LOG}}"'; \ + ${ECHO} '${ECHO} "==> Error: makeinfo $$*" >> $$wrapperlog'; \ + ${ECHO} 'exit 1' \ + ) > ${.TARGET} + ${_PKG_SILENT}${_PKG_DEBUG}${CHMOD} +x ${.TARGET} +.endif # USE_MAKEINFO + +# Handle platforms with broken tools in the base system, e.g. sed, awk. # +# Symlink the suitable versions of tools into ${TOOLS_DIR}/bin (if they +# exist in the base system) and allow packages to force the use of +# pkgsrc GNU tools when they are not present in the base system by +# defining e.g. USE_GNU_TOOLS+="awk sed". Version numbers are not +# considered. -.if !defined(TOOLS_MK) -TOOLS_MK= # defined - -.if empty(USE_BUILDLINK2:M[nN][oO]) _TOOLS= awk grep sed -# define which platforms already have GNU tools, so no need to pull in -# the pkgsrc versions. +# These platforms already have GNU versions of the tools in the base +# system, so no need to pull in the pkgsrc versions; we will use these +# instead. +# _TOOLS_OPSYS_HAS_GNU.awk+= FreeBSD-*-* Linux-*-* NetBSD-*-* OpenBSD-*-* _TOOLS_OPSYS_HAS_GNU.grep+= Darwin-*-* FreeBSD-*-* Linux-*-* _TOOLS_OPSYS_HAS_GNU.grep+= NetBSD-*-* OpenBSD-*-* _TOOLS_OPSYS_HAS_GNU.sed+= Linux-*-* -# where said tool is completely unusable, and no suitable replacement -# is available. +# These platforms have GNUish versions of the tools available in the base +# system, which we already define as ${AWK}, ${SED}, etc. (refer to +# defs.*.mk for the definitions), so no need to pull in the pkgsrc +# versions; we will use these instead. +# +_TOOLS_REPLACE_OPSYS.awk+= SunOS-*-* +_TOOLS_REPLACE_OPSYS.grep+= SunOS-*-* +_TOOLS_REPLACE_OPSYS.sed+= # empty + +# These platforms have completely unusable versions of these tools, and +# no suitable replacement is available. +# _TOOLS_OPSYS_INCOMPAT.awk+= # empty _TOOLS_OPSYS_INCOMPAT.grep+= # empty _TOOLS_OPSYS_INCOMPAT.sed+= # empty -# a suitable alternative version is available in the base system, as -# eg. ${AWK}, ${SED}, ... refer to defs.*.mk for the definitions. -_TOOLS_REPLACE_OPSYS.awk+= SunOS-*-* -_TOOLS_REPLACE_OPSYS.grep+= SunOS-*-* -_TOOLS_REPLACE_OPSYS.sed+= # empty +# Default to not requiring GNU tools. +.for _tool_ in ${_TOOLS} +_TOOLS_NEED_GNU.${_tool_}?= NO +_TOOLS_REPLACE.${_tool_}?= NO +_TOOLS_OVERRIDE.${_tool_}?= NO +.endfor -# what GNU tools did the package or user ask for, and does the OS -# already have it? .for _tool_ in ${USE_GNU_TOOLS} -_TOOLS_NEED_GNU.${_tool_}= YES +# +# What GNU tools did the package or user ask for, and does the base +# system already have it? +# +_TOOLS_NEED_GNU.${_tool_}= YES . for _pattern_ in ${_TOOLS_OPSYS_HAS_GNU.${_tool_}} . if !empty(MACHINE_PLATFORM:M${_pattern_}) -_TOOLS_NEED_GNU.${_tool_}= NO +_TOOLS_NEED_GNU.${_tool_}= NO . endif . endfor -.endfor - -# default to not requiring GNU tools. -.for _tool_ in ${_TOOLS} -_TOOLS_NEED_GNU.${_tool_}?= NO -_TOOLS_REPLACE.${_tool_}?= NO - -# do we know it's broken? +# +# Do we know the base system tool is broken? +# . for _pattern_ in ${_TOOLS_OPSYS_INCOMPAT.${_tool_}} . if !empty(MACHINE_PLATFORM:M${_pattern_}) -_TOOLS_NEED_GNU.${_tool_}= YES +_TOOLS_NEED_GNU.${_tool_}= YES . endif . endfor - -# are we replacing it with a better version? +# +# Are we using a GNUish system tool in place of the needed GNU tool? +# . for _pattern_ in ${_TOOLS_REPLACE_OPSYS.${_tool_}} . if !empty(MACHINE_PLATFORM:M${_pattern_}) -_TOOLS_REPLACE.${_tool_}= YES +TOOLS_REPLACE.${_tool_}= YES . endif . endfor +.endfor # USE_GNU_TOOLS -.endfor # ${_TOOLS} - -.if ${_TOOLS_NEED_GNU.awk} == "YES" && empty(PKGPATH:Mlang/gawk) -_TOOLS_PROGNAME.gawk= ${LOCALBASE}/bin/${GNU_PROGRAM_PREFIX}awk -# catch the case where we are in between package installs, thus don't -# have gawk available yet. -. if exists(${_TOOLS_PROGNAME.gawk}) -AWK= ${_TOOLS_PROGNAME.gawk} -. endif -BUILDLINK_DEPENDS.gawk?= gawk>=3.1.1 -BUILDLINK_PKGSRCDIR.gawk?= ../../lang/gawk -BUILDLINK_DEPMETHOD.gawk?= build -BUILDLINK_PACKAGES+= gawk -BUILDLINK_PREFIX.gawk_DEFAULT= ${LOCALBASE} -BUILDLINK_FILES.gawk= bin/${GNU_PROGRAM_PREFIX}awk -EVAL_PREFIX+= BUILDLINK_PREFIX.gawk=gawk -.endif - -.if ${_TOOLS_NEED_GNU.awk} == "YES" || ${_TOOLS_REPLACE.awk} == "YES" -BUILDLINK_TARGETS+= gawk-buildlink gawk-buildlink-bin +.if ${_TOOLS_REPLACE.awk} == "YES" +_TOOLS_OVERRIDE.awk= YES +_TOOLS_PROGNAME.awk= ${AWK} .endif - -.if ${_TOOLS_NEED_GNU.grep} == "YES" && empty(PKGPATH:Mtextproc/grep) -_TOOLS_PROGNAME.grep= ${LOCALBASE}/bin/${GNU_PROGRAM_PREFIX}grep -. if exists(${_TOOLS_PROGNAME.grep}) -GREP= ${_TOOLS_PROGNAME.grep} -. endif -BUILDLINK_DEPENDS.grep?= grep>=2.5.1 -BUILDLINK_PKGSRCDIR.grep?= ../../textproc/grep -BUILDLINK_DEPMETHOD.grep?= build -BUILDLINK_PACKAGES+= grep -BUILDLINK_PREFIX.grep= ${LOCALBASE} -BUILDLINK_FILES.grep= bin/${GNU_PROGRAM_PREFIX}grep -EVAL_PREFIX+= BUILDLINK_PREFIX.grep=grep +.if (${_TOOLS_NEED_GNU.awk} == "YES") && empty(PKGPATH:Mlang/gawk) +BUILD_DEPENDS+= gawk>=3.1.1:../../lang/gawk +_TOOLS_OVERRIDE.awk= YES +_TOOLS_PROGNAME.awk= ${LOCALBASE}/bin/${GNU_PROGRAM_PREFIX}awk +AWK:= ${_TOOLS_PROGNAME.awk} .endif -.if ${_TOOLS_NEED_GNU.grep} == "YES" || ${_TOOLS_REPLACE.grep} == "YES" -BUILDLINK_TARGETS+= grep-buildlink grep-buildlink-bin +.if ${_TOOLS_REPLACE.grep} == "YES" +_TOOLS_OVERRIDE.grep= YES +_TOOLS_PROGNAME.grep= ${GREP} .endif - -.if ${_TOOLS_NEED_GNU.sed} == "YES" && empty(PKGPATH:Mtextproc/gsed) -_TOOLS_PROGNAME.gsed= ${LOCALBASE}/bin/${GNU_PROGRAM_PREFIX}sed -. if exists(${_TOOLS_PROGNAME.gsed}) -SED= ${_TOOLS_PROGNAME.gsed} -. endif -BUILDLINK_DEPENDS.gsed?= gsed>=3.0.2 -BUILDLINK_PKGSRCDIR.gsed?= ../../textproc/gsed -BUILDLINK_DEPMETHOD.gsed?= build -BUILDLINK_PACKAGES+= gsed -BUILDLINK_PREFIX.gsed_DEFAULT= ${LOCALBASE} -BUILDLINK_FILES.gsed= bin/${GNU_PROGRAM_PREFIX}sed -EVAL_PREFIX+= BUILDLINK_PREFIX.gsed=gsed +.if (${_TOOLS_NEED_GNU.grep} == "YES") && empty(PKGPATH:Mtextproc/grep) +BUILD_DEPENDS+= grep>=2.5.1:../../textproc/grep +_TOOLS_OVERRIDE.grep= YES +_TOOLS_PROGNAME.grep= ${LOCALBASE}/bin/${GNU_PROGRAM_PREFIX}grep +GREP:= ${_TOOLS_PROGNAME.grep} .endif -.if ${_TOOLS_NEED_GNU.sed} == "YES" || ${_TOOLS_REPLACE.sed} == "YES" -BUILDLINK_TARGETS+= gsed-buildlink gsed-buildlink-bin +.if ${_TOOLS_REPLACE.sed} == "YES" +_TOOLS_OVERRIDE.sed= YES +_TOOLS_PROGNAME.sed= ${SED} .endif - -gawk-buildlink: _BUILDLINK_USE -gawk-buildlink-bin: -.if ${_TOOLS_NEED_GNU.awk} == "YES" && empty(PKGPATH:Mlang/gawk) - ${_PKG_SILENT}${_PKG_DEBUG} \ - [ ! -f ${BUILDLINK_DIR}/bin/awk ] && \ - ${LN} -fs ${LOCALBASE}/bin/${GNU_PROGRAM_PREFIX}awk \ - ${BUILDLINK_DIR}/bin/awk -.elif ${_TOOLS_REPLACE.awk} == "YES" - ${_PKG_SILENT}${_PKG_DEBUG} \ - [ ! -f ${BUILDLINK_DIR}/bin/awk ] && \ - ${LN} -fs ${AWK} ${BUILDLINK_DIR}/bin/awk +.if (${_TOOLS_NEED_GNU.sed} == "YES") && empty(PKGPATH:Mtextproc/gsed) +BUILD_DEPENDS+= gsed>=3.0.2:../../textproc/gsed +_TOOLS_OVERRIDE.sed= YES +_TOOLS_PROGNAME.sed= ${LOCALBASE}/bin/${GNU_PROGRAM_PREFIX}sed +SED:= ${_TOOLS_PROGNAME.sed} .endif -grep-buildlink: _BUILDLINK_USE -grep-buildlink-bin: -.if ${_TOOLS_NEED_GNU.grep} == "YES" && empty(PKGPATH:Mtextproc/grep) - ${_PKG_SILENT}${_PKG_DEBUG} \ - [ ! -f ${BUILDLINK_DIR}/bin/grep ] && \ - ${LN} -fs ${LOCALBASE}/bin/${GNU_PROGRAM_PREFIX}grep \ - ${BUILDLINK_DIR}/bin/grep -.elif ${_TOOLS_REPLACE.grep} == "YES" - ${_PKG_SILENT}${_PKG_DEBUG} \ - [ ! -f ${BUILDLINK_DIR}/bin/grep ] && \ - ${LN} -fs ${GREP} ${BUILDLINK_DIR}/bin/grep -.endif - -gsed-buildlink: _BUILDLINK_USE -gsed-buildlink-bin: -.if ${_TOOLS_NEED_GNU.sed} == "YES" && empty(PKGPATH:Mtextproc/gsed) - ${_PKG_SILENT}${_PKG_DEBUG} \ - [ ! -f ${BUILDLINK_DIR}/bin/sed ] && \ - ${LN} -fs ${LOCALBASE}/bin/${GNU_PROGRAM_PREFIX}sed \ - ${BUILDLINK_DIR}/bin/sed -.elif ${_TOOLS_REPLACE.sed} == "YES" - ${_PKG_SILENT}${_PKG_DEBUG} \ - [ ! -f ${BUILDLINK_DIR}/bin/sed ] && \ - ${LN} -fs ${SED} ${BUILDLINK_DIR}/bin/sed -.endif - -.endif # USE_BUILDLINK2 +# If _TOOLS_OVERRIDE.<tool> is actually set to "YES", then we override +# the tool with the one specified in _TOOLS_PROGNAME.<tool>. +# +.for _tool_ in ${_TOOLS} +. if ${_TOOLS_OVERRIDE.${_tool_}} == "YES" +override-tools: ${TOOLS_DIR}/bin/${_tool_} + +${TOOLS_DIR}/bin/${_tool_}: + ${_PKG_SILENT}${_PKG_DEBUG} \ + src="${_TOOLS_PROGNAME.${_tool_}}"; \ + if [ -x $$src -a ! -f ${.TARGET} ]; then \ + ${MKDIR} ${.TARGET:H}; \ + ${LN} -sf $$src ${.TARGET}; \ + fi +. endif +.endfor .endif # TOOLS_MK |