]> arthur.barton.de Git - bup.git/blobdiff - config/configure
sampledata: use a local absolute symlink, not /etc
[bup.git] / config / configure
index 6f339399fdd3005850636811e6b6ae323b200ee3..d6156d25b565fd77f4301ae5f02d1280e4fb0ff5 100755 (executable)
@@ -1,5 +1,17 @@
 #!/bin/sh
 
+bup_find_prog()
+{
+    # Prints prog path to stdout or nothing.
+    local name="$1" result="$2"
+    TLOGN "checking for $name"
+    if ! [ "$result" ]; then
+        result=`acLookFor "$name"`
+    fi
+    TLOG " ($result)"
+    echo "$result"
+}
+
 TARGET=bup
 
 . ./configure.inc
@@ -11,44 +23,32 @@ 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";
+MAKE="$(bup_find_prog make $MAKE)"
+if test -z "$MAKE"; then
+    MAKE="$(bup_find_prog gmake "$GMAKE")"
+fi
+
+if test -z "$MAKE"; then
+    AC_FAIL "ERROR: unable to find make"
 fi
 
-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?"
+    AC_FAIL "ERROR: $MAKE --version does not return sensible output?"
 fi
-expr "$MAKE_VERSION" '>=' '3.81' || AC_FAIL "$MAKE must be >= version 3.81"
-TLOG " ok"
+expr "$MAKE_VERSION" '>=' '3.81' || AC_FAIL "ERROR: $MAKE must be >= version 3.81"
 
-TLOGN "checking the python"
-PYTHON=`acLookFor python`
-if [ -z "$PYTHON" ]; then
-    AC_FAIL " Cannot find python";
+if test -z "$(bup_find_prog python '')"; then
+    AC_FAIL "ERROR: unable to find python"
 fi
-TLOG " - you have some python program - ok"
 
-TLOGN "checking the git"
-GIT=`acLookFor git`
-if [ -z "$GIT" ]; then
-    AC_FAIL " Cannot find git";
+if test -z "$(bup_find_prog git '')"; then
+    AC_FAIL "ERROR: unable to find git"
 fi
-TLOG " - you have some git program - ok"
-
-
-# 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
 
 # For stat.
 AC_CHECK_HEADERS sys/stat.h
@@ -58,10 +58,11 @@ AC_CHECK_HEADERS unistd.h
 # For FS_IOC_GETFLAGS and FS_IOC_SETFLAGS.
 AC_CHECK_HEADERS linux/fs.h
 AC_CHECK_HEADERS sys/ioctl.h
-# For attr related flags like EXT2_COMPR_FL.
-AC_CHECK_HEADERS ext2fs/ext2_fs.h
 
-AC_CHECK_FUNCS utimensat 
+# On GNU/kFreeBSD utimensat is defined in GNU libc, but won't work.
+if [ -z "$OS_GNU_KFREEBSD" ]; then
+    AC_CHECK_FUNCS utimensat
+fi
 AC_CHECK_FUNCS utimes
 AC_CHECK_FUNCS lutimes