Kopete: Improve check for videodev header

This resolves bug 2725

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
(cherry picked from commit c7ed96db83)
pull/38/head
Slávek Banko 8 years ago
parent 1f93335507
commit 56484e2a73

@ -6,6 +6,9 @@
// for other OSes can be necessary to check
#define STDC_HEADERS 1
// kopete (libkopete/avdevice and plugins/motionautoaway)
#cmakedefine VIDEODEV_HEADER "@VIDEODEV_HEADER@"
// kopete/protocols/yahoo
#cmakedefine HAVE_STRINGS_H 1

@ -19,19 +19,22 @@ if( BUILD_KOPETE_PROTOCOL_JABBER AND WITH_JINGLE )
endif( )
endif( )
# -- Check for libv4l1-videodev.h presence --------------------
CHECK_INCLUDE_FILE ( "libv4l1-videodev.h" HAVE_LIBV4L1_VIDEODEV_H )
### Check for videodev header
check_include_file( "libv4l1-videodev.h" HAVE_LIBV4L1_VIDEODEV_H )
if( HAVE_LIBV4L1_VIDEODEV_H )
add_definitions( -DHAVE_LIBV4L1_VIDEODEV_H )
set( VIDEODEV_HEADER "libv4l1-videodev.h" CACHE INTERNAL "" )
else( )
check_include_file( "linux/videodev.h" HAVE_VIDEODEV_H )
if( HAVE_VIDEODEV_H )
set( VIDEODEV_HEADER "linux/videodev.h" CACHE INTERNAL "" )
else( )
if( BUILD_KOPETE_PLUGIN_MOTIONAUTOAWAY )
tde_message_fatal( "libv4l1-videodev.h or linux/videodev.h is required, but not found on your system" )
endif( BUILD_KOPETE_PLUGIN_MOTIONAUTOAWAY )
endif( )
# -- End libv4l1-videodev.h ----------------------------------------------
# -- Check for linux/videodev.h presence --------------------
CHECK_INCLUDE_FILE ( "linux/videodev.h" HAVE_LINUX_VIDEODEV_H )
if ( HAVE_LINUX_VIDEODEV_H )
add_definitions( -DHAVE_LINUX_VIDEODEV_H )
endif( )
# -- End linux-videodev.h ----------------------------------------------
### Check for tm_gmtoff in tm struct
check_struct_has_member( "struct tm" tm_gmtoff time.h HAVE_TM_GMTOFF )

@ -136,6 +136,19 @@ AC_SUBST(KOPETE_INCLUDES)
AC_SUBST(KOPETE_COMPAT_INCLUDES)
AC_SUBST(LIB_KOPETECOMPAT)
KDE_CHECK_HEADERS(
[libv4l1-videodev.h],
[videodev_header="libv4l1-videodev.h"],
[
KDE_CHECK_HEADERS([linux/videodev.h],
[videodev_header="linux/videodev.h"],
[videodev_header="no"])
])
if test ! x$videodev_header = xno; then
AC_DEFINE_UNQUOTED(VIDEODEV_HEADER, ["$videodev_header"], [Define header name for videodev])
fi
# -- Check for installed Valgrind headers --------------------
AC_MSG_CHECKING([for valgrind.h])

@ -1,43 +0,0 @@
# -- Check for libv4l1-videodev.h presence --------------------
AC_MSG_CHECKING([for libv4l1-videodev.h])
AC_TRY_COMPILE([
#include <libv4l1-videodev.h>
],
[
],
ac_have_libv4l1_videodev_h=yes
,
ac_have_libv4l1_videodev_h=no
)
if test $ac_have_libv4l1_videodev_h = yes; then
AC_DEFINE(HAVE_LIBV4L1_VIDEODEV_H, 1, [Define if you have libv4l1-videodev.h installed])
fi
AC_MSG_RESULT($ac_have_libv4l1_videodev_h)
# -- End libv4l1-videodev.h ----------------------------------------------
# -- Check for installed videodev headers --------------------
AC_MSG_CHECKING([for videodev.h])
AC_TRY_COMPILE([
#include <linux/videodev.h>
],
[
],
ac_have_videodev_h=yes
,
ac_have_videodev_h=no
)
if test $ac_have_videodev_h = yes; then
AC_DEFINE(HAVE_LINUX_VIDEODEV_H, 1, [Define if you have videodev.h installed])
fi
AC_MSG_RESULT($ac_have_videodev_h)
# -- End videodev ----------------------------------------------

@ -21,8 +21,8 @@
#if defined HAVE_CONFIG_H
#include <config.h>
#endif
#if defined HAVE_LINUX_VIDEODEV_H
#include <linux/videodev.h>
#if defined VIDEODEV_HEADER
#include VIDEODEV_HEADER
#endif
#if defined(__linux__)
#include <asm/types.h>

@ -35,8 +35,8 @@
#if (defined(__linux__) || defined(__FreeBSD__)) && defined(ENABLE_AV)
#if defined HAVE_LINUX_VIDEODEV_H
#include <linux/videodev.h>
#if defined VIDEODEV_HEADER
#include VIDEODEV_HEADER
#endif
#if defined(__linux__)
#include <asm/types.h>
@ -59,10 +59,8 @@
#include <linux/fs.h>
#include <linux/kernel.h>
#endif
#if defined(HAVE_LIBV4L1_VIDEODEV_H)
#include <libv4l1-videodev.h>
#elif defined(HAVE_LINUX_VIDEODEV_H)
#include <linux/videodev.h>
#if defined(VIDEODEV_HEADER)
#include VIDEODEV_HEADER
#else
#undef ENABLE_AV
#endif

@ -52,11 +52,7 @@
#endif
#endif
#ifdef HAVE_LIBV4L1_VIDEODEV_H
#include <libv4l1-videodev.h>
#else
#include <linux/videodev.h>
#endif
#include VIDEODEV_HEADER
#define DEF_WIDTH 352
#define DEF_HEIGHT 288

Loading…
Cancel
Save