This is the mail archive of the
automake-prs@sources.redhat.com
mailing list for the automake project.
automake/382: including lex and yacc generated header files
- From: wsf at fultondesigns dot co dot uk
- To: automake-gnats at sources dot redhat dot com
- Date: 12 Jan 2003 22:53:56 -0000
- Subject: automake/382: including lex and yacc generated header files
- Reply-to: wsf at fultondesigns dot co dot uk
>Number: 382
>Category: automake
>Synopsis: including lex and yacc generated header files
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: tromey
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sun Jan 12 15:01:00 PST 2003
>Closed-Date:
>Last-Modified:
>Originator: William Fulton
>Release: automake-1.7.2
>Organization:
>Environment:
Mandrake 9.0
autoconf 2.54
gcc 3.2
bison 1.35
>Description:
The order of declaration seems to be important for the _SOURCES primary when using yacc/bison. The problematic circumstances are when a c file includes the generated parser header file.
I played around with EXTRA_foo_foo_SOURCES but it made no difference.
May I suggest a bit more detail in the 'Lex and Yacc support' section in the automake manual with regard to YFLAGS=-d. For example should the generated files be placed into the EXTRA_whatever_SOURCES and whether dependencies will work.
>How-To-Repeat:
Run test case. The test case was based on yacc8.test. The output on my machine was:
[william@localhost tests]$ ./yaccNEW.test
yaccNEW: running gcc --version
gcc (GCC) 3.2 (Mandrake Linux 9.0 3.2-1mdk)
Copyright (C) 2002 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
yaccNEW: running bison --version
bison (GNU Bison) 1.35
Copyright 1984, 1986, 1989, 1992, 2000, 2001, 2002
Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
=== Running test ./yaccNEW.test
++ pwd
/home/william/automake-1.7.2/tests/testSubDir
+ set -e
+ cat
+ cat
+ mkdir foo
+ cat
+ cat
+ /usr/bin/perl /home/william/automake-1.7.2/tests/testSubDir/../../aclocal -I /home/william/automake-1.7.2/tests/testSubDir/../../m4 --acdir=/home/william/automake-1.7.2/tests/../m4
+ /bin/sh /home/william/automake-1.7.2/lib/missing --run autoconf
+ /usr/bin/perl /home/william/automake-1.7.2/tests/testSubDir/../../automake --libdir=/home/william/automake-1.7.2/tests/../lib --foreign -Werror -Wall -a
Makefile.am: installing `./compile'
+ mkdir sub
+ cd sub
+ ../configure
checking for a BSD-compatible install... /usr//bin/install -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets ${MAKE}... yes
checking for gcc... gcc
checking for C compiler default output... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking whether gcc and cc understand -c and -o together... yes
checking for bison... bison -y
configure: creating ./config.status
config.status: creating Makefile
config.status: executing depfiles commands
+ make
if gcc -DPACKAGE_NAME=\"yaccNEW\" -DPACKAGE_TARNAME=\"yaccnew\" -DPACKAGE_VERSION=\"1.0\" -DPACKAGE_STRING=\"yaccNEW\ 1.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE=\"yaccnew\" -DVERSION=\"1.0\" -I. -I.. -I./foo -g -O2 -MT foo/foo_foo-bar.o -MD -MP -MF "foo/.deps/foo_foo-bar.Tpo" \
-c -o foo/foo_foo-bar.o `test -f 'foo/bar.c' || echo '../'`foo/bar.c; \
then mv "foo/.deps/foo_foo-bar.Tpo" "foo/.deps/foo_foo-bar.Po"; \
else rm -f "foo/.deps/foo_foo-bar.Tpo"; exit 1; \
fi
../foo/bar.c:1:19: parse.h: No such file or directory
make: *** [foo/foo_foo-bar.o] Error 1
[william@localhost tests]$
>Fix:
Sorry, I was not able to fix it. There is a work around. The .y file must appear before the .c file in the _SOURCES primary.
>Release-Note:
>Audit-Trail:
>Unformatted: