From ed8eb39db388a0e2cba2126414896414c4b53bd1 Mon Sep 17 00:00:00 2001 From: Richard Maw Date: Fri, 18 Jan 2013 12:02:19 +0000 Subject: build-system: apply Gentoo patch for parallel build We had build failures stemming from the use of recursive make, and multiple instances attempting to build pathnames.h at once. This managed to go un-noticed for a year, possibly the introduction of ccache made compilation quick enough to trigger this behaviour. http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/app-shells/bash/files/bash-4.2-parallel-build.patch --- Makefile.in | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Makefile.in b/Makefile.in index 9f9276d4..297ae666 100644 --- a/Makefile.in +++ b/Makefile.in @@ -579,16 +579,17 @@ buildversion.o: version.h conftypes.h patchlevel.h $(srcdir)/version.c # old rules GRAM_H = parser-built -y.tab.o: y.tab.c ${GRAM_H} command.h ${BASHINCDIR}/stdc.h input.h +y.tab.o: y.tab.h y.tab.c ${GRAM_H} command.h ${BASHINCDIR}/stdc.h input.h ${GRAM_H}: y.tab.h @-if test -f y.tab.h ; then \ cmp -s $@ y.tab.h 2>/dev/null || cp -p y.tab.h $@; \ fi -y.tab.c y.tab.h: parse.y +y.tab.c: parse.y # -if test -f y.tab.h; then mv -f y.tab.h old-y.tab.h; fi $(YACC) -d $(srcdir)/parse.y touch parser-built # -if cmp -s old-y.tab.h y.tab.h; then mv old-y.tab.h y.tab.h; else cp -p y.tab.h ${GRAM_H}; fi +y.tab.h: y.tab.c ; @true # experimental new rules - work with GNU make but not BSD (or OSF) make #y.tab.o: y.tab.c y.tab.h @@ -597,6 +598,11 @@ y.tab.c y.tab.h: parse.y # $(YACC) -d $(srcdir)/parse.y # -if cmp -s old-y.tab.h y.tab.h; then mv old-y.tab.h y.tab.h; fi +# Subdirs will often times want version.h, so they'll change back up to +# the top level and try to create it. This causes parallel build issues +# so just force top level sanity before we descend. +$(LIBDEP): .build + $(READLINE_LIBRARY): config.h $(READLINE_SOURCE) @echo making $@ in ${RL_LIBDIR} @( { test "${RL_LIBDIR}" = "${libdir}" && exit 0; } || \ @@ -668,7 +674,7 @@ syntax.c: mksyntax${EXEEXT} $(srcdir)/syntax.h $(RM) $@ ./mksyntax$(EXEEXT) -o $@ -$(BUILTINS_LIBRARY): $(BUILTIN_DEFS) $(BUILTIN_C_SRC) config.h ${BASHINCDIR}/memalloc.h version.h +$(BUILTINS_LIBRARY): $(BUILTIN_DEFS) $(BUILTIN_C_SRC) config.h ${BASHINCDIR}/memalloc.h ${DEFDIR}/builtext.h version.h @(cd $(DEFDIR) && $(MAKE) $(MFLAGS) DEBUG=${DEBUG} libbuiltins.a ) || exit 1 # these require special rules to circumvent make builtin rules -- cgit v1.2.1