speakup: Fix building as extmod

spk_priv_keyinfo.h should be opened from the speakup directory. When
building as extmod we should thus open it from the module directory
rather than the main Linux source.

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Link: https://lore.kernel.org/r/20221118012206.j6hq6b6nfx2jhqg6@begin
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Samuel Thibault 2022-11-18 02:22:06 +01:00 committed by Greg Kroah-Hartman
parent 27158c7267
commit e68a558fb2
2 changed files with 8 additions and 3 deletions

View File

@ -40,7 +40,9 @@ hostprogs += makemapdata
makemapdata-objs := makemapdata.o makemapdata-objs := makemapdata.o
quiet_cmd_mkmap = MKMAP $@ quiet_cmd_mkmap = MKMAP $@
cmd_mkmap = TOPDIR=$(srctree) $(obj)/makemapdata > $@ cmd_mkmap = TOPDIR=$(srctree) \
SPKDIR=$(if $(KBUILD_EXTMOD),$(KBUILD_EXTMOD),$(srctree)/drivers/accessibility/speakup) \
$(obj)/makemapdata > $@
$(obj)/mapdata.h: $(obj)/makemapdata $(obj)/mapdata.h: $(obj)/makemapdata
$(call cmd,mkmap) $(call cmd,mkmap)

View File

@ -51,12 +51,15 @@ main(int argc, char *argv[])
{ {
int value, i; int value, i;
struct st_key *this; struct st_key *this;
const char *dir_name; const char *dir_name, *spk_dir_name;
char *cp; char *cp;
dir_name = getenv("TOPDIR"); dir_name = getenv("TOPDIR");
if (!dir_name) if (!dir_name)
dir_name = "."; dir_name = ".";
spk_dir_name = getenv("SPKDIR");
if (!spk_dir_name)
spk_dir_name = "drivers/accessibility/speakup";
bzero(key_table, sizeof(key_table)); bzero(key_table, sizeof(key_table));
add_key("shift", 1, is_shift); add_key("shift", 1, is_shift);
add_key("altgr", 2, is_shift); add_key("altgr", 2, is_shift);
@ -83,7 +86,7 @@ main(int argc, char *argv[])
add_key(def_name, value, is_input); add_key(def_name, value, is_input);
} }
open_input(dir_name, "drivers/accessibility/speakup/spk_priv_keyinfo.h"); open_input(spk_dir_name, "spk_priv_keyinfo.h");
while (get_define()) { while (get_define()) {
if (strlen(def_val) > 5) { if (strlen(def_val) > 5) {
//if (def_val[0] == '(') //if (def_val[0] == '(')