| Summary: | No way to create pre-built libraries for Android | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Mark Callow <libsdl.org> |
| Component: | build | Assignee: | Gabriel Jacobo <gabomdq> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | CC: | gabomdq |
| Version: | 2.0.3 | ||
| Hardware: | x86_64 | ||
| OS: | Other | ||
| Attachments: |
Script to build android version of SDL2.
Patch to Android.mk adding SDL2_main module |
||
Created attachment 1986 [details]
Patch to Android.mk adding SDL2_main module
P.S. The addition of SDL2_main to Android.mk won't affect any existing users because the Android build system defaults to building only the loadable (shared library) modules it finds in the .mk files. To build the new module, it must be explicitly specified to the build system, something the new script does. This has been added, thanks! https://hg.libsdl.org/SDL/rev/8e5441ab6c63 |
Created attachment 1985 [details] Script to build android version of SDL2. This is really an RFE but there is no way set that in this bugzilla. README-android says to copy or link the SDL source tree to the jni folder in your Android project. It is not desirable to have to compile SDL with every application; furthermore the Android NDK has support for prebuilt libraries. Attached is script (to be put in build-scripts) that builds the Android version of the libraries. The script builds both the existing SDL2 module and a new SDL2_main module. This is a static library containing the code from src/main/android/SDL_android_main.c. Also attached is a patch for Android.mk adding this module. Note that when building an application's native .so using this prebuilt libSDL2main, you must use a link option, such as --whole-archive, that forces inclusion of the code in the .so because the functions in SDL_android_main are called only from Java.