GNOME Bugzilla – Bug 431150
compilation fails with flex 2.5.4
Last modified: 2007-04-19 14:38:05 UTC
I was trying to compile gstreamer from a fresh mingw system. I installed flex 2.5.4 from gnuwin32. But the compilation failed (grammar.tab.h was not generated). The configure script had just reported that an old version of flex was installed: checking for flex... /usr/local/bin/flex checking flex version 2.5.4 >= 2.5.31... no and it did not exit. Then I installed flex 2.5.33 from the mingw repository and the compilation was successfull. Maybe there is a problem in the AG_GST_FLEX_CHECK macro.
What's the complete build output? If you're using latest CVS it should use pre-generated flex/bison sources if your flex is too old as we can't bump the required flex version in the stable series but need a newer one for a fairly critical bugfix.
Here is the output: cd . && /bin/sh /d/vincent/upload/gst/gstreamer/missing --run autoheader touch ./config.h.in cd . && /bin/sh ./config.status config.h config.status: creating config.h config.status: config.h is unchanged make all-recursive make[1]: Entering directory `/d/vincent/upload/gst/gstreamer' Making all in gst make[2]: Entering directory `/d/vincent/upload/gst/gstreamer/gst' glib-mkenums \ --fhead "#ifndef __GST_ENUM_TYPES_H__\n#define __GST_ENUM_TYPES_H__\n\n#include <glib-object.h>\n\nG_BEGIN_DECLS\n" \ --fprod "\n/* enumerations from \"@filename@\" */\n" \ --vhead "GType @enum_name@_get_type (void);\n#define GST_TYPE_@ENUMSHORT@ (@enum_name@_get_type())\n" \ --ftail "G_END_DECLS\n\n#endif /* __GST_ENUM_TYPES_H__ */" \ gst.h glib-compat.h gstobject.h gstbin.h gstbuffer.h gstbus.h gstcaps.h gstchildproxy.h gstclock.h gstcompat.h gstelement.h gstelementfactory.h gsterror.h gstevent.h gstfilter.h gstformat.h gstghostpad.h gstindex.h gstindexfactory.h gstinfo.h gstinterface.h gstiterator.h gstmacros.h gstmessage.h gstminiobject.h gstpad.h gstpadtemplate.h gstpipeline.h gstplugin.h gstpluginfeature.h gstquery.h gstsegment.h gststructure.h gstsystemclock.h gsttaglist.h gsttagsetter.h gsttask.h gsttrace.h gsttypefind.h gsttypefindfactory.h gsturi.h gstutils.h gstvalue.h gstregistry.h gstparse.h gstxml.h > gstenumtypes.h glib-genmarshal --header --prefix=gst_marshal ./gstmarshal.list > gstmarshal.h.tmp mv gstmarshal.h.tmp gstmarshal.h glib-mkenums \ --fhead "#include \"gst_private.h\"\n#include <gst/gst.h>\n#define C_ENUM(v) ((gint) v)\n#define C_FLAGS(v) ((guint) v)\n " \ --fprod "\n/* enumerations from \"@filename@\" */" \ --vhead "static void\nregister_@enum_name@ (GType* id)\n{\n static const G@Type@Value values[] = {" \ --vprod " { C_@TYPE@(@VALUENAME@), \"@VALUENAME@\", \"@valuenick@\" }," \ --vtail " { 0, NULL, NULL }\n };\n *id = g_@type@_register_static (\"@EnumName@\", values);\n}\nGType\n@enum_name@_get_type (void)\n{\n static GType id;\n static GOnce once = G_ONCE_INIT;\n\n g_once (&once, (GThreadFunc)register_@enum_name@, &id);\n return id;\n}\n" \ gst.h glib-compat.h gstobject.h gstbin.h gstbuffer.h gstbus.h gstcaps.h gstchildproxy.h gstclock.h gstcompat.h gstelement.h gstelementfactory.h gsterror.h gstevent.h gstfilter.h gstformat.h gstghostpad.h gstindex.h gstindexfactory.h gstinfo.h gstinterface.h gstiterator.h gstmacros.h gstmessage.h gstminiobject.h gstpad.h gstpadtemplate.h gstpipeline.h gstplugin.h gstpluginfeature.h gstquery.h gstsegment.h gststructure.h gstsystemclock.h gsttaglist.h gsttagsetter.h gsttask.h gsttrace.h gsttypefind.h gsttypefindfactory.h gsturi.h gstutils.h gstvalue.h gstregistry.h gstparse.h gstxml.h > gstenumtypes.c echo "#include \"gst_private.h\"" > gstmarshal.c.tmp echo "#include \"glib-object.h\"" >> gstmarshal.c.tmp echo "#include \"gstmarshal.h\"" >> gstmarshal.c.tmp glib-genmarshal --body --prefix=gst_marshal ./gstmarshal.list >> gstmarshal.c.tmp mv gstmarshal.c.tmp gstmarshal.c make all-recursive make[3]: Entering directory `/d/vincent/upload/gst/gstreamer/gst' Making all in parse make[4]: Entering directory `/d/vincent/upload/gst/gstreamer/gst/parse' cp ./lex._gst_parse_yy.pre.c lex._gst_parse_yy.c if /bin/sh ../../libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I../.. -I/usr/local/include -I../../libs -I../.. -I../.. -ID:/vincent/msys/1.0/local/include/glib-2.0 -ID:/vincent/msys/1.0/local/lib/glib-2.0/include -ID:/vincent/msys/1.0/local/include/libxml2 -Wall -Werror -g -DGST_DISABLE_DEPRECATED -g -O2 -MT libgstparse_la-lex._gst_parse_yy.lo -MD -MP -MF ".deps/libgstparse_la-lex._gst_parse_yy.Tpo" \ -c -o libgstparse_la-lex._gst_parse_yy.lo `test -f 'lex._gst_parse_yy.c' || echo './'`lex._gst_parse_yy.c; \ then mv ".deps/libgstparse_la-lex._gst_parse_yy.Tpo" ".deps/libgstparse_la-lex._gst_parse_yy.Plo"; \ else rm -f ".deps/libgstparse_la-lex._gst_parse_yy.Tpo"; exit 1; \ fi mkdir .libs gcc -DHAVE_CONFIG_H -I. -I. -I../.. -I/usr/local/include -I../../libs -I../.. -I../.. -ID:/vincent/msys/1.0/local/include/glib-2.0 -ID:/vincent/msys/1.0/local/lib/glib-2.0/include -ID:/vincent/msys/1.0/local/include/libxml2 -Wall -Werror -g -DGST_DISABLE_DEPRECATED -g -O2 -MT libgstparse_la-lex._gst_parse_yy.lo -MD -MP -MF .deps/libgstparse_la-lex._gst_parse_yy.Tpo -c lex._gst_parse_yy.c -DDLL_EXPORT -DPIC -o .libs/libgstparse_la-lex._gst_parse_yy.o parse.l:12:25: grammar.tab.h: No such file or directory lex._gst_parse_yy.c:885: error: syntax error before "YYSTYPE" lex._gst_parse_yy.c:885: warning: no semicolon at end of struct or union lex._gst_parse_yy.c:924: error: syntax error before '*' token lex._gst_parse_yy.c:924: warning: type defaults to `int' in declaration of `_gst_parse_yyget_lval' lex._gst_parse_yy.c:924: warning: data definition has no type or storage class lex._gst_parse_yy.c:926: error: syntax error before '*' token lex._gst_parse_yy.c:1033: error: syntax error before '*' token lex._gst_parse_yy.c:1056: error: syntax error before '*' token lex._gst_parse_yy.c: In function `_gst_parse_yylex': lex._gst_parse_yy.c:1060: error: `yyscanner' undeclared (first use in this function) lex._gst_parse_yy.c:1060: error: (Each undeclared identifier is reported only once lex._gst_parse_yy.c:1060: error: for each function it appears in.) lex._gst_parse_yy.c:1069: error: dereferencing pointer to incomplete type lex._gst_parse_yy.c:1069: error: `yylval_param' undeclared (first use in this function) etc... the problem is that grammr.tab.h is not generated. Also, I think that some brakets should be added in the flex macro, because only 'no' is displayed if the version is not high enough. I've attached a patch below. Another question more or less off topic: is regex needed ? I don't have it but it is checked (and I know it is used for flex compilation)
Created attachment 86620 [details] [review] patch for AG_GST_FLEX_CHECK
Interesting, do you have gst/parse/lex._gst_parse_yy.pre.c and grammer.tab.pre.[ch]? These should be copied to the same filenames without ".pre" if flex is too old and then the build should work... Please make sure that your CVS checkout is complete and from latest CVS (cvs up -dP). But you're right with the AG_GST_FLEX_CHECK patch, I'll commit it later.
I have the latest cvs here are the files in the parser dir: $ ls gst/parse/ CVS grammar.tab.pre.c lex._gst_parse_yy.pre.c Makefile grammar.tab.pre.h libgstparse_la-lex._gst_parse_yy.loT Makefile.am grammar.y parse.l Makefile.in lex._gst_parse_yy.c types.h in gst/parser/Makefile.am, when GENERATE_PARSER is false, I can't see grammar.tab.h as a dependancy in any make rules. So I think that it is normal that it is not copied from grammar.tab.pre.h
Please retry with latest CVS. This should be fixed now... but please tell me if there's more broken :)
OK, everything should be fixed now finally... please reopen otherwise :)