After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 378931 - Bison version check doesn't work on Solaris 9
Bison version check doesn't work on Solaris 9
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
0.10.10
Other All
: High critical
: 0.10.12
Assigned To: Tim-Philipp Müller
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2006-11-24 20:26 UTC by Bjoern Voigt
Modified: 2007-01-08 09:39 UTC
See Also:
GNOME target: ---
GNOME version: 2.15/2.16



Description Bjoern Voigt 2006-11-24 20:26:22 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.
Comment 1 Tim-Philipp Müller 2007-01-01 12:31:36 UTC
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?)

Comment 2 Tim-Philipp Müller 2007-01-05 15:04:24 UTC
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.

Comment 3 Bjoern Voigt 2007-01-05 21:29:05 UTC
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.
Comment 4 Tim-Philipp Müller 2007-01-06 11:38:59 UTC
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

Comment 5 Bjoern Voigt 2007-01-06 12:35:15 UTC
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.
Comment 6 Tim-Philipp Müller 2007-01-07 18:18:58 UTC
> 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`
 
Comment 7 Bjoern Voigt 2007-01-07 19:37:48 UTC
Yes, your suggested patch works.
Comment 8 Tim-Philipp Müller 2007-01-07 22:00:35 UTC
Excellent, thanks a lot for confirming.
Comment 9 Tim-Philipp Müller 2007-01-08 09:39:42 UTC
 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.