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