Skip to content

Commit

Permalink
fix gflags
Browse files Browse the repository at this point in the history
  • Loading branch information
taohexxx committed Jun 3, 2018
1 parent eb3f4f6 commit ec3f562
Showing 1 changed file with 38 additions and 4 deletions.
42 changes: 38 additions & 4 deletions third_party/autoinstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function go_back()
cd $current_path;
}

function check_dir_exist()
function check_dir_exist()
{
dir_path=$current_path"/$1";
if [ ! -d $dir_path ]; then
Expand All @@ -25,7 +25,7 @@ function check_dir_exist()
fi
}

function check_file_exist()
function check_file_exist()
{
if [ ! -f $1 ]; then
return 1;
Expand Down Expand Up @@ -145,7 +145,40 @@ function install_glog()

go_back;
cd $lib_name;
./configure CXXFLAGS=-fPIC --prefix=$(pwd);
./autogen.sh
exist_gflags_dir="../gflags";
if [ -d $exist_gflags_dir ]; then
# use local gflags
./configure CXXFLAGS=-fPIC --prefix=$(pwd) --with-gflags=$(pwd)/gflags;
else
# use system gflags
./configure CXXFLAGS=-fPIC --prefix=$(pwd);
fi
make && make install;

check_lib_exist $lib_name;
if [ $? -eq 1 ]; then
perror "$lib_name install fail. please check compile error info."
exit 1;
fi
psucc "install $lib_name ok."
}

function install_gflags()
{
lib_name="gflags";
check_dir_exist $lib_name;

# check if aready install.
check_lib_exist $lib_name;
if [ $? -eq 0 ]; then
psucc "$lib_name already installed."
return;
fi
# end check.
go_back;
cd $lib_name;
cmake . -DCMAKE_INSTALL_PREFIX=$(pwd);
make && make install;

check_lib_exist $lib_name;
Expand Down Expand Up @@ -257,9 +290,10 @@ function install_phxrpc()
psucc "install $lib_name ok."
}

install_gflags;
install_glog;
install_leveldb;
install_protobuf;
install_glog;
install_colib;
install_phxpaxos;
install_phxrpc;
Expand Down

0 comments on commit ec3f562

Please sign in to comment.