Subject: bug#7884: Yacc and FreeBSD make in VPATH builds

From: Ralf Wildenhues <[email-masked]>
Date: Tue, 25 Jan 2011 21:05:17 +0100

* Stefano Lattarini wrote on Tue, Jan 25, 2011 at 08:52:56PM CET:
> On Saturday 22 January 2011, Ralf Wildenhues wrote:
> > 
> > >  - Tell the developer to add proper AC_CONFIG_LINKS to configure in
> > >    order to support VPATH builds with FreeBSD make (yuck^2, since
> > >    that means keeping track of renamed files when object-specific
> > >    flags are involved).
> > >
> Hmm... maybe a variation of this might be a good solution after all, at
> least for FreeBSD make: the special `.BEGIN' target[1][2] might be used
> to copy Yacc-derived *.c and *.h files from $(srcdir) to $(builddir),
> unless they are already there.

How do you ensure that you don't overwrite newer such files in the build
tree?  Please note that 'test' and 'ls' might not have the same time
stamp reading granularity that 'make' might have.  Well, at least in
general, this might be less of a problem on FreeBSD specifically.

Anyway, the above sounds a lot like a hack with possible traps, I'm not
sure I like going that way.

> Note that the 'distcleancheck' target would still fail with this change,
> but that's more of an annoyance rather than a serious bug (like the one
> under discussion is IMHO).  And we could try to fix that later.

Well, regressions are generally worse than bugs.

Generally, whatever solution you would like to propose, I would suggest
that you could first try to create in a simple Makefile the rules as you
think automake should produce them; then we have something to digest
(and possibly throw away) without having to invest a lot of work in a
proper automake implementation.  It is often possible to rule out
strategies quickly at such an early stage.

Thanks,
Ralf