Problems (#1) - bison cannot be found? (#41) - Message List

bison cannot be found?
 unsolved

Hi, I am having a little problem with configure. I have got the required packages, however, configure cannot find bison. here is the output.

checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for gawk... no
checking for mawk... mawk
checking for flex... flex
checking lex output file root... lex.yy
checking lex library... -lfl
checking whether yytext is a pointer... yes
checking for bison... byacc -d
configure: error: bison not found

I am on Kubuntu OS and when I apt-get install bison it says I have already got the latest version.

Anyone know why is this happening?

  • Message #187

    Yeah, configure is finding byacc instead of bison. In cwiid/configure.ac, comment out the test right after AC_PROG_YACC, then run autoconf, and ./configure; make; sudo make install as usual. Reply here with the results. If it works, we can add byacc as an acceptable YACC clone, or if not, test explicitly for bison rather than using AC_PROG_YACC.

    • Message #188

      Well, I don't think it works. Is there any alternative to bison?

      Here is what I get during make..

      ...
      gcc -o wmgui main.o interface.o support.o -L../libcwiid -pthread -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lm -lpangocairo-1.0 -lfontconfig -lXext -lXrender -lXinerama -lXi -lXrandr -lXcursor -lXfixes -lpango-1.0 -lcairo -lX11 -lgobject-2.0 -lgmodule-2.0 -ldl -lgthread-2.0 -lrt -lglib-2.0   -lm -lcwiid
      install -D wmgui /usr/local/bin/wmgui
      make[1]: Leaving directory `/home/kde-devel/utils/cwiid-0.6.00_rc2/cwiid-0.6.00_rc2/wmgui'
      make install -C wminput
      make[1]: Entering directory `/home/kde-devel/utils/cwiid-0.6.00_rc2/cwiid-0.6.00_rc2/wminput'
      byacc -d -d parser.y
      make[1]: byacc: Command not found
      mawk -f action_enum.awk action_enum.txt > action_enum.c
      In file included from action_enum.c:3:
      conf.h:48:19: error: y.tab.h: No such file or directory
      In file included from uinput.c:44:
      conf.h:48:19: error: y.tab.h: No such file or directory
      In file included from py_plugin.c:46:
      conf.h:48:19: error: y.tab.h: No such file or directory
      In file included from c_plugin.c:30:
      conf.h:48:19: error: y.tab.h: No such file or directory
      In file included from conf.c:48:
      conf.h:48:19: error: y.tab.h: No such file or directory
      In file included from main.c:64:
      conf.h:48:19: error: y.tab.h: No such file or directory
      make[1]: Leaving directory `/home/kde-devel/utils/cwiid-0.6.00_rc2/cwiid-0.6.00_rc2/wminput'
      make[1]: Entering directory `/home/kde-devel/utils/cwiid-0.6.00_rc2/cwiid-0.6.00_rc2/wminput'
      byacc -d -d parser.y
      make[1]: byacc: Command not found
      gcc -g -Wall -W -I../libcwiid -I/usr/include/python2.5 -DWMINPUT_CONFIG_DIR=\"/usr/local/etc/cwiid/wminput\" -DCWIID_PLUGINS_DIR=\"/usr/local/lib/cwiid/plugins\" -DCWIID_VERSION=\"0.6.00_rc2\"   -c -o main.o main.c
      In file included from main.c:64:
      conf.h:48:19: error: y.tab.h: No such file or directory
      conf.h:121:1: warning: "UINPUT_VERSION" redefined
      In file included from conf.h:44,
                       from main.c:64:
      /usr/include/linux/uinput.h:35:1: warning: this is the location of the previous definition
      In file included from main.c:64:
      conf.h:167: error: expected specifier-qualifier-list before ‘YYLTYPE’
      conf.h:201: error: expected declaration specifiers or ‘...’ before ‘YYLTYPE’
      conf.h:202: error: expected declaration specifiers or ‘...’ before ‘YYLTYPE’
      main.c: In function ‘main’:
      main.c:246: error: ‘struct conf’ has no member named ‘plugins’
      main.c:247: error: ‘struct conf’ has no member named ‘plugins’
      ...
      
      • Message #192

        That's odd - it's detecting byacc when you don't have it installed? That's an autoconf bug. There are no (known) alternatives to bison, but you can set configure to use bison by adding the line:

        YACC="bison -y"
        

        after the test you commented earlier.

      • Message #189

        I've just installed "byacc", I 'll try that and see if it works.

      • Message #190

        After, sudo apt-get install byacc -- Its a different error this time,

        ...
        make[1]: Entering directory `/home/kde-devel/utils/cwiid-0.6.00_rc2/cwiid-0.6.00_rc2/wminput'
        byacc -d -d parser.y
        byacc: e - line 44 of "parser.y", syntax error
        %error-verbose
        ^
        gcc -g -Wall -W -I../libcwiid -I/usr/include/python2.5 -DWMINPUT_CONFIG_DIR=\"/usr/local/etc/cwiid/wminput\" -DCWIID_PLUGINS_DIR=\"/usr/local/lib/cwiid/plugins\" -DCWIID_VERSION=\"0.6.00_rc2\"   -c -o main.o main.c
        In file included from main.c:64:
        conf.h:121:1: warning: "UINPUT_VERSION" redefined
        In file included from conf.h:44,
                         from main.c:64:
        /usr/include/linux/uinput.h:35:1: warning: this is the location of the previous definition
        In file included from main.c:64:
        conf.h:167: error: expected specifier-qualifier-list before ‘YYLTYPE’
        conf.h:201: error: expected declaration specifiers or ‘...’ before ‘YYLTYPE’
        ...
        
        • Message #191

          did you do a make clean before trying make again?

          • Message #193

            Yes, I did clean.

            Though I solved it, here is what needs to be done; Comment out the following lines in configure.ac

            #if test "$YACC" != "bison -y"; then # AC_MSG_ERROR([bison not found]) #fi

            and off you go.

            • Message #194

              Whoah, hold on there, cowboy. That test is there for a reason, and removing it may be the solution for you, but it's definitely not for everyone. The standard yacc does not work for CWiid, and if we don't test for bison, a bad yacc clone may be used, resulting in hard-to-decipher make errors, which it is part of configure's job to prevent.

              So, please tell us more about how you got it to work. Earlier in the thread, you tried using byacc, and it failed. Did you get byacc to work somehow? If not, what yacc did you end up using?

              • Message #195

                I understand what you mean.

                See how I said that I installed byacc.

                I did, sudo apt-get install byacc

                and when I ran configure, it displayed ..

                ...
                checking lex library... -lfl
                checking whether yytext is a pointer... yes
                checking for bison... yacc -d
                configure: error: bison not found
                ...
                

                I was like "what the". And I thought I should give the default yacc a shot, and commented the lines from configure.ac.

                In fact yacc -V tells me that it is bison, here is the output

                bison (GNU Bison) 2.3
                Written by Robert Corbett and Richard Stallman.
                

                and when I say,

                bison -y

                it says,

                bison: missing operand after `-y'
                Try `bison --help' for more information.
                

                Anyway I did an experiment, instead of using yacc, I used bison, here is what I get when making

                ...
                make install -C wminput
                make[1]: Entering directory
                `/home/kde-devel/utils/cwiid-0.6.00_rc2/cwiid-0.6.00_rc2/wminput'
                bison -d parser.y
                mv -f y.tab.c parser.c
                mv: cannot stat `y.tab.c': No such file or directory
                gawk -f action_enum.awk action_enum.txt > action_enum.c
                In file included from action_enum.c:3:
                conf.h:48:19: error: y.tab.h: No such file or directory
                In file included from uinput.c:44:
                conf.h:48:19: error: y.tab.h: No such file or directory
                In file included from py_plugin.c:46:
                conf.h:48:19: error: y.tab.h: No such file or directory
                In file included from c_plugin.c:30:
                conf.h:48:19: error: y.tab.h: No such file or directory
                In file included from conf.c:48:
                conf.h:48:19: error: y.tab.h: No such file or directory
                In file included from main.c:64:
                conf.h:48:19: error: y.tab.h: No such file or directory
                make[1]: Leaving directory
                `/home/kde-devel/utils/cwiid-0.6.00_rc2/cwiid-0.6.00_rc2/wminput'
                make[1]: Entering directory
                `/home/kde-devel/utils/cwiid-0.6.00_rc2/cwiid-0.6.00_rc2/wminput'
                bison -d parser.y
                mv -f y.tab.c parser.c
                mv: cannot stat `y.tab.c': No such file or directory
                gcc -g -Wall -W -I../libcwiid -I/usr/include/python2.5
                -DWMINPUT_CONFIG_DIR=\"/usr/local/etc/cwiid/wminput\"
                -DCWIID_PLUGINS_DIR=\"/usr/local/lib/cwiid/plugins\"
                -DCWIID_VERSION=\"0.6.00_rc2\"   -c -o main.o main.c
                In file included from main.c:64:
                conf.h:48:19: error: y.tab.h: No such file or directory
                conf.h:121:1: warning: "UINPUT_VERSION" redefined
                In file included from conf.h:44,
                                 from main.c:64:
                /usr/include/linux/uinput.h:35:1: warning: this is the location of the previous
                definition
                ...
                

                so then I tried, byacc and while making I get

                ...
                make install -C wminput
                make[1]: Entering directory
                `/home/kde-devel/utils/cwiid-0.6.00_rc2/cwiid-0.6.00_rc2/wminput'
                byacc -d parser.y
                byacc: e - line 44 of "parser.y", syntax error
                %error-verbose
                ^
                gawk -f action_enum.awk action_enum.txt > action_enum.c
                make[1]: Leaving directory
                `/home/kde-devel/utils/cwiid-0.6.00_rc2/cwiid-0.6.00_rc2/wminput'
                make[1]: Entering directory
                `/home/kde-devel/utils/cwiid-0.6.00_rc2/cwiid-0.6.00_rc2/wminput'
                byacc -d parser.y
                byacc: e - line 44 of "parser.y", syntax error
                %error-verbose
                ^
                make[1]: Leaving directory
                `/home/kde-devel/utils/cwiid-0.6.00_rc2/cwiid-0.6.00_rc2/wminput'
                make: *** [wminput] Error 2
                ...
                

                I hope this explains it.

                • Message #196

                  I'm going to leave it like it is for now. The correct solution is to write a bison autoconf script, but until I can do that, it should work correctly for everyone except the few people, such as yourself, that have byacc and bison installed. Thanks for the info.

                  • Message #255

                    I encountered the same error again on one of my other machines and this time I fixed it by simply doing:

                    export YACC="bison -y"

Attachments

No attachments created.