diff options
author | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2018-11-17 23:28:52 -0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2018-11-17 23:28:52 -0200 |
commit | 013284f5c8a08e4b3c4773036afbfae3de96b1b7 (patch) | |
tree | 7ec08ddf7cc6bd3a73849a8d8661442a7cc7d88e | |
parent | 2ee91cf754721a022fe0628bda4235cc5363a1d3 (diff) |
configure.ac: check if libv4l is presentcheck_libv4l
Camorama can't build without libv4l. Add such check there.
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
-rwxr-xr-x | configure | 46 | ||||
-rw-r--r-- | configure.ac | 7 |
2 files changed, 53 insertions, 0 deletions
@@ -8046,6 +8046,52 @@ fi done +# Check for V4L2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for v4l2_open in -lv4l2" >&5 +$as_echo_n "checking for v4l2_open in -lv4l2... " >&6; } +if ${ac_cv_lib_v4l2_v4l2_open+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lv4l2 $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char v4l2_open (); +int +main () +{ +return v4l2_open (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_v4l2_v4l2_open=yes +else + ac_cv_lib_v4l2_v4l2_open=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_v4l2_v4l2_open" >&5 +$as_echo "$ac_cv_lib_v4l2_v4l2_open" >&6; } +if test "x$ac_cv_lib_v4l2_v4l2_open" = xyes; then : + LIBV4L="yes" +fi + +if test "$LIBV4L" != "yes"; then + echo "Oops: libv4l library not found." + exit 1 +fi + # Don't assume that gcc warnings are errors diff --git a/configure.ac b/configure.ac index f631423..989e22a 100644 --- a/configure.ac +++ b/configure.ac @@ -33,6 +33,13 @@ AC_HEADER_STDC AC_HEADER_MAJOR AC_CHECK_HEADERS([fcntl.h stdlib.h string.h sys/ioctl.h unistd.h linux/videodev.h png.h glade/glade.h]) +# Check for V4L2 +AC_CHECK_LIB(v4l2, v4l2_open, LIBV4L="yes",,) +if test "$LIBV4L" != "yes"; then + echo "Oops: libv4l library not found." + exit 1 +fi + # Don't assume that gcc warnings are errors AX_IS_RELEASE(always) AX_COMPILER_FLAGS([WARN_CFLAGS],[WARN_LDFLAGS]) |