]> arthur.barton.de Git - bup.git/blobdiff - config/configure
Get TZ offset from C localtime, given tm_gmtoff
[bup.git] / config / configure
index e3866ecec15d30d44da14a18ab4ea84ea2362fce..ccc02b20559da2a8da40068f51b1708ed2f38e9a 100755 (executable)
@@ -2,13 +2,11 @@
 
 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"`
-        if [ -z "$result" ]; then
-            AC_FAIL "\nERROR: unable to find $name"
-        fi
     fi
     TLOG " ($result)"
     echo "$result"
@@ -25,7 +23,14 @@ 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
+
+if test -z "$MAKE"; then
+    AC_FAIL "ERROR: unable to find make"
+fi
 
 if ! ($MAKE --version | grep "GNU Make"); then
     AC_FAIL "ERROR: $MAKE is not GNU Make"
@@ -37,8 +42,13 @@ if [ -z "$MAKE_VERSION" ]; then
 fi
 expr "$MAKE_VERSION" '>=' '3.81' || AC_FAIL "ERROR: $MAKE must be >= version 3.81"
 
-bup_find_prog python ''
-bup_find_prog git ''
+if test -z "$(bup_find_prog python '')"; then
+    AC_FAIL "ERROR: unable to find python"
+fi
+
+if test -z "$(bup_find_prog git '')"; then
+    AC_FAIL "ERROR: unable to find git"
+fi
 
 # For stat.
 AC_CHECK_HEADERS sys/stat.h
@@ -50,7 +60,7 @@ 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_GNUKFREEBSD" ]; then
+if [ -z "$OS_GNU_KFREEBSD" ]; then
     AC_CHECK_FUNCS utimensat
 fi
 AC_CHECK_FUNCS utimes
@@ -64,4 +74,6 @@ AC_CHECK_FIELD stat st_atimensec sys/types.h sys/stat.h unistd.h
 AC_CHECK_FIELD stat st_mtimensec sys/types.h sys/stat.h unistd.h
 AC_CHECK_FIELD stat st_ctimensec sys/types.h sys/stat.h unistd.h
 
+AC_CHECK_FIELD tm tm_gmtoff time.h
+
 AC_OUTPUT config.vars