diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4ecacb53a6..9495a52e85 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -553,8 +553,8 @@ jobs: runs-on: ubuntu-22.04 env: NDK: /home/runner/Android/Ndk - ARCH_BITS: ${{ (matrix.arch == 'arm32' && 32) || 64 }} - FB_PREFIX: ${{ (matrix.arch == 'arm32' && 'arme') || 'arm64' }} + ARCH: ${{ matrix.arch }} + FB_PREFIX: ${{ (matrix.arch == 'arm32' && 'arme') || (matrix.arch == 'x64' && 'x86_64') || matrix.arch }} strategy: fail-fast: false @@ -562,6 +562,8 @@ jobs: arch: - arm32 - arm64 + - x86 + - x64 steps: - name: Checkout @@ -586,7 +588,7 @@ jobs: ./autogen.sh --prefix=/opt/firebird --enable-binreloc --with-cross-build=android.$FB_PREFIX --without-editline make -j4 make CROSS_OUT=Y tests -j4 - builds/install/arch-specific/android/BuildPackage.sh $ARCH_BITS + builds/install/arch-specific/android/BuildPackage.sh $ARCH - name: Upload initial build uses: actions/upload-artifact@v3 @@ -601,7 +603,7 @@ jobs: needs: build-android-initial runs-on: macos-latest env: - ARCH_BITS: ${{ (matrix.arch == 'arm32' && 32) || 64 }} + ARCH: ${{ matrix.arch }} strategy: fail-fast: false @@ -609,6 +611,8 @@ jobs: arch: - arm32 - arm64 + - x86 + - x64 steps: - name: Checkout @@ -654,8 +658,9 @@ jobs: ndk: 25.1.8937393 emulator-options: -no-snapshot-save -no-window -noaudio -no-boot-anim -camera-back none -port 5554 script: | + adb wait-for-device adb root - NDK=/Users/runner/Library/Android/sdk/ndk/25.1.8937393 builds/install/arch-specific/android/BuildFinalPackage.sh $ARCH_BITS + NDK=/Users/runner/Library/Android/sdk/ndk/25.1.8937393 builds/install/arch-specific/android/BuildFinalPackage.sh $ARCH - name: Upload installer uses: actions/upload-artifact@v3 diff --git a/builds/install/arch-specific/android/BuildFinalPackage.sh b/builds/install/arch-specific/android/BuildFinalPackage.sh index 7be4679cb3..6fb6e4ebf3 100755 --- a/builds/install/arch-specific/android/BuildFinalPackage.sh +++ b/builds/install/arch-specific/android/BuildFinalPackage.sh @@ -1,6 +1,8 @@ #!/bin/sh set -e +arch=${1} + case $OSTYPE in darwin*) NDK_TOOLCHAIN_NAME=darwin-x86_64 @@ -12,22 +14,19 @@ case $OSTYPE in FIND_EXEC_OPTS="-executable" ;; esac -bits=${1} -[ -z "$bits" ] && bits=32 - [ -z "$NDK_TOOLCHAIN" ] && NDK_TOOLCHAIN=$NDK/toolchains/llvm/prebuilt/$NDK_TOOLCHAIN_NAME aStrip=${NDK_TOOLCHAIN}/bin/llvm-strip MakeVersion=gen/Make.Version Build=`grep ^BuildNum ${MakeVersion}|awk '{print $3;}'` Version=`grep ^FirebirdVersion ${MakeVersion}|awk '{print $3;}'` -InitialBaseName="Firebird-${Version}.${Build}-0-android-initial-arm${bits}" +InitialBaseName="Firebird-${Version}.${Build}-0-android-initial-${arch}" InitialDebugTar="$InitialBaseName-withDebugSymbols.tar" InitialDebugTarGz="$InitialDebugTar.gz" Stripped=strip -FinalRelease="Firebird-${Version}.${Build}-0-android-arm${bits}.tar.gz" -FinalDebug="Firebird-${Version}.${Build}-0-android-arm${bits}-withDebugSymbols.tar.gz" +FinalRelease="Firebird-${Version}.${Build}-0-android-${arch}.tar.gz" +FinalDebug="Firebird-${Version}.${Build}-0-android-${arch}-withDebugSymbols.tar.gz" [ -z "$AndroidDevicePort" ] && AndroidDevicePort=5554 AndroidDeviceName=emulator-$AndroidDevicePort @@ -39,8 +38,9 @@ mkdir -p gen/Release $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 && cd firebird && ./AfterUntar.sh)" +$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 && ./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/ diff --git a/builds/install/arch-specific/android/BuildPackage.sh b/builds/install/arch-specific/android/BuildPackage.sh index 996c07cba9..f69434f626 100755 --- a/builds/install/arch-specific/android/BuildPackage.sh +++ b/builds/install/arch-specific/android/BuildPackage.sh @@ -1,27 +1,13 @@ #!/bin/sh set -e -case $OSTYPE in - darwin*) - NDK_TOOLCHAIN_NAME=darwin-x86_64 ;; - linux*) - NDK_TOOLCHAIN_NAME=linux-x86_64 ;; -esac - -bits=${1} -[ -z "$bits" ] && bits=32 - -[ "$bits" = "32" ] && cross=arm-linux-androideabi -[ "$bits" = "64" ] && cross=aarch64-linux-android -[ -z "$cross" ] && echo "Invalid bits passed" && exit 1 - -[ -z "$NDK_TOOLCHAIN" ] && NDK_TOOLCHAIN=$NDK/toolchains/llvm/prebuilt/$NDK_TOOLCHAIN_NAME +arch=${1} MakeVersion=gen/Make.Version Build=`grep ^BuildNum ${MakeVersion}|awk '{print $3;}'` Version=`grep ^FirebirdVersion ${MakeVersion}|awk '{print $3;}'` -Release="Firebird-${Version}.${Build}-0-android-initial-arm${bits}.tar.gz" -Debug="Firebird-${Version}.${Build}-0-android-initial-arm${bits}-withDebugSymbols.tar.gz" +Release="Firebird-${Version}.${Build}-0-android-initial-${arch}.tar.gz" +Debug="Firebird-${Version}.${Build}-0-android-initial-${arch}-withDebugSymbols.tar.gz" fbRootDir=`pwd` runTar() @@ -36,7 +22,7 @@ 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 ${bits}/* +tar -C firebird/lib --wildcards --strip-components 1 -xvf ../../extern/icu/icu_android.tar.xz ${arch}/* echo . echo . echo "Compress with deb-info" diff --git a/builds/posix/make.android.x86 b/builds/posix/make.android.x86 index c789649f4f..1344fe0dc1 100644 --- a/builds/posix/make.android.x86 +++ b/builds/posix/make.android.x86 @@ -6,12 +6,10 @@ endif NDK_TOOLCHAIN ?= $(NDK)/toolchains/llvm/prebuilt/linux-x86_64 -CROSS_SYSROOT:=$(NDK_TOOLCHAIN)/sysroot CROSS_PREFIX24:=$(NDK_TOOLCHAIN)/bin/i686-linux-android24- CROSS_PREFIX:=$(NDK_TOOLCHAIN)/bin/llvm- -CROSS_FLAGS:=--sysroot=$(CROSS_SYSROOT) \ - -I$(CROSS_SYSROOT)/usr/include -I$(ROOT)/gen/cross +CROSS_FLAGS:=-I$(ROOT)/gen/cross CXX:=$(CROSS_PREFIX24)clang++ CC:=$(CROSS_PREFIX24)clang @@ -42,8 +40,9 @@ DEV_FLAGS=$(COMMON_FLAGS) $(WARN_FLAGS) CROSS_CONFIG=android.x86 -LDFLAGS += --sysroot=$(CROSS_SYSROOT) -static-libstdc++ +LDFLAGS += -static-libstdc++ DroidLibs := -lm -ldl $(DECLIB) $(RE2LIB) $(I128LIB) +UDR_SUPPORT_LIBS := LINK_LIBS = $(DroidLibs) STATICLINK_LIBS = $(DroidLibs) diff --git a/builds/posix/make.android.x86_64 b/builds/posix/make.android.x86_64 index 97a031acc0..34ae36925d 100644 --- a/builds/posix/make.android.x86_64 +++ b/builds/posix/make.android.x86_64 @@ -6,12 +6,10 @@ endif NDK_TOOLCHAIN ?= $(NDK)/toolchains/llvm/prebuilt/linux-x86_64 -CROSS_SYSROOT:=$(NDK_TOOLCHAIN)/sysroot CROSS_PREFIX24:=$(NDK_TOOLCHAIN)/bin/x86_64-linux-android24- CROSS_PREFIX:=$(NDK_TOOLCHAIN)/bin/llvm- -CROSS_FLAGS:=--sysroot=$(CROSS_SYSROOT) \ - -I$(CROSS_SYSROOT)/usr/include -I$(ROOT)/gen/cross +CROSS_FLAGS:=-I$(ROOT)/gen/cross CXX:=$(CROSS_PREFIX24)clang++ CC:=$(CROSS_PREFIX24)clang @@ -42,8 +40,9 @@ DEV_FLAGS=$(COMMON_FLAGS) $(WARN_FLAGS) CROSS_CONFIG=android.x86_64 -LDFLAGS += --sysroot=$(CROSS_SYSROOT) -static-libstdc++ +LDFLAGS += -static-libstdc++ DroidLibs := -lm -ldl $(DECLIB) $(RE2LIB) $(I128LIB) +UDR_SUPPORT_LIBS := LINK_LIBS = $(DroidLibs) STATICLINK_LIBS = $(DroidLibs) diff --git a/extern/icu/android/env.sh b/extern/icu/android/env.sh index cc84814cad..ec59cd60dc 100644 --- a/extern/icu/android/env.sh +++ b/extern/icu/android/env.sh @@ -1,5 +1,4 @@ #!/bin/sh export CROSS_BUILD_DIR=`realpath ../linux` -export ANDROID_NDK=${NDK} -export ANDROID_TOOLCHAIN=${NDK_TOOLCHAIN} -export PATH=$ANDROID_TOOLCHAIN/bin:$PATH +[ -z "$NDK_TOOLCHAIN" ] && export NDK_TOOLCHAIN=$NDK/toolchains/llvm/prebuilt/linux-x86_64 +export PATH=$NDK_TOOLCHAIN/bin:$PATH diff --git a/extern/icu/android/i686/config.sh b/extern/icu/android/i686/config.sh new file mode 100755 index 0000000000..6b5b34ef2c --- /dev/null +++ b/extern/icu/android/i686/config.sh @@ -0,0 +1,27 @@ +#!/bin/sh + +. ../env.sh + +../source/configure --prefix=$(pwd)/prebuilt \ + --host=i686-android-linux \ + --enable-static=no \ + --enable-shared \ + --enable-extras=no \ + --enable-strict=no \ + --enable-icuio=no \ + --enable-layout=no \ + --enable-layoutex=no \ + --enable-tools=no \ + --enable-tests=no \ + --enable-samples=no \ + --enable-renaming \ + --enable-dyload \ + --with-cross-build=$CROSS_BUILD_DIR \ + CFLAGS='-Os' \ + CXXFLAGS='--std=c++17' \ + LDFLAGS='-static-libstdc++' \ + CC=i686-linux-android24-clang \ + CXX=i686-linux-android24-clang++ \ + AR=llvm-ar \ + RANLIB=llvm-ranlib \ + --with-data-packaging=archive diff --git a/extern/icu/android/i686/mk.sh b/extern/icu/android/i686/mk.sh new file mode 100755 index 0000000000..56fb7848c8 --- /dev/null +++ b/extern/icu/android/i686/mk.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +. ../env.sh + +make -j15 && make install + diff --git a/extern/icu/android/renameLinks.sh b/extern/icu/android/renameLinks.sh old mode 100644 new mode 100755 index 44ec5b5749..498c8d6d23 --- a/extern/icu/android/renameLinks.sh +++ b/extern/icu/android/renameLinks.sh @@ -1,4 +1,4 @@ -MAJOR=52 +MAJOR=63 MINOR=1 rm -f libicu*so diff --git a/extern/icu/android/x86_64/config.sh b/extern/icu/android/x86_64/config.sh new file mode 100755 index 0000000000..8e30645ee2 --- /dev/null +++ b/extern/icu/android/x86_64/config.sh @@ -0,0 +1,27 @@ +#!/bin/sh + +. ../env.sh + +../source/configure --prefix=$(pwd)/prebuilt \ + --host=x86_64-android-linux \ + --enable-static=no \ + --enable-shared \ + --enable-extras=no \ + --enable-strict=no \ + --enable-icuio=no \ + --enable-layout=no \ + --enable-layoutex=no \ + --enable-tools=no \ + --enable-tests=no \ + --enable-samples=no \ + --enable-renaming \ + --enable-dyload \ + --with-cross-build=$CROSS_BUILD_DIR \ + CFLAGS='-Os' \ + CXXFLAGS='--std=c++17' \ + LDFLAGS='-static-libstdc++' \ + CC=x86_64-linux-android24-clang \ + CXX=x86_64-linux-android24-clang++ \ + AR=llvm-ar \ + RANLIB=llvm-ranlib \ + --with-data-packaging=archive diff --git a/extern/icu/android/x86_64/mk.sh b/extern/icu/android/x86_64/mk.sh new file mode 100755 index 0000000000..56fb7848c8 --- /dev/null +++ b/extern/icu/android/x86_64/mk.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +. ../env.sh + +make -j15 && make install + diff --git a/extern/icu/icu_android.tar.xz b/extern/icu/icu_android.tar.xz index 2ed037e2d6..9259ae0072 100644 Binary files a/extern/icu/icu_android.tar.xz and b/extern/icu/icu_android.tar.xz differ