From: Víctor Manuel Jáquez Leal Date: Mon, 2 Apr 2012 17:03:47 +0000 (+0200) Subject: configure.ac: pass kernel source path X-Git-Tag: glsdk-6_00_00_07~28 X-Git-Url: https://git.ti.com/gitweb?p=glsdk%2Fomapdrmtest.git;a=commitdiff_plain;h=2996d8788a6de12b1bfc1bf8d31231b603f61630 configure.ac: pass kernel source path 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 --- diff --git a/configure.ac b/configure.ac index cf426df..217126b 100644 --- a/configure.ac +++ b/configure.ac @@ -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: