[Fix #1099] Build RocksDB 3.10.2 on linux

This commit is contained in:
Mike Arpaia 2015-05-04 21:12:16 -07:00
parent eb9da578f2
commit dfe62540ce

View File

@ -57,27 +57,27 @@ function install_thrift() {
function install_rocksdb() {
if [[ ! -f /usr/local/lib/librocksdb.a ]]; then
if [[ ! -f rocksdb-3.5.tar.gz ]]; then
wget https://osquery-packages.s3.amazonaws.com/deps/rocksdb-3.5.tar.gz
if [[ ! -f rocksdb-3.10.2.tar.gz ]]; then
wget https://github.com/facebook/rocksdb/archive/rocksdb-3.10.2.tar.gz
else
log "rocksdb source is already downloaded. skipping."
fi
if [[ ! -d rocksdb-rocksdb-3.5 ]]; then
tar -xf rocksdb-3.5.tar.gz
if [[ ! -d rocksdb-rocksdb-3.10.2 ]]; then
tar -xf rocksdb-3.10.2.tar.gz
fi
if [[ ! -f rocksdb-rocksdb-3.5/librocksdb.a ]]; then
if [[ ! -f rocksdb-rocksdb-3.10.2/librocksdb.a ]]; then
if [[ $OS = "ubuntu" ]]; then
CLANG_INCLUDE="-I/usr/include/clang/3.4/include"
elif [ $OS = "centos" ] || [ $OS = "rhel" ]; then
CLANG_VERSION=`clang --version | grep version | cut -d" " -f3`
CLANG_INCLUDE="-I/usr/lib/clang/$CLANG_VERSION/include"
fi
pushd rocksdb-rocksdb-3.5
pushd rocksdb-rocksdb-3.10.2
make static_lib CFLAGS="$CLANG_INCLUDE $CFLAGS"
popd
fi
sudo cp rocksdb-rocksdb-3.5/librocksdb.a /usr/local/lib
sudo cp -R rocksdb-rocksdb-3.5/include/rocksdb /usr/local/include
sudo cp rocksdb-rocksdb-3.10.2/librocksdb.a /usr/local/lib
sudo cp -R rocksdb-rocksdb-3.10.2/include/rocksdb /usr/local/include
else
log "rocksdb already installed. skipping."
fi