[weston] xkbcommon library is not optional.
Bryce Harrington
bryce at osg.samsung.com
Thu Oct 15 18:28:37 PDT 2015
On Tue, Oct 13, 2015 at 01:59:13PM +0200, Joaquim Duran wrote:
> Hello,
>
> When configuring the Weston project, it is possible to disable (don't
> include) the library libxkbcommon. To compile Weston successfully,
> even if the option --disable-xkbcommon is specified, the library must
> be installed because the file src/compositor.h requires it.
Joaquim, good find.
>From the comments in configure.ac:
AS_HELP_STRING([--disable-xkbcommon], [Disable libxkbcommon
support: This is only useful in environments
where you do not have a hardware keyboard. If
libxkbcommon support is disabled clients will not
be sent a keymap and and must know how to
interpret the keycode sent for any key event.]),,
So it sounds like this is a special case that is intended to work.
The header include was from commit 855028fe three years ago, while the
--disable-xkbcommon was added by 382ff46f just two years ago. That
makes me think that your situation was simply overlooked.
If that's true, then presumably the fix would involve peppering
compositor.* and other files with tests like,
#ifdef ENABLE_XKBCOMMON
...
#endif
For example it looks like the weston_xkb_info struct would need to
either be removed or stubbed out, and users of it be disabled. There
are also some weston calls that use xkb_keymap, xkb_rule_names,
etc. structures for params that'd need addressed.
On the face of it, seems like it could be a fair amount of work, and a
bit invasive, but maybe there's some tricks to make it simpler
(typedeffing the unsupported struct args and so on.)
Alternatively, --disable-xkbcommon could be dropped. However I get the
sense it actually solves a real world need, and functional regression is
rarely a good idea.
Would you mind filing a bug report about this? At the least we probably
ought to at least fix the documentation, to admit the fact if xkbcommon
still needs to be present.
Is this a situation that affects what you're working on, or just
something you noticed via analysis? If the former, would you be open to
working on a patch to address it?
Bryce
> Some code of file src/compositor.h should only be compiled if
> xkbcommon library is enabed, but this is not the case. Here I include
> some lines from that file:
>
>
> 34 #include <stdbool.h>
> 35 #include <time.h>
> 36 #include <pixman.h>
> 37 #include <xkbcommon/xkbcommon.h> <--- Always included
>
> 450
> 451 struct weston_xkb_info { <--- Always compiled
> 452 struct xkb_keymap *keymap;
> 453 int keymap_fd;
> 454 size_t keymap_size;
> 455 char *keymap_area;
> 456 int32_t ref_count;
> 457 xkb_mod_index_t shift_mod;
> 458 xkb_mod_index_t caps_mod;
> 459 xkb_mod_index_t ctrl_mod;
> 460 xkb_mod_index_t alt_mod;
> 461 xkb_mod_index_t mod2_mod;
> 462 xkb_mod_index_t mod3_mod;
> 463 xkb_mod_index_t super_mod;
> 464 xkb_mod_index_t mod5_mod;
> 465 xkb_led_index_t num_led;
> 466 xkb_led_index_t caps_led;
> 467 xkb_led_index_t scroll_led;
> 468 };
> 469
>
>
> Configuration of weston:
>
> ./autogen.sh \
> --disable-devdocs \
> --disable-dbus \
> --disable-xwayland \
> --disable-xwayland-test \
> --disable-x11-compositor \
> --disable-drm-compositor \
> --disable-wayland-compositor \
> --disable-headless-compositor \
> --disable-rpi-compositor \
> --enable-fbdev-compositor \
> --disable-rdp-compositor \
> --disable-weston-launch \
> --disable-wcap-tools \
> --with-cairo=image \
> --disable-xkbcommon \
> --enable-clients \
> --disable-simple-clients \
> --disable-simple-egl-clients \
> --build=i686-linux --host=arm-none-linux-gnueabi
> --target=arm-none-linux-gnueabi \
> --prefix=$INSTALL_DIR --with-sysroot=${SYSROOT_DIR}
>
>
> Error:
>
> gem-med at gemmed-VirtualBox:~/Logic_BSPs/Linux_3.0/src/weston$ make
> make all-am
> make[1]: Entering directory `/home/gem-med/Logic_BSPs/Linux_3.0/src/weston'
> CC src/gl_renderer_la-gl-renderer.lo
> cc1: warning: include location "/usr/include/libdrm" is unsafe for
> cross-compilation [-Wpoison-system-directories]
> In file included from src/gl-renderer.h:28:0,
> from src/gl-renderer.c:41:
> src/compositor.h:37:33: fatal error: xkbcommon/xkbcommon.h: No such
> file or directory
> compilation terminated.
> make[1]: *** [src/gl_renderer_la-gl-renderer.lo] Error 1
> make[1]: Leaving directory `/home/gem-med/Logic_BSPs/Linux_3.0/src/weston'
> make: *** [all] Error 2
>
> Joaquim Duran
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel
More information about the wayland-devel
mailing list