From: <ale...@us...> - 2015-01-27 10:46:56
|
Revision: 60571 http://sourceforge.net/p/firebird/code/60571 Author: alexpeshkoff Date: 2015-01-27 10:46:48 +0000 (Tue, 27 Jan 2015) Log Message: ----------- Work in progress on CORE-3885: Firebird for Android, build is complete Modified Paths: -------------- firebird/trunk/builds/posix/Makefile.in firebird/trunk/builds/posix/Makefile.in.plugins_examples firebird/trunk/builds/posix/make.android.arme firebird/trunk/builds/posix/make.defaults firebird/trunk/builds/posix/make.rules firebird/trunk/configure.ac firebird/trunk/src/common/ThreadStart.cpp firebird/trunk/src/common/ThreadStart.h firebird/trunk/src/common/classes/init.cpp firebird/trunk/src/include/cross/android.arme firebird/trunk/src/remote/server/os/posix/inet_server.cpp Modified: firebird/trunk/builds/posix/Makefile.in =================================================================== --- firebird/trunk/builds/posix/Makefile.in 2015-01-27 10:33:10 UTC (rev 60570) +++ firebird/trunk/builds/posix/Makefile.in 2015-01-27 10:46:48 UTC (rev 60571) @@ -130,7 +130,7 @@ # main build target for both debug abd release builds # -.PHONY: cross1 cross2 boot yvalve engine fbintl gpre utilities plugins rest codes ids examples +.PHONY: cross1 cross2 boot yvalve engine fbintl gpre utilities plugins rest codes ids examples cross_rest master_process: ln -sf $(SRC_ROOT)/include/gen/autoconfig.auto $(SRC_ROOT)/include/gen/autoconfig.h @@ -187,13 +187,22 @@ # even if gpre itself was not rebuilt -$(RM) $(GPRE_CURRENT) (cd $(BIN); $(LN) $(notdir $(RUN_GPRE)) $(notdir $(GPRE_CURRENT))) + $(MAKE) include_generic + $(MAKE) -f Makefile.examples -C $(GEN_ROOT)/examples/ cross2: ln -sf $(SRC_ROOT)/include/cross/$(CROSS_CONFIG) $(SRC_ROOT)/include/gen/autoconfig.h + $(MAKE) prerequisites $(MAKE) tommath $(MAKE) yvalve + $(MAKE) engine + $(MAKE) fbintl + $(MAKE) utilities + $(MAKE) $(GPRE) + $(MAKE) plugins + $(MAKE) -f Makefile.plugins_examples -C $(GEN_ROOT)/examples/ + $(MAKE) cross_rest - #___________________________________________________________________________ # static library - various common code, used in different FB projects # @@ -493,10 +502,17 @@ # all the rest we need to build # -.PHONY: qli message_file +.PHONY: qli message_file gbak_files +FDB_FILES := $(HELP_FDB) $(ROOT)/gen/msg.fdb $(SECURITY_FDB) $(FIREBIRD)/examples/empbuild/employee.fdb +GBAK_FILES := $(FDB_FILES:.fdb=.gbak) $(FIREBIRD)/msg.gbak +GBAK_FILES := $(subst Native,$(TARGET),$(GBAK_FILES)) + rest: qli message_file +cross_rest: qli gbak_files + $(MAKE) $(BUILD_FILE) + qli: $(QLI) $(QLI): $(QLI_Objects) $(COMMON_LIB) @@ -508,14 +524,18 @@ message_file: $(FIREBIRD_MSG) -$(FIREBIRD_MSG): $(RUN_BUILD_FILE) msg.timestamp - $(RUN_BUILD_FILE) -d msg.fdb -f $@ +$(FIREBIRD_MSG): $(BUILD_FILE) msg.timestamp + $(BUILD_FILE) -d msg.fdb -f $@ $(CHMOD_6) $@ $(BUILD_FILE): $(BUILD_Objects) $(COMMON_LIB) $(EXE_LINK) $(EXE_LINK_OPTIONS) $^ -o $@ $(FIREBIRD_LIBRARY_LINK) $(LINK_LIBS) +gbak_files: $(GBAK_FILES) +$(GEN_ROOT)/$(TARGET)/firebird/msg.gbak: $(ROOT)/gen/msg.gbak + cp $^ $@ + #--------------------------------------------------------------------------- # This target builds the include files for distribution with the release Modified: firebird/trunk/builds/posix/Makefile.in.plugins_examples =================================================================== --- firebird/trunk/builds/posix/Makefile.in.plugins_examples 2015-01-27 10:33:10 UTC (rev 60570) +++ firebird/trunk/builds/posix/Makefile.in.plugins_examples 2015-01-27 10:46:48 UTC (rev 60571) @@ -39,7 +39,11 @@ CPPFLAGS+= -I$(FB_BUILD)/include include $(ROOT)/gen/make.defaults +ifeq ($(CROSS_OUT), Y) +include $(ROOT)/gen/make.crossPlatform +else include $(ROOT)/gen/make.platform +endif include $(ROOT)/gen/make.rules include $(ROOT)/gen/make.shared.variables Modified: firebird/trunk/builds/posix/make.android.arme =================================================================== --- firebird/trunk/builds/posix/make.android.arme 2015-01-27 10:33:10 UTC (rev 60570) +++ firebird/trunk/builds/posix/make.android.arme 2015-01-27 10:46:48 UTC (rev 60571) @@ -3,16 +3,24 @@ $(error Must export NDK location before building for Android) endif NDK_ROOT:=$(NDK) -NDK_LOG:=1 +#NDK_LOG:=1 include $(NDK)/build/core/init.mk + TOOLCHAIN_DIR:=$(foreach chain, $(NDK_ALL_TOOLCHAINS), $(if $(findstring arm, $(chain)), $(chain), )) -TOOLCHAIN_DIR:=$(strip $(TOOLCHAIN_DIR)) +# Filter out clang +TEMP_LIST_DIR := $(foreach chain, $(TOOLCHAIN_DIR), $(if $(findstring clang, $(chain)), , $(chain))) +ifdef TEMP_LIST_DIR + TOOLCHAIN_DIR := $(TEMP_LIST_DIR) +endif +# use freshmost compiler +TOOLCHAIN_DIR:=$(lastword $(TOOLCHAIN_DIR)) + ifeq ($(HOST_TAG64),) HOST_TAG64:=linux-x86 endif NDK_TOOLCHAIN_VERSION:=$(shell echo $(TOOLCHAIN_DIR) | awk -F - '{print $$NF;}') -CROSS_PLATFORM:=$(NDK)/platforms/android-9/arch-arm +CROSS_PLATFORM:=$(NDK)/platforms/android-14/arch-arm CROSS_PREFIX:=$(NDK)/toolchains/$(TOOLCHAIN_DIR)/prebuilt/$(HOST_TAG64)/bin/arm-linux-androideabi- CXX:=$(CROSS_PREFIX)g++ @@ -28,8 +36,9 @@ 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/usr/include -OPTIMIZE_FLAGS=-O0 -fno-omit-frame-pointer # optimizing cause bugs... - i.e. -O0 + -I$(CROSS_PLATFORM)/usr/include -I$(ROOT)/gen/cross + +OPTIMIZE_FLAGS=-fno-omit-frame-pointer WARN_FLAGS=-Wall -Wno-switch -Wno-parentheses -Wno-unknown-pragmas -Wno-unused-variable PROD_FLAGS=$(COMMON_FLAGS) $(OPTIMIZE_FLAGS) @@ -47,3 +56,19 @@ EXE_LINK_OPTIONS= $(LDFLAGS) $(UNDEF_FLAGS) $(LIB_PATH_OPTS) $(LINK_EMPTY_SYMBOLS) LIB_LINK_OPTIONS= $(LDFLAGS) -shared + +UNICODE_DIR := $(shell dirname `find /usr/include -name ucnv.h`) +UNICODE_DIR := $(filter %unicode, $(UNICODE_DIR)) +UNICODE_DIR := $(firstword $(UNICODE_DIR)) +ifndef UNICODE_DIR + $(error ERROR while locating ICU include directory, probably missing ucnv.h) +endif + +.PHONY: prerequisites +prerequisites: $(ROOT)/gen/cross/unicode + +$(ROOT)/gen/cross/unicode: + echo $(UNICODE_DIR) + rm -rf $(ROOT)/gen/cross + mkdir $(ROOT)/gen/cross + ln -s $(UNICODE_DIR) cross/unicode Modified: firebird/trunk/builds/posix/make.defaults =================================================================== --- firebird/trunk/builds/posix/make.defaults 2015-01-27 10:33:10 UTC (rev 60570) +++ firebird/trunk/builds/posix/make.defaults 2015-01-27 10:46:48 UTC (rev 60571) @@ -297,8 +297,8 @@ # Per-library link rules LINK_UDF = $(LIB_LINK) $(LIB_LINK_OPTIONS) $(call LIB_LINK_SONAME,$(1).$(SHRLIB_EXT)) $(UNDEF_FLAGS)\ - $(call LIB_LINK_RPATH,lib) $(SO_LINK_LIBS) -LINK_UDF_LIBS = $(THR_LIBS) -L$(LIB) -lib_util + $(call LIB_LINK_RPATH,lib) +LINK_UDF_LIBS = $(THR_LIBS) -L$(LIB) -lib_util $(SO_LINK_LIBS) LINK_IB_UTIL = $(LIB_LINK) $(LINK_IBUTIL_SYMBOLS) $(LIB_LINK_OPTIONS) $(UNDEF_FLAGS)\ $(call LIB_LINK_SONAME,$(IbUtilLibraryName)) $(call LIB_LINK_RPATH,lib) @@ -375,7 +375,6 @@ # From msgs CHECK_MESSAGES = $(BIN)/check_messages$(EXEC_EXT) BUILD_FILE = $(BIN)/build_file$(EXEC_EXT) -RUN_BUILD_FILE = $(RBIN)/build_file$(EXEC_EXT) FIREBIRD_MSG = $(FIREBIRD)/firebird.msg ENTER_MESSAGES = $(BIN)/enter_messages$(EXEC_EXT) Modified: firebird/trunk/builds/posix/make.rules =================================================================== --- firebird/trunk/builds/posix/make.rules 2015-01-27 10:33:10 UTC (rev 60570) +++ firebird/trunk/builds/posix/make.rules 2015-01-27 10:46:48 UTC (rev 60571) @@ -104,3 +104,13 @@ $(GEN_ROOT)/%.res: $(SRC_ROOT)/%.rc windres --output-format=coff --include-dir=$(<D) $< $@ + +# Rule for making gbak files when cross-compiling + +.SUFFIXES: .gbak .fdb + +$(GEN_ROOT)/$(TARGET)/%.gbak: $(GEN_ROOT)/Native/%.fdb + $(RUN_GBAK) -b $(firstword $<) $(firstword $@) + +$(GEN_ROOT)/%.gbak: $(GEN_ROOT)/%.fdb + $(RUN_GBAK) -b $(firstword $<) $(firstword $@) Modified: firebird/trunk/configure.ac =================================================================== --- firebird/trunk/configure.ac 2015-01-27 10:33:10 UTC (rev 60570) +++ firebird/trunk/configure.ac 2015-01-27 10:46:48 UTC (rev 60571) @@ -706,6 +706,7 @@ AC_CHECK_HEADERS(sys/ioctl.h) AC_CHECK_HEADERS(sys/select.h) AC_CHECK_HEADERS(sys/syscall.h) +AC_CHECK_HEADERS(sys/signal.h) AC_CHECK_HEADERS(limits.h) AC_CHECK_HEADERS(setjmp.h) AC_CHECK_HEADERS(stdarg.h) Modified: firebird/trunk/src/common/ThreadStart.cpp =================================================================== --- firebird/trunk/src/common/ThreadStart.cpp 2015-01-27 10:33:10 UTC (rev 60570) +++ firebird/trunk/src/common/ThreadStart.cpp 2015-01-27 10:46:48 UTC (rev 60571) @@ -200,7 +200,7 @@ ThreadId Thread::getId() { -#ifdef LINUX +#if defined(LINUX) && !defined(ANDROID) return syscall(SYS_gettid); #else return pthread_self(); Modified: firebird/trunk/src/common/ThreadStart.h =================================================================== --- firebird/trunk/src/common/ThreadStart.h 2015-01-27 10:33:10 UTC (rev 60570) +++ firebird/trunk/src/common/ThreadStart.h 2015-01-27 10:46:48 UTC (rev 60571) @@ -56,7 +56,7 @@ #if defined(WIN_NT) typedef DWORD ThreadId; -#elif defined(LINUX) +#elif defined(LINUX) && !defined(ANDROID) typedef int ThreadId; #elif defined(USE_POSIX_THREADS) typedef pthread_t ThreadId; Modified: firebird/trunk/src/common/classes/init.cpp =================================================================== --- firebird/trunk/src/common/classes/init.cpp 2015-01-27 10:33:10 UTC (rev 60570) +++ firebird/trunk/src/common/classes/init.cpp 2015-01-27 10:46:48 UTC (rev 60571) @@ -56,7 +56,7 @@ // This helps initialize globals, needed before regular ctors run int initDone = 0; -#ifndef WIN_NT +#ifdef HAVE_PTHREAD_ATFORK void child(void) { // turn off dtors execution in forked process @@ -132,7 +132,7 @@ #endif //DEBUG_INIT initDone = 1; -#ifndef WIN_NT +#ifdef HAVE_PTHREAD_ATFORK int ret = pthread_atfork(NULL, NULL, child); #endif Modified: firebird/trunk/src/include/cross/android.arme =================================================================== --- firebird/trunk/src/include/cross/android.arme 2015-01-27 10:33:10 UTC (rev 60570) +++ firebird/trunk/src/include/cross/android.arme 2015-01-27 10:46:48 UTC (rev 60571) @@ -125,7 +125,7 @@ /* #undef GPRE_PASCAL */ /* Define to 1 if you have the <aio.h> header file. */ -#define HAVE_AIO_H 1 +/* #undef HAVE_AIO_H */ /* Define this if AO_compare_and_swap_full() is defined in atomic_ops.h */ /* #undef HAVE_AO_COMPARE_AND_SWAP_FULL */ @@ -162,7 +162,7 @@ #define HAVE_DLFCN_H 1 /* Define this if editline is in use */ -#define HAVE_EDITLINE_H 1 +/* #undef HAVE_EDITLINE_H */ /* Define to 1 if you have the <errno.h> header file. */ #define HAVE_ERRNO_H 1 @@ -291,7 +291,7 @@ #define HAVE_POLL_H 1 /* Define this if posix_fadvise() is present on the platform */ -#define HAVE_POSIX_FADVISE 1 +/* #undef HAVE_POSIX_FADVISE */ /* Define to 1 if you have the `pread' function. */ #define HAVE_PREAD 1 @@ -369,7 +369,7 @@ #define HAVE_SIGNAL_H 1 /* Define to 1 if you have the `sigset' function. */ -#define HAVE_SIGSET 1 +/* #undef HAVE_SIGSET */ /* Define to 1 if you have the `snprintf' function. */ #define HAVE_SNPRINTF 1 @@ -587,6 +587,9 @@ /* Architecture is big-edian sh4 */ /* #undef SHEB */ +/* Extension for shared libraries */ +#define SHRLIB_EXT "so" + /* The size of `long', as computed by sizeof. */ #define SIZEOF_LONG 4 Modified: firebird/trunk/src/remote/server/os/posix/inet_server.cpp =================================================================== --- firebird/trunk/src/remote/server/os/posix/inet_server.cpp 2015-01-27 10:33:10 UTC (rev 60570) +++ firebird/trunk/src/remote/server/os/posix/inet_server.cpp 2015-01-27 10:46:48 UTC (rev 60571) @@ -92,13 +92,11 @@ #include "../auth/trusted/AuthSspi.h" #include "../auth/SecureRemotePassword/server/SrpServer.h" -#ifdef UNIX -#ifdef NETBSD +#ifdef HAVE_SYS_SIGNAL_H +#include <sys/signal.h> +#else #include <signal.h> -#else -#include <sys/signal.h> #endif -#endif #ifdef HAVE_SYS_RESOURCE_H #include <sys/resource.h> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |