[PATCH] clients: fix build on Linux

Olivier Fourdan ofourdan at redhat.com
Thu Jan 14 07:44:32 PST 2016


stropts.h is not available on Linux.

Check for this header in the configure script and include it only if
available to avoid a build failure on systems which do not have
stropts.h.

Signed-off-by: Olivier Fourdan <ofourdan at redhat.com>
---
 clients/simple-dmabuf-v4l.c | 2 ++
 configure.ac                | 1 +
 2 files changed, 3 insertions(+)

diff --git a/clients/simple-dmabuf-v4l.c b/clients/simple-dmabuf-v4l.c
index 2334e09..471cbf2 100644
--- a/clients/simple-dmabuf-v4l.c
+++ b/clients/simple-dmabuf-v4l.c
@@ -34,7 +34,9 @@
 
 #include <drm_fourcc.h>
 
+#ifdef HAVE_STROPTS_H
 #include <stropts.h>
+#endif
 #include <sys/mman.h>
 #include <sys/stat.h>
 #include <fcntl.h>
diff --git a/configure.ac b/configure.ac
index 97cbfe5..5f8b345 100644
--- a/configure.ac
+++ b/configure.ac
@@ -366,6 +366,7 @@ if ! test "x$enable_simple_dmabuf_v4l_client" = "xno"; then
   if test "x$have_simple_dmabuf_v4l_client" = "xno" -a "x$enable_simple_dmabuf_v4l_client" = "xyes"; then
     AC_MSG_ERROR([V4L dmabuf client explicitly enabled, but libdrm couldn't be found])
   fi
+  AC_CHECK_HEADERS([stropts.h])
   enable_simple_dmabuf_v4l_client="$have_simple_dmabuf_v4l_client"
 fi
 AM_CONDITIONAL(BUILD_SIMPLE_DMABUF_V4L_CLIENT, test "x$enable_simple_dmabuf_v4l_client" = "xyes")
-- 
2.5.0



More information about the wayland-devel mailing list