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