@ -0,0 +1,36 @@ | |||
From 1948dd03d69c1a50e92d7e8868b7d6eabd4873c1 Mon Sep 17 00:00:00 2001 | |||
From: Yousong Zhou <yszhou4tech@gmail.com> | |||
Date: Wed, 17 Jun 2015 16:11:31 +0800 | |||
Subject: [PATCH 1/7] build: always use /lib instead of /lib64. | |||
* configure.ac: OpenWrt does not use /lib64. | |||
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com> | |||
--- | |||
configure.ac | 10 +--------- | |||
1 file changed, 1 insertion(+), 9 deletions(-) | |||
diff --git a/configure.ac b/configure.ac | |||
index fd0e310..306b6e2 100644 | |||
--- a/configure.ac | |||
+++ b/configure.ac | |||
@@ -25,15 +25,7 @@ dnl If we use /usr as prefix, use /etc for config files | |||
then | |||
sysconfdir="/etc" | |||
fi | |||
- if test ${libdir} = '${exec_prefix}/lib' | |||
- then | |||
- case "`uname -m`" in | |||
- x86_64|ppc64|s390x|sparc64) | |||
- libdir="/lib64" ;; | |||
- *) | |||
- libdir="/lib" ;; | |||
- esac | |||
- fi | |||
+ libdir="/lib" | |||
if test ${sbindir} = '${exec_prefix}/sbin' | |||
then | |||
sbindir="/sbin" | |||
-- | |||
1.7.10.4 | |||
@ -1,28 +0,0 @@ | |||
From ee916fd0ec70eb37a97da29f6ec0c26bef7cf6f2 Mon Sep 17 00:00:00 2001 | |||
From: Yousong Zhou <yszhou4tech@gmail.com> | |||
Date: Wed, 17 Jun 2015 16:11:31 +0800 | |||
Subject: [PATCH 1/7] build: use $host_cpu for lib64 directory handling. | |||
* configure.ac: use $host_cpu for lib64 directory handling. | |||
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com> | |||
--- | |||
configure.ac | 2 +- | |||
1 file changed, 1 insertion(+), 1 deletion(-) | |||
diff --git a/configure.ac b/configure.ac | |||
index fd0e310..1bc2591 100644 | |||
--- a/configure.ac | |||
+++ b/configure.ac | |||
@@ -27,7 +27,7 @@ dnl If we use /usr as prefix, use /etc for config files | |||
fi | |||
if test ${libdir} = '${exec_prefix}/lib' | |||
then | |||
- case "`uname -m`" in | |||
+ case "$host_cpu" in | |||
x86_64|ppc64|s390x|sparc64) | |||
libdir="/lib64" ;; | |||
*) | |||
-- | |||
1.7.10.4 | |||
@ -0,0 +1,23 @@ | |||
--- a/configure.ac | |||
+++ b/configure.ac | |||
@@ -80,6 +80,20 @@ gl_VISIBILITY | |||
AC_CHECK_HEADERS([sys/klog.h]) | |||
AC_CHECK_FUNCS([klogctl]) | |||
+AC_CACHE_CHECK([for ioctl with POSIX signature], | |||
+ [gl_cv_func_ioctl_posix_signature], | |||
+ [AC_COMPILE_IFELSE( | |||
+ [AC_LANG_PROGRAM( | |||
+ [[#include <sys/ioctl.h>]], | |||
+ [[int ioctl (int, int, ...);]]) | |||
+ ], | |||
+ [gl_cv_func_ioctl_posix_signature=yes], | |||
+ [gl_cv_func_ioctl_posix_signature=no]) | |||
+ ]) | |||
+if test "x$gl_cv_func_ioctl_posix_signature" = xyes; then | |||
+ AC_DEFINE([HAVE_POSIX_IOCTL], [1], [Have ioctl with POSIX signature]) | |||
+fi | |||
+ | |||
# Check host os | |||
case "$host_os" in | |||
linux*) |
@ -0,0 +1,92 @@ | |||
--- a/lib/libv4lconvert/libv4lsyscall-priv.h | |||
+++ b/lib/libv4lconvert/libv4lsyscall-priv.h | |||
@@ -35,14 +35,19 @@ | |||
which is broken on some systems and doesn't include them itself :( */ | |||
#ifdef linux | |||
+#define __NEED_off_t | |||
#include <sys/time.h> | |||
#include <syscall.h> | |||
#include <linux/types.h> | |||
#include <linux/ioctl.h> | |||
/* On 32 bits archs we always use mmap2, on 64 bits archs there is no mmap2 */ | |||
#ifdef __NR_mmap2 | |||
+#undef SYS_mmap2 | |||
#define SYS_mmap2 __NR_mmap2 | |||
#define MMAP2_PAGE_SHIFT 12 | |||
+#if !(defined(__UCLIBC__) || defined(__GLIBC__)) | |||
+typedef off_t __off_t; | |||
+#endif | |||
#else | |||
#define SYS_mmap2 SYS_mmap | |||
#define MMAP2_PAGE_SHIFT 0 | |||
--- a/lib/libv4l1/v4l1compat.c | |||
+++ b/lib/libv4l1/v4l1compat.c | |||
@@ -62,7 +62,7 @@ LIBV4L_PUBLIC int open(const char *file, | |||
return fd; | |||
} | |||
-#ifdef linux | |||
+#if defined(linux) && (defined(__GLIBC__) || defined(__UCLIBC__)) | |||
LIBV4L_PUBLIC int open64(const char *file, int oflag, ...) | |||
{ | |||
int fd; | |||
@@ -94,7 +94,11 @@ LIBV4L_PUBLIC int dup(int fd) | |||
return v4l1_dup(fd); | |||
} | |||
+#ifdef HAVE_POSIX_IOCTL | |||
+LIBV4L_PUBLIC int ioctl(int fd, int request, ...) | |||
+#else | |||
LIBV4L_PUBLIC int ioctl(int fd, unsigned long int request, ...) | |||
+#endif | |||
{ | |||
void *arg; | |||
va_list ap; | |||
@@ -112,12 +116,12 @@ LIBV4L_PUBLIC ssize_t read(int fd, void | |||
} | |||
LIBV4L_PUBLIC void *mmap(void *start, size_t length, int prot, int flags, int fd, | |||
- __off_t offset) | |||
+ off_t offset) | |||
{ | |||
return v4l1_mmap(start, length, prot, flags, fd, offset); | |||
} | |||
-#ifdef linux | |||
+#if defined(linux) && (defined(__GLIBC__) || defined(__UCLIBC__)) | |||
LIBV4L_PUBLIC void *mmap64(void *start, size_t length, int prot, int flags, int fd, | |||
__off64_t offset) | |||
{ | |||
--- a/lib/libv4l2/v4l2convert.c | |||
+++ b/lib/libv4l2/v4l2convert.c | |||
@@ -86,7 +86,7 @@ LIBV4L_PUBLIC int open(const char *file, | |||
return fd; | |||
} | |||
-#ifdef linux | |||
+#if defined(linux) && (defined(__GLIBC__) || defined(__UCLIBC__)) | |||
LIBV4L_PUBLIC int open64(const char *file, int oflag, ...) | |||
{ | |||
int fd; | |||
@@ -121,7 +121,11 @@ LIBV4L_PUBLIC int dup(int fd) | |||
return v4l2_dup(fd); | |||
} | |||
+#ifdef HAVE_POSIX_IOCTL | |||
+LIBV4L_PUBLIC int ioctl(int fd, int request, ...) | |||
+#else | |||
LIBV4L_PUBLIC int ioctl(int fd, unsigned long int request, ...) | |||
+#endif | |||
{ | |||
void *arg; | |||
va_list ap; | |||
@@ -144,7 +148,7 @@ LIBV4L_PUBLIC void *mmap(void *start, si | |||
return v4l2_mmap(start, length, prot, flags, fd, offset); | |||
} | |||
-#ifdef linux | |||
+#if defined(linux) && (defined(__GLIBC__) || defined(__UCLIBC__)) | |||
LIBV4L_PUBLIC void *mmap64(void *start, size_t length, int prot, int flags, int fd, | |||
__off64_t offset) | |||
{ |
@ -0,0 +1,13 @@ | |||
--- a/mjpg_streamer.h | |||
+++ b/mjpg_streamer.h | |||
@@ -29,6 +29,10 @@ | |||
#define MAX_OUTPUT_PLUGINS 10 | |||
#define MAX_PLUGIN_ARGUMENTS 32 | |||
+#define __NEED_pthread_t | |||
+#define __NEED_pthread_mutex_t | |||
+#define __NEED_pthread_cond_t | |||
+ | |||
#include <linux/types.h> /* for videodev2.h */ | |||
#include <linux/videodev2.h> | |||