Commit 8f9d328b authored by Edward Wang's avatar Edward Wang

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

parent 04de4e9d
......@@ -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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment