aboutsummaryrefslogtreecommitdiff
path: root/pc-bios
diff options
context:
space:
mode:
Diffstat (limited to 'pc-bios')
-rw-r--r--pc-bios/keymaps/.gitignore1
-rw-r--r--pc-bios/keymaps/Makefile56
-rw-r--r--pc-bios/keymaps/meson.build56
-rw-r--r--pc-bios/meson.build1
4 files changed, 58 insertions, 56 deletions
diff --git a/pc-bios/keymaps/.gitignore b/pc-bios/keymaps/.gitignore
new file mode 100644
index 0000000000..f90738f4dc
--- /dev/null
+++ b/pc-bios/keymaps/.gitignore
@@ -0,0 +1 @@
+/*.stamp
diff --git a/pc-bios/keymaps/Makefile b/pc-bios/keymaps/Makefile
deleted file mode 100644
index 76217b0689..0000000000
--- a/pc-bios/keymaps/Makefile
+++ /dev/null
@@ -1,56 +0,0 @@
-
-KEYMAP := $(shell which qemu-keymap 2>/dev/null)
-
-MAPS := ar bepo cz da de de-ch en-us en-gb es et fi fo \
- fr fr-be fr-ca fr-ch \
- hr hu is it ja lt lv mk nl no pl pt pt-br ru th tr
-
-ar : MAP_FLAGS := -l ar
-bepo : MAP_FLAGS := -l fr -v dvorak
-cz : MAP_FLAGS := -l cz
-da : MAP_FLAGS := -l dk
-de : MAP_FLAGS := -l de -v nodeadkeys
-de-ch : MAP_FLAGS := -l ch
-en-us : MAP_FLAGS := -l us
-en-gb : MAP_FLAGS := -l gb
-es : MAP_FLAGS := -l es
-et : MAP_FLAGS := -l et
-fi : MAP_FLAGS := -l fi
-fo : MAP_FLAGS := -l fo
-fr : MAP_FLAGS := -l fr -v nodeadkeys
-fr-be : MAP_FLAGS := -l be
-fr-ca : MAP_FLAGS := -l ca -v fr
-fr-ch : MAP_FLAGS := -l ch -v fr
-hr : MAP_FLAGS := -l hr
-hu : MAP_FLAGS := -l hu
-is : MAP_FLAGS := -l is
-it : MAP_FLAGS := -l it
-ja : MAP_FLAGS := -l jp -m jp106
-lt : MAP_FLAGS := -l lt
-lv : MAP_FLAGS := -l lv
-mk : MAP_FLAGS := -l mk
-nl : MAP_FLAGS := -l nl
-no : MAP_FLAGS := -l no
-pl : MAP_FLAGS := -l pl
-pt : MAP_FLAGS := -l pt
-pt-br : MAP_FLAGS := -l br
-ru : MAP_FLAGS := -l ru
-th : MAP_FLAGS := -l th
-tr : MAP_FLAGS := -l tr
-
-ifeq ($(KEYMAP),)
-
-all:
- @echo "nothing to do (qemu-keymap not found)"
-
-else
-
-all: $(MAPS)
-
-clean:
- rm -f $(MAPS)
-
-$(MAPS): $(KEYMAP) Makefile
- $(KEYMAP) -f $@ $(MAP_FLAGS)
-
-endif
diff --git a/pc-bios/keymaps/meson.build b/pc-bios/keymaps/meson.build
new file mode 100644
index 0000000000..b737c82230
--- /dev/null
+++ b/pc-bios/keymaps/meson.build
@@ -0,0 +1,56 @@
+keymaps = {
+ 'ar': '-l ar',
+ 'bepo': '-l fr -v dvorak',
+ 'cz': '-l cz',
+ 'da': '-l dk',
+ 'de': '-l de -v nodeadkeys',
+ 'de-ch': '-l ch',
+ 'en-gb': '-l gb',
+ 'en-us': '-l us',
+ 'es': '-l es',
+ 'et': '-l et',
+ 'fi': '-l fi',
+ 'fo': '-l fo',
+ 'fr': '-l fr -v nodeadkeys',
+ 'fr-be': '-l be',
+ 'fr-ca': '-l ca -v fr',
+ 'fr-ch': '-l ch -v fr',
+ 'hr': '-l hr',
+ 'hu': '-l hu',
+ 'is': '-l is',
+ 'it': '-l it',
+ 'ja': '-l jp -m jp106',
+ 'lt': '-l lt',
+ 'lv': '-l lv',
+ 'mk': '-l mk',
+ 'nl': '-l nl',
+ 'no': '-l no',
+ 'pl': '-l pl',
+ 'pt': '-l pt',
+ 'pt-br': '-l br',
+ 'ru': '-l ru',
+ 'th': '-l th',
+ 'tr': '-l tr',
+}
+
+if meson.is_cross_build() or 'CONFIG_XKBCOMMON' not in config_host
+ native_qemu_keymap = find_program('qemu-keymap', required: false, disabler: true)
+else
+ native_qemu_keymap = qemu_keymap
+endif
+t = []
+foreach km, args: keymaps
+ t += custom_target(km,
+ build_by_default: true,
+ output: km,
+ command: [native_qemu_keymap, '-f', '@OUTPUT@', args.split()],
+ install_dir: config_host['qemu_datadir'] / 'keymaps')
+endforeach
+if t.length() > 0
+ alias_target('update-keymaps', t)
+else
+ # install from the source tree
+ install_data(keymaps.keys(), install_dir: config_host['qemu_datadir'] / 'keymaps')
+endif
+
+install_data(['sl', 'sv'], install_dir: config_host['qemu_datadir'] / 'keymaps')
diff --git a/pc-bios/meson.build b/pc-bios/meson.build
index 6e3bfe3ca4..b6389f5148 100644
--- a/pc-bios/meson.build
+++ b/pc-bios/meson.build
@@ -25,3 +25,4 @@ if 'DECOMPRESS_EDK2_BLOBS' in config_host
endif
subdir('descriptors')
+subdir('keymaps')