2012-03-11 11:45:20 +02:00
|
|
|
Status
|
|
|
|
======
|
|
|
|
|
2012-04-01 23:00:08 +03:00
|
|
|
See http://freeglut.sourceforge.net/docs/android.php
|
2012-03-11 11:45:20 +02:00
|
|
|
|
|
|
|
|
2012-03-11 11:18:53 +02:00
|
|
|
Create a module compatible with the NDK build-system
|
|
|
|
====================================================
|
|
|
|
|
|
|
|
- Use your own cross-compiler for Android, or export the one from the
|
|
|
|
NDK:
|
|
|
|
|
2012-04-15 21:47:07 +03:00
|
|
|
/usr/src/android-ndk-r7c/build/tools/make-standalone-toolchain.sh \
|
2012-03-11 11:18:53 +02:00
|
|
|
--platform=android-9 \
|
|
|
|
--install-dir=/usr/src/ndk-standalone-9
|
|
|
|
|
|
|
|
- Build FreeGLUT with a '/freeglut' prefix :
|
|
|
|
|
|
|
|
PATH=/usr/src/ndk-standalone-9/bin:$PATH
|
|
|
|
cd /usr/src/freeglut-3.0.0/
|
2012-04-19 23:53:47 +03:00
|
|
|
mkdir cross-android-module-gles2/
|
|
|
|
cd cross-android-module-gles2/
|
2012-03-11 11:18:53 +02:00
|
|
|
cmake \
|
2012-04-01 18:40:23 +03:00
|
|
|
-D CMAKE_TOOLCHAIN_FILE=../android_toolchain.cmake \
|
2012-04-03 01:22:33 +03:00
|
|
|
-D CMAKE_INSTALL_PREFIX=/freeglut-gles2 \
|
2012-04-19 23:53:47 +03:00
|
|
|
-D CMAKE_BUILD_TYPE=Debug \
|
2012-03-11 11:18:53 +02:00
|
|
|
-D FREEGLUT_GLES2=ON \
|
|
|
|
-D FREEGLUT_BUILD_DEMOS=NO \
|
2012-04-01 18:40:23 +03:00
|
|
|
..
|
2012-03-11 11:18:53 +02:00
|
|
|
make -j4
|
|
|
|
make install DESTDIR=$(pwd)
|
|
|
|
|
|
|
|
- Copy Android.mk in the new 'freeglut/' directory :
|
|
|
|
|
2012-04-03 01:22:33 +03:00
|
|
|
cp ../android/gles2/Android.mk freeglut-gles2/
|
2012-03-11 11:18:53 +02:00
|
|
|
|
|
|
|
- Reference this module in your jni/Android.mk:
|
|
|
|
|
2012-04-03 01:22:33 +03:00
|
|
|
LOCAL_STATIC_LIBRARIES := ... freeglut-gles2
|
2012-03-11 11:18:53 +02:00
|
|
|
...
|
2012-04-03 01:22:33 +03:00
|
|
|
$(call import-module,freeglut-gles2)
|
2012-03-11 11:18:53 +02:00
|
|
|
|
|
|
|
- You now can point your NDK_MODULE_PATH to this module!
|
|
|
|
|
2012-04-03 01:22:33 +03:00
|
|
|
ndk-build NDK_MODULE_PATH=/usr/src/freeglut-3.0.0/cross-android-module/freeglut-gles2/
|
2012-03-11 11:18:53 +02:00
|
|
|
|
|
|
|
|
|
|
|
Compile FreeGLUT for a traditional cross-compiler environment
|
|
|
|
=============================================================
|
|
|
|
|
|
|
|
- Use your own cross-compiler for Android, or export the one from the
|
|
|
|
NDK:
|
|
|
|
|
2012-04-15 21:47:07 +03:00
|
|
|
/usr/src/android-ndk-r7c/build/tools/make-standalone-toolchain.sh \
|
2012-03-11 11:18:53 +02:00
|
|
|
--platform=android-9 \
|
|
|
|
--install-dir=/usr/src/ndk-standalone-9
|
|
|
|
|
|
|
|
- Compile FreeGLUT and install it in your Android cross-compiler path:
|
|
|
|
|
|
|
|
PATH=/usr/src/ndk-standalone-9/bin:$PATH
|
2012-03-11 11:45:20 +02:00
|
|
|
cd /usr/src/freeglut-3.0.0/
|
2012-04-19 23:53:47 +03:00
|
|
|
mkdir cross-android-toolchain-gles2/
|
|
|
|
cd cross-android-toolchain-gles2/
|
2012-03-11 11:45:20 +02:00
|
|
|
cmake \
|
2012-04-01 18:40:23 +03:00
|
|
|
-D CMAKE_TOOLCHAIN_FILE=../android_toolchain.cmake \
|
2012-04-15 21:47:07 +03:00
|
|
|
-D CMAKE_INSTALL_PREFIX=/usr/src/ndk-standalone-9/sysroot/usr \
|
2012-04-19 23:53:47 +03:00
|
|
|
-D CMAKE_BUILD_TYPE=Debug \
|
2012-03-11 11:45:20 +02:00
|
|
|
-D FREEGLUT_GLES2=ON \
|
|
|
|
-D FREEGLUT_BUILD_DEMOS=NO \
|
2012-04-01 18:40:23 +03:00
|
|
|
..
|
2012-03-11 11:45:20 +02:00
|
|
|
make -j4
|
2012-03-11 11:18:53 +02:00
|
|
|
make install
|
2012-04-19 23:53:47 +03:00
|
|
|
# Only static for now:
|
|
|
|
rm -f /usr/src/ndk-standalone-9/sysroot/usr/lib/libfreeglut-gles1.so*
|
2012-03-11 11:18:53 +02:00
|
|
|
|
2012-03-15 22:48:32 +02:00
|
|
|
- Compile your own project.
|
|
|
|
|
|
|
|
For instance if you use the autotools:
|
2012-03-11 11:18:53 +02:00
|
|
|
|
|
|
|
PATH=/usr/src/ndk-standalone-9/bin:$PATH
|
2012-04-15 21:47:07 +03:00
|
|
|
export PKG_CONFIG_PATH=/usr/src/ndk-standalone-9/sysroot/usr/share/pkgconfig
|
2012-03-11 11:18:53 +02:00
|
|
|
./configure --host=arm-linux-androideabi --prefix=/somewhere
|
|
|
|
make
|
|
|
|
make install
|
2012-03-15 22:48:32 +02:00
|
|
|
|
|
|
|
If you use CMake, you may want to copy our Android toolchain
|
|
|
|
'android_toolchain.cmake':
|
|
|
|
|
2012-03-18 12:24:21 +02:00
|
|
|
PATH=/usr/src/ndk-standalone-9/bin:$PATH
|
2012-04-15 21:47:07 +03:00
|
|
|
export PKG_CONFIG_PATH=/usr/src/ndk-standalone-9/sysroot/usr/share/pkgconfig
|
2012-03-15 22:48:32 +02:00
|
|
|
cp .../android_toolchain.cmake .
|
2012-04-01 18:40:23 +03:00
|
|
|
mkdir cross-android/
|
|
|
|
cd cross-android/
|
2012-03-15 22:48:32 +02:00
|
|
|
cmake \
|
2012-04-01 18:40:23 +03:00
|
|
|
-D CMAKE_TOOLCHAIN_FILE=../android_toolchain.cmake \
|
2012-03-15 22:48:32 +02:00
|
|
|
-D CMAKE_INSTALL_PREFIX=/somewhere \
|
2012-04-19 23:53:47 +03:00
|
|
|
-D CMAKE_BUILD_TYPE=Debug \
|
2012-03-15 22:48:32 +02:00
|
|
|
-D MY_PROG_OPTION=something ... \
|
2012-04-01 18:40:23 +03:00
|
|
|
..
|
2012-03-15 22:48:32 +02:00
|
|
|
make -j4
|
|
|
|
make install
|