Kopete: Improve check for videodev header

This resolves bug 2725

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
pull/1/head
Slávek Banko 8 years ago
parent 60880aed60
commit c7ed96db83

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

@ -19,19 +19,22 @@ if( BUILD_KOPETE_PROTOCOL_JABBER AND WITH_JINGLE )
endif( ) endif( )
endif( ) endif( )
# -- Check for libv4l1-videodev.h presence --------------------
CHECK_INCLUDE_FILE ( "libv4l1-videodev.h" HAVE_LIBV4L1_VIDEODEV_H )
if ( HAVE_LIBV4L1_VIDEODEV_H )
add_definitions( -DHAVE_LIBV4L1_VIDEODEV_H )
endif ( )
# -- End libv4l1-videodev.h ----------------------------------------------
# -- Check for linux/videodev.h presence -------------------- ### Check for videodev header
CHECK_INCLUDE_FILE ( "linux/videodev.h" HAVE_LINUX_VIDEODEV_H ) check_include_file( "libv4l1-videodev.h" HAVE_LIBV4L1_VIDEODEV_H )
if ( HAVE_LINUX_VIDEODEV_H ) if( HAVE_LIBV4L1_VIDEODEV_H )
add_definitions( -DHAVE_LINUX_VIDEODEV_H ) set( VIDEODEV_HEADER "libv4l1-videodev.h" CACHE INTERNAL "" )
endif ( ) else( )
# -- End linux-videodev.h ---------------------------------------------- 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( )
endif( )
### Check for tm_gmtoff in tm struct ### Check for tm_gmtoff in tm struct
check_struct_has_member( "struct tm" tm_gmtoff time.h HAVE_TM_GMTOFF ) 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(KOPETE_COMPAT_INCLUDES)
AC_SUBST(LIB_KOPETECOMPAT) 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 -------------------- # -- Check for installed Valgrind headers --------------------
AC_MSG_CHECKING([for valgrind.h]) 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 #if defined HAVE_CONFIG_H
#include <config.h> #include <config.h>
#endif #endif
#if defined HAVE_LINUX_VIDEODEV_H #if defined VIDEODEV_HEADER
#include <linux/videodev.h> #include VIDEODEV_HEADER
#endif #endif
#if defined(__linux__) #if defined(__linux__)
#include <asm/types.h> #include <asm/types.h>

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

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

Loading…
Cancel
Save