authorGaetan Nadon <>2011-11-16 19:07:10 (GMT)
committer Martin-√Čric Racine <>2011-11-21 08:33:09 (GMT)
commitfc19e7d2bd256663b4a731661a35abcf435eaf18 (patch) (side-by-side diff)
parent23b85b3fcd1439561f0693755a31f7fded50741b (diff)
Add a configure option to enable/disable building the ztv driver
Even when V4L2 is available there are always reasons why distros may not want to build the driver. This patch uses a common idiom in xorg. When no configure option is specified ztv is built iff v4l2 is detected (auto). When user issues --disable-ztv, the ztv driver is not built (no) When user issues --enable-ztv, the ztv driver is built (yes) if v4l2 is detected but the configuration fails if v4l2 is missing. Distros do not want silent failures when a feature is explicitly requested but cannot be built. Signed-off-by: Gaetan Nadon <>
Diffstat (more/less context) (ignore whitespace changes)
1 files changed, 21 insertions, 4 deletions
diff --git a/ b/
index 3c28bb0..efe75d5 100644
--- a/
+++ b/
@@ -70,6 +70,27 @@ AC_ARG_ENABLE(visibility,
[ AMD_CFLAGS="$AMD_CFLAGS -fvisibility=hidden" ],
[ : ])
+# Define a configure option to enable/disable ztv
+ AS_HELP_STRING([--enable-ztv],
+ [Enable Video For Linux based ZTV driver (default: auto-detected)]),
+ [ztv=$enableval],
+ [ztv=auto])
+# Check for Video4Linux Version 2 (V4L2) availability
+if test "x$ztv" != "xno" ; then
+ if test "x$v4l2" = "xno" ; then
+ if test "x$ztv" = "xyes" ; then
+ # User really wants ztv but V4L2 is not found
+ AC_MSG_ERROR([ZTV driver requested, but videodev2.h not found.])
+ fi
+ else
+ fi
if test "x$GCC" = "xyes"; then
GCC_WARNINGS1="-Wall -Wpointer-arith -Wstrict-prototypes"
GCC_WARNINGS2="-Wmissing-prototypes -Wmissing-declarations"
@@ -110,10 +131,6 @@ if test "x$XSERVER_LIBPCIACCESS" = xyes; then
-# Check for Video4Linux Version 2 (V4L2)
-AM_CONDITIONAL(BUILD_ZTV, [test "x$v4l2" = xyes])