From 702722a43ee6472993fabdd810272d3599064866 Mon Sep 17 00:00:00 2001
From: Hugues Fruchet <hugues.fruchet@st.com>
Date: Wed, 17 May 2017 10:03:11 +0200
Subject: [PATCH] configure.ac: add --disable-libv4l option
Add an option to disable libv4l libraries and plugins compilation.
If system is not supporting dynamic shared libraries, this option
dlopen() is no more a mandatory dependency (warning is kept).
lib/ and contrib/ folders are no more built with this option set
because of libv4l dependency.
utils/ folder is still built with this options set but without
rds-ctl because of its libv4l dependency.
v4l2-compliance and v4l2-ctl are also built but without any links
on libv4l and libv4lconvert libraries.
Signed-off-by: Hugues Fruchet <hugues.fruchet@st.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Makefile.am | 11 +++++++++--
configure.ac | 12 +++++++++++-
utils/Makefile.am | 6 +++++-
utils/v4l2-compliance/Makefile.am | 4 ++++
utils/v4l2-ctl/Makefile.am | 4 ++++
5 files changed, 33 insertions(+), 4 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index e603472..07c3ef8 100644
AUTOMAKE_OPTIONS = foreign
-SUBDIRS = v4l-utils-po libdvbv5-po lib
+SUBDIRS = v4l-utils-po libdvbv5-po
-SUBDIRS += utils contrib
EXTRA_DIST = android-config.h bootstrap.sh doxygen_libdvbv5.cfg include COPYING.libv4l \
diff --git a/configure.ac b/configure.ac
index 8e536cc..b9fc59a 100644
@@ -285,7 +285,7 @@ dl_saved_libs=$LIBS
[test "$ac_cv_search_dlopen" = "none required" || DLOPEN_LIBS=$ac_cv_search_dlopen],
- [AC_MSG_ERROR([unable to find the dlopen() function])])
+ [AC_MSG_WARN([unable to find the dlopen() function])])
@@ -371,6 +371,14 @@ AC_ARG_ENABLE(libdvbv5,
+ AS_HELP_STRING([--disable-libv4l], [disable libv4l compilation]),
+ [case "${enableval}" in
+ *) AC_MSG_ERROR(bad value ${enableval} for --disable-libv4l) ;;
AC_ARG_ENABLE(dyn-libv4l,
AS_HELP_STRING([--disable-dyn-libv4l], [disable dynamic libv4l support]),
@@ -428,6 +436,7 @@ AM_CONDITIONAL([WITH_LIBDVBV5], [test x$enable_libdvbv5 != xno -a x$have_li
AM_CONDITIONAL([WITH_DVBV5_REMOTE], [test x$enable_libdvbv5 != xno -a x$have_libudev = xyes -a x$have_pthread = xyes])
AM_CONDITIONAL([WITH_DYN_LIBV4L], [test x$enable_dyn_libv4l != xno])
+AM_CONDITIONAL([WITH_LIBV4L], [test x$enable_libv4l != xno -a x$enable_shared != xno])
AM_CONDITIONAL([WITH_V4LUTILS], [test x$enable_v4l_utils != xno -a x$linux_os = xyes])
AM_CONDITIONAL([WITH_QV4L2], [test x${qt_pkgconfig} = xtrue -a x$enable_qv4l2 != xno])
AM_CONDITIONAL([WITH_V4L_PLUGINS], [test x$enable_dyn_libv4l != xno -a x$enable_shared != xno])
@@ -455,6 +464,7 @@ AM_COND_IF([WITH_LIBDVBV5], [USE_LIBDVBV5="yes"], [USE_LIBDVBV5="no"])
AM_COND_IF([WITH_DVBV5_REMOTE], [USE_DVBV5_REMOTE="yes"
AC_DEFINE([HAVE_DVBV5_REMOTE], [1], [Usage of DVBv5 remote enabled])],
+AM_COND_IF([WITH_LIBV4L], [USE_LIBV4L="yes"], [USE_LIBV4L="no"])
AM_COND_IF([WITH_DYN_LIBV4L], [USE_DYN_LIBV4L="yes"], [USE_DYN_LIBV4L="no"])