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.
This commit is contained in:
Arkadiusz Hiler 2021-06-11 00:50:53 +03:00 committed by Andrew Eikum
parent 68fc0e1c11
commit f55d7adcb1

View File

@ -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"