3434# Home page of jsoncpp: http://sourceforge.net/projects/libjson/files/?source=navbar
3535#
3636
37- GFLAGS_URL=https://github.com/gflags/gflags/archive/v2.1 .2.tar.gz
38- GLOG_URL=https://github.com/google/glog/archive/v0.3.4 .tar.gz
39- JSONCPP_URL=https://github.com/open-source-parsers/jsoncpp/archive/refs/tags/1.7.4 .tar.gz
37+ GFLAGS_URL=https://github.com/gflags/gflags/archive/v2.2 .2.tar.gz
38+ GLOG_URL=https://github.com/google/glog/archive/v0.4.0 .tar.gz
39+ JSONCPP_URL=https://github.com/open-source-parsers/jsoncpp/archive/refs/tags/1.7.6 .tar.gz
4040
4141
4242ROOT=$( cd $( dirname " ${BASH_SOURCE[0]} " ) > /dev/null; /bin/pwd -P)
@@ -45,56 +45,59 @@ ROOT=$(cd $(dirname "${BASH_SOURCE[0]}") >/dev/null; /bin/pwd -P)
4545PARALLEL_BUILD_OPTION=" -j $(( $(nproc 2 > / dev/ null || echo 4 )* 3 / 2 )) "
4646
4747# Clean up any previous build files.
48- rm -rf ${ROOT} /third_party/gflags* \
49- ${ROOT} /third_party/glog* \
50- ${ROOT} /third_party/* jsoncpp* \
51- ${ROOT} /third_party/install
48+ rm -rf " ${ROOT} " /third_party/gflags* \
49+ " ${ROOT} " /third_party/glog* \
50+ " ${ROOT} " /third_party/* jsoncpp* \
51+ " ${ROOT} " /third_party/install
5252
5353# Build and install gflags to third_party/.
54- pushd ${ROOT} /third_party
55- curl -Lk ${GFLAGS_URL} -o gflags.tar.gz
54+ pushd " ${ROOT} " /third_party
55+ curl -Lk " ${GFLAGS_URL} " -o gflags.tar.gz
5656tar xzf gflags.tar.gz
5757cd gflags-*
5858mkdir build
5959cd build
6060cmake -DCMAKE_CXX_FLAGS=-fpic \
6161 -DGFLAGS_NAMESPACE=google \
62- -DCMAKE_INSTALL_PREFIX:PATH=${ROOT} /third_party/install \
62+ -DCMAKE_INSTALL_PREFIX:PATH=" ${ROOT} " /third_party/install \
6363 ..
6464make ${PARALLEL_BUILD_OPTION}
6565make install
6666popd
6767
6868# Build and install glog to third_party/.
69- pushd ${ROOT} /third_party
70- curl -L ${GLOG_URL} -o glog.tar.gz
69+ pushd " ${ROOT} " /third_party
70+ curl -L " ${GLOG_URL} " -o glog.tar.gz
7171tar xzf glog.tar.gz
7272cd glog-*
73- ./configure --with-pic \
74- --prefix=${ROOT} /third_party/install \
75- --with-gflags=${ROOT} /third_party/install
73+ mkdir build
74+ cd build
75+ cmake -DCMAKE_CXX_FLAGS=-fpic \
76+ -DCMAKE_PREFIX_PATH=" ${ROOT} " /third_party/install \
77+ -DCMAKE_INSTALL_PREFIX:PATH=" ${ROOT} " /third_party/install \
78+ ..
7679make ${PARALLEL_BUILD_OPTION}
7780make install
7881popd
7982
8083# Build and install jsoncpp to third_party/.
81- pushd ${ROOT} /third_party
84+ pushd " ${ROOT} " /third_party
8285curl -L ${JSONCPP_URL} -o jsoncpp.tar.gz
8386tar xzf jsoncpp.tar.gz
8487cd * jsoncpp-*
8588mkdir build
8689cd build
8790cmake -DCMAKE_CXX_FLAGS=-fpic \
88- -DCMAKE_INSTALL_PREFIX:PATH=${ROOT} /third_party/install \
91+ -DCMAKE_INSTALL_PREFIX:PATH=" ${ROOT} " /third_party/install \
8992 ..
9093make ${PARALLEL_BUILD_OPTION}
9194make install
9295popd
9396
9497# Build the debugger agent.
95- pushd ${ROOT} /src/agent
98+ pushd " ${ROOT} " /src/agent
9699make ${PARALLEL_BUILD_OPTION} \
97- BUILD_TARGET_PATH=${ROOT} \
98- THIRD_PARTY_LIB_PATH=${ROOT} /third_party/install/lib \
99- THIRD_PARTY_INCLUDE_PATH=${ROOT} /third_party/install/include
100+ BUILD_TARGET_PATH=" ${ROOT} " \
101+ THIRD_PARTY_LIB_PATH=" ${ROOT} " /third_party/install/lib \
102+ THIRD_PARTY_INCLUDE_PATH=" ${ROOT} " /third_party/install/include
100103popd
0 commit comments