[vlc-devel] [PATCH 1/1] Resolves protoc version compatibility problems.
Waterson
waterson at hotmail.com
Thu Nov 13 06:03:06 CET 2014
Chromecast and Protobuf itself use the stock version of protoc
on the build-system by default, which may not be compatible.
To avoid this problem, we build a version of protoc for the
build-system first, and use it consistently throughout the whole
build process.
This patch is adapted from MXE, an excellent Mingw cross build environment.
---
contrib/src/main.mak | 1 +
contrib/src/protobuf/SHA512SUMS | 2 +-
contrib/src/protobuf/rules.mak | 17 ++++++++++++++---
extras/package/win32/configure.sh | 1 +
4 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/contrib/src/main.mak b/contrib/src/main.mak
index 97e2b62..bed737b 100644
--- a/contrib/src/main.mak
+++ b/contrib/src/main.mak
@@ -352,6 +352,7 @@ install: $(PKGS:%=.%)
mostlyclean:
-$(RM) $(foreach p,$(PKGS_ALL),.$(p) .sum-$(p) .dep-$(p))
-$(RM) toolchain.cmake
+ -$(RM) -R "$(PREFIX)/../bin"
-$(RM) -R "$(PREFIX)"
-$(RM) -R */
diff --git a/contrib/src/protobuf/SHA512SUMS b/contrib/src/protobuf/SHA512SUMS
index 4e0dd6e..c00e2c6 100644
--- a/contrib/src/protobuf/SHA512SUMS
+++ b/contrib/src/protobuf/SHA512SUMS
@@ -1 +1 @@
-a59a6d28d1653335fee42eff074f54b317d79d50361ed27d16502012ebb68bf7932ff80be4ce1588829940d6fdf77d113536ee3b27b72959577527ca488eddab protobuf-2.6.0.tar.bz2
+8b092b87fcd79223db199cd3d330f3d43689b47f345aa4e34028dcf1680d609a5d5a89ab08588e817b566d3b265834c38f1db580bc1c144b512ce74d35f2a174 protobuf-2.6.1.tar.bz2
diff --git a/contrib/src/protobuf/rules.mak b/contrib/src/protobuf/rules.mak
index eed116e..8735366 100644
--- a/contrib/src/protobuf/rules.mak
+++ b/contrib/src/protobuf/rules.mak
@@ -1,5 +1,5 @@
# protobuf
-PROTOBUF_VERSION := 2.6.0
+PROTOBUF_VERSION := 2.6.1
PROTOBUF_URL := https://protobuf.googlecode.com/svn/rc/protobuf-$(PROTOBUF_VERSION).tar.bz2
PKGS += protobuf
@@ -22,7 +22,18 @@ endif
$(MOVE)
.protobuf: protobuf
+# First Step: Build for build system in order to create "protoc" binary.
$(RECONF)
- cd $< && $(HOSTVARS) ./configure $(HOSTCONF) --with-protoc=protoc
- cd $< && $(MAKE) && $(MAKE) install
+ cd $< && ./configure --disable-shared
+ $(MAKE) -C $<
+ mkdir -p '../bin' && \
+ cp -f 'protobuf/src/protoc' '../bin/protoc_build'
+ $(MAKE) -C $< distclean
+# Second step: Build for target system.
+ cd $< && ./configure $(HOSTCONF) --with-protoc='../../bin/protoc_build'
+ $(MAKE) -C $< install
+ '$(HOST)-g++' -W -Wall -ansi -pedantic \
+ '$(SRC)/protobuf/protobuf-test.cpp' \
+ -o '$(PREFIX)/bin/test-protobuf.exe' \
+ `'$(HOST)-pkg-config' protobuf --cflags --libs`
touch $@
diff --git a/extras/package/win32/configure.sh b/extras/package/win32/configure.sh
index 1d89003..eeea353 100755
--- a/extras/package/win32/configure.sh
+++ b/extras/package/win32/configure.sh
@@ -28,4 +28,5 @@ OPTIONS="
--enable-zvbi --disable-telx
--enable-nls"
+export PROTOC="$(pwd)"/../contrib/bin/protoc_build
sh "$(dirname $0)"/../../../configure ${OPTIONS} "$@"
--
1.7.9.5
More information about the vlc-devel
mailing list