628e06
--- protobuf-2.5.0/autogen.sh.orig	2013-02-26 09:56:44.000000000 -0800
628e06
+++ protobuf-2.5.0/autogen.sh	2013-03-09 19:21:52.512010330 -0800
628e06
@@ -1,41 +1,24 @@
628e06
 #!/bin/sh
628e06
 
628e06
 # Run this script to generate the configure script and other files that will
628e06
 # be included in the distribution.  These files are not checked in because they
628e06
 # are automatically generated.
628e06
 
628e06
 set -e
628e06
 
628e06
 # Check that we're being run from the right directory.
628e06
 if test ! -f src/google/protobuf/stubs/common.h; then
628e06
   cat >&2 << __EOF__
628e06
 Could not find source code.  Make sure you are running this script from the
628e06
 root of the distribution tree.
628e06
 __EOF__
628e06
   exit 1
628e06
 fi
628e06
 
628e06
-# Check that gtest is present.  Usually it is already there since the
628e06
-# directory is set up as an SVN external.
628e06
-if test ! -e gtest; then
628e06
-  echo "Google Test not present.  Fetching gtest-1.5.0 from the web..."
628e06
-  curl http://googletest.googlecode.com/files/gtest-1.5.0.tar.bz2 | tar jx
628e06
-  mv gtest-1.5.0 gtest
628e06
-fi
628e06
-
628e06
 set -ex
628e06
 
628e06
-# Temporary hack:  Must change C runtime library to "multi-threaded DLL",
628e06
-#   otherwise it will be set to "multi-threaded static" when MSVC upgrades
628e06
-#   the project file to MSVC 2005/2008.  vladl of Google Test says gtest will
628e06
-#   probably change their default to match, then this will be unnecessary.
628e06
-#   One of these mappings converts the debug configuration and the other
628e06
-#   converts the release configuration.  I don't know which is which.
628e06
-sed -i -e 's/RuntimeLibrary="5"/RuntimeLibrary="3"/g;
628e06
-           s/RuntimeLibrary="4"/RuntimeLibrary="2"/g;' gtest/msvc/*.vcproj
628e06
-
628e06
 # TODO(kenton):  Remove the ",no-obsolete" part and fix the resulting warnings.
628e06
 autoreconf -f -i -Wall,no-obsolete
628e06
 
628e06
 rm -rf autom4te.cache config.h.in~
628e06
 exit 0
628e06
--- protobuf-2.5.0/Makefile.am.orig	2013-02-26 09:56:44.000000000 -0800
628e06
+++ protobuf-2.5.0/Makefile.am	2013-03-09 19:22:18.741692020 -0800
628e06
@@ -1,54 +1,33 @@
628e06
 ## Process this file with automake to produce Makefile.in
628e06
 
628e06
 ACLOCAL_AMFLAGS = -I m4
628e06
 
628e06
 AUTOMAKE_OPTIONS = foreign
628e06
 
628e06
 # Build . before src so that our all-local and clean-local hooks kicks in at
628e06
 # the right time.
628e06
 SUBDIRS = . src
628e06
 
628e06
 # Always include gtest in distributions.
628e06
 DIST_SUBDIRS = $(subdirs) src
628e06
 
628e06
-# Build gtest before we build protobuf tests.  We don't add gtest to SUBDIRS
628e06
-# because then "make check" would also build and run all of gtest's own tests,
628e06
-# which takes a lot of time and is generally not useful to us.  Also, we don't
628e06
-# want "make install" to recurse into gtest since we don't want to overwrite
628e06
-# the installed version of gtest if there is one.
628e06
-check-local:
628e06
-	@echo "Making lib/libgtest.a lib/libgtest_main.a in gtest"
628e06
-	@cd gtest && $(MAKE) $(AM_MAKEFLAGS) lib/libgtest.la lib/libgtest_main.la
628e06
-
628e06
-# We would like to clean gtest when "make clean" is invoked.  But we have to
628e06
-# be careful because clean-local is also invoked during "make distclean", but
628e06
-# "make distclean" already recurses into gtest because it's listed among the
628e06
-# DIST_SUBDIRS.  distclean will delete gtest/Makefile, so if we then try to
628e06
-# cd to the directory again and "make clean" it will fail.  So, check that the
628e06
-# Makefile exists before recursing.
628e06
-clean-local:
628e06
-	@if test -e gtest/Makefile; then \
628e06
-	  echo "Making clean in gtest"; \
628e06
-	  cd gtest && $(MAKE) $(AM_MAKEFLAGS) clean; \
628e06
-	fi
628e06
-
628e06
 pkgconfigdir = $(libdir)/pkgconfig
628e06
 pkgconfig_DATA = protobuf.pc protobuf-lite.pc
628e06
 
628e06
 EXTRA_DIST =                                                                 \
628e06
   autogen.sh                                                                 \
628e06
   generate_descriptor_proto.sh                                               \
628e06
   README.txt                                                                 \
628e06
   INSTALL.txt                                                                \
628e06
   COPYING.txt                                                                \
628e06
   CONTRIBUTORS.txt                                                           \
628e06
   CHANGES.txt                                                                \
628e06
   editors/README.txt                                                         \
628e06
   editors/proto.vim                                                          \
628e06
   editors/protobuf-mode.el                                                   \
628e06
   vsprojects/config.h                                                        \
628e06
   vsprojects/extract_includes.bat                                            \
628e06
   vsprojects/libprotobuf.vcproj                                              \
628e06
   vsprojects/libprotobuf-lite.vcproj                                         \
628e06
   vsprojects/libprotoc.vcproj                                                \
628e06
   vsprojects/protobuf.sln                                                    \
628e06
--- protobuf-2.5.0/src/Makefile.am.orig	2013-02-26 09:56:43.000000000 -0800
628e06
+++ protobuf-2.5.0/src/Makefile.am	2013-03-09 19:25:09.076620571 -0800
628e06
@@ -286,44 +286,42 @@
628e06
 # building out-of-tree.
628e06
 unittest_proto_middleman: protoc$(EXEEXT) $(protoc_inputs)
628e06
 	oldpwd=`pwd` && ( cd $(srcdir) && $$oldpwd/protoc$(EXEEXT) -I. --cpp_out=$$oldpwd $(protoc_inputs) )
628e06
 	touch unittest_proto_middleman
628e06
 
628e06
 endif
628e06
 
628e06
 $(protoc_outputs): unittest_proto_middleman
628e06
 
628e06
 COMMON_TEST_SOURCES =                                          \
628e06
   google/protobuf/test_util.cc                                 \
628e06
   google/protobuf/test_util.h                                  \
628e06
   google/protobuf/testing/googletest.cc                        \
628e06
   google/protobuf/testing/googletest.h                         \
628e06
   google/protobuf/testing/file.cc                              \
628e06
   google/protobuf/testing/file.h
628e06
 
628e06
 check_PROGRAMS = protoc protobuf-test protobuf-lazy-descriptor-test \
628e06
                  protobuf-lite-test test_plugin $(GZCHECKPROGRAMS)
628e06
 protobuf_test_LDADD = $(PTHREAD_LIBS) libprotobuf.la libprotoc.la \
628e06
-                      $(top_builddir)/gtest/lib/libgtest.la       \
628e06
-                      $(top_builddir)/gtest/lib/libgtest_main.la
628e06
+                      -lgtest -lgtest_main
628e06
-protobuf_test_CPPFLAGS = -I$(top_srcdir)/gtest/include         \
628e06
-                         -I$(top_builddir)/gtest/include
628e06
+protobuf_test_CPPFLAGS =
628e06
 # Disable optimization for tests unless the user explicitly asked for it,
628e06
 # since test_util.cc takes forever to compile with optimization (with GCC).
628e06
 # See configure.ac for more info.
628e06
 protobuf_test_CXXFLAGS = $(NO_OPT_CXXFLAGS)
628e06
 protobuf_test_SOURCES =                                        \
628e06
   google/protobuf/stubs/common_unittest.cc                     \
628e06
   google/protobuf/stubs/once_unittest.cc                       \
628e06
   google/protobuf/stubs/strutil_unittest.cc                    \
628e06
   google/protobuf/stubs/structurally_valid_unittest.cc         \
628e06
   google/protobuf/stubs/stringprintf_unittest.cc               \
628e06
   google/protobuf/stubs/template_util_unittest.cc              \
628e06
   google/protobuf/stubs/type_traits_unittest.cc                \
628e06
   google/protobuf/descriptor_database_unittest.cc              \
628e06
   google/protobuf/descriptor_unittest.cc                       \
628e06
   google/protobuf/dynamic_message_unittest.cc                  \
628e06
   google/protobuf/extension_set_unittest.cc                    \
628e06
   google/protobuf/generated_message_reflection_unittest.cc     \
628e06
   google/protobuf/message_unittest.cc                          \
628e06
   google/protobuf/reflection_ops_unittest.cc                   \
628e06
   google/protobuf/repeated_field_unittest.cc                   \
628e06
@@ -335,61 +333,58 @@
628e06
   google/protobuf/io/printer_unittest.cc                       \
628e06
   google/protobuf/io/tokenizer_unittest.cc                     \
628e06
   google/protobuf/io/zero_copy_stream_unittest.cc              \
628e06
   google/protobuf/compiler/command_line_interface_unittest.cc  \
628e06
   google/protobuf/compiler/importer_unittest.cc                \
628e06
   google/protobuf/compiler/mock_code_generator.cc              \
628e06
   google/protobuf/compiler/mock_code_generator.h               \
628e06
   google/protobuf/compiler/parser_unittest.cc                  \
628e06
   google/protobuf/compiler/cpp/cpp_bootstrap_unittest.cc       \
628e06
   google/protobuf/compiler/cpp/cpp_unittest.h                  \
628e06
   google/protobuf/compiler/cpp/cpp_unittest.cc                 \
628e06
   google/protobuf/compiler/cpp/cpp_plugin_unittest.cc          \
628e06
   google/protobuf/compiler/java/java_plugin_unittest.cc        \
628e06
   google/protobuf/compiler/java/java_doc_comment_unittest.cc   \
628e06
   google/protobuf/compiler/python/python_plugin_unittest.cc    \
628e06
   $(COMMON_TEST_SOURCES)
628e06
 nodist_protobuf_test_SOURCES = $(protoc_outputs)
628e06
 
628e06
 # Run cpp_unittest again with PROTOBUF_TEST_NO_DESCRIPTORS defined.
628e06
 protobuf_lazy_descriptor_test_LDADD = $(PTHREAD_LIBS) libprotobuf.la \
628e06
-                      $(top_builddir)/gtest/lib/libgtest.la       \
628e06
-                      $(top_builddir)/gtest/lib/libgtest_main.la
628e06
+                                      -lgtest -lgtest_main
628e06
-protobuf_lazy_descriptor_test_CPPFLAGS = -I$(top_srcdir)/gtest/include    \
628e06
-                                         -I$(top_builddir)/gtest/include  \
628e06
-                                         -DPROTOBUF_TEST_NO_DESCRIPTORS
628e06
+protobuf_lazy_descriptor_test_CPPFLAGS = -DPROTOBUF_TEST_NO_DESCRIPTORS
628e06
 protobuf_lazy_descriptor_test_CXXFLAGS = $(NO_OPT_CXXFLAGS)
628e06
 protobuf_lazy_descriptor_test_SOURCES =                        \
628e06
   google/protobuf/compiler/cpp/cpp_unittest.cc                 \
628e06
   $(COMMON_TEST_SOURCES)
628e06
 nodist_protobuf_lazy_descriptor_test_SOURCES = $(protoc_outputs)
628e06
 
628e06
 # Build lite_unittest separately, since it doesn't use gtest.
628e06
 protobuf_lite_test_LDADD = $(PTHREAD_LIBS) libprotobuf-lite.la
628e06
 protobuf_lite_test_CXXFLAGS = $(NO_OPT_CXXFLAGS)
628e06
 protobuf_lite_test_SOURCES =                                           \
628e06
   google/protobuf/lite_unittest.cc                                     \
628e06
   google/protobuf/test_util_lite.cc                                    \
628e06
   google/protobuf/test_util_lite.h
628e06
 nodist_protobuf_lite_test_SOURCES = $(protoc_lite_outputs)
628e06
 
628e06
 # Test plugin binary.
628e06
 test_plugin_LDADD = $(PTHREAD_LIBS) libprotobuf.la libprotoc.la \
628e06
-                    $(top_builddir)/gtest/lib/libgtest.la
628e06
+                    -lgtest
628e06
 test_plugin_CPPFLAGS = -I$(top_srcdir)/gtest/include         \
628e06
                        -I$(top_builddir)/gtest/include
628e06
 test_plugin_SOURCES =                                          \
628e06
   google/protobuf/compiler/mock_code_generator.cc              \
628e06
   google/protobuf/testing/file.cc                              \
628e06
   google/protobuf/testing/file.h                               \
628e06
   google/protobuf/compiler/test_plugin.cc
628e06
 
628e06
 if HAVE_ZLIB
628e06
 zcgzip_LDADD = $(PTHREAD_LIBS) libprotobuf.la
628e06
 zcgzip_SOURCES = google/protobuf/testing/zcgzip.cc
628e06
 
628e06
 zcgunzip_LDADD = $(PTHREAD_LIBS) libprotobuf.la
628e06
 zcgunzip_SOURCES = google/protobuf/testing/zcgunzip.cc
628e06
 endif
628e06
 
628e06
 TESTS = protobuf-test protobuf-lazy-descriptor-test protobuf-lite-test \
628e06
         google/protobuf/compiler/zip_output_unittest.sh $(GZTESTS)