Skip to content

Commit ec31b25

Browse files
committed
Build changes for Solaris x86 & Sparc.
1 parent 2fc787b commit ec31b25

File tree

4 files changed

+27
-2
lines changed

4 files changed

+27
-2
lines changed

Makefile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,18 @@ 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

Makefile.common

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ endif
4141

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

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
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)))
@@ -72,6 +72,20 @@ Linux-x86_64_LINKFLAGS := -shared -static-libgcc -static-libstdc++
7272
Linux-x86_64_LIBNAME := libsnappyjava.so
7373
Linux-x86_64_SNAPPY_FLAGS :=
7474

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 :=
88+
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
7791
# jni_md.h in same directory as jni.h, the include path is ignored when

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,9 @@ See the [installation instruction](https://github.com/xerial/snappy-java/blob/de
9191
$ cd snappy-java
9292
$ make
9393

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

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

pom.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,8 @@
188188
org/xerial/snappy/native/Mac/x86_64/libsnappyjava.jnilib;selection-filter="(&amp;(osgi.arch=x86_64)(osgi.os=macosx))",
189189
org/xerial/snappy/native/Linux/x86_64/libsnappyjava.so;selection-filter="(&amp;(osgi.arch=x86_64)(osgi.os=linux))",
190190
org/xerial/snappy/native/Linux/x86/libsnappyjava.so;selection-filter="(&amp;(osgi.arch=x86)(osgi.os=linux))",
191+
org/xerial/snappy/native/SunOS/x86/libsnappyjava.so;selection-filter="(&amp;(osgi.arch=x86)(osgi.os=sunos))",
192+
org/xerial/snappy/native/SunOS/sparc/libsnappyjava.so;selection-filter="(&amp;(osgi.arch=sparc)(osgi.os=sunos))",
191193
org/xerial/snappy/native/Linux/arm/libsnappyjava.so;selection-filter="(&amp;(osgi.arch=arm)(osgi.os=linux))"
192194
</Bundle-NativeCode>
193195
<!-- TODO: unsure about ARMHF -->

0 commit comments

Comments
 (0)