Improve check_tools script
This commit is contained in:
parent
8041f7da83
commit
3296ca83f1
1 changed files with 29 additions and 29 deletions
|
@ -1,37 +1,37 @@
|
||||||
#!/bin/bash
|
#!/bin/sh
|
||||||
|
|
||||||
rm -f check_tools.mk
|
rm -f check_tools.mk
|
||||||
touch check_tools.mk
|
touch check_tools.mk
|
||||||
|
|
||||||
# Check java
|
error_on_quit=0
|
||||||
JAVA=\"$(which java)\"
|
|
||||||
if [ -z ${JAVA} ]; then
|
check_installed() {
|
||||||
echo "Could not find java. Please install java";
|
if [ -z "$(which $1)" ]; then
|
||||||
exit -1;
|
echo "Could not find $1. Please install $2."
|
||||||
|
error_on_quit=1
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
check_installed "java" "it"
|
||||||
|
check_installed "ant" "it"
|
||||||
|
check_installed "yasm" "it"
|
||||||
|
check_installed "nasm" "it"
|
||||||
|
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
|
||||||
|
echo "Install at least one android target in android SDK"
|
||||||
|
error_on_quit=1
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check antlr
|
if [ $error_on_quit = 0 ]; then
|
||||||
ANTLR="${JAVA} -jar \"submodules/externals/antlr3/antlr-3.2.jar\"";
|
echo "JAVA=\"$(which java)\"" >> check_tools.mk
|
||||||
|
echo "ANTLR=\"$(which java)\" -jar \"submodules/externals/antlr3/antlr-3.2.jar\"" >> check_tools.mk
|
||||||
# Check NDK
|
|
||||||
NDK=$(which ndk-build)
|
|
||||||
if [ -z ${NDK} ]; then
|
|
||||||
echo "Could not find ndk-build. Please install android ndk";
|
|
||||||
exit -1;
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check SDK
|
exit $error_on_quit
|
||||||
SDK=$(which android)
|
|
||||||
if [ -z ${SDK} ]; then
|
|
||||||
echo "Could not find android. Please install android sdk";
|
|
||||||
exit -1;
|
|
||||||
fi
|
|
||||||
|
|
||||||
SDK_PLATFORM_TOOLS=$(which adb)
|
|
||||||
if [ -z ${SDK_PLATFORM_TOOLS} ]; then
|
|
||||||
echo "Could not find adb. Please install android sdk platform tools";
|
|
||||||
exit -1;
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo JAVA=${JAVA} >> check_tools.mk
|
|
||||||
echo ANTLR=${ANTLR} >> check_tools.mk
|
|
||||||
|
|
Loading…
Reference in a new issue