1 #!/bin/sh 2 3 set -e 4 export LANG=C 5 export LC_ALL=C 6 7 PROGDIR=$(dirname "$0") 8 9 EXENAME=android_support_unittests 10 EXECUTABLE=${EXECUTABLE:-/tmp/ndk-$USER/$EXENAME} 11 12 CXX=${CXX:-g++} 13 CXXFLAGS="-Werror -Wall" 14 LDFLAGS= 15 LINK_LIBS="" 16 17 # NOTE: libdl_unittest.cc can not run on Ubuntu because dladdr is missing 18 19 SOURCES="\ 20 ctype_unittest.cc \ 21 math_unittest.cc \ 22 stdio_unittest.cc \ 23 wchar_unittest.cc \ 24 " 25 26 MINITEST_INCLUDES="-I." 27 MINITEST_SOURCES="minitest/minitest.cc" 28 29 CXXFLAGS="$CXXFLAGS $MINITEST_INCLUDES" 30 SOURCES="$SOURCES $MINITEST_SOURCES" 31 32 mkdir -p $(dirname "$EXECUTABLE") 33 cd $PROGDIR 34 $CXX -o "$EXECUTABLE" $SOURCES $CXXFLAGS $LINK_LIBS $LDFLAGS 35 "$EXECUTABLE" 36 37