@ -1370,10 +1370,21 @@ ROCKSDB_JAR = rocksdbjni-$(ROCKSDB_MAJOR).$(ROCKSDB_MINOR).$(ROCKSDB_PATCH)-linu
ROCKSDB_JAR_ALL = rocksdbjni-$( ROCKSDB_MAJOR) .$( ROCKSDB_MINOR) .$( ROCKSDB_PATCH) .jar
ROCKSDB_JAR_ALL = rocksdbjni-$( ROCKSDB_MAJOR) .$( ROCKSDB_MINOR) .$( ROCKSDB_PATCH) .jar
ROCKSDB_JAVADOCS_JAR = rocksdbjni-$( ROCKSDB_MAJOR) .$( ROCKSDB_MINOR) .$( ROCKSDB_PATCH) -javadoc.jar
ROCKSDB_JAVADOCS_JAR = rocksdbjni-$( ROCKSDB_MAJOR) .$( ROCKSDB_MINOR) .$( ROCKSDB_PATCH) -javadoc.jar
ROCKSDB_SOURCES_JAR = rocksdbjni-$( ROCKSDB_MAJOR) .$( ROCKSDB_MINOR) .$( ROCKSDB_PATCH) -sources.jar
ROCKSDB_SOURCES_JAR = rocksdbjni-$( ROCKSDB_MAJOR) .$( ROCKSDB_MINOR) .$( ROCKSDB_PATCH) -sources.jar
SHA256_CMD = sha256sum
ZLIB_VER = 1.2.11
ZLIB_SHA256 = c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1
BZIP2_VER = 1.0.6
BZIP2_SHA256 = a2848f34fcd5d6cf47def00461fcb528a0484d8edef8208d6d2e2909dc61d9cd
SNAPPY_VER = 1.1.4
SNAPPY_SHA256 = 134bfe122fd25599bb807bb8130e7ba6d9bdb851e0b16efcb83ac4f5d0b70057
LZ4_VER = 1.7.5
LZ4_SHA256 = 0190cacd63022ccb86f44fa5041dc6c3804407ad61550ca21c382827319e7e7e
i f e q ( $( PLATFORM ) , O S _ M A C O S X )
i f e q ( $( PLATFORM ) , O S _ M A C O S X )
ROCKSDBJNILIB = librocksdbjni-osx.jnilib
ROCKSDBJNILIB = librocksdbjni-osx.jnilib
ROCKSDB_JAR = rocksdbjni-$( ROCKSDB_MAJOR) .$( ROCKSDB_MINOR) .$( ROCKSDB_PATCH) -osx.jar
ROCKSDB_JAR = rocksdbjni-$( ROCKSDB_MAJOR) .$( ROCKSDB_MINOR) .$( ROCKSDB_PATCH) -osx.jar
SHA256_CMD = openssl sha256 -r
i f n e q ( "$(wildcard $(JAVA_HOME)/include/darwin)" , "" )
i f n e q ( "$(wildcard $(JAVA_HOME)/include/darwin)" , "" )
JAVA_INCLUDE = -I$( JAVA_HOME) /include -I $( JAVA_HOME) /include/darwin
JAVA_INCLUDE = -I$( JAVA_HOME) /include -I $( JAVA_HOME) /include/darwin
e l s e
e l s e
@ -1389,44 +1400,65 @@ ifeq ($(PLATFORM), OS_SOLARIS)
ROCKSDBJNILIB = librocksdbjni-solaris$( ARCH) .so
ROCKSDBJNILIB = librocksdbjni-solaris$( ARCH) .so
ROCKSDB_JAR = rocksdbjni-$( ROCKSDB_MAJOR) .$( ROCKSDB_MINOR) .$( ROCKSDB_PATCH) -solaris$( ARCH) .jar
ROCKSDB_JAR = rocksdbjni-$( ROCKSDB_MAJOR) .$( ROCKSDB_MINOR) .$( ROCKSDB_PATCH) -solaris$( ARCH) .jar
JAVA_INCLUDE = -I$( JAVA_HOME) /include/ -I$( JAVA_HOME) /include/solaris
JAVA_INCLUDE = -I$( JAVA_HOME) /include/ -I$( JAVA_HOME) /include/solaris
SHA256_CMD = digest -a sha256
e n d i f
e n d i f
libz.a :
libz.a :
-rm -rf zlib-1.2.10
-rm -rf zlib-$( ZLIB_VER)
curl -O -L http://zlib.net/zlib-1.2.10.tar.gz
curl -O -L http://zlib.net/zlib-$( ZLIB_VER) .tar.gz
tar xvzf zlib-1.2.10.tar.gz
ZLIB_SHA256_ACTUAL = ` $( SHA256_CMD) zlib-$( ZLIB_VER) .tar.gz | cut -d ' ' -f 1` ; \
cd zlib-1.2.10 && CFLAGS = '-fPIC' ./configure --static && make
if [ " $( ZLIB_SHA256) " != " $$ ZLIB_SHA256_ACTUAL " ] ; then \
cp zlib-1.2.10/libz.a .
echo zlib-$( ZLIB_VER) .tar.gz checksum mismatch, expected = \" $( ZLIB_SHA256) \" actual = \" $$ ZLIB_SHA256_ACTUAL\" ; \
exit 1; \
fi
tar xvzf zlib-$( ZLIB_VER) .tar.gz
cd zlib-$( ZLIB_VER) && CFLAGS = '-fPIC' ./configure --static && make
cp zlib-$( ZLIB_VER) /libz.a .
libbz2.a :
libbz2.a :
-rm -rf bzip2-1.0.6
-rm -rf bzip2-$( BZIP2_VER)
curl -O -L http://www.bzip.org/1.0.6/bzip2-1.0.6.tar.gz
curl -O -L http://www.bzip.org/$( BZIP2_VER) /bzip2-$( BZIP2_VER) .tar.gz
tar xvzf bzip2-1.0.6.tar.gz
BZIP2_SHA256_ACTUAL = ` $( SHA256_CMD) bzip2-$( BZIP2_VER) .tar.gz | cut -d ' ' -f 1` ; \
cd bzip2-1.0.6 && make CFLAGS = '-fPIC -O2 -g -D_FILE_OFFSET_BITS=64'
if [ " $( BZIP2_SHA256) " != " $$ BZIP2_SHA256_ACTUAL " ] ; then \
cp bzip2-1.0.6/libbz2.a .
echo bzip2-$( BZIP2_VER) .tar.gz checksum mismatch, expected = \" $( BZIP2_SHA256) \" actual = \" $$ BZIP2_SHA256_ACTUAL\" ; \
exit 1; \
fi
tar xvzf bzip2-$( BZIP2_VER) .tar.gz
cd bzip2-$( BZIP2_VER) && make CFLAGS = '-fPIC -O2 -g -D_FILE_OFFSET_BITS=64'
cp bzip2-$( BZIP2_VER) /libbz2.a .
libsnappy.a :
libsnappy.a :
-rm -rf snappy-1.1.3
-rm -rf snappy-$( SNAPPY_VER)
curl -O -L https://github.com/google/snappy/releases/download/1.1.3/snappy-1.1.3.tar.gz
curl -O -L https://github.com/google/snappy/releases/download/$( SNAPPY_VER) /snappy-$( SNAPPY_VER) .tar.gz
tar xvzf snappy-1.1.3.tar.gz
SNAPPY_SHA256_ACTUAL = ` $( SHA256_CMD) snappy-$( SNAPPY_VER) .tar.gz | cut -d ' ' -f 1` ; \
cd snappy-1.1.3 && ./configure --with-pic --enable-static
if [ " $( SNAPPY_SHA256) " != " $$ SNAPPY_SHA256_ACTUAL " ] ; then \
cd snappy-1.1.3 && make
echo snappy-$( SNAPPY_VER) .tar.gz checksum mismatch, expected = \" $( SNAPPY_SHA256) \" actual = \" $$ SNAPPY_SHA256_ACTUAL\" ; \
cp snappy-1.1.3/.libs/libsnappy.a .
exit 1; \
fi
tar xvzf snappy-$( SNAPPY_VER) .tar.gz
cd snappy-$( SNAPPY_VER) && ./configure --with-pic --enable-static
cd snappy-$( SNAPPY_VER) && make
cp snappy-$( SNAPPY_VER) /.libs/libsnappy.a .
liblz4.a :
liblz4.a :
-rm -rf lz4-r127
-rm -rf lz4-$( LZ4_VER)
curl -O -L https://codeload.github.com/Cyan4973/lz4/tar.gz/r127
curl -O -L https://github.com/lz4/lz4/archive/v$( LZ4_VER) .tar.gz
mv r127 lz4-r127.tar.gz
mv v$( LZ4_VER) .tar.gz lz4-$( LZ4_VER) .tar.gz
tar xvzf lz4-r127.tar.gz
LZ4_SHA256_ACTUAL = ` $( SHA256_CMD) lz4-$( LZ4_VER) .tar.gz | cut -d ' ' -f 1` ; \
cd lz4-r127/lib && make CFLAGS = '-fPIC' all
if [ " $( LZ4_SHA256) " != " $$ LZ4_SHA256_ACTUAL " ] ; then \
cp lz4-r127/lib/liblz4.a .
echo lz4-$( LZ4_VER) .tar.gz checksum mismatch, expected = \" $( LZ4_SHA256) \" actual = \" $$ LZ4_SHA256_ACTUAL\" ; \
exit 1; \
fi
tar xvzf lz4-$( LZ4_VER) .tar.gz
cd lz4-$( LZ4_VER) /lib && make CFLAGS = '-fPIC' all
cp lz4-$( LZ4_VER) /lib/liblz4.a .
# A version of each $(LIBOBJECTS) compiled with -fPIC and a fixed set of static compression libraries
# A version of each $(LIBOBJECTS) compiled with -fPIC and a fixed set of static compression libraries
java_static_libobjects = $( patsubst %,jls/%,$( LIBOBJECTS) )
java_static_libobjects = $( patsubst %,jls/%,$( LIBOBJECTS) )
CLEAN_FILES += jls
CLEAN_FILES += jls
JAVA_STATIC_FLAGS = -DZLIB -DBZIP2 -DSNAPPY -DLZ4
JAVA_STATIC_FLAGS = -DZLIB -DBZIP2 -DSNAPPY -DLZ4
JAVA_STATIC_INCLUDES = -I./zlib-1.2.10 -I./bzip2-1.0.6 -I./snappy-1.1.3 -I./lz4-r127 /lib
JAVA_STATIC_INCLUDES = -I./zlib-$( ZLIB_VER) -I./bzip2-$( BZIP2_VER) -I./snappy-$( SNAPPY_VER) -I./lz4-$( LZ4_VER) /lib
$(java_static_libobjects) : jls /%.o : %.cc libz .a libbz 2.a libsnappy .a liblz 4.a
$(java_static_libobjects) : jls /%.o : %.cc libz .a libbz 2.a libsnappy .a liblz 4.a
$( AM_V_CC) mkdir -p $( @D) && $( CXX) $( CXXFLAGS) $( JAVA_STATIC_FLAGS) $( JAVA_STATIC_INCLUDES) -fPIC -c $< -o $@ $( COVERAGEFLAGS)
$( AM_V_CC) mkdir -p $( @D) && $( CXX) $( CXXFLAGS) $( JAVA_STATIC_FLAGS) $( JAVA_STATIC_INCLUDES) -fPIC -c $< -o $@ $( COVERAGEFLAGS)