Skip to content
This repository has been archived by the owner on Feb 29, 2024. It is now read-only.

Commit

Permalink
Update gflags, glog and jsoncpp to newer versions.
Browse files Browse the repository at this point in the history
In addition to refreshing the gflags, glog and jsoncpp libraries, update the
agent Makefile to run static_def_gen.py using `python3` instead of `python`.

PiperOrigin-RevId: 461606067
Change-Id: If534897c75c804282913c75d34f6fdead7e373f7
  • Loading branch information
jasonborg authored and copybara-github committed Jul 18, 2022
1 parent 0337874 commit 025e319
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 22 deletions.
45 changes: 24 additions & 21 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@
# Home page of jsoncpp: http://sourceforge.net/projects/libjson/files/?source=navbar
#

GFLAGS_URL=https://github.com/gflags/gflags/archive/v2.1.2.tar.gz
GLOG_URL=https://github.com/google/glog/archive/v0.3.4.tar.gz
JSONCPP_URL=https://github.com/open-source-parsers/jsoncpp/archive/refs/tags/1.7.4.tar.gz
GFLAGS_URL=https://github.com/gflags/gflags/archive/v2.2.2.tar.gz
GLOG_URL=https://github.com/google/glog/archive/v0.4.0.tar.gz
JSONCPP_URL=https://github.com/open-source-parsers/jsoncpp/archive/refs/tags/1.7.6.tar.gz


ROOT=$(cd $(dirname "${BASH_SOURCE[0]}") >/dev/null; /bin/pwd -P)
Expand All @@ -45,56 +45,59 @@ ROOT=$(cd $(dirname "${BASH_SOURCE[0]}") >/dev/null; /bin/pwd -P)
PARALLEL_BUILD_OPTION="-j $(($(nproc 2> /dev/null || echo 4)*3/2))"

# Clean up any previous build files.
rm -rf ${ROOT}/third_party/gflags* \
${ROOT}/third_party/glog* \
${ROOT}/third_party/*jsoncpp* \
${ROOT}/third_party/install
rm -rf "${ROOT}"/third_party/gflags* \
"${ROOT}"/third_party/glog* \
"${ROOT}"/third_party/*jsoncpp* \
"${ROOT}"/third_party/install

# Build and install gflags to third_party/.
pushd ${ROOT}/third_party
curl -Lk ${GFLAGS_URL} -o gflags.tar.gz
pushd "${ROOT}"/third_party
curl -Lk "${GFLAGS_URL}" -o gflags.tar.gz
tar xzf gflags.tar.gz
cd gflags-*
mkdir build
cd build
cmake -DCMAKE_CXX_FLAGS=-fpic \
-DGFLAGS_NAMESPACE=google \
-DCMAKE_INSTALL_PREFIX:PATH=${ROOT}/third_party/install \
-DCMAKE_INSTALL_PREFIX:PATH="${ROOT}"/third_party/install \
..
make ${PARALLEL_BUILD_OPTION}
make install
popd

# Build and install glog to third_party/.
pushd ${ROOT}/third_party
curl -L ${GLOG_URL} -o glog.tar.gz
pushd "${ROOT}"/third_party
curl -L "${GLOG_URL}" -o glog.tar.gz
tar xzf glog.tar.gz
cd glog-*
./configure --with-pic \
--prefix=${ROOT}/third_party/install \
--with-gflags=${ROOT}/third_party/install
mkdir build
cd build
cmake -DCMAKE_CXX_FLAGS=-fpic \
-DCMAKE_PREFIX_PATH="${ROOT}"/third_party/install \
-DCMAKE_INSTALL_PREFIX:PATH="${ROOT}"/third_party/install \
..
make ${PARALLEL_BUILD_OPTION}
make install
popd

# Build and install jsoncpp to third_party/.
pushd ${ROOT}/third_party
pushd "${ROOT}"/third_party
curl -L ${JSONCPP_URL} -o jsoncpp.tar.gz
tar xzf jsoncpp.tar.gz
cd *jsoncpp-*
mkdir build
cd build
cmake -DCMAKE_CXX_FLAGS=-fpic \
-DCMAKE_INSTALL_PREFIX:PATH=${ROOT}/third_party/install \
-DCMAKE_INSTALL_PREFIX:PATH="${ROOT}"/third_party/install \
..
make ${PARALLEL_BUILD_OPTION}
make install
popd

# Build the debugger agent.
pushd ${ROOT}/src/agent
pushd "${ROOT}"/src/agent
make ${PARALLEL_BUILD_OPTION} \
BUILD_TARGET_PATH=${ROOT} \
THIRD_PARTY_LIB_PATH=${ROOT}/third_party/install/lib \
THIRD_PARTY_INCLUDE_PATH=${ROOT}/third_party/install/include
BUILD_TARGET_PATH="${ROOT}" \
THIRD_PARTY_LIB_PATH="${ROOT}"/third_party/install/lib \
THIRD_PARTY_INCLUDE_PATH="${ROOT}"/third_party/install/include
popd
2 changes: 1 addition & 1 deletion src/agent/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ endif
cp internals-class-loader/target/com/google/devtools/cdbg/debuglets/java/InternalsClassLoader.class $(INTERNALS_CLASS_LOADER)

internals_class_loader_static_defs: internals_class_loader
python ../codegen/static_def_gen.py $(INTERNALS_CLASS_LOADER_STATIC_DEFS) .:^$(INTERNALS_CLASS_LOADER)$
python3 ../codegen/static_def_gen.py $(INTERNALS_CLASS_LOADER_STATIC_DEFS) .:^$(INTERNALS_CLASS_LOADER)$

internals_jar:
ifeq ($(JAVA_BUILD),maven)
Expand Down

0 comments on commit 025e319

Please sign in to comment.