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