2014-12-22 08:25:27 +00:00
#!/bin/sh
2013-01-23 13:08:55 +00:00
2014-12-22 08:25:27 +00:00
error_on_quit = 0
2013-01-23 13:08:55 +00:00
2014-12-23 11:28:48 +00:00
echo_err( ) {
echo " $@ " >& 2
2015-01-14 11:47:05 +00:00
error_on_quit = 1
2014-12-23 11:28:48 +00:00
}
2014-12-22 08:25:27 +00:00
check_installed( ) {
if [ -z " $( which $1 ) " ] ; then
2014-12-23 11:28:48 +00:00
echo_err " Could not find $1 . Please install $2 . "
2014-12-22 08:25:27 +00:00
return 1
fi
return 0
}
2013-01-23 13:08:55 +00:00
2014-12-23 11:28:48 +00:00
for prog in automake autoconf pkg-config java ant yasm nasm wget; do
check_installed " $prog " "it"
done
check_installed "libtoolize" "libtool"
2014-12-22 08:25:27 +00:00
check_installed "ndk-build" "android NDK"
if check_installed "android" "android SDK" ; then
check_installed "adb" "android SDK platform tools"
# check that at least one target is installed
if [ -z " $( android list target -c) " ] ; then
2014-12-23 11:28:48 +00:00
echo_err "Install at least one android target in the android SDK"
2014-12-22 08:25:27 +00:00
fi
2013-01-23 13:08:55 +00:00
fi
2014-12-23 11:28:48 +00:00
if nasm -f elf32 2>& 1 | grep -q "fatal: unrecognised output format" ; then
echo_err "Invalid version of nasm: your version does not support elf32 output format. If you have installed nasm, please check that your PATH env variable is set correctly."
fi
if ! ( find submodules/linphone/mediastreamer2 -mindepth 1 2>/dev/null | grep -q . \
|| find submodules/linphone/oRTP -mindepth 1 2>/dev/null | grep -q .) ; then
echo_err "Missing some git submodules. Did you run 'git submodule update --init --recursive'?"
fi
2015-01-14 11:47:05 +00:00
# Android NDK should NOT be simlinked!
2015-01-15 10:25:26 +00:00
if [ -L " $ANDROID_NDK " ] && [ -d " $ANDROID_NDK " ] ; then
2015-01-14 11:50:23 +00:00
echo_err " ANDROID_NDK= $ANDROID_NDK must NOT be a symbolic link, please modify it accordingly "
2015-01-14 11:47:05 +00:00
fi
2013-01-23 13:08:55 +00:00
2014-12-22 08:25:27 +00:00
if [ $error_on_quit = 0 ] ; then
2014-12-23 11:28:48 +00:00
rm -f check_tools.mk
touch check_tools.mk
2014-12-22 08:25:27 +00:00
echo " JAVA=\" $( which java) \" " >> check_tools.mk
echo " ANTLR=\" $( which java) \" -jar \"submodules/externals/antlr3/antlr-3.2.jar\" " >> check_tools.mk
2014-12-23 11:28:48 +00:00
else
echo "Failed to detect required tools, aborting."
2013-01-23 13:08:55 +00:00
fi
2014-12-22 08:25:27 +00:00
exit $error_on_quit