Commit cbeba2d0 authored by wenweihu86's avatar wenweihu86

fix build env and add building section for README

parent 2ef40e6b
......@@ -22,10 +22,14 @@ You can use it to:
* Get [better latency and throughput](docs/en/overview.md#better-latency-and-throughput).
* [Extend brpc](docs/en/new_protocol.md) with the protocols used in your organization quickly, or customize components, including [naming services](docs/cn/load_balancing.md#命名服务) (dns, zk, etcd), [load balancers](docs/cn/load_balancing.md#负载均衡) (rr, random, consistent hashing)
# How to Build
* Read [getting started](docs/cn/getting_started.md) for building steps.
# Try it!
* Read [overview](docs/en/overview.md) to know where brpc can be used and its advantages.
* Read [getting started](docs/cn/getting_started.md) for building steps and play with [examples](https://github.com/brpc/brpc/tree/master/example/).
* Play with [examples](https://github.com/brpc/brpc/tree/master/example/).
* Docs:
* [Performance benchmark](docs/cn/benchmark.md)
* [bvar](docs/en/bvar.md)
......
......@@ -138,7 +138,12 @@ find_dir_of_header_or_die() {
# Inconvenient to check these headers in baidu-internal
#PTHREAD_HDR=$(find_dir_of_header_or_die pthread.h)
OPENSSL_HDR=$(find_dir_of_header_or_die openssl/ssl.h)
if [ "$SYSTEM" = "Darwin" ]; then
OPENSSL_HDR="/usr/local/Cellar/openssl\@1.1/1.1.1b/include"
OPENSSL_LIB="/usr/local/Cellar/openssl\@1.1/1.1.1b/lib"
else
OPENSSL_HDR=$(find_dir_of_header_or_die openssl/ssl.h)
fi
if [ $WITH_MESALINK != 0 ]; then
MESALINK_HDR=$(find_dir_of_header_or_die mesalink/openssl/ssl.h)
......@@ -233,7 +238,7 @@ PROTOBUF_HDR=$(find_dir_of_header_or_die google/protobuf/message.h)
LEVELDB_HDR=$(find_dir_of_header_or_die leveldb/db.h)
HDRS=$($ECHO "$GFLAGS_HDR\n$PROTOBUF_HDR\n$LEVELDB_HDR\n$OPENSSL_HDR" | sort | uniq)
LIBS=$($ECHO "$GFLAGS_LIB\n$PROTOBUF_LIB\n$LEVELDB_LIB\n$SNAPPY_LIB" | sort | uniq)
LIBS=$($ECHO "$GFLAGS_LIB\n$PROTOBUF_LIB\n$LEVELDB_LIB\n$OPENSSL_LIB\n$SNAPPY_LIB" | sort | uniq)
absent_in_the_list() {
TMP=`$ECHO "$1\n$2" | sort | uniq`
......
......@@ -40,7 +40,7 @@ sudo apt-get install libgoogle-perftools-dev
If you need to run tests, install and compile libgtest-dev (which is not compiled yet):
```shell
sudo apt-get install libgtest-dev && cd /usr/src/gtest && sudo cmake . && sudo make && sudo mv libgtest* /usr/lib/ && cd -
sudo apt-get install libgtest-dev && cd /usr/src/gtest && sudo cmake . && sudo make && sudo mv lib/libgtest* /usr/lib/ && cd -
```
The directory of gtest source code may be changed, try `/usr/src/googletest/googletest` if `/usr/src/gtest` is not there.
......@@ -261,12 +261,18 @@ Note: In the same running environment, the performance of the current Mac versio
Install common deps:
```shell
brew install openssl git gnu-getopt coreutils
brew install openssl@1.1 git gnu-getopt coreutils
```
Install [gflags](https://github.com/gflags/gflags), [protobuf](https://github.com/google/protobuf), [leveldb](https://github.com/google/leveldb):
Install [gflags](https://github.com/gflags/gflags), [leveldb](https://github.com/google/leveldb):
```shell
brew install gflags leveldb
```
Install [protobuf](https://github.com/google/protobuf):
```shell
brew install gflags protobuf leveldb
brew install protobuf@3.1
brew link --force --overwrite protobuf@3.1
```
If you need to enable cpu/heap profilers in examples:
......@@ -276,7 +282,7 @@ brew install gperftools
If you need to run tests, install and compile googletest (which is not compiled yet):
```shell
git clone https://github.com/google/googletest && cd googletest/googletest && mkdir bld && cd bld && cmake -DCMAKE_CXX_FLAGS="-std=c++11" .. && make && sudo mv libgtest* /usr/lib/ && cd -
git clone https://github.com/google/googletest && cd googletest/googletest && mkdir bld && cd bld && cmake -DCMAKE_CXX_FLAGS="-std=c++11" .. && make && sudo mv lib/libgtest* /usr/lib/ && cd -
```
### Compile brpc with config_brpc.sh
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment