From 17cd6a2ec9ede260a99dd997be0ec871c62370c1 Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Fri, 5 Sep 2014 19:49:31 +0200 Subject: [PATCH] build: check for needed commands in autogen.sh And display a more informative message. --- autogen.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/autogen.sh b/autogen.sh index 75a67ff1..78e5d82b 100755 --- a/autogen.sh +++ b/autogen.sh @@ -22,6 +22,20 @@ AUTOCONF=${AUTOCONF:-autoconf} AUTOHEADER=${AUTOHEADER:-autoheader} AUTOMAKE=${AUTOMAKE:-automake} +# Check we have all tools installed +check_command() { + command -v "${1}" > /dev/null 2>&1 || { + >&2 echo "autogen.sh: could not find \`$1'. \`$1' is required to run autogen.sh." + exit 1 + } +} +check_command "$LIBTOOLIZE" +check_command "$AUTORECONF" +check_command "$ACLOCAL" +check_command "$AUTOCONF" +check_command "$AUTOHEADER" +check_command "$AUTOMAKE" + echo "autogen.sh: start libtoolize to get ltmain.sh" ${LIBTOOLIZE} --copy --force echo "autogen.sh: reconfigure with autoreconf" -- 2.39.5