mirror of https://github.com/siddontang/go.git
update leveled build shell
This commit is contained in:
parent
3dfdf380f2
commit
54e6055f8c
|
@ -5,20 +5,27 @@
|
||||||
SNAPPY_DIR=/usr/local/snappy
|
SNAPPY_DIR=/usr/local/snappy
|
||||||
LEVELDB_DIR=/usr/local/leveldb
|
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
|
if [ ! -f $SNAPPY_DIR/lib/libsnappy.a ]; then
|
||||||
(git clone git@github.com:siddontang/snappy.git && \
|
(git clone git@github.com:siddontang/snappy.git && \
|
||||||
cd ./snappy && \
|
cd ./snappy && \
|
||||||
./configure --prefix=$SNAPPY_DIR && \
|
./configure --prefix=$SNAPPY_DIR && \
|
||||||
make && \
|
make && \
|
||||||
make install)
|
make install && \
|
||||||
|
cd ..)
|
||||||
else
|
else
|
||||||
echo "skip install snappy"
|
echo "skip install snappy"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
cd $BUILD_DIR
|
||||||
|
|
||||||
if [ ! -f $LEVELDB_DIR/lib/libleveldb.a ]; then
|
if [ ! -f $LEVELDB_DIR/lib/libleveldb.a ]; then
|
||||||
(git clone git@github.com:siddontang/leveldb.git && \
|
(git clone git@github.com:siddontang/leveldb.git && \
|
||||||
cd ./leveldb && \
|
cd ./leveldb && \
|
||||||
|
@ -30,11 +37,14 @@ if [ ! -f $LEVELDB_DIR/lib/libleveldb.a ]; then
|
||||||
mkdir -p $LEVELDB_DIR/include/leveldb && \
|
mkdir -p $LEVELDB_DIR/include/leveldb && \
|
||||||
install include/leveldb/*.h $LEVELDB_DIR/include/leveldb && \
|
install include/leveldb/*.h $LEVELDB_DIR/include/leveldb && \
|
||||||
mkdir -p $LEVELDB_DIR/lib && \
|
mkdir -p $LEVELDB_DIR/lib && \
|
||||||
cp -f libleveldb.* $LEVELDB_DIR/lib)
|
cp -f libleveldb.* $LEVELDB_DIR/lib &&\
|
||||||
|
cd ..)
|
||||||
else
|
else
|
||||||
echo "skip install leveldb"
|
echo "skip install leveldb"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
cd $ROOT_DIR
|
||||||
|
|
||||||
export CGO_CFLAGS="-I$LEVELDB_DIR/include -I$SNAPPY_DIR/include"
|
export CGO_CFLAGS="-I$LEVELDB_DIR/include -I$SNAPPY_DIR/include"
|
||||||
export CGO_CXXFLAGS="-I$LEVELDB_DIR/include -I$SNAPPY_DIR/include"
|
export CGO_CXXFLAGS="-I$LEVELDB_DIR/include -I$SNAPPY_DIR/include"
|
||||||
export CGO_LDFLAGS="-L$LEVELDB_DIR/lib -L$SNAPPY_DIR/lib -lsnappy"
|
export CGO_LDFLAGS="-L$LEVELDB_DIR/lib -L$SNAPPY_DIR/lib -lsnappy"
|
||||||
|
|
Loading…
Reference in New Issue