+ AC_FAIL "ERROR: $MAKE --version does not return sensible output?"
+fi
+expr "$MAKE_VERSION" '>=' '3.81' || AC_FAIL "ERROR: $MAKE must be >= version 3.81"
+
+AC_SUB bup_make "$MAKE"
+
+
+# Haven't seen a documented way to determine the python version via
+# python-config right now, so we'll defer version checking until
+# later.
+
+if test "$BUP_PYTHON_CONFIG"; then
+ bup_python_config="$(type -p "$BUP_PYTHON_CONFIG")"
+ if test -z "$bup_python_config"; then
+ AC_FAIL $(printf "ERROR: BUP_PYTHON_CONFIG value %q appears invalid" \
+ "$BUP_PYTHON_CONFIG")
+ fi
+else
+ for py_maj_ver in 9 8 7 6; do
+ bup_python_config="$(bup_find_prog "python3.$py_maj_ver-config" '')"
+ test -z "$bup_python_config" || break
+ done
+ test -z "$bup_python_config" \
+ && bup_python_config="$(bup_find_prog python3-config '')"
+ test -z "$bup_python_config" \
+ && bup_python_config="$(bup_find_prog python2.7-config '')"
+ if test -z "$bup_python_config"; then
+ AC_FAIL "ERROR: unable to find a suitable python-config"
+ fi
+fi
+
+
+bup_python_cflags=$("$bup_python_config" --cflags) || exit $?
+bup_python_ldflags=$("$bup_python_config" --ldflags) || exit $?
+bup_python_cflags_embed=$("$bup_python_config" --cflags --embed)
+if test $? -eq 0; then
+ bup_python_ldflags_embed=$("$bup_python_config" --ldflags --embed) || exit $?
+else # Earlier versions didn't support --embed
+ bup_python_cflags_embed=$("$bup_python_config" --cflags) || exit $?
+ bup_python_ldflags_embed=$("$bup_python_config" --ldflags) || exit $?
+fi
+
+bup_python_cflags="$bup_python_cflags -fPIC"
+
+case "$OSTYPE" in
+ darwin*)
+ # For at least 10.3+ (2003+)
+ bup_python_ldflags="$bup_python_ldflags -bundle -undefined dynamic_lookup"
+ ;;
+ *)
+ bup_python_ldflags="$bup_python_ldflags -shared"
+ ;;
+esac
+
+AC_SUB bup_python_config "$bup_python_config"
+AC_SUB bup_python_cflags "$bup_python_cflags"
+AC_SUB bup_python_ldflags "$bup_python_ldflags"
+AC_SUB bup_python_cflags_embed "$bup_python_cflags_embed"
+AC_SUB bup_python_ldflags_embed "$bup_python_ldflags_embed"
+
+
+bup_git="$(bup_find_prog git '')"
+if test -z "$bup_git"; then
+ AC_FAIL "ERROR: unable to find git"
+fi
+
+# For stat.
+AC_CHECK_HEADERS sys/stat.h
+AC_CHECK_HEADERS sys/types.h
+
+# For stat and mincore.
+AC_CHECK_HEADERS unistd.h
+
+# For mincore.
+AC_CHECK_HEADERS sys/mman.h
+
+# For FS_IOC_GETFLAGS and FS_IOC_SETFLAGS.
+AC_CHECK_HEADERS linux/fs.h
+AC_CHECK_HEADERS sys/ioctl.h
+
+# On GNU/kFreeBSD utimensat is defined in GNU libc, but won't work.
+if [ -z "$OS_GNU_KFREEBSD" ]; then
+ AC_CHECK_FUNCS utimensat