🛠️🐜 Antkeeper superbuild with dependencies included https://antkeeper.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

74 lines
1.6 KiB

  1. #!/bin/sh
  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. # Note that SDLmain is not an installable module (.so) so libSDLmain.a
  15. # can be found in $obj/local/<abi> along with the unstripped libSDL.so.
  16. #
  17. # Android.mk is in srcdir
  18. srcdir=`dirname $0`/..
  19. srcdir=`cd $srcdir && pwd`
  20. cd $srcdir
  21. #
  22. # Create the build directories
  23. #
  24. build=build
  25. buildandroid=$build/android
  26. obj=
  27. lib=
  28. ndk_args=
  29. # Allow an external caller to specify locations.
  30. for arg in $*
  31. do
  32. if [ "${arg:0:8}" == "NDK_OUT=" ]; then
  33. obj=${arg#NDK_OUT=}
  34. elif [ "${arg:0:13}" == "NDK_LIBS_OUT=" ]; then
  35. lib=${arg#NDK_LIBS_OUT=}
  36. else
  37. ndk_args="$ndk_args $arg"
  38. fi
  39. done
  40. if [ -z $obj ]; then
  41. obj=$buildandroid/obj
  42. fi
  43. if [ -z $lib ]; then
  44. lib=$buildandroid/lib
  45. fi
  46. for dir in $build $buildandroid $obj $lib; do
  47. if test -d $dir; then
  48. :
  49. else
  50. mkdir $dir || exit 1
  51. fi
  52. done
  53. # APP_* variables set in the environment here will not be seen by the
  54. # ndk-build makefile segments that use them, e.g., default-application.mk.
  55. # For consistency, pass all values on the command line.
  56. ndk-build \
  57. NDK_PROJECT_PATH=null \
  58. NDK_OUT=$obj \
  59. NDK_LIBS_OUT=$lib \
  60. APP_BUILD_SCRIPT=Android.mk \
  61. APP_ABI="armeabi-v7a arm64-v8a x86 x86_64" \
  62. APP_PLATFORM=android-16 \
  63. APP_MODULES="SDL2 SDL2_main" \
  64. $ndk_args