Ralf Wildenhues wrote: > > it creates the new files in the build > > directory. I know the reason why: if a source distribution is installed in a > > read-only location, the build in a VPATH should not touch any file in the > > source directory. > > That's not what I'd say. You can only expect compiling from a read-only > location to work right if that read-only location happens to contain up > to date files. If a bison input file is updated there, then one can > rightly expect other files to need updated there as well.
Good! So please, can you fix automake to behave like this? > > The result are inconsistent compiles, as you see. > > I'm not trying to say that there isn't an Automake bug, but it uses an > inference rule for .y.c, and the VPATH target lookup rules of GNU make > (and other make implementations) are simply not simple: > <http://www.gnu.org/software/autoconf/manual/html_node/Make-Target-Lookup.html> The lookup rules are irrelevant here. The point is that automake generates a rule that creates the po-gram-gen.c and po-gram-gen.h from po-gram-gen.y, like this: .y.c: $(am__skipyacc) $(SHELL) $(YLWRAP) $< y.tab.c $@ y.tab.h $*.h y.output $*.output -- $(YACCCOMPILE) and in the circumstances that - $(srcdir) != "." - po-gram-gen.y exists in $(srcdir) but not in "." - po-gram-gen.y has changed - po-gram-gen.c and po-gram-gen.h also exist in $(srcdir) but not in "." and are older than po-gram-gen.y this rule will create _new_ files po-gram-gen.c and po-gram-gen.h in the current directory. Some compiles will then use the po-gram-gen.h in the current directory and some will use the po-gram-gen.h in $(srcdir). The fix should be that in the cited circumstances po-gram-gen.c and po-gram-gen.h should be updated in $(srcdir). > How about this patch to force updates in srcdir? > (Some BSD make cannot infer that file and $(srcdir)/file are > the same target with VPATH = $(srcdir).) This misses the point, because - we are not discussing BSD make here, but GNU make on a glibc system, and - a patch to gettext's Makefile.am will not affect the instantiations of automake's .y.c rule in other packages than gettext. Bruno