Skip to content

Comments

Fix bison 3.7 include header error#37

Closed
Mathnerd314 wants to merge 1 commit intoUnNetHack:masterfrom
Mathnerd314:master
Closed

Fix bison 3.7 include header error#37
Mathnerd314 wants to merge 1 commit intoUnNetHack:masterfrom
Mathnerd314:master

Conversation

@Mathnerd314
Copy link

The build fails after upgrading to bison 3.7:

( cd util ; make lev_comp )
make[1]: Entering directory '/build/UnNetHack/util'
bison -y  -b lev -d ./lev_comp.y
mv lev.tab.c lev_yacc.c
mv lev.tab.h ../include/lev_comp.h
gcc -DAUTOCONF -O2 -I../include -I./../include -g -O2   -c -o lev_yacc.o lev_yacc.c
lev.tab.c:245:10: fatal error: lev.tab.h: No such file or directory
compilation terminated.
make[1]: *** [<builtin>: lev_yacc.o] Error 1

This seems to be due to a change in how Bison handles definitions; it used to include them in both the header and the file, but now generates an #include <header> in the file. Setting the filename fixes it. Regenerating the build scripts using more recent autoconf/automake should also work.

@Mathnerd314 Mathnerd314 changed the title Fix bison include header error Fix bison 3.7 include header error Sep 11, 2020
bhaak added a commit that referenced this pull request Sep 11, 2020
This is a hacky way to support both bison >= 3.7 and < 3.7.

Using "%define api.header.include" (see PR #37) would be the correct way
to fix it but this makes it incompatible to earlier bison versions.
@bhaak
Copy link
Member

bhaak commented Sep 11, 2020

Thanks for bringing this to our attention. I couldn't use this PR though as it would make building the game incompatible if an older bison version than 3.7 is installed.

I committed a workaround with 04f0a3a that should fix compiling for older and newer versions of bison.

@bhaak bhaak closed this Sep 11, 2020
@Mathnerd314
Copy link
Author

Thanks for the fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants