[vlc-devel] [PATCH 7/7] configure: allow a --disable-v4l2

Jean-Baptiste Kempf jb at videolan.org
Thu Sep 22 18:46:54 CEST 2011


This is needed because some distro have broken headers
---
 configure.ac |   32 ++++++++++++++++++--------------
 1 files changed, 18 insertions(+), 14 deletions(-)

diff --git a/configure.ac b/configure.ac
index 0746cc9..c39f7ac 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1954,26 +1954,30 @@ fi
 dnl
 dnl  Video4Linux 2
 dnl
+AC_ARG_ENABLE(v4l2, [AS_HELP_STRING([--enable-v4l2],
+  [support V4L2 cards (default enabled)])])
 AC_ARG_ENABLE(libv4l2, [AS_HELP_STRING([--disable-libv4l2],
   [disable userspace V4L2 library (default auto)])])
 AC_ARG_ENABLE(pvr, [AS_HELP_STRING([--enable-pvr],
   [support PVR V4L2 cards (default disabled)])])
 have_v4l2="no"
-AC_CHECK_HEADERS([linux/videodev2.h sys/videoio.h], [
-  have_v4l2="yes"
-])
-AS_IF([test "$have_v4l2" = "yes"], [
-  AS_IF([test "${enable_libv4l2}" != "no"], [
-    PKG_CHECK_MODULES(LIBV4L2, libv4l2, [
-      AC_DEFINE(HAVE_LIBV4L2, 1, [Define to 1 if libv4l2 is available])
-    ], [
-      AC_MSG_WARN([${LIBV4L2_PKG_ERRORS}])
+if test "{enable_v4l2}" = "yes" ; then
+    AC_CHECK_HEADERS([linux/videodev2.h sys/videoio.h], [
+      have_v4l2="yes"
     ])
-  ])
-  AS_IF([test "${enable_pvr}" = "yes"], [
-    VLC_ADD_PLUGIN([pvr])
-  ])
-])
+    AS_IF([test "$have_v4l2" = "yes"], [
+      AS_IF([test "${enable_libv4l2}" != "no"], [
+        PKG_CHECK_MODULES(LIBV4L2, libv4l2, [
+          AC_DEFINE(HAVE_LIBV4L2, 1, [Define to 1 if libv4l2 is available])
+        ], [
+          AC_MSG_WARN([${LIBV4L2_PKG_ERRORS}])
+        ])
+      ])
+      AS_IF([test "${enable_pvr}" = "yes"], [
+        VLC_ADD_PLUGIN([pvr])
+      ])
+    ])
+fi
 AM_CONDITIONAL(HAVE_V4L2, [test "${have_v4l2}" != "no"])
 
 dnl
-- 
1.7.7.rc1




More information about the vlc-devel mailing list