[vlc-commits] contrib: limit the use of pthreads-w32 to winstore builds for now
Steve Lhomme
git at videolan.org
Thu May 17 13:01:38 CEST 2018
vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Thu May 17 12:37:30 2018 +0200| [6f20847b5ddb4ca30edeffe0c490eaf56a478d01] | committer: Steve Lhomme
contrib: limit the use of pthreads-w32 to winstore builds for now
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=6f20847b5ddb4ca30edeffe0c490eaf56a478d01
---
contrib/src/aom/rules.mak | 4 +-
.../src/libplacebo/0001-build-use-a-Makefile.patch | 7 +-
contrib/src/libplacebo/rules.mak | 3 -
contrib/src/mysofa/rules.mak | 2 +-
contrib/src/openjpeg/rules.mak | 2 +-
contrib/src/protobuf/rules.mak | 2 +-
contrib/src/srt/rules.mak | 6 +-
contrib/src/upnp/libupnp-configure.patch | 82 ----------------------
contrib/src/upnp/libupnp-pthread-w32-checks.patch | 54 ++++++++++++++
contrib/src/upnp/libupnp-pthread-w32-force.patch | 19 +++++
contrib/src/upnp/libupnp-win32-exports.patch | 31 ++++++++
contrib/src/upnp/libupnp-win32.patch | 20 ------
contrib/src/upnp/rules.mak | 7 +-
contrib/src/vpx/rules.mak | 4 +-
contrib/src/x264/rules.mak | 4 ++
contrib/src/zvbi/rules.mak | 11 ++-
contrib/src/zvbi/zvbi-pthread-w32.patch | 11 +++
contrib/src/zvbi/zvbi-win32.patch | 11 ---
18 files changed, 145 insertions(+), 135 deletions(-)
diff --git a/contrib/src/aom/rules.mak b/contrib/src/aom/rules.mak
index 1443e7454f..b36cd5e3c5 100644
--- a/contrib/src/aom/rules.mak
+++ b/contrib/src/aom/rules.mak
@@ -19,13 +19,15 @@ aom: aom-$(AOM_VERSION).tar.gz .sum-aom
rm -Rf $@-$(AOM_VERSION) $@
mkdir -p $@-$(AOM_VERSION)
tar xvzf "$<" -C $@-$(AOM_VERSION)
+ifdef HAVE_WINSTORE
$(APPLY) $(SRC)/aom/aom-pthreads-win32.patch
+endif
$(MOVE)
AOM_CFLAGS := $(CFLAGS)
AOM_CXXFLAGS := $(CXXFLAGS)
DEPS_aom =
-ifdef HAVE_WIN32
+ifdef HAVE_WINSTORE
DEPS_aom += pthreads $(DEPS_pthreads)
AOM_CFLAGS += -DPTW32_STATIC_LIB
AOM_CXXFLAGS += -DPTW32_STATIC_LIB
diff --git a/contrib/src/libplacebo/0001-build-use-a-Makefile.patch b/contrib/src/libplacebo/0001-build-use-a-Makefile.patch
index 08a1e6de28..86ab90dbef 100644
--- a/contrib/src/libplacebo/0001-build-use-a-Makefile.patch
+++ b/contrib/src/libplacebo/0001-build-use-a-Makefile.patch
@@ -16,17 +16,12 @@ new file mode 100644
index 0000000..4c431cf
--- /dev/null
+++ b/Makefile
-@@ -0,0 +1,43 @@
+@@ -0,0 +1,38 @@
+SRCS := colorspace.c common.c context.c dither.c dispatch.c filters.c ra.c renderer.c shaders.c \
+ shaders/colorspace.c shaders/sampling.c spirv.c bstr/bstr.c bstr/format.c 3rdparty/siphash.c \
+ ta/ta.c ta/ta_utils.c ta/talloc.c
+
-+ifdef HAVE_WIN32
-+CFLAGS += -DPTW32_STATIC_LIB
-+lpthread_libs = -lpthreadGC2 -lws2_32
-+else
+lpthread_libs = $(shell $(LD) -lpthread && echo "-lpthread" || echo "")
-+endif
+
+OBJS = $(patsubst %.c, $(OBJDIR)src/%.o, $(SRCS))
+
diff --git a/contrib/src/libplacebo/rules.mak b/contrib/src/libplacebo/rules.mak
index b2bfa3ca01..871418b00d 100644
--- a/contrib/src/libplacebo/rules.mak
+++ b/contrib/src/libplacebo/rules.mak
@@ -8,9 +8,6 @@ LIBPLACEBO_CFLAGS := $(CFLAGS)
LIBPLACEBO_CXXFLAGS := $(CXXFLAGS)
ifdef HAVE_WIN32
LIBPLACEBO_WIN32 = HAVE_WIN32=1
-DEPS_libplacebo += pthreads $(DEPS_pthreads)
-LIBPLACEBO_CFLAGS += -DPTW32_STATIC_LIB
-LIBPLACEBO_CXXFLAGS += -DPTW32_STATIC_LIB
endif
PKGS += libplacebo
diff --git a/contrib/src/mysofa/rules.mak b/contrib/src/mysofa/rules.mak
index 26d66af4ac..ceff0b02a5 100644
--- a/contrib/src/mysofa/rules.mak
+++ b/contrib/src/mysofa/rules.mak
@@ -12,7 +12,7 @@ endif
MYSOFA_CFLAGS := $(CFLAGS)
MYSOFA_CXXFLAGS := $(CXXFLAGS)
DEPS_mysofa += zlib $(DEPS_zlib)
-ifdef HAVE_WIN32
+ifdef HAVE_WINSTORE
DEPS_mysofa += pthreads $(DEPS_pthreads)
MYSOFA_CFLAGS += -DPTW32_STATIC_LIB
MYSOFA_CXXFLAGS += -DPTW32_STATIC_LIB
diff --git a/contrib/src/openjpeg/rules.mak b/contrib/src/openjpeg/rules.mak
index 005bf24bfa..a184a026c2 100644
--- a/contrib/src/openjpeg/rules.mak
+++ b/contrib/src/openjpeg/rules.mak
@@ -5,7 +5,7 @@ OPENJPEG_URL := https://github.com/uclouvain/openjpeg/archive/v$(OPENJPEG_VERSIO
OPENJPEG_CFLAGS := $(CFLAGS)
OPENJPEG_CXXFLAGS := $(CXXFLAGS)
-ifdef HAVE_WIN32
+ifdef HAVE_WINSTORE
DEPS_openjpeg += pthreads $(DEPS_pthreads)
OPENJPEG_CFLAGS += -DPTW32_STATIC_LIB
OPENJPEG_CXXFLAGS += -DPTW32_STATIC_LIB
diff --git a/contrib/src/protobuf/rules.mak b/contrib/src/protobuf/rules.mak
index 7de7f682de..900a498fcb 100644
--- a/contrib/src/protobuf/rules.mak
+++ b/contrib/src/protobuf/rules.mak
@@ -30,7 +30,7 @@ $(TARBALLS)/protobuf-$(PROTOBUF_VERSION)-cpp.tar.gz:
PROTOBUF_CFLAGS := $(CFLAGS)
PROTOBUF_CXXFLAGS := $(CXXFLAGS)
DEPS_protobuf = zlib $(DEPS_zlib)
-ifdef HAVE_WIN32
+ifdef HAVE_WINSTORE
DEPS_protobuf += pthreads $(DEPS_pthreads)
PROTOBUF_CFLAGS += -DPTW32_STATIC_LIB
PROTOBUF_CXXFLAGS += -DPTW32_STATIC_LIB
diff --git a/contrib/src/srt/rules.mak b/contrib/src/srt/rules.mak
index 98839e882c..890f10c963 100644
--- a/contrib/src/srt/rules.mak
+++ b/contrib/src/srt/rules.mak
@@ -14,7 +14,7 @@ endif
SRT_CFLAGS := $(CFLAGS)
SRT_CXXFLAGS := $(CXXFLAGS)
DEPS_srt = gnutls $(DEPS_gnutls)
-ifdef HAVE_WIN32
+ifdef HAVE_WINSTORE
DEPS_srt += pthreads $(DEPS_pthreads)
SRT_CFLAGS += -DPTW32_STATIC_LIB
SRT_CXXFLAGS += -DPTW32_STATIC_LIB
@@ -34,9 +34,9 @@ srt: srt-$(SRT_VERSION).tar.gz .sum-srt
$(UNPACK)
$(APPLY) $(SRC)/srt/add-implicit-link-libraries.patch
$(APPLY) $(SRC)/srt/0001-CMakeLists.txt-substitute-link-flags-for-package-nam.patch
- $(APPLY) $(SRC)/srt/0002-CMakeLists.txt-let-cmake-find-pthread.patch
$(APPLY) $(SRC)/srt/srt-fix-non-gnu-detection.patch
-ifdef HAVE_WIN32
+ifdef HAVE_WINSTORE
+ $(APPLY) $(SRC)/srt/0002-CMakeLists.txt-let-cmake-find-pthread.patch
$(APPLY) $(SRC)/srt/srt-no-implicit-libs.patch
endif
$(call pkg_static,"scripts/haisrt.pc.in")
diff --git a/contrib/src/upnp/libupnp-configure.patch b/contrib/src/upnp/libupnp-configure.patch
deleted file mode 100644
index dbc14cca5e..0000000000
--- a/contrib/src/upnp/libupnp-configure.patch
+++ /dev/null
@@ -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([
diff --git a/contrib/src/upnp/libupnp-pthread-w32-checks.patch b/contrib/src/upnp/libupnp-pthread-w32-checks.patch
new file mode 100644
index 0000000000..f1e76ec332
--- /dev/null
+++ b/contrib/src/upnp/libupnp-pthread-w32-checks.patch
@@ -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()
diff --git a/contrib/src/upnp/libupnp-pthread-w32-force.patch b/contrib/src/upnp/libupnp-pthread-w32-force.patch
new file mode 100644
index 0000000000..f485f3530a
--- /dev/null
+++ b/contrib/src/upnp/libupnp-pthread-w32-force.patch
@@ -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)
diff --git a/contrib/src/upnp/libupnp-win32-exports.patch b/contrib/src/upnp/libupnp-win32-exports.patch
new file mode 100644
index 0000000000..9375393f68
--- /dev/null
+++ b/contrib/src/upnp/libupnp-win32-exports.patch
@@ -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
+
diff --git a/contrib/src/upnp/libupnp-win32.patch b/contrib/src/upnp/libupnp-win32.patch
index 686e3bae19..80d758423d 100644
--- a/contrib/src/upnp/libupnp-win32.patch
+++ b/contrib/src/upnp/libupnp-win32.patch
@@ -1,23 +1,3 @@
---- libupnp/configure.ac.orig 2011-02-10 23:53:25.000000000 +0100
-+++ libupnp/configure.ac 2011-02-10 23:54:23.574454501 +0100
-@@ -546,6 +546,7 @@
- AC_SUBST(PTHREAD_CFLAGS)
- AC_SUBST(PTHREAD_CC)
-
-+AC_DEFINE([_WIN32_WINNT], 0x0501, [Define to '0x0500' for Windows 2000 APIs.])
- #
- # Determine if pthread_rwlock_t is available
- #
---- libupnp/libupnp.pc.in 2010-12-23 21:24:05.000000000 +0100
-+++ libupnp.new/libupnp.pc.in 2011-02-13 11:27:23.000000000 +0100
-@@ -6,6 +6,6 @@
- Name: libupnp
- Description: Linux SDK for UPnP Devices
- Version: @VERSION@
--Libs: @PTHREAD_CFLAGS@ @PTHREAD_LIBS@ -L${libdir} -lupnp -lthreadutil -lixml
-+Libs: @PTHREAD_CFLAGS@ -L${libdir} -lupnp -lthreadutil -lixml -liphlpapi @PTHREAD_LIBS@
- Cflags: @PTHREAD_CFLAGS@ -I${includedir}/upnp
-
--- libupnp/upnp/src/inc/upnputil.h 2010-12-23 21:24:06.000000000 +0100
+++ libupnp.new/upnp/src/inc/upnputil.h 2011-02-13 08:24:24.000000000 +0100
@@ -125,7 +125,7 @@
diff --git a/contrib/src/upnp/rules.mak b/contrib/src/upnp/rules.mak
index 48091a5183..25a9574de0 100644
--- a/contrib/src/upnp/rules.mak
+++ b/contrib/src/upnp/rules.mak
@@ -13,7 +13,7 @@ $(TARBALLS)/libupnp-$(UPNP_VERSION).tar.bz2:
UPNP_CFLAGS := $(CFLAGS) -DUPNP_STATIC_LIB
UPNP_CXXFLAGS := $(CXXFLAGS) -DUPNP_STATIC_LIB
-ifdef HAVE_WIN32
+ifdef HAVE_WINSTORE
DEPS_upnp += pthreads $(DEPS_pthreads)
UPNP_CFLAGS += -DPTW32_STATIC_LIB
UPNP_CXXFLAGS += -DPTW32_STATIC_LIB
@@ -30,14 +30,15 @@ endif
upnp: libupnp-$(UPNP_VERSION).tar.bz2 .sum-upnp
$(UNPACK)
ifdef HAVE_WIN32
- $(APPLY) $(SRC)/upnp/libupnp-configure.patch
$(APPLY) $(SRC)/upnp/libupnp-win32.patch
$(APPLY) $(SRC)/upnp/libupnp-win64.patch
$(APPLY) $(SRC)/upnp/windows-random.patch
$(APPLY) $(SRC)/upnp/windows-version-inet.patch
+ $(APPLY) $(SRC)/upnp/libupnp-win32-exports.patch
+ $(APPLY) $(SRC)/upnp/libupnp-pthread-w32-checks.patch
ifdef HAVE_WINSTORE
- $(APPLY) $(SRC)/upnp/winrt-dont-force-win32-winnt.patch
$(APPLY) $(SRC)/upnp/no-getifinfo.patch
+ $(APPLY) $(SRC)/upnp/libupnp-pthread-w32-force.patch
endif
endif
$(APPLY) $(SRC)/upnp/libpthread.patch
diff --git a/contrib/src/vpx/rules.mak b/contrib/src/vpx/rules.mak
index 71ca08fb53..8e46730e4c 100644
--- a/contrib/src/vpx/rules.mak
+++ b/contrib/src/vpx/rules.mak
@@ -23,7 +23,7 @@ endif
$(APPLY) $(SRC)/vpx/0001-ads2gas-Add-a-noelf-option.patch
$(APPLY) $(SRC)/vpx/0002-configure-Add-an-armv7-win32-gcc-target.patch
$(APPLY) $(SRC)/vpx/0003-configure-Add-an-arm64-win64-gcc-target.patch
-ifdef HAVE_WIN32
+ifdef HAVE_WINSTORE
$(APPLY) $(SRC)/vpx/libvpx-pthread-w32.patch
endif
$(MOVE)
@@ -32,7 +32,7 @@ DEPS_vpx =
VPX_CFLAGS := $(CFLAGS)
VPX_CXXFLAGS := $(CXXFLAGS)
-ifdef HAVE_WIN32
+ifdef HAVE_WINSTORE
DEPS_vpx += pthreads $(DEPS_pthreads)
VPX_CFLAGS += -DPTW32_STATIC_LIB
VPX_CXXFLAGS += -DPTW32_STATIC_LIB
diff --git a/contrib/src/x264/rules.mak b/contrib/src/x264/rules.mak
index 4519640a7d..7f96b0024d 100644
--- a/contrib/src/x264/rules.mak
+++ b/contrib/src/x264/rules.mak
@@ -35,7 +35,11 @@ X264CONF = --prefix="$(PREFIX)" --host="$(HOST)" \
ifndef HAVE_WIN32
X264CONF += --enable-pic
else
+ifdef HAVE_WINSTORE
X264CONF += --enable-win32thread
+else
+X264CONF += --disable-win32thread
+endif
ifeq ($(ARCH), arm)
X264_AS = AS="./tools/gas-preprocessor.pl -arch arm -as-type clang -force-thumb -- $(CC) -mimplicit-it=always"
endif
diff --git a/contrib/src/zvbi/rules.mak b/contrib/src/zvbi/rules.mak
index 8f47ae36bd..0b77838560 100644
--- a/contrib/src/zvbi/rules.mak
+++ b/contrib/src/zvbi/rules.mak
@@ -20,6 +20,9 @@ zvbi: zvbi-$(ZVBI_VERSION).tar.bz2 .sum-zvbi
$(APPLY) $(SRC)/zvbi/zvbi-fix-static-linking.patch
ifdef HAVE_WIN32
$(APPLY) $(SRC)/zvbi/zvbi-win32.patch
+ifdef HAVE_WINSTORE
+ $(APPLY) $(SRC)/zvbi/zvbi-pthread-w32.patch
+endif
endif
$(APPLY) $(SRC)/zvbi/zvbi-fix-clang-support.patch
ifdef HAVE_ANDROID
@@ -30,12 +33,18 @@ endif
DEPS_zvbi = png $(DEPS_png) iconv $(DEPS_iconv)
ZVBI_CFLAGS := $(CFLAGS)
+ZVBI_CXXFLAGS := $(CXXFLAGS)
ZVBICONF := \
--disable-dvb --disable-bktr \
--disable-nls --disable-proxy \
--without-doxygen \
$(HOSTCONF)
+ifdef HAVE_WINSTORE
+DEPS_upnp += pthreads $(DEPS_pthreads)
+ZVBI_CFLAGS += -DPTW32_STATIC_LIB
+ZVBI_CXXFLAGS += -DPTW32_STATIC_LIB
+endif
ifdef HAVE_MACOSX
ZVBI_CFLAGS += -fnested-functions
endif
@@ -43,7 +52,7 @@ endif
.zvbi: zvbi
$(UPDATE_AUTOCONFIG)
$(RECONF)
- cd $< && $(HOSTVARS) CFLAGS="$(ZVBI_CFLAGS)" ./configure $(ZVBICONF)
+ cd $< && $(HOSTVARS) CFLAGS="$(ZVBI_CFLAGS)" CXXFLAGS="$(ZVBI_CXXFLAGS)" ./configure $(ZVBICONF)
cd $< && $(MAKE) -C src install
cd $< && $(MAKE) SUBDIRS=. install
sed -i.orig -e "s/\/[^ ]*libiconv.a/-liconv/" $(PREFIX)/lib/pkgconfig/zvbi-0.2.pc
diff --git a/contrib/src/zvbi/zvbi-pthread-w32.patch b/contrib/src/zvbi/zvbi-pthread-w32.patch
new file mode 100644
index 0000000000..3e34fe2dd3
--- /dev/null
+++ b/contrib/src/zvbi/zvbi-pthread-w32.patch
@@ -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();,,[
diff --git a/contrib/src/zvbi/zvbi-win32.patch b/contrib/src/zvbi/zvbi-win32.patch
index 1224b08731..76e3ef60cd 100644
--- a/contrib/src/zvbi/zvbi-win32.patch
+++ b/contrib/src/zvbi/zvbi-win32.patch
@@ -107,17 +107,6 @@ diff -ruN zvbi/src/vbi.c zvbi.new/src/vbi.c
#include <sys/time.h>
#include <pthread.h>
---- 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();,,[
--- zvbi/src/io.c 2008-02-19 01:35:20.000000000 +0100
+++ zvbi2/src/io.c 2008-09-11 21:18:59.000000000 +0200
@@ -28,8 +28,10 @@
More information about the vlc-commits
mailing list