TomWetmore / DeadEnds

Genealogical Software
2 stars 2 forks source link

Compiling DeadEnds on Xubuntu 22.04 LTS #1

Closed ahomansikka closed 3 months ago

ahomansikka commented 3 months ago

I had to do these changes before I could compile DeadEnds on Xubuntu 22.04 LTS

Remove line

include "y.tab.h" // Generated by yacc or bison when processing yacc.

from lexer.h

Comment out these lines from Parser/makefile

%.c: %.y

oyacc -d $<

cp -f y.tab.c $@

and do instead

bison -d -y grammar.y

In file y.tab.h replace line

extern YYSTYPE yylval;

with line

extern SemanticValue yylval;

I could not link tests until I added

-ldatatypes -linterp -lutils -lgedcom

to line

LIBS=-lutils ...

in Tests/makefile

Yes, the files are there two times.

Compler gives these warnings

builtin.c:516:2: warning: misleading indentation; statement is not part of the previous 'else' [-Wmisleading-indentation] if (!str || *str == 0) return nullPValue; // Not considered an error. ^ builtin.c:514:5: note: previous statement is here else ^

rassa.c:256:12: warning: unused variable 'name' [-Wunused-variable] String p, name;

utils.c:48:9: warning: unused variable 'j' [-Wunused-variable] int i, j;

TomWetmore commented 3 months ago

Thanks for the information. I am not using bison at present, and don't plan to. Oyacc is an old version of yacc I built. To build DeadEnds the yacc step should be skipped. The file grammar.c is the oyacc-generated parser and should be compiled directly. There should be no bison/yacc step in the build. In the current state of development this is what I support. I will look at the makefile to get the oyacc step removed. I keep the yacc file (grammar.y) in the repository so people can see what it is, but it should not be "yacc'ed."

TomWetmore commented 3 months ago

I changed the makefile in the Parser directory to remove the yacc rule. I also added grammar.y and y.tab.h to the repository. For the time being it is my responsibility to run yacc (oyacc) on my system to update grammar.c, and not have a yacc rule run on a user's system.