Skip to content

中文详细编译手册

Haochuan Cui edited this page Sep 7, 2016 · 2 revisions

获取源码

git clone --recursive https://github.com/tencent-wechat/phxrpc.git [PhxRPC放置目录]

使用--recursive参数可以同时获得所依赖的第三方库protobuf源码。也可自行下载这些源码,然后自行拷贝或者通过软链的形式放置到third_party目录。

编译protobuf

  1. 进入third_party/protobuf目录。
  2. ./autogen.sh
  3. ./configure CXXFLAGS=-fPIC --prefix=[当前目录绝对路径], 这一步CXXFLAGS--prefix都必须设置对。
  4. make && make install
  5. 编译完成后检查是否在当前目录成功生成bin,include,lib三个子目录。

编译protobuf也可以直接参考官方文档 protobuf编译方法

编译PhxRPC

  1. 进入PhxRPC根目录。
  2. make
  3. 编译完成后检查是否生成lib子目录,并检查lib目录下是否生成静态库libphxrpc.a.

编译PhxRPC boost优化插件

  1. 下载boost1.56及以上版本放置到third_party目录,更名为boost.
  2. 编译好boost,如何编译请参考网上教程。
  3. 回到PhxRPC根目录。
  4. make boost
Clone this wiki locally