diff options
| author | 3gg <3gg@shellblade.net> | 2025-12-27 12:03:39 -0800 |
|---|---|---|
| committer | 3gg <3gg@shellblade.net> | 2025-12-27 12:03:39 -0800 |
| commit | 5a079a2d114f96d4847d1ee305d5b7c16eeec50e (patch) | |
| tree | 8926ab44f168acf787d8e19608857b3af0f82758 /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-x | contrib/SDL-3.2.8/build-scripts/androidbuildlibs.sh | 78 |
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 | ||
| 17 | srcdir=`dirname $0`/.. | ||
| 18 | srcdir=`cd $srcdir && pwd` | ||
| 19 | cd $srcdir | ||
| 20 | |||
| 21 | |||
| 22 | # | ||
| 23 | # Create the build directories | ||
| 24 | # | ||
| 25 | |||
| 26 | build=build | ||
| 27 | buildandroid=$build/android | ||
| 28 | platform=android-21 | ||
| 29 | abi="arm64-v8a" # "armeabi-v7a arm64-v8a x86 x86_64" | ||
| 30 | obj= | ||
| 31 | lib= | ||
| 32 | ndk_args= | ||
| 33 | |||
| 34 | # Allow an external caller to specify locations and platform. | ||
| 35 | while [ $# -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 | ||
| 49 | done | ||
| 50 | |||
| 51 | if [ -z $obj ]; then | ||
| 52 | obj=$buildandroid/obj | ||
| 53 | fi | ||
| 54 | if [ -z $lib ]; then | ||
| 55 | lib=$buildandroid/lib | ||
| 56 | fi | ||
| 57 | |||
| 58 | for dir in $build $buildandroid $obj $lib; do | ||
| 59 | if test -d $dir; then | ||
| 60 | : | ||
| 61 | else | ||
| 62 | mkdir $dir || exit 1 | ||
| 63 | fi | ||
| 64 | done | ||
| 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. | ||
| 70 | ndk-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 | ||
