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