configure.ac: pass kernel source path
authorVíctor Manuel Jáquez Leal <vjaquez@igalia.com>
Mon, 2 Apr 2012 17:03:47 +0000 (19:03 +0200)
committerRob Clark <rob@ti.com>
Tue, 3 Apr 2012 12:06:48 +0000 (07:06 -0500)
By default the configure.ac only checked for videodev2.h in
/usr/src/linux-headers-$kversion.

With this patch the user can pass the kernel source path with the parameter
--with-kernel-source.

Signed-off-by: Víctor Manuel Jáquez Leal <vjaquez@igalia.com>
configure.ac

index cf426df46c82054860f0c9de0a29ac450e223e63..217126bb9cdb9cae02c3df6caab938685985b246 100644 (file)
@@ -36,13 +36,19 @@ 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_ARG_WITH([kernel-source],
+            [AS_HELP_STRING([--with-kernel-source],
+              [specify pavth to linux kernel source])],
+           [kernel_source="$with_kernel_source"],
+           [kernel_source="/usr/src/linux-headers-$kversion"])
+
+if test -r "$kernel_source/include/linux/videodev2.h"; then
+    headers_cflags="$headers_cflags -I$kernel_source/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])
+    AC_MSG_NOTICE([Could not find $kernel_source/include/linux/videodev2.h])
 fi
 
 # Check for v4l2 dmabuf support: