summaryrefslogtreecommitdiff
path: root/contrib/SDL-3.2.8/build-scripts/androidbuildlibs.sh
diff options
context:
space:
mode:
author3gg <3gg@shellblade.net>2025-12-27 12:03:39 -0800
committer3gg <3gg@shellblade.net>2025-12-27 12:03:39 -0800
commit5a079a2d114f96d4847d1ee305d5b7c16eeec50e (patch)
tree8926ab44f168acf787d8e19608857b3af0f82758 /contrib/SDL-3.2.8/build-scripts/androidbuildlibs.sh
Initial commit
Diffstat (limited to 'contrib/SDL-3.2.8/build-scripts/androidbuildlibs.sh')
-rwxr-xr-xcontrib/SDL-3.2.8/build-scripts/androidbuildlibs.sh78
1 files changed, 78 insertions, 0 deletions
diff --git a/contrib/SDL-3.2.8/build-scripts/androidbuildlibs.sh b/contrib/SDL-3.2.8/build-scripts/androidbuildlibs.sh
new file mode 100755
index 0000000..a903f36
--- /dev/null
+++ b/contrib/SDL-3.2.8/build-scripts/androidbuildlibs.sh
@@ -0,0 +1,78 @@
1#!/bin/bash
2#
3# Build the Android libraries without needing a project
4# (AndroidManifest.xml, jni/{Application,Android}.mk, etc.)
5#
6# Usage: androidbuildlibs.sh [arg for ndk-build ...]"
7#
8# Useful NDK arguments:
9#
10# NDK_DEBUG=1 - build debug version
11# NDK_LIBS_OUT=<dest> - specify alternate destination for installable
12# modules.
13#
14
15
16# Android.mk is in srcdir
17srcdir=`dirname $0`/..
18srcdir=`cd $srcdir && pwd`
19cd $srcdir
20
21
22#
23# Create the build directories
24#
25
26build=build
27buildandroid=$build/android
28platform=android-21
29abi="arm64-v8a" # "armeabi-v7a arm64-v8a x86 x86_64"
30obj=
31lib=
32ndk_args=
33
34# Allow an external caller to specify locations and platform.
35while [ $# -gt 0 ]; do
36 arg=$1
37 if [ "${arg:0:8}" == "NDK_OUT=" ]; then
38 obj=${arg#NDK_OUT=}
39 elif [ "${arg:0:13}" == "NDK_LIBS_OUT=" ]; then
40 lib=${arg#NDK_LIBS_OUT=}
41 elif [ "${arg:0:13}" == "APP_PLATFORM=" ]; then
42 platform=${arg#APP_PLATFORM=}
43 elif [ "${arg:0:8}" == "APP_ABI=" ]; then
44 abi=${arg#APP_ABI=}
45 else
46 ndk_args="$ndk_args $arg"
47 fi
48 shift
49done
50
51if [ -z $obj ]; then
52 obj=$buildandroid/obj
53fi
54if [ -z $lib ]; then
55 lib=$buildandroid/lib
56fi
57
58for dir in $build $buildandroid $obj $lib; do
59 if test -d $dir; then
60 :
61 else
62 mkdir $dir || exit 1
63 fi
64done
65
66
67# APP_* variables set in the environment here will not be seen by the
68# ndk-build makefile segments that use them, e.g., default-application.mk.
69# For consistency, pass all values on the command line.
70ndk-build \
71 NDK_PROJECT_PATH=null \
72 NDK_OUT=$obj \
73 NDK_LIBS_OUT=$lib \
74 APP_BUILD_SCRIPT=Android.mk \
75 APP_ABI="$abi" \
76 APP_PLATFORM="$platform" \
77 APP_MODULES="SDL3" \
78 $ndk_args