4 See http://freeglut.sourceforge.net/docs/android.php
7 Create a module compatible with the NDK build-system
8 ====================================================
10 - Use your own cross-compiler for Android, or export the one from the
13 /usr/src/android-ndk-r7c/build/tools/make-standalone-toolchain.sh \
14 --platform=android-9 \
15 --install-dir=/usr/src/ndk-standalone-9
17 - Build FreeGLUT with a '/freeglut' prefix :
19 PATH=/usr/src/ndk-standalone-9/bin:$PATH
20 cd /usr/src/freeglut-3.0.0/
21 mkdir cross-android-module/
22 cd cross-android-module/
24 -D CMAKE_TOOLCHAIN_FILE=../android_toolchain.cmake \
25 -D CMAKE_INSTALL_PREFIX=/freeglut-gles2 \
26 -D FREEGLUT_GLES2=ON \
27 -D FREEGLUT_BUILD_DEMOS=NO \
30 make install DESTDIR=$(pwd)
32 - Copy Android.mk in the new 'freeglut/' directory :
34 cp ../android/gles2/Android.mk freeglut-gles2/
36 - Reference this module in your jni/Android.mk:
38 LOCAL_STATIC_LIBRARIES := ... freeglut-gles2
40 $(call import-module,freeglut-gles2)
42 - You now can point your NDK_MODULE_PATH to this module!
44 ndk-build NDK_MODULE_PATH=/usr/src/freeglut-3.0.0/cross-android-module/freeglut-gles2/
47 Compile FreeGLUT for a traditional cross-compiler environment
48 =============================================================
50 - Use your own cross-compiler for Android, or export the one from the
53 /usr/src/android-ndk-r7c/build/tools/make-standalone-toolchain.sh \
54 --platform=android-9 \
55 --install-dir=/usr/src/ndk-standalone-9
57 - Compile FreeGLUT and install it in your Android cross-compiler path:
60 PATH=/usr/src/ndk-standalone-9/bin:$PATH
61 cd /usr/src/freeglut-3.0.0/
62 mkdir cross-android-toolchain/
63 cd cross-android-toolchain/
65 -D CMAKE_TOOLCHAIN_FILE=../android_toolchain.cmake \
66 -D CMAKE_INSTALL_PREFIX=/usr/src/ndk-standalone-9/sysroot/usr \
67 -D FREEGLUT_GLES2=ON \
68 -D FREEGLUT_BUILD_DEMOS=NO \
73 - Compile your own project.
75 For instance if you use the autotools:
77 PATH=/usr/src/ndk-standalone-9/bin:$PATH
78 export PKG_CONFIG_PATH=/usr/src/ndk-standalone-9/sysroot/usr/share/pkgconfig
79 ./configure --host=arm-linux-androideabi --prefix=/somewhere
83 If you use CMake, you may want to copy our Android toolchain
84 'android_toolchain.cmake':
86 PATH=/usr/src/ndk-standalone-9/bin:$PATH
87 export PKG_CONFIG_PATH=/usr/src/ndk-standalone-9/sysroot/usr/share/pkgconfig
88 cp .../android_toolchain.cmake .
92 -D CMAKE_TOOLCHAIN_FILE=../android_toolchain.cmake \
93 -D CMAKE_INSTALL_PREFIX=/somewhere \
94 -D MY_PROG_OPTION=something ... \