<br><br><div class="gmail_quote">2013/6/21 <span dir="ltr"><<a href="mailto:sardemff7+wayland@sardemff7.net" target="_blank">sardemff7+wayland@sardemff7.net</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>On 21/06/2013 11:52, Marc Chalain wrote:<br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
2013/6/21 <<a href="mailto:sardemff7%2Bwayland@sardemff7.net" target="_blank">sardemff7+wayland@sardemff7.<u></u>net</a>><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>
On 21/06/2013 10:39, mchalain [<a href="mailto:marc.chalain@gmail.com" target="_blank">marc.chalain@gmail.com</a>] wrote:<br>
<br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>
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, [<br>
--enable-drm-compositor],,<br></div>
AM_CONDITIONAL(ENABLE_DRM_**<u></u>COMPOSITOR, test x$enable_drm_compositor =<div><br>
xyes -a x$enable_egl = xyes)<br>
if test x$enable_drm_compositor = xyes -a x$enable_egl = xyes; then<br></div>
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<div><br>
gbm mtdev >= 1.1.0])<br></div>
+ PKG_CHECK_MODULES(DRM_**<u></u>COMPOSITOR, [libudev >= 136 libdrm >= 2.4.30<br>
gbm])<br>
fi<br>
<br>
<br>
@@ -161,7 +161,7 @@ AM_CONDITIONAL(ENABLE_RPI_**<u></u>COMPOSITOR, test<div><br>
"x$enable_rpi_compositor" = "xyes")<br>
have_bcm_host="no"<br>
if test "x$enable_rpi_compositor" = "xyes"; then<br></div>
AC_DEFINE([BUILD_RPI_**<u></u>COMPOSITOR], [1], [Build the compositor for<br>
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],<div><br>
[have_bcm_host="yes"<br>
AC_DEFINE([HAVE_BCM_HOST], [1], [have Raspberry Pi<br>
BCM headers])],<br></div>
@@ -176,7 +176,7 @@ AM_CONDITIONAL([ENABLE_FBDEV_*<u></u>*COMPOSITOR],<div><br>
[test x$enable_fbdev_compositor = xyes])<br>
AS_IF([test x$enable_fbdev_compositor = xyes], [<br></div>
AC_DEFINE([BUILD_FBDEV_**<u></u>COMPOSITOR], [1], [Build the fbdev<br>
compositor])<br>
- PKG_CHECK_MODULES([FBDEV_**<u></u>COMPOSITOR], [libudev >= 136 mtdev >=<br>
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],,<div><br>
@@ -203,6 +203,17 @@ PKG_CHECK_MODULES(WEBP, [libwebp], [have_webp=yes],<br>
[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></div>
+ AS_HELP_STRING([--disable-**<u></u>mtdev],<div><br>
+ [do not support multitouch library<br>
libmtdev]),,<br>
+ enable_mtdev=auto)<br>
+AM_CONDITIONAL(ENABLE_MTDEV, test "x$enable_mtdev" = "xyes")<br>
<br>
</div></blockquote><div>
<br>
If you do not use this, you should probably not set it.<br>
<br>
<br>
</div></blockquote><div>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
+if test "x$enable_mtdev" != "xno"; then<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+ PKG_CHECK_MODULES(MTDEV, [mtdev >= 1.1.0], [have_mtdev=yes],<br>
[have_mtdev=no])<br>
<br>
</blockquote>
<br>
Where do you use MTDEV_{CFLAGS,LIBS}?<br>
</blockquote>
<br>
Nowhere at this moment. But I don't know the future and this was done in<br>
the prevsious version.<br>
</div></blockquote>
<br>
Why do you removed this usage then? I’m not sure what you mean by that. If you don’t know the future, you should even more use the provided flags. Specifically the LIBS so that mtdev is properly linked everywhere is it used. (And CFLAGS in case headers are not in a default location.)<div>
<br></div></blockquote><div>OK I understand. <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
+ AS_IF([test "x$have_mtdev" = "xyes"],<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+ [AC_DEFINE([HAVE_MTDEV], [1], [Have Multitouch device<br>
support])])<br>
<br>
</blockquote>
<br>
What if the user specified --enable-mtdev but the package is not<br>
available? It should be an error, not a silent ignore. :-)<br>
<br>
<br>
</blockquote>
If you set --enable-mtde, you know that mtdev is available. After the<br>
automatic check is the normal way in my opinion.<br>
</blockquote>
<br></div>
Not at all. You want mtdev support, but you might have missed the installation. Also, we (packagers) want to ensure that a specific feature has all its deps checked. Please, add an error if $enable_mtdev is yes and $have_mtdev is no. :-)<br>
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div>
<br>
+fi<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+<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<br>
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>
<br>
</blockquote>
<br>
IMO, it should still log it if mtdev support is enabled.<br>
<br>
<br>
<br>
}<br>
</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
device->source = wl_event_loop_add_fd(ec->**<u></u>input_loop,<br>
device->fd,<br>
<br>
<br>
</blockquote><div>
<br>
--<br>
<br>
Quentin “Sardem FF7” Glidic<br>
<br>
</div></blockquote>
<br>
</blockquote><div><div>
<br>
<br>
-- <br>
<br>
Quentin “Sardem FF7” Glidic<br>
</div></div></blockquote></div><br>