Created
August 2, 2016 04:10
-
-
Save ernoaapa/f98e358f5c235754ca9fa775679e0d27 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Install protobuf C++ library | |
# As described here: https://github.com/google/protobuf/blob/master/src/README.md#c-installation---unix | |
# | |
# NOTE: | |
# You should use 'libprotobuf10' package when it's available! | |
# | |
set -e | |
PROTOBUF_VERSION=${1:-3.0.0-beta-3} | |
if [ -d "/usr/local/include/google/protobuf/" ]; then | |
echo "Already installed! (directory /usr/local/include/google/protobuf/ exist)" | |
else | |
echo "Install Protobuf ${PROTOBUF_VERSION}" | |
apt-get install -y autoconf automake libtool make g++ wget | |
wget -O /tmp/protobuf.tar.gz https://github.com/google/protobuf/releases/download/v${PROTOBUF_VERSION}/protobuf-cpp-${PROTOBUF_VERSION}.tar.gz | |
mkdir -p /tmp/protobuf | |
tar -zxvf /tmp/protobuf.tar.gz -C /tmp/protobuf | |
cd /tmp/protobuf/protobuf-${PROTOBUF_VERSION} | |
# ./autogen.sh # Needed only if building from master branch | |
./configure | |
make | |
make check | |
make install | |
ldconfig | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment