Line 70:
Line 70:
** sudo apt-get install --no-install-recommends git build-essential libprotobuf-dev libprotobuf-c0-dev protobuf-c-compiler protobuf-compiler python-protobuf libnl-3-dev libpth-dev pkg-config libcap-dev asciidoc xmlto libnet-dev
** sudo apt-get install --no-install-recommends git build-essential libprotobuf-dev libprotobuf-c0-dev protobuf-c-compiler protobuf-compiler python-protobuf libnl-3-dev libpth-dev pkg-config libcap-dev asciidoc xmlto libnet-dev
−
==== Building Protocol Buffers From Source ====
+
[[Build protobuf]] from sources
−
If you would like to build from source, 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 <code>autoconf curl g++ libtool</code> packages first.
−
−
<div class="toccolours mw-collapsible mw-collapsed" style="width:800px">
−
To build protobuf
−
<div class="mw-collapsible-content">
−
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 ../..
−
</div>
−
</div>
−
−
<div class="toccolours mw-collapsible mw-collapsed" style="width:800px">
−
To build protobuf-c
−
<div class="mw-collapsible-content">
−
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 ../..
−
</div>
−
</div>
−
−
<div class="toccolours mw-collapsible mw-collapsed" style="width:800px">
−
To cross-compile for ARM some more tricks will be required.
−
<div class="mw-collapsible-content">
−
For 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 ../..
−
−
For 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 ../..
−
</div>
−
</div>
=== Other deps ===
=== Other deps ===