glsl: build without bison
Removes the hard dependency on bison
and makes it possible to build with byacc
.
Issues
In order to get this to build, I had to manually patch the files generated from glsl_parser.yy
.
This is because byacc
and bison
define YYSTYPE
differently.
// byacc generates this
typedef union {...} YYSTYPE;
// bison generates this
union YYSTYPE {...};
typedef union YYSTYPE YYSTYPE;
This breaks the forward declaration of YYSTYPE
in glsl_parser_extras.h
. I don't know what the best way to fix this would be.
Edit
I was also successful at building Mesa as it is in my fork with the following patch to byacc
--- a/reader.c
+++ b/reader.c
@@ -902,7 +902,7 @@
if (!lflag)
fprintf(text_file, line_format, lineno, input_file_name);
- puts_both("typedef union");
+ puts_both("typedef union YYSTYPE");
depth = 0;
loop: