android:android-jni:ndkbuild-shell-for-linux
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| android:android-jni:ndkbuild-shell-for-linux [2010/11/30 17:40] – created percy | android:android-jni:ndkbuild-shell-for-linux [2016/05/05 13:07] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== NDK Shell for Linux ====== | + | ====== NDK Shell for Linux/ |
| 自己简单封装了一下ndk-build | 自己简单封装了一下ndk-build | ||
| Line 5: | Line 5: | ||
| - 通过修改build-static-library.mk, | - 通过修改build-static-library.mk, | ||
| - 直接解析Android.mk,支持设置安装目录,支持自动拷贝依赖的静态库 | - 直接解析Android.mk,支持设置安装目录,支持自动拷贝依赖的静态库 | ||
| + | - 添加了系统检测,同时支持Linux和Cygwin(Windows)环境。 | ||
| 使用方法 | 使用方法 | ||
| Line 10: | Line 11: | ||
| - 支持原来ndk-build参数,如:ndk clean,ndk -h等。 | - 支持原来ndk-build参数,如:ndk clean,ndk -h等。 | ||
| - | <code lang=shell> | + | update note: |
| + | - 解决了Windows下make.exe和Symbian编译环境的冲突 | ||
| + | - 同时支持了Linux和Cygwin(Windows)环境下编译 | ||
| + | |||
| + | <file lang=shell | ||
| #!/bin/sh | #!/bin/sh | ||
| Line 22: | Line 27: | ||
| # | # | ||
| #2.If you need to run this shell,you must cd to the RIGHT directory | #2.If you need to run this shell,you must cd to the RIGHT directory | ||
| - | #You MUST see ./jni/ | + | #You MUST see ./${ANDROID_MK},then this shell will run, |
| # | # | ||
| Line 29: | Line 34: | ||
| START_AT=`date` | START_AT=`date` | ||
| - | #Parsed list in Android.mk | ||
| INSTALL_DIR=" | INSTALL_DIR=" | ||
| MY_STATIC_LIBRARIES=" | MY_STATIC_LIBRARIES=" | ||
| Line 36: | Line 40: | ||
| CREATED_LIBRARIES_DIR=" | CREATED_LIBRARIES_DIR=" | ||
| + | |||
| #help() | #help() | ||
| Line 57: | Line 62: | ||
| #echo LOCAL_STATIC_LIBRARIES=$LOCAL_STATIC_LIBRARIES | #echo LOCAL_STATIC_LIBRARIES=$LOCAL_STATIC_LIBRARIES | ||
| + | HOST_OS=`uname -s` | ||
| BIN_ARMEABI=" | BIN_ARMEABI=" | ||
| + | |||
| + | echo " | ||
| + | #Check the OS,I find Linux and Cygwin has the different directory. | ||
| + | if [ " | ||
| + | BIN_ARMEABI=" | ||
| + | #elif [ " | ||
| + | else | ||
| + | BIN_ARMEABI=" | ||
| + | fi | ||
| + | |||
| mkdir -p ${BIN_ARMEABI} | mkdir -p ${BIN_ARMEABI} | ||
| STATIC_LIBRARIES=`grep ${MY_STATIC_LIBRARIES} ${ANDROID_MK}|grep -v ^#|cut -d " | STATIC_LIBRARIES=`grep ${MY_STATIC_LIBRARIES} ${ANDROID_MK}|grep -v ^#|cut -d " | ||
| Line 131: | Line 147: | ||
| else | else | ||
| echo "Find ndk-build successfully, | echo "Find ndk-build successfully, | ||
| + | HOST_OS=`uname -s` | ||
| + | echo " | ||
| + | echo " | ||
| + | if [ " | ||
| + | echo "" | ||
| + | else | ||
| + | #In Windows,the make maybe occur conflicts with othe make tool,so set the PATH here. | ||
| + | export PATH=/ | ||
| + | #echo " | ||
| + | fi | ||
| fi | fi | ||
| if [ ! -f ${ANDROID_MK} ];then | if [ ! -f ${ANDROID_MK} ];then | ||
| Line 193: | Line 219: | ||
| printTime | printTime | ||
| - | </code> | + | </file> |
/var/www/dokuwiki/wiki/data/attic/android/android-jni/ndkbuild-shell-for-linux.1291110013.txt.gz · Last modified: 2016/05/05 13:06 (external edit)
