Put the bitshuffle version in resources/.../VERSION

This commit is contained in:
Takeshi YAMAMURO 2016-04-01 09:33:17 +09:00
parent 6a894340fc
commit ba55390f79
7 changed files with 45 additions and 54 deletions

View File

@ -7,31 +7,21 @@ SBT:=./sbt
all: snappy
SNAPPY_OUT:=$(TARGET)/$(snappy)-$(os_arch)
SNAPPY_ARCHIVE:=$(TARGET)/snappy-$(VERSION).tar.gz
SNAPPY_ARCHIVE:=$(TARGET)/snappy-$(SNAPPY_VERSION).tar.gz
SNAPPY_CC:=snappy-sinksource.cc snappy-stubs-internal.cc snappy.cc
SNAPPY_SRC_DIR:=$(TARGET)/snappy-$(VERSION)
SNAPPY_SRC_DIR:=$(TARGET)/snappy-$(SNAPPY_VERSION)
SNAPPY_SRC:=$(addprefix $(SNAPPY_SRC_DIR)/,$(SNAPPY_CC))
SNAPPY_GIT_REPO_URL:=https://github.com/google/snappy
SNAPPY_GIT_REV:=2b9152d9c5bed71dffb7f7f6c7a3ec48b058ff2d # 1.1.3 with autogen.sh fix
SNAPPY_UNPACKED:=$(TARGET)/snappy-extracted.log
SNAPPY_GIT_UNPACKED:=$(TARGET)/snappy-git-extracted.log
BITSHUFFLE_VERSION:=0.2.2
BITSHUFFLE_ARCHIVE:=$(TARGET)/bitshuffle-$(BITSHUFFLE_VERSION).tar.gz
BITSHUFFLE_C:=bitshuffle_core.c iochain.c
BITSHUFFLE_SRC_DIR:=$(TARGET)/bitshuffle-$(BITSHUFFLE_VERSION)/src
BITSHUFFLE_SRC:=$(addprefix $(BITSHUFFLE_SRC_DIR)/,$(BITSHUFFLE_C))
BITSHUFFLE_UNPACKED:=$(TARGET)/bitshuffle-extracted.log
ifdef USE_GIT
ifndef GIT_REPO_URL
$(warning GIT_REPO_URL is not set when using git)
endif
ifndef GIT_SNAPPY_BRANCH
$(warning GIT_SNAPPY_BRANCH is not set when using git)
endif
endif
$(BITSHUFFLE_ARCHIVE):
@mkdir -p $(@D)
curl -L -o$@ https://github.com/kiyo-masui/bitshuffle/archive/$(BITSHUFFLE_VERSION).tar.gz
@ -48,7 +38,7 @@ $(SNAPPY_OUT)/%.o: $(BITSHUFFLE_SRC_DIR)/%.c
SNAPPY_OBJ:=$(addprefix $(SNAPPY_OUT)/,$(patsubst %.cc,%.o,$(SNAPPY_CC)) $(patsubst %.c,%.o,$(BITSHUFFLE_C)) SnappyNative.o BitShuffleNative.o)
ifndef UNIVERSAL_BITSHUFFLE
ifdef UNIVERSAL_BITSHUFFLE
# Undefined macros to generate a platform-independent binary
CXXFLAGS:=$(CXXFLAGS) -U__AVX2__ -U__SSE2__ -I$(SNAPPY_SRC_DIR) -I$(BITSHUFFLE_SRC_DIR)
else
@ -63,7 +53,7 @@ endif
$(SNAPPY_ARCHIVE):
@mkdir -p $(@D)
curl -L -o$@ https://github.com/google/snappy/releases/download/$(VERSION)/snappy-$(VERSION).tar.gz
curl -L -o$@ https://github.com/google/snappy/releases/download/$(SNAPPY_VERSION)/snappy-$(SNAPPY_VERSION).tar.gz
$(SNAPPY_UNPACKED): $(SNAPPY_ARCHIVE)
$(TAR) xvfz $< -C $(TARGET)
@ -184,16 +174,16 @@ install-m2:
googlecode-upload: googlecode-lib-upload googlecode-src-upload
googlecode-lib-upload: $(TARGET)/snappy-java-$(VERSION)-lib.upload
googlecode-src-upload: $(TARGET)/snappy-java-$(VERSION)-src.upload
googlecode-lib-upload: $(TARGET)/snappy-java-$(SNAPPY_VERSION)-lib.upload
googlecode-src-upload: $(TARGET)/snappy-java-$(SNAPPY_VERSION)-src.upload
GOOGLECODE_USER:=leo@xerial.org
$(TARGET)/snappy-java-$(VERSION)-lib.upload:
./googlecode_upload.py -s "library for all platforms" -p snappy-java -l "Type-Executable,Featured,OpSys-All" -u "$(GOOGLECODE_USER)" target/snappy-java-$(VERSION).jar
$(TARGET)/snappy-java-$(SNAPPY_VERSION)-lib.upload:
./googlecode_upload.py -s "library for all platforms" -p snappy-java -l "Type-Executable,Featured,OpSys-All" -u "$(GOOGLECODE_USER)" target/snappy-java-$(SNAPPY_VERSION).jar
touch $@
$(TARGET)/snappy-java-$(VERSION)-src.upload:
./googlecode_upload.py -s "source code archive" -p snappy-java -l "Type-Source,OpSys-All" -u "$(GOOGLECODE_USER)" target/snappy-java-$(VERSION).tar.gz
$(TARGET)/snappy-java-$(SNAPPY_VERSION)-src.upload:
./googlecode_upload.py -s "source code archive" -p snappy-java -l "Type-Source,OpSys-All" -u "$(GOOGLECODE_USER)" target/snappy-java-$(SNAPPY_VERSION).tar.gz
touch $@

View File

@ -8,13 +8,13 @@ endif
JAVA := "$$JAVA_HOME/bin/java"
JAVAC := "$$JAVA_HOME/bin/javac"
JAVAC := "$$JAVA_HOME/bin/javac"
JAVAH := "$$JAVA_HOME/bin/javah"
OSINFO_CLASS := org.xerial.snappy.OSInfo
OSINFO_PROG := lib/org/xerial/snappy/OSInfo.class
## building OSInfo.java
## building OSInfo.java
#$(info compiling OSInfo.java)
#$(shell mkdir -p lib)
#$(shell $(JAVAC) src/main/java/org/xerial/snappy/OSInfo.java -d lib)
@ -31,7 +31,7 @@ else
sep := :
endif
snappy := snappy-$(VERSION)
snappy := snappy-$(SNAPPY_VERSION)
jni_md := $(shell find -L "$(JAVA_HOME)" -name jni_md.h | head -1)
@ -70,7 +70,7 @@ Default_STRIP := $(CROSS_PREFIX)strip
Default_CXXFLAGS := -I$(JAVA_HOME)/include -Ilib/inc_mac -O2 -fPIC -fvisibility=hidden
Default_LINKFLAGS := -shared -static
Default_LIBNAME := libsnappyjava.so
Default_SNAPPY_FLAGS :=
Default_SNAPPY_FLAGS :=
Linux-x86_CXX := $(CROSS_PREFIX)g++
Linux-x86_STRIP := $(CROSS_PREFIX)strip
@ -81,18 +81,18 @@ else
endif
Linux-x86_LINKFLAGS := -shared -static-libgcc -static-libstdc++
Linux-x86_LIBNAME := libsnappyjava.so
Linux-x86_SNAPPY_FLAGS:=
Linux-x86_SNAPPY_FLAGS:=
Linux-x86_64_CXX := $(CROSS_PREFIX)g++
Linux-x86_64_CXX := $(CROSS_PREFIX)g++
Linux-x86_64_STRIP := $(CROSS_PREFIX)strip
ifeq ($(IBM_JDK_7),)
Linux-x86_64_CXXFLAGS := -Ilib/inc_linux -I$(JAVA_HOME)/include -Ilib/inc_mac -O2 -fPIC -fvisibility=hidden -m64
Linux-x86_64_CXXFLAGS := -Ilib/inc_linux -I$(JAVA_HOME)/include -Ilib/inc_mac -O2 -fPIC -fvisibility=hidden -m64
else
Linux-x86_64_CXXFLAGS := -include $(IBM_JDK_LIB)/jni_md.h -include $(IBM_JDK_LIB)/jniport.h -I$(JAVA_HOME)/include -Ilib/inc_mac -O2 -fPIC -fvisibility=hidden -m64
Linux-x86_64_CXXFLAGS := -include $(IBM_JDK_LIB)/jni_md.h -include $(IBM_JDK_LIB)/jniport.h -I$(JAVA_HOME)/include -Ilib/inc_mac -O2 -fPIC -fvisibility=hidden -m64
endif
Linux-x86_64_LINKFLAGS := -shared -static-libgcc -static-libstdc++
Linux-x86_64_LIBNAME := libsnappyjava.so
Linux-x86_64_SNAPPY_FLAGS :=
Linux-x86_64_SNAPPY_FLAGS :=
Linux-ppc_CXX := g++
Linux-ppc_STRIP := strip
@ -108,7 +108,7 @@ Linux-ppc_SNAPPY_FLAGS :=
Linux-ppc64_CXX := g++
Linux-ppc64_STRIP := strip
ifeq ($(IBM_JDK_7),)
Linux-ppc64_CXXFLAGS := -DHAVE_CONFIG_H -Ilib/inc_linux -I$(JAVA_HOME)/include -Ilib/inc_mac -O2 -fPIC -fvisibility=hidden -m64
Linux-ppc64_CXXFLAGS := -DHAVE_CONFIG_H -Ilib/inc_linux -I$(JAVA_HOME)/include -Ilib/inc_mac -O2 -fPIC -fvisibility=hidden -m64
else
Linux-ppc64_CXXFLAGS := -DHAVE_CONFIG_H -include $(IBM_JDK_LIB)/jni_md.h -include $(IBM_JDK_LIB)/jniport.h -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/linux -O2 -fPIC -m64
endif
@ -160,19 +160,19 @@ Linux-s390x_LINKFLAGS := -shared -static-libgcc -static-libstdc++
Linux-s390x_LIBNAME := libsnappyjava.so
Linux-s390x_SNAPPY_FLAGS :=
SunOS-x86_CXX := g++
SunOS-x86_CXX := g++
SunOS-x86_STRIP := strip
SunOS-x86_CXXFLAGS := -include lib/inc_linux/jni_md.h -I$(JAVA_HOME)/include -O2 -fPIC -fvisibility=hidden
SunOS-x86_LINKFLAGS := -shared -static-libgcc -static-libstdc++
SunOS-x86_LIBNAME := libsnappyjava.so
SunOS-x86_SNAPPY_FLAGS :=
SunOS-x86_SNAPPY_FLAGS :=
SunOS-sparc_CXX := g++
SunOS-sparc_CXX := g++
SunOS-sparc_STRIP := strip
SunOS-sparc_CXXFLAGS := -include lib/inc_linux/jni_md.h -I$(JAVA_HOME)/include -O2 -fPIC -fvisibility=hidden
SunOS-sparc_LINKFLAGS := -shared -static-libgcc -static-libstdc++
SunOS-sparc_LIBNAME := libsnappyjava.so
SunOS-sparc_SNAPPY_FLAGS :=
SunOS-sparc_SNAPPY_FLAGS :=
SunOS-x86_64_CXX := g++
SunOS-x86_64_STRIP := strip
@ -191,14 +191,14 @@ Linux-arm_STRIP := $(CROSS_PREFIX)strip
Linux-arm_CXXFLAGS := -include lib/inc_linux/jni_md.h -I$(JAVA_HOME)/include -O2 -fPIC -fvisibility=hidden -mfloat-abi=softfp
Linux-arm_LINKFLAGS := -shared -static-libgcc
Linux-arm_LIBNAME := libsnappyjava.so
Linux-arm_SNAPPY_FLAGS:=
Linux-arm_SNAPPY_FLAGS:=
Linux-armhf_CXX := $(CROSS_PREFIX)g++
Linux-armhf_STRIP := $(CROSS_PREFIX)strip
Linux-armhf_CXXFLAGS := -include lib/inc_linux/jni_md.h -I$(JAVA_HOME)/include -O2 -fPIC -fvisibility=hidden -mfloat-abi=hard
Linux-armhf_LINKFLAGS := -shared -static-libgcc
Linux-armhf_LIBNAME := libsnappyjava.so
Linux-armhf_SNAPPY_FLAGS:=
Linux-armhf_SNAPPY_FLAGS:=
Linux-aarch64_CXX := $(CROSS_PREFIX)g++
Linux-aarch64_STRIP := $(CROSS_PREFIX)strip
@ -214,47 +214,46 @@ Mac-x86_LINKFLAGS := -dynamiclib -static-libgcc
Mac-x86_LIBNAME := libsnappyjava.jnilib
Mac-x86_SNAPPY_FLAGS :=
Mac-x86_64_CXX := g++ -arch $(OS_ARCH)
Mac-x86_64_CXX := g++ -arch $(OS_ARCH)
Mac-x86_64_STRIP := strip -x
Mac-x86_64_CXXFLAGS := -Ilib/inc_mac -I$(JAVA_HOME)/include -O2 -fPIC -mmacosx-version-min=10.5 -fvisibility=hidden
Mac-x86_64_LINKFLAGS := -dynamiclib
Mac-x86_64_LIBNAME := libsnappyjava.jnilib
Mac-x86_64_SNAPPY_FLAGS :=
Mac-x86_64_LINKFLAGS := -dynamiclib
Mac-x86_64_LIBNAME := libsnappyjava.jnilib
Mac-x86_64_SNAPPY_FLAGS :=
FreeBSD-x86_64_CXX := $(CROSS_PREFIX)g++
FreeBSD-x86_64_STRIP := $(CROSS_PREFIX)strip
FreeBSD-x86_64_CXXFLAGS := -I$(JAVA_HOME)/include -Ilib/inc_mac -O2 -fPIC -fvisibility=hidden
FreeBSD-x86_64_LINKFLAGS := -shared -static-libgcc
FreeBSD-x86_64_LIBNAME := libsnappyjava.so
FreeBSD-x86_64_SNAPPY_FLAGS :=
FreeBSD-x86_64_SNAPPY_FLAGS :=
Windows-x86_CXX := $(CROSS_PREFIX)g++
Windows-x86_STRIP := $(CROSS_PREFIX)strip
Windows-x86_CXXFLAGS := -Ilib/inc_win -O2
Windows-x86_CXXFLAGS := -Ilib/inc_win -O2
Windows-x86_LINKFLAGS := -Wl,--kill-at -shared -static
Windows-x86_LIBNAME := snappyjava.dll
Windows-x86_SNAPPY_FLAGS :=
Windows-x86_SNAPPY_FLAGS :=
Windows-x86_64_CXX := $(CROSS_PREFIX)g++
Windows-x86_64_STRIP := $(CROSS_PREFIX)strip
Windows-x86_64_CXXFLAGS := -Ilib/inc_win -O2
Windows-x86_64_LINKFLAGS := -Wl,--kill-at -shared -static
Windows-x86_64_CXXFLAGS := -Ilib/inc_win -O2
Windows-x86_64_LINKFLAGS := -Wl,--kill-at -shared -static
Windows-x86_64_LIBNAME := snappyjava.dll
Windows-x86_64_SNAPPY_FLAGS :=
Windows-x86_64_SNAPPY_FLAGS :=
CXX := $($(os_arch)_CXX)
STRIP := $($(os_arch)_STRIP)
CXXFLAGS := $($(os_arch)_CXXFLAGS)
LINKFLAGS := $($(os_arch)_LINKFLAGS)
CXXFLAGS := $($(os_arch)_CXXFLAGS)
LINKFLAGS := $($(os_arch)_LINKFLAGS)
LIBNAME := $($(os_arch)_LIBNAME)
SNAPPY_FLAGS := $($(os_arch)_SNAPPY_FLAGS)
CXXFLAGS := $(CXXFLAGS) -Ilib/include
CXXFLAGS := $(CXXFLAGS) -Ilib/include
ifneq ($(jni_include),)
CXXFLAGS := $(CXXFLAGS) -I"$(jni_include)"
endif

View File

@ -295,7 +295,7 @@ public class Snappy
versionData.load(in);
version = versionData.getProperty("version", version);
if (version.equals("unknown")) {
version = versionData.getProperty("VERSION", version);
version = versionData.getProperty("SNAPPY_VERSION", version);
}
version = version.trim().replaceAll("[^0-9\\.]", "");
}

View File

@ -404,7 +404,7 @@ public class SnappyLoader
versionData.load(versionFile.openStream());
version = versionData.getProperty("version", version);
if (version.equals("unknown")) {
version = versionData.getProperty("VERSION", version);
version = versionData.getProperty("SNAPPY_VERSION", version);
}
version = version.trim().replaceAll("[^0-9M\\.]", "");
}

View File

@ -32,7 +32,8 @@ inline void throw_exception(JNIEnv *env, jobject self, int errorCode)
JNIEXPORT jstring JNICALL Java_org_xerial_snappy_SnappyNative_nativeLibraryVersion
(JNIEnv * env, jobject self)
{
return env->NewStringUTF("1.1.0");
// TODO: Do we need to read this library version from resources/org/xerial/snappy/VERSION?
return env->NewStringUTF("1.1.3");
}
JNIEXPORT jlong JNICALL Java_org_xerial_snappy_SnappyNative_rawCompress__JJJ

View File

@ -1 +1,2 @@
VERSION=1.1.3
SNAPPY_VERSION=1.1.3
BITSHUFFLE_VERSION=0.2.2