Hi,

Here is a little info on how to compile libprotobuf on iSeries (as/
400). (But not on how to build protoc)

Before you even start, consider compiling your entire program on AIX
and using PASE "emulation" to run it.

I list below the files that are needed to compose the equivalent of
"libprotobuf.so". The idea is to compile them all into a library and
then build a binding directory, and use it for binding your program.

Copy the protobuf release into an IFS directory. Modify the .cc file
extension to .C  . Make sure the C++ file names are shorter than 10
characters. C headers should stay the same.

Add to all .C file, at the first line,

#pragma convert(850)

This tells the compiler, more or less, to use ASCII, not EBCDIC. This
is important for several reasons, one is that the protoc output, when
running on an ASCII machine, create a string that is parsed, on
startup assuming ASCII. This might not be needed if someone manage to
build protoc on the iSeries. To return to the default code page, if
you need to , use #pragma convert(0). Some internal protobuf messages
will come out garbage on the iSeries output file. Perhaps later I'll
hunt all printed strings and #pragma before and after.

Create an empty library (e.g. PBUFLIB)

Compile the file in QSH with ixlC like this, for example:

ixlC -c -qrtti=all -oPBUFLIB/zs_impl -I`pwd` -I`pwd`/src ./src/google/
protobuf/io/zs_impl.C

It will be very similar to use CRTCPPMOD.

Create a binding directory and add all the files in library PBUFLIB to
the binding directory.

Note I am an iSeries novice. There may be a much better way to do this
-- that's what worked for me.

Files needed for libprtobuf.a :

 ./src/google/protobuf/stubs/common.cc \
./src/google/protobuf/stubs/once.cc \
./src/google/protobuf/stubs/hash.cc \
./src/google/protobuf/extension_set.cc \
./src/google/protobuf/generated_message_util.cc \
./src/google/protobuf/message_lite.cc \
./src/google/protobuf/repeated_field.cc \
./src/google/protobuf/wire_format_lite.cc \
./src/google/protobuf/io/coded_stream.cc \
./src/google/protobuf/io/zero_copy_stream.cc \
./src/google/protobuf/io/zero_copy_stream_impl_lite.cc \
./src/google/protobuf/stubs/strutil.cc \
./src/google/protobuf/stubs/substitute.cc \
./src/google/protobuf/stubs/structurally_valid.cc \
./src/google/protobuf/descriptor.cc \
./src/google/protobuf/descriptor.pb.cc \
./src/google/protobuf/descriptor_database.cc \
./src/google/protobuf/dynamic_message.cc \
./src/google/protobuf/extension_set_heavy.cc \
./src/google/protobuf/generated_message_reflection.cc \
./src/google/protobuf/message.cc \
./src/google/protobuf/reflection_ops.cc \
./src/google/protobuf/service.cc \
./src/google/protobuf/text_format.cc \
./src/google/protobuf/unknown_field_set.cc \
./src/google/protobuf/wire_format.cc \
./src/google/protobuf/io/gzip_stream.cc \
./src/google/protobuf/io/printer.cc \
./src/google/protobuf/io/tokenizer.cc \
./src/google/protobuf/io/zero_copy_stream_impl.cc \
./src/google/protobuf/compiler/importer.cc \
./src/google/protobuf/compiler/parser.cc


On Aug 17, 11:08 am, Henner Zeller <henner.zel...@googlemail.com>
wrote:
> On Mon, Aug 16, 2010 at 17:04, ury <ury.se...@gmail.com> wrote:
> > Hi,
>
> > It was EBCDIC vs. ASCII issues.
>
> > If anyone is interested in iSeries/zSeries porting issues, or protobuf
> > on EBCDIC, I'll be glad to help
>
> In particular if you needed to modify the source and have a patch it
> might be interesting to send that change upstream if it is not too
> much hassle.
>
>
>
> > Thanks
>
> > On Aug 16, 2:18 pm, ury <ury.se...@gmail.com> wrote:
> >> Hi,
>
> >> I got the thing to compile and link on the iSeries. When I run the
> >> add_person  C++ example, I get
>
> >> libprotobuf ERROR /testc/protobuf/build/./src/google/protobuf/
> >> desc_datab.C:314] Invalid file descriptor data passed to
> >> EncodedDescriptorDatabase::Add().
> >> libprotobuf FATAL /testc/protobuf/build/./src/google/protobuf/desc.C:
> >> 860] CHECK failed: generated_database_->Add(encoded_file_descriptor,
> >> size):
>
> >> Any idea what may cause this?
>
> >> Thanks
>
> >> On Aug 10, 3:52 pm, ury <ury.se...@gmail.com> wrote:
>
> >> > Hi,
>
> >> > I am trying to port the C++ protobuf runtime library to iSeries. (aka
> >> > AS/400).
> >> > Have anyone does this before ? I'd be glad to hear any advice.
>
> >> > Thanks !
>
> > --
> > You received this message because you are subscribed to the Google Groups 
> > "Protocol Buffers" group.
> > To post to this group, send email to proto...@googlegroups.com.
> > To unsubscribe from this group, send email to 
> > protobuf+unsubscr...@googlegroups.com.
> > For more options, visit this group 
> > athttp://groups.google.com/group/protobuf?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to proto...@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