> Probably not. LibCstd isn't complete enough for protobuf.

I was able to get protobuf 2.1.0 to work well under Sun Studio 11,
using libCstd, with a few patches.  Works well enough to compile and
run the add_person_cpp/list_people_cpp examples.

I include the build instructions and patch set below   Also included
are patches to the examples makefile to test it out.

<Apply below patchset first against protobuf 2.1.0>
$ CXX=CC CC=cc ./configure --disable-shared
$ make
$ cd examples
$ make cpp
$ ./add_person_cpp addressbook.test
(enter a test record)
$ ./list_people_cpp addressbook.test
(test record is displayed correctly)
$ ldd list_people_cpp      (or ldd add_person_cpp )
        libpthread.so.1 =>       /lib/libpthread.so.1
        libCstd.so.1 =>  /usr/lib/libCstd.so.1
        libCrun.so.1 =>  /usr/lib/libCrun.so.1
        libm.so.2 =>     /lib/libm.so.2
        libc.so.1 =>     /lib/libc.so.1

Index: src/google/protobuf/repeated_field.h
===================================================================
--- src/google/protobuf/repeated_field.h        (revision 2)
+++ src/google/protobuf/repeated_field.h        (working copy)
@@ -69,7 +69,7 @@
 class LIBPROTOBUF_EXPORT GenericRepeatedField {
  public:
   inline GenericRepeatedField() {}
-#if defined(__DECCXX) && defined(__osf__)
+#if defined(__SUNPRO_CC) || defined(__DECCXX) && defined(__osf__)
   // HP C++ on Tru64 has trouble when this is not defined inline.
   virtual ~GenericRepeatedField() {}
 #else
@@ -548,7 +548,7 @@
   current_size_ = 0;
 }

-#if defined(__DECCXX) && defined(__osf__)
+#if defined(__SUNPRO_CC) || defined(__DECCXX) && defined(__osf__)
 // HP C++ on Tru64 has trouble when this is not defined inline.
 template <>
 inline void RepeatedPtrField<string>::Clear() {
Index: src/google/protobuf/descriptor_database.cc
===================================================================
--- src/google/protobuf/descriptor_database.cc  (revision 2)
+++ src/google/protobuf/descriptor_database.cc  (working copy)
@@ -127,7 +127,13 @@

   // Insert the new symbol using the iterator as a hint, the new
entry will
   // appear immediately before the one the iterator is pointing at.
+
+  // Sun Studio 11 needs a little help here
+#if defined(__SUNPRO_CC)
+  by_symbol_.insert(iter, make_pair<const string,Value>(name,
value));
+#else
   by_symbol_.insert(iter, make_pair(name, value));
+#endif

   return true;
 }
Index: src/google/protobuf/compiler/command_line_interface.cc
===================================================================
--- src/google/protobuf/compiler/command_line_interface.cc      (revision
2)
+++ src/google/protobuf/compiler/command_line_interface.cc      (working
copy)
@@ -474,7 +474,7 @@

   // If no --proto_path was given, use the current working directory.
   if (proto_path_.empty()) {
-    proto_path_.push_back(make_pair("", "."));
+    proto_path_.push_back(make_pair(string(""), string(".")));
   }

   // Check some errror cases.
Index: src/google/protobuf/repeated_field.cc
===================================================================
--- src/google/protobuf/repeated_field.cc       (revision 2)
+++ src/google/protobuf/repeated_field.cc       (working copy)
@@ -40,7 +40,7 @@
 // HP C++ on Tru64 can't handle the stuff below being defined out-of-
line, so
 // on that platform everything is defined in repeated_field.h.  On
other
 // platforms, we want these to be out-of-line to avoid code bloat.
-#if !defined(__DECCXX) || !defined(__osf__)
+#if !defined(__SUNPRO_CC) && (!defined(__DECCXX) || !defined
(__osf__))

 namespace internal {

------- Below changes the examples makefile to exercise protobuf under
solaris

Index: examples/Makefile
===================================================================
--- examples/Makefile   (revision 2)
+++ examples/Makefile   (working copy)
@@ -1,5 +1,13 @@
 # See README.txt.

+# For the rest of the world
+#CXX = c++
+#PROTOC = protoc
+
+# Testing For Solaris (pre-install)
+CXX = CC -I../src -L../src/.libs
+PROTOC = ../src/protoc
+
 .PHONY: all cpp java python clean

 all: cpp java python
@@ -18,14 +26,14 @@
        rmdir com 2>/dev/null || true

 protoc_middleman: addressbook.proto
-       protoc --cpp_out=. --java_out=. --python_out=. addressbook.proto
+       $(PROTOC) --cpp_out=. --java_out=. --python_out=. addressbook.proto
        @touch protoc_middleman

 add_person_cpp: add_person.cc protoc_middleman
-       c++ add_person.cc addressbook.pb.cc -lprotobuf -lpthread -o
add_person_cpp
+       $(CXX) add_person.cc addressbook.pb.cc -lprotobuf -lpthread -o
add_person_cpp

 list_people_cpp: list_people.cc protoc_middleman
-       c++ list_people.cc addressbook.pb.cc -lprotobuf -lpthread -o
list_people_cpp
+       $(CXX) list_people.cc addressbook.pb.cc -lprotobuf -lpthread -o
list_people_cpp

 javac_middleman: AddPerson.java ListPeople.java protoc_middleman
        javac AddPerson.java ListPeople.java com/example/tutorial/
AddressBookProtos.java




--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to protobuf@googlegroups.com
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to