Android documentation
[freeglut] / README.android
1 Create a module compatible with the NDK build-system
2 ====================================================
3
4 - Use your own cross-compiler for Android, or export the one from the
5   NDK:
6
7   /usr/src/android-ndk-r7/build/tools/make-standalone-toolchain.sh \
8     --platform=android-9 \
9     --install-dir=/usr/src/ndk-standalone-9
10
11 - Build FreeGLUT with a '/freeglut' prefix :
12
13   PATH=/usr/src/ndk-standalone-9/bin:$PATH
14   cd /usr/src/freeglut-3.0.0/
15   cmake \
16     -D CMAKE_TOOLCHAIN_FILE=android_toolchain.cmake \
17     -D CMAKE_INSTALL_PREFIX=/freeglut \
18     -D FREEGLUT_GLES2=ON \
19     -D FREEGLUT_BUILD_DEMOS=NO \
20     .
21   make -j4
22   make install DESTDIR=$(pwd)
23
24 - Copy Android.mk in the new 'freeglut/' directory :
25
26   cp android/Android.mk freeglut/
27
28 - Reference this module in your jni/Android.mk:
29
30   LOCAL_STATIC_LIBRARIES := ... freeglut
31   ...
32   $(call import-module,freeglut)
33
34 - You now can point your NDK_MODULE_PATH to this module!
35
36   ndk-build NDK_MODULE_PATH=/usr/src/freeglut-3.0.0/freeglut/
37
38
39 Compile FreeGLUT for a traditional cross-compiler environment
40 =============================================================
41
42 - Use your own cross-compiler for Android, or export the one from the
43   NDK:
44
45   /usr/src/android-ndk-r7/build/tools/make-standalone-toolchain.sh \
46     --platform=android-9 \
47     --install-dir=/usr/src/ndk-standalone-9
48
49 - Compile FreeGLUT and install it in your Android cross-compiler path:
50
51   PATH=/usr/src/ndk-standalone-9/bin:$PATH
52   ./configure --host=arm-linux-androideabi --prefix=/usr/src/ndk-standalone-9
53   make
54   make install
55
56 - Compile your own project, for instance if you use the autotools:
57
58   PATH=/usr/src/ndk-standalone-9/bin:$PATH
59   ./configure --host=arm-linux-androideabi --prefix=/somewhere
60   make
61   make install