* Eric Blake wrote on Wed, Sep 22, 2010 at 08:30:08PM CEST: > On 09/22/2010 12:22 PM, Ralf Wildenhues wrote: > >* Eric Blake wrote on Wed, Sep 22, 2010 at 08:19:28PM CEST: > >> $(srcdir)/doc/libtool.1: $(srcdir)/$(auxdir)/ltmain.sh > >>+ $(MAKE) libtool > >> $(update_mans) --help-option=--help-all libtool > > > >When -jN has been passed, the two makes may both try to update 'libtool' > >at the same time, leading to a race. > > Any ideas on how to avoid such a race?
1) .NOTPARALLEL: Is not a good idea because it will make 'make -j3 check' slow again. :-/ And if you require non-parallel builds, then you can again rely on the fact that Posix make will update prerequisites in the order listed, so that all you need to ensure is that all-am depends on 'libtool' earlier than it depends on '$(srcdir)/doc/libtool.1'. 2) Use a subdir Makefile.am in doc, as SUBDIRS is a serializer. Update the manpage in doc/Makefile.am, and have 'SUBDIRS = . doc' in toplevel so that it is updated first. 3) GNU make could use order-only prerequisites, but that is far too unportable, as many practical GNU make installations are too old still. 4) BUILT_SOURCES = libtool libtoolize Wait ... we are using (4) already. Why does it not work? IOW, I don't see the failure mode which this patch is supposed to fix. Please show a verbose make log exhibiting the failure. I'm guessing there is a different actual reason for the failure. Thanks, ralf