2013/6/21 <span dir="ltr"><<a href="mailto:sardemff7+wayland@sardemff7.net" target="_blank">sardemff7+wayland@sardemff7.net</a>></span><br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5">On 21/06/2013 10:39, mchalain [<a href="mailto:marc.chalain@gmail.com" target="_blank">marc.chalain@gmail.com</a>] wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
From: mchalain <<a href="mailto:marc.chalain@gmail.com" target="_blank">marc.chalain@gmail.com</a>><br>
<br>
it allows the --disable-mtdev option at configuration.<br>
evdev.c creates empty macros for mtdev functions not availlables<br>
<br>
---<br>
weston/<a href="http://configure.ac" target="_blank">configure.ac</a> | 17 ++++++++++++++---<br>
weston/src/evdev.c | 11 ++++++++---<br>
2 files changed, 22 insertions(+), 6 deletions(-)<br>
<br>
diff --git a/weston/<a href="http://configure.ac" target="_blank">configure.ac</a> b/weston/<a href="http://configure.ac" target="_blank">configure.ac</a><br>
index b625221..2bdff35 100644<br>
--- a/weston/<a href="http://configure.ac" target="_blank">configure.ac</a><br>
+++ b/weston/<a href="http://configure.ac" target="_blank">configure.ac</a><br>
@@ -132,7 +132,7 @@ AC_ARG_ENABLE(drm-compositor, [ --enable-drm-compositor],,<br>
AM_CONDITIONAL(ENABLE_DRM_<u></u>COMPOSITOR, test x$enable_drm_compositor = xyes -a x$enable_egl = xyes)<br>
if test x$enable_drm_compositor = xyes -a x$enable_egl = xyes; then<br>
AC_DEFINE([BUILD_DRM_<u></u>COMPOSITOR], [1], [Build the DRM compositor])<br>
- PKG_CHECK_MODULES(DRM_<u></u>COMPOSITOR, [libudev >= 136 libdrm >= 2.4.30 gbm mtdev >= 1.1.0])<br>
+ PKG_CHECK_MODULES(DRM_<u></u>COMPOSITOR, [libudev >= 136 libdrm >= 2.4.30 gbm])<br>
fi<br>
<br>
<br>
@@ -161,7 +161,7 @@ AM_CONDITIONAL(ENABLE_RPI_<u></u>COMPOSITOR, test "x$enable_rpi_compositor" = "xyes")<br>
have_bcm_host="no"<br>
if test "x$enable_rpi_compositor" = "xyes"; then<br>
AC_DEFINE([BUILD_RPI_<u></u>COMPOSITOR], [1], [Build the compositor for Raspberry Pi])<br>
- PKG_CHECK_MODULES(RPI_<u></u>COMPOSITOR, [libudev >= 136 mtdev >= 1.1.0])<br>
+ PKG_CHECK_MODULES(RPI_<u></u>COMPOSITOR, [libudev >= 136])<br>
PKG_CHECK_MODULES(RPI_BCM_<u></u>HOST, [bcm_host],<br>
[have_bcm_host="yes"<br>
AC_DEFINE([HAVE_BCM_HOST], [1], [have Raspberry Pi BCM headers])],<br>
@@ -176,7 +176,7 @@ AM_CONDITIONAL([ENABLE_FBDEV_<u></u>COMPOSITOR],<br>
[test x$enable_fbdev_compositor = xyes])<br>
AS_IF([test x$enable_fbdev_compositor = xyes], [<br>
AC_DEFINE([BUILD_FBDEV_<u></u>COMPOSITOR], [1], [Build the fbdev compositor])<br>
- PKG_CHECK_MODULES([FBDEV_<u></u>COMPOSITOR], [libudev >= 136 mtdev >= 1.1.0])<br>
+ PKG_CHECK_MODULES([FBDEV_<u></u>COMPOSITOR], [libudev >= 136 ])<br>
])<br>
<br>
AC_ARG_ENABLE([rdp-compositor]<u></u>, [ --enable-rdp-compositor],,<br>
@@ -203,6 +203,17 @@ PKG_CHECK_MODULES(WEBP, [libwebp], [have_webp=yes], [have_webp=no])<br>
AS_IF([test "x$have_webp" = "xyes"],<br>
[AC_DEFINE([HAVE_WEBP], [1], [Have webp])])<br>
<br>
+AC_ARG_ENABLE(mtdev,<br>
+ AS_HELP_STRING([--disable-<u></u>mtdev],<br>
+ [do not support multitouch library libmtdev]),,<br>
+ enable_mtdev=auto)<br>
+AM_CONDITIONAL(ENABLE_MTDEV, test "x$enable_mtdev" = "xyes")<br>
</blockquote>
<br></div></div>
If you do not use this, you should probably not set it.<div class="im"><br></div></blockquote><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+if test "x$enable_mtdev" != "xno"; then<br>
+ PKG_CHECK_MODULES(MTDEV, [mtdev >= 1.1.0], [have_mtdev=yes], [have_mtdev=no])<br>
</blockquote>
<br></div>
Where do you use MTDEV_{CFLAGS,LIBS}?<div class="im"><br></div></blockquote><div>Nowhere at this moment. But I don't know the future and this was done in the prevsious version.<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+ AS_IF([test "x$have_mtdev" = "xyes"],<br>
+ [AC_DEFINE([HAVE_MTDEV], [1], [Have Multitouch device support])])<br>
</blockquote>
<br></div>
What if the user specified --enable-mtdev but the package is not available? It should be an error, not a silent ignore. :-)<div><div class="h5"><br>
<br></div></div></blockquote><div>If you set --enable-mtde, you know that mtdev is available. After the automatic check is the normal way in my opinion.<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div class="h5">
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+fi<br>
+<br>
AC_CHECK_LIB([jpeg], [jpeg_CreateDecompress], have_jpeglib=yes)<br>
if test x$have_jpeglib = xyes; then<br>
JPEG_LIBS="-ljpeg"<br>
diff --git a/weston/src/evdev.c b/weston/src/evdev.c<br>
index 122a2d9..59af038 100644<br>
--- a/weston/src/evdev.c<br>
+++ b/weston/src/evdev.c<br>
@@ -27,7 +27,15 @@<br>
#include <linux/input.h><br>
#include <unistd.h><br>
#include <fcntl.h><br>
+#ifdef HAVE_MTDEV<br>
#include <mtdev.h><br>
+#else<br>
+struct mtdev<br>
+{ int none;};<br>
+#define mtdev_close_delete(...) do{}while(0)<br>
+#define mtdev_get(...) 0<br>
+#define mtdev_new_open(...) NULL<br>
+#endif<br>
<br>
#include "compositor.h"<br>
#include "evdev.h"<br>
@@ -565,11 +573,8 @@ evdev_device_create(struct weston_seat *seat, const char *path, int device_fd)<br>
if (device->dispatch == NULL)<br>
goto err1;<br>
<br>
-<br>
if (device->is_mt) {<br>
device->mtdev = mtdev_new_open(device->fd);<br>
- if (!device->mtdev)<br>
- weston_log("mtdev failed to open for %s\n", path);<br>
</blockquote>
<br></div></div>
IMO, it should still log it if mtdev support is enabled.<div class="im"><br>
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
}<br>
<br>
device->source = wl_event_loop_add_fd(ec-><u></u>input_loop, device->fd,<br>
<br>
</blockquote>
<br>
<br>
-- <br>
<br></div>
Quentin “Sardem FF7” Glidic<br>
</blockquote></div><br>