]> arthur.barton.de Git - bup.git/blobdiff - config/configure
fix --strip-path (thanks to gevaerts)
[bup.git] / config / configure
index f250d1a32a486fccaaa2d975e6011c40216e32d6..1ea6757a3df313c29f5d27b4f7db0f1c00a622b5 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 bup_find_prog()
 {
@@ -37,7 +37,7 @@ if ! AC_PROG_CC; then
     exit 1
 fi
 
-MAKE="$(bup_find_prog make $MAKE)"
+MAKE="$(bup_find_prog make "$MAKE")"
 if test -z "$MAKE"; then
     MAKE="$(bup_find_prog gmake "$GMAKE")"
 fi
@@ -56,8 +56,17 @@ if [ -z "$MAKE_VERSION" ]; then
 fi
 expr "$MAKE_VERSION" '>=' '3.81' || AC_FAIL "ERROR: $MAKE must be >= version 3.81"
 
-if test -z "$(bup_find_prog python '')"; then
+AC_SUB bup_make "$MAKE"
+
+bup_python="$PYTHON"
+test -z "$bup_python" && bup_python="$(bup_find_prog python2.7 '')"
+test -z "$bup_python" && bup_python="$(bup_find_prog python2.6 '')"
+test -z "$bup_python" && bup_python="$(bup_find_prog python2 '')"
+test -z "$bup_python" && bup_python="$(bup_find_prog python '')"
+if test -z "$bup_python"; then
     AC_FAIL "ERROR: unable to find python"
+else
+    AC_SUB bup_python "$bup_python"
 fi
 
 if test -z "$(bup_find_prog git '')"; then
@@ -147,4 +156,9 @@ AC_CHECK_FIELD stat st_ctimensec sys/types.h sys/stat.h unistd.h
 
 AC_CHECK_FIELD tm tm_gmtoff time.h
 
+__config_files="$__config_files config.vars.sh"
+
 AC_OUTPUT config.vars
+
+printf 'bup_make=%q\n' "$MAKE" > config.vars.sh
+printf 'bup_python=%q\n' "$bup_python" >> config.vars.sh