系统版本: Mac OS X 10
本文简述grpc-java的编译过程,在官方文档的步骤里,增加两个包的安装依赖。
Build
# download source code
git clone https://github.com/grpc/grpc-java.git
cd grpc-java
# install mvn
brew install maven
# build netty
git submodule update --init
cd lib/netty
mvn install -pl codec-http2 -am -DskipTests=true
# build protobuf
git clone https://github.com/google/protobuf.git
cd protobuf
git checkout alpha-2-x # branch is not as the doc
# install automake
brew install automake
# install Libtool
brew install Libtool
./autogen.sh
./configure
make
make check
sudo make install
# export system var in Mac
export CXXFLAGS="-I/usr/local/include" LDFLAGS="-L/usr/local/lib"
# build grpc
./gradlew install
参考资料: HomeBrew工具
全文完 :)