bug-automake
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#10852: VPATH builds cannot recover from missing parser header


From: Akim Demaille
Subject: bug#10852: VPATH builds cannot recover from missing parser header
Date: Mon, 20 Feb 2012 15:23:25 +0100

Le 20 févr. 2012 à 14:58, Stefano Lattarini a écrit :

> Hi Akim.

Hi Stefano,

Thanks for the quick answer!

> The following patch extends a test which is aimed at checking
>> 
>> this, but does it in a non-vpath build :)
>> 
> But the test is wrong, because it checks that the Yacc-generated .h and .c
> files are placed in the $srcdir, while we expect them to be placed in the
> $builddir.  Do the tests added by your patch work for you?  They don't work
> for me (as I would have expected BTW).

OK, so it is my expectations which are wrong.  Probably
in an attempt to have simple minded picture in my head,
I expected the maintainer source tree to be alike an end
user tarball.  Since Automake ships the generated parsers
and scanners, I expected it to generate these guys in srcdir,
not builddir.

So indeed the patch I proposed wanted to exhibit the failure,
but it's my understanding that is incorrect.  Hence the test
failed, as _I_ expected.

>> I have a question though.  I don't understand how come
>> Make realizes it must provide $@ in srcdir too.
>> 
>> The Makefile.in features:
>> 
>>> .y.c:
>>>     $(AM_V_YACC)$(am__skipyacc) $(SHELL) $(YLWRAP) $< y.tab.c $@ y.tab.h 
>>> $*.h y.output $*.output -- $(YACCCOMPILE)
>> 
>> and at runtime I have:
>> 
>>> /bin/sh ../../build-aux/ylwrap ../../src/parse-gram.y y.tab.c 
>>> ../../src/parse-gram.c y.tab.h ../../src/parse-gram.h y.output 
>>> ../../src/parse-gram.output -- ./tests/bison -y -d -v --warnings=all,error 
>>> --report=all 
>>> updating ../../src/parse-gram.h
>>> ../../src/parse-gram.output is unchanged
>> 
>> which is what is expected, but I don't understand why
>> it works: that $< is prefixed with $(srcdir), this I
>> understand, but why does it appear on address@hidden
>> 
> Unless I'm somehow sorely mistaken, that is not automake's doing; it's the
> make implementation that does such a rewrite.  Which is highly unexpected
> BTW.  Which make implementation are you using?

It's GNU Make 3.81/3.82.

Got it.  It's the dep file that introduces the $(srcdir)
part:

src/src_bison-parse-gram.o: ../../src/parse-gram.c lib/config.h \
  ../../src/system.h \
  /usr/lib/gcc/i686-apple-darwin10/4.2.1/include/limits.h \
  /usr/lib/gcc/i686-apple-darwin10/4.2.1/include/syslimits.h \
...

and it continues being propagated this way.

Is there is a way to tell Automake I want the generation
to be performed in srcdir?  In the case of Bison, we do
want to keep a copy in the repository.  I guess I cannot
use Automake for this.






reply via email to

[Prev in Thread] Current Thread [Next in Thread]