summaryrefslogtreecommitdiffstats
path: root/kopete
diff options
context:
space:
mode:
Diffstat (limited to 'kopete')
-rw-r--r--kopete/ConfigureChecks.cmake27
-rw-r--r--kopete/configure.in.in13
-rw-r--r--kopete/libkopete/avdevice/configure.in.in43
-rw-r--r--kopete/libkopete/avdevice/videocontrol.h4
-rw-r--r--kopete/libkopete/avdevice/videodevice.h10
-rw-r--r--kopete/plugins/motionautoaway/motionawayplugin.cpp6
6 files changed, 35 insertions, 68 deletions
diff --git a/kopete/ConfigureChecks.cmake b/kopete/ConfigureChecks.cmake
index ef0a250f..44939818 100644
--- a/kopete/ConfigureChecks.cmake
+++ b/kopete/ConfigureChecks.cmake
@@ -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 )
-if ( HAVE_LIBV4L1_VIDEODEV_H )
- add_definitions( -DHAVE_LIBV4L1_VIDEODEV_H )
-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 videodev header
+check_include_file( "libv4l1-videodev.h" HAVE_LIBV4L1_VIDEODEV_H )
+if( HAVE_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( )
+endif( )
+
### Check for tm_gmtoff in tm struct
check_struct_has_member( "struct tm" tm_gmtoff time.h HAVE_TM_GMTOFF )
diff --git a/kopete/configure.in.in b/kopete/configure.in.in
index 261f4f6f..989b410d 100644
--- a/kopete/configure.in.in
+++ b/kopete/configure.in.in
@@ -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])
diff --git a/kopete/libkopete/avdevice/configure.in.in b/kopete/libkopete/avdevice/configure.in.in
deleted file mode 100644
index 4a446c03..00000000
--- a/kopete/libkopete/avdevice/configure.in.in
+++ /dev/null
@@ -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 ----------------------------------------------
diff --git a/kopete/libkopete/avdevice/videocontrol.h b/kopete/libkopete/avdevice/videocontrol.h
index e2d89756..af6b5138 100644
--- a/kopete/libkopete/avdevice/videocontrol.h
+++ b/kopete/libkopete/avdevice/videocontrol.h
@@ -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>
diff --git a/kopete/libkopete/avdevice/videodevice.h b/kopete/libkopete/avdevice/videodevice.h
index dd9047c9..970f6655 100644
--- a/kopete/libkopete/avdevice/videodevice.h
+++ b/kopete/libkopete/avdevice/videodevice.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
diff --git a/kopete/plugins/motionautoaway/motionawayplugin.cpp b/kopete/plugins/motionautoaway/motionawayplugin.cpp
index 4d768710..f8494fff 100644
--- a/kopete/plugins/motionautoaway/motionawayplugin.cpp
+++ b/kopete/plugins/motionautoaway/motionawayplugin.cpp
@@ -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