Alexandre Duret-Lutz wrote: > a fix for this belongs to the rule that starts those multiple `$(MAKE) > elc-stamp' processes, not to the elc-stamp rule. IOW locks are > not needed in regular builds, they would only be needed to > prevent multiple *recover* rules to start `$(MAKE) elc-stamp'.
Ok, what about this (untested) patch? diff -c -3 -r1.45 lisp.am *** lib/am/lisp.am 16 Mar 2005 00:10:30 -0000 1.45 --- lib/am/lisp.am 17 Mar 2005 19:00:16 -0000 *************** *** 49,60 **** $(am__ELCFILES): elc-stamp ## Recover from the removal of [EMAIL PROTECTED] ## ! ## Make sure not to call `make elc-stamp' if emacs is not available, ! ## because as all *.elc files appear as missing, a parallel make would ! ## attempt to build elc-stamp several times. @if test "$(EMACS)" != no && test ! -f $@; then \ ! rm -f elc-stamp; \ ! $(MAKE) $(AM_MAKEFLAGS) elc-stamp; \ else : ; fi --- 49,72 ---- $(am__ELCFILES): elc-stamp ## Recover from the removal of [EMAIL PROTECTED] ## ! ## Do not call `make elc-stamp' if emacs is not available, because it would ! ## be useless. @if test "$(EMACS)" != no && test ! -f $@; then \ ! ## Mutual exclusion locking to ensure that if multiple processes need to ! ## rebuild elc-stamp, only the first one does it, and the followers wait. ! trap 'rm -rf elc-lock elc-stamp' 1 2 3 15; \ ! if mkdir elc-lock 2>/dev/null; then \ ! ## This code is being executed by the first process. ! rm -f elc-stamp; \ ! $(MAKE) $(AM_MAKEFLAGS) elc-stamp; \ ! rmdir elc-lock; \ ! else \ ! ## This code is being executed by the follower processes. ! ## Wait until the first process is done. ! while test -d elc-lock; do sleep 1; done; \ ! ## Succeed if and only if the first process succeeded. ! test -f elc-stamp; exit $$?; \ ! fi; \ else : ; fi