Browse Source
(cherry picked from commit 6f20847b5d) (edited)
edited:
* aom has different android patches
* srt has extra fix-partial-availability patch
* upnp is using LIBUPNP_ECFLAGS on 3.0
* vpx is using VPX_HOSTVARS on 3.0
* zvbi has the pthreads dependency for all targets, already has ZVBI_CFLAGS and removed macos hack already
* srt doesn't have some gcc/pthread patches and had CMakeLists.txt-let-cmake-find-pthread patch
Signed-off-by: Steve Lhomme <robux4@ycbcr.xyz>
pull/135/head
18 changed files with 145 additions and 136 deletions
@ -1,82 +0,0 @@ |
|||
--- libupnp/configure.ac.orig 2011-02-09 00:55:44.000000000 +0100
|
|||
+++ libupnp/configure.ac 2011-02-10 23:39:44.154929678 +0100
|
|||
@@ -397,7 +397,6 @@
|
|||
AC_PROG_MAKE_SET |
|||
AC_PROG_EGREP |
|||
|
|||
-#
|
|||
# Default compilation flags |
|||
# |
|||
echo "--------------------- Default compilation flags -------------------------------" |
|||
@@ -531,39 +530,46 @@
|
|||
# Checks for POSIX Threads |
|||
# |
|||
echo "--------------------------- pthread stuff -------------------------------------" |
|||
-ACX_PTHREAD(
|
|||
- [],
|
|||
- [AC_MSG_ERROR([POSIX threads are required to build this program])])
|
|||
+#ACX_PTHREAD(
|
|||
+# [],
|
|||
+# [AC_MSG_ERROR([POSIX threads are required to build this program])])
|
|||
# |
|||
+PTHREAD_LIBS=" -lpthreadGC2 -lws2_32"
|
|||
+PTHREAD_CFLAGS=" -DPTW32_STATIC_LIB -DUPNP_STATIC_LIB"
|
|||
# Update environment variables for pthreads |
|||
# |
|||
-CC="$PTHREAD_CC"
|
|||
+#CC="$PTHREAD_CC"
|
|||
CFLAGS="$PTHREAD_CFLAGS $CFLAGS" |
|||
LIBS="$PTHREAD_LIBS $LIBS" |
|||
+
|
|||
+AC_SUBST(PTHREAD_LIBS)
|
|||
+AC_SUBST(PTHREAD_CFLAGS)
|
|||
+AC_SUBST(PTHREAD_CC)
|
|||
+
|
|||
# |
|||
# Determine if pthread_rwlock_t is available |
|||
# |
|||
-echo "----------------------- pthread_rwlock_t stuff --------------------------------"
|
|||
-AC_MSG_CHECKING([if pthread_rwlock_t is available])
|
|||
-AC_LANG([C])
|
|||
-AC_COMPILE_IFELSE(
|
|||
- [AC_LANG_PROGRAM(
|
|||
- [#include <pthread.h>],
|
|||
- [pthread_rwlock_t *x;])],
|
|||
- [AC_DEFINE([UPNP_USE_RWLOCK], [1], [Use pthread_rwlock_t])
|
|||
- AC_MSG_RESULT([yes, supported without any options])],
|
|||
- [AC_COMPILE_IFELSE(
|
|||
- [AC_LANG_PROGRAM(
|
|||
- [#define _GNU_SOURCE
|
|||
- #include <pthread.h>],
|
|||
- [pthread_rwlock_t *x;])],
|
|||
- [AC_DEFINE([UPNP_USE_RWLOCK], [1], [Use pthread_rwlock_t])
|
|||
- CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
|
|||
- AC_MSG_RESULT([yes, definition of _GNU_SOURCE required])],
|
|||
- [AC_DEFINE([UPNP_USE_RWLOCK], [0], [Do not use pthread_rwlock_t])
|
|||
- AC_MSG_RESULT([no, needs to fallback to pthread_mutex])
|
|||
- AC_MSG_ERROR([pthread_rwlock_t not available])])])
|
|||
-echo "-------------------------------------------------------------------------------"
|
|||
+#echo "----------------------- pthread_rwlock_t stuff --------------------------------"
|
|||
+#AC_MSG_CHECKING([if pthread_rwlock_t is available])
|
|||
+#AC_LANG([C])
|
|||
+#AC_COMPILE_IFELSE(
|
|||
+# [AC_LANG_PROGRAM(
|
|||
+# [#include <pthread.h>],
|
|||
+# [pthread_rwlock_t *x;])],
|
|||
+# [AC_DEFINE([UPNP_USE_RWLOCK], [1], [Use pthread_rwlock_t])
|
|||
+# AC_MSG_RESULT([yes, supported without any options])],
|
|||
+# [AC_COMPILE_IFELSE(
|
|||
+# [AC_LANG_PROGRAM(
|
|||
+# [#define _GNU_SOURCE
|
|||
+# #include <pthread.h>],
|
|||
+# [pthread_rwlock_t *x;])],
|
|||
+# [AC_DEFINE([UPNP_USE_RWLOCK], [1], [Use pthread_rwlock_t])
|
|||
+# CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
|
|||
+# AC_MSG_RESULT([yes, definition of _GNU_SOURCE required])],
|
|||
+# [AC_DEFINE([UPNP_USE_RWLOCK], [0], [Do not use pthread_rwlock_t])
|
|||
+# AC_MSG_RESULT([no, needs to fallback to pthread_mutex])
|
|||
+# AC_MSG_ERROR([pthread_rwlock_t not available])])])
|
|||
+#echo "-------------------------------------------------------------------------------"
|
|||
|
|||
|
|||
AC_CONFIG_FILES([ |
|||
@ -0,0 +1,54 @@ |
|||
--- upnp/threadutil/src/ThreadPool.c.pthread-w32 2018-05-17 10:53:48.438587300 +0200
|
|||
+++ upnp/threadutil/src/ThreadPool.c 2018-05-17 10:54:03.696907300 +0200
|
|||
@@ -34,7 +34,7 @@
|
|||
* \file |
|||
*/ |
|||
|
|||
-#if !defined(WIN32)
|
|||
+#if !defined(WIN32) || !defined(_MSC_VER)
|
|||
#include <sys/param.h> |
|||
#endif |
|||
|
|||
@@ -263,8 +263,16 @@ static int SetPolicyType(
|
|||
#elif defined(__OSX__) || defined(__APPLE__) || defined(__NetBSD__) |
|||
setpriority(PRIO_PROCESS, 0, 0); |
|||
retVal = 0; |
|||
-#elif defined(WIN32)
|
|||
+#elif defined(PTW32_LEVEL)
|
|||
retVal = sched_setscheduler(0, in); |
|||
+#elif defined(WIN32)
|
|||
+ struct sched_param current;
|
|||
+ int sched_result;
|
|||
+
|
|||
+ memset(¤t, 0, sizeof(current));
|
|||
+ current.sched_priority = sched_get_priority_min(DEFAULT_POLICY);
|
|||
+ sched_result = sched_setscheduler(0, in, ¤t);
|
|||
+ retVal = (sched_result != -1 || errno == EPERM) ? 0 : errno;
|
|||
#elif defined(_POSIX_PRIORITY_SCHEDULING) && _POSIX_PRIORITY_SCHEDULING > 0 |
|||
struct sched_param current; |
|||
int sched_result; |
|||
@@ -415,11 +423,11 @@ static void SetSeed(void)
|
|||
struct timeval t; |
|||
|
|||
gettimeofday(&t, NULL); |
|||
-#if defined(WIN32)
|
|||
+#if defined(PTW32_LEVEL)
|
|||
srand((unsigned int)t.tv_usec + (unsigned int)ithread_get_current_thread_id().p); |
|||
#elif defined(BSD) || defined(__OSX__) || defined(__APPLE__) || defined(__FreeBSD_kernel__) |
|||
srand((unsigned int)t.tv_usec + (unsigned int)ithread_get_current_thread_id()); |
|||
-#elif defined(__linux__) || defined(__sun) || defined(__CYGWIN__) || defined(__GLIBC__)
|
|||
+#elif defined(__linux__) || defined(__sun) || defined(__CYGWIN__) || defined(__GLIBC__) || defined(WIN32)
|
|||
srand((unsigned int)t.tv_usec + (unsigned int)ithread_get_current_thread_id()); |
|||
#else |
|||
{ |
|||
--- upnp/upnp/src/api/upnpdebug.c.pthread-w32 2018-05-17 10:53:05.030173700 +0200
|
|||
+++ upnp/upnp/src/api/upnpdebug.c 2018-05-17 10:53:44.686358100 +0200
|
|||
@@ -183,7 +183,7 @@ void UpnpDisplayFileAndLine(FILE *fd, co
|
|||
lines[i] = buf[i]; |
|||
/* Put the debug lines in the buffer */ |
|||
sprintf(buf[0], "DEBUG - THREAD ID: 0x%lX", |
|||
-#ifdef WIN32
|
|||
+#if defined(PTW32_LEVEL)
|
|||
(unsigned long int)ithread_self().p |
|||
#else |
|||
(unsigned long int)ithread_self() |
|||
@ -0,0 +1,19 @@ |
|||
--- upnp/configure.ac.pthread-w32 2018-05-17 11:51:47.115502500 +0200
|
|||
+++ upnp/configure.ac 2018-05-17 12:49:30.371786100 +0200
|
|||
@@ -667,6 +667,7 @@ ACX_PTHREAD(
|
|||
# |
|||
# Update environment variables for pthreads |
|||
# |
|||
+PTHREAD_LIBS="-lpthreadGC2"
|
|||
CC="$PTHREAD_CC" |
|||
CFLAGS="$PTHREAD_CFLAGS $CFLAGS" |
|||
LIBS="$PTHREAD_LIBS $LIBS" |
|||
@@ -676,7 +677,7 @@ PC_CFLAGS="$PTHREAD_CFLAGS"
|
|||
# WIN32 specific |
|||
if test "$ac_cv_win32" = "yes"; then |
|||
WIN32_LIBS="-liphlpapi -lws2_32" |
|||
-PC_CFLAGS="$PC_CFLAGS -DUPNP_STATIC_LIB"
|
|||
+PC_CFLAGS="$PC_CFLAGS -DUPNP_STATIC_LIB -DPTW32_STATIC_LIB"
|
|||
fi |
|||
AC_SUBST(PC_CFLAGS) |
|||
AC_SUBST(WIN32_LIBS) |
|||
@ -0,0 +1,31 @@ |
|||
--- upnp/configure.ac.win32 2013-11-15 17:18:45.000000000 +0100
|
|||
+++ upnp/configure.ac 2018-05-17 11:41:56.647083600 +0200
|
|||
@@ -670,6 +670,17 @@ ACX_PTHREAD(
|
|||
CC="$PTHREAD_CC" |
|||
CFLAGS="$PTHREAD_CFLAGS $CFLAGS" |
|||
LIBS="$PTHREAD_LIBS $LIBS" |
|||
+
|
|||
+PC_CFLAGS="$PTHREAD_CFLAGS"
|
|||
+
|
|||
+# WIN32 specific
|
|||
+if test "$ac_cv_win32" = "yes"; then
|
|||
+WIN32_LIBS="-liphlpapi -lws2_32"
|
|||
+PC_CFLAGS="$PC_CFLAGS -DUPNP_STATIC_LIB"
|
|||
+fi
|
|||
+AC_SUBST(PC_CFLAGS)
|
|||
+AC_SUBST(WIN32_LIBS)
|
|||
+
|
|||
# |
|||
# Determine if pthread_rwlock_t is available |
|||
# |
|||
--- upnp/libupnp.pc.in.win32 2010-12-23 21:24:05.000000000 +0100
|
|||
+++ upnp/libupnp.pc.in 2018-05-17 11:43:06.014745400 +0200
|
|||
@@ -6,6 +6,6 @@ includedir=@includedir@
|
|||
Name: libupnp |
|||
Description: Linux SDK for UPnP Devices |
|||
Version: @VERSION@ |
|||
-Libs: @PTHREAD_CFLAGS@ @PTHREAD_LIBS@ -L${libdir} -lupnp -lthreadutil -lixml
|
|||
-Cflags: @PTHREAD_CFLAGS@ -I${includedir}/upnp
|
|||
+Libs: -L${libdir} -lupnp -lthreadutil -lixml @PTHREAD_LIBS@ @WIN32_LIBS@
|
|||
+Cflags: @PC_CFLAGS@ -I${includedir}/upnp
|
|||
|
|||
@ -0,0 +1,11 @@ |
|||
--- zvbi/configure.in 2018-05-16 14:04:41.881375400 +0200
|
|||
+++ zvbi/configure.in.pthread-w32 2018-05-16 14:03:52.661096100 +0200
|
|||
@@ -167,7 +167,7 @@ dnl
|
|||
dnl Check how to link pthreads functions. |
|||
dnl (-lpthread on Linux, -pthread on FreeBSD). |
|||
dnl |
|||
-AC_CHECK_LIB(pthread, pthread_create,,[
|
|||
+AC_SEARCH_LIBS(pthread_create,[pthreadGC2 pthread],,[
|
|||
AC_TRY_LINK(, pthread_create();,,[ |
|||
LDFLAGS="$LDFLAGS -pthread" |
|||
AC_TRY_LINK(, pthread_create();,,[ |
|||
Loading…
Reference in new issue