added two new options "max connections" and "lock file"
[rsync.git] / configure.in
1 dnl Process this file with autoconf to produce a configure script.
2 AC_INIT(byteorder.h)
3 AC_CONFIG_HEADER(config.h)
4
5 dnl Checks for programs.
6 AC_PROG_CC
7 AC_PROG_INSTALL
8 AC_SUBST(SHELL)
9
10 AC_CHECK_PROG(HAVE_REMSH, remsh, 1, 0)
11 AC_DEFINE_UNQUOTED(HAVE_REMSH, $HAVE_REMSH)
12
13 AC_HEADER_DIRENT
14 AC_HEADER_TIME
15 AC_HEADER_SYS_WAIT
16 AC_CHECK_HEADERS(sys/fcntl.h sys/select.h fcntl.h sys/time.h sys/unistd.h unistd.h utime.h grp.h)
17 AC_CHECK_HEADERS(compat.h sys/param.h ctype.h sys/wait.h sys/ioctl.h)
18 AC_CHECK_HEADERS(sys/filio.h string.h stdlib.h sys/socket.h sys/mode.h)
19
20 AC_CHECK_SIZEOF(int)
21 AC_CHECK_SIZEOF(long)
22 AC_CHECK_SIZEOF(short)
23
24 AC_C_INLINE
25
26 AC_TYPE_SIGNAL
27 AC_TYPE_UID_T
28 AC_TYPE_MODE_T
29 AC_TYPE_OFF_T
30 AC_TYPE_SIZE_T
31 AC_TYPE_PID_T
32 AC_STRUCT_ST_RDEV
33 AC_CHECK_TYPE(ino_t,unsigned)
34
35 echo $ac_n "checking for errno in errno.h... $ac_c"
36 AC_TRY_COMPILE([#include <errno.h>],[int i = errno],
37 echo yes; AC_DEFINE(HAVE_ERRNO_DECL),
38 echo no)
39
40 AC_FUNC_MEMCMP
41 AC_FUNC_MMAP
42 AC_FUNC_UTIME_NULL
43 AC_CHECK_FUNCS(waitpid strtok pipe getcwd mkdir strdup strerror chown chmod mknod)
44 AC_CHECK_FUNCS(fchmod fstat strchr bcopy bzero readlink link utime utimes)
45 AC_CHECK_FUNCS(memmove getopt_long lchown setlinebuf vsnprintf setsid)
46
47 echo $ac_n "checking for working fnmatch... $ac_c"
48 AC_TRY_RUN([#include <fnmatch.h>
49 main() { exit(fnmatch("*.o", "x.o", 0) == 0? 0: 1); }],
50 echo yes;AC_DEFINE(HAVE_FNMATCH), 
51 echo no)
52
53 echo $ac_n "checking for long long ... $ac_c"
54 AC_TRY_RUN([#include <stdio.h>
55 main() { long long x = 1000000; x *= x; exit(((x/1000000) == 1000000)? 0: 1); }],
56 echo yes;AC_DEFINE(HAVE_LONGLONG), 
57 echo no)
58
59 echo $ac_n "checking for off64_t ... $ac_c"
60 AC_TRY_RUN([#include <stdio.h>
61 #include <sys/stat.h>
62 main() { struct stat64 st; off64_t s; if (sizeof(off_t) == sizeof(off64_t)) return 1; exit((lstat64("/dev/null", &st)==0)?0:1); }],
63 echo yes;AC_DEFINE(HAVE_OFF64_T), 
64 echo no)
65
66 echo $ac_n "checking for unsigned char ... $ac_c"
67 AC_TRY_RUN([#include <stdio.h>
68 main() { char c; c=250; exit((c > 0)?0:1); }],
69 echo yes;AC_DEFINE(HAVE_UNSIGNED_CHAR), 
70 echo no)
71
72 echo $ac_n "checking for broken readdir ... $ac_c"
73 AC_TRY_RUN([#include <sys/types.h>
74 #include <dirent.h>
75 main() { struct dirent *di; DIR *d = opendir("."); di = readdir(d);
76 if (di && di->d_name[-2] == '.' && di->d_name[-1] == 0 &&
77 di->d_name[0] == 0) return 0; return 1;} ],
78 echo yes - you are using the broken /usr/ucb/cc;AC_DEFINE(HAVE_BROKEN_READDIR), 
79 echo no)
80
81 echo $ac_n "checking for utimbuf ... $ac_c"
82 AC_TRY_COMPILE([#include <sys/types.h>
83 #include <utime.h>],
84 [struct utimbuf tbuf;  tbuf.actime = 0; tbuf.modtime = 1; return utime("foo.c",&tbuf);],
85 echo yes;AC_DEFINE(HAVE_UTIMBUF), 
86 echo no)
87
88 # The following test taken from the cvs sources
89 # If we can't find connect, try looking in -lsocket, -lnsl, and -linet.
90 # The Irix 5 libc.so has connect and gethostbyname, but Irix 5 also has
91 # libsocket.so which has a bad implementation of gethostbyname (it
92 # only looks in /etc/hosts), so we only look for -lsocket if we need
93 # it.
94 AC_CHECK_FUNC(connect, :, 
95 [case "$LIBS" in
96 *-lnsl*) ;;
97 *) AC_CHECK_LIB(nsl_s, printf) ;;
98 esac
99 case "$LIBS" in
100 *-lnsl*) ;;
101 *) AC_CHECK_LIB(nsl, printf) ;;
102 esac
103 case "$LIBS" in
104 *-lsocket*) ;;
105 *) AC_CHECK_LIB(socket, connect) ;;
106 esac
107 case "$LIBS" in
108 *-linet*) ;;
109 *) AC_CHECK_LIB(inet, connect) ;;
110 esac
111 dnl We can't just call AC_CHECK_FUNCS(connect) here, because the value
112 dnl has been cached.
113 if test "$ac_cv_lib_socket_connect" = "yes" || 
114    test "$ac_cv_lib_inet_connect" = "yes"; then
115   ac_cv_func_connect=yes
116   AC_DEFINE(HAVE_CONNECT)
117 fi])
118
119
120 AC_OUTPUT(Makefile lib/dummy)