8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-22 16:43:03 +01:00

Android build - work in progress

This commit is contained in:
AlexPeshkoff 2018-02-07 20:16:57 +03:00
parent c70cc39b62
commit 854e1f5208
4 changed files with 35 additions and 12 deletions

View File

@ -35,12 +35,18 @@
ROOT=$(shell cd ..; pwd)
ifeq ($(CROSS_OUT), Y)
export CROSS:=CrossBuild
endif
include make.defaults
ifeq ($(CROSS_OUT), Y)
include make.crossPlatform
else
include make.platform
endif
include make.rules
include make.shared.variables
@ -185,7 +191,11 @@ $(TOMMATH_LIB): $(TOM_Objs)
.PHONY: tomcrypt
TOMCRYPT_LIB=$(LIB)/libtomcrypt.a
TOM_Objs=$(addprefix ../extern/libtomcrypt/,$(call doObjects,$(call dirFiles,../extern/libtomcrypt)))
TOM_Src:=hashes\md5.c hashes\sha1.c hashes\sha2\sha256.c hashes\sha2\sha512.c misc\crypt\crypt_argchk.c
TOM_Src:=$(addprefix ../extern/libtomcrypt/src, $(TOM_Src))
TOM_Objs=$(addprefix ../extern/libtomcrypt/,$(call doObjects,$(TOM_Src)))
tomcrypt: $(TOMCRYPT_LIB)
@ -264,6 +274,8 @@ cross2:
$(MAKE) prerequisites
$(MAKE) tommath
$(MAKE) tomcrypt
$(MAKE) -C $(ROOT)/extern/decNumber
ln -sf $(ROOT)/extern/decNumber/libdecFloat$(CROSS).a $(LIB)
$(MAKE) yvalve
$(MAKE) engine
$(MAKE) fbintl

View File

@ -20,7 +20,10 @@ HOST_TAG64:=linux-x86
endif
NDK_TOOLCHAIN_VERSION:=$(shell echo $(TOOLCHAIN_DIR) | awk -F - '{print $$NF;}')
CROSS_PLATFORM:=$(NDK)/platforms/android-24/arch-arm
CROSS_PLATFORM:=$(NDK)/platforms
ALEVEL:=$(shell for i in `seq 256`; do [ -d $(CROSS_PLATFORM)/android-$${i} ] && adir=$${i}; done; echo $${adir})
CROSS_PLATFORM:=$(CROSS_PLATFORM)/android-$(ALEVEL)/arch-arm
CROSS_PREFIX:=$(NDK)/toolchains/$(TOOLCHAIN_DIR)/prebuilt/$(HOST_TAG64)/bin/arm-linux-androideabi-
CXX:=$(CROSS_PREFIX)g++
@ -34,12 +37,20 @@ OBJDUMP:=$(CROSS_PREFIX)objdump
RANLIB:=$(CROSS_PREFIX)ranlib
STRIP:=$(CROSS_PREFIX)strip
COMMON_FLAGS=-ggdb -DFB_SEND_FLAGS=MSG_NOSIGNAL -DLINUX -DANDROID -DARM -pipe -MMD -fPIC -fmessage-length=0 \
-I$(ROOT)/extern/libtommath --sysroot=$(CROSS_PLATFORM) \
-I$(CROSS_PLATFORM)/usr/include -I$(ROOT)/gen/cross \
-I$(NDK)/sources/cxx-stl/gnu-libstdc++/$(NDK_TOOLCHAIN_VERSION)/include \
-I$(NDK)/sources/cxx-stl/gnu-libstdc++/$(NDK_TOOLCHAIN_VERSION)/libs/armeabi/include
export CXX
export CC
export AR
CROSS_FLAGS=--sysroot=$(CROSS_PLATFORM) \
-I$(CROSS_PLATFORM)/usr/include -I$(ROOT)/gen/cross \
-I$(NDK)/sources/cxx-stl/gnu-libstdc++/$(NDK_TOOLCHAIN_VERSION)/include \
-I$(NDK)/sources/cxx-stl/gnu-libstdc++/$(NDK_TOOLCHAIN_VERSION)/libs/armeabi/include
export CROSS_FLAGS
COMMON_FLAGS=-ggdb -DFB_SEND_FLAGS=MSG_NOSIGNAL -DLINUX -DANDROID -DARM -pipe -MMD -fPIC -fmessage-length=0 \
-I$(ROOT)/extern/libtommath -I$(ROOT)/extern/libtomcrypt/src/headers \
$(CROSS_FLAGS)
OPTIMIZE_FLAGS=-fno-omit-frame-pointer
WARN_FLAGS=-Wall -Wno-switch -Wno-parentheses -Wno-unknown-pragmas -Wno-unused-variable
@ -53,7 +64,7 @@ CROSS_CONFIG=android.arme
LDFLAGS += --sysroot=$(CROSS_PLATFORM) -L$(NDK)/sources/cxx-stl/gnu-libstdc++/$(NDK_TOOLCHAIN_VERSION)/libs/armeabi \
-L$(NDK)/sources/cxx-stl/gnu-libstdc++/libs/armeabi
DroidLibs := -lm -ldl -lsupc++
DroidLibs := -lm -ldl -lsupc++ $(DECLIB)
LINK_LIBS = $(DroidLibs)
SO_LINK_LIBS = $(DroidLibs)

View File

@ -133,7 +133,7 @@ CAS_OPTIONS=@CAS_OPTIONS@
# multiple-precision integer library
MATHLIB=@MATHLIB@
DECLIB=-ldecFloat
DECLIB=-ldecFloat$(CROSS)
# crypt library
CRYPTLIB=@CRYPTLIB@

View File

@ -1,11 +1,11 @@
LIBRARY=libdecFloat.a
LIBRARY=libdecFloat$(CROSS).a
$(LIBRARY): $(wildcard *.c) $(wildcard *.h) Makefile
$(RM) -f *.o
$(CC) -c -O3 -fPIC $(subst decCommon.c,,$(subst decBasic.c,,$(wildcard *.c)))
$(CC) $(CROSS_FLAGS) -c -O3 -fPIC $(subst decCommon.c,,$(subst decBasic.c,,$(wildcard *.c)))
$(AR) crs $(LIBRARY) *.o
$(RM) -f *.o
.PHONY: clean
clean:
$(RM) -f *.o $(LIBRARY)
$(RM) -f *.o *.a