Add linux-headers include dir
authorXavier Boudet <x-boudet@ti.com>
Fri, 30 Mar 2012 09:52:55 +0000 (09:52 +0000)
committerRob Clark <rob@ti.com>
Fri, 30 Mar 2012 15:23:32 +0000 (10:23 -0500)
Signed-off-by: Xavier Boudet <x-boudet@ti.com>
configure.ac

index 3dc7c0b9e8c8d2b86dbfbf2f926a24a5718d43c7..cf426df46c82054860f0c9de0a29ac450e223e63 100644 (file)
@@ -34,6 +34,17 @@ AC_PROG_LIBTOOL
 # Obtain compiler/linker options for depedencies
 PKG_CHECK_MODULES(DRM, libdrm libdrm_omap)
 
 # 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],
 # Check for v4l2 dmabuf support:
 AC_CHECK_MEMBER([struct v4l2_buffer.m.fd],
        [HAVE_V4L2_DMABUF=yes],
@@ -41,6 +52,7 @@ AC_CHECK_MEMBER([struct v4l2_buffer.m.fd],
        [[#include <linux/videodev2.h>]])
 if test "x$HAVE_V4L2_DMABUF" = "xyes"; then
        AC_DEFINE(HAVE_V4L2_DMABUF, 1, [Have V4L2 DMABUF support])
        [[#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
 else
        AC_MSG_WARN([No V4L2 DMABUF support detected, disabling V4L2 DMABUF tests])
 fi