diff --git a/configure.ac b/configure.ac index b129b22a3..3bcd7d0ba 100644 --- a/configure.ac +++ b/configure.ac @@ -66,21 +66,27 @@ AM_CONDITIONAL([SUPPORTS_GNU_PLUS_PLUS_11], [test "x$ac_cv_gnu_plus_plus_11" = x # force us into gnu++98 mode if necessary # If gnu++11 and gnu++98 then -# If no unit tests, force to gnu++98 -# If unittests and cppunit < 1.14.0, force to gnu++98 -# Else turn off deprecation messages for std::auto_ptr and run gnu++11 +# If protobuf < 3.6 +# If no unit tests, force to gnu++98 +# Else we have unit tests +# If cppunit < 1.14.0, force to gnu++98 +# Else turn off deprecation messages for std::auto_ptr and run gnu++11 +# Else assume we have protobuf >= 3.6 (later checks will confirm that for certain), turn off deprecation messages for std::auto_ptr and run gnu++11 require_gnu_plus_plus_11="no" AS_IF([test "x$ac_cv_gnu_plus_plus_11" = xyes], [AS_IF([test "x$ac_cv_gnu_plus_plus_98" = xyes], - [AS_IF([test "x$enable_unittests" = xno], - [CXXFLAGS="$CXXFLAGS -std=gnu++98"], - [PKG_CHECK_MODULES([CPPUNIT1], [cppunit < 1.14.0], + [PKG_CHECK_MODULES([PROTOBUF1], [protobuf < 3.6], + [AS_IF([test "x$enable_unittests" = xno], [CXXFLAGS="$CXXFLAGS -std=gnu++98"], - [PKG_CHECK_MODULES([CPPUNIT2], [cppunit >= 1.14.0], - [require_gnu_plus_plus_11="yes"], - [AC_MSG_WARN([OLA requires std::auto_ptr support.])]) + [PKG_CHECK_MODULES([CPPUNIT1], [cppunit < 1.14.0], + [CXXFLAGS="$CXXFLAGS -std=gnu++98"], + [PKG_CHECK_MODULES([CPPUNIT2], [cppunit >= 1.14.0], + [require_gnu_plus_plus_11="yes"], + [AC_MSG_WARN([OLA requires std::auto_ptr support.])]) + ]) ]) - ]) + ], + [require_gnu_plus_plus_11="yes"]) ]) ]) AS_IF([test "x$require_gnu_plus_plus_11" = xyes], diff --git a/config/ola.m4 b/config/ola.m4 index 6080932e9..d3b8cc8f8 100644 --- a/config/ola.m4 +++ b/config/ola.m4 @@ -24,9 +24,6 @@ AC_DEFUN([PROTOBUF_SUPPORT], AC_REQUIRE_CPP() PKG_CHECK_MODULES(libprotobuf, [protobuf >= $1]) -PKG_CHECK_MODULES(libprotobuf2, [protobuf < 3.2], [], - [AC_MSG_ERROR([OLA currently requires protobuf < 3.2, see issue 1192])]) - AC_SUBST([libprotobuf_CFLAGS]) AC_ARG_WITH([protoc], diff --git a/protoc/CppFileGenerator.cpp b/protoc/CppFileGenerator.cpp index 518c17879..e7dd95ccb 100644 --- a/protoc/CppFileGenerator.cpp +++ b/protoc/CppFileGenerator.cpp @@ -196,14 +196,6 @@ void FileGenerator::GenerateBuildDescriptors(Printer* printer) { "assigndescriptorsname", GlobalAssignDescriptorsName(m_output_name)); printer->Indent(); - // Make sure the file has found its way into the pool. If a descriptor - // is requested *during* static init then AddDescriptors() may not have - // been called yet, so we call it manually. Note that it's fine if - // AddDescriptors() is called multiple times. - printer->Print( - "$adddescriptorsname$();\n", - "adddescriptorsname", GlobalAddDescriptorsName(m_file->name())); - // Get the file's descriptor from the pool. printer->Print( "const ::google::protobuf::FileDescriptor* file =\n" diff --git a/protoc/GeneratorHelpers.cpp b/protoc/GeneratorHelpers.cpp index 19609181e..6f619b5c0 100644 --- a/protoc/GeneratorHelpers.cpp +++ b/protoc/GeneratorHelpers.cpp @@ -104,11 +104,6 @@ string FilenameIdentifier(const string& filename) { return result; } -// Return the name of the AddDescriptors() function for a given file. -string GlobalAddDescriptorsName(const string& filename) { - return "protobuf_AddDesc_" + FilenameIdentifier(filename); -} - // Return the name of the AssignDescriptors() function for a given file. string GlobalAssignDescriptorsName(const string& filename) { return "protobuf_AssignDesc_" + FilenameIdentifier(filename); diff --git a/protoc/GeneratorHelpers.h b/protoc/GeneratorHelpers.h index 35efdbb04..fa91a915d 100644 --- a/protoc/GeneratorHelpers.h +++ b/protoc/GeneratorHelpers.h @@ -67,9 +67,6 @@ string StripProto(const string& filename); // Convert a file name into a valid identifier. string FilenameIdentifier(const string& filename); -// Return the name of the AddDescriptors() function for a given file. -string GlobalAddDescriptorsName(const string& filename); - // Return the name of the AssignDescriptors() function for a given file. string GlobalAssignDescriptorsName(const string& filename);