Build protobuf

From CRIU
Revision as of 12:52, 12 July 2017 by Xemul (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

If you would like to build protobuf from sources, you can use the following commands to obtain the source code repositories, configure, and build the code. On a Debian based system, you may have to install autoconf curl g++ libtool packages first.

Build protobuf

 cd deps
 git clone https://github.com/google/protobuf.git protobuf
 cd protobuf
 ./autogen.sh
 ./configure --prefix=`pwd`/../`uname -m`-linux-gnu
 make
 make install
 cd ../..

Build protobuf-c

 cd deps
 git clone https://github.com/protobuf-c/protobuf-c.git protobuf-c
 cd protobuf-c
 ./autogen.sh
 mkdir ../pbc-`uname -m`
 cd ../pbc-`uname -m`
 ../protobuf-c/configure --prefix=`pwd`/../`uname -m`-linux-gnu \
   PKG_CONFIG_PATH=`pwd`/../`uname -m`-linux-gnu/lib/pkgconfig
 make
 make install
 cd ../..

Cross-compile for ARM

ARMv7

 cd deps
 mkdir -p pbc-arm
 cd pbc-arm
 ../protobuf-c/configure --host=arm-linux-gnueabihf --prefix=`pwd`/../arm-linux-gnueabihf \
                         --disable-protoc PATH=`pwd`/../`uname -m`-linux-gnu/bin:$PATH
 make PATH=`pwd`/../`uname -m`-linux-gnu/bin:$PATH
 make install PATH=`pwd`/../`uname -m`-linux-gnu/bin:$PATH
 cd ../..

ARM8

 cd deps
 mkdir -p pbc-aarch64
 cd pbc-aarch64
  ../protobuf-c/configure --host=aarch64-linux-gnu --prefix=`pwd`/../aarch64-linux-gnu \
                          --disable-protoc PATH=`pwd`/../`uname -m`-linux-gnu/bin:$PATH
 make PATH=`pwd`/../`uname -m`-linux-gnu/bin:$PATH
 make install PATH=`pwd`/../`uname -m`-linux-gnu/bin:$PATH
 cd ../..