add include headers necessary for buliding snappy

This commit is contained in:
Taro L. Saito 2011-03-29 20:30:07 +09:00
parent d9fa5f1b25
commit c82cf5d6f8
7 changed files with 2057 additions and 34 deletions

View File

@ -1,6 +1,10 @@
target
.classpath
.project
Debug
Release
syntax: glob
*~
*.sdf
*.ipch

View File

@ -5,6 +5,7 @@ TARGET:=target
include $(SRC)/org/xerial/snappy/VERSION
include Makefile.common
SNAPPY_ARCHIVE:=$(TARGET)/snappy-$(VERSION).tar.gz
@ -22,3 +23,9 @@ $(SRC)/org/xerial/snappy/SnappyNative.h: $(SRC)/org/xerial/snappy/Snappy.java
javah -classpath $(TARGET)/classes -o $@ org.xerial.snappy.Snappy
snappy:
(cd $(TARGET)/snappy-$(VERSION); \
./configure CXX=$(CXX) CXXFLAGS=$(CXXFLAGS); \
make)

View File

@ -29,7 +29,7 @@ else
sep := :
endif
sqlite := sqlite-$(version)
snappy := snappy-$(version)
jni_md := $(shell find -L "$(JAVA_HOME)" -name jni_md.h)
ifneq ($(jni_md),)
@ -46,65 +46,65 @@ ifeq (,$(findstring $(strip $(target)),$(known_targets)))
target := Default
endif
Default_CC := gcc
Default_CXX := gcc
Default_STRIP := strip
Default_CFLAGS := -I$(JAVA_HOME)/include -Isqlitejdbc/lib/inc_mac -Os -fPIC
Default_CXXFLAGS := -I$(JAVA_HOME)/include -Ilib/inc_mac -Os -fPIC
Default_LINKFLAGS := -shared
Default_LIBNAME := libsqlitejdbc.so
Default_SQLITE_FLAGS :=
Default_LIBNAME := libsnappy.so
Default_SNAPPY_FLAGS :=
Linux-i386_CC := gcc
Linux-i386_CXX := cc
Linux-i386_STRIP := strip
Linux-i386_CFLAGS := -I$(JAVA_HOME)/include -Ilib/inc_mac -Os -fPIC
Linux-i386_CXXFLAGS := -I$(JAVA_HOME)/include -Ilib/inc_mac -Os -fPIC
Linux-i386_LINKFLAGS := -shared
Linux-i386_LIBNAME := libsqlitejdbc.so
Linux-i386_SQLITE_FLAGS :=
Linux-i386_LIBNAME := libsnappy.so
Linux-i386_SNAPPY_FLAGS :=
Linux-amd64_CC := gcc
Linux-amd64_CXX := gcc
Linux-amd64_STRIP := strip
Linux-amd64_CFLAGS := -I$(JAVA_HOME)/include -Ilib/inc_mac -Os -fPIC
Linux-amd64_CXXFLAGS := -I$(JAVA_HOME)/include -Ilib/inc_mac -Os -fPIC
Linux-amd64_LINKFLAGS := -shared
Linux-amd64_LIBNAME := libsqlitejdbc.so
Linux-amd64_SQLITE_FLAGS :=
Linux-amd64_LIBNAME := libsnappy.so
Linux-amd64_SNAPPY_FLAGS :=
Mac-i386_CC := gcc -arch $(OS_ARCH)
Mac-i386_CXX := gcc -arch $(OS_ARCH)
Mac-i386_STRIP := strip -x
Mac-i386_CFLAGS := -I$(JAVA_HOME)/include -Os -fPIC
Mac-i386_CXXFLAGS := -I$(JAVA_HOME)/include -Os -fPIC
Mac-i386_LINKFLAGS := -dynamiclib
Mac-i386_LIBNAME := libsqlitejdbc.jnilib
Mac-i386_SQLITE_FLAGS := -DSQLITE_ENABLE_LOCKING_STYLE=0
Mac-i386_LIBNAME := libsnappy.jnilib
Mac-i386_SNAPPY_FLAGS := -DSNAPPY_ENABLE_LOCKING_STYLE=0
Mac-x86_64_CC := gcc -arch $(OS_ARCH)
Mac-x86_64_CXX := gcc -arch $(OS_ARCH)
Mac-x86_64_STRIP := strip -x
Mac-x86_64_CFLAGS := -I$(JAVA_HOME)/include -Os -fPIC
Mac-x86_64_CXXFLAGS := -I$(JAVA_HOME)/include -Os -fPIC
Mac-x86_64_LINKFLAGS := -dynamiclib
Mac-x86_64_LIBNAME := libsqlitejdbc.jnilib
Mac-x86_64_SQLITE_FLAGS :=
Mac-x86_64_LIBNAME := libsnappy.jnilib
Mac-x86_64_SNAPPY_FLAGS :=
Windows-x86_CC := mingw32-gcc
Windows-x86_CXX := mingw32-gcc
Windows-x86_STRIP := strip
Windows-x86_CFLAGS := -D_JNI_IMPLEMENTATION_ -Ilib/inc_win -O
Windows-x86_CXXFLAGS := -D_JNI_IMPLEMENTATION_ -Ilib/inc_win -O
Windows-x86_LINKFLAGS := -Wl,--kill-at -shared
Windows-x86_LIBNAME := sqlitejdbc.dll
Windows-x86_SQLITE_FLAGS :=
Windows-x86_LIBNAME := snappy.dll
Windows-x86_SNAPPY_FLAGS :=
Windows-amd64_CC := x86_64-w64-mingw32-gcc
Windows-amd64_CXX := x86_64-w64-mingw32-gcc
Windows-amd64_STRIP := x86_64-w64-mingw32-strip
Windows-amd64_CFLAGS := -D_JNI_IMPLEMENTATION_ -Ilib/inc_win -O
Windows-amd64_CXXFLAGS := -D_JNI_IMPLEMENTATION_ -Ilib/inc_win -O
Windows-amd64_LINKFLAGS := -Wl,--kill-at -shared
Windows-amd64_LIBNAME := sqlitejdbc.dll
Windows-amd64_SQLITE_FLAGS :=
Windows-amd64_LIBNAME := snappy.dll
Windows-amd64_SNAPPY_FLAGS :=
CC := $($(target)_CC)
CXX := $($(target)_CXX)
STRIP := $($(target)_STRIP)
CFLAGS := $($(target)_CFLAGS)
CXXFLAGS := $($(target)_CXXFLAGS)
LINKFLAGS := $($(target)_LINKFLAGS)
LIBNAME := $($(target)_LIBNAME)
SQLITE_FLAGS := $($(target)_SQLITE_FLAGS)
SNAPPY_FLAGS := $($(target)_SNAPPY_FLAGS)
CFLAGS := $(CFLAGS) -I$(WORK)/build/$(sqlite)-$(target) -I$(WORK)/build
CXXFLAGS := $(CXXFLAGS) -I$(WORK)/build/$(snappy)-$(target) -I$(WORK)/build
ifneq ($(jni_include),)
CFLAGS := $(CFLAGS) -I"$(jni_include)"
CXXFLAGS := $(CXXFLAGS) -I"$(jni_include)"
endif

View File

@ -3,3 +3,6 @@ mingwin compile
x86_64-w64-mingw32-cpp src/main/java/org/xerial/snappy/SnappyNative.cpp -Isrc/main/java/org/xerial/snappy -Itarget/snappy-1.0.1 -I../sqlite-jdbc/lib/inc_win -D_JNI_IMPLEMENTATION_ -O -o target/SnappyNative.o
-static-libgcc

1951
lib/inc_win/jni.h Normal file

File diff suppressed because it is too large Load Diff

19
lib/inc_win/jni_md.h Normal file
View File

@ -0,0 +1,19 @@
/*
* @(#)jni_md.h 1.14 03/12/19
*
* Copyright 2004 Sun Microsystems, Inc. All rights reserved.
* SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*/
#ifndef _JAVASOFT_JNI_MD_H_
#define _JAVASOFT_JNI_MD_H_
#define JNIEXPORT __declspec(dllexport)
#define JNIIMPORT __declspec(dllimport)
#define JNICALL __stdcall
typedef long jint;
typedef __int64 jlong;
typedef signed char jbyte;
#endif /* !_JAVASOFT_JNI_MD_H_ */

39
lib/include/byteswap.h Normal file
View File

@ -0,0 +1,39 @@
/* byteswap.h
Copyright 2005 Red Hat, Inc.
This file is part of Cygwin.
This software is a copyrighted work licensed under the terms of the
Cygwin license. Please consult the file "CYGWIN_LICENSE" for
details. */
#ifndef _BYTESWAP_H
#define _BYTESWAP_H
#ifdef __cplusplus
extern "C" {
#endif
static __inline unsigned short
bswap_16 (unsigned short __x)
{
return (__x >> 8) | (__x << 8);
}
static __inline unsigned int
bswap_32 (unsigned int __x)
{
return (bswap_16 (__x & 0xffff) << 16) | (bswap_16 (__x >> 16));
}
static __inline unsigned long long
bswap_64 (unsigned long long __x)
{
return (((unsigned long long) bswap_32 (__x & 0xffffffffull)) << 32) | (bswap_32 (__x >> 32));
}
#ifdef __cplusplus
}
#endif
#endif /* _BYTESWAP_H */