config: set the default xkb config root based on xkeyboard-config module

The default value ${dataroot}/X11/xkb only works if xkeyboard-config
has created the keymaps in that directory. Let's obtain the true final
value of where the keymaps are and use that as a default. In a production
environment this is the only value that can work.

This new default value also has the merit of making the 'check' target
to work in distcheck which does not have a copy of the xkeyboard-config
keymaps in its sandbox based on ${dataroot}/X11/xkb. The test data
cannot find the "include" keymaps it needs.

Reviewed-by: Jeremy Huddleston <>
Signed-off-by: Gaetan Nadon <>
diff --git a/ b/
index f8175ba..0026441 100644
--- a/
+++ b/
@@ -88,11 +88,12 @@
 # Define a configuration option for the XKB config root
+xkb_base=`$PKG_CONFIG --variable=xkb_base xkeyboard-config`
         [Set default XKB config root (default: ${datadir}/X11/xkb)])],
-    [XKBCONFIGROOT='${datadir}/X11/xkb'])
+    [XKBCONFIGROOT="$xkb_base"])