[vlc-commits] contrib: protobuf: fixes invalid recursion

Rémi Denis-Courmont git at videolan.org
Sun May 19 10:38:24 CEST 2019


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun May 19 11:30:03 2019 +0300| [4a5a69895a776036eee04e283f798b132eba07e6] | committer: Rémi Denis-Courmont

contrib: protobuf: fixes invalid recursion

This removes the recursive setting of PROTOC in error cases, producing a
the intended and more helpful error message. This won't get the build
working though.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=4a5a69895a776036eee04e283f798b132eba07e6
---

 contrib/src/protobuf/rules.mak | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/contrib/src/protobuf/rules.mak b/contrib/src/protobuf/rules.mak
index 092c7f6b8e..a8db9a8364 100644
--- a/contrib/src/protobuf/rules.mak
+++ b/contrib/src/protobuf/rules.mak
@@ -8,15 +8,17 @@ PKGS_FOUND += protobuf
 else
 ifeq ($(findstring protobuf,$(PKGS_DISABLE)),)
 # check we have a matching protoc to use
-PROTOC = $(shell PATH="$(PATH)" which protoc)
-ifeq ($(PROTOC),)
+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) --version)
-SYS_PROTOC = $(word $(words $(SYS_PROTOC_VER)) , $(SYS_PROTOC_VER))
-ifneq ($(PROTOBUF_VERSION),$(SYS_PROTOC))
-PROTOC = $(error $(PROTOC) version $(SYS_PROTOC) doesn't match the protobuf $(PROTOBUF_VERSION) we're building)
+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



More information about the vlc-commits mailing list