Commit Graph

76 Commits (e4bceec8809f2563af6786678442fa70d4cd728c)

Author SHA1 Message Date
Ran Benita e4bceec880 utils: add {un,}map_file to read an entire file
This wraps the current mmap call and adds a fallback implementation for
systems which do not have mmap (e.g. mingw).

Signed-off-by: Ran Benita <ran234@gmail.com>
2013-04-01 18:20:56 +01:00
Daniel Stone 27a11762ab Bump version to 0.3.0
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2013-04-01 18:04:06 +01:00
Daniel Stone fbe5e6751e Add environment overrides for default RMLVO
You can now set default values in the environment, as well as a context
option to ignore the environment, e.g. for tests.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2013-03-19 10:53:37 +00:00
Ran Benita a7b1f80d34 Build cleanly with clang
clang doesn't like the use of typeof with out default flags, so just
don't use it.

Signed-off-by: Ran Benita <ran234@gmail.com>
2013-03-18 22:20:04 +00:00
Ran Benita 79329e1022 Don't try to build linux-specific tests on non-linux
Some tests use linux/input.h (and epoll), but we're building on some
other kernels (e.g. debian freebsd). We could just copy the file but
it's GPL. We could also skip the tests (exit code 77) but it doesn't
really matter.

Signed-off-by: Ran Benita <ran234@gmail.com>
2013-03-18 22:20:04 +00:00
Ran Benita 2b352c11dd Makefile.am: don't create INSTALL and ChangeLog
It may be xorg standard but it's completely useless and clutter the
directory.

Signed-off-by: Ran Benita <ran234@gmail.com>
2013-03-18 22:20:03 +00:00
Ran Benita 3d731eba5c configure.ac: add xkbcommon.com url to AC_INIT
Why not.
Also forgot to update the xorg-utils error message when bumping the
requirement.

Signed-off-by: Ran Benita <ran234@gmail.com>

[daniels: Changed to xkbcommon.org.]
2012-12-13 14:02:12 +00:00
Daniel Stone 324d4dbd99 Only distribute .tar.xz archives
We definitely don't need .gz anymore, and .bz2 seems on its way out.
Mirror what Wayland does, and move to .xz exclusively.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-11-09 14:26:49 +11:00
Damien Lespiau 860fb171a9 build: Require xorg macros 1.16
For XORG_TESTSET_CFLAG and XORG_MEMORY_CHECK_FLAGS.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Cc: Daniel Stone <daniel@fooishbar.org>
2012-10-30 15:08:14 +02:00
Ran Benita 0a5e9d90e7 configure.ac: don't tramp on user's CFLAGS
The configure test shouldn't touch CFLAGS, because they come last on the
command line and allow to users to override settings if needed.

Signed-off-by: Ran Benita <ran234@gmail.com>
2012-10-26 14:43:15 +02:00
Ran Benita a851ef1ed9 configure.ac: add explicit PKG_PROG_PKG_CONFIG
We still use pkg-config to get the xkb_base variable from
xkeyboard-config, but we removed all of the other PKG_ macro calls. This
still works now, because XORG_DEFAULT_OPTIONS runs it somehow. But we
shouldn't rely on it.

Signed-off-by: Ran Benita <ran234@gmail.com>
2012-10-26 14:25:17 +02:00
Daniel Stone 5be22ad641 Bump to 0.2.0
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-10-24 03:13:46 +11:00
Ran Benita 5d9a5cb003 Commit and distribute ks_tables.h
The ks_tables.h file is generated by makekeys.py from
xkbcommon-keysyms.h, which in turn is generated initially by 'make
update-keysyms'. The xkbcommon-keysyms.h file is commited to git and
distributed in the tarball. Since ks_tables.h should only ever change
when xkbcommon-keysyms.h changes, it is more sensible to update them
together and treat them the same, instead of generating ks_tables.h
every time for every builder with 'make', as we do now.

This means we don't need python as a build dependency (only the one
running update-keysyms, i.e. no one, needs this), and we can be
sure exactly the same file is used by everyone. We also don't need to
run makekeys.py on every build.

Signed-off-by: Ran Benita <ran234@gmail.com>
2012-10-17 20:09:09 +02:00
Ran Benita 5fff637e07 makekeys: replace helper with python script and binary search
This removes the complicated and undocumented hash-table creation-helper
and replaces it with an autogenerated sorted array. The search uses simple
bsearch() now.

We also tried using gperf but it turned out to generate way to big
hashtables and when reducing the size it isn't really faster than
bsearch() anymore.

There are no users complaining about the speed of keysym lookups and we
have no benchmarks that tell that we are horribly slow. Hence, we can
safely use the simpler approach and drop all that old code.

Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-16 21:10:04 +02:00
Ran Benita a86fa17aeb build: change to AM_MAINTAINER_MODE([enable])
Disabled maintainer mode is annoying, we have no reason to do it. The
old behavior can still be had with --disable-maintainer-mode.
See:
http://lists.x.org/archives/xorg-devel/2012-September/033757.html
http://www.gnu.org/savannah-checkouts/gnu/automake/manual/html_node/maintainer_002dmode.html

Signed-off-by: Ran Benita <ran234@gmail.com>
2012-10-10 21:01:15 +02:00
Ran Benita 108fa1c793 Add support for building doxygen API documentation
Simple HTML docs generated from the doxygen comments.
After running 'make' or 'make doc', try firefox doc/html/index.html to
see it (if you have doxygen). It's also installed with 'make install'.
You can use --enable-docs or --disable-docs, or specifically
--with-doxygen or --without-doxygen (autodetected, default yes).

The docs are currently not distributed in the tarball, because I
couldn't make it work properly in all cases :/

Signed-off-by: Ran Benita <ran234@gmail.com>
2012-09-24 09:13:32 +10:00
Ran Benita 70a82afa73 configure.ac: use XORG_TESTSET_CFLAG for -fvisibility=hidden
Probably shouldn't use CFLAGS for that but o well.

Signed-off-by: Ran Benita <ran234@gmail.com>
2012-09-24 09:08:54 +10:00
Ran Benita 18a433223e configure.ac: add XORG_MEMORY_CHECK_FLAGS
Adds some memory checking (e.g. MALLOC_PERTURB_) to tests.

Signed-off-by: Ran Benita <ran234@gmail.com>
2012-09-24 09:08:54 +10:00
Ran Benita 414007ca67 configure.ac: remove XORG_CHECK_MALLOC_ZERO
We don't use its result.

Signed-off-by: Ran Benita <ran234@gmail.com>
2012-09-24 09:08:53 +10:00
Ran Benita 31c7427209 configure.ac: fix bug report url
Signed-off-by: Ran Benita <ran234@gmail.com>
2012-09-24 09:08:53 +10:00
Daniel Stone 28bd10cee7 kbproto unentanglement: drop dependency
\o\ \o/ /o/

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-09-11 14:10:41 +01:00
Daniel Stone 04253fb2eb Add support for default rules/model/layout
Right now it just comes from build-time, but eventually this should be
sourced from configuration files at runtime too.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-08-08 13:30:24 +02:00
Ran Benita 4c00278c82 Remove xproto build dependency
Very little left to do for this.

Signed-off-by: Ran Benita <ran234@gmail.com>
2012-08-07 13:20:37 +03:00
Ran Benita 9baf62f307 Remove configure check for X11 keysym files
Since every user building the library, even from git, doesn't need these
files anymore, there's no need to check for them (this goes for makekeys
as well).

The only remaining user is the update-keysyms target, but whoever will
run it again (if ever) will probably know what he's doing (at least
enough to run git diff before git commit). And the defaults should be
fine too.

Signed-off-by: Ran Benita <ran234@gmail.com>
2012-06-09 12:34:57 +03:00
Ran Benita c815ff96d9 Import darray.h for common dynamic array code
Signed-off-by: Ran Benita <ran234@gmail.com>
2012-05-22 14:19:23 +03:00
Ran Benita 869c687190 rules: add test
Add a non-extensive test to check that some basic things (e.g. rule
matching, var substitution, indexes and groups) work as expected.

Signed-off-by: Ran Benita <ran234@gmail.com>
2012-05-20 20:31:49 +03:00
Ran Benita ab82e0ebc3 Fix configure check for xkbparse.c instead of parser.c
This obscure test is easy to miss.

Signed-off-by: Ran Benita <ran234@gmail.com>
2012-05-18 20:54:32 +03:00
Pekka Paalanen 8ca8f05aab Add xkbcommon-uninstalled.pc 2012-05-18 01:05:14 +01:00
Pekka Paalanen 8bdef139a6 Use eaccess() only if available
Fixes build on Android.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-05-18 01:05:14 +01:00
Pekka Paalanen bdbb3ac455 makekeys: fix cross-compilation
makekeys must be built with the build-native compiler, not with $(CC)
which is the cross-compiler. The only sane way to achieve this seems to
be to use a separate Makefile.am for it.

This patch fixes the problem apparently caused by:

commit b5efe41f19
Author: Ran Benita <ran234@gmail.com>
Date:   Sat Mar 24 04:48:31 2012 +0200

    Make build non-recursive

There is no such thing as makekeys_makekeys_CC in automake.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-05-09 15:24:50 +01:00
Daniel Stone 9797c918ca Use AC_ARG_VAR for X11 header and XKB paths
And don't call pkg-config unless we need to.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-07 17:30:47 +01:00
Ran Benita 522be162b2 Use LT_INIT instead of deprecated AC_PROG_LIBTOOL
And add some warnings to the autoreconf step, for the developers to
see.

Signed-off-by: Ran Benita <ran234@gmail.com>
2012-04-30 17:06:15 +01:00
Ran Benita 4b49e0a117 Overhaul test suite
Rewrite all of the current tests in the following ways:
- Instead of the current mix of C and shell, just use single-process
  pure C file per test. All of the .sh files are removed, but everything
  that was tested is ported.
- Instead of handling the test logs ourselves, use Automake's
  "parallel-test" mechanism. This will create a single log file for each
  test with it's stdout+stderr, and a top level "test-suite.log" file
  for all the failed tests.
- The "parallel-tests" directive also makes the test run in parallel,
  so "make check" runs faster.
- Also use the "color-tests" directive to have the "make check" output
  colorized. Who doesn't like to see PASS in green?
- All of the test data files are moved into the test/data subdirectory.
  That way we can just put the directory in EXTRA_DIST and forget about
  it.
- The test/Makefile.am file is consolidated into the main Makefile.am,
  for a completely non-recursive build.

Right now the tests are completely independent and just use simple
assert()'s. More sophistication can be added as needed.

It should also be noted that it's still possible to use shell, python,
etc. if a test wants more flexibility than C can provide, just do as
before.

Signed-off-by: Ran Benita <ran234@gmail.com>

[daniels: Updated for xkb_keymap changes.]
2012-04-09 14:21:47 +01:00
Ran Benita 518debb3bc Set xorg-macros CFLAGS correctly
A previous commit messed up all warning flags. Oops.

Signed-off-by: Ran Benita <ran234@gmail.com>
2012-04-09 13:52:38 +01:00
Daniel Stone bc872252f3 Use xorg CFLAGS and fix AC_USE_SYSTEM_EXTENSIONS
autotools was warning that AC_USE_SYSTEM_EXTENSIONS was being called too
late, so move it earlier.  Also shove BASE_CFLAGS into CFLAGS so we get
all the added warning flags from xorg.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-04-09 13:47:23 +01:00
Daniel Stone 3e9dd7512c Add new context API
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-03-27 16:59:01 +01:00
Ran Benita b5efe41f19 Make build non-recursive
Unify all the different Makefile.am into a single short top level one
(the test/Makefile.am file is left intact though).

This makes the build system simpler to look and should encourage
unifying more currently-disparate code.

Some further motivation can be found in this page:
http://www.flameeyes.eu/autotools-mythbuster/automake/nonrecursive.html

Signed-off-by: Ran Benita <ran234@gmail.com>
2012-03-27 14:17:34 +01:00
Daniel Stone 2ac8610fad Remove fallback strcasecmp/strncasecmp
Sorry if your libc doesn't have this, but it's not my problem.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reported-by: Ran Benita <ran234@gmail.com>
2012-03-27 14:06:56 +01:00
Ran Benita ad4f195eb4 makekeys: Receive the keysym files as arguments
Signed-off-by: Ran Benita <ran234@gmail.com>
2012-02-26 21:09:37 +02:00
Kristian Høgsberg 9dd7dc6d88 configure: Lower kbproto requirement to 1.0.4
There's nothing in 1.0.5 that we need.
2011-03-18 00:33:48 -04:00
Kristian Høgsberg dd0e8b70fb Revert "config: remove incorrectly implemented visibility compiler option"
This reverts commit bf9fdceef6.

We really only want to expose symbols that we explicitly mark as part of
the API.  This may not work with other platforms or compilers, but the
fact that private symbols are not available on Linux+GCC is enough of an
incentive to not use those.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
2011-01-29 14:11:36 -05:00
Gaetan Nadon 1b6e022c97 config: set the default xkb config root based on xkeyboard-config module
The default value ${dataroot}/X11/xkb only works if xkeyboard-config
has created the keymaps in that directory. Let's obtain the true final
value of where the keymaps are and use that as a default. In a production
environment this is the only value that can work.

This new default value also has the merit of making the 'check' target
to work in distcheck which does not have a copy of the xkeyboard-config
keymaps in its sandbox based on ${dataroot}/X11/xkb. The test data
cannot find the "include" keymaps it needs.
.../libxkbcommon-0.1.0/_inst/share/X11/xkb

Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
2010-12-18 11:19:57 -05:00
Gaetan Nadon 69e52ad901 config: makekeys prog should stand alone in the makekeys directory
This program is a utility to generated a header file.
The header file it generates should not be located in the
directory where this utility program is compiled.

Move the /makekeys dir as a sibling of /src.
This reduces the number of bi-directional relationships
between directories.

Make corresponding makefiles simplifications.

Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
2010-12-18 11:19:56 -05:00
Gaetan Nadon 89377d5cd1 config: use existing variables KEYSYMDEF_H and XF86KEYSYM_H
These automake variables are not currently used.
The variable KS_HEADERS is not required anymore.

Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
2010-12-18 11:19:56 -05:00
Gaetan Nadon bf9fdceef6 config: remove incorrectly implemented visibility compiler option
CFLAGS is a user variable which should never be set by the configuration.
It allows the user to alter the configuration compiler options.

The visibility is only set for GNU compiler, leaving libraries built
with other compilers with the wrong visibility.

All other xorg libraries set visibilty using _X_EXPORT or _X_HIDDEN.

For the time being, all the symbols will have the default visibility
which does not break anything.

Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
2010-12-18 11:19:56 -05:00
Gaetan Nadon ec3fbfdf6d config: use xproto pkgconfig includex11dir variable
Rather than appending X11 to the include dir.
It should be safe to use as it has been added in 2005.

Use a local variable name matching the pkgconfig name.

Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
2010-12-18 11:19:56 -05:00
Gaetan Nadon 3c570b7ce9 config: relocate library functions check and comment
No functional changes.
Follow Automake suggested order.

Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
2010-12-18 11:19:56 -05:00
Gaetan Nadon 41664ba237 config: remove PKG_PROG_PKG_CONFIG test
If pkg-config is missing, the configuration fails while initializing
XORG_* macros:

warning: PKG_PROG_PKG_CONFIG is m4_require'd but not m4_defun'd
line 11622: PKG_PROG_PKG_CONFIG: command not found

The output is sufficient to locate the problem.
It is not possible, or very difficult, to not have pkg-config
installed as the whole desktop and countless other software
depends on it.

Acked-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
2010-12-08 15:24:21 -05:00
Gaetan Nadon e2f9f51667 config: allow to build tarball when yacc is missing
Autoconf does not handle this scenario as well as Automake does.
If xkbparse.c is already there, do not abort the configuration
if yacc is missing as it is not needed.

If both xkbparse.c and yacc are missing, abort configuration.
Yacc is a required tool to build the package.

Acked-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
2010-12-08 15:24:21 -05:00
Gaetan Nadon 83f64da993 config: remove AC_PROG_CC as it overrides AC_PROG_C_C99
XORG_STRICT_OPTION from XORG_DEFAULT_OPTIONS calls
AC_PROG_C_C99. This sets gcc with -std=gnu99.
If AC_PROG_CC macro is called afterwards, it resets CC to gcc.

Acked-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
2010-12-07 09:47:32 -05:00