系統版本: 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工具
全文完 :)