🛠️🐜 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.

73 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 $*; do
  31. if [ "${arg:0:8}" == "NDK_OUT=" ]; then
  32. obj=${arg#NDK_OUT=}
  33. elif [ "${arg:0:13}" == "NDK_LIBS_OUT=" ]; then
  34. lib=${arg#NDK_LIBS_OUT=}
  35. else
  36. ndk_args="$ndk_args $arg"
  37. fi
  38. done
  39. if [ -z $obj ]; then
  40. obj=$buildandroid/obj
  41. fi
  42. if [ -z $lib ]; then
  43. lib=$buildandroid/lib
  44. fi
  45. for dir in $build $buildandroid $obj $lib; do
  46. if test -d $dir; then
  47. :
  48. else
  49. mkdir $dir || exit 1
  50. fi
  51. done
  52. # APP_* variables set in the environment here will not be seen by the
  53. # ndk-build makefile segments that use them, e.g., default-application.mk.
  54. # For consistency, pass all values on the command line.
  55. ndk-build \
  56. NDK_PROJECT_PATH=null \
  57. NDK_OUT=$obj \
  58. NDK_LIBS_OUT=$lib \
  59. APP_BUILD_SCRIPT=Android.mk \
  60. APP_ABI="armeabi-v7a arm64-v8a x86 x86_64" \
  61. APP_PLATFORM=android-16 \
  62. APP_MODULES="SDL2 SDL2_main" \
  63. $ndk_args