Add linux-headers include dir
[glsdk/omapdrmtest.git] / configure.ac
index 06a930f36f04f5620e03a2e8e94ee38b68f9bf2b..cf426df46c82054860f0c9de0a29ac450e223e63 100644 (file)
@@ -34,8 +34,32 @@ AC_PROG_LIBTOOL
 # Obtain compiler/linker options for depedencies
 PKG_CHECK_MODULES(DRM, libdrm libdrm_omap)
 
+# Check for kernel headers
+kversion=`uname -r`
+if test -r "/usr/src/linux-headers-$kversion/include/linux/videodev2.h"; then
+    headers_cflags="$headers_cflags -I/usr/src/linux-headers-$kversion/include"
+
+    AC_SUBST(CFLAGS, [$headers_cflags])
+    AC_MSG_NOTICE([$kversion provides videodev2.h])
+else
+    AC_MSG_NOTICE([Could not find /usr/src/linux-headers-$kversion/include/linux/videodev2.h])
+fi
+
+# Check for v4l2 dmabuf support:
+AC_CHECK_MEMBER([struct v4l2_buffer.m.fd],
+       [HAVE_V4L2_DMABUF=yes],
+       [HAVE_V4L2_DMABUF=no],
+       [[#include <linux/videodev2.h>]])
+if test "x$HAVE_V4L2_DMABUF" = "xyes"; then
+       AC_DEFINE(HAVE_V4L2_DMABUF, 1, [Have V4L2 DMABUF support])
+       AC_MSG_NOTICE([V4L2 DMABUF support detected])
+else
+       AC_MSG_WARN([No V4L2 DMABUF support detected, disabling V4L2 DMABUF tests])
+fi
+AM_CONDITIONAL(ENABLE_V4L2_DMABUF, [test "x$HAVE_V4L2_DMABUF" = xyes])
+
 # Check optional X11:
-PKG_CHECK_MODULES(X11, x11 libdri2, [HAVE_X11=yes], [HAVE_X11=no])
+PKG_CHECK_MODULES(X11, x11 dri2, [HAVE_X11=yes], [HAVE_X11=no])
 if test "x$HAVE_X11" = "xyes"; then
        AC_DEFINE(HAVE_X11, 1, [Have X11 support])
 else