diff --git a/ffmpeg-android-maker.sh b/ffmpeg-android-maker.sh index 19b2780..8cba281 100755 --- a/ffmpeg-android-maker.sh +++ b/ffmpeg-android-maker.sh @@ -18,6 +18,9 @@ export SCRIPTS_DIR=${BASE_DIR}/scripts # All FFmpeg's libraries and headers are copied there export OUTPUT_DIR=${BASE_DIR}/output +# Check the host machine for proper setup and fail fast otherwise +${SCRIPTS_DIR}/check-host-machine.sh || exit 1 + # Directory to use as a place to build/install FFmpeg and its dependencies BUILD_DIR=${BASE_DIR}/build # Separate directory to build FFmpeg to diff --git a/scripts/check-host-machine.sh b/scripts/check-host-machine.sh new file mode 100755 index 0000000..faf3280 --- /dev/null +++ b/scripts/check-host-machine.sh @@ -0,0 +1,16 @@ +#!/usr/bin/env bash + +function checkVariablePresence() { + VARIABLE_NAME=$1 + if [[ -z "${!VARIABLE_NAME}" ]]; then + echo "The ${VARIABLE_NAME} environment variable isn't defined" + echo $2 + exit 1 + fi +} + +checkVariablePresence "ANDROID_SDK_HOME" \ + "The variable should be set to the actual Android SDK path" || exit 1 + +checkVariablePresence "ANDROID_NDK_HOME" \ + "The variable should be set to the actual Android NDK path" || exit 1