From 6aaedb813fa11ba0679c3051bc2eb28646b9506c Mon Sep 17 00:00:00 2001 From: 3gg <3gg@shellblade.net> Date: Sat, 30 Aug 2025 16:53:58 -0700 Subject: Update to SDL3 --- .../SDL-3.2.20/build-scripts/androidbuildlibs.sh | 85 ++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100755 src/contrib/SDL-3.2.20/build-scripts/androidbuildlibs.sh (limited to 'src/contrib/SDL-3.2.20/build-scripts/androidbuildlibs.sh') diff --git a/src/contrib/SDL-3.2.20/build-scripts/androidbuildlibs.sh b/src/contrib/SDL-3.2.20/build-scripts/androidbuildlibs.sh new file mode 100755 index 0000000..1004a98 --- /dev/null +++ b/src/contrib/SDL-3.2.20/build-scripts/androidbuildlibs.sh @@ -0,0 +1,85 @@ +#!/bin/bash +# +# Build the Android libraries without needing a project +# (AndroidManifest.xml, jni/{Application,Android}.mk, etc.) +# +# Usage: androidbuildlibs.sh [arg for ndk-build ...]" +# +# Useful NDK arguments: +# +# NDK_DEBUG=1 - build debug version +# NDK_LIBS_OUT= - specify alternate destination for installable +# modules. +# + + +# Android.mk is in srcdir +srcdir=`dirname $0`/.. +srcdir=`cd $srcdir && pwd` +cd $srcdir + + +# +# Create the build directories +# + +build=build +buildandroid=$build/android +platform=android-21 +abi="arm64-v8a" # "armeabi-v7a arm64-v8a x86 x86_64" +obj= +lib= +ndk_args= +flexpage=true + +# Allow an external caller to specify locations and platform. +while [ $# -gt 0 ]; do + arg=$1 + if [ "${arg:0:8}" == "NDK_OUT=" ]; then + obj=${arg#NDK_OUT=} + elif [ "${arg:0:13}" == "NDK_LIBS_OUT=" ]; then + lib=${arg#NDK_LIBS_OUT=} + elif [ "${arg:0:13}" == "APP_PLATFORM=" ]; then + platform=${arg#APP_PLATFORM=} + elif [ "${arg:0:8}" == "APP_ABI=" ]; then + abi=${arg#APP_ABI=} + elif [ "${arg:0:32}" == "APP_SUPPORT_FLEXIBLE_PAGE_SIZES=" ]; then + flexpage=${arg#APP_SUPPORT_FLEXIBLE_PAGE_SIZES=} + else + ndk_args="$ndk_args $arg" + fi + shift +done + +if [ -z $obj ]; then + obj=$buildandroid/obj +fi +if [ -z $lib ]; then + lib=$buildandroid/lib +fi + +for dir in $build $buildandroid $obj $lib; do + if test -d $dir; then + : + else + mkdir $dir || exit 1 + fi +done + + +# APP_* variables set in the environment here will not be seen by the +# ndk-build makefile segments that use them, e.g., default-application.mk. +# For consistency, pass all values on the command line. +# +# Add support for Google Play 16 KB Page size requirement: +# https://developer.android.com/guide/practices/page-sizes#ndk-build +ndk-build \ + NDK_PROJECT_PATH=null \ + NDK_OUT=$obj \ + NDK_LIBS_OUT=$lib \ + APP_BUILD_SCRIPT=Android.mk \ + APP_ABI="$abi" \ + APP_PLATFORM="$platform" \ + APP_MODULES="SDL3" \ + APP_SUPPORT_FLEXIBLE_PAGE_SIZES="$flexpage" \ + $ndk_args -- cgit v1.2.3