代码拉取完成,页面将自动刷新
#!/bin/bash
if [ $# -lt 2 ]; then
echo "You need to provide two arguments:"
echo " 1. The folder in which to clone and build grpc"
echo " 2. The folder in which to install grpc"
echo "Both folders need to be user writeable but will be created if they do not exist"
echo "Example: "
echo " build_grpc.sh /tmp/grpc `pwd`/GrpcInstall"
exit 1
fi
parentdir="$(dirname $1)"
if [ -d $1 ]; then
if ! [ -w $1 ]; then
echo "$1 exists and you don't have the permissions to write to it"
exit 1
fi
elif [ -d ${parentdir} ]; then
if ! [ -w ${parentdir} ]; then
echo "You don't have the permissions to write to ${parentdir}"
exit 1
fi
else
echo "${parentdir} does not exist"
exit 1
fi
if [ -d "$2" ]; then
if ! [ -w "$2" ]; then
echo "You don't have the permissions to write to $2"
exit 1
fi
else
mkdir -p "$2" || { echo "Failed to create $2. Make sure you have write permissions." ; exit 1; }
fi
echo "Cloning GRPC repository to: $1"
echo "Installing to: $2"
git clone https://github.com/grpc/grpc.git $1
cd $1
git checkout v1.21.1
git submodule init
git submodule update
export PROTOBUF_CONFIG_OPTS="--prefix=$2"
make prefix=$2
echo "Installing GRPC to $2"
make install prefix=$2
cd third_party/protobuf
make install
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。