add -static-libgcc flag. This flag is necessary to remove the dependency to lib-gcc
This commit is contained in:
parent
0e5ada2f90
commit
077d52599c
6
Makefile
6
Makefile
|
@ -1,6 +1,7 @@
|
||||||
|
|
||||||
include Makefile.common
|
include Makefile.common
|
||||||
|
|
||||||
|
all: snappy
|
||||||
|
|
||||||
SNAPPY_ARCHIVE:=$(TARGET)/snappy-$(VERSION).tar.gz
|
SNAPPY_ARCHIVE:=$(TARGET)/snappy-$(VERSION).tar.gz
|
||||||
|
|
||||||
|
@ -36,3 +37,8 @@ $(SNAPPY_OUT)/%.o : $(SRC)/org/xerial/snappy/SnappyNative.cpp
|
||||||
$(SNAPPY_OUT)/$(LIBNAME): $(SNAPPY_OBJ)
|
$(SNAPPY_OUT)/$(LIBNAME): $(SNAPPY_OBJ)
|
||||||
$(CXX) $(CXXFLAGS) $(LINKFLAGS) -o $@ $*
|
$(CXX) $(CXXFLAGS) $(LINKFLAGS) -o $@ $*
|
||||||
$(STRIP) $@
|
$(STRIP) $@
|
||||||
|
|
||||||
|
clean-native:
|
||||||
|
rm -rf $(SNAPPY_OBJ) $(SNAPPY_OUT)/$(LIBNAME)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -50,50 +50,52 @@ endif
|
||||||
|
|
||||||
Default_CXX := g++
|
Default_CXX := g++
|
||||||
Default_STRIP := strip
|
Default_STRIP := strip
|
||||||
Default_CXXFLAGS := -I$(JAVA_HOME)/include -Ilib/inc_mac -Os -fPIC
|
Default_CXXFLAGS := -I$(JAVA_HOME)/include -Ilib/inc_mac -O2 -fPIC
|
||||||
Default_LINKFLAGS := -shared
|
Default_LINKFLAGS := -shared -static-libgcc
|
||||||
Default_LIBNAME := libsnappy.so
|
Default_LIBNAME := libsnappy.so
|
||||||
Default_SNAPPY_FLAGS :=
|
Default_SNAPPY_FLAGS :=
|
||||||
|
|
||||||
Linux-i386_CXX := g++
|
Linux-i386_CXX := g++
|
||||||
Linux-i386_STRIP := strip
|
Linux-i386_STRIP := strip
|
||||||
Linux-i386_CXXFLAGS := -I$(JAVA_HOME)/include -Ilib/inc_mac -Os -fPIC
|
Linux-i386_CXXFLAGS := -I$(JAVA_HOME)/include -Ilib/inc_mac -O2 -fPIC
|
||||||
Linux-i386_LINKFLAGS := -shared
|
Linux-i386_LINKFLAGS := -shared -static-libgcc
|
||||||
Linux-i386_LIBNAME := libsnappy.so
|
Linux-i386_LIBNAME := libsnappy.so
|
||||||
Linux-i386_SNAPPY_FLAGS:=
|
Linux-i386_SNAPPY_FLAGS:=
|
||||||
|
|
||||||
Linux-amd64_CXX := g++
|
Linux-amd64_CXX := g++
|
||||||
Linux-amd64_STRIP := strip
|
Linux-amd64_STRIP := strip
|
||||||
Linux-amd64_CXXFLAGS := -I$(JAVA_HOME)/include -Ilib/inc_mac -Os -fPIC
|
Linux-amd64_CXXFLAGS := -I$(JAVA_HOME)/include -Ilib/inc_mac -O2 -fPIC
|
||||||
Linux-amd64_LINKFLAGS := -shared
|
Linux-amd64_LINKFLAGS := -shared -static-libgcc
|
||||||
Linux-amd64_LIBNAME := libsnappy.so
|
Linux-amd64_LIBNAME := libsnappy.so
|
||||||
Linux-amd64_SNAPPY_FLAGS :=
|
Linux-amd64_SNAPPY_FLAGS :=
|
||||||
|
|
||||||
Mac-i386_CXX := g++ -arch $(OS_ARCH)
|
Mac-i386_CXX := g++ -arch $(OS_ARCH)
|
||||||
Mac-i386_STRIP := strip -x
|
Mac-i386_STRIP := strip -x
|
||||||
Mac-i386_CXXFLAGS := -I$(JAVA_HOME)/include -Os -fPIC
|
Mac-i386_CXXFLAGS := -I$(JAVA_HOME)/include -O2 -fPIC
|
||||||
Mac-i386_LINKFLAGS := -dynamiclib
|
Mac-i386_LINKFLAGS := -dynamiclib -static-libgcc
|
||||||
Mac-i386_LIBNAME := libsnappy.jnilib
|
Mac-i386_LIBNAME := libsnappy.jnilib
|
||||||
Mac-i386_SNAPPY_FLAGS :=
|
Mac-i386_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_STRIP := strip -x
|
||||||
Mac-x86_64_CXXFLAGS := -I$(JAVA_HOME)/include -Os -fPIC
|
Mac-x86_64_CXXFLAGS := -I$(JAVA_HOME)/include -O2 -fPIC
|
||||||
Mac-x86_64_LINKFLAGS := -dynamiclib
|
Mac-x86_64_LINKFLAGS := -dynamiclib -static-libgcc
|
||||||
Mac-x86_64_LIBNAME := libsnappy.jnilib
|
Mac-x86_64_LIBNAME := libsnappy.jnilib
|
||||||
Mac-x86_64_SNAPPY_FLAGS :=
|
Mac-x86_64_SNAPPY_FLAGS :=
|
||||||
|
|
||||||
Windows-x86_CXX := mingw32-g++
|
Windows-x86_CXX := mingw32-g++
|
||||||
Windows-x86_STRIP := strip
|
Windows-x86_STRIP := strip
|
||||||
Windows-x86_CXXFLAGS := -Ilib/inc_win -O
|
Windows-x86_CXXFLAGS := -Ilib/inc_win -O2
|
||||||
Windows-x86_LINKFLAGS := -Wl,--kill-at -shared
|
Windows-x86_LINKFLAGS := -Wl,--kill-at -shared -static-libgcc
|
||||||
Windows-x86_LIBNAME := snappy.dll
|
Windows-x86_LIBNAME := snappy.dll
|
||||||
Windows-x86_SNAPPY_FLAGS :=
|
Windows-x86_SNAPPY_FLAGS :=
|
||||||
|
|
||||||
Windows-amd64_CXX := x86_64-w64-mingw32-g++
|
Windows-amd64_CXX := x86_64-w64-mingw32-g++
|
||||||
Windows-amd64_STRIP := x86_64-w64-mingw32-strip
|
Windows-amd64_STRIP := x86_64-w64-mingw32-strip
|
||||||
Windows-amd64_CXXFLAGS := -Ilib/inc_win -O
|
#Windows-amd64_CXX := g++
|
||||||
Windows-amd64_LINKFLAGS := -Wl,--kill-at -shared
|
#Windows-amd64_STRIP := strip
|
||||||
|
Windows-amd64_CXXFLAGS := -Ilib/inc_win -O2
|
||||||
|
Windows-amd64_LINKFLAGS := -Wl,--kill-at -shared -static-libgcc
|
||||||
Windows-amd64_LIBNAME := snappy.dll
|
Windows-amd64_LIBNAME := snappy.dll
|
||||||
Windows-amd64_SNAPPY_FLAGS :=
|
Windows-amd64_SNAPPY_FLAGS :=
|
||||||
|
|
||||||
|
@ -105,9 +107,9 @@ LINKFLAGS := $($(os_arch)_LINKFLAGS)
|
||||||
LIBNAME := $($(os_arch)_LIBNAME)
|
LIBNAME := $($(os_arch)_LIBNAME)
|
||||||
SNAPPY_FLAGS := $($(os_arch)_SNAPPY_FLAGS)
|
SNAPPY_FLAGS := $($(os_arch)_SNAPPY_FLAGS)
|
||||||
|
|
||||||
SNAPPY_OUT:=$(TARGET)/$(snappy)/$(os_arch)
|
SNAPPY_OUT:=$(TARGET)/$(snappy)-$(os_arch)
|
||||||
|
|
||||||
CXXFLAGS := $(CXXFLAGS) -I$(SNAPPY_OUT) -I$(SNAPPY_SRC)
|
CXXFLAGS := $(CXXFLAGS) -I$(SNAPPY_OUT) -I$(SNAPPY_SRC)
|
||||||
ifneq ($(jni_include),)
|
ifneq ($(jni_include),)
|
||||||
CXXFLAGS := $(CXXFLAGS) -I"$(jni_include)"
|
CXXFLAGS := $(CXXFLAGS) -I"$(jni_include)"
|
||||||
endif
|
endif
|
||||||
|
|
|
@ -5,4 +5,6 @@ mingwin compile
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-static-libgcc
|
|
||||||
|
make snappy CXX=/cygdrive/c/MinGW/bin/g++
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue