Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 28 Feb 2002 11:34:52 +0200
From:      Maxim Sobolev <sobomax@FreeBSD.org>
To:        Maxim Sobolev <sobomax@FreeBSD.org>, ports@FreeBSD.org
Subject:   Re: Speeding up bsd.ports.mk [patch #3]
Message-ID:  <3C7DF9BC.B61F7C6@FreeBSD.org>
References:  <3C73F34F.D9A58E8B@FreeBSD.org> <1014506262.48476.13.camel@notebook>

next in thread | previous in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.
--------------7746931EEA6A51301F16C5D2
Content-Type: text/plain; charset=koi8-r
Content-Transfer-Encoding: 7bit

Maxim Sobolev wrote:
> 
> On Wed, 2002-02-20 at 21:04, Maxim Sobolev wrote:
> > Hi folks,
> >
> > Recently NetBSD team removed all .USE macros from their bsd.pkg.mk
> > (see http://mail-index.netbsd.org/tech-pkg/2001/11/08/0001.html) -
> > which should make operations (most notably dependency resolution and
> > registration) 3 times faster. What do people think about integrating
> > those changes into our bsd.port.mk?
> 
> First of all, thanks to all for feedback and suggestions.
> 
> Attached please find the updated version of the patch, which solves one
> of the major drawbacks of the previous version -  now ports that really
> need it could fall-back to a previous behaviour (i.e. execute each main
> target in its own submake). This allows ports that change their
> behaviour based on user's input using dialog(1) and other means work
> correctly. Also I've collapsed 6 main targets into a .for loop, so that
> the code is more compact, added several more comments, adjusted
> indentation to be consistent with the rest of the file and moved several
> targets where they belong.

Ok, thanks to a delay with 4-exp build I have prepared another
revision. This version adds 2x speedup into dependency registration
process. This is significant improvement, especially for things like
GNOME with zillion dependencies. For example without this patch `make
package-depends' in ports/mail/evolution takes more than 1 minute to
complete on my underpowered 266MMX notebook, while after it it takes
only 36 seconds.

As usually any feedback is greatly appreciated.

-Maxim
--------------7746931EEA6A51301F16C5D2
Content-Type: text/plain; charset=koi8-r;
 name="bsd.port.mk-speedup.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="bsd.port.mk-speedup.diff"

Index: bsd.port.mk
===================================================================
RCS file: /home/ncvs/ports/Mk/bsd.port.mk,v
retrieving revision 1.400
diff -d -u -r1.400 bsd.port.mk
--- bsd.port.mk	24 Feb 2002 16:54:34 -0000	1.400
+++ bsd.port.mk	28 Feb 2002 09:27:14 -0000
@@ -121,6 +121,11 @@
 #				  during any step in a package build.  User can then decide
 #				  to skip this port by setting ${BATCH}, or compiling only
 #				  the interactive ports by setting ${INTERACTIVE}.
+# USE_SUBMAKE	- Set this if you want that each of the port's main 6 targets
+#				  (extract, patch, configure, build, install and package) to be
+#				  executed in a separate make(1) process. Useful when one of
+#				  the stages needs to influence make(1) variables of the later
+#				  stages using ${WRKDIR}/Makefile.inc generated on the fly.
 #
 # Set these if your port only makes sense to certain archetictures.
 # They are lists containing names for them (e.g., "alpha i386").
@@ -1021,8 +1026,7 @@
 .include "${PORTSDIR}/../Makefile.inc"
 .endif
 
-# Don't change these!!!  These names are built into the _TARGET_USE macro,
-# there is no way to refer to them cleanly from within the macro AFAIK.
+# Names of cookies used to skip already completed stages
 EXTRACT_COOKIE?=	${WRKDIR}/.extract_done.${PKGNAME}
 CONFIGURE_COOKIE?=	${WRKDIR}/.configure_done.${PKGNAME}
 INSTALL_COOKIE?=	${WRKDIR}/.install_done.${PKGNAME}
@@ -1995,6 +1999,24 @@
 # adding pre-* or post-* targets/scripts, override these.
 ################################################################
 
+# Pre-everything
+
+.if !target(pre-everything)
+pre-everything:
+.if defined(TRYBROKEN)
+	@${ECHO_MSG} "Trying build of ${PKGNAME} even though it is marked BROKEN."
+.else
+	@${DO_NADA}
+.endif
+.if defined(GNOME_OPTION_MSG) && (!defined(PACKAGE_BUILDING) || !defined(BATCH))
+	@for m in ${GNOME_OPTION_MSG}; do \
+		${ECHO_MSG} $$m; \
+	done
+.else
+	@${DO_NADA}
+.endif
+.endif
+
 # Fetch
 
 .if !target(do-fetch)
@@ -2252,7 +2280,6 @@
 
 .if !target(do-package)
 do-package: ${TMPPLIST}
-	@${ECHO_MSG} "===>  Building package for ${PKGNAME}"
 	@if [ -d ${PACKAGES} ]; then \
 		if [ ! -d ${PKGREPOSITORY} ]; then \
 			if ! ${MKDIR} ${PKGREPOSITORY}; then \
@@ -2275,8 +2302,7 @@
 # Some support rules for do-package
 
 .if !target(package-links)
-package-links:
-	@cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} delete-package-links
+package-links: delete-package-links
 	@for cat in ${CATEGORIES}; do \
 		if [ ! -d ${PACKAGES}/$$cat ]; then \
 			if ! ${MKDIR} ${PACKAGES}/$$cat; then \
@@ -2308,8 +2334,7 @@
 .endif
 
 .if !target(delete-package)
-delete-package:
-	@cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} delete-package-links
+delete-package: delete-package-links
 	@${RM} -f ${PKGFILE}
 .endif
 
@@ -2324,29 +2349,14 @@
 .endif
 
 .if !target(delete-package-list)
-delete-package-list:
-	@cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} delete-package-links-list
+delete-package-list: delete-package-links-list
 	@${ECHO} "[ -f ${PKGFILE} ] && (${ECHO} deleting ${PKGFILE}; ${RM} -f ${PKGFILE})"
 .endif
 
-################################################################
-# This is the "generic" port target, actually a macro used from the
-# six main targets.  See below for more.
-################################################################
+# Utility targets follow
 
-_PORT_USE: .USE
-.if make(real-fetch)
-.if defined(TRYBROKEN)
-	@${ECHO_MSG} "Trying build of ${PKGNAME} even though it is marked BROKEN."
-.endif
-	@cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} fetch-depends
-.endif
-.if make(real-extract)
-	@cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} checksum REAL_EXTRACT=yes
-	@cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} build-depends lib-depends misc-depends
-.endif
-.if make(real-install)
-	@cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} check-categories
+.if !target(check-already-installed)
+check-already-installed:
 .if !defined(NO_PKG_REGISTER) && !defined(FORCE_PKG_REGISTER)
 	@if [ -d ${PKG_DBDIR}/${PKGNAME} ]; then \
 		${ECHO} "===>  ${PKGNAME} is already installed - perhaps an older version?"; \
@@ -2357,15 +2367,22 @@
 		${ECHO} "      in your environment or the \"make install\" command line."; \
 		exit 1; \
 	fi
+.else
+	@${DO_NADA}
 .endif
+.endif
+
+.if !target(check-umask)
+check-umask:
 	@if [ `${SH} -c umask` != 0022 ]; then \
 		${ECHO_MSG} "===>  Warning: your umask is \"`${SH} -c umask`"\".; \
 		${ECHO_MSG} "      If this is not desired, set it to an appropriate value"; \
 		${ECHO_MSG} "      and install this port again by \`\`make reinstall''."; \
 	fi
-	@cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} run-depends lib-depends
 .endif
-.if make(real-install)
+
+.if !target(install-mtree)
+install-mtree:
 	@${MKDIR} ${PREFIX}
 	@if [ `id -u` != 0 ]; then \
 		if [ -w ${PREFIX}/ ]; then \
@@ -2390,98 +2407,19 @@
 	fi
 .endif
 .endif
-.if make(real-configure) && defined(USE_LIBTOOL)
-	@cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} patch-libtool
-.endif
-	@cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} ${.TARGET:S/^real-/pre-/}
-	@if [ -f ${SCRIPTDIR}/${.TARGET:S/^real-/pre-/} ]; then \
-		cd ${.CURDIR} && ${SETENV} ${SCRIPTS_ENV} ${SH} \
-			${SCRIPTDIR}/${.TARGET:S/^real-/pre-/}; \
-	fi
-	@cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} ${.TARGET:S/^real-/do-/}
-# put here so ports can change the contents of ${TMPPLIST} if necessary
-.if make(real-install)
-	@cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} generate-plist
-.endif
-	@cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} ${.TARGET:S/^real-/post-/}
-	@if [ -f ${SCRIPTDIR}/${.TARGET:S/^real-/post-/} ]; then \
-		cd ${.CURDIR} && ${SETENV} ${SCRIPTS_ENV} ${SH} \
-			${SCRIPTDIR}/${.TARGET:S/^real-/post-/}; \
-	fi
-.if make(real-install) && (defined(_MANPAGES) || defined(_MLINKS))
-	@cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} compress-man
-.endif
-.if make(real-install) && defined(INSTALLS_SHLIB)
+
+.if !target(run-ldconfig)
+run-ldconfig:
+.if defined(INSTALLS_SHLIB)
 	@${ECHO_MSG} "===>   Running ldconfig"
 	${LDCONFIG} -m ${LDCONFIG_RUNLIST}
-.endif
-.if make(real-install) && !defined(NO_PKG_REGISTER)
-	@cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} fake-pkg
-.endif
-.if !make(real-fetch) \
-	&& (!make(real-patch) || !defined(PATCH_CHECK_ONLY)) \
-	&& (!make(real-package) || !defined(PACKAGE_NOINSTALL))
-	@${TOUCH} ${TOUCH_FLAGS} ${WRKDIR}/.${.TARGET:S/^real-//}_done.${PKGNAME}
-.endif
-
-################################################################
-# Skeleton targets start here
-# 
-# You shouldn't have to change these.  Either add the pre-* or
-# post-* targets/scripts or redefine the do-* targets.  These
-# targets don't do anything other than checking for cookies and
-# call the necessary targets/scripts.
-################################################################
-
-.if !target(pre-everything)
-pre-everything:
+.else
 	@${DO_NADA}
 .endif
-
-.if !target(fetch)
-fetch:	pre-everything
-	@cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} real-fetch
-.endif
-
-.if !target(extract)
-extract: ${EXTRACT_COOKIE}
-.endif
-
-.if !target(patch)
-patch: ${PATCH_COOKIE}
-.endif
-
-.if !target(configure)
-configure: ${CONFIGURE_COOKIE}
 .endif
 
-.if !target(build)
-build: ${BUILD_COOKIE}
-.endif
-
-.if !target(install)
-install: ${INSTALL_COOKIE}
-.endif
-
-.if !target(package)
-package: ${PACKAGE_COOKIE}
-.endif
-
-${EXTRACT_COOKIE}:
-	@cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} fetch
-	@cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} real-extract
-${PATCH_COOKIE}:
-	@cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} extract
-	@cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} real-patch
-${CONFIGURE_COOKIE}:
-	@cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} patch
-	@cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} real-configure
-${BUILD_COOKIE}:
-	@cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} configure
-	@cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} real-build
-${INSTALL_COOKIE}:
-	@cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} build
-	@cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} real-install
+.if !target(security-check)
+security-check:
 # Scan PLIST for setugid files and startup scripts
 	-@for i in `${GREP} -v '^@' ${TMPPLIST}`; do \
 		${FIND} ${PREFIX}/$$i -prune -type f \( -perm -4000 -o -perm -2000 \) \( -perm -0010 -o -perm -0001 \) -ls 2>/dev/null; \
@@ -2512,51 +2450,111 @@
 			${MAKE} www-site; \
 		fi; \
 	fi
+.endif
 
-${PACKAGE_COOKIE}:
-	@cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} install
-	@cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} real-package
+################################################################
+# Skeleton targets start here
+# 
+# You shouldn't have to change these.  Either add the pre-* or
+# post-* targets/scripts or redefine the do-* targets.  These
+# targets don't do anything other than checking for cookies and
+# call the necessary targets/scripts.
+################################################################
 
-# And call the macros
+# Please note that the order of the following targets is important, and
+# should not be modified.
 
-real-fetch: _PORT_USE
-real-extract: _PORT_USE
+_FETCH_SEQ=		pre-everything fetch-depends pre-fetch pre-fetch-script \
+				do-fetch post-fetch post-fetch-script
+_EXTRACT_SEQ=	fetch extract-message checksum build-depends lib-depends \
+				misc-depends pre-extract pre-extract-script do-extract \
+				post-extract post-extract-script
+_PATCH_SEQ=		extract patch-message pre-patch pre-patch-script do-patch \
+				post-patch post-patch-script
+_CONFIGURE_SEQ=	patch configure-message patch-libtool pre-configure \
+				pre-configure-script do-configure post-configure \
+				post-configure-script
+_BUILD_SEQ=		configure build-message pre-build pre-build-script do-build \
+				post-build post-build-script
+_INSTALL_SEQ=	build install-message check-categories check-already-installed \
+				check-umask run-depends lib-depends install-mtree pre-install \
+				pre-install-script do-install generate-plist post-install \
+				post-install-script compress-man run-ldconfig fake-pkg \
+				security-check
+_PACKAGE_SEQ=	install package-message pre-package pre-package-script \
+				do-package post-package-script
+
+.if !target(fetch)
+fetch: ${_FETCH_SEQ}
+.endif
+
+# Main logick. The loop generates 6 main targets and using cookies
+# ensures that those already completed are skipped.
+
+.for target in extract patch configure build install package
+
+.if !target(${target})
+.if !defined(USE_SUBMAKE)
+${target}: ${${target:U}_COOKIE}
+.else
+${target}:
+	@cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} ${${target:U}_COOKIE}
+.endif
+.endif
+
+.if !exists(${${target:U}_COOKIE})
+${${target:U}_COOKIE}: ${_${target:U}_SEQ}
+	@${TOUCH} ${TOUCH_FLAGS} ${.TARGET}
+.else
+${${target:U}_COOKIE}:
+	${DO_NADA}
+.endif
+
+.endfor
+
+# Enforce order for -jN builds
+
+.ORDER: ${_FETCH_SEQ}
+.ORDER: ${_EXTRACT_SEQ}
+.ORDER: ${_PATCH_SEQ}
+.ORDER: ${_CONFIGURE_SEQ}
+.ORDER: ${_BUILD_SEQ}
+.ORDER: ${_INSTALL_SEQ}
+.ORDER: ${_PACKAGE_SEQ}
+
+extract-message:
 	@${ECHO_MSG} "===>  Extracting for ${PKGNAME}"
-real-patch: _PORT_USE
+patch-message:
 	@${ECHO_MSG} "===>  Patching for ${PKGNAME}"
-real-configure: _PORT_USE
+configure-message:
 	@${ECHO_MSG} "===>  Configuring for ${PKGNAME}"
-real-build: _PORT_USE
+build-message:
 	@${ECHO_MSG} "===>  Building for ${PKGNAME}"
-real-install: _PORT_USE
+install-message:
 	@${ECHO_MSG} "===>  Installing for ${PKGNAME}"
-real-package: _PORT_USE
+package-message:
+	@${ECHO_MSG} "===>  Building package for ${PKGNAME}"
 
-# Empty pre-* and post-* targets, note we can't use .if !target()
-# in the _PORT_USE macro
+# Empty pre-* and post-* targets
 
+.for stage in pre post
 .for name in fetch extract patch configure build install package
 
-.if !target(pre-${name})
-pre-${name}:
+.if !target(${stage}-${name})
+${stage}-${name}:
 	@${DO_NADA}
 .endif
 
-.if !target(post-${name})
-post-${name}:
-	@${DO_NADA}
+.if !target(${stage}-${name}-script)
+${stage}-${name}-script:
+	@if [ -f ${SCRIPTDIR}/${.TARGET:S/-script$//} ]; then \
+		cd ${.CURDIR} && ${SETENV} ${SCRIPTS_ENV} ${SH} \
+			${SCRIPTDIR}/${.TARGET:S/-script$//}; \
+	fi
 .endif
 
 .endfor
-
-.if defined(GNOME_OPTION_MSG) && (!defined(PACKAGE_BUILDING) || !defined(BATCH))
-pre-everything:: echo-gnome-option-msg
-
-echo-gnome-option-msg:
-	@for m in ${GNOME_OPTION_MSG}; do \
-		${ECHO_MSG} $$m; \
-	done
-.endif
+.endfor
 
 # Patch-libtool
 #
@@ -2582,6 +2580,7 @@
 
 .if !target(patch-libtool)
 patch-libtool:
+.if defined(USE_LIBTOOL)
 	@(if ${LIBTOOL} --version | grep -vq "1\.3\.4-freebsd-ports"; then \
 		(${ECHO} "Your libtool installation is out of date. Please remove"; \
 		 ${ECHO} "and reinstall ${PORTSDIR}/devel/libtool."; \
@@ -2595,15 +2594,22 @@
 			-e "s^\$$ac_aux_dir/ltmain.sh^${LIBTOOLFLAGS} $${LIBTOOLDIR}/ltmain.sh^g" \
 			$$file.tmp > $$file; \
 	 done);
+.else
+	@${DO_NADA}
+.endif
 .endif
 
+################################################################
+# Some more targets supplied for users' convenience
+################################################################
+
 # Checkpatch
 #
 # Special target to verify patches
 
 .if !target(checkpatch)
 checkpatch:
-	@cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} PATCH_CHECK_ONLY=yes patch
+	@cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} PATCH_CHECK_ONLY=yes ${_PATCH_SEQ}
 .endif
 
 # Reinstall
@@ -2631,10 +2637,6 @@
 	@${RM} -f ${INSTALL_COOKIE} ${PACKAGE_COOKIE}
 .endif
 
-################################################################
-# Some more targets supplied for users' convenience
-################################################################
-
 # Cleaning up
 
 .if !target(do-clean)
@@ -2798,10 +2800,7 @@
 
 
 .if !target(checksum)
-checksum:
-.if !defined(REAL_EXTRACT)
-	@cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} fetch
-.endif
+checksum: fetch
 	@if [ ! -f ${MD5_FILE} ]; then \
 		${ECHO_MSG} ">> No MD5 checksum file."; \
 	else \
@@ -2870,7 +2869,8 @@
 .if !target(package-noinstall)
 package-noinstall:
 	@${MKDIR} ${WRKDIR}
-	@cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} PACKAGE_NOINSTALL=yes real-package
+	@cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} pre-package \
+		pre-package-script do-package post-package-script
 	@${RM} -f ${TMPPLIST}
 	-@${RMDIR} ${WRKDIR}
 .endif
@@ -2880,22 +2880,7 @@
 ################################################################
 
 .if !target(depends)
-depends: lib-depends misc-depends
-	@cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} fetch-depends
-	@cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} build-depends
-	@cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} run-depends
-
-.if make(fetch-depends)
-DEPENDS_TMP+=	${FETCH_DEPENDS}
-.endif
-
-.if make(build-depends)
-DEPENDS_TMP+=	${BUILD_DEPENDS}
-.endif
-
-.if make(run-depends)
-DEPENDS_TMP+=	${RUN_DEPENDS}
-.endif
+depends: lib-depends misc-depends fetch-depends build-depends run-depends
 
 .if defined(ALWAYS_BUILD_DEPENDS)
 _DEPEND_ALWAYS=	1
@@ -2903,10 +2888,11 @@
 _DEPEND_ALWAYS=	0
 .endif
 
-_DEPENDS_USE:	.USE
-.if defined(DEPENDS_TMP)
+.for deptype in FETCH BUILD RUN
+${deptype:L}-depends:
+.if defined(${deptype}_DEPENDS)
 .if !defined(NO_DEPENDS)
-	@for i in ${DEPENDS_TMP}; do \
+	@for i in ${${deptype}_DEPENDS}; do \
 		prog=`${ECHO} $$i | ${SED} -e 's/:.*//'`; \
 		dir=`${ECHO} $$i | ${SED} -e 's/[^:]*://'`; \
 		if ${EXPR} "$$dir" : '.*:' > /dev/null; then \
@@ -2957,10 +2943,7 @@
 .else
 	@${DO_NADA}
 .endif
-
-fetch-depends:	_DEPENDS_USE
-build-depends:	_DEPENDS_USE
-run-depends:	_DEPENDS_USE
+.endfor
 
 lib-depends:
 .if defined(LIB_DEPENDS)
@@ -3118,32 +3101,39 @@
 		fi; \
 	done | sort -u
 
-# Package (recursive runtime) dependency list.  Print out directory names.
+# Package (recursive runtime) dependency list.  Print out both directory names
+# and package names.
 
 package-depends-list:
 	@${PACKAGE-DEPENDS-LIST}
 
 PACKAGE-DEPENDS-LIST= \
+	if [ "${CHILD_DEPENDS}" ]; then \
+		${ECHO} "${PKGNAME}	${.CURDIR}"; \
+	fi; \
 	checked="${PARENT_CHECKED}"; \
 	for dir in $$(${ECHO} "${LIB_DEPENDS} ${RUN_DEPENDS}" | ${TR} '\040' '\012' | ${SED} -e 's/^[^:]*://' -e 's/:.*//') $$(${ECHO} ${DEPENDS} | ${TR} '\040' '\012' | ${SED} -e 's/:.*//'); do \
 		if [ -d $$dir ]; then \
 			if (${ECHO} $$checked | ${GREP} -qwv "$$dir"); then \
-				child=$$(cd $$dir; ${MAKE} PARENT_CHECKED="$$checked" package-depends-list); \
-				for d in $$child; do ${ECHO} $$d; done; \
-				${ECHO} $$dir; \
-				checked="$$dir $$child $$checked"; \
+				childout=$$(cd $$dir; ${MAKE} CHILD_DEPENDS=yes PARENT_CHECKED="$$checked" package-depends-list); \
+				set -- $$childout; \
+				while [ $$\# != 0 ]; do \
+					childname="$$childname $$1"; \
+					childdir="$$childdir $$2"; \
+					${ECHO} "$$1	$$2"; \
+					shift 2; \
+				done; \
+				checked="$$dir $$childdir $$checked"; \
 			fi; \
 		else \
 			${ECHO_MSG} "${PKGNAME}: \"$$dir\" non-existent -- dependency list incomplete" >&2; \
 		fi; \
-	done | sort -u
+	done
 
 # Print out package names.
 
 package-depends:
-	@for dir in $$(${PACKAGE-DEPENDS-LIST}); do \
-		(cd $$dir; ${MAKE} package-name); \
-	done
+	@${PACKAGE-DEPENDS-LIST} | ${AWK} '{print $$1}'
 
 ################################################################
 # Everything after here are internal targets and really
@@ -3317,6 +3307,7 @@
 # Compress (or uncompress) and symlink manpages.
 .if !target(compress-man)
 compress-man:
+.if defined(_MANPAGES) || defined(_MLINKS)
 .if ${MANCOMPRESSED} == yes && defined(NOMANCOMPRESS)
 	@${ECHO_MSG} "===>   Uncompressing manual pages for ${PKGNAME}"
 	@_manpages='${_MANPAGES:S/'/'\''/g}' && [ "$${_manpages}" != "" ] && ( eval ${GUNZIP_CMD} $${_manpages} ) || ${TRUE}
@@ -3337,6 +3328,9 @@
 		shift; shift; \
 	done
 .endif
+.else
+	@${DO_NADA}
+.endif
 .endif
 
 # Fake installation of package so that user can pkg_delete it later.
@@ -3345,6 +3339,7 @@
 
 .if !target(fake-pkg)
 fake-pkg:
+.if !defined(NO_PKG_REGISTER)
 	@if [ ! -d ${PKG_DBDIR} ]; then ${RM} -f ${PKG_DBDIR}; ${MKDIR} ${PKG_DBDIR}; fi
 	@${RM} -f /tmp/${PKGNAME}-required-by
 .if defined(FORCE_PKG_REGISTER)
@@ -3384,6 +3379,9 @@
 		${CAT} /tmp/${PKGNAME}-required-by >> ${PKG_DBDIR}/${PKGNAME}/+REQUIRED_BY; \
 		${RM} -f /tmp/${PKGNAME}-required-by; \
 	fi
+.else
+	@${DO_NADA}
+.endif
 .endif
 
 # Depend is generally meaningless for arbitrary ports, but if someone wants

--------------7746931EEA6A51301F16C5D2--


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3C7DF9BC.B61F7C6>