[Android] compile.sh: generate an env.sh file for piecewise building

Edward Wang git at videolan.org
Sun Dec 2 16:11:30 CET 2012


vlc-ports/android | branch: master | Edward Wang <edward.c.wang at compdigitec.com> | Sat Dec  1 20:28:04 2012 -0500| [8f9d328bf6cf47196d9b53c1c7fbf90acf1806ad] | committer: Edward Wang

compile.sh: generate an env.sh file for piecewise building

> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=8f9d328bf6cf47196d9b53c1c7fbf90acf1806ad
---

 compile.sh |   60 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 59 insertions(+), 1 deletion(-)

diff --git a/compile.sh b/compile.sh
index 2a56698..594eabf 100755
--- a/compile.sh
+++ b/compile.sh
@@ -79,7 +79,8 @@ export PLATFORM_SHORT_ARCH
 
 # Add the NDK toolchain to the PATH, needed both for contribs and for building
 # stub libraries
-export PATH=${ANDROID_NDK}/toolchains/${PATH_HOST}-${GCCVER}/prebuilt/`uname|tr A-Z a-z`-x86/bin:${PATH}
+NDK_TOOLCHAIN_PATH=${ANDROID_NDK}/toolchains/${PATH_HOST}-${GCCVER}/prebuilt/`uname|tr A-Z a-z`-x86/bin
+export PATH=${NDK_TOOLCHAIN_PATH}:${PATH}
 
 # 1/ libvlc, libvlccore and its plugins
 TESTED_HASH=9aef14d5e5
@@ -224,3 +225,60 @@ export VLC_BUILD_DIR=vlc/android
 
 make distclean
 make -j1 TARGET_TUPLE=$TARGET_TUPLE PLATFORM_SHORT_ARCH=$PLATFORM_SHORT_ARCH CXXSTL=$CXXSTL $RELEASEFLAG
+
+# 3/ Environment script
+echo "Generating environment script."
+cat <<EOF
+This is a script that will export many of the variables used in this
+script. It will allow you to compile parts of the build without having
+to rebuild the entire build (e.g. recompile only the Java part).
+
+To use it, include the script into your shell, like this:
+    source env.sh
+
+Now, you can use this command to build the Java portion:
+    make -e
+
+The file will be automatically regenerated by compile.sh, so if you change
+your NDK/SDK locations or any build configurations, just re-run this
+script (sh compile.sh) and it will automatically update the file.
+
+EOF
+
+echo "# This file was automatically generated by compile.sh" > env.sh
+echo "# Re-run 'sh compile.sh' to update this file." >> env.sh
+
+# The essentials
+cat <<EssentialsA >> env.sh
+export ANDROID_ABI=$ANDROID_ABI
+export ANDROID_SDK=$ANDROID_SDK
+export ANDROID_NDK=$ANDROID_NDK
+export GCCVER=$GCCVER
+export CXXSTL=$CXXSTL
+export ANDROID_SYS_HEADERS_GINGERBREAD=$ANDROID_SYS_HEADERS_GINGERBREAD
+export ANDROID_SYS_HEADERS_HC=$ANDROID_SYS_HEADERS_HC
+export ANDROID_SYS_HEADERS_ICS=$ANDROID_SYS_HEADERS_ICS
+export ANDROID_LIBS=$ANDROID_LIBS
+export VLC_BUILD_DIR=$PWD/vlc/android
+export TARGET_TUPLE=$TARGET_TUPLE
+export PLATFORM_SHORT_ARCH=$PLATFORM_SHORT_ARCH
+EssentialsA
+
+# PATH
+echo "export PATH=$NDK_TOOLCHAIN_PATH:\${ANDROID_SDK}/platform-tools:\${PATH}" >> env.sh
+
+# CPU flags
+if [ -n "${HAVE_ARM}" ]; then
+    echo "export HAVE_ARM=1" >> env.sh
+elif [ -n "${HAVE_X86}" ]; then
+    echo "export HAVE_X86=1" >> env.sh
+elif [ -n "${HAVE_MIPS}" ]; then
+    echo "export HAVE_MIPS=1" >> env.sh
+fi
+
+if [ -n "${NO_ARMV6}" ]; then
+    echo "export NO_ARMV6=1" >> env.sh
+fi
+if [ -n "${NO_FPU}" ]; then
+    echo "export NO_FPU=1" >> env.sh
+fi



More information about the Android mailing list