From 5b05e5a07a5dbee6267aca597d6b6503be97aaf6 Mon Sep 17 00:00:00 2001 From: vrld Date: Thu, 22 Mar 2012 12:43:52 +0100 Subject: [PATCH] Fix issue #396: Make automagic check for libtool and auto(conf|tools). --- platform/unix/automagic | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/platform/unix/automagic b/platform/unix/automagic index d885ea03b..d5932facf 100755 --- a/platform/unix/automagic +++ b/platform/unix/automagic @@ -1,15 +1,33 @@ #!/bin/bash +die() { + echo "Fatal: "$@ + exit 1 +} + +AUTOHEADER=$(which autoheader) +AUTOCONF=$(which autoconf) +LIBTOOLIZE=$(which libtoolize) +ACLOCAL=$(which aclocal) +AUTOMAKE=$(which automake) + +[[ -x ${AUTOHEADER} ]] || die "Could not find autoheader. Install autoconf." +[[ -x ${AUTOCONF} ]] || die "Could not find autoconf." +[[ -x ${LIBTOOLIZE} ]] || die "Could not find libtoolize. Install libtool." +[[ -x ${ACLOCAL} ]] || die "Could not find aclocal. Install automake." +[[ -x ${AUTOMAKE} ]] || die "Could not find automake." + automagic() { if ! sh platform/unix/gen-makefile; then echo "You should be doing this from the root directory of the project." exit 1 fi - autoheader 2>&1 || return 1 # Gimmie config.h.in - libtoolize --force 2>&1 || return 1 - aclocal 2>&1 || return 1 - autoconf 2>&1 || return 1 - automake -a 2>&1 || return 1 + + ${AUTOHEADER} 2>&1 || return 1 # Gimmie config.h.in + ${LIBTOOLIZE} --force 2>&1 || return 1 + ${ACLOCAL} 2>&1 || return 1 + ${AUTOCONF} 2>&1 || return 1 + ${AUTOMAKE} -a 2>&1 || return 1 } if [[ $1 == "-d" ]]; then