Home | History | Annotate | Download | only in import-install
      1 cd `dirname $0`
      2 PWD=$(pwd)
      3 
      4 # Update NDK_MODULE_PATH so we can find our imported modules
      5 export 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>
     11 PARAM_ABIS=$(echo "$@" | tr ' ' '\n' | grep -e "^APP_ABI=")
     12 PARAM_ABIS=${PARAM_ABIS##APP_ABI=}
     13 if [ -z "$PARAM_ABIS" ]; then
     14     echo "NO ABIS in param '$@'"
     15     ABIS="armeabi armeabi-v7a x86 mips"
     16 else
     17     echo "FOUND ABIS in param '$@': $PARAM_ABIS"
     18     ABIS="$PARAM_ABIS"
     19 fi
     20 
     21 # Now ensure that all files were installed to all supported ABIs
     22 MISSING=
     23 for ABI in $ABIS; do
     24     DIR=$PWD/libs/$ABI
     25     for FILENAME in libfoo.so libpath1.so libpath2.so; do
     26         FILE=$DIR/$FILENAME
     27         if [ ! -f "$FILE" ]; then
     28             MISSING="$MISSING $FILE"
     29 	fi
     30     done
     31 done
     32 
     33 # In case of missing files, error out
     34 if [ "$MISSING" ]; then
     35     echo "ERROR: Missing files in build tree:"
     36     for FILE in $MISSING; do echo "  $FILE"; done
     37     exit 1
     38 fi
     39 
     40 # Otherwise, our test is good
     41 exit 0
     42