You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-commits@axis.apache.org by ro...@apache.org on 2026/01/15 02:44:42 UTC

(axis-axis2-c-core) branch master updated: Add Android cross-compilation convenience script

This is an automated email from the ASF dual-hosted git repository.

robertlazarski pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/axis-axis2-c-core.git


The following commit(s) were added to refs/heads/master by this push:
     new 484b472a0 Add Android cross-compilation convenience script
484b472a0 is described below

commit 484b472a03dd69e1a4a5f1dee424218d5cb6eb95
Author: Robert Lazarski <ro...@gmail.com>
AuthorDate: Wed Jan 14 16:32:16 2026 -1000

    Add Android cross-compilation convenience script
    
    - Add build_android.sh for ARM64 builds with NDK r28
    - Reference script in HTTP2_ANDROID.md documentation
    
    Co-Authored-By: Claude Opus 4.5 <no...@anthropic.com>
---
 build_android.sh      | 43 +++++++++++++++++++++++++++++++++++++++++++
 docs/HTTP2_ANDROID.md | 10 +++++++++-
 2 files changed, 52 insertions(+), 1 deletion(-)

diff --git a/build_android.sh b/build_android.sh
new file mode 100755
index 000000000..d6480633d
--- /dev/null
+++ b/build_android.sh
@@ -0,0 +1,43 @@
+#!/bin/bash
+# Build Axis2/C for Android ARM64
+set -e
+
+ANDROID_NDK_HOME=$HOME/Android/Sdk/ndk/28.0.12916984
+TOOLCHAIN=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64
+DEPS=$HOME/android-cross-builds/deps/arm64-v8a
+
+echo "=== Axis2/C Android Cross-Compilation ==="
+echo "NDK: $ANDROID_NDK_HOME"
+echo "Toolchain: $TOOLCHAIN"
+echo "Deps: $DEPS"
+
+# Verify toolchain exists
+if [ ! -f "$TOOLCHAIN/bin/aarch64-linux-android21-clang" ]; then
+    echo "ERROR: NDK compiler not found"
+    exit 1
+fi
+
+# Configure
+CC="$TOOLCHAIN/bin/aarch64-linux-android21-clang" \
+AR="$TOOLCHAIN/bin/llvm-ar" \
+RANLIB="$TOOLCHAIN/bin/llvm-ranlib" \
+CFLAGS="-fPIC -std=gnu99 -I$DEPS/include -I$DEPS/include/apr-1" \
+LDFLAGS="-L$DEPS/lib" \
+LIBS="-lapr-1 -laprutil-1 -lexpat -lssl -lcrypto -lnghttp2 -ljson-c" \
+./configure \
+    --host=aarch64-linux-android \
+    --prefix=$DEPS \
+    --with-apache2=$HOME/android-cross-builds/httpd-2.4.66 \
+    --with-apr=$DEPS \
+    --enable-static \
+    --disable-shared \
+    --enable-http2 \
+    --enable-json \
+    --with-openssl=$DEPS
+
+echo "=== Configure complete, building ==="
+
+# Build
+make -j$(nproc)
+
+echo "=== Build complete ==="
diff --git a/docs/HTTP2_ANDROID.md b/docs/HTTP2_ANDROID.md
index dbeef5307..d727ff39b 100644
--- a/docs/HTTP2_ANDROID.md
+++ b/docs/HTTP2_ANDROID.md
@@ -90,6 +90,14 @@ export RANLIB=$TOOLCHAIN/bin/llvm-ranlib
     --with-openssl=$DEPS
 ```
 
+**Convenience script:** Use `build_android.sh` in the repository root for a complete build:
+
+```bash
+./build_android.sh
+```
+
+This script sets up the toolchain, configures with all required flags, and builds. Edit the script to adjust paths for your NDK installation and dependency locations.
+
 ## Static Service Registry (Android)
 
 ### The Problem
@@ -528,4 +536,4 @@ Key files for Android support:
 
 ---
 
-*Last updated: 2026-01-06*
+*Last updated: 2026-01-14*