Generate keysym tables from X and XF86 keysym definitions The keysym hash table ks_tables.h is generated by makekeys from keysymdef.h and XF86keysym.h.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
diff --git a/configure.ac b/configure.ac
index 90eec9e..d0f1735 100644
--- a/configure.ac
+++ b/configure.ac
@@ -49,6 +49,23 @@ fi
PKG_CHECK_MODULES([X11], [xproto])
+dnl Ensure we have keysym headers
+AC_MSG_CHECKING([for X11 includedir])
+x11includedir="`$PKG_CONFIG --variable=includedir xproto`/X11"
+AC_MSG_RESULT([$x11includedir])
+
+AC_MSG_CHECKING([for keysymdef.h])
+KEYSYMDEF_H="$x11includedir/keysymdef.h"
+test -f "$KEYSYMDEF_H" || AC_MSG_ERROR([can't locate keysymdef.h in $x11includedir])
+AC_MSG_RESULT([$KEYSYMDEF_H])
+AC_SUBST([KEYSYMDEF_H])
+
+AC_MSG_CHECKING([for XF86keysym.h])
+XF86KEYSYM_H="$x11includedir/XF86keysym.h"
+test -f "$XF86KEYSYM_H" || AC_MSG_ERROR([can't locate XF86keysym.h in $x11includedir])
+AC_MSG_RESULT([$XF86KEYSYM_H])
+AC_SUBST([XF86KEYSYM_H])
+
# Require xorg-macros version 1.2.0 or newer for XORG_CHANGELOG macro
m4_ifndef([XORG_MACROS_VERSION],
[m4_fatal([must install xorg-macros before running autoconf/autogen.sh])])
diff --git a/src/.gitignore b/src/.gitignore
index 2bdb5e0..6251fb4 100644
--- a/src/.gitignore
+++ b/src/.gitignore
@@ -1 +1,2 @@
+ks_tables.h
makekeys
diff --git a/src/Makefile.am b/src/Makefile.am
index 53f1911..85cddbd 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,3 +1,9 @@
noinst_PROGRAMS = makekeys
makekeys_CFLAGS = $(X11_CFLAGS)
makekeys: CC = $(CC_FOR_BUILD)
+
+#BUILT_SOURCES = ks_tables.h
+noinst_HEADERS = ks_tables.h
+ks_tables.h: makekeys
+ @rm -f $@
+ cat $(KEYSYMDEF_H) $(XF86KEYSYM_H) | $(builddir)/makekeys$(EXEEXT) >$@