[vlc-commits] Simplify V4L2 configure checks

Rémi Denis-Courmont git at videolan.org
Mon Sep 5 18:19:01 CEST 2011


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Mon Sep  5 18:26:52 2011 +0300| [812b6e27ce3f4ed84ce547dc2365b844931729d8] | committer: Rémi Denis-Courmont

Simplify V4L2 configure checks

 - only check for libv4l2 if V4L2 is supported,
 - only check for --enable-pvr if V4L2 is supported,
 - remove mostly useless --enable-libv4l2 and --enable-v4l2.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=812b6e27ce3f4ed84ce547dc2365b844931729d8
---

 configure.ac              |   48 +++++++++++++-------------------------------
 modules/access/Modules.am |    4 +-
 2 files changed, 16 insertions(+), 36 deletions(-)

diff --git a/configure.ac b/configure.ac
index d191934..ceafd03 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1948,47 +1948,27 @@ if test "${enable_sftp}" = "yes"; then
 fi
 
 dnl
-dnl  Video4Linux2 plugin
+dnl  Video4Linux 2
 dnl
-AC_ARG_ENABLE(v4l2,
-  [AS_HELP_STRING([--disable-v4l2],
-    [disable Video4Linux2 support (default auto)])])
+AC_ARG_ENABLE(pvr, [AS_HELP_STRING([--enable-pvr],
+  [support PVR V4L2 cards (default disabled)])])
 have_v4l2="no"
-AS_IF([test "${enable_v4l2}" != "no"], [
-  AC_CHECK_HEADERS([linux/videodev2.h sys/videoio.h], [
-    have_v4l2="yes"
+AC_CHECK_HEADERS([linux/videodev2.h sys/videoio.h], [
+  have_v4l2="yes"
+])
+AS_IF([test "$have_v4l2" = "yes"], [
+  PKG_CHECK_MODULES(LIBV4L2, libv4l2, [
+    AC_DEFINE(HAVE_LIBV4L2, 1, [Define to 1 if libv4l2 is available])
+  ], [
+    AC_MSG_WARN([libv4l2 development headers were not found])
+  ])
+  AS_IF([test "${enable_pvr}" = "yes"], [
+    VLC_ADD_PLUGIN([pvr])
   ])
 ])
 AM_CONDITIONAL(HAVE_V4L2, [test "${have_v4l2}" != "no"])
 
 dnl
-dnl libv4l2 support for video4linux.
-dnl
-AC_ARG_ENABLE(libv4l2,
-  [AS_HELP_STRING([--enable-libv4l2],
-    [use V4L2 through libv4l2 (default auto)])])
-if test "${enable_libv4l2}" != "no" -a "${enable_v4l2}" != "no"
-then
-    PKG_CHECK_MODULES( LIBV4L2, libv4l2, [
-      VLC_ADD_LIBS([v4l2],[${LIBV4L2_LIBS}])
-      VLC_ADD_CFLAGS([v4l2],[${LIBV4L2_CFLAGS}])
-      AC_DEFINE(HAVE_LIBV4L2, 1, Define if libv4l2 is available)],
-      AC_MSG_WARN([LibV4L2 support disabled because libv4l2 development headers were not found])
-    )
-fi
-
-dnl
-dnl  special access module for Hauppauge PVR cards
-dnl
-AC_ARG_ENABLE(pvr,
-  [AS_HELP_STRING([--enable-pvr],
-    [support PVR V4L2 cards (default disabled)])])
-if test "${enable_pvr}" = "yes"
-then
-  VLC_ADD_PLUGIN([pvr])
-fi
-
-dnl
 dnl special access module for Blackmagic SDI cards
 dnl
 AC_ARG_ENABLE(decklink,
diff --git a/modules/access/Modules.am b/modules/access/Modules.am
index 6b6fce8..31d6845 100644
--- a/modules/access/Modules.am
+++ b/modules/access/Modules.am
@@ -131,8 +131,8 @@ libaccess_shm_plugin_la_DEPENDENCIES =
 libvlc_LTLIBRARIES += $(LTLIBaccess_shm)
 
 libv4l2_plugin_la_SOURCES = v4l2/v4l2.h v4l2/video.c v4l2/controls.c
-libv4l2_plugin_la_CFLAGS = $(AM_CFLAGS) $(CFLAGS_v4L2)
-libv4l2_plugin_la_LIBADD = $(AM_LIBADD) $(LIBS_v4l2) $(LIBM)
+libv4l2_plugin_la_CFLAGS = $(AM_CFLAGS) $(LIBV4L2_CFLAGS)
+libv4l2_plugin_la_LIBADD = $(AM_LIBADD) $(LIBV4L2_LIBS) $(LIBM)
 libv4l2_plugin_la_DEPENDENCIES =
 if HAVE_V4L2
 libvlc_LTLIBRARIES += libv4l2_plugin.la



More information about the vlc-commits mailing list