[Top][All Lists]

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

problem with automake and bison

From: Michael Walton
Subject: problem with automake and bison
Date: Mon, 11 Jan 2010 15:03:58 -0500

I also sent this same message to address@hidden I don't think that it
is technically a bison bug, but I am sending it to the bison bug list in case
any Bison people are interested and can prod the automake people into doing 
or have suggestions about a proper way to handle it.

I am using the autotools in combination with GNU Bison and Flex. In
particular I am using the %glr directive in my bison file (parse.y).
Everything works fine, except that when I run 'make', 'ylwrap' is
invoked which runs 'bison -y -d' on 'parse.y' producing 'y.tab.h' and
'y.tab.c'. 'ylwrap' then renames these output files to 'parse.h' and
'parse.c' (Forgive me if I have the details wrong. I claim no
expertise). The problem is that the y.tab.c produced from the glr
skeleton with the -d bison option has in '#include "y.tab.h"' CPP
directive in it. This really should be changed by ylwrap to '#include
"parse.h"', but it isn't. The autotools do nothing about this problem.

I am attaching my 'parse.y' file. You can run bison -y -d on it to
simulate the problem. Notice that in the resulting y.tab.c file, there
is an "#include y.tab.h" line. This line won't work because y.tab.h will
be changed to parse.h by ylwrap (or however its done).

As a work around I inserted the following lines into ylwrap.
base=`basename $target .c`
echo $target
mv $target $target.tmp
sed -e 's,y.tab.h,'$base'.h,g' $target.tmp > $target

This works for now but I rather not have to have workarounds. I am
attaching my modified ylwrap file, my parse.y file and my Makefile.am.

Attachment: ylwrap
Description: application/shellscript

Attachment: parse.y
Description: Text Data

Attachment: Makefile.am
Description: Text Data

reply via email to

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