• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1cd `dirname $0`
2PWD=$(pwd)
3
4# Update NDK_MODULE_PATH so we can find our imported modules
5export NDK_MODULE_PATH="$PWD"
6
7# Build everything
8$NDK/ndk-build "$@"
9
10# Extract ABIs list from parameters, we're looking for something like APP_ABI=<something>
11PARAM_ABIS=$(echo "$@" | tr ' ' '\n' | grep -e "^APP_ABI=")
12PARAM_ABIS=${PARAM_ABIS##APP_ABI=}
13if [ -z "$PARAM_ABIS" ]; then
14    echo "NO ABIS in param '$@'"
15    ABIS="armeabi armeabi-v7a x86 mips armeabi-v7a-hard"
16else
17    echo "FOUND ABIS in param '$@': $PARAM_ABIS"
18    ABIS="$PARAM_ABIS"
19fi
20
21# Now ensure that all files were installed to all supported ABIs
22ANDROID_NDK_ROOT=$NDK
23NDK_BUILDTOOLS_PATH=$NDK/build/tools
24source $NDK_BUILDTOOLS_PATH/prebuilt-common.sh
25MISSING=
26for ABI in $ABIS; do
27    DIR=$PWD/libs/$ABI
28    SUFFIX=$(get_lib_suffix_for_abi $ABI)
29    for FILENAME in libfoo$SUFFIX libpath1$SUFFIX libpath2$SUFFIX; do
30        FILE=$DIR/$FILENAME
31        if [ ! -f "$FILE" ]; then
32            MISSING="$MISSING $FILE"
33	fi
34    done
35done
36
37# In case of missing files, error out
38if [ "$MISSING" ]; then
39    echo "ERROR: Missing files in build tree:"
40    for FILE in $MISSING; do echo "  $FILE"; done
41    exit 1
42fi
43
44# Otherwise, our test is good
45exit 0
46