| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 | #!/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=<dest>  - specify alternate destination for installable#                         modules.## Note that SDLmain is not an installable module (.so) so libSDLmain.a# can be found in $obj/local/<abi> along with the unstripped libSDL.so.## Android.mk is in srcdirsrcdir=`dirname $0`/..srcdir=`cd $srcdir && pwd`cd $srcdir## Create the build directories#build=buildbuildandroid=$build/androidobj=lib=ndk_args=# Allow an external caller to specify locations.for arg in $*; do    if [ "${arg:0:8}" == "NDK_OUT=" ]; then        obj=${arg#NDK_OUT=}    elif [ "${arg:0:13}" == "NDK_LIBS_OUT=" ]; then        lib=${arg#NDK_LIBS_OUT=}    else        ndk_args="$ndk_args $arg"    fidoneif [ -z $obj ]; then    obj=$buildandroid/objfiif [ -z $lib ]; then    lib=$buildandroid/libfifor dir in $build $buildandroid $obj $lib; do    if test -d $dir; then        :    else        mkdir $dir || exit 1    fidone# 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.ndk-build \    NDK_PROJECT_PATH=null \    NDK_OUT=$obj \    NDK_LIBS_OUT=$lib \    APP_BUILD_SCRIPT=Android.mk \    APP_ABI="armeabi-v7a arm64-v8a x86 x86_64" \    APP_PLATFORM=android-16 \    APP_MODULES="SDL2 SDL2_main" \    $ndk_args
 |