From f55d7adcb12bfff0110af6740595fa8f5ca274a2 Mon Sep 17 00:00:00 2001 From: Arkadiusz Hiler Date: Fri, 11 Jun 2021 00:50:53 +0300 Subject: [PATCH] configure.sh: Check for host-side tools and warn if something is missing. The checks don't exit immediately so users won't have to rerun configure after installing only a single dependency. --- configure.sh | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) 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"