NDK_TARGET=21
fi
+if [ -z $CMAKE_PROGRAM ]; then
+ CMAKE_PROGRAM=$(find $ANDROID_SDK/cmake -name cmake -type f -executable -print -quit)
+fi
+
if [ -z $CCACHE ]; then
CCACHE=$(which ccache)
fi
ANDROID_NDK="missing"
fi
+if [ -z $ANDROID_SDK ]; then
+ ANDROID_SDK="missing"
+fi
+
if [ -z $BUILD_DST ]; then
BUILD_DST=$(pwd)/libs
fi
echo "$(BASHSOURCE[0]) supports the following arguments:"
echo " --ndk The base directory of your android NDK defa"
echo " ANDROID_NDK=$ANDROID_NDK"
+ echo " --sdk The base directory of your android SDK defa"
+ echo " ANDROID_SDK=$ANDROID_SDK"
echo " --arch A list of architectures to build"
echo " BUILD_ARCH=$BUILD_ARCH"
echo " --dst The destination directory for include and library files"
shift
;;
+ --sdk)
+ ANDROID_SDK="$2"
+ CMAKE_PROGRAM=$(find $ANDROID_SDK/cmake -name cmake -type f -executable -print -quit)
+ shift
+ ;;
+
--arch)
BUILD_ARCH="$2"
shift
exit 1
fi
+ if [[ ! -d $ANDROID_SDK ]];
+ then
+ echo "export ANDROID_SDK to point to your SDK location."
+ exit 1
+ fi
if [[ -z $BUILD_DST ]];
then
echo "Destination directory not valid"
NDK_BUILD=ndk-build
fi
- if [[ -z $NDK_BUILD ]];
- then
- echo "Android ndk-build not detected"
- exit 1
- fi
+ if [ -z $CMAKE_PROGRAM ]; then
+ CMAKE_PROGRAM=$(find $ANDROID_SDK/cmake -name cmake -type f -executable -print -quit)
+ fi
- for CMD in make git cmake $NDK_BUILD
+ for CMD in make git $CMAKE_PROGRAM $NDK_BUILD
do
if ! type $CMD >/dev/null; then
echo "Command $CMD not found. Install and add it to the PATH."
common_run mkdir -p $BUILD_SRC/freerdp-build/$ARCH
common_run cd $BUILD_SRC/freerdp-build/$ARCH
common_run export ANDROID_NDK=$ANDROID_NDK
- common_run cmake $CMAKE_CMD_ARGS \
+ common_run $CMAKE_PROGRAM $CMAKE_CMD_ARGS \
-DANDROID_ABI=$ARCH \
-DCMAKE_INSTALL_PREFIX=$BUILD_DST/$ARCH \
-DCMAKE_INSTALL_LIBDIR=. \