1#!/bin/bash 2 3grpc_1_36_0_githash=736e3758351ced3cd842bad3ba4e2540f01bbc48 4 5function build_grpc () { 6 git clone https://github.com/grpc/grpc.git google/grpc 7 cd google/grpc 8 git checkout ${grpc_1_36_0_githash} 9 git submodule update --init 10 # Apply boringssl build patch 11 cd third_party/boringssl-with-bazel 12 git apply ../../../../grpc/boringssl.patch 13 cd ../.. 14 mkdir ../grpc_build 15 cd ../grpc_build 16 cmake ../grpc -DgRPC_INSTALL=ON -DgRPC_BUILD_TESTS=OFF -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX=`pwd`/../grpc/install 17 cmake --build . --target install ${JOBS:+-j$JOBS} 18 if [ ! -f ${GRPC_INSTALL_PATH}/lib/libgrpc++_unsecure.so.1 ]; then 19 ln -s ${GRPC_INSTALL_PATH}/lib/libgrpc++_unsecure.so.6 ${GRPC_INSTALL_PATH}/lib/libgrpc++_unsecure.so.1 20 fi 21 cd ../.. 22} 23 24GRPC_INSTALL_PATH=`pwd`/google/grpc/install 25PROTOBUF_DOWNLOAD_PATH=`pwd`/google/grpc/third_party/protobuf 26 27build_grpc 28