From: Jakub Jirutka Date: Wed, 6 Apr 2016 00:52:00 +0200 Subject: [PATCH] Unbundle snappy Use system-provided snappy library instead of downloading and building snappy from the upstream. --- a/Makefile +++ b/Makefile @@ -8,7 +8,7 @@ SNAPPY_OUT:=$(TARGET)/snappy-$(SNAPPY_VERSION)-$(os_arch) SNAPPY_ARCHIVE:=$(TARGET)/snappy-$(SNAPPY_VERSION).tar.gz -SNAPPY_CC:=snappy-sinksource.cc snappy-stubs-internal.cc snappy.cc +SNAPPY_CC:= SNAPPY_SRC_DIR:=$(TARGET)/snappy-$(SNAPPY_VERSION) SNAPPY_SRC:=$(addprefix $(SNAPPY_SRC_DIR)/,$(SNAPPY_CC)) SNAPPY_GIT_REPO_URL:=https://github.com/google/snappy @@ -84,9 +84,9 @@ cd $(SNAPPY_OUT) && cmake $(SNAPPY_CMAKE_OPTS) ../../$(SNAPPY_SRC_DIR) touch $@ -jni-header: $(SNAPPY_GIT_UNPACKED) $(BITSHUFFLE_UNPACKED) $(SRC)/org/xerial/snappy/SnappyNative.h $(SRC)/org/xerial/snappy/BitShuffleNative.h +jni-header: $(BITSHUFFLE_UNPACKED) $(SRC)/org/xerial/snappy/SnappyNative.h $(SRC)/org/xerial/snappy/BitShuffleNative.h -snappy-header: $(SNAPPY_CMAKE_CACHE) +snappy-header: $(TARGET)/jni-classes/org/xerial/snappy/SnappyNative.class: $(SRC)/org/xerial/snappy/SnappyNative.java @mkdir -p $(TARGET)/jni-classes @@ -102,7 +102,7 @@ $(SRC)/org/xerial/snappy/BitShuffleNative.h: $(TARGET)/jni-classes/org/xerial/snappy/BitShuffleNative.class $(JAVAH) -force -classpath $(TARGET)/jni-classes -o $@ org.xerial.snappy.BitShuffleNative -$(SNAPPY_SRC): $(SNAPPY_GIT_UNPACKED) +$(SNAPPY_SRC): # aarch64 can use big-endian optimzied code ifeq ($(OS_ARCH),aarch64) @@ -122,7 +122,7 @@ $(CXX) $(CXXFLAGS) -c $< -o $@ $(SNAPPY_OUT)/$(LIBNAME): $(SNAPPY_OBJ) - $(CXX) $(CXXFLAGS) -o $@ $+ $(LINKFLAGS) + $(CXX) $(CXXFLAGS) -o $@ $+ $(LINKFLAGS) -lsnappy # Workaround for strip Protocol error when using VirtualBox on Mac cp $@ /tmp/$(@F) $(STRIP) /tmp/$(@F) @@ -142,7 +142,7 @@ native: jni-header snappy-header $(NATIVE_DLL) native-nocmake: jni-header $(NATIVE_DLL) -snappy: native $(TARGET)/$(snappy-jar-version).jar +snappy: native native-all: win32 win64 mac64 native-arm linux32 linux64 linux-ppc64le linux-aarch64 @@ -151,6 +151,7 @@ cp $(SNAPPY_OUT)/$(LIBNAME) $@ @mkdir -p $(NATIVE_TARGET_DIR) cp $(SNAPPY_OUT)/$(LIBNAME) $(NATIVE_TARGET_DIR)/$(LIBNAME) + cp $(SNAPPY_OUT)/$(LIBNAME) $(TARGET)/ package: $(TARGET)/$(snappy-jar-version).jar