Protobuf: added script for dependencies check
This commit is contained in:
@@ -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
|
||||
|
||||
Binary file not shown.
Executable
+52
@@ -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
|
||||
Reference in New Issue
Block a user