xkbcommon / libxkbcommon

keymap handling library for toolkits and window systems
https://xkbcommon.org
Other
286 stars 125 forks source link

libxkbcommon only supports GNU bison options #133

Closed konimex closed 4 years ago

konimex commented 4 years ago

Using byacc 20191125, libxkbcommon fails to build since byacc doesn't support long options commonly used by GNU bison.

Found ninja-1.9.0 at /usr/bin/ninja
WARNING: Could not create compilation database.
[1/140] Generating source from 'src/xkbcomp/parser.y'.
ninja: job failed: /usr/bin/byacc ../src/xkbcomp/parser.y --defines=xkbcommon-test-internal@sta/parser.h --output=xkbcommon-test-internal@sta/parser.c '-p _xkbcommon_'
Usage: /usr/bin/byacc [options] filename

Options:
  -b file_prefix        set filename prefix (default "y.")
  -B                    create a backtracking parser
  -d                    write definitions (.tab.h)
  -H defines_file       write definitions to defines_file
  -i                    write interface (y.tab.i)
  -g                    write a graphical description
  -l                    suppress #line directives
  -L                    enable position processing, e.g., "%locations"
  -o output_file        (default ".tab.c")
  -p symbol_prefix      set symbol prefix (default "yy")
  -P                    create a reentrant parser, e.g., "%pure-parser"
  -r                    produce separate code and table files (y.code.c)
  -s                    suppress #define's for quoted names in %token lines
  -t                    add debugging support
  -v                    write description (y.output)
  -V                    show version information and exit
ninja: subcommands failed
bluetech commented 4 years ago

Indeed. Should be fixed now.

Ella-0 commented 4 years ago

The latest master still has these issues.


[2/164] Generating symbol file 'xkbregistry@sha/libxkbregistry.so.0.0.0.symbols'
[3/164] Generating source from 'src/xkbcomp/parser.y'.
[4/164] Generating source from 'src/xkbcomp/parser.y'.
ninja: job failed: /usr/bin/byacc ../src/xkbcomp/parser.y -H compile-keymap@exe/parser.h -o compile-keymap@exe/parser.c '-p _xkbcommon_'
Usage: /usr/bin/byacc [options] filename

Options:
  -b file_prefix        set filename prefix (default "y.")
  -B                    create a backtracking parser
  -d                    write definitions (.tab.h)
  -H defines_file       write definitions to defines_file
  -i                    write interface (y.tab.i)
  -g                    write a graphical description
  -l                    suppress #line directives
  -L                    enable position processing, e.g., "%locations"
  -o output_file        (default ".tab.c")
  -p symbol_prefix      set symbol prefix (default "yy")
  -P                    create a reentrant parser, e.g., "%pure-parser"
  -r                    produce separate code and table files (y.code.c)
  -s                    suppress #define's for quoted names in %token lines
  -t                    add debugging support
  -v                    write description (y.output)
  -V                    show version information and exit
ninja: job failed: /usr/bin/byacc ../src/xkbcomp/parser.y -H xkbcommon-test-internal@sta/parser.h -o xkbcommon-test-internal@sta/parser.c '-p _xkbcommon_'
Usage: /usr/bin/byacc [options] filename

Options:
  -b file_prefix        set filename prefix (default "y.")
  -B                    create a backtracking parser
  -d                    write definitions (.tab.h)
  -H defines_file       write definitions to defines_file
  -i                    write interface (y.tab.i)
  -g                    write a graphical description
  -l                    suppress #line directives
  -L                    enable position processing, e.g., "%locations"
  -o output_file        (default ".tab.c")
  -p symbol_prefix      set symbol prefix (default "yy")
  -P                    create a reentrant parser, e.g., "%pure-parser"
  -r                    produce separate code and table files (y.code.c)
  -s                    suppress #define's for quoted names in %token lines
  -t                    add debugging support
  -v                    write description (y.output)
  -V                    show version information and exit
ninja: job failed: /usr/bin/byacc ../src/xkbcomp/parser.y -H xkbcommon@sha/parser.h -o xkbcommon@sha/parser.c '-p _xkbcommon_'
Usage: /usr/bin/byacc [options] filename

Options:
  -b file_prefix        set filename prefix (default "y.")
  -B                    create a backtracking parser
  -d                    write definitions (.tab.h)
  -H defines_file       write definitions to defines_file
  -i                    write interface (y.tab.i)
  -g                    write a graphical description
  -l                    suppress #line directives
  -L                    enable position processing, e.g., "%locations"
  -o output_file        (default ".tab.c")
  -p symbol_prefix      set symbol prefix (default "yy")
  -P                    create a reentrant parser, e.g., "%pure-parser"
  -r                    produce separate code and table files (y.code.c)
  -s                    suppress #define's for quoted names in %token lines
  -t                    add debugging support
  -v                    write description (y.output)
  -V                    show version information and exit
ninja: subcommands failed```
bluetech commented 4 years ago

Looks like I made a little silly mistake. Does the following fix it for you?

diff --git a/meson.build b/meson.build
index a4b0f7b..f7489d3 100644
--- a/meson.build
+++ b/meson.build
@@ -145,7 +145,7 @@ if bison.found()
     yacc_gen = generator(
         bison,
         output: ['@BASENAME@.c', '@BASENAME@.h'],
-        arguments: ['@INPUT@', '--defines=@OUTPUT1@', '--output=@OUTPUT0@', '-p _xkbcommon_'],
+        arguments: ['@INPUT@', '--defines=@OUTPUT1@', '--output=@OUTPUT0@', '-p', '_xkbcommon_'],
     )
 else
     byacc = find_program('byacc', required: false)
@@ -153,7 +153,7 @@ else
         yacc_gen = generator(
             byacc,
             output: ['@BASENAME@.c', '@BASENAME@.h'],
-            arguments: ['@INPUT@', '-H', '@OUTPUT1@', '-o', '@OUTPUT0@', '-p _xkbcommon_'],
+            arguments: ['@INPUT@', '-H', '@OUTPUT1@', '-o', '@OUTPUT0@', '-p', '_xkbcommon_'],
         )
     else
         error('Could not find a compatible YACC program (bison or byacc)')
Ella-0 commented 4 years ago

No but switching the position of the input file does

arguments: ['-H', '@OUTPUT1@', '-o', '@OUTPUT0@', '-p _xkbcommon_', '@INPUT@'],
bluetech commented 4 years ago

Thanks, fixed in a0c1c2f42dafecbad7b9912dcaba7f206805981d.

Ella-0 commented 4 years ago

Thank you