Browse Source

Merge pull request #1413 from thess/libv4l-fix

libv4l: Fix musl compatibility, update to 1.6.3
Ted Hess 9 years ago
parent
commit
327f74e884

+ 3
- 2
libs/libv4l/Makefile View File

@@ -9,12 +9,12 @@
9 9
 include $(TOPDIR)/rules.mk
10 10
 
11 11
 PKG_NAME:=v4l-utils
12
-PKG_VERSION:=1.6.2
12
+PKG_VERSION:=1.6.3
13 13
 PKG_RELEASE:=1
14 14
 
15 15
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
16 16
 PKG_SOURCE_URL:=http://www.linuxtv.org/downloads/v4l-utils
17
-PKG_MD5SUM:=9cb3c178f937954e65bf30920af433ef
17
+PKG_MD5SUM:=307858616be6374f63bf946307f15a7f
18 18
 
19 19
 PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
20 20
 
@@ -22,6 +22,7 @@ PKG_LICENSE:=GPL-2.0 LGPL-2.1
22 22
 PKG_LICENSE_FILES:=COPYING COPYING.libv4l
23 23
 
24 24
 PKG_USE_MIPS16:=0
25
+PKG_FIXUP:=autoreconf
25 26
 PKG_INSTALL:=1
26 27
 
27 28
 PKG_BUILD_DEPENDS:=argp-standalone

+ 23
- 0
libs/libv4l/patches/005-test_for_posix_ioctl.patch View File

@@ -0,0 +1,23 @@
1
+--- a/configure.ac
2
++++ b/configure.ac
3
+@@ -80,6 +80,20 @@ gl_VISIBILITY
4
+ AC_CHECK_HEADERS([sys/klog.h])
5
+ AC_CHECK_FUNCS([klogctl])
6
+ 
7
++AC_CACHE_CHECK([for ioctl with POSIX signature],
8
++  [gl_cv_func_ioctl_posix_signature],
9
++  [AC_COMPILE_IFELSE(
10
++     [AC_LANG_PROGRAM(
11
++        [[#include <sys/ioctl.h>]],
12
++        [[int ioctl (int, int, ...);]])
13
++     ],
14
++     [gl_cv_func_ioctl_posix_signature=yes],
15
++     [gl_cv_func_ioctl_posix_signature=no])
16
++  ])
17
++if test "x$gl_cv_func_ioctl_posix_signature" = xyes; then
18
++  AC_DEFINE([HAVE_POSIX_IOCTL], [1], [Have ioctl with POSIX signature])
19
++fi
20
++
21
+ # Check host os
22
+ case "$host_os" in
23
+   linux*)

+ 18
- 0
libs/libv4l/patches/020-add-missing-includes.patch View File

@@ -8,3 +8,21 @@
8 8
  #include <fcntl.h>
9 9
  #include <errno.h>
10 10
  #include <sys/ioctl.h>
11
+@@ -36,6 +37,7 @@
12
+ #include <dirent.h>
13
+ #include <config.h>
14
+ #include <signal.h>
15
++#include <time.h>
16
+ 
17
+ #include <linux/videodev2.h>
18
+ #include <libv4l2.h>
19
+--- a/utils/v4l2-ctl/v4l2-ctl-streaming.cpp
20
++++ b/utils/v4l2-ctl/v4l2-ctl-streaming.cpp
21
+@@ -14,6 +14,7 @@
22
+ #include <sys/mman.h>
23
+ #include <dirent.h>
24
+ #include <math.h>
25
++#include <time.h>
26
+ 
27
+ #include "v4l2-ctl.h"
28
+ 

+ 92
- 0
libs/libv4l/patches/030-musl_compatibility.patch View File

@@ -0,0 +1,92 @@
1
+--- a/lib/libv4lconvert/libv4lsyscall-priv.h
2
++++ b/lib/libv4lconvert/libv4lsyscall-priv.h
3
+@@ -35,14 +35,19 @@
4
+    which is broken on some systems and doesn't include them itself :( */
5
+ 
6
+ #ifdef linux
7
++#define __NEED_off_t
8
+ #include <sys/time.h>
9
+ #include <syscall.h>
10
+ #include <linux/types.h>
11
+ #include <linux/ioctl.h>
12
+ /* On 32 bits archs we always use mmap2, on 64 bits archs there is no mmap2 */
13
+ #ifdef __NR_mmap2
14
++#undef SYS_mmap2
15
+ #define	SYS_mmap2 __NR_mmap2
16
+ #define	MMAP2_PAGE_SHIFT 12
17
++#if !(defined(__UCLIBC__) || defined(__GLIBC__))
18
++typedef off_t __off_t;
19
++#endif
20
+ #else
21
+ #define	SYS_mmap2 SYS_mmap
22
+ #define	MMAP2_PAGE_SHIFT 0
23
+--- a/lib/libv4l1/v4l1compat.c
24
++++ b/lib/libv4l1/v4l1compat.c
25
+@@ -62,7 +62,7 @@ LIBV4L_PUBLIC int open(const char *file,
26
+ 	return fd;
27
+ }
28
+ 
29
+-#ifdef linux
30
++#if defined(linux) && (defined(__GLIBC__) || defined(__UCLIBC__))
31
+ LIBV4L_PUBLIC int open64(const char *file, int oflag, ...)
32
+ {
33
+ 	int fd;
34
+@@ -94,7 +94,11 @@ LIBV4L_PUBLIC int dup(int fd)
35
+ 	return v4l1_dup(fd);
36
+ }
37
+ 
38
++#ifdef HAVE_POSIX_IOCTL
39
++LIBV4L_PUBLIC int ioctl(int fd, int request, ...)
40
++#else
41
+ LIBV4L_PUBLIC int ioctl(int fd, unsigned long int request, ...)
42
++#endif
43
+ {
44
+ 	void *arg;
45
+ 	va_list ap;
46
+@@ -112,12 +116,12 @@ LIBV4L_PUBLIC ssize_t read(int fd, void
47
+ }
48
+ 
49
+ LIBV4L_PUBLIC void *mmap(void *start, size_t length, int prot, int flags, int fd,
50
+-		__off_t offset)
51
++		off_t offset)
52
+ {
53
+ 	return v4l1_mmap(start, length, prot, flags, fd, offset);
54
+ }
55
+ 
56
+-#ifdef linux
57
++#if defined(linux) && (defined(__GLIBC__) || defined(__UCLIBC__))
58
+ LIBV4L_PUBLIC void *mmap64(void *start, size_t length, int prot, int flags, int fd,
59
+ 		__off64_t offset)
60
+ {
61
+--- a/lib/libv4l2/v4l2convert.c
62
++++ b/lib/libv4l2/v4l2convert.c
63
+@@ -86,7 +86,7 @@ LIBV4L_PUBLIC int open(const char *file,
64
+ 	return fd;
65
+ }
66
+ 
67
+-#ifdef linux
68
++#if defined(linux) && (defined(__GLIBC__) || defined(__UCLIBC__))
69
+ LIBV4L_PUBLIC int open64(const char *file, int oflag, ...)
70
+ {
71
+ 	int fd;
72
+@@ -121,7 +121,11 @@ LIBV4L_PUBLIC int dup(int fd)
73
+ 	return v4l2_dup(fd);
74
+ }
75
+ 
76
++#ifdef HAVE_POSIX_IOCTL
77
++LIBV4L_PUBLIC int ioctl(int fd, int request, ...)
78
++#else
79
+ LIBV4L_PUBLIC int ioctl(int fd, unsigned long int request, ...)
80
++#endif
81
+ {
82
+ 	void *arg;
83
+ 	va_list ap;
84
+@@ -144,7 +148,7 @@ LIBV4L_PUBLIC void *mmap(void *start, si
85
+ 	return v4l2_mmap(start, length, prot, flags, fd, offset);
86
+ }
87
+ 
88
+-#ifdef linux
89
++#if defined(linux) && (defined(__GLIBC__) || defined(__UCLIBC__))
90
+ LIBV4L_PUBLIC void *mmap64(void *start, size_t length, int prot, int flags, int fd,
91
+ 		__off64_t offset)
92
+ {