summaryrefslogtreecommitdiff
path: root/Makefile.am
diff options
context:
space:
mode:
authorRan Benita <ran234@gmail.com>2017-07-29 13:54:02 +0300
committerRan Benita <ran234@gmail.com>2017-07-31 15:55:48 +0300
commit00b08eae826f1ef6b7d87308d5da603736126ea8 (patch)
tree4ff59ad71e33d6abbe098377486b5857926f9181 /Makefile.am
parentd44ba481d7a22310f5345cc90f7ba66928006f40 (diff)
downloadxorg-lib-libxkbcommon-00b08eae826f1ef6b7d87308d5da603736126ea8.tar.gz
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>
Diffstat (limited to 'Makefile.am')
-rw-r--r--Makefile.am23
1 files changed, 4 insertions, 19 deletions
diff --git a/Makefile.am b/Makefile.am
index be5abc1..0501997 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -5,6 +5,7 @@ pkgconfig_DATA = xkbcommon.pc
EXTRA_DIST = \
makekeys.py \
+ makeheader.py \
src/xkbcomp/keywords.gperf \
test/data \
README.md \
@@ -317,26 +318,10 @@ bench_compose_LDADD = $(BENCH_LDADD)
# Custom targets
##
-# This sed script strips out lines that start with '#define _' which
-# removes #define _OSF_Keysyms and such. The XK_Ydiaeresis case is to
-# handle a duplicate definition in HPkeysyms.h which kicks in if it's
-# not already defined.
-X11_INCLUDEDIR = /usr/include/X11
-KEYSYMDEFS = \
- $(X11_INCLUDEDIR)/keysymdef.h \
- $(X11_INCLUDEDIR)/XF86keysym.h \
- $(X11_INCLUDEDIR)/Sunkeysym.h \
- $(X11_INCLUDEDIR)/DECkeysym.h \
- $(X11_INCLUDEDIR)/HPkeysym.h
+# Run this to regenerate xkbcommon-keysyms.h from the X11 headers
+# defining the keysyms and update the name <-> keysym mapping.
update-keysyms:
- echo -en '#ifndef _XKBCOMMON_KEYSYMS_H\n#define _XKBCOMMON_KEYSYMS_H\n\n' > $(top_srcdir)/xkbcommon/xkbcommon-keysyms.h
- echo -en '/* This file is autogenerated from Makefile.am; please do not commit directly. */\n\n' >> $(top_srcdir)/xkbcommon/xkbcommon-keysyms.h
- echo -en '#define XKB_KEY_NoSymbol 0x000000 /* Special KeySym */\n\n' >> $(top_srcdir)/xkbcommon/xkbcommon-keysyms.h
- sed -e '/XK_Ydiaeresis\s*0x100000ee/d' \
- -e '/#define _/d' \
- -e 's/#define\s*\(\w*\)XK_/#define XKB_KEY_\1/' \
- -e '/\(#ifdef\|#ifndef\|#endif\)/d' $(KEYSYMDEFS) >> $(top_srcdir)/xkbcommon/xkbcommon-keysyms.h
- echo -en '\n\n#endif\n' >> $(top_srcdir)/xkbcommon/xkbcommon-keysyms.h
+ LC_CTYPE=C python $(top_srcdir)/makeheader.py > $(top_srcdir)/xkbcommon/xkbcommon-keysyms.h
LC_CTYPE=C python $(top_srcdir)/makekeys.py $(top_srcdir)/xkbcommon/xkbcommon-keysyms.h > $(top_srcdir)/src/ks_tables.h
# Run this if you add/remove a new keyword to the xkbcomp scanner,