1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
From: Jakub Jirutka <jakub@jirutka.cz>
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
|