summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2016-04-18 13:20:34 -0700
committerMichael Forney <mforney@mforney.org>2016-04-18 13:20:34 -0700
commit078b742f135b0f33e1c5bb27c4df0f5aed878660 (patch)
tree1d7d2876c2379f0b8e1ba6dbf46454ece637d358
parenta4a936154b9cdc881e5224011e6209ee2732b971 (diff)
Add kbd 2.0.3
-rw-r--r--.gitmodules3
-rw-r--r--core/gen.rc1
-rw-r--r--core/kbd/analyze.h10
-rw-r--r--core/kbd/config.h31
-rw-r--r--core/kbd/gen.rc83
m---------core/kbd/src0
-rw-r--r--rules.ninja3
7 files changed, 131 insertions, 0 deletions
diff --git a/.gitmodules b/.gitmodules
index 9aa72eb0..6bcfa973 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -4,6 +4,9 @@
[submodule "core/file/src"]
path = core/file/src
url = https://github.com/file/file
+[submodule "core/kbd/src"]
+ path = core/kbd/src
+ url = https://git.kernel.org/pub/scm/linux/kernel/git/legion/kbd.git
[submodule "core/libfirm/src"]
path = core/libfirm/src
url = http://pp.ipd.kit.edu/git/libfirm.git
diff --git a/core/gen.rc b/core/gen.rc
index 60588478..e6a507ba 100644
--- a/core/gen.rc
+++ b/core/gen.rc
@@ -1,6 +1,7 @@
subgen bzip2
subgen cparser
subgen file
+subgen kbd
subgen libfirm
subgen loksh
subgen openbsd
diff --git a/core/kbd/analyze.h b/core/kbd/analyze.h
new file mode 100644
index 00000000..f0eca1c0
--- /dev/null
+++ b/core/kbd/analyze.h
@@ -0,0 +1,10 @@
+#include <string.h>
+#include "keymap.h"
+
+int stack_push(struct lk_ctx *ctx, lkfile_t *fp, void *scanner);
+int stack_pop(struct lk_ctx *ctx, void *scanner);
+
+typedef void *yyscan_t;
+int yylex_init(yyscan_t *scanner);
+int yylex_init_extra (struct lk_ctx *user_defined, yyscan_t *scanner);
+int yylex_destroy(yyscan_t yyscanner);
diff --git a/core/kbd/config.h b/core/kbd/config.h
new file mode 100644
index 00000000..0931f0c3
--- /dev/null
+++ b/core/kbd/config.h
@@ -0,0 +1,31 @@
+#include <config-posix.h>
+
+#define PACKAGE "kbd"
+#define PACKAGE_BUGREPORT "gladkov.alexey@gmail.com"
+#define PACKAGE_NAME "kbd"
+#define PACKAGE_STRING "kbd 2.0.3"
+#define PACKAGE_TARNAME "kbd"
+#define PACKAGE_URL "http://kbd-project.org/"
+#define PACKAGE_VERSION "2.0.3"
+#define VERSION "2.0.3"
+
+/* features */
+/* #undef ENABLE_NLS */
+
+/* headers */
+#define HAVE_LIBINTL_H 1
+#define HAVE_MEMORY_H 1
+#define HAVE_SYS_DIR_H 1
+#define HAVE_SYS_FILE_H 1
+#define HAVE_SYS_IOCTL_H 1
+/* #undef HAVE_NDIR_H */
+/* #undef HAVE_SYS_NDIR_H */
+
+/* functions */
+#define HAVE_ICONV 1
+#define HAVE_DCGETTEXT 1
+#define HAVE_GETTEXT 1
+
+/* misc */
+#define YYTEXT_POINTER 1
+/* #undef LT_OBJDIR */
diff --git a/core/kbd/gen.rc b/core/kbd/gen.rc
new file mode 100644
index 00000000..3a31628e
--- /dev/null
+++ b/core/kbd/gen.rc
@@ -0,0 +1,83 @@
+cflags\
+ -I include\
+ -I '$dir' \
+ -I '$srcdir' \
+ -I '$srcdir'/src\
+ -I '$srcdir'/src/libkeymap\
+ -I '$srcdir'/src/libkeymap/keymap\
+ -DDATADIR'='\"share\"
+
+lib libcommon.a src/^(getfd.c xmalloc.c kbd_error.c)
+lib libfont.a src/^(kdfontop.c kdmapop.c loadunimap.c psffontop.c utf8.c)
+
+yacc parser '$srcdir'/src/libkeymap/parser.y
+build '$outdir'/parser.h copy '$outdir'/parser.tab.h
+build '$outdir'/analyze.c lex '$srcdir'/src/libkeymap/analyze.l
+
+for(src in '$outdir'/^(analyze.c parser.tab.c)) cc $src '||' '$outdir'/parser.h
+lib libkeymap.a \
+ '$outdir'/^(analyze.c.o parser.tab.c.o)\
+ src/libkeymap/^(\
+ array.c\
+ findfile.c\
+ common.c\
+ kernel.c\
+ dump.c\
+ kmap.c\
+ diacr.c\
+ func.c\
+ summary.c\
+ loadkeys.c\
+ modifiers.c\
+ ksyms.c\
+ )
+
+# old: loadunimap mapscrn
+# optional: clrunmap getunimap setlogcons setvesablank setpalette screendump
+# i386/x86_64 only: resizecons
+# ubase: chvt
+
+fn x {
+ sect=$1
+ exe=$2
+ shift 2
+ exe $exe src/$exe.c $* libcommon.a libfont.a libkeymap.a
+ file bin/$exe '$outdir'/$exe 755
+ if(~ $sect ?~) {
+ sect=`{printf %s $sect | head -c -1}
+ let expr s,@DATADIR@,/share,g --\
+ build '$outdir'/$exe.$sect sed '$srcdir'/docs/man/man$sect/$exe.$sect.in
+ man='$outdir'/$exe.$sect
+ }
+ if not man='$srcdir'/docs/man/man$sect/$exe.$sect
+ if(~ $sect [18]) file share/man/man$sect/$exe.$sect $man 644
+ status=()
+}
+
+x 1 deallocvt
+x 1~ dumpkeys
+x 1 fgconsole
+x 8 getkeycodes
+x 1 kbd_mode
+x - kbdinfo
+x 1~ loadkeys
+x 1 openvt
+x 1 psfxtable
+x 8~ setfont src/mapscrn.c
+x 8 setkeycodes
+x 8 setvtrgb
+x 8 showconsolefont
+x 1 showkey
+
+# keymap data
+cd data
+keymaps=(\
+include sun amiga atari\
+i386/^(azerty bepo dvorak fgGIod qwerty qwertz include olpc colemak)\
+mac/^(include all)\
+)
+for(keymap in keymaps/$keymaps/*) {
+ build '$outdir'/$keymap.gz gzip '$srcdir'/data/$keymap
+ file share/kbd/$keymap.gz '$outdir'/$keymap.gz 644
+}
+sym share/kbd/keymaps/ppc mac
diff --git a/core/kbd/src b/core/kbd/src
new file mode 160000
+Subproject f1cbca04b4b9ae782ed8b4391b682615cb77d99
diff --git a/rules.ninja b/rules.ninja
index 55cd3fc2..66715c8f 100644
--- a/rules.ninja
+++ b/rules.ninja
@@ -24,6 +24,9 @@ rule copy
rule cat
command = cat $in >$out.tmp && mv $out.tmp $out
+rule gzip
+ command = gzip -c -9 -n $in >$out.tmp && mv $out.tmp $out
+
rule lex
command = $lex -t $in >$out.tmp && mv $out.tmp $out