diff --git a/configure.sh b/configure.sh index dac12fe5..c5660c31 100755 --- a/configure.sh +++ b/configure.sh @@ -31,6 +31,21 @@ die() { err "$@"; exit 1; } finish() { stat "$@"; exit 0; } cmd() { showcmd "$@"; "$@"; } +# +# Dependency Checks +# + +MISSING_DEPENDENCIES=0 + +dependency_command() { + local COMMAND=$1 + shift + if ! command -v "$COMMAND" &> /dev/null; then + err "Couldn't find command '$COMMAND'. Please install ${@:-$COMMAND}." + MISSING_DEPENDENCIES=1 + fi +} + # # Configure # @@ -64,6 +79,21 @@ function configure() { info "No build name specified, using default: $build_name" fi + dependency_command fontforge + dependency_command find "findutils" + dependency_command make "GNU Make" + dependency_command rsync + dependency_command wget + dependency_command xz + dependency_command patch + dependency_command autoconf + dependency_command git + dependency_command python3 + + if [ "$MISSING_DEPENDENCIES" -ne 0 ]; then + die "Missing dependencies, cannot continue." + fi + ## Write out config # Don't die after this point or we'll have rather unhelpfully deleted the Makefile [[ ! -e "$MAKEFILE" ]] || rm "$MAKEFILE"