build: Check for the XKB extension
authorEmmanuele Bassi <ebassi@linux.intel.com>
Mon, 14 Jun 2010 16:29:21 +0000 (17:29 +0100)
committerEmmanuele Bassi <ebassi@linux.intel.com>
Tue, 13 Jul 2010 07:27:48 +0000 (08:27 +0100)
When compiling the X11 backends.

README
configure.ac

diff --git a/README b/README
index 9d132fd..a1666df 100644 (file)
--- a/README
+++ b/README
@@ -28,6 +28,7 @@ On X11, Clutter depends on the following extensions
   • XExt
   • XFixes
   • XInput 1.x (if --enable-xinput is passed to configure)
+  • XKB
 
 When running the OpenGL flavor, Clutter requires at least version 1.3
 or 1.2 with the multitexturing extension. However to build Clutter
index 1fb7e2b..1bcf292 100644 (file)
@@ -684,7 +684,7 @@ AS_IF([test "x$SUPPORT_XLIB" = "x1"],
 
                 [yes],
                 [
-                  AC_DEFINE(HAVE_XINPUT, 1, Use the XINPUT X extension)
+                  AC_DEFINE(HAVE_XINPUT, 1, [Use the XINPUT X extension])
 
                   X11_LIBS="$X11_LIBS -lXi"
                   X11_PC_FILES="$X11_PC_FILES xi"
@@ -694,6 +694,23 @@ AS_IF([test "x$SUPPORT_XLIB" = "x1"],
                 [],
         )
 
+        # XKB
+        clutter_save_CPPFLAGS="$CPPFLAGS"
+        CPPFLAGS="$CPPFLAGS $X11_CFLAGS"
+
+        clutter_save_LIBS="$LIBS"
+        LIBS="$LIBS $X11_LIBS"
+
+        have_xkb=no
+        AC_CHECK_FUNC([XkbQueryExtension],
+                      [
+                        AC_DEFINE(HAVE_XKB, 1, [Define to use XKB extension])
+                        have_xkb=yes
+                      ])
+
+        CPPFLAGS="$clutter_save_CPPFLAGS"
+        LIBS="$clutter_save_LIBS"
+
         x11_tests=yes
         BACKEND_PC_FILES="$BACKEND_PC_FILES $X11_PC_FILES"
         FLAVOUR_LIBS="$FLAVOUR_LIBS $X11_LIBS"
@@ -1136,6 +1153,7 @@ fi
 
 if test "x$SUPPORT_XLIB" = "x1"; then
 echo "        Enable XInput 1.0: ${xinput}"
+echo "        Enable XKB: ${have_xkb}"
 echo "        Enable X11 tests: ${x11_tests}"
 fi