Updated build script, now also building jpeg library.

This commit is contained in:
Armin Novak 2013-11-21 09:46:58 +01:00 committed by Bernhard Miklautz
parent cf71df7881
commit f6a8c1e431

View File

@ -6,15 +6,19 @@
# Specifically these are:
# - OpenSSL
# - Android NDK Profiler
# - Jpeg library
#
# Usage:
# android_setup_build_env.sh <source root>
OPENSSL_SCM=https://github.com/akallabeth/openssl-android
NDK_PROFILER_SCM=https://github.com/richq/android-ndk-profiler
OPENSSL_SCM=https://github.com/akallabeth/openssl-android.git
NDK_PROFILER_SCM=https://github.com/richq/android-ndk-profiler.git
JPEG_LIBRARY_SCM=https://github.com/akallabeth/jpeg8d.git
SCRIPT_NAME=`basename $0`
if [ $# -ne 1 ]; then
echo "Missing command line argument, current directory as root."
ROOT=`pwd`
ROOT=$ROOT/external
@ -42,7 +46,6 @@ if [ $RETVAL -ne 0 ]; then
echo "Failed to execute git command [$RETVAL]"
exit -3
fi
cd $OPENSSL_SRC
make clean
# The makefile has a bug, which aborts during
@ -54,7 +57,6 @@ if [ $RETVAL -ne 0 ]; then
echo "Failed to execute make command [$RETVAL]"
exit -4
fi
# Copy the created library to the default openssl directory,
# so that CMake will detect it automatically.
SSL_ROOT=`find $OPENSSL_SRC -type d -name "openssl-?.?.*"`
@ -87,5 +89,28 @@ if [ $RETVAL -ne 0 ]; then
exit -6
fi
echo "Preparing JPEG library..."
JPEG_LIBRARY_SRC=$ROOT/jpeg8d
if [ -d $JPEG_LIBRARY_SRC ]; then
cd $JPEG_LIBRARY_SRC
git pull
RETVAL=$?
else
git clone $JPEG_LIBRARY_SCM $JPEG_LIBRARY_SRC
RETVAL=$?
fi
if [ $RETVAL -ne 0 ]; then
echo "Failed to execute git command [$RETVAL]"
exit -6
fi
cd $JPEG_LIBRARY_SRC
ndk-build V=1 APP_ABI=armeabi-v7a clean
ndk-build V=1 APP_ABI=armeabi-v7a
RETVAL=$?
if [ $RETVAL -ne 0 ]; then
echo "Failed to execute ndk-build command [$RETVAL]"
exit -7
fi
echo "Prepared external libraries, you can now build the application."
exit 0