1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
|
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
is automatically set.
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
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,10 +1,17 @@
AUTOMAKE_OPTIONS = foreign
ACLOCAL_AMFLAGS = -I m4
-SUBDIRS = v4l-utils-po libdvbv5-po lib
+SUBDIRS = v4l-utils-po libdvbv5-po
+
+if WITH_LIBV4L
+SUBDIRS += lib
+endif
if WITH_V4LUTILS
-SUBDIRS += utils contrib
+SUBDIRS += utils
+if WITH_LIBV4L
+SUBDIRS += contrib
+endif
endif
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
--- a/configure.ac
+++ b/configure.ac
@@ -285,7 +285,7 @@ dl_saved_libs=$LIBS
AC_SEARCH_LIBS([dlopen],
[dl],
[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])])
AC_SUBST([DLOPEN_LIBS])
LIBS=$dl_saved_libs
@@ -371,6 +371,14 @@ AC_ARG_ENABLE(libdvbv5,
esac]
)
+AC_ARG_ENABLE(libv4l,
+ AS_HELP_STRING([--disable-libv4l], [disable libv4l compilation]),
+ [case "${enableval}" in
+ yes | no ) ;;
+ *) AC_MSG_ERROR(bad value ${enableval} for --disable-libv4l) ;;
+ esac]
+)
+
AC_ARG_ENABLE(dyn-libv4l,
AS_HELP_STRING([--disable-dyn-libv4l], [disable dynamic libv4l support]),
[case "${enableval}" in
@@ -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])],
[USE_DVBV5_REMOTE="no"])
+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"])
AM_COND_IF([WITH_V4LUTILS], [USE_V4LUTILS="yes"], [USE_V4LUTILS="no"])
AM_COND_IF([WITH_QV4L2], [USE_QV4L2="yes"], [USE_QV4L2="no"])
diff --git a/utils/Makefile.am b/utils/Makefile.am
index d7708cc..ce710c2 100644
--- a/utils/Makefile.am
+++ b/utils/Makefile.am
@@ -13,8 +13,12 @@ SUBDIRS = \
v4l2-sysfs-path \
cec-ctl \
cec-compliance \
- cec-follower \
+ cec-follower
+
+if WITH_LIBV4L
+SUBDIRS += \
rds-ctl
+endif
if WITH_LIBDVBV5
SUBDIRS += \
diff --git a/utils/v4l2-compliance/Makefile.am b/utils/v4l2-compliance/Makefile.am
index c2b5919..0240a50 100644
--- a/utils/v4l2-compliance/Makefile.am
+++ b/utils/v4l2-compliance/Makefile.am
@@ -7,12 +7,16 @@ v4l2_compliance_SOURCES = v4l2-compliance.cpp v4l2-test-debug.cpp v4l2-test-inpu
v4l2-test-codecs.cpp v4l2-test-colors.cpp v4l2-compliance.h
v4l2_compliance_CPPFLAGS = -I../common
+if WITH_LIBV4L
if WITH_V4L2_COMPLIANCE_LIBV4L
v4l2_compliance_LDADD = ../../lib/libv4l2/libv4l2.la ../../lib/libv4lconvert/libv4lconvert.la -lrt -lpthread
else
v4l2_compliance_LDADD = -lrt -lpthread
DEFS += -DNO_LIBV4L2
endif
+else
+DEFS += -DNO_LIBV4L2
+endif
EXTRA_DIST = Android.mk fixme.txt v4l2-compliance.1
diff --git a/utils/v4l2-ctl/Makefile.am b/utils/v4l2-ctl/Makefile.am
index 955647d..4475aed 100644
--- a/utils/v4l2-ctl/Makefile.am
+++ b/utils/v4l2-ctl/Makefile.am
@@ -9,10 +9,14 @@ v4l2_ctl_SOURCES = v4l2-ctl.cpp v4l2-ctl.h v4l2-ctl-common.cpp v4l2-ctl-tuner.cp
v4l2-tpg-colors.c v4l2-tpg-core.c v4l-stream.c
v4l2_ctl_CPPFLAGS = -I../common
+if WITH_LIBV4L
if WITH_V4L2_CTL_LIBV4L
v4l2_ctl_LDADD = ../../lib/libv4l2/libv4l2.la ../../lib/libv4lconvert/libv4lconvert.la -lrt -lpthread
else
DEFS += -DNO_LIBV4L2
endif
+else
+DEFS += -DNO_LIBV4L2
+endif
EXTRA_DIST = Android.mk v4l2-ctl.1
--
1.9.1
|