evdev: Enable the compilation of the evdev backend for eglnative
authorDamien Lespiau <damien.lespiau@intel.com>
Fri, 19 Nov 2010 19:31:51 +0000 (14:31 -0500)
committerDamien Lespiau <damien.lespiau@intel.com>
Tue, 30 Nov 2010 14:40:38 +0000 (14:40 +0000)
Not tested (but checked that it compiles).

There's no reason to only enable the check for the cex100. Hopefully
should work.

We make sure not to enable both the evdev and the tslib backend at the
same time as the DeviceManager is a singleton and we can't have both
subclasses at the same time for now.

configure.ac

index 29beffb..6427db8 100644 (file)
@@ -278,10 +278,23 @@ AS_CASE([$CLUTTER_FLAVOUR],
                 [AC_DEFINE([HAVE_TSLIB], [1], [Have tslib for touchscreen handling])]
           )
 
+          # evdev
+          PKG_CHECK_MODULES(EVDEV, [gudev-1.0 xkbcommon],
+                            [have_evdev=yes], [have_evdev=no])
+          AS_IF([test "x$have_evdev" = "xyes"],
+                [AC_DEFINE([HAVE_EVDEV], 1,
+                           [Have evdev support for input handling])]
+          )
+
+          # Make sure we don't enable tslib and evdev at the same time, we
+          # don't support multiple event backends yet.
+          AS_IF([test "x$have_tslib" = "xyes" -a "x$have_evdev" = "xyes"],
+                [AC_MSG_ERROR([Can't enable both tslib and evdev events])])
+
           COGL_DRIVER="gles"
 
-          FLAVOUR_LIBS="$FLAVOUR_LIBS $TSLIB_LIBS"
-          FLAVOUR_CFLAGS="$FLAVOUR_CFLAGS $TSLIB_CFLAGS"
+          FLAVOUR_LIBS="$FLAVOUR_LIBS $TSLIB_LIBS $EVDEV_LIBS"
+          FLAVOUR_CFLAGS="$FLAVOUR_CFLAGS $TSLIB_CFLAGS $EVDEV_CFLAGS"
 
           CLUTTER_WINSYS=egl
           CLUTTER_SONAME_INFIX=eglnative