From: Vincent Bernat Date: Fri, 5 Sep 2014 17:49:31 +0000 (+0200) Subject: build: check for needed commands in autogen.sh X-Git-Tag: 0.7.11~21 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=17cd6a2ec9ede260a99dd997be0ec871c62370c1;p=thirdparty%2Flldpd.git build: check for needed commands in autogen.sh And display a more informative message. --- 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"