Commit Graph

1652 Commits (5eeba0fe0da70b7cb1ac17ef0b606058e07c64ea)

Author SHA1 Message Date
Ran Benita 5eeba0fe0d build/meson: require meson >= 0.41.0
With previous versions, the compilation fails with linker errors.

Fixes https://github.com/xkbcommon/libxkbcommon/issues/52
Reported-by: @rezso
Signed-off-by: Ran Benita <ran234@gmail.com>
2017-09-10 09:18:54 +03:00
Ran Benita 41f1018897 expr: paper over a maybe-uninitialized warning
Signed-off-by: Ran Benita <ran234@gmail.com>
2017-09-08 12:16:13 +03:00
Ran Benita 14686cd1a8 test/interactive-wayland: avoid unused function warning due to configuration
test/interactive-wayland.c:95:1: warning: ‘set_cloexec_or_close’ defined but not used [-Wunused-function]

Signed-off-by: Ran Benita <ran234@gmail.com>
2017-08-16 20:24:27 +03:00
Ran Benita 76348754e3 build: add missing configure function checks for test/interactive-wayland
Signed-off-by: Ran Benita <ran234@gmail.com>
2017-08-16 20:23:54 +03:00
Ran Benita f468f0b243 xkbcommon-compose.h: change recommended locale fallback code to treat empty string same as unset
The previous code would cause failures to find the Compose file if one
of the environment variables LC_ALL, LC_CTYPE or LANG are set to the
empty string.

The description of the fallback procedure in loclale(7) talks about
"non-null environment variable"; I interpreted this to mean the
environment variable is unset, but it actually means unset or empty (I
verified this by looking at what glibc and musl do).

A recent bug in systemd https://github.com/systemd/systemd/issues/6407
exposed this issue. It causes these these variables to be set to the
empty string in TTY sessions.

Reported by "doodoo" in https://bbs.archlinux.org/viewtopic.php?id=228658

Signed-off-by: Ran Benita <ran234@gmail.com>
2017-08-13 18:03:57 +03:00
Ran Benita ba9568bdb1 Bump version to 0.7.2
Signed-off-by: Ran Benita <ran234@gmail.com>
2017-08-04 16:28:36 +03:00
Ran Benita c99f6a5821 Update NEWS
Signed-off-by: Ran Benita <ran234@gmail.com>
2017-08-04 16:28:14 +03:00
Ran Benita 5c2da7795c build/autotools: fix doc installation
Signed-off-by: Ran Benita <ran234@gmail.com>
2017-08-04 15:43:13 +03:00
Ran Benita fbd86e44ad test/symbols-leak-test.bash: make it easier to read
Signed-off-by: Ran Benita <ran234@gmail.com>
2017-08-03 13:38:14 +03:00
Ran Benita 2a16c3c482 build/autotools: fix symbol versioning configure check
Regressed in 4309735. I thought `$top_srcdir` works in configure too,
apparently not!

See: https://github.com/xkbcommon/libxkbcommon/issues/50#issuecomment-319693694

Signed-off-by: Ran Benita <ran234@gmail.com>
2017-08-02 18:34:29 +03:00
Ran Benita c665b45011 build/autotools: make doxygen's input relative
Was meant to be a part of 41bea9a.

Signed-off-by: Ran Benita <ran234@gmail.com>
2017-08-02 18:26:19 +03:00
Ran Benita cd642b27ac build/autotools: dist the meson build files
So that it's possible to build with meson from autotools-generated
tarballs.

Signed-off-by: Ran Benita <ran234@gmail.com>
2017-08-01 23:36:33 +03:00
Ran Benita fd82b89eb9 build/autotools: install documentation under html/
To be consistent with the meson build; also makes more sense as doxygen
can generate more than html (though we currently are not doing that).

Signed-off-by: Ran Benita <ran234@gmail.com>
2017-08-01 23:35:22 +03:00
Ran Benita 41bea9ab2b build: make doxygen run from the source tree
I couldn't find any other way to make this work!

Signed-off-by: Ran Benita <ran234@gmail.com>
2017-08-01 23:32:15 +03:00
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