From 6257837d83e5ef5f7fe59d992c3218360e24a0e6 Mon Sep 17 00:00:00 2001 From: Siying Dong Date: Tue, 11 Apr 2017 16:51:15 -0700 Subject: [PATCH] Add ROCKSDB_JAVA_NO_COMPRESSION flag Summary: In some CI test environment, compression libraries can't be successfully built. It still helps to build RocksDB there. Provide such an option to skip to download and build compression libraries. Closes https://github.com/facebook/rocksdb/pull/2135 Differential Revision: D4872617 Pulled By: siying fbshipit-source-id: bb21ac373bc62a2528cdf1ca4547e05fcae86214 --- Makefile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 80bfdedd6..f4615bec2 100644 --- a/Makefile +++ b/Makefile @@ -1482,10 +1482,14 @@ liblz4.a: java_static_libobjects = $(patsubst %,jls/%,$(LIBOBJECTS)) CLEAN_FILES += jls +ifneq ($(ROCKSDB_JAVA_NO_COMPRESSION), 1) +JAVA_COMPRESSIONS = libz.a libbz2.a libsnappy.a liblz4.a +endif + JAVA_STATIC_FLAGS = -DZLIB -DBZIP2 -DSNAPPY -DLZ4 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 libbz2.a libsnappy.a liblz4.a +$(java_static_libobjects): jls/%.o: %.cc $(JAVA_COMPRESSIONS) $(AM_V_CC)mkdir -p $(@D) && $(CXX) $(CXXFLAGS) $(JAVA_STATIC_FLAGS) $(JAVA_STATIC_INCLUDES) -fPIC -c $< -o $@ $(COVERAGEFLAGS) rocksdbjavastatic: $(java_static_libobjects) @@ -1494,7 +1498,7 @@ rocksdbjavastatic: $(java_static_libobjects) $(CXX) $(CXXFLAGS) -I./java/. $(JAVA_INCLUDE) -shared -fPIC \ -o ./java/target/$(ROCKSDBJNILIB) $(JNI_NATIVE_SOURCES) \ $(java_static_libobjects) $(COVERAGEFLAGS) \ - libz.a libbz2.a libsnappy.a liblz4.a $(JAVA_STATIC_LDFLAGS) + $(JAVA_COMPRESSIONS) $(JAVA_STATIC_LDFLAGS) cd java/target;strip -S -x $(ROCKSDBJNILIB) cd java;jar -cf target/$(ROCKSDB_JAR) HISTORY*.md cd java/target;jar -uf $(ROCKSDB_JAR) $(ROCKSDBJNILIB)