summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorGaetan Nadon <memsize@videotron.ca>2011-11-16 14:07:10 -0500
committerMartin-Éric Racine <martin-eric.racine@iki.fi>2011-11-21 10:33:09 +0200
commitfc19e7d2bd256663b4a731661a35abcf435eaf18 (patch)
treeabdad879a545cfcf992528d6c032bd9d4be36e90 /configure.ac
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 <memsize@videotron.ca>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac25
1 files changed, 21 insertions, 4 deletions
diff --git a/configure.ac b/configure.ac
index 3c28bb0..efe75d5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -70,6 +70,27 @@ AC_ARG_ENABLE(visibility,
[ AMD_CFLAGS="$AMD_CFLAGS -fvisibility=hidden" ],
[ : ])
+# Define a configure option to enable/disable ztv
+AC_ARG_ENABLE(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
+AC_CHECK_HEADERS([linux/videodev2.h],[v4l2=yes],[v4l2=no])
+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
+ BUILD_ZTV=yes
+ fi
+fi
+AM_CONDITIONAL(BUILD_ZTV, [test "x$BUILD_ZTV" = xyes])
+
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
XORG_CFLAGS="$XORG_CFLAGS $PCIACCESS_CFLAGS"
fi
-# Check for Video4Linux Version 2 (V4L2)
-AC_CHECK_HEADERS([linux/videodev2.h],[v4l2=yes])
-AM_CONDITIONAL(BUILD_ZTV, [test "x$v4l2" = xyes])
-
AC_SUBST([XORG_CFLAGS])
AC_SUBST([moduledir])
AC_SUBST([AMD_CFLAGS])