Skip to content
Snippets Groups Projects
Commit c51b8568 authored by Steve Lhomme's avatar Steve Lhomme Committed by Hugo Beauzée-Luyssen
Browse files

contrib: protobuf: don't use pthread on Win32

It has its own internal Win32 threads support. No need to rebuild this (heavy)
contrib when pthread changes.

No need to use winpthread from mingw either in the native protoc build when it
can use the Win32 threading API. And thus the codebase is the same in both
case.
parent d7dac03a
No related branches found
No related tags found
1 merge request!1466contrib: protobuf: don't use pthread on Win32
Pipeline #193953 passed with stage
in 51 minutes and 8 seconds
--- protobuf/m4/acx_pthread.m4.orig 2022-02-23 11:15:51.818483000 +0100
+++ protobuf/m4/acx_pthread.m4 2022-02-23 11:16:06.148340600 +0100
@@ -134,6 +134,10 @@ case "${host_cpu}-${host_os}" in
acx_pthread_flags="-pthreads pthread -mt -pthread $acx_pthread_flags"
;;
+ *mingw*)
+ # Do not use pthread, fallback to the win32 threading API
+ acx_pthread_flags=""
+ ;;
esac
if test x"$acx_pthread_ok" = xno; then
......@@ -24,9 +24,6 @@ $(TARBALLS)/protoc-$(PROTOBUF_VERSION)-cpp.tar.gz: $(TARBALLS)/protobuf-$(PROTOB
.sum-protobuf: protobuf-$(PROTOBUF_VERSION)-cpp.tar.gz
DEPS_protobuf = zlib $(DEPS_zlib)
ifdef HAVE_WIN32
DEPS_protobuf += pthreads $(DEPS_pthreads)
endif
PROTOBUFVARS := DIST_LANG="cpp"
PROTOCVARS := DIST_LANG="cpp"
......@@ -42,6 +39,7 @@ protoc: protoc-$(PROTOBUF_VERSION)-cpp.tar.gz .sum-protoc
$(APPLY) $(SRC)/protobuf/protobuf-disable-gmock.patch
$(APPLY) $(SRC)/protobuf/protobuf-fix-build.patch
$(APPLY) $(SRC)/protobuf/include-algorithm.patch
$(APPLY) $(SRC)/protobuf/protobuf-no-mingw-pthread.patch
$(MOVE)
.protoc: protoc
......@@ -57,6 +55,7 @@ protobuf: protobuf-$(PROTOBUF_VERSION)-cpp.tar.gz .sum-protobuf
$(APPLY) $(SRC)/protobuf/dont-build-protoc.patch
$(APPLY) $(SRC)/protobuf/protobuf-fix-build.patch
$(APPLY) $(SRC)/protobuf/include-algorithm.patch
$(APPLY) $(SRC)/protobuf/protobuf-no-mingw-pthread.patch
$(MOVE)
.protobuf: protobuf
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment