summaryrefslogtreecommitdiff
path: root/src/udev/Makefile.am
diff options
context:
space:
mode:
authorIan Stakenvicius <axs@gentoo.org>2013-07-24 14:00:06 -0400
committerIan Stakenvicius <axs@gentoo.org>2013-07-24 16:27:01 -0400
commit35876baf30ceab34fc16e3fb52763fc0be08f683 (patch)
treeacc96c905d60da830cd4b08b499f50ca4eb901a7 /src/udev/Makefile.am
parent87b69cb04556d5dacae2eb1a9f2122ce5f6a4620 (diff)
Switch from external keymaps to internal (hwdb) keymaps
This commit imports the new internal keyboard handling from upstream. This is a combination of many upstream commits, including those that added code, removed old code, and updated the hwdb. Some commits (hwdb ones specifically) were unrelated but brought in anyways to keep the whole hwdb consistent. Each upstream commit included is as follows: 9d7d42bc406a2ac04639674281ce3ff6beeda790 - internal keymap support 0c959b39175b126fdb70ae00de37ca6d9c8ca3a1 - hwdb: keyboard -- add file e8193554925a22b63bef0e77b8397b56d63a91ff - hwdb: keyboard -- update comments c79d894d590fc9df4861738555cc43c477e33376 - hwdb: import data aedc2eddd16e48d468e6ad0aea2caf00c7d37365 - hwdb: keyboard update 97a9313cafccf772ce03f5ebd36fe4d9d8412583 - hwdb: drop non-existant Samsung 900XC3 from keymap ddc77f62244bb41d5c8261517e2e1ff1b763fc94 - switch from udev keymaps to hwdb 0c3815773331b263713f4f7b9d80bc1ca159338e - also remove keymaps-force-release directory 1b6bce89b3383904d0dab619dd38bff673f7286e - keymap: re-add Logitech USB corded/cordless models bf89b99c5a39115112c2eda4c2103e2db54988d2 - 60-keyboard.hwdb: Fix syntax error ce39bb6909578017aa10031638e724e038f0b859 - hwdb: data update, upstream 884c86812c51479496edd50b278383d7bb67baf0 - rules: keyboard - use builtin command All code from each of the above commits is attributed to the original authors. There were some adjustments made in order to support the code differences between upstream and eudev, which was done by myself. Also of note is that the code can still be disabled via the --disable-keymaps configure option, which was removed from upstream. Signed-off-by: Ian Stakenvicius <axs@gentoo.org>
Diffstat (limited to 'src/udev/Makefile.am')
-rw-r--r--src/udev/Makefile.am35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/udev/Makefile.am b/src/udev/Makefile.am
index 2bceb0c698..4a5f5fefa5 100644
--- a/src/udev/Makefile.am
+++ b/src/udev/Makefile.am
@@ -117,6 +117,41 @@ EXTRA_DIST = \
CLEANFILES = \
udev.pc
+if ENABLE_KEYMAP
+AM_CPPFLAGS += \
+ -I $(top_builddir)/src/udev
+
+libudev_core_la_SOURCES += \
+ udev-builtin-keyboard.c
+
+nodist_libudev_core_la_SOURCES = \
+ keyboard-keys-from-name.h \
+ keyboard-keys-to-name.h
+
+keyboard-keys.txt: Makefile
+ $(AM_V_at)$(MKDIR_P) $(dir $@)
+ $(AM_V_GEN)$(CPP) $(CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) -dM -include linux/input.h - < /dev/null | $(AWK) '/^#define[ \t]+KEY_[^ ]+[ \t]+[0-9]/ { if ($$2 != "KEY_MAX") { print $$2 } }' | sed 's/^KEY_COFFEE$$/KEY_SCREENLOCK/' > $@
+
+keyboard-keys-from-name.gperf: keyboard-keys.txt Makefile
+ $(AM_V_GEN)$(AWK) 'BEGIN{ print "struct key { const char* name; unsigned short id; };"; print "%null-strings"; print "%%";} { print tolower(substr($$1 ,5)) ", " $$1 }' < $< > $@
+
+keyboard-keys-from-name.h: keyboard-keys-from-name.gperf Makefile
+ $(AM_V_GPERF)$(GPERF) -L ANSI-C -t -N keyboard_lookup_key -H hash_key_name -p -C < $< > $@
+
+keyboard-keys-to-name.h: keyboard-keys.txt Makefile
+ $(AM_V_GEN)$(AWK) 'BEGIN{ print "const char* const key_names[KEY_CNT] = { "} { print "[" $$1 "] = \"" $$1 "\"," } END{print "};"}' < $< > $@
+
+
+BUILT_SOURCES = \
+ $(nodist_libudev_core_la_SOURCES)
+
+CLEANFILES += \
+ keyboard-keys-from-name.gperf \
+ keyboard-keys.txt \
+ $(BUILT_SOURCES)
+
+endif
+
# install udevadm symlink in sbindir
install-exec-hook:
if test "$(bindir)" != "$(sbindir)"; then \