Changes

Jump to navigation Jump to search
756 bytes added ,  10:08, 23 July 2014
Line 11: Line 11:     
==== Building Protocol Buffers From Source ====
 
==== Building Protocol Buffers From Source ====
If you would like to build from source instead of using a package, the Protocol Buffer library can be found at http://code.google.com/p/protobuf/, while the Protocol Buffer C bindings can be found at http://code.google.com/p/protobuf-c/. You can use the following commands to obtain the source code repositories via <code>git</code>.
+
If you would like to build from source instead of using a package, the Protocol Buffer library can be found at http://code.google.com/p/protobuf/, while the Protocol Buffer C bindings can be found at http://code.google.com/p/protobuf-c/. You can use the following commands to obtain the source code repositories via <code>git</code>. Note that when cross compiling you will need to compile once for your build machine in order to get a <code>protoc</code> binary to use in the build process, and build once for each target machine to generate <code>libprotobuf.so</code>.
    
  git svn clone http://protobuf.googlecode.com/svn/trunk protobuf
 
  git svn clone http://protobuf.googlecode.com/svn/trunk protobuf
 +
cd protobuf
 +
./autogen.sh
 +
./configure --prefix=`pwd`/`uname -m`
 +
make
 +
make install
 +
cd ..
 +
 +
If you are cross compiling, then you will additionally want to build a version for your target architecture. This example targets AArch64.
 +
 +
cd protobuf
 +
./configure --host=aarch64-linux-gnu --prefix=`pwd`/aarch64 --with-protoc=`pwd`/`uname -m`/bin/protoc
 +
make
 +
make install
 +
cd ..
    
  git svn clone http://protobuf-c.googlecode.com/svn/trunk protobuf-c
 
  git svn clone http://protobuf-c.googlecode.com/svn/trunk protobuf-c
 +
cd protobuf-c
 +
./autogen.sh
 +
./configure --prefix=`pwd`/`uname -m` PATH="`pwd`/../protobuf/`uname -m`/bin:$PATH"
 +
make
 +
make install
 +
cd ..
    
=== Linux Kernel ===
 
=== Linux Kernel ===
50

edits

Navigation menu