X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=README.android;h=ec8b32dbfc554768831df18e3e342931f1ee5b04;hb=a98dd465e59abd3d295aaab17363e5a5f8e5c6b4;hp=71a18222cccf7bbad0ce815fb518d500d67925ec;hpb=8b08d68ba789289f1744c7d3724c6c6b118ead44;p=freeglut diff --git a/README.android b/README.android index 71a1822..ec8b32d 100644 --- a/README.android +++ b/README.android @@ -1,61 +1,83 @@ -Create a module compatible with the NDK build-system -==================================================== +Status +====== + +See http://freeglut.sourceforge.net/docs/android.php + + +Compile FreeGLUT +================ - Use your own cross-compiler for Android, or export the one from the - NDK: + Android NDK: - /usr/src/android-ndk-r7/build/tools/make-standalone-toolchain.sh \ + /usr/src/android-ndk-r7c/build/tools/make-standalone-toolchain.sh \ --platform=android-9 \ --install-dir=/usr/src/ndk-standalone-9 -- Build FreeGLUT with a '/freeglut' prefix : +- Compile FreeGLUT and install it in your Android cross-compiler path: PATH=/usr/src/ndk-standalone-9/bin:$PATH - cd /usr/src/freeglut-3.0.0/ + cd /usr/src/freeglut-x.x/ + mkdir cross-android-gles2/ + cd cross-android-gles2/ cmake \ - -D CMAKE_TOOLCHAIN_FILE=android_toolchain.cmake \ - -D CMAKE_INSTALL_PREFIX=/freeglut \ + -D CMAKE_TOOLCHAIN_FILE=../android_toolchain.cmake \ + -D CMAKE_INSTALL_PREFIX=/usr/src/ndk-standalone-9/sysroot/usr \ + -D CMAKE_BUILD_TYPE=Debug \ -D FREEGLUT_GLES2=ON \ -D FREEGLUT_BUILD_DEMOS=NO \ - . + .. make -j4 - make install DESTDIR=$(pwd) + make install + # Only static for now: + rm -f /usr/src/ndk-standalone-9/sysroot/usr/lib/libfreeglut-gles?.so* -- Copy Android.mk in the new 'freeglut/' directory : - cp android/Android.mk freeglut/ +Compile your own project using common build systems +=================================================== -- Reference this module in your jni/Android.mk: +For instance if you use the autotools: - LOCAL_STATIC_LIBRARIES := ... freeglut - ... - $(call import-module,freeglut) + PATH=/usr/src/ndk-standalone-9/bin:$PATH + export PKG_CONFIG_PATH=/usr/src/ndk-standalone-9/sysroot/usr/share/pkgconfig + ./configure --host=arm-linux-androideabi --prefix=/somewhere + make + make install -- You now can point your NDK_MODULE_PATH to this module! +If you use CMake, you may want to copy our Android toolchain +'android_toolchain.cmake': - ndk-build NDK_MODULE_PATH=/usr/src/freeglut-3.0.0/freeglut/ + PATH=/usr/src/ndk-standalone-9/bin:$PATH + export PKG_CONFIG_PATH=/usr/src/ndk-standalone-9/sysroot/usr/share/pkgconfig + cp .../freeglut-x.x/android_toolchain.cmake . + mkdir cross-android/ + cd cross-android/ + cmake \ + -D CMAKE_TOOLCHAIN_FILE=../android_toolchain.cmake \ + -D CMAKE_INSTALL_PREFIX=/somewhere \ + -D CMAKE_BUILD_TYPE=Debug \ + -D MY_PROG_OPTION=something ... \ + .. + make -j4 + make install -Compile FreeGLUT for a traditional cross-compiler environment -============================================================= +Compile your own project using the NDK build-system +=================================================== -- Use your own cross-compiler for Android, or export the one from the - NDK: +- Create a module hierarchy pointing to FreeGLUT, with our Android.mk: - /usr/src/android-ndk-r7/build/tools/make-standalone-toolchain.sh \ - --platform=android-9 \ - --install-dir=/usr/src/ndk-standalone-9 + mkdir freeglut-gles2/ + cp .../freeglut-x.x/android/gles2/Android.mk freeglut-gles2/ + ln -s /usr/src/ndk-standalone-9/sysroot/usr/include freeglut-gles2/include + ln -s /usr/src/ndk-standalone-9/sysroot/usr/lib freeglut-gles2/lib -- Compile FreeGLUT and install it in your Android cross-compiler path: +- Reference this module in your jni/Android.mk: - PATH=/usr/src/ndk-standalone-9/bin:$PATH - ./configure --host=arm-linux-androideabi --prefix=/usr/src/ndk-standalone-9 - make - make install + LOCAL_STATIC_LIBRARIES := ... freeglut-gles2 + ... + $(call import-module,freeglut-gles2) -- Compile your own project, for instance if you use the autotools: +- You now can point your NDK_MODULE_PATH to the directory containing the module: - PATH=/usr/src/ndk-standalone-9/bin:$PATH - ./configure --host=arm-linux-androideabi --prefix=/somewhere - make - make install + ndk-build NDK_MODULE_PATH=.