Skip to content

Commit df38a6f

Browse files
committed
Merge branch 'release/1.1.0'
2 parents 90b6f1e + 8c3c303 commit df38a6f

36 files changed

+2327
-440
lines changed

Makefile

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,27 @@ SNAPPY_UNPACKED:=$(TARGET)/snappy-extracted.log
1616

1717
CXXFLAGS:=$(CXXFLAGS) -I$(SNAPPY_SRC_DIR)
1818

19+
ifeq ($(OS_NAME),SunOS)
20+
TAR:= gtar
21+
else
22+
TAR:= tar
23+
endif
24+
1925
$(SNAPPY_ARCHIVE):
2026
@mkdir -p $(@D)
2127
curl -o$@ http://snappy.googlecode.com/files/snappy-$(VERSION).tar.gz
2228

2329
$(SNAPPY_UNPACKED): $(SNAPPY_ARCHIVE)
24-
tar xvfz $< -C $(TARGET)
30+
$(TAR) xvfz $< -C $(TARGET)
2531
touch $@
2632

2733
jni-header: $(SRC)/org/xerial/snappy/SnappyNative.h
2834

29-
30-
$(SRC)/org/xerial/snappy/SnappyNative.h: $(SRC)/org/xerial/snappy/SnappyNative.java
35+
$(TARGET)/classes/org/xerial/snappy/SnappyNative.class : $(SRC)/org/xerial/snappy/SnappyNative.java
3136
@mkdir -p $(TARGET)/classes
37+
$(JAVAC) -source 1.6 -target 1.6 -d $(TARGET)/classes -sourcepath $(SRC) $<
38+
39+
$(SRC)/org/xerial/snappy/SnappyNative.h: $(TARGET)/classes/org/xerial/snappy/SnappyNative.class
3240
$(JAVAH) -classpath $(TARGET)/classes -o $@ org.xerial.snappy.SnappyNative
3341

3442
bytecode: src/main/resources/org/xerial/snappy/SnappyNativeLoader.bytecode
@@ -86,16 +94,16 @@ win32:
8694

8795
# for cross-compilation on Ubuntu, install the g++-mingw-w64-x86-64 package
8896
win64:
89-
$(MAKE) native CROSS_PREFIX=x86_64-w64-mingw32- OS_NAME=Windows OS_ARCH=amd64
97+
$(MAKE) native CROSS_PREFIX=x86_64-w64-mingw32- OS_NAME=Windows OS_ARCH=x86_64
9098

9199
mac32:
92-
$(MAKE) native OS_NAME=Mac OS_ARCH=i386
100+
$(MAKE) native OS_NAME=Mac OS_ARCH=x86
93101

94102
linux32:
95-
$(MAKE) native OS_NAME=Linux OS_ARCH=i386
103+
$(MAKE) native OS_NAME=Linux OS_ARCH=x86
96104

97105
freebsd64:
98-
$(MAKE) native OS_NAME=FreeBSD OS_ARCH=amd64
106+
$(MAKE) native OS_NAME=FreeBSD OS_ARCH=x86_64
99107

100108
# for cross-compilation on Ubuntu, install the g++-arm-linux-gnueabi package
101109
linux-arm:
@@ -106,7 +114,7 @@ linux-armhf:
106114
$(MAKE) native CROSS_PREFIX=arm-linux-gnueabihf- OS_NAME=Linux OS_ARCH=armhf
107115

108116
clean-native-linux32:
109-
$(MAKE) clean-native OS_NAME=Linux OS_ARCH=i386
117+
$(MAKE) clean-native OS_NAME=Linux OS_ARCH=x86
110118

111119
clean-native-win32:
112120
$(MAKE) clean-native OS_NAME=Windows OS_ARCH=x86

Makefile.common

Lines changed: 47 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,15 @@ endif
3333
snappy := snappy-$(VERSION)
3434

3535

36-
jni_md := $(shell find -L "$(JAVA_HOME)" -name jni_md.h)
36+
jni_md := $(shell find -L "$(JAVA_HOME)" -name jni_md.h | head -1)
3737
ifneq ($(jni_md),)
3838
jni_include := $(shell dirname "$(jni_md)")
3939
endif
4040

4141

4242
# os=Default is meant to be generic unix/linux
4343

44-
known_os_archs := Linux-i386 Linux-amd64 Linux-arm Linux-armhf Mac-i386 Mac-x86_64 FreeBSD-amd64 Windows-x86 Windows-amd64
44+
known_os_archs := Linux-x86 Linux-x86_64 Linux-arm Linux-armhf Mac-x86 Mac-x86_64 FreeBSD-x86_64 Windows-x86 Windows-x86_64 SunOS-x86 SunOS-sparc
4545
os_arch := $(OS_NAME)-$(OS_ARCH)
4646

4747
ifeq (,$(findstring $(strip $(os_arch)),$(known_os_archs)))
@@ -58,19 +58,33 @@ Default_LINKFLAGS := -shared -static
5858
Default_LIBNAME := libsnappyjava.so
5959
Default_SNAPPY_FLAGS :=
6060

61-
Linux-i386_CXX := $(CROSS_PREFIX)g++
62-
Linux-i386_STRIP := $(CROSS_PREFIX)strip
63-
Linux-i386_CXXFLAGS := -include lib/inc_linux/jni_md.h -I$(JAVA_HOME)/include -O2 -fPIC -fvisibility=hidden -m32
64-
Linux-i386_LINKFLAGS := -shared -static-libgcc -static-libstdc++
65-
Linux-i386_LIBNAME := libsnappyjava.so
66-
Linux-i386_SNAPPY_FLAGS:=
67-
68-
Linux-amd64_CXX := $(CROSS_PREFIX)g++
69-
Linux-amd64_STRIP := $(CROSS_PREFIX)strip
70-
Linux-amd64_CXXFLAGS := -include lib/inc_linux/jni_md.h -I$(JAVA_HOME)/include -O2 -fPIC -fvisibility=hidden -m64
71-
Linux-amd64_LINKFLAGS := -shared -static-libgcc -static-libstdc++
72-
Linux-amd64_LIBNAME := libsnappyjava.so
73-
Linux-amd64_SNAPPY_FLAGS :=
61+
Linux-x86_CXX := $(CROSS_PREFIX)g++
62+
Linux-x86_STRIP := $(CROSS_PREFIX)strip
63+
Linux-x86_CXXFLAGS := -include lib/inc_linux/jni_md.h -I$(JAVA_HOME)/include -O2 -fPIC -fvisibility=hidden -m32
64+
Linux-x86_LINKFLAGS := -shared -static-libgcc -static-libstdc++
65+
Linux-x86_LIBNAME := libsnappyjava.so
66+
Linux-x86_SNAPPY_FLAGS:=
67+
68+
Linux-x86_64_CXX := $(CROSS_PREFIX)g++
69+
Linux-x86_64_STRIP := $(CROSS_PREFIX)strip
70+
Linux-x86_64_CXXFLAGS := -include lib/inc_linux/jni_md.h -I$(JAVA_HOME)/include -O2 -fPIC -fvisibility=hidden -m64
71+
Linux-x86_64_LINKFLAGS := -shared -static-libgcc -static-libstdc++
72+
Linux-x86_64_LIBNAME := libsnappyjava.so
73+
Linux-x86_64_SNAPPY_FLAGS :=
74+
75+
SunOS-x86_CXX := g++
76+
SunOS-x86_STRIP := strip
77+
SunOS-x86_CXXFLAGS := -include lib/inc_linux/jni_md.h -I$(JAVA_HOME)/include -O2 -fPIC -fvisibility=hidden
78+
SunOS-x86_LINKFLAGS := -shared -static-libgcc -static-libstdc++
79+
SunOS-x86_LIBNAME := libsnappyjava.so
80+
SunOS-x86_SNAPPY_FLAGS :=
81+
82+
SunOS-sparc_CXX := g++
83+
SunOS-sparc_STRIP := strip
84+
SunOS-sparc_CXXFLAGS := -include lib/inc_linux/jni_md.h -I$(JAVA_HOME)/include -O2 -fPIC -fvisibility=hidden
85+
SunOS-sparc_LINKFLAGS := -shared -static-libgcc -static-libstdc++
86+
SunOS-sparc_LIBNAME := libsnappyjava.so
87+
SunOS-sparc_SNAPPY_FLAGS :=
7488

7589
# '-include lib/inc_linux/jni_md.h' is used to force the use of our version,
7690
# which defines JNIEXPORT differently; otherwise, since OpenJDK includes
@@ -91,12 +105,12 @@ Linux-armhf_LINKFLAGS := -shared -static-libgcc
91105
Linux-armhf_LIBNAME := libsnappyjava.so
92106
Linux-armhf_SNAPPY_FLAGS:=
93107

94-
Mac-i386_CXX := g++ -arch $(OS_ARCH)
95-
Mac-i386_STRIP := strip -x
96-
Mac-i386_CXXFLAGS := -Ilib/inc_mac -I$(JAVA_HOME)/include -O2 -fPIC -mmacosx-version-min=10.4 -fvisibility=hidden
97-
Mac-i386_LINKFLAGS := -dynamiclib -static-libgcc
98-
Mac-i386_LIBNAME := libsnappyjava.jnilib
99-
Mac-i386_SNAPPY_FLAGS :=
108+
Mac-x86_CXX := g++ -arch i386
109+
Mac-x86_STRIP := strip -x
110+
Mac-x86_CXXFLAGS := -Ilib/inc_mac -I$(JAVA_HOME)/include -O2 -fPIC -mmacosx-version-min=10.4 -fvisibility=hidden
111+
Mac-x86_LINKFLAGS := -dynamiclib -static-libgcc
112+
Mac-x86_LIBNAME := libsnappyjava.jnilib
113+
Mac-x86_SNAPPY_FLAGS :=
100114

101115
Mac-x86_64_CXX := g++ -arch $(OS_ARCH)
102116
Mac-x86_64_STRIP := strip -x
@@ -105,12 +119,12 @@ Mac-x86_64_LINKFLAGS := -dynamiclib -static-libgcc
105119
Mac-x86_64_LIBNAME := libsnappyjava.jnilib
106120
Mac-x86_64_SNAPPY_FLAGS :=
107121

108-
FreeBSD-amd64_CXX := $(CROSS_PREFIX)g++
109-
FreeBSD-amd64_STRIP := $(CROSS_PREFIX)strip
110-
FreeBSD-amd64_CXXFLAGS := -I$(JAVA_HOME)/include -Ilib/inc_mac -O2 -fPIC -fvisibility=hidden
111-
FreeBSD-amd64_LINKFLAGS := -shared -static-libgcc
112-
FreeBSD-amd64_LIBNAME := libsnappyjava.so
113-
FreeBSD-amd64_SNAPPY_FLAGS :=
122+
FreeBSD-x86_64_CXX := $(CROSS_PREFIX)g++
123+
FreeBSD-x86_64_STRIP := $(CROSS_PREFIX)strip
124+
FreeBSD-x86_64_CXXFLAGS := -I$(JAVA_HOME)/include -Ilib/inc_mac -O2 -fPIC -fvisibility=hidden
125+
FreeBSD-x86_64_LINKFLAGS := -shared -static-libgcc
126+
FreeBSD-x86_64_LIBNAME := libsnappyjava.so
127+
FreeBSD-x86_64_SNAPPY_FLAGS :=
114128

115129
Windows-x86_CXX := $(CROSS_PREFIX)g++
116130
Windows-x86_STRIP := $(CROSS_PREFIX)strip
@@ -119,12 +133,12 @@ Windows-x86_LINKFLAGS := -Wl,--kill-at -shared -static
119133
Windows-x86_LIBNAME := snappyjava.dll
120134
Windows-x86_SNAPPY_FLAGS :=
121135

122-
Windows-amd64_CXX := $(CROSS_PREFIX)g++
123-
Windows-amd64_STRIP := $(CROSS_PREFIX)strip
124-
Windows-amd64_CXXFLAGS := -Ilib/inc_win -O2
125-
Windows-amd64_LINKFLAGS := -Wl,--kill-at -shared -static
126-
Windows-amd64_LIBNAME := snappyjava.dll
127-
Windows-amd64_SNAPPY_FLAGS :=
136+
Windows-x86_64_CXX := $(CROSS_PREFIX)g++
137+
Windows-x86_64_STRIP := $(CROSS_PREFIX)strip
138+
Windows-x86_64_CXXFLAGS := -Ilib/inc_win -O2
139+
Windows-x86_64_LINKFLAGS := -Wl,--kill-at -shared -static
140+
Windows-x86_64_LIBNAME := snappyjava.dll
141+
Windows-x86_64_SNAPPY_FLAGS :=
128142

129143

130144
CXX := $($(os_arch)_CXX)

Milestone.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,21 @@
22
* `SnappyIndexer` for parallel compression/decompression
33
* CUI commands (snap/unsnap)
44

5+
## snappy-java-1.1.0 (17 October 2013)
6+
* Add Snappy framed format support (SnappyFramedInputStream, SnappyFramedOutputStream)
7+
* Add SunOS support
8+
* Dropped OpenBSD support
9+
* OSGi support
10+
11+
## snappy-java-1.1.0-M4 (20 August 2013)
12+
* New JNI native code loading mechanism, which does not rely on native code injection.
13+
* Add OpenBSD support
14+
* Add Framed format support
15+
* Recovered 32-bit Mac support
16+
* Fixes several issues
17+
* Target to Java6 (Java5 will be no longer supported)
18+
* Add zero-copy compression, decompression and isValidCompressedData for LArray <https://github.com/xerial/larray>
19+
520
## snappy-java-1.1.0-M3 (28 March 2013)
621
* Fix linux amd64 build (embed libstdc++)
722
* Fixes #26

NOTICE

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
This product includes software developed by Google
22
Snappy: http://code.google.com/p/snappy/ (New BSD License)
33

4+
This product includes software developed by Apache
5+
PureJavaCrc32C from apache-hadoop-common http://hadoop.apache.org/
6+
(Apache 2.0 license)
47

58
This library containd statically linked libstdc++. This inclusion is allowed by
69
"GCC RUntime Library Exception"

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ The snappy-java is a Java port of the snappy
88
* Although snappy-java uses JNI, it can be used safely with multiple class loaders (e.g. Tomcat, etc.).
99
* Portable across various operating systems; Snappy-java contains native libraries built for Window/Mac/Linux (64-bit). At runtime, snappy-java loads one of these libraries according to your machine environment (It looks system properties, `os.name` and `os.arch`).
1010
* Simple usage. Add the snappy-java-(version).jar file to your classpath. Then call compression/decompression methods in org.xerial.snappy.Snappy.
11+
* [Framing-format support](http://snappy.googlecode.com/svn/trunk/framing_format.txt) (Since 1.1.0-SNAPSHOT version)
1112

1213
## Performance
1314
* Snappy's main target is very high-speed compression/decompression with reasonable compression size. So the compression ratio of snappy-java is modest and about the same as `LZF` (ranging 20%-100% according to the dataset).
@@ -24,7 +25,7 @@ The snappy-java is a Java port of the snappy
2425
## Download
2526
The current stable version is available from here:
2627
* Release version: http://code.google.com/p/snappy-java/downloads/list
27-
* [Release plans](https://github.com/xerial/snappy-java/blob/develop/Milestone.md)
28+
* [Release plans](Milestone.md)
2829
* Snapshot version (the latest beta version): https://oss.sonatype.org/content/repositories/snapshots/org/xerial/snappy/snappy-java/
2930
If you are a Maven user, see [pom.xml example](#using-with-maven).
3031

@@ -53,7 +54,7 @@ In addition, high-level methods (`Snappy.compress(String)`, `Snappy.compress(flo
5354
### Stream-based API
5455
Stream-based compressor/decompressor `SnappyOutputStream`/`SnappyInputStream` are also available for reading/writing large data sets.
5556

56-
* [Javadoc API](https://oss.sonatype.org/service/local/repositories/releases/archive/org/xerial/snappy/snappy-java/1.1.0-M3/snappy-java-1.1.0-M3-javadoc.jar/!/index.html)
57+
* [Javadoc API](https://oss.sonatype.org/service/local/repositories/releases/archive/org/xerial/snappy/snappy-java/1.1.0/snappy-java-1.1.0-javadoc.jar/!/index.html)
5758

5859
### Setting classpath
5960
If you have snappy-java-(VERSION).jar in the current directory, use `-classpath` option as follows:
@@ -90,6 +91,9 @@ See the [installation instruction](https://github.com/xerial/snappy-java/blob/de
9091
$ cd snappy-java
9192
$ make
9293

94+
When building on Solaris use
95+
96+
$ gmake
9397

9498
A file `target/snappy-java-$(version).jar` is the product additionally containing the native library built for your platform.
9599

@@ -125,7 +129,7 @@ If you are using Mac and openjdk7 (or higher), use the following option:
125129
## Miscellaneous Notes
126130
### Using snappy-java with Tomcat 6 (or higher) Web Server
127131

128-
Simply put the snappy-java's jar to WEB-INF/lib folder of your web application. Usual JNI-library specific problem no longer exists since snappy-java version 1.0.3 or higher can be loaded by multiple class loaders in the same JVM by using native code injection to the parent class loader (Issue 21).
132+
Simply put the snappy-java's jar to WEB-INF/lib folder of your web application. Usual JNI-library specific problem no longer exists since snappy-java version 1.0.3 or higher can be loaded by multiple class loaders.
129133

130134
----
131135
Snappy-java is developed by [Taro L. Saito](http://www.xerial.org/leo). Twitter [@taroleo](http://twitter.com/#!/taroleo)

lib/org/xerial/snappy/OSInfo.class

1.59 KB
Binary file not shown.

pom.xml

Lines changed: 15 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<modelVersion>4.0.0</modelVersion>
55
<groupId>org.xerial.snappy</groupId>
66
<artifactId>snappy-java</artifactId>
7-
<version>1.1.0-M3</version>
7+
<version>1.1.0</version>
88
<name>Snappy for Java</name>
99
<description>snappy-java: A fast compression/decompression library</description>
1010
<packaging>bundle</packaging>
@@ -182,12 +182,15 @@
182182
<Import-Package>org.osgi.framework;version="[1.5,2)"</Import-Package>
183183
<Bundle-ActivationPolicy>lazy</Bundle-ActivationPolicy>
184184
<Bundle-NativeCode>
185-
org/xerial/snappy/native/Windows/amd64/snappyjava.dll;selection-filter="(&amp;(osgi.arch=x86_64)(osgi.os=win32))",
186-
org/xerial/snappy/native/Windows/x86/snappyjava.dll;selection-filter="(&amp;(osgi.arch=x86)(osgi.os=win32))",
187-
org/xerial/snappy/native/Mac/x86_64/libsnappyjava.jnilib;selection-filter="(&amp;(osgi.arch=x86_64)(osgi.os=macosx))",
188-
org/xerial/snappy/native/Linux/amd64/libsnappyjava.so;selection-filter="(&amp;(osgi.arch=x86_64)(osgi.os=linux))",
189-
org/xerial/snappy/native/Linux/i386/libsnappyjava.so;selection-filter="(&amp;(osgi.arch=x86)(osgi.os=linux))",
190-
org/xerial/snappy/native/Linux/arm/libsnappyjava.so;selection-filter="(&amp;(osgi.arch=arm)(osgi.os=linux))"
185+
org/xerial/snappy/native/Windows/x86_64/snappyjava.dll;osname=win32;processor=x86-64,
186+
org/xerial/snappy/native/Windows/x86/snappyjava.dll;osname=win32;processor=x86,
187+
org/xerial/snappy/native/Mac/x86/libsnappyjava.jnilib;osname=macosx;processor=x86,
188+
org/xerial/snappy/native/Mac/x86_64/libsnappyjava.jnilib;osname=macosx;processor=x86-64,
189+
org/xerial/snappy/native/Linux/x86_64/libsnappyjava.so;osname=linux;processor=x86-64,
190+
org/xerial/snappy/native/Linux/x86/libsnappyjava.so;osname=linux;processor=x86,
191+
org/xerial/snappy/native/SunOS/x86/libsnappyjava.so;osname=sunos;processor=x86,
192+
org/xerial/snappy/native/SunOS/sparc/libsnappyjava.so;osname=sunos;processor=sparc,
193+
org/xerial/snappy/native/Linux/arm/libsnappyjava.so;osname=linux;processor=arm
191194
</Bundle-NativeCode>
192195
<!-- TODO: unsure about ARMHF -->
193196
</instructions>
@@ -214,7 +217,7 @@
214217
</archive>
215218
</configuration>
216219
</plugin>
217-
220+
218221
<plugin>
219222
<groupId>org.apache.maven.plugins</groupId>
220223
<artifactId>maven-clean-plugin</artifactId>
@@ -231,7 +234,7 @@
231234
</filesets>
232235
</configuration>
233236
</plugin>
234-
237+
235238
<plugin>
236239
<artifactId>maven-assembly-plugin</artifactId>
237240
<version>2.2.1</version>
@@ -252,7 +255,7 @@
252255
</execution>
253256
</executions>
254257
</plugin>
255-
258+
256259
</plugins>
257260

258261
<extensions>
@@ -278,30 +281,6 @@
278281
<url>[email protected]:xerial/snappy-java.git</url>
279282
</scm>
280283

281-
<profiles>
282-
<!-- for local updates -->
283-
<profile>
284-
<id>xerial.local</id>
285-
<distributionManagement>
286-
<repository>
287-
<id>xerial.local</id>
288-
<name>Xerial Maven Repository</name>
289-
<url>file:///home/web/maven.xerial.org/repository/artifact</url>
290-
</repository>
291-
<snapshotRepository>
292-
<id>xerial.local</id>
293-
<name>Xerial Maven Snapshot Repository</name>
294-
<url>file:///home/web/maven.xerial.org/repository/snapshot</url>
295-
<uniqueVersion>false</uniqueVersion>
296-
</snapshotRepository>
297-
<site>
298-
<id>xerial.local</id>
299-
<url>file:///home/web/maven.xerial.org/repository/site</url>
300-
</site>
301-
</distributionManagement>
302-
</profile>
303-
</profiles>
304-
305284
<dependencies>
306285
<dependency>
307286
<groupId>junit</groupId>
@@ -332,7 +311,7 @@
332311
<type>jar</type>
333312
<scope>test</scope>
334313
</dependency>
335-
314+
336315
</dependencies>
337-
316+
338317
</project>

0 commit comments

Comments
 (0)