Index: bsd.port.mk =================================================================== RCS file: /home/ncvs/ports/Mk/bsd.port.mk,v retrieving revision 1.362 diff -u -r1.362 bsd.port.mk --- bsd.port.mk 2001/02/17 00:46:26 1.362 +++ bsd.port.mk 2001/03/20 00:17:02 @@ -477,6 +477,16 @@ # a different checksum and you intend to verify if # the port still works with it. +# Start of lock check +.if !defined(LOCKF_HAS_RUN) +.BEGIN: + @cd ${.CURDIR} && exec lockf -k Makefile ${MAKE} LOCKF_HAS_RUN=YES ${.TARGETS} + +.IGNORE: ${.TARGETS} +.MAIN: all +all: +${.TARGETS}: +.else # Start of pre-makefile section. .if !defined(AFTERPORTMK) @@ -504,6 +514,7 @@ GZIP_CMD?= /usr/bin/gzip -nf ${GZIP} LDCONFIG?= /sbin/ldconfig LN?= /bin/ln +LOCKF?= /usr/bin/lockf MKDIR?= /bin/mkdir -p MV?= /bin/mv RM?= /bin/rm @@ -519,6 +530,10 @@ # Used to print all the '===>' style prompts - override this to turn them off. ECHO_MSG?= ${ECHO} +# Used for dependency recursion with locks - replace with ${MAKE} to disable +# locking against parallell dependency builds. +DEPMAKE?= ${LOCKF} -k Makefile ${MAKE} + # Get the architecture .if !defined(ARCH) ARCH!= ${UNAME} -m @@ -2515,7 +2530,7 @@ if [ ! -d "$$dir" ]; then \ ${ECHO_MSG} " >> No directory for $$prog. Skipping.."; \ else \ - (cd $$dir; ${MAKE} $$target $$depends_args) ; \ + (cd $$dir && ${DEPMAKE} $$target $$depends_args) ; \ ${ECHO_MSG} "===> Returning to build of ${PKGNAME}"; \ fi; \ fi; \ @@ -2559,7 +2574,7 @@ if [ ! -d "$$dir" ]; then \ ${ECHO_MSG} " >> No directory for $$lib. Skipping.."; \ else \ - (cd $$dir; ${MAKE} $$target $$depends_args) ; \ + (cd $$dir && ${DEPMAKE} $$target $$depends_args) ; \ ${ECHO_MSG} "===> Returning to build of ${PKGNAME}"; \ if ${LDCONFIG} -r | ${GREP} -qwF -e "-l$$lib"; then \ ${TRUE}; \ @@ -2591,7 +2606,7 @@ if [ ! -d $$dir ]; then \ ${ECHO_MSG} " >> No directory for $$dir. Skipping.."; \ else \ - (cd $$dir; ${MAKE} $$target $$depends_args) ; \ + (cd $$dir && ${DEPMAKE} $$target $$depends_args) ; \ fi \ done @${ECHO_MSG} "===> Returning to build of ${PKGNAME}" @@ -3006,3 +3021,5 @@ .endif # End of post-makefile section. +.endif +# End of lockf protection