forked from FreeRDP/FreeRDP
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added building of external profiler library.
- Loading branch information
1 parent
767425f
commit 6659af8
Showing
1 changed file
with
78 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
#!/bin/sh | ||
# | ||
# This script checks out or updates and builds third party libraries | ||
# required for the android build. | ||
# | ||
# Specifically these are: | ||
# - OpenSSL | ||
# - Android NDK Profiler | ||
# | ||
# Usage: | ||
# android_setup_build_env.sh <source root> | ||
|
||
OPENSSL_SCM=https://github.com/bmiklautz/android-external-openssl-ndk-static | ||
NDK_PROFILER_SCM=https://github.com/richq/android-ndk-profiler | ||
|
||
SCRIPT_NAME=`basename $0` | ||
|
||
if [ $# -ne 1 ]; then | ||
|
||
echo "Missing command line argument." | ||
echo "$SCRIPT_NAME <FreeRDP source>" | ||
exit -1 | ||
fi | ||
|
||
if [ ! -d $1 ]; then | ||
echo "Argument '$1' is not a directory." | ||
exit -2 | ||
fi | ||
SRC=`realpath $1` | ||
|
||
echo "Using '$SRC' as root." | ||
|
||
echo "Preparing OpenSSL..." | ||
OPENSSL_SRC=$SRC/external/openssl | ||
if [ -d $OPENSSL_SRC ]; then | ||
cd $OPENSSL_SRC | ||
git pull | ||
RETVAL=$? | ||
else | ||
git clone $OPENSSL_SCM $OPENSSL_SRC | ||
RETVAL=$? | ||
cd $OPENSSL_SRC | ||
fi | ||
if [ $RETVAL -ne 0 ]; then | ||
echo "Failed to execute git command [$RETVAL]" | ||
exit -3 | ||
fi | ||
ndk-build | ||
RETVAL=$? | ||
if [ $RETVAL -ne 0 ]; then | ||
echo "Failed to execute ndk-build command [$RETVAL]" | ||
exit -4 | ||
fi | ||
|
||
echo "Preparing NDK profiler..." | ||
NDK_PROFILER_SRC=$SRC/external/android-ndk-profiler | ||
if [ -d $NDK_PROFILER_SRC ]; then | ||
cd $NDK_PROFILER_SRC | ||
git pull | ||
RETVAL=$? | ||
else | ||
git clone $NDK_PROFILER_SCM $NDK_PROFILER_SRC | ||
RETVAL=$? | ||
cd $NDK_PROFILER_SRC | ||
fi | ||
if [ $RETVAL -ne 0 ]; then | ||
echo "Failed to execute git command [$RETVAL]" | ||
exit -5 | ||
fi | ||
ndk-build | ||
RETVAL=$? | ||
if [ $RETVAL -ne 0 ]; then | ||
echo "Failed to execute ndk-build command [$RETVAL]" | ||
exit -6 | ||
fi | ||
|
||
echo "Prepared external libraries, you can now build the application." | ||
exit 0 |