From: RĂ©mi Denis-Courmont Date: Mon, 5 Sep 2011 15:26:52 +0000 (+0300) Subject: Simplify V4L2 configure checks X-Git-Tag: 1.2.0-pre1~837 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=812b6e27ce3f4ed84ce547dc2365b844931729d8;p=vlc 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. --- diff --git a/configure.ac b/configure.ac index d191934a0c..ceafd03ad2 100644 --- a/configure.ac +++ b/configure.ac @@ -1948,46 +1948,26 @@ 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 diff --git a/modules/access/Modules.am b/modules/access/Modules.am index 6b6fce8a74..31d6845c89 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