GNOME Bugzilla – Bug 378931
Bison version check doesn't work on Solaris 9
Last modified: 2007-01-08 09:39:42 UTC
Please describe the problem: GStreamer 0.10.10 does not correctly detect the installed bison version 1.875d in Solaris 9. The problem is caused by the letter "d" ín "1.875d". Other systems may be affected too. Steps to reproduce: type ./configure on Solaris 9 Actual results: checking bison version 1.875d >= 1.35... Bareword found where operator expected at - line 1, near "1.875d" (Missing operator before d?) Unquoted string "d" may clash with future reserved word at - line 1. syntax error at - line 1, near "1.875d " Execution of - aborted due to compilation errors. no configure: error: Your bison version is too old, 1.35 or later is required. Expected results: checking bison version 1.875d >= 1.35...yes Does this happen every time? yes Other information: $ which bison /usr/local/bin/bison $ bison --version bison (GNU Bison) 1.875d Written by Robert Corbett and Richard Stallman. Copyright (C) 2004 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.
This should have been fixed quite a while ago, see bug #348354 Could you investigate why this doesn't work on Solaris or how to fix it? And what exactly causes the "Bareword found where operator expected" warning? (maybe the double-bracket thing from the bug above depends on the shell used?)
Actually, it looks more like either the 'cut' or the 'tr' tool aren't available or not in your PATH in your case. As 'cut' is used in other checks that are done earlier as well, my guess would be that it's the "tr" utility that's missing or not in your path. Replaced usage with sed in this case. 2007-01-05 Tim-Philipp Müller <tim at centricular dot net> * m4/gst-parser.m4: Use 'sed' rather than 'tr' to strip trailing letters from version numbers, since 'tr' might not be available and we know sed is (#378931). Please re-open if there are still issues.
Sorry, the bug still exists in Solaris with the current CVS HEAD version of gstreamer: checking bison version 1.875d >= 1.35... Bareword found where operator expected at - line 1, near "1.875d" (Missing operator before d?) Unquoted string "d" may clash with future reserved word at - line 1. syntax error at - line 1, near "1.875d " Execution of - aborted due to compilation errors. no configure: error: Your bison version is too old, 1.35 or later is required. The error comes from Perl because 1.875d (the version of /usr/local/bin/bison on my SunOS 5.9 system) is not a number. This test (original from gstreamer/common/m4/gst-parser.m4:15) shows the problem: $ perl -w << EOF ? exit 1.875d < 1.35 ? 0:1; ? EOF Bareword found where operator expected at - line 1, near "1.875d" (Missing operator before d?) Unquoted string "d" may clash with future reserved word at - line 1. syntax error at - line 1, near "1.875d " Execution of - aborted due to compilation errors.
So why exactly does it still not work? Could you do run these command lines and paste the output for each please? $ echo 'bison (GNU Bison) 1.875d' | sed 's/^.*) //' $ echo 'bison (GNU Bison) 1.875d' | sed 's/^.*) //' | sed 's/[a-zA-Z]*$//' $ echo 'bison (GNU Bison) 1.875d' | sed 's/^.*) //' | sed 's/[a-zA-Z]*$//' | cut -d' ' -f1 $ which cut $ which tr
Here is the output of the above commands (SunOS 5.9): $ echo 'bison (GNU Bison) 1.875d' | sed 's/^.*) //' 1.875d $ echo 'bison (GNU Bison) 1.875d' | sed 's/^.*) //' | sed 's/[a-zA-Z]*$//' 1.875 $ echo 'bison (GNU Bison) 1.875d' | sed 's/^.*) //' | sed 's/[a-zA-Z]*$//' | cut -d' ' -f1 1.875 $ which cut /usr/bin/cut which tr $ /usr/ucb/tr /usr/ucb/tr The version number is right using the above 'sed' commands. But configure (near line 25022) contains an error: bison_version=`$BISON_PATH --version | head -n 1 | sed 's/^.*) //' | sed 's/a-zA-Z*$//' | cut -d' ' -f1` Instead of "sed 's/a-zA-Z*$//'" we need sed 's/[a-zA-Z]*$//' (like in the test commands). common/m4/gst-parser.m4:12 has this right. I think we have a M4 quoting problem here. The quoting problem (within autoconf processing from common/m4/gst-parser.m4 to configure) can be seen on Linux too.
> But configure (near line 25022) contains an error: > > bison_version=`$BISON_PATH --version | head -n 1 | sed 's/^.*) //' | sed > 's/a-zA-Z*$//' | cut -d' ' -f1` > > Instead of "sed 's/a-zA-Z*$//'" we need sed 's/[a-zA-Z]*$//' (like in the test > commands). common/m4/gst-parser.m4:12 has this right. > > I think we have a M4 quoting problem here. The quoting problem (within autoconf > processing from common/m4/gst-parser.m4 to configure) can be seen on Linux too. Ah, good catch. I guess we need double square brackets again in the .m4 file. Does changing this in common/m4/gst-parser.m4 fix it for you as well, after running autogen.sh again? - bison_version=`$BISON_PATH --version | head -n 1 | sed 's/^.*) //' | sed 's/[a-zA-Z]*$//' | cut -d' ' -f1` + bison_version=`$BISON_PATH --version | head -n 1 | sed 's/^.*) //' | sed 's/[[a-zA-Z]]*$//' | cut -d' ' -f1`
Yes, your suggested patch works.
Excellent, thanks a lot for confirming.
2007-01-08 Tim-Philipp Müller <tim at centricular dot net> * m4/gst-parser.m4: Need to use double square brackets again so m4 doesn't remove them (fixes #378931). * m4/gst-args.m4: Use double square brackets here as well, for the same reason.