From ab9a2a8b5e5b805595b3cf50be392c119e9af8b8 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Sun, 23 Jun 2013 22:01:39 -0500 Subject: Fix kstars not detecting videodev2.h This resolves Bug 1372 --- kstars/configure.in.in | 13 ++++++++++++- kstars/kstars/indi/v4lphilips.h | 2 ++ kstars/kstars/indi/webcam/v4l1_base.h | 4 ++++ kstars/kstars/indi/webcam/v4l1_pwc.h | 4 ++++ 4 files changed, 22 insertions(+), 1 deletion(-) diff --git a/kstars/configure.in.in b/kstars/configure.in.in index 19f17c3b..f5fad3c4 100644 --- a/kstars/configure.in.in +++ b/kstars/configure.in.in @@ -87,7 +87,18 @@ case "$target" in [have_v4l2=true], [have_v4l2=false], [#include -#include ]) + #include ]) + if test x$have_v4l2 = xfalse; then + unset ac_cv_type_struct_v4l2_buffer + AC_CHECK_TYPE([struct v4l2_buffer], + [have_v4l2=true], + [have_v4l2=false], + [#include + #include ]) + if test x$have_v4l2 = xtrue; then + AC_DEFINE(HAVE_LINUX_ALTERNATE_VIDEODEV_H, 1, [Define to 1 if you have the header file.]) + fi + fi if test x$have_v4l2 = xfalse; then KERNEL_VERSION=`uname -r` AC_CHECK_FILE(/lib/modules/$KERNEL_VERSION/build/include/linux/videodev2.h, diff --git a/kstars/kstars/indi/v4lphilips.h b/kstars/kstars/indi/v4lphilips.h index 59c33f0a..19aa3b3d 100644 --- a/kstars/kstars/indi/v4lphilips.h +++ b/kstars/kstars/indi/v4lphilips.h @@ -20,6 +20,8 @@ */ +#include + #ifndef HAVE_LINUX_VIDEODEV2_H #include "webcam/v4l1_pwc.h" #endif diff --git a/kstars/kstars/indi/webcam/v4l1_base.h b/kstars/kstars/indi/webcam/v4l1_base.h index 7a7c93f9..60586104 100644 --- a/kstars/kstars/indi/webcam/v4l1_base.h +++ b/kstars/kstars/indi/webcam/v4l1_base.h @@ -24,7 +24,11 @@ #include #include +#ifdef HAVE_LINUX_ALTERNATE_VIDEODEV_H #include "videodev.h" +#else +#include "videodev2.h" +#endif #include "../eventloop.h" class V4L1_Base diff --git a/kstars/kstars/indi/webcam/v4l1_pwc.h b/kstars/kstars/indi/webcam/v4l1_pwc.h index 3790daa2..84fccf6a 100644 --- a/kstars/kstars/indi/webcam/v4l1_pwc.h +++ b/kstars/kstars/indi/webcam/v4l1_pwc.h @@ -23,7 +23,11 @@ #include #include +#ifdef HAVE_LINUX_ALTERNATE_VIDEODEV_H #include "videodev.h" +#else +#include "videodev2.h" +#endif #include "v4l1_base.h" class V4L1_PWC : public V4L1_Base -- cgit v1.2.1