Merge pull request #781 from knnniggett/v4l_headers

Check for libv4l1-videodev headers
This commit is contained in:
Isaac Connor 2015-04-10 13:30:15 -04:00
commit 05634f694a
7 changed files with 31 additions and 12 deletions

View File

@ -112,7 +112,10 @@ include_directories("${CMAKE_BINARY_DIR}")
set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS ON) set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS ON)
# System checks # System checks
check_include_file("linux/videodev.h" HAVE_LINUX_VIDEODEV_H) check_include_file("libv4l1-videodev.h" HAVE_LIBV4L1_VIDEODEV_H)
if(NOT HAVE_LIBV4L1_VIDEODEV_H)
check_include_file("linux/videodev.h" HAVE_LINUX_VIDEODEV_H)
endif(NOT HAVE_LIBV4L1_VIDEODEV_H)
check_include_file("linux/videodev2.h" HAVE_LINUX_VIDEODEV2_H) check_include_file("linux/videodev2.h" HAVE_LINUX_VIDEODEV2_H)
check_include_file("execinfo.h" HAVE_EXECINFO_H) check_include_file("execinfo.h" HAVE_EXECINFO_H)
check_include_file("ucontext.h" HAVE_UCONTEXT_H) check_include_file("ucontext.h" HAVE_UCONTEXT_H)
@ -413,17 +416,17 @@ endif((NOT HAVE_LIBCRYPTO) AND (NOT HAVE_LIBGNUTLS))
set(ZM_HAS_V4L 0) set(ZM_HAS_V4L 0)
set(ZM_HAS_V4L1 0) set(ZM_HAS_V4L1 0)
set(ZM_HAS_V4L2 0) set(ZM_HAS_V4L2 0)
if(HAVE_LINUX_VIDEODEV_H) if(HAVE_LINUX_VIDEODEV_H OR HAVE_LIBV4L1_VIDEODEV_H)
set(ZM_HAS_V4L 1) set(ZM_HAS_V4L 1)
set(ZM_HAS_V4L1 1) set(ZM_HAS_V4L1 1)
endif(HAVE_LINUX_VIDEODEV_H) endif(HAVE_LINUX_VIDEODEV_H OR HAVE_LIBV4L1_VIDEODEV_H)
if(HAVE_LINUX_VIDEODEV2_H) if(HAVE_LINUX_VIDEODEV2_H)
set(ZM_HAS_V4L 1) set(ZM_HAS_V4L 1)
set(ZM_HAS_V4L2 1) set(ZM_HAS_V4L2 1)
endif(HAVE_LINUX_VIDEODEV2_H) endif(HAVE_LINUX_VIDEODEV2_H)
if((NOT HAVE_LINUX_VIDEODEV_H) AND (NOT HAVE_LINUX_VIDEODEV2_H)) if((NOT HAVE_LINUX_VIDEODEV_H) AND (NOT HAVE_LIBV4L1_VIDEODEV_H) AND (NOT HAVE_LINUX_VIDEODEV2_H))
message(AUTHOR_WARNING " Video 4 Linux headers weren't found - Analog and USB camera support will not be available") message(AUTHOR_WARNING " Video 4 Linux headers weren't found - Analog and USB camera support will not be available")
endif((NOT HAVE_LINUX_VIDEODEV_H) AND (NOT HAVE_LINUX_VIDEODEV2_H)) endif((NOT HAVE_LINUX_VIDEODEV_H) AND (NOT HAVE_LIBV4L1_VIDEODEV_H) AND (NOT HAVE_LINUX_VIDEODEV2_H))
# Check for PCRE and enable ZM_PCRE accordingly # Check for PCRE and enable ZM_PCRE accordingly
set(ZM_PCRE 0) set(ZM_PCRE 0)
if(HAVE_LIBPCRE AND HAVE_PCRE_H) if(HAVE_LIBPCRE AND HAVE_PCRE_H)

View File

@ -368,14 +368,26 @@ AC_CHECK_HEADERS(execinfo.h,,,)
AC_CHECK_HEADERS(ucontext.h,,,) AC_CHECK_HEADERS(ucontext.h,,,)
AC_CHECK_HEADERS(sys/syscall.h,,,) AC_CHECK_HEADERS(sys/syscall.h,,,)
AC_CHECK_HEADERS(pthread.h,,,) AC_CHECK_HEADERS(pthread.h,,,)
AC_CHECK_HEADERS(linux/videodev.h,AC_SUBST(ZM_HAS_V4L1,1),AC_SUBST(ZM_HAS_V4L1,0),)
AC_CHECK_HEADERS(linux/videodev2.h,AC_SUBST(ZM_HAS_V4L2,1),AC_SUBST(ZM_HAS_V4L2,0),) # Check for Video for Linux 1 Header Files
ZM_HAS_V4L1=0
AC_CHECK_HEADERS([libv4l1-videodev.h linux/videodev.h],[ZM_HAS_V4L1=1; break;],,)
AC_SUBST(ZM_HAS_V4L1)
# Check for Video for Linux 2 Header Files
ZM_HAS_V4L2=0
AC_CHECK_HEADERS(linux/videodev2.h,ZM_HAS_V4L2=1,,)
AC_SUBST(ZM_HAS_V4L2)
# Set global Video for Linux flag
ZM_HAS_V4L=0
if test "$ZM_HAS_V4L1" == "1" || test "$ZM_HAS_V4L2" == "1"; then if test "$ZM_HAS_V4L1" == "1" || test "$ZM_HAS_V4L2" == "1"; then
AC_SUBST(ZM_HAS_V4L,1) ZM_HAS_V4L=1
else else
AC_SUBST(ZM_HAS_V4L,0)
AC_MSG_WARN(zm requires Video4Linux or Video4Linux2 to be installed for analog or USB camera support) AC_MSG_WARN(zm requires Video4Linux or Video4Linux2 to be installed for analog or USB camera support)
fi fi
AC_SUBST(ZM_HAS_V4L)
AC_CHECK_HEADERS(jpeglib.h,,AC_MSG_ERROR(zm requires libjpeg headers to be installed),) AC_CHECK_HEADERS(jpeglib.h,,AC_MSG_ERROR(zm requires libjpeg headers to be installed),)
AC_CHECK_HEADERS(mysql/mysql.h,,AC_MSG_ERROR(zm requires MySQL headers - check that MySQL development packages are installed),) AC_CHECK_HEADERS(mysql/mysql.h,,AC_MSG_ERROR(zm requires MySQL headers - check that MySQL development packages are installed),)
AC_LANG_PUSH([C]) AC_LANG_PUSH([C])

View File

@ -31,7 +31,7 @@ BuildRequires: perl(MIME::Entity) perl(MIME::Lite)
BuildRequires: perl(PHP::Serialization) perl(Sys::Mmap) BuildRequires: perl(PHP::Serialization) perl(Sys::Mmap)
BuildRequires: perl(Time::HiRes) perl(Net::SFTP::Foreign) BuildRequires: perl(Time::HiRes) perl(Net::SFTP::Foreign)
BuildRequires: perl(Expect) perl(Sys::Syslog) BuildRequires: perl(Expect) perl(Sys::Syslog)
BuildRequires: gcc gcc-c++ vlc-devel libcurl-devel BuildRequires: gcc gcc-c++ vlc-devel libcurl-devel libv4l-devel
%{!?_without_ffmpeg:BuildRequires: ffmpeg-devel} %{!?_without_ffmpeg:BuildRequires: ffmpeg-devel}
%{!?_without_x10:BuildRequires: perl(X10::ActiveHome) perl(Astro::SunTime)} %{!?_without_x10:BuildRequires: perl(X10::ActiveHome) perl(Astro::SunTime)}
# cmake needs the following installed at build time due to the way it auto-detects certain parameters # cmake needs the following installed at build time due to the way it auto-detects certain parameters

View File

@ -31,7 +31,7 @@ BuildRequires: perl(MIME::Entity) perl(MIME::Lite)
BuildRequires: perl(PHP::Serialization) perl(Sys::Mmap) BuildRequires: perl(PHP::Serialization) perl(Sys::Mmap)
BuildRequires: perl(Time::HiRes) perl(Net::SFTP::Foreign) BuildRequires: perl(Time::HiRes) perl(Net::SFTP::Foreign)
BuildRequires: perl(Expect) perl(Sys::Syslog) BuildRequires: perl(Expect) perl(Sys::Syslog)
BuildRequires: gcc gcc-c++ vlc-devel libcurl-devel BuildRequires: gcc gcc-c++ vlc-devel libcurl-devel libv4l-devel
%{!?_without_ffmpeg:BuildRequires: ffmpeg-devel} %{!?_without_ffmpeg:BuildRequires: ffmpeg-devel}
%{!?_without_x10:BuildRequires: perl(X10::ActiveHome) perl(Astro::SunTime)} %{!?_without_x10:BuildRequires: perl(X10::ActiveHome) perl(Astro::SunTime)}
# cmake needs the following installed at build time due to the way it auto-detects certain parameters # cmake needs the following installed at build time due to the way it auto-detects certain parameters

View File

@ -27,7 +27,7 @@ BuildRequires: perl(MIME::Entity) perl(MIME::Lite)
BuildRequires: perl(PHP::Serialization) perl(Sys::Mmap) BuildRequires: perl(PHP::Serialization) perl(Sys::Mmap)
BuildRequires: perl(Time::HiRes) perl(Net::SFTP::Foreign) BuildRequires: perl(Time::HiRes) perl(Net::SFTP::Foreign)
BuildRequires: perl(Expect) perl(Sys::Syslog) BuildRequires: perl(Expect) perl(Sys::Syslog)
BuildRequires: gcc gcc-c++ vlc-devel libcurl-devel BuildRequires: gcc gcc-c++ vlc-devel libcurl-devel libv4l-devel
BuildRequires: ffmpeg ffmpeg-devel perl(X10::ActiveHome) perl(Astro::SunTime) BuildRequires: ffmpeg ffmpeg-devel perl(X10::ActiveHome) perl(Astro::SunTime)
# cmake needs the following installed at build time due to the way it auto-detects certain parameters # cmake needs the following installed at build time due to the way it auto-detects certain parameters
BuildRequires: httpd polkit-devel BuildRequires: httpd polkit-devel

View File

@ -29,6 +29,9 @@
#ifdef HAVE_LINUX_VIDEODEV_H #ifdef HAVE_LINUX_VIDEODEV_H
#include <linux/videodev.h> #include <linux/videodev.h>
#endif // HAVE_LINUX_VIDEODEV_H #endif // HAVE_LINUX_VIDEODEV_H
#ifdef HAVE_LIBV4L1_VIDEODEV_H
#include <libv4l1-videodev.h>
#endif // HAVE_LIB4VL1_VIDEODEV_H
#ifdef HAVE_LINUX_VIDEODEV2_H #ifdef HAVE_LINUX_VIDEODEV2_H
#include <linux/videodev2.h> #include <linux/videodev2.h>
#endif // HAVE_LINUX_VIDEODEV2_H #endif // HAVE_LINUX_VIDEODEV2_H

View File

@ -5,6 +5,7 @@
/* General system checks */ /* General system checks */
#cmakedefine HAVE_LINUX_VIDEODEV_H 1 #cmakedefine HAVE_LINUX_VIDEODEV_H 1
#cmakedefine HAVE_LIBV4L1_VIDEODEV_H 1
#cmakedefine HAVE_LINUX_VIDEODEV2_H 1 #cmakedefine HAVE_LINUX_VIDEODEV2_H 1
#cmakedefine HAVE_EXECINFO_H 1 #cmakedefine HAVE_EXECINFO_H 1
#cmakedefine HAVE_UCONTEXT_H 1 #cmakedefine HAVE_UCONTEXT_H 1