]> arthur.barton.de Git - bup.git/blob - config/configure
Eject pages after save more selectively
[bup.git] / config / configure
1 #!/bin/sh
2
3 bup_find_prog()
4 {
5     # Prints prog path to stdout or nothing.
6     local name="$1" result="$2"
7     TLOGN "checking for $name"
8     if ! [ "$result" ]; then
9         result=`acLookFor "$name"`
10     fi
11     TLOG " ($result)"
12     echo "$result"
13 }
14
15 TARGET=bup
16
17 . ./configure.inc
18
19 AC_INIT $TARGET
20
21 if ! AC_PROG_CC; then
22     LOG " You need to have a functional C compiler to build $TARGET"
23     exit 1
24 fi
25
26 MAKE="$(bup_find_prog make $MAKE)"
27 if test -z "$MAKE"; then
28     MAKE="$(bup_find_prog gmake "$GMAKE")"
29 fi
30
31 if test -z "$MAKE"; then
32     AC_FAIL "ERROR: unable to find make"
33 fi
34
35 if ! ($MAKE --version | grep "GNU Make"); then
36     AC_FAIL "ERROR: $MAKE is not GNU Make"
37 fi
38
39 MAKE_VERSION=`$MAKE --version | grep "GNU Make" | awk '{print $3}'`
40 if [ -z "$MAKE_VERSION" ]; then
41     AC_FAIL "ERROR: $MAKE --version does not return sensible output?"
42 fi
43 expr "$MAKE_VERSION" '>=' '3.81' || AC_FAIL "ERROR: $MAKE must be >= version 3.81"
44
45 if test -z "$(bup_find_prog python '')"; then
46     AC_FAIL "ERROR: unable to find python"
47 fi
48
49 if test -z "$(bup_find_prog git '')"; then
50     AC_FAIL "ERROR: unable to find git"
51 fi
52
53 # For stat.
54 AC_CHECK_HEADERS sys/stat.h
55 AC_CHECK_HEADERS sys/types.h
56 AC_CHECK_HEADERS unistd.h
57
58 # For FS_IOC_GETFLAGS and FS_IOC_SETFLAGS.
59 AC_CHECK_HEADERS linux/fs.h
60 AC_CHECK_HEADERS sys/ioctl.h
61
62 # On GNU/kFreeBSD utimensat is defined in GNU libc, but won't work.
63 if [ -z "$OS_GNU_KFREEBSD" ]; then
64     AC_CHECK_FUNCS utimensat
65 fi
66 AC_CHECK_FUNCS utimes
67 AC_CHECK_FUNCS lutimes
68 AC_CHECK_FUNCS mincore
69
70 AC_CHECK_FIELD stat st_atim sys/types.h sys/stat.h unistd.h
71 AC_CHECK_FIELD stat st_mtim sys/types.h sys/stat.h unistd.h
72 AC_CHECK_FIELD stat st_ctim sys/types.h sys/stat.h unistd.h
73
74 AC_CHECK_FIELD stat st_atimensec sys/types.h sys/stat.h unistd.h
75 AC_CHECK_FIELD stat st_mtimensec sys/types.h sys/stat.h unistd.h
76 AC_CHECK_FIELD stat st_ctimensec sys/types.h sys/stat.h unistd.h
77
78 AC_CHECK_FIELD tm tm_gmtoff time.h
79
80 AC_OUTPUT config.vars