Skip to content

Commit

Permalink
Add drv and nif backends for HyperLevelDB
Browse files Browse the repository at this point in the history
  • Loading branch information
norton committed May 18, 2014
1 parent 75451cc commit cd5f108
Show file tree
Hide file tree
Showing 18 changed files with 4,753 additions and 84 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -3,6 +3,8 @@
.qc/
.rebar/
c_src/*.o
c_src/hyperleveldb-*/
c_src/hyperleveldb/
c_src/leveldb-*/
c_src/leveldb/
c_src/snappy-*/
Expand Down
20 changes: 20 additions & 0 deletions c_src/build_deps.sh
Expand Up @@ -26,6 +26,7 @@ set -eo pipefail

SNAPPY_VSN=HEAD
LEVELDB_VSN=HEAD
HYPERLEVELDB_VSN=HEAD

if [ `basename $PWD` != "c_src" ]; then
pushd c_src > /dev/null 2>&1
Expand All @@ -35,8 +36,10 @@ BASEDIR="$PWD"

case "$1" in
clean)
rm -f *.o ../priv/lib/*.so
rm -rf snappy snappy-$SNAPPY_VSN
rm -rf leveldb leveldb-$LEVELDB_VSN
rm -rf hyperleveldb hyperleveldb-$HYPERLEVELDB_VSN
;;
get_deps)
;;
Expand Down Expand Up @@ -91,5 +94,22 @@ case "$1" in
mkdir -p $BASEDIR/leveldb/lib && \
install libleveldb.a $BASEDIR/leveldb/lib)
fi
# hyperleveldb
if [ ! -f $BASEDIR/hyperleveldb/lib/libhyperleveldb.a ]; then
(cd $REBAR_DEPS_DIR/hyperleveldb && git archive --format=tar --prefix=hyperleveldb-$HYPERLEVELDB_VSN/ $HYPERLEVELDB_VSN) \
| tar xf -
(cd hyperleveldb-$HYPERLEVELDB_VSN && \
autoreconf -i && \
env CPPFLAGS="-fPIC -I$BASEDIR/snappy/include $CPPFLAGS" \
CFLAGS="-fPIC -I$BASEDIR/snappy/include $CFLAGS" \
CXXFLAGS="-fPIC -I$BASEDIR/snappy/include $CXXFLAGS" \
LDFLAGS="-L$BASEDIR/snappy/lib -lsnappy $LDFLAGS" \
./configure --enable-static --enable-snappy && \
make && \
mkdir -p $BASEDIR/hyperleveldb/include/hyperleveldb && \
install hyperleveldb/*.h $BASEDIR/hyperleveldb/include/hyperleveldb && \
mkdir -p $BASEDIR/hyperleveldb/lib && \
install .libs/libhyperleveldb.a $BASEDIR/hyperleveldb/lib)
fi
;;
esac

0 comments on commit cd5f108

Please sign in to comment.