2013-02-20 21:20:43 +01:00
|
|
|
#!/bin/bash
|
2013-02-21 08:50:53 +01:00
|
|
|
|
2013-02-20 20:51:42 +01:00
|
|
|
if [ ! -d "$ANDROID_SDK" ]; then
|
|
|
|
echo "ANDROID_SDK is not set"
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
if [ ! -d "$ANDROID_NDK" ]; then
|
|
|
|
echo "ANDROID_NDK is not set"
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
2013-08-04 06:48:27 +02:00
|
|
|
SCRIPT_LOC="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
2013-02-20 20:51:42 +01:00
|
|
|
|
2013-08-04 06:48:27 +02:00
|
|
|
if [ -z "$OSMAND_ARCHITECTURES_SET" ]; then
|
|
|
|
OSMAND_ARCHITECTURES_SET=(x86 mips arm armv5 armv7 armv7-neon)
|
|
|
|
export OSMAND_ARCHITECTURES_SET
|
2014-01-03 18:45:09 +01:00
|
|
|
echo Setting OSMAND_ARCHITECTURES_SET to default set of architectures
|
|
|
|
echo WARNING: exporting a bash ARRAY to environment, this might not work depending on your bash version. See BUGS section of "bash(1)" for details.
|
2013-05-10 00:54:42 +02:00
|
|
|
fi
|
|
|
|
|
2013-08-04 10:07:52 +02:00
|
|
|
if [[ "$(uname -a)" =~ Linux ]]; then
|
|
|
|
if [[ -z "$OSMAND_BUILD_CPU_CORES_NUM" ]]; then
|
|
|
|
OSMAND_BUILD_CPU_CORES_NUM=`nproc`
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
if [[ "$(uname -a)" =~ Darwin ]]; then
|
|
|
|
if [[ -z "$OSMAND_BUILD_CPU_CORES_NUM" ]]; then
|
|
|
|
OSMAND_BUILD_CPU_CORES_NUM=`sysctl hw.ncpu | awk '{print $2}'`
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2014-02-22 23:10:44 +01:00
|
|
|
OSMAND_ANDROID_EXTERNAL_DEPENDENCIES=(expat freetype gdal giflib glm glsl-optimizer jpeg libpng protobuf qtbase-android skia icu4c boost-android)
|
2013-08-04 06:50:12 +02:00
|
|
|
"$SCRIPT_LOC/../../core/externals/configure.sh" ${OSMAND_ANDROID_EXTERNAL_DEPENDENCIES[*]}
|
|
|
|
"$SCRIPT_LOC/../../core/externals/build.sh" ${OSMAND_ANDROID_EXTERNAL_DEPENDENCIES[*]}
|
2014-01-03 18:45:09 +01:00
|
|
|
(cd "$SCRIPT_LOC" && "$ANDROID_NDK/ndk-build" -j$OSMAND_BUILD_CPU_CORES_NUM "$@")
|