From d8eab1572c24453d95f14be7863035519b8452d3 Mon Sep 17 00:00:00 2001 From: siddontang Date: Wed, 14 May 2014 09:20:45 +0800 Subject: [PATCH] update leveled build shell --- build_leveldb.sh | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/build_leveldb.sh b/build_leveldb.sh index a361be9..73fbf2a 100644 --- a/build_leveldb.sh +++ b/build_leveldb.sh @@ -3,20 +3,27 @@ SNAPPY_DIR=/usr/local/snappy LEVELDB_DIR=/usr/local/leveldb -mkdir -p ./build +ROOT_DIR=$(pwd) -cd ./build +BUILD_DIR=/tmp/build_leveldb + +mkdir -p $BUILD_DIR + +cd $BUILD_DIR if [ ! -f $SNAPPY_DIR/lib/libsnappy.a ]; then (git clone git@github.com:siddontang/snappy.git && \ cd ./snappy && \ ./configure --prefix=$SNAPPY_DIR && \ make && \ - make install) + make install && \ + cd ..) else echo "skip install snappy" fi +cd $BUILD_DIR + if [ ! -f $LEVELDB_DIR/lib/libleveldb.a ]; then (git clone git@github.com:siddontang/leveldb.git && \ cd ./leveldb && \ @@ -28,7 +35,10 @@ if [ ! -f $LEVELDB_DIR/lib/libleveldb.a ]; then mkdir -p $LEVELDB_DIR/include/leveldb && \ install include/leveldb/*.h $LEVELDB_DIR/include/leveldb && \ mkdir -p $LEVELDB_DIR/lib && \ - cp -f libleveldb.* $LEVELDB_DIR/lib) + cp -f libleveldb.* $LEVELDB_DIR/lib &&\ + cd ..) else echo "skip install leveldb" -fi \ No newline at end of file +fi + +cd $ROOT_DIR \ No newline at end of file