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

Flat Android tree.

This commit is contained in:
Adriano dos Santos Fernandes 2023-02-04 13:55:06 -03:00
parent 56da7b245b
commit 14507af30d
18 changed files with 188 additions and 66 deletions

View File

@ -18,9 +18,9 @@ runAndCheckExit() {
fi
}
runAndCheckExit "Build messages file (firebird.msg)" "bin/build_file -f firebird.msg"
runAndCheckExit "Creating security database" "echo create database \'security5.fdb\'^ | bin/isql -q -term ^"
runAndCheckExit "Creating security database metadata" "bin/isql -q security5.fdb -i security.sql"
runAndCheckExit "Restore examples database (employee)" "(cd examples/empbuild ; ../../bin/isql -q -i ../../employe2.sql)"
runAndCheckExit "Build messages file (firebird.msg)" "./build_file -f firebird.msg"
runAndCheckExit "Creating security database" "echo create database \'security5.fdb\'^ | ./isql -q -term ^"
runAndCheckExit "Creating security database metadata" "./isql -q security5.fdb -i security.sql"
#runAndCheckExit "Restore examples database (employee)" "(cd examples/empbuild ; ../.././isql -q -i ../../employe2.sql)"
rm -f security.sql employe2.sql bin/build_file AfterUntar.sh
rm -f security.sql employe2.sql ./build_file AfterUntar.sh

View File

@ -36,26 +36,27 @@ AndroidDeviceName=emulator-$AndroidDevicePort
AndroidDir=/data/$InitialBaseName
mkdir -p gen/Release
(cd gen; gunzip -k $InitialDebugTarGz)
(cd gen; gunzip --force -k $InitialDebugTarGz)
(cd gen/Release; tar xvzf ../$InitialDebugTarGz)
$ANDROID_HOME/platform-tools/adb -s $AndroidDeviceName shell "rm -rf $AndroidDir"
$ANDROID_HOME/platform-tools/adb -s $AndroidDeviceName shell "mkdir $AndroidDir"
$ANDROID_HOME/platform-tools/adb -s $AndroidDeviceName push gen/$InitialDebugTar $AndroidDir/
$ANDROID_HOME/platform-tools/adb -s $AndroidDeviceName shell "(cd $AndroidDir && tar xvf $InitialDebugTar)"
$ANDROID_HOME/platform-tools/adb -s $AndroidDeviceName shell "(cd $AndroidDir/firebird/tests && ./common_test --log_level=all && ./libEngine13_test --log_level=all)"
$ANDROID_HOME/platform-tools/adb -s $AndroidDeviceName shell "(cd $AndroidDir/firebird && ./common_test --log_level=all && ./libEngine13_test --log_level=all)"
$ANDROID_HOME/platform-tools/adb -s $AndroidDeviceName shell "(cd $AndroidDir/firebird && ./AfterUntar.sh)"
$ANDROID_HOME/platform-tools/adb -s $AndroidDeviceName pull $AndroidDir/firebird/firebird.msg gen/Release/firebird/
$ANDROID_HOME/platform-tools/adb -s $AndroidDeviceName pull $AndroidDir/firebird/security5.fdb gen/Release/firebird/
$ANDROID_HOME/platform-tools/adb -s $AndroidDeviceName pull $AndroidDir/firebird/examples/empbuild/employe2.fdb gen/Release/firebird/examples/empbuild/
#$ANDROID_HOME/platform-tools/adb -s $AndroidDeviceName pull $AndroidDir/firebird/examples/empbuild/employe2.fdb gen/Release/firebird/examples/empbuild/
$ANDROID_HOME/platform-tools/adb -s $AndroidDeviceName shell "(rm -rf $AndroidDir)"
rm gen/$InitialDebugTar
cd gen/Release
rm -rf ${Stripped}
rm -f firebird/{security.sql,employe2.sql,bin/build_file,AfterUntar.sh}
TAR_OPTS="$TAR_OPTS --exclude *_test --exclude security.sql --exclude employe2.sql --exclude build_file --exclude AfterUntar.sh"
tar $TAR_OPTS --exclude tests -czvf ../$FinalDebug firebird
tar $TAR_OPTS -czvf ../$FinalDebug firebird
mkdir ${Stripped}
tar cf - firebird | (cd ${Stripped}; tar xvf -)
@ -68,4 +69,4 @@ do
${aStrip} ${file}
done
tar $TAR_OPTS --exclude tests -czvf ../../$FinalRelease firebird
tar $TAR_OPTS -czvf ../../$FinalRelease firebird

View File

@ -22,8 +22,8 @@ cp ${fbRootDir}/builds/install/arch-specific/android/AfterUntar.sh firebird
chmod +x firebird/AfterUntar.sh
cp ${fbRootDir}/src/dbs/security.sql firebird
cp ${fbRootDir}/examples/empbuild/employe2.sql firebird
tar -C firebird/lib --wildcards -xvf ../../extern/icu/icu_android.tar.xz icudt*.dat
tar -C firebird/lib --wildcards --strip-components 1 -xvf ../../extern/icu/icu_android.tar.xz ${arch}/*
tar -C firebird --wildcards -xvf ../../extern/icu/icu_android.tar.xz icudt*.dat
tar -C firebird --wildcards --strip-components 1 -xvf ../../extern/icu/icu_android.tar.xz ${arch}/*
echo .
echo .
echo "Compress with deb-info"

View File

@ -612,7 +612,7 @@ SRP_USER_MANAGER = $(call makePluginName,Srp)
FBTRACE = $(call makePluginName,fbtrace)
AUTH_DEBUGGER = $(call makePluginName,Auth_Debug)
UDF_BACKWARD_COMPATIBILITY_BASENAME = $(LIB_PREFIX)udf_compat.$(SHRLIB_EXT)
UDF_BACKWARD_COMPATIBILITY = $(PLUGINS)/udr/$(UDF_BACKWARD_COMPATIBILITY_BASENAME)
UDF_BACKWARD_COMPATIBILITY ?= $(call buildSubDirectory,plugins/udr)/$(UDF_BACKWARD_COMPATIBILITY_BASENAME)
CHACHA = $(call makePluginName,ChaCha)
PROFILER = $(call makePluginName,Default_Profiler)
@ -707,11 +707,11 @@ $(FIREBIRD_MSG) $(FIREBIRD)/include/firebird/impl/iberror_c.h: $(BUILD_FILE)
$(BUILD_FILE) -f $(FIREBIRD_MSG) -c $(FIREBIRD)/include/firebird/impl/iberror_c.h
$(CHMOD_6) $(FIREBIRD_MSG)
tzdata: $(FB_BUILD)/tzdata
tzdata: $(TZDATA)/ids.dat
$(FB_BUILD)/tzdata: $(ROOT)/extern/icu/tzdata/$(TZDATA_ZIP)
mkdir -p $(FB_BUILD)/tzdata
unzip -o $(ROOT)/extern/icu/tzdata/$(TZDATA_ZIP) -d $(FB_BUILD)/tzdata
$(TZDATA)/ids.dat: $(ROOT)/extern/icu/tzdata/$(TZDATA_ZIP)
unzip -o $(ROOT)/extern/icu/tzdata/$(TZDATA_ZIP) -d $(TZDATA)
touch $(TZDATA)/ids.dat
$(BUILD_FILE): $(BUILD_Objects)
$(EXE_LINK) $(EXE_LINK_OPTIONS) $(LSB_UNDEF) $^ -o $@

View File

@ -27,6 +27,12 @@ export CC
export AR
export CROSS_FLAGS
# Android uses flat tree.
buildSubDirectory=$(FB_BUILD)
LIB_PLATFORM_RPATH=-Wl,-rpath,\$$ORIGIN
LibraryFullName=$(LibraryBaseName)
LibrarySoName=$(LibraryBaseName)
COMMON_FLAGS=-ggdb -DFB_SEND_FLAGS=MSG_NOSIGNAL -DLINUX -DANDROID -DARM64 -pipe -MMD -fPIC -fmessage-length=0 \
-I$(ROOT)/extern/libtommath -I$(ROOT)/extern/libtomcrypt/src/headers \
$(CROSS_FLAGS) -fsigned-char \

View File

@ -27,6 +27,12 @@ export CC
export AR
export CROSS_FLAGS
# Android uses flat tree.
buildSubDirectory=$(FB_BUILD)
LIB_PLATFORM_RPATH=-Wl,-rpath,\$$ORIGIN
LibraryFullName=$(LibraryBaseName)
LibrarySoName=$(LibraryBaseName)
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) -fsigned-char \

View File

@ -27,6 +27,12 @@ export CC
export AR
export CROSS_FLAGS
# Android uses flat tree.
buildSubDirectory=$(FB_BUILD)
LIB_PLATFORM_RPATH=-Wl,-rpath,\$$ORIGIN
LibraryFullName=$(LibraryBaseName)
LibrarySoName=$(LibraryBaseName)
COMMON_FLAGS=-ggdb -DFB_SEND_FLAGS=MSG_NOSIGNAL -DLINUX -DANDROID -pipe -MMD -fPIC -fmessage-length=0 \
-I$(ROOT)/extern/libtommath -I$(ROOT)/extern/libtomcrypt/src/headers \
$(CROSS_FLAGS) \

View File

@ -27,6 +27,12 @@ export CC
export AR
export CROSS_FLAGS
# Android uses flat tree.
buildSubDirectory=$(FB_BUILD)
LIB_PLATFORM_RPATH=-Wl,-rpath,\$$ORIGIN
LibraryFullName=$(LibraryBaseName)
LibrarySoName=$(LibraryBaseName)
COMMON_FLAGS=-ggdb -DFB_SEND_FLAGS=MSG_NOSIGNAL -DLINUX -DANDROID -DAMD64 -pipe -MMD -fPIC -fmessage-length=0 \
-I$(ROOT)/extern/libtommath -I$(ROOT)/extern/libtomcrypt/src/headers \
$(CROSS_FLAGS) \
@ -41,7 +47,7 @@ DEV_FLAGS=$(COMMON_FLAGS) $(WARN_FLAGS)
CROSS_CONFIG=android.x86_64
LDFLAGS += -static-libstdc++
DroidLibs := -lm -ldl $(DECLIB) $(I128LIB)
DroidLibs := -lm -ldl -llog $(DECLIB) $(I128LIB)
UDR_SUPPORT_LIBS :=
LINK_LIBS = $(DroidLibs)

View File

@ -68,11 +68,14 @@ export FIREBIRD_LOCK
FIREBIRD_BOOT_BUILD=1
export FIREBIRD_BOOT_BUILD
LIB=$(FB_BUILD)/lib
BIN=$(FB_BUILD)/bin
PLUGINS=$(FB_BUILD)/plugins
buildSubDirectory=$(FB_BUILD)/$(1)
LIB=$(call buildSubDirectory,lib)
BIN=$(call buildSubDirectory,bin)
PLUGINS=$(call buildSubDirectory,plugins)
TZDATA=$(call buildSubDirectory,tzdata)
FB_TESTS_DIR=$(call buildSubDirectory,tests)
RBIN=$(FIREBIRD)/bin
FB_TESTS_DIR=$(FB_BUILD)/tests
# This picks up the current directory and maps it to the equivalent module
# in the src and gen area.
@ -267,7 +270,7 @@ ENGINE_TEST = $(FB_TESTS_DIR)/$(EngineFileName)_test$(EXEC_EXT)
# confuses the dynamic load process. So we only have the .$(SHRLIB_EXT) file
# MOD 28-July-2002
LIBFBINTL_SO = $(FB_BUILD)/intl/$(LIB_PREFIX)fbintl.$(SHRLIB_EXT)
LIBFBINTL_SO=$(call buildSubDirectory,intl)/$(LIB_PREFIX)fbintl.$(SHRLIB_EXT)
ifeq ($(EDITLINE_FLG),Y)
ifeq ($(STD_EDITLINE), true)

View File

@ -218,7 +218,7 @@ UTIL_Objects:= $(call makeObjects,extlib,ib_util.cpp)
# UDR backward compatible with distributed UDFs
COMPAT_Objects:= $(call makeObjects,extlib,UdfBackwardCompatibility.cpp)
SRC_COMPAT_SQL:= $(SRC_ROOT)/extlib/UdfBackwardCompatibility.sql
COMPAT_SQL:= $(PLUGINS)/udr/udf_compat.sql
COMPAT_SQL?= $(call buildSubDirectory,plugins/udr)/udf_compat.sql
AllObjects += $(UTIL_Objects) $(COMPAT_Objects)

View File

@ -1367,31 +1367,35 @@ for fb_tgt in \$FB_TARGETS; do
echo "Creating \$fb_tgt directories"
dnl # output
mkdir -p gen/\$fb_tgt/firebird/bin
mkdir -p gen/\$fb_tgt/firebird/include/firebird/impl
mkdir -p gen/\$fb_tgt/firebird/lib
mkdir -p gen/\$fb_tgt/firebird/tests
if test "$CLIENT_ONLY_FLG" = "N" || test "$WITH_TOMCRYPT" = "Y"; then
mkdir -p gen/\$fb_tgt/firebird/plugins
fi
if test "$CLIENT_ONLY_FLG" = "N"; then
mkdir -p gen/\$fb_tgt/firebird/plugins/udr
mkdir -p gen/\$fb_tgt/firebird/examples/api
mkdir -p gen/\$fb_tgt/firebird/examples/dbcrypt
mkdir -p gen/\$fb_tgt/firebird/examples/empbuild
mkdir -p gen/\$fb_tgt/firebird/examples/extauth
mkdir -p gen/\$fb_tgt/firebird/examples/include
mkdir -p gen/\$fb_tgt/firebird/examples/interfaces
mkdir -p gen/\$fb_tgt/firebird/examples/object_pascal
mkdir -p gen/\$fb_tgt/firebird/examples/object_pascal/common
mkdir -p gen/\$fb_tgt/firebird/examples/package
mkdir -p gen/\$fb_tgt/firebird/examples/stat
mkdir -p gen/\$fb_tgt/firebird/examples/udf
mkdir -p gen/\$fb_tgt/firebird/examples/udr
mkdir -p gen/\$fb_tgt/firebird/examples/prebuilt/bin
mkdir -p gen/\$fb_tgt/firebird/examples/prebuilt/plugins
mkdir -p gen/\$fb_tgt/firebird/misc
fi
if test "x\$fb_tgt" = "xNative" || [[[ x$CROSS != xandroid* ]]]; then
mkdir -p gen/\$fb_tgt/firebird/bin
mkdir -p gen/\$fb_tgt/firebird/lib
mkdir -p gen/\$fb_tgt/firebird/tests
mkdir -p gen/\$fb_tgt/firebird/tzdata
mkdir -p gen/\$fb_tgt/firebird/include/firebird/impl
if test "$CLIENT_ONLY_FLG" = "N" || test "$WITH_TOMCRYPT" = "Y"; then
mkdir -p gen/\$fb_tgt/firebird/plugins
fi
if test "$CLIENT_ONLY_FLG" = "N"; then
mkdir -p gen/\$fb_tgt/firebird/plugins/udr
mkdir -p gen/\$fb_tgt/firebird/examples/api
mkdir -p gen/\$fb_tgt/firebird/examples/dbcrypt
mkdir -p gen/\$fb_tgt/firebird/examples/empbuild
mkdir -p gen/\$fb_tgt/firebird/examples/extauth
mkdir -p gen/\$fb_tgt/firebird/examples/include
mkdir -p gen/\$fb_tgt/firebird/examples/interfaces
mkdir -p gen/\$fb_tgt/firebird/examples/object_pascal
mkdir -p gen/\$fb_tgt/firebird/examples/object_pascal/common
mkdir -p gen/\$fb_tgt/firebird/examples/package
mkdir -p gen/\$fb_tgt/firebird/examples/stat
mkdir -p gen/\$fb_tgt/firebird/examples/udf
mkdir -p gen/\$fb_tgt/firebird/examples/udr
mkdir -p gen/\$fb_tgt/firebird/examples/prebuilt/bin
mkdir -p gen/\$fb_tgt/firebird/examples/prebuilt/plugins
mkdir -p gen/\$fb_tgt/firebird/misc
fi
fi
dnl ### TEMP ### directories for generated .cpp, .o and .d by module name
for src_dir in `cd src; ls -R -1 * | grep : | tr -d : | tr "\n" " "; cd ..`; do
@ -1424,9 +1428,17 @@ if test "$CLIENT_ONLY_FLG" = "N"; then
AC_CONFIG_FILES([
gen/$fb_tgt/firebird/databases.conf:builds/install/misc/databases.conf
gen/$fb_tgt/firebird/fbtrace.conf:src/utilities/ntrace/fbtrace.conf
gen/$fb_tgt/firebird/intl/fbintl.conf:builds/install/misc/fbintl.conf
gen/$fb_tgt/firebird/replication.conf:builds/install/misc/replication.conf
])
if test "x$fb_tgt" != "xNative" && [[[ x$CROSS = xandroid* ]]]; then
AC_CONFIG_FILES([
gen/$fb_tgt/firebird/fbintl.conf:builds/install/misc/fbintl.conf
])
else
AC_CONFIG_FILES([
gen/$fb_tgt/firebird/intl/fbintl.conf:builds/install/misc/fbintl.conf
])
fi
fi
done
@ -1434,6 +1446,7 @@ if test "x$CROSS" != "x"; then
AC_CONFIG_FILES([gen/make.crossPlatform:builds/posix/make.$CROSS])
fi
if [[[ x$CROSS != xandroid* ]]]; then
AC_CONFIG_FILES([
gen/Release/firebird/bin/fb_config:builds/install/posix-common/fb_config.in
gen/Release/firebird/bin/posixLibrary.sh:builds/install/posix-common/posixLibrary.sh.in
@ -1441,6 +1454,10 @@ gen/Release/firebird/bin/install.sh:builds/install/posix-common/install.sh.in
gen/Release/firebird/bin/FirebirdUninstall.sh:builds/install/posix-common/FirebirdUninstall.sh.in
gen/Release/firebird/bin/changeServerMode.sh:builds/install/posix-common/changeServerMode.sh.in
gen/Release/firebird/bin/registerDatabase.sh:builds/install/posix-common/registerDatabase.sh.in
])
fi
AC_CONFIG_FILES([
gen/vers.sh:builds/posix/vers.sh.in
])
@ -1461,10 +1478,17 @@ case "$PLATFORM" in
gen/install/misc/firebird.init.d.gentoo:builds/install/arch-specific/linux/firebird.init.d.gentoo.in
gen/install/misc/firebird.init.d.slackware:builds/install/arch-specific/linux/firebird.init.d.slackware.in
gen/install/misc/rc.config.firebird:builds/install/arch-specific/linux/rc.config.firebird.in
gen/Release/firebird/bin/linuxLibrary.sh:builds/install/arch-specific/linux/linuxLibrary.sh.in
gen/install/misc/firebird.service:builds/install/arch-specific/linux/firebird.service.in
],
[chmod a+x gen/install/*sh 2>/dev/null])
if [[[ x$CROSS != xandroid* ]]]; then
AC_CONFIG_FILES([
gen/Release/firebird/bin/linuxLibrary.sh:builds/install/arch-specific/linux/linuxLibrary.sh.in
],
[chmod a+x gen/install/*sh 2>/dev/null])
fi
;;
HPUX)

View File

@ -102,7 +102,13 @@ namespace
if (FB_TZDATADIR[0])
temp = FB_TZDATADIR;
else
{
#ifdef ANDROID
temp = Config::getRootDirectory();
#else
PathUtils::concatPath(temp, Config::getRootDirectory(), "tzdata");
#endif
}
const static char* const ICU_TIMEZONE_FILES_DIR = "ICU_TIMEZONE_FILES_DIR";

View File

@ -65,15 +65,16 @@ const char* const ucTemplate = "lib/libicuuc.%s.dylib";
#elif defined(HPUX)
const char* const inTemplate = "libicui18n.sl.%s";
const char* const ucTemplate = "libicuuc.sl.%s";
#elif defined(ANDROID)
const char* const inTemplate = "libicui18n.%s.so";
const char* const ucTemplate = "libicuuc.%s.so";
// In Android we need to load this library before others.
const char* const dataTemplate = "libicudata.%s.so";
#else
const char* const inTemplate = "libicui18n.so.%s";
const char* const ucTemplate = "libicuuc.so.%s";
#endif
#ifdef ANDROID
const char* const dataTemplate = "libicudata.so.%s";
#endif
// encapsulate ICU library
struct BaseICU
{
@ -221,12 +222,22 @@ void BaseICU::initialize(ModuleLoader::Module* module)
{
// call uSetDataDirectory only if .dat file exists at same folder as the loaded module
PathName modulePathName;
if (!module->getRealPath(uSetDataDirectorySymbolName.c_str(), modulePathName))
modulePathName = module->fileName;
ObjectsArray<PathName> pathsToTry;
PathName file;
PathName path, file, fullName;
PathUtils::splitLastComponent(path, file, modulePathName);
{ // scope
PathName modulePathName;
if (!module->getRealPath(uSetDataDirectorySymbolName.c_str(), modulePathName))
modulePathName = module->fileName;
PathName path;
PathUtils::splitLastComponent(path, file, modulePathName);
if (path.hasData())
pathsToTry.add(path);
}
pathsToTry.add(Config::getRootDirectory());
file.printf("icudt%u%c.dat", majorVersion,
#ifdef WORDS_BIGENDIAN
@ -236,10 +247,17 @@ void BaseICU::initialize(ModuleLoader::Module* module)
#endif
);
PathUtils::concatPath(fullName, path, file);
for (const auto& path : pathsToTry)
{
PathName fullName;
PathUtils::concatPath(fullName, path, file);
if (PathUtils::canAccess(fullName, 0))
uSetDataDirectory(path.c_str());
if (PathUtils::canAccess(fullName, 0))
{
uSetDataDirectory(path.c_str());
break;
}
}
}
if (uInit)

View File

@ -58,6 +58,7 @@
#include "../common/classes/ClumpletReader.h"
#include "../common/StatusArg.h"
#include "../common/TimeZoneUtil.h"
#include "../common/config/config.h"
#ifdef WIN_NT
#include <direct.h>
@ -1200,6 +1201,22 @@ bool bootBuild()
Firebird::PathName getPrefix(unsigned int prefType, const char* name)
{
Firebird::PathName s;
#ifdef ANDROID
const bool useInstallDir =
prefType == Firebird::IConfigManager::DIR_BIN ||
prefType == Firebird::IConfigManager::DIR_SBIN ||
prefType == Firebird::IConfigManager::DIR_LIB ||
prefType == Firebird::IConfigManager::DIR_GUARD ||
prefType == Firebird::IConfigManager::DIR_PLUGINS;
if (useInstallDir)
s = name;
else
PathUtils::concatPath(s, Firebird::Config::getRootDirectory(), name);
return s;
#else
char tmp[MAXPATHLEN];
const char* configDir[] = {
@ -1305,6 +1322,7 @@ Firebird::PathName getPrefix(unsigned int prefType, const char* name)
s += name;
gds__prefix(tmp, s.c_str());
return tmp;
#endif
}
unsigned int copyStatus(ISC_STATUS* const to, const unsigned int space,

View File

@ -41,6 +41,10 @@
#include "../common/ScanDir.h"
#include "../common/config/config_file.h"
#ifdef ANDROID
#include "../common/os/path_utils.h"
#endif
using namespace Firebird;
@ -475,6 +479,16 @@ bool IntlManager::initialize()
if (!exists)
{
mod = ModuleLoader::fixAndLoadModule(status, filename);
#ifdef ANDROID
if (!mod)
{
PathName path, file;
PathUtils::splitLastComponent(path, file, filename);
mod = ModuleLoader::fixAndLoadModule(status, file);
}
#endif
if (mod)
{
exists = modules->exist(filename);

View File

@ -87,7 +87,7 @@ namespace
if (fb_utils::bootBuild())
return;
#if defined(WIN_NT)
#if defined(WIN_NT) || defined(ANDROID)
libUtilPath.assign(LIBNAME);
#elif defined(DARWIN)
libUtilPath = "/Library/Frameworks/Firebird.framework/Versions/A/Libraries/" LIBNAME;

View File

@ -69,8 +69,12 @@ void ConfigRoot::osConfigInstallDir()
char* temp = br_find_exe_dir(NULL);
if (temp)
{
#ifdef ANDROID
install_dir = temp;
#else
string dummy;
PathUtils::splitLastComponent(install_dir, dummy, temp);
#endif
free(temp);
return;
}

View File

@ -112,6 +112,10 @@
#undef leave
#endif // WIN_NT
#ifdef ANDROID
#include <android/log.h>
#endif
static char fb_prefix_val[MAXPATHLEN];
static char fb_prefix_lock_val[MAXPATHLEN];
static char fb_prefix_msg_val[MAXPATHLEN];
@ -1281,6 +1285,7 @@ void API_ROUTINE gds__log(const TEXT* text, ...)
#ifdef WIN_NT
WaitForSingleObject(CleanupTraceHandles::trace_mutex_handle, INFINITE);
#endif
FILE* file = os_utils::fopen(name.c_str(), "a");
if (file != NULL)
{
@ -1311,7 +1316,12 @@ void API_ROUTINE gds__log(const TEXT* text, ...)
// This will release file lock set in posix case
fclose(file);
}
#ifdef WIN_NT
#ifdef ANDROID
va_start(ptr, text);
__android_log_vprint(ANDROID_LOG_INFO, "FIREBIRD", text, ptr);
va_end(ptr);
#elif defined(WIN_NT)
ReleaseMutex(CleanupTraceHandles::trace_mutex_handle);
#endif
}