[vlc-devel] [PATCH v2 11/13] contrib: protobuf: use the protoc built in contribs when cross compiling
Steve Lhomme
robux4 at ycbcr.xyz
Tue Mar 24 15:46:29 CET 2020
Remove the unused detection of the proper protoc to us. Now we always have a
native version built.
---
contrib/src/protobuf/rules.mak | 22 ++++++----------------
1 file changed, 6 insertions(+), 16 deletions(-)
diff --git a/contrib/src/protobuf/rules.mak b/contrib/src/protobuf/rules.mak
index a404aade3b..41cc2f128c 100644
--- a/contrib/src/protobuf/rules.mak
+++ b/contrib/src/protobuf/rules.mak
@@ -13,21 +13,6 @@ endif
PKGS_PROGS += protoc
ifeq ($(call need_pkg, "protobuf-lite >= 3.1.0 protobuf-lite < 3.2.0"),)
PKGS_FOUND += protobuf protoc
-else
-# check we have a matching protoc to use
-PROTOC_ABSPATH = $(shell PATH="$(PATH)" which protoc)
-ifeq ($(PROTOC_ABSPATH),)
-PROTOC = $(error protoc not found (search path: $(PATH)))
-else
-# make sure the installed protoc is compatible with the version we want to build
-SYS_PROTOC_VER = $(shell $(PROTOC_ABSPATH) --version)
-SYS_PROTOC_VERSION = $(word $(words $(SYS_PROTOC_VER)) , $(SYS_PROTOC_VER))
-ifneq ($(PROTOBUF_VERSION),$(SYS_PROTOC_VERSION))
-PROTOC = $(error protoc system version $(SYS_PROTOC_VERSION) and required version $(PROTOBUF_VERSION) do not match)
-else
-PROTOC = $(PROTOC_ABSPATH)
-endif
-endif
endif
$(TARBALLS)/protobuf-$(PROTOBUF_VERSION)-cpp.tar.gz:
@@ -43,6 +28,11 @@ endif
PROTOBUFVARS := $(HOSTVARS) DIST_LANG="cpp"
PROTOCVARS := $(BUILDVARS) DIST_LANG="cpp"
+PROTOBUFCONF := $(HOSTCONF)
+ifdef HAVE_CROSS_COMPILE
+PROTOBUFCONF += --with-protoc="$(BUILDBINDIR)/$(HOST)-protoc"
+endif
+
protobuf: protobuf-$(PROTOBUF_VERSION)-cpp.tar.gz .sum-protobuf $(PROTOBUF_DEP)
$(UNPACK)
mv protobuf-$(PROTOBUF_VERSION) protobuf-$(PROTOBUF_VERSION)-cpp
@@ -51,7 +41,7 @@ protobuf: protobuf-$(PROTOBUF_VERSION)-cpp.tar.gz .sum-protobuf $(PROTOBUF_DEP)
.protobuf: protobuf
$(RECONF)
- cd $< && $(PROTOBUFVARS) ./configure $(HOSTCONF) --with-protoc="$(PROTOC)"
+ cd $< && $(PROTOBUFVARS) ./configure $(PROTOBUFCONF)
cd $< && $(MAKE) && $(MAKE) install
touch $@
--
2.17.1
More information about the vlc-devel
mailing list