From 549031e3b3aeb22fccb95d1b15052a977f6cb35c Mon Sep 17 00:00:00 2001 From: Rob Browning Date: Thu, 4 Jul 2013 14:12:22 -0500 Subject: [PATCH 1/1] config/configure: add and use bup_find_prog; remove unused MF_PATH_INCLUDEs. Pull all the common program search code into bup_find_prog() and use it everywhere. This also makes configure's output a bit more consistent in style/content. Make it obvious that at the moment bup doesn't pay any attention to a PYTHON or GIT environment variable value. i.e. bup currently ignores a setting like PYTHON=python2.7. Bup also doesn't use MF_PATH_INCLUDE settings yet, so remove them. Signed-off-by: Rob Browning --- config/configure | 52 +++++++++++++++++++----------------------------- 1 file changed, 21 insertions(+), 31 deletions(-) diff --git a/config/configure b/config/configure index fce0dde..6f47f84 100755 --- a/config/configure +++ b/config/configure @@ -1,5 +1,19 @@ #!/bin/sh +bup_find_prog() +{ + local name="$1" result="$2" + TLOGN "checking for $name" + if ! [ "$result" ]; then + result=`acLookFor "$name"` + if [ -z "$result" ]; then + AC_FAIL "\nERROR: unable to find $name" + fi + fi + TLOG " ($result)" + echo "$result" +} + TARGET=bup . ./configure.inc @@ -11,44 +25,20 @@ if ! AC_PROG_CC; then exit 1 fi -TLOGN "checking the GNU make" -[ -n "$MAKE" ] || MAKE=`acLookFor make` -if [ -z "$MAKE" ]; then - AC_FAIL " Cannot find make"; -fi +MAKE=`bup_find_prog make $MAKE` -MAKE_GNU=`$MAKE --version | grep "GNU Make"` -if [ -z "$MAKE_GNU" ]; then - AC_FAIL " $MAKE is not GNU Make" +if ! ($MAKE --version | grep "GNU Make"); then + AC_FAIL "ERROR: $MAKE is not GNU Make" fi MAKE_VERSION=`$MAKE --version | grep "GNU Make" | awk '{print $3}'` if [ -z "$MAKE_VERSION" ]; then - AC_FAIL " $MAKE --version does not return sensible output?" -fi -expr "$MAKE_VERSION" '>=' '3.81' || AC_FAIL "$MAKE must be >= version 3.81" -TLOG " ok" - -TLOGN "checking the python" -PYTHON=`acLookFor python` -if [ -z "$PYTHON" ]; then - AC_FAIL " Cannot find python"; + AC_FAIL "ERROR: $MAKE --version does not return sensible output?" fi -TLOG " - you have some python program - ok" - -TLOGN "checking the git" -GIT=`acLookFor git` -if [ -z "$GIT" ]; then - AC_FAIL " Cannot find git"; -fi -TLOG " - you have some git program - ok" - +expr "$MAKE_VERSION" '>=' '3.81' || AC_FAIL "ERROR: $MAKE must be >= version 3.81" -# assuming the above checks pass, get the path of everything -MF_PATH_INCLUDE GMAKE gmake make -MF_PATH_INCLUDE GIT git -MF_PATH_INCLUDE TAR tar gtar -MF_PATH_INCLUDE PYTHON python +bup_find_prog python '' +bup_find_prog git '' # For stat. AC_CHECK_HEADERS sys/stat.h -- 2.39.2