Commit Graph

1638 Commits (ccc3415edd036be24bae3c7c3a615e04bdcebbaf)

Author SHA1 Message Date
Ran Benita ccc3415edd Merge pull request #49 from bluetech/meson
build: add meson build system
2017-07-31 20:57:31 +03:00
Ran Benita 86434d8498 build: add meson build system
Meson is easier to maintain, much faster, encourages better practices,
and is not built on a pile of shell scripts.

The autotools build system is kept intact for now, in order to ease the
migration. The intention is to remove it sooner rather than later, if
all goes well.

Run `meson build && mesonconf build` to see the configuration options
for the new system. Conversion should be straightforward. Environment
variables like CFLAGS work the same.

If meson is used, xorg-util-macros is not required.

In terms of functionality the two systems have about the same
capabilities. Here are some differences I noticed:

- Meson uses `-g` by default, autotools uses `-g -O2`.

- In autotools the default behavior is to install both static and shared
  versions of the libraries. In meson the user must choose exactly one
  (using -Ddefault_library=static/shared).

  It is possible to workaround if needed (install twice...), but
  hopefully meson will add the option in the future.

- Autotools has builtin ctags/cscope targets, meson doesn't.

  Easy to run the tools directly.

- Meson has builtin benchmarks target. Handy.

- Meson has builtin support for sanitizers/clang-analyzer/lto/pgo/
  coverage etc. Also handy.

Signed-off-by: Ran Benita <ran234@gmail.com>
2017-07-31 20:53:39 +03:00
Ran Benita 75ec764cee build: remove Android.mk
I don't think it will work with meson, and I also don't think anyone is
using it.

Signed-off-by: Ran Benita <ran234@gmail.com>
2017-07-31 18:28:28 +03:00
Ran Benita 2f6616a571 build: remove -uninstalled pkg-config files
Meson doesn't support them directly, and I don't think anyone is using
them.

Signed-off-by: Ran Benita <ran234@gmail.com>
2017-07-31 18:28:28 +03:00
Ran Benita a0c858cda1 travis: do the build out-of-tree
To catch problems like the previous commit.

Signed-off-by: Ran Benita <ran234@gmail.com>
2017-07-31 18:22:54 +03:00
Ran Benita 993f4837ad build: fix out-of-tree build
The change in d44ba48 removed -I$(top_builddir)/src/xkbcomp, but this is
needed in order to find the generated parser.h file which is put in the
build dir.

I also added -I$(top_builddir)/src in order to match the meson behavior.

Fixes https://github.com/xkbcommon/libxkbcommon/issues/50

Signed-off-by: Ran Benita <ran234@gmail.com>
2017-07-31 18:20:58 +03:00
Ran Benita 4309735de3 build: use top_srcdir consistently
Signed-off-by: Ran Benita <ran234@gmail.com>
2017-07-31 15:55:48 +03:00
Ran Benita 4983dbcf43 build: change doxygen target to be properly dependency-based
This hackery (thanks libinput) is clearer and more precise than the
previous hackery.

Signed-off-by: Ran Benita <ran234@gmail.com>
2017-07-31 15:55:48 +03:00
Ran Benita 0a19267f30 build: move custom targets to scripts/ and remove from makefile
These scripts generate source code that is committed to git and hence do
not really belong in the build system. A maintainer runs them as needed.

Signed-off-by: Ran Benita <ran234@gmail.com>
2017-07-31 15:55:48 +03:00
Ran Benita 00b08eae82 build: rewrite the update-keysyms sed script in python
A bit more manageable this way, and the other part of the target is
already using python.

The output is the same, except I removed the reference to Makefile.am.

Signed-off-by: Ran Benita <ran234@gmail.com>
2017-07-31 15:55:48 +03:00
Ran Benita d44ba481d7 build: remove unneeded preprocessor include flags
Better to avoid these unexpected include paths.

Signed-off-by: Ran Benita <ran234@gmail.com>
2017-07-31 15:55:48 +03:00
Ran Benita 1b6fa0298a build: explain why we don't AC_DEFINE a couple of constants
Signed-off-by: Ran Benita <ran234@gmail.com>
2017-07-31 15:55:48 +03:00
Ran Benita daebdb5e08 x11/keymap,test/interactive-evdev: fix a couple of clang-analyzer warnings
From my analysis these values cannot be null, but the analyzer cannot
see this. So assert it.

Signed-off-by: Ran Benita <ran234@gmail.com>
2017-07-31 15:55:48 +03:00
Ran Benita 2d9640651a test/x11comp: fix compiler warnings
Signed-off-by: Ran Benita <ran234@gmail.com>
2017-07-31 15:55:48 +03:00
Ran Benita 42f800175d Merge pull request #48 from namandixit/patch-1
Fixed a minor bug in error detection in Wayland test
2017-05-27 12:23:27 +03:00
Naman Dixit 4f17fc6005 Fixed a minor bug in error detection in Wayland test 2017-05-27 09:15:26 +00:00
Ran Benita ca12d2fdd3 Merge pull request #46 from jwrdegoede/master
Sync Keysyms with recent xproto additions
2017-05-12 14:48:47 +03:00
Hans de Goede 939d0909a4 Sync Keysyms with recent xproto additions
xproto recently has been extended with 4 new keysyms:
XF86XK_Keyboard
XF86XK_WWAN
XF86XK_RFKill
XF86XK_AudioPreset

This commit is the result of running "make update-keysyms" on a system
with the updated xproto installed.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2017-05-12 12:27:05 +02:00
Ran Benita 148aec8bdf doc/compat: correct the XKB protocol version from 1.1 to 1.0
There is no XKB 1.1!

Thanks to Oded Arbel for catching this.

Signed-off-by: Ran Benita <ran234@gmail.com>
2017-04-29 15:26:38 +03:00
Ran Benita c9832d4374 test/interactive-x11: handle NULL from xcb_wait_for_event
Can happen in cases like:
- There was an error between the error check and the call.
- The internal poll() fails.

Signed-off-by: Ran Benita <ran234@gmail.com>
2017-04-28 09:33:25 +03:00
Ran Benita 6b57344c32 state: cure boolean blindness in the filter functions' result
Makes it a little easier to understand the filters.

Signed-off-by: Ran Benita <ran234@gmail.com>
2017-04-27 20:06:21 +03:00
Ran Benita 927fd8f89a state: remove unneeded NULL check
xkb_filter_new() cannot return NULL.

Signed-off-by: Ran Benita <ran234@gmail.com>
2017-04-27 19:17:53 +03:00
Ran Benita d44c3ab28e state: reorder new() functions before the set() functions in the code
So that they may be read more naturally in chronological order.

Signed-off-by: Ran Benita <ran234@gmail.com>
2017-04-27 19:16:04 +03:00
Ran Benita 5d821aed9b test/x11comp: be a bit more careful with kill()
We did it correctly but better be safe and appease clang.

Signed-off-by: Ran Benita <ran234@gmail.com>
2017-04-11 21:01:41 +03:00
Ran Benita 9d94145808 test/interactive-wayland: mark a local function static
Signed-off-by: Ran Benita <ran234@gmail.com>
2017-04-11 21:01:41 +03:00
Ran Benita 03f4a03e71 test/interactive-wayland: handle unrecognized SHM format
The enum seems large, and we don't handle all of the values in it.
Previously if we got an unrecognized SHM format we would use an
uninitialized `stride`.

Signed-off-by: Ran Benita <ran234@gmail.com>
2017-04-11 21:01:41 +03:00
Ran Benita 0f43cfa225 test/interactive-wayland: fix uninitialized `ret` in error path
Signed-off-by: Ran Benita <ran234@gmail.com>
2017-04-11 21:01:41 +03:00
Ran Benita 4812adb0b9 Merge pull request #45 from fooishbar/xdg-shell-v6
Wayland: xdg-shell v6 support
2017-04-11 21:01:03 +03:00
Daniel Stone 90bd9fdb01 interactive-wayland: Port to xdg-shell v6
Mutter only implements v6 now, and Weston also implements that. Port
interactive-wayland to this so people can keep on using it.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2017-04-11 15:09:50 +01:00
Daniel Stone ce38f96e95 Add explicit fallthrough case statements
When we fall through to another label in a case, add an explicit comment
noting so, to quiet GCC 7's warnings.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2017-04-11 15:09:23 +01:00
Ran Benita 877fe59ac3 Bump version to 0.7.1
Signed-off-by: Ran Benita <ran234@gmail.com>
2017-01-18 20:17:46 +02:00
Ran Benita 18d53732f2 Update NEWS
Signed-off-by: Ran Benita <ran234@gmail.com>
2017-01-18 20:16:15 +02:00
Ran Benita 47d6e5a8d9 compose/doc: note that it is safe to pass the result of getenv() as locale
See the NOTES section of getenv(3). Somewhat obscure but it doesn't hurt
to reassure the readers who know about this.

Signed-off-by: Ran Benita <ran234@gmail.com>
2017-01-15 18:32:02 +02:00
Ran Benita 1ec14d0996 compose: remove the keysym_from_name cache
The hit rate is high, but either the cache is slow or the function is
not fast enough -- the cache no longer holds its weight, leading only to
very modest improvements. If it's the former, it can definitely be
improved, the code is very dumb (though it worked just as well as any
other I tried back then). But instead, let's just kill it.

Signed-off-by: Ran Benita <ran234@gmail.com>
2016-12-03 00:22:05 +02:00
Ran Benita 7984a30bbc doc: note that XKB_KEYSYM_CASE_INSENSITIVE does C folding only
and not locale-dependent.

Signed-off-by: Ran Benita <ran234@gmail.com>
2016-12-03 00:02:57 +02:00
Ran Benita b5586a6c42 keysym: fix locale dependence in xkb_keysym_from_name()
We currently use strcasecmp, which is locale-dependent. In particular,
one well-known surprise even if restricted just ASCII input is found in
the tr_TR (Turkish) locale, see e.g.
https://msdn.microsoft.com/en-us/library/ms973919.aspx#stringsinnet20_topic5

We have known to avoid locale-dependent functions before, but in this
case, we forgot.

Fix it by implementing our own simple ASCII-only strcasecmp/strncasecmp.
Might have been possible to use strcasecmp_l() with the C locale, but
went the easy route.

Side advantage is that even this non-optimized version is faster than
the optimized libc one (__strcasecmp_l_sse42) since it doesn't need to
do the locale stuff. xkb_keysym_from_name(), which uses strcasecmp
heavily, becomes faster, and so for example Compose file parsing, which
uses xkb_keysym_from_name() heavily, becomes ~20% faster.

Resolves https://github.com/xkbcommon/libxkbcommon/issues/42
Signed-off-by: Ran Benita <ran234@gmail.com>
2016-12-02 23:46:56 +02:00
Ran Benita 327364d277 utils: rename popcount to avoid conflict in NetBSD
Resolves https://github.com/xkbcommon/libxkbcommon/issues/41
Signed-off-by: Ran Benita <ran234@gmail.com>
2016-11-14 17:37:35 +02:00
Ran Benita d596f6e3ff Bump version to 0.7.0
Signed-off-by: Ran Benita <ran234@gmail.com>
2016-11-11 20:02:41 +02:00
Ran Benita e7f73940b5 Update NEWS
Signed-off-by: Ran Benita <ran234@gmail.com>
2016-11-11 20:01:43 +02:00
Ran Benita 0aa704bc75 Merge pull request #31 from bluetech/consumed-modes
Consumed modifiers modes
2016-10-31 13:07:45 +02:00
Ran Benita babc9e0c30 state: add GTK consumed modifiers mode
This is more or less what is implemented here:
https://git.gnome.org/browse/gtk+/tree/gdk/x11/gdkkeys-x11.c?h=3.19.10#n1131

The implementation here is more technically correct but should provide
the same results.

Try it out with ./test/interactive-evdev -g (modifiers prefixed with "-"
are consumed).

https://bugzilla.gnome.org/show_bug.cgi?id=754110
https://github.com/xkbcommon/libxkbcommon/issues/17

Signed-off-by: Ran Benita <ran234@gmail.com>
2016-10-31 12:52:28 +02:00
Ran Benita a0a41332cc state: allow different modes for calculating consumed modifiers
The current functions dealing with consumed modifiers use the
traditional XKB definition of consumed modifiers (see description in the
added documentation). However, for several users of the library (e.g.
GTK) this definition is unsuitable or too eager. This is exacerbated by
some less-than-ideal xkeyboard-config type definitions (CTRL+ALT seems
to cause most grief...).

So, because we
- want to enable alternative interpretations, but
- don't want to expose too much internal details, and
- want to keep things simple for all library users,
we add a high-level "mode" parameter which selects the desired
interpretation. New ones can be added as long as they make some sense.

All of the old consumed-modifiers functions keep using the traditional
("XKB") mode. I mark xkb_state_mod_mask_remove_consumed() and as
deprecated without adding a *2 variant because I don't it is very useful
(or used) in practice.

Alternative modes are added in subsequent commits (this commit only adds
a mode for the existing behavior).

https://github.com/xkbcommon/libxkbcommon/issues/17

Signed-off-by: Ran Benita <ran234@gmail.com>
2016-10-31 12:52:26 +02:00
Ran Benita 9061171957 utils: add popcount function
Signed-off-by: Ran Benita <ran234@gmail.com>
2016-10-22 20:13:46 +03:00
Ran Benita 914c060a1d test/state: move wrongly-placed assert
Signed-off-by: Ran Benita <ran234@gmail.com>
2016-10-22 20:13:11 +03:00
Ran Benita fe81dcbd2f bench: fix compilation on hurd
Patch by Samuel Thibault.

https://github.com/xkbcommon/libxkbcommon/issues/39

Signed-off-by: Ran Benita <ran234@gmail.com>
2016-09-19 10:09:12 +03:00
Ran Benita 853b7502f4 bench/compose: tabs -> spaces
Signed-off-by: Ran Benita <ran234@gmail.com>
2016-09-16 09:36:27 +03:00
Bryce Harrington af2c83b664 README: Add basic build directions
In particular, highlight the use of configure flags to control locating
X11 keyboard stuff when building for Wayland.

Of particular note, if the locale root is not specified, then xkbcommon
will look for them under $prefix (i.e. /usr/local/share/X11/locale).
But unless the user has specifically installed them there, it is better
to look in the standard system location, /usr/share/X11/locale.

Otherwise, xkbcommon will error when it can't find them, e.g.:

  xkbcommon: ERROR: ~/.XCompose:4:9: failed to expand %L to the locale Compose file
  xkbcommon: ERROR: ~/.XCompose:4:12: unterminated string literal

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Signed-off-by: Ran Benita <ran234@gmail.com>
2016-09-16 09:24:09 +03:00
Bryce Harrington e92e0b88c6 README: Bug *reports* are welcome
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Yong Bakos <ybakos@humanoriented.com>
Signed-off-by: Ran Benita <ran234@gmail.com>
2016-09-16 09:24:04 +03:00
Bryce Harrington ea9a5bcfd7 bench: Check for errors opening Compose file
Otherwise it can segfault e.g. running ./compose inside the bench
directory.

Signed-off-by: Bryce Harrington <bryce@bryceharrington.org>
Signed-off-by: Ran Benita <ran234@gmail.com>
2016-09-16 09:23:43 +03:00
Ran Benita 599fd9ba39 doc/compat: (! MODIFIER) syntax is parsed but ignored
Signed-off-by: Ran Benita <ran234@gmail.com>
2016-09-01 21:23:23 +03:00