--- protobuf-3.5.0/autogen.sh.orig 2017-11-17 17:49:36.389442867 +0100 +++ protobuf-3.5.0/autogen.sh 2017-11-17 17:51:03.439441874 +0100 @@ -27,23 +27,6 @@ exit 1 fi -# Check that gmock is present. Usually it is already there since the -# directory is set up as an SVN external. -if test ! -e gmock; then - echo "Google Mock not present. Fetching gmock-1.7.0 from the web..." - curl $curlopts -L -O https://github.com/google/googlemock/archive/release-1.7.0.zip - unzip -q release-1.7.0.zip - rm release-1.7.0.zip - mv googlemock-release-1.7.0 gmock -fi - -if test ! -e gmock/gtest; then - curl $curlopts -L -O https://github.com/google/googletest/archive/release-1.7.0.zip - unzip -q release-1.7.0.zip - rm release-1.7.0.zip - mv googletest-release-1.7.0 gmock/gtest -fi - set -ex # TODO(kenton): Remove the ",no-obsolete" part and fix the resulting warnings. --- protobuf-3.1.0/Makefile.am.orig 2016-09-24 04:12:45.000000000 +0200 +++ protobuf-3.1.0/Makefile.am 2016-12-29 21:03:50.640290792 +0100 @@ -11,28 +11,8 @@ # Always include gmock in distributions. DIST_SUBDIRS = $(subdirs) src conformance benchmarks -# Build gmock before we build protobuf tests. We don't add gmock to SUBDIRS -# because then "make check" would also build and run all of gmock's own tests, -# which takes a lot of time and is generally not useful to us. Also, we don't -# want "make install" to recurse into gmock since we don't want to overwrite -# the installed version of gmock if there is one. -check-local: - @echo "Making lib/libgmock.a lib/libgmock_main.a in gmock" - @cd gmock && $(MAKE) $(AM_MAKEFLAGS) lib/libgmock.la lib/libgmock_main.la - @cd gmock/gtest && $(MAKE) $(AM_MAKEFLAGS) lib/libgtest.la lib/libgtest_main.la - -# We would like to clean gmock when "make clean" is invoked. But we have to -# be careful because clean-local is also invoked during "make distclean", but -# "make distclean" already recurses into gmock because it's listed among the -# DIST_SUBDIRS. distclean will delete gmock/Makefile, so if we then try to -# cd to the directory again and "make clean" it will fail. So, check that the -# Makefile exists before recursing. clean-local: - @if test -e gmock/Makefile; then \ - echo "Making clean in gmock"; \ - cd gmock && $(MAKE) $(AM_MAKEFLAGS) clean; \ - fi; \ - if test -e conformance/Makefile; then \ + @if test -e conformance/Makefile; then \ echo "Making clean in conformance"; \ cd conformance && $(MAKE) $(AM_MAKEFLAGS) clean; \ fi; \ --- protobuf-3.5.0/src/Makefile.am.orig 2017-11-13 19:47:29.000000000 +0100 +++ protobuf-3.5.0/src/Makefile.am 2017-11-17 17:49:36.389442867 +0100 @@ -756,15 +756,22 @@ google/protobuf/testing/file.cc \ google/protobuf/testing/file.h +gmock_dir = /usr/src/gmock/src +gmock_inc_dir = /usr/src/gmock/src +gtest_inc_dir = /usr/include/gtest +check_LTLIBRARIES = libgmock.la libgmock_main.la +libgmock_la_SOURCES = ./gmock-all.cc +libgmock_main_la_SOURCES = ./gmock_main.cc + check_PROGRAMS = protoc protobuf-test protobuf-lazy-descriptor-test \ protobuf-lite-test test_plugin protobuf-lite-arena-test \ no-warning-test $(GZCHECKPROGRAMS) protobuf_test_LDADD = $(PTHREAD_LIBS) libprotobuf.la libprotoc.la \ - ../gmock/gtest/lib/libgtest.la \ - ../gmock/lib/libgmock.la \ - ../gmock/lib/libgmock_main.la -protobuf_test_CPPFLAGS = -I$(srcdir)/../gmock/gtest/include \ - -I$(srcdir)/../gmock/include + -lgtest \ + libgmock_main.la \ + libgmock.la +protobuf_test_CPPFLAGS = -I$(gtest_inc_dir) \ + -I$(gmock_inc_dir) # Disable optimization for tests unless the user explicitly asked for it, # since test_util.cc takes forever to compile with optimization (with GCC). # See configure.ac for more info. @@ -853,11 +860,11 @@ # Run cpp_unittest again with PROTOBUF_TEST_NO_DESCRIPTORS defined. protobuf_lazy_descriptor_test_LDADD = $(PTHREAD_LIBS) libprotobuf.la \ libprotoc.la \ - ../gmock/gtest/lib/libgtest.la \ - ../gmock/lib/libgmock.la \ - ../gmock/lib/libgmock_main.la -protobuf_lazy_descriptor_test_CPPFLAGS = -I$(srcdir)/../gmock/include \ - -I$(srcdir)/../gmock/gtest/include \ + -lgtest \ + libgmock_main.la \ + libgmock.la +protobuf_lazy_descriptor_test_CPPFLAGS = -I$(gmock_dir) \ + -I$(gtest_inc_dir) \ -DPROTOBUF_TEST_NO_DESCRIPTORS protobuf_lazy_descriptor_test_CXXFLAGS = $(NO_OPT_CXXFLAGS) protobuf_lazy_descriptor_test_SOURCES = \ @@ -878,9 +885,9 @@ # full runtime and we want to make sure this test builds without full # runtime. protobuf_lite_test_LDADD = $(PTHREAD_LIBS) libprotobuf-lite.la \ - ../gmock/gtest/lib/libgtest.la \ - ../gmock/lib/libgmock.la \ - ../gmock/lib/libgmock_main.la + -lgtest \ + libgmock_main.la \ + libgmock.la protobuf_lite_test_CPPFLAGS= -I$(srcdir)/../gmock/include \ -I$(srcdir)/../gmock/gtest/include protobuf_lite_test_CXXFLAGS = $(NO_OPT_CXXFLAGS) @@ -893,11 +900,11 @@ # gtest when building the test internally our memory sanitizer doesn't detect # memory leaks (don't know why). protobuf_lite_arena_test_LDADD = $(PTHREAD_LIBS) libprotobuf-lite.la \ - ../gmock/gtest/lib/libgtest.la \ - ../gmock/lib/libgmock.la \ - ../gmock/lib/libgmock_main.la -protobuf_lite_arena_test_CPPFLAGS = -I$(srcdir)/../gmock/include \ - -I$(srcdir)/../gmock/gtest/include + -lgtest \ + libgmock_main.la \ + libgmock.la +protobuf_lite_arena_test_CPPFLAGS = -I$(gmock_inc_dir) \ + -I$(gtest_inc_dir) protobuf_lite_arena_test_CXXFLAGS = $(NO_OPT_CXXFLAGS) protobuf_lite_arena_test_SOURCES = \ google/protobuf/lite_arena_unittest.cc \ @@ -906,8 +913,8 @@ # Test plugin binary. test_plugin_LDADD = $(PTHREAD_LIBS) libprotobuf.la libprotoc.la \ - ../gmock/gtest/lib/libgtest.la -test_plugin_CPPFLAGS = -I$(srcdir)/../gmock/gtest/include + -lgtest +test_plugin_CPPFLAGS = -I$(gmock_inc_dir) test_plugin_SOURCES = \ google/protobuf/compiler/mock_code_generator.cc \ google/protobuf/testing/file.cc \