Protobuf: added script for dependencies check

This commit is contained in:
dsavvinov
2016-08-09 15:53:48 +03:00
parent 3444e01785
commit 3a2f1ff136
3 changed files with 54 additions and 1 deletions
@@ -15,7 +15,7 @@ $(EXE): $(BINDIR) $(OBJECTS)
$(CXX) $(OBJECTS) -o $(EXE) $(LDFLAGS)
$(BINDIR)/%.o: $(SRCDIR)/%.cc
$(CXX) $(CXXFLAGS) -c -MMD -o $@ $< -lprotoc
$(CXX) $(CXXFLAGS) -c -MMD -o $@ $<
include $(wildcard $(BINDIR)/*.d)
@@ -24,6 +24,7 @@ $(BINDIR):
clean:
rm -rf $(BINDIR)
rm $(EXE)
generate:
./protoc --kotlin_out=$$HOME/Downloads/carkot/proto/compiler/protoc-artifacts ./test/connect.proto
+52
View File
@@ -0,0 +1,52 @@
#!/bin/bash
lprotoc="/usr/local/lib/libprotoc.so"
lprotobuf="/usr/local/lib/libprotobuf.so"
ok=1
missing=""
if [ ! -e "$lprotoc" ]; then
ok=0
missing="$missing $lprotoc"
fi
if [ ! -e "$lprotobuf" ]; then
ok=0
missing="$missing $lprotobuf"
fi
if [ "$ok" == 0 ]; then
echo "$missing, required for building, is not found"
echo "You have to build and install latest Protobuf version from https://github.com/google/protobuf"
echo "Do you want to do it automatically? [y/n]"
echo "(Caution: this will take decent amount of time and internet traffic)"
response="n"
read response
if [ $response = "y" ]; then
echo "Creating directory for Protobuf sources"
mkdir protobuf_sources
cd protobuf_sources
echo "Cloning repository"
git clone https://github.com/google/protobuf
cd protobuf
echo "Resolving prerequisites to build Google Protobuf"
sudo apt-get install autoconf automake libtool curl make g++ unzip
echo "Generating Makefiles and etc."
./autogen.sh
./configure
echo "Building"
make
echo "Installing"
sudo make install
echo "Cleaning"
rm -rf protobuf_sources
fi
else
echo "Prerequisites met, you can build library now via Makefile"
fi