4349cb5769
Denis Bernard This patch to Android.mk adds support for static linking of libSDL for Android applications. A patched readme with static build instructions is also provided. It does not break existing build environments setup according to the README-android.txt since the static library version will not be built in not required. The static build uses the Android NDK module system (see docs/IMPORT-MODULE.html in the NDK folder and step 5 in the instructions below). Instructions: 1. Copy the android-project directory wherever you want to keep your projects and rename it to the name of your project. 2. Create a symlink to SDL/src/main/android/SDL_android_main.c as <project>/jni/src/SDL_android_main.c 3. Rename <project>/jni/src/Android_static.mk to <project>/jni/src/Android.mk (overwrite the existing one) 4. Edit <project>/jni/src/Android.mk to include your source files 5. create and export an environment variable named NDK_MODULE_PATH that points to the parent directory of this SDL directory. e.g.: export NDK_MODULE_PATH="$PWD"/.. 6. Edit <project>/src/org/libsdl/app/SDLActivity.java and remove the call to System.loadLibrary("SDL2") line 42. 7. Run 'ndk-build' (a script provided by the NDK). This compiles the C source Although this requires an environment variable to be setup, it can be added once and for all to the main Android.mk of the project. |
||
---|---|---|
VisualC | ||
Xcode | ||
Xcode-iOS | ||
acinclude | ||
android-project | ||
build-scripts | ||
cmake | ||
debian | ||
include | ||
src | ||
test | ||
.hgignore | ||
Android.mk | ||
BUGS.txt | ||
CMakeLists.txt | ||
COPYING.txt | ||
CREDITS.txt | ||
INSTALL.txt | ||
Makefile.in | ||
Makefile.minimal | ||
Makefile.pandora | ||
Makefile.psp | ||
Makefile.wiz | ||
README-SDL.txt | ||
README-android.txt | ||
README-cmake.txt | ||
README-directfb.txt | ||
README-gesture.txt | ||
README-hg.txt | ||
README-ios.txt | ||
README-macosx.txt | ||
README-pandora.txt | ||
README-platforms.txt | ||
README-porting.txt | ||
README-psp.txt | ||
README-raspberrypi.txt | ||
README-touch.txt | ||
README-wince.txt | ||
README.txt | ||
SDL2.spec.in | ||
TODO.txt | ||
VisualC.html | ||
WhatsNew.txt | ||
autogen.sh | ||
configure | ||
configure.in | ||
sdl2-config.in | ||
sdl2.m4 | ||
sdl2.pc.in |
README.txt
Simple DirectMedia Layer (SDL) Version 2.0 --- http://www.libsdl.org/ Simple DirectMedia Layer is a cross-platform development library designed to provide low level access to audio, keyboard, mouse, joystick, and graphics hardware via OpenGL and Direct3D. It is used by video playback software, emulators, and popular games including Valve's award winning catalog and many Humble Bundle games. SDL officially supports Windows, Mac OS X, Linux, iOS, and Android. Support for other platforms may be found in the source code. SDL is written in C, works natively with C++, and there are bindings available for several other languages, including C# and Python. This library is distributed under the zlib license, which can be found in the file "COPYING.txt". The best way to learn how to use SDL is to check out the header files in the "include" subdirectory and the programs in the "test" subdirectory. The header files and test programs are well commented and always up to date. More documentation and FAQs are available online at: http://wiki.libsdl.org/ If you need help with the library, or just want to discuss SDL related issues, you can join the developers mailing list: http://www.libsdl.org/mailing-list.php Enjoy! Sam Lantinga (slouken@libsdl.org)