Home | History | Annotate | Download | only in issue64679-prctl
      1 # Check if some platform headers can be included alone
      2 # See b.android.com/64679 for one of them
      3 #
      4 
      5 export ANDROID_NDK_ROOT=$NDK
      6 
      7 NDK_BUILDTOOLS_PATH=$NDK/build/tools
      8 . $NDK/build/tools/prebuilt-common.sh
      9 
     10 INTERNAL_HEADERS="sys/_errdefs.h sys/_sigdefs.h sys/_system_properties.h"
     11 
     12 for API_LEVEL in $API_LEVELS; do
     13     for ARCH in $DEFAULT_ARCHS; do
     14         if [ -d $ANDROID_NDK_ROOT/platforms/android-$API_LEVEL/arch-$ARCH ]; then
     15             HEADERS=`cd $ANDROID_NDK_ROOT/platforms/android-$API_LEVEL/arch-$ARCH/usr/include ; ls *.h sys/*.h android/*.h EGL/*.h GLES/*.h GLES2/*.h GLES3/*.h OMXAL/*.h SLES/*.h 2> /dev/null`
     16             #echo $API_LEVEL $ARCH HEADERS=$HEADERS
     17             ABIS=$(commas_to_spaces $(convert_arch_to_abi $ARCH))
     18             for ABI in $ABIS; do
     19                 for HEADER in $HEADERS; do
     20                     if [ "$INTERNAL_HEADERS" = "${INTERNAL_HEADERS%%$HEADER*}" ] ; then
     21                         #echo Compiling with $HEADER
     22                         $ANDROID_NDK_ROOT/ndk-build -B APP_CFLAGS=-DHEADER=\"\<$HEADER\>\" APP_PLATFORM=android-$API_LEVEL APP_ABI=$ABI 1>/dev/null 2>&1
     23                         fail_panic "Can't compile header $ANDROID_NDK_ROOT/platforms/android-$API_LEVEL/arch-$ARCH/usr/include/$HEADER alone.
     24 To reproduce: $ANDROID_NDK_ROOT/ndk-build -B APP_CFLAGS=-DHEADER=\"\<$HEADER\>\" APP_PLATFORM=android-$API_LEVEL APP_ABI=$ABI"
     25                     fi
     26                 done
     27             done
     28         fi
     29     done
     30 done
     31