[vlc-commits] contrib: clean dependency on win32 pthread
Steve Lhomme
git at videolan.org
Wed May 16 15:53:29 CEST 2018
vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Tue May 15 08:23:31 2018 +0200| [f52ef651974696f59261d699241d622e323a32df] | committer: Steve Lhomme
contrib: clean dependency on win32 pthread
and define the macros to force using the static version
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=f52ef651974696f59261d699241d622e323a32df
---
contrib/src/aom/rules.mak | 9 ++++++++-
contrib/src/libplacebo/rules.mak | 6 +++++-
contrib/src/mysofa/rules.mak | 11 +++++++++--
contrib/src/openjpeg/rules.mak | 10 +++++++++-
contrib/src/protobuf/rules.mak | 9 ++++++++-
contrib/src/srt/rules.mak | 2 ++
contrib/src/vpx/rules.mak | 10 +++++++++-
contrib/src/zvbi/rules.mak | 5 +----
8 files changed, 51 insertions(+), 11 deletions(-)
diff --git a/contrib/src/aom/rules.mak b/contrib/src/aom/rules.mak
index 1ee5870505..1443e7454f 100644
--- a/contrib/src/aom/rules.mak
+++ b/contrib/src/aom/rules.mak
@@ -22,7 +22,14 @@ aom: aom-$(AOM_VERSION).tar.gz .sum-aom
$(APPLY) $(SRC)/aom/aom-pthreads-win32.patch
$(MOVE)
+AOM_CFLAGS := $(CFLAGS)
+AOM_CXXFLAGS := $(CXXFLAGS)
DEPS_aom =
+ifdef HAVE_WIN32
+DEPS_aom += pthreads $(DEPS_pthreads)
+AOM_CFLAGS += -DPTW32_STATIC_LIB
+AOM_CXXFLAGS += -DPTW32_STATIC_LIB
+endif
AOM_LDFLAGS := $(LDFLAGS)
@@ -59,7 +66,7 @@ endif
# libaom doesn't allow in-tree builds
.aom: aom toolchain.cmake
cd $< && mkdir -p aom_build
- cd $</aom_build && LDFLAGS="$(AOM_LDFLAGS)" $(HOSTVARS) $(CMAKE) ../ $(AOM_CONF)
+ cd $</aom_build && LDFLAGS="$(AOM_LDFLAGS)" CFLAGS="$(AOM_CFLAGS)" CXXFLAGS="$(AOM_CXXFLAGS)" $(HOSTVARS) $(CMAKE) ../ $(AOM_CONF)
cd $< && $(MAKE) -C aom_build
cd $</aom_build && ../../../../contrib/src/pkg-static.sh aom.pc
cd $</aom_build && $(MAKE) install
diff --git a/contrib/src/libplacebo/rules.mak b/contrib/src/libplacebo/rules.mak
index b9871a0056..b2bfa3ca01 100644
--- a/contrib/src/libplacebo/rules.mak
+++ b/contrib/src/libplacebo/rules.mak
@@ -4,9 +4,13 @@ PLACEBO_VERSION := 0.2.1
PLACEBO_URL := https://github.com/haasn/libplacebo/archive/v$(PLACEBO_VERSION).tar.gz
PLACEBO_ARCHIVE = libplacebo-$(PLACEBO_VERSION).tar.gz
+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
@@ -33,5 +37,5 @@ libplacebo: $(PLACEBO_ARCHIVE) .sum-libplacebo
# we don't want to depend on meson/ninja for VLC 3.0
#cd $< && $(HOSTVARS) meson $(PLACEBOCONF) build
#cd $< && cd build && ninja install
- cd $< && $(HOSTVARS_PIC) PREFIX=$(PREFIX) $(LIBPLACEBO_WIN32) make install
+ cd $< && $(HOSTVARS_PIC) PREFIX=$(PREFIX) $(LIBPLACEBO_WIN32) CFLAGS="$(LIBPLACEBO_CFLAGS)" CXXFLAGS="$(LIBPLACEBO_CXXFLAGS)" make install
touch $@
diff --git a/contrib/src/mysofa/rules.mak b/contrib/src/mysofa/rules.mak
index 79d315f9bc..26d66af4ac 100644
--- a/contrib/src/mysofa/rules.mak
+++ b/contrib/src/mysofa/rules.mak
@@ -9,7 +9,14 @@ ifeq ($(call need_pkg,"mysofa"),)
PKGS_FOUND += mysofa
endif
-DEPS_mysofa += pthreads zlib $(DEPS_pthreads) $(DEPS_zlib)
+MYSOFA_CFLAGS := $(CFLAGS)
+MYSOFA_CXXFLAGS := $(CXXFLAGS)
+DEPS_mysofa += zlib $(DEPS_zlib)
+ifdef HAVE_WIN32
+DEPS_mysofa += pthreads $(DEPS_pthreads)
+MYSOFA_CFLAGS += -DPTW32_STATIC_LIB
+MYSOFA_CXXFLAGS += -DPTW32_STATIC_LIB
+endif
$(TARBALLS)/libmysofa-$(MYSOFA_VERSION).tar.gz:
$(call download_pkg,$(MYSOFA_URL),mysofa)
@@ -22,7 +29,7 @@ mysofa: libmysofa-$(MYSOFA_VERSION).tar.gz .sum-mysofa
.mysofa: mysofa toolchain.cmake
-cd $< && rm CMakeCache.txt
- cd $< && $(HOSTVARS) $(CMAKE) -DBUILD_TESTS=OFF -DBUILD_SHARED_LIBS=OFF
+ cd $< && $(HOSTVARS) CFLAGS="$(MYSOFA_CFLAGS)" CXXFLAGS="$(MYSOFA_CXXFLAGS)" $(CMAKE) -DBUILD_TESTS=OFF -DBUILD_SHARED_LIBS=OFF
cd $< && $(MAKE) install
touch $@
diff --git a/contrib/src/openjpeg/rules.mak b/contrib/src/openjpeg/rules.mak
index e41056c10d..005bf24bfa 100644
--- a/contrib/src/openjpeg/rules.mak
+++ b/contrib/src/openjpeg/rules.mak
@@ -3,6 +3,14 @@
OPENJPEG_VERSION := 2.3.0
OPENJPEG_URL := https://github.com/uclouvain/openjpeg/archive/v$(OPENJPEG_VERSION).tar.gz
+OPENJPEG_CFLAGS := $(CFLAGS)
+OPENJPEG_CXXFLAGS := $(CXXFLAGS)
+ifdef HAVE_WIN32
+DEPS_openjpeg += pthreads $(DEPS_pthreads)
+OPENJPEG_CFLAGS += -DPTW32_STATIC_LIB
+OPENJPEG_CXXFLAGS += -DPTW32_STATIC_LIB
+endif
+
$(TARBALLS)/openjpeg-v$(OPENJPEG_VERSION).tar.gz:
$(call download_pkg,$(OPENJPEG_URL),openjpeg)
@@ -22,7 +30,7 @@ endif
$(MOVE)
.openjpeg: openjpeg toolchain.cmake
- cd $< && $(HOSTVARS) $(CMAKE) \
+ cd $< && $(HOSTVARS) CFLAGS="$(OPENJPEG_CFLAGS)" CXXFLAGS="$(OPENJPEG_CXXFLAGS)" $(CMAKE) \
-DBUILD_SHARED_LIBS:bool=OFF -DBUILD_PKGCONFIG_FILES=ON \
-DBUILD_CODEC:bool=OFF \
.
diff --git a/contrib/src/protobuf/rules.mak b/contrib/src/protobuf/rules.mak
index 755867f4ca..7de7f682de 100644
--- a/contrib/src/protobuf/rules.mak
+++ b/contrib/src/protobuf/rules.mak
@@ -27,7 +27,14 @@ $(TARBALLS)/protobuf-$(PROTOBUF_VERSION)-cpp.tar.gz:
.sum-protobuf: protobuf-$(PROTOBUF_VERSION)-cpp.tar.gz
+PROTOBUF_CFLAGS := $(CFLAGS)
+PROTOBUF_CXXFLAGS := $(CXXFLAGS)
DEPS_protobuf = zlib $(DEPS_zlib)
+ifdef HAVE_WIN32
+DEPS_protobuf += pthreads $(DEPS_pthreads)
+PROTOBUF_CFLAGS += -DPTW32_STATIC_LIB
+PROTOBUF_CXXFLAGS += -DPTW32_STATIC_LIB
+endif
protobuf: protobuf-$(PROTOBUF_VERSION)-cpp.tar.gz .sum-protobuf
$(UNPACK)
@@ -38,6 +45,6 @@ protobuf: protobuf-$(PROTOBUF_VERSION)-cpp.tar.gz .sum-protobuf
.protobuf: protobuf
$(RECONF)
- cd $< && $(HOSTVARS) ./configure $(HOSTCONF) --with-protoc="$(PROTOC)"
+ cd $< && CFLAGS="$(PROTOBUF_CFLAGS)" CXXFLAGS="$(PROTOBUF_CXXFLAGS)" $(HOSTVARS) ./configure $(HOSTCONF) --with-protoc="$(PROTOC)"
cd $< && $(MAKE) && $(MAKE) install
touch $@
diff --git a/contrib/src/srt/rules.mak b/contrib/src/srt/rules.mak
index 7a9004b55d..98839e882c 100644
--- a/contrib/src/srt/rules.mak
+++ b/contrib/src/srt/rules.mak
@@ -16,6 +16,8 @@ SRT_CXXFLAGS := $(CXXFLAGS)
DEPS_srt = gnutls $(DEPS_gnutls)
ifdef HAVE_WIN32
DEPS_srt += pthreads $(DEPS_pthreads)
+SRT_CFLAGS += -DPTW32_STATIC_LIB
+SRT_CXXFLAGS += -DPTW32_STATIC_LIB
endif
ifdef HAVE_DARWIN_OS
diff --git a/contrib/src/vpx/rules.mak b/contrib/src/vpx/rules.mak
index a4dde202cb..71ca08fb53 100644
--- a/contrib/src/vpx/rules.mak
+++ b/contrib/src/vpx/rules.mak
@@ -30,6 +30,14 @@ endif
DEPS_vpx =
+VPX_CFLAGS := $(CFLAGS)
+VPX_CXXFLAGS := $(CXXFLAGS)
+ifdef HAVE_WIN32
+DEPS_vpx += pthreads $(DEPS_pthreads)
+VPX_CFLAGS += -DPTW32_STATIC_LIB
+VPX_CXXFLAGS += -DPTW32_STATIC_LIB
+endif
+
ifdef HAVE_CROSS_COMPILE
VPX_CROSS := $(HOST)-
else
@@ -161,7 +169,7 @@ VPX_CONF += --enable-debug --disable-optimizations
endif
.vpx: libvpx
- cd $< && LDFLAGS="$(VPX_LDFLAGS)" CROSS=$(VPX_CROSS) ./configure --target=$(VPX_TARGET) \
+ cd $< && LDFLAGS="$(VPX_LDFLAGS)" CROSS=$(VPX_CROSS) CFLAGS="$(VPX_CFLAGS)" CXXFLAGS="$(VPX_CXXFLAGS)" ./configure --target=$(VPX_TARGET) \
$(VPX_CONF) --prefix=$(PREFIX)
cd $< && $(MAKE)
cd $< && ../../../contrib/src/pkg-static.sh vpx.pc
diff --git a/contrib/src/zvbi/rules.mak b/contrib/src/zvbi/rules.mak
index a9cf42674f..8f47ae36bd 100644
--- a/contrib/src/zvbi/rules.mak
+++ b/contrib/src/zvbi/rules.mak
@@ -27,7 +27,7 @@ ifdef HAVE_ANDROID
endif
$(MOVE)
-DEPS_zvbi = pthreads png $(DEPS_png) iconv $(DEPS_iconv)
+DEPS_zvbi = png $(DEPS_png) iconv $(DEPS_iconv)
ZVBI_CFLAGS := $(CFLAGS)
ZVBICONF := \
@@ -39,9 +39,6 @@ ZVBICONF := \
ifdef HAVE_MACOSX
ZVBI_CFLAGS += -fnested-functions
endif
-ifdef HAVE_WIN32
-ZVBI_CFLAGS += -DPTW32_STATIC_LIB
-endif
.zvbi: zvbi
$(UPDATE_AUTOCONFIG)
More information about the vlc-commits
mailing list