]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
build: check for needed commands in autogen.sh
authorVincent Bernat <vincent@bernat.im>
Fri, 5 Sep 2014 17:49:31 +0000 (19:49 +0200)
committerVincent Bernat <vincent@bernat.im>
Fri, 5 Sep 2014 17:50:10 +0000 (19:50 +0200)
And display a more informative message.

autogen.sh

index 75a67ff18e45f5131b6ebfb2f89410c28f5c6ae4..78e5d82b1bfc1aa8dce68a395a3127aabd07563c 100755 (executable)
@@ -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"