#!/bin/sh
ROCKSDB_DIR=c_src/rocksdb
ROCKSDB_TAG=v5.6.1

if [ ! -d ${ROCKSDB_DIR} ]; then
    # Control will enter here if rocksdb doesn't exist.
    (cd c_src && git clone https://github.com/pundunlabs/rocksdb.git && cd rocksdb && git checkout tags/$ROCKSDB_TAG -b $ROCKSDB_TAG)
fi
export INSTALL_PATH="."
export CXXFLAGS=-fPIC

# building libraries under rocksdb checks sha256 checksum using openssl
# set working opnessl first in path
if [ -z "$(echo "test text" | openssl sha256 2>/dev/null)" ]; then
    for p in ${PATH//:/ }; do
	if [ -e $p/openssl ]; then
	    if [ ! -z "$(echo "test text" | $p/openssl sha256 2>/dev/null)" ]; then
		export PATH=$p:$PATH;
	    fi
	fi
    done
fi

(cd ${ROCKSDB_DIR} && \
    make -j 4 libzstd.a libsnappy.a libbz2.a libz.a liblz4.a static_lib)

#!/bin/sh
ROCKSDB_DIR=c_src/rocksdb
ROCKSDB_TAG=v5.6.1

if [ ! -d ${ROCKSDB_DIR} ]; then
    # Control will enter here if rocksdb doesn't exist.
    (cd c_src && git clone https://github.com/pundunlabs/rocksdb.git && cd rocksdb && git checkout tags/$ROCKSDB_TAG -b $ROCKSDB_TAG)
fi
export INSTALL_PATH="."
export CXXFLAGS=-fPIC

# building libraries under rocksdb checks sha256 checksum using openssl
# set working opnessl first in path
if [ -z "$(echo "test text" | openssl sha256 2>/dev/null)" ]; then
    for p in ${PATH//:/ }; do
	if [ -e $p/openssl ]; then
	    if [ ! -z "$(echo "test text" | $p/openssl sha256 2>/dev/null)" ]; then
		export PATH=$p:$PATH;
	    fi
	fi
    done
fi

(cd ${ROCKSDB_DIR} && \
    make -j 4 libzstd.a && \
    make -j 4 libsnappy.a && \
    make -j 4 libbz2.a && \
    make -j 4 libz.a && \
    make -j 4 liblz4.a && \
    make -j 4 static_lib)

Revert "Build all rocksdb targets in one go"
Revert "Build all rocksdb targets in one go"

This reverts commit dff3fe6c544daa047e65dc9738c519b8d6ff2c20.
For this to work we need to change rockdsb's Makefile to set DEBUG_LEVEL=0.
Reverting for now.
