-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinstall_gflags.sh
executable file
·28 lines (23 loc) · 1.09 KB
/
install_gflags.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/bash
############################################
# #
# This script builds gflags #
# #
############################################
if [ "X$app_dir" == "X" ]; then
. $(dirname $0)/utils.sh $@
fi
if [ "X$GFLAGS_VERSION" == "X" ]; then
GFLAGS_VERSION=2.2.2
fi
if [ "X${GFLAGS_HOME}" != "X" ]; then return; fi
export GFLAGS_HOME=$app_dir/gflags-${GFLAGS_VERSION}
cd $src_dir
[ -e gflags-${GFLAGS_VERSION}.tar.gz ] || wget "https://github.com/gflags/gflags/archive/v${GFLAGS_VERSION}.tar.gz" -O gflags-${GFLAGS_VERSION}.tar.gz || exit 1
[ -e gflags-${GFLAGS_VERSION} ] || tar -zxf gflags-${GFLAGS_VERSION}.tar.gz || exit 1
cd gflags-${GFLAGS_VERSION}
mkdir -p build && cd build || exit 1
cmake .. -DCMAKE_INSTALL_PREFIX=${GFLAGS_HOME} -DBUILD_SHARED_LIBS=ON && make -j $make_threads install || exit 1
echo export GFLAGS_HOME=$GFLAGS_HOME >> $bashrc
echo "export CMAKE_PREFIX_PATH=$GFLAGS_HOME:\$CMAKE_PREFIX_PATH" >> $bashrc
echo "export LD_LIBRARY_PATH=$GFLAGS_HOME/lib:\$LD_LIBRARY_PATH" >> $bashrc