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