put the pid on each line of the log file to facilitate
[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
5AC_CANONICAL_SYSTEM
6AC_VALIDATE_CACHE_SYSTEM_TYPE
7
8dnl Checks for programs.
9AC_PROG_CC
10AC_PROG_INSTALL
11AC_SUBST(SHELL)
12
13AC_CHECK_PROG(HAVE_REMSH, remsh, 1, 0)
14AC_DEFINE_UNQUOTED(HAVE_REMSH, $HAVE_REMSH)
15
16AC_HEADER_DIRENT
17AC_HEADER_TIME
18AC_HEADER_SYS_WAIT
19AC_CHECK_HEADERS(sys/fcntl.h sys/select.h fcntl.h sys/time.h sys/unistd.h unistd.h utime.h grp.h)
20AC_CHECK_HEADERS(compat.h sys/param.h ctype.h sys/wait.h sys/ioctl.h)
21AC_CHECK_HEADERS(sys/filio.h string.h stdlib.h sys/socket.h sys/mode.h)
22AC_CHECK_HEADERS(glob.h)
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
37AC_CHECK_TYPE(ino_t,unsigned)
38
39echo $ac_n "checking for errno in errno.h... $ac_c"
40AC_TRY_COMPILE([#include <errno.h>],[int i = errno],
41echo yes; AC_DEFINE(HAVE_ERRNO_DECL),
42echo no)
43
44AC_FUNC_MEMCMP
45AC_FUNC_UTIME_NULL
46AC_CHECK_FUNCS(mmap munmap waitpid getcwd strdup strerror chown chmod mknod)
47AC_CHECK_FUNCS(fchmod fstat strchr readlink link utime utimes strftime)
48AC_CHECK_FUNCS(memmove getopt_long lchown vsnprintf snprintf setsid glob strpbrk)
49
50echo $ac_n "checking for working fnmatch... $ac_c"
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
56echo $ac_n "checking for long long ... $ac_c"
57AC_TRY_RUN([#include <stdio.h>
58main() { long long x = 1000000; x *= x; exit(((x/1000000) == 1000000)? 0: 1); }],
59echo yes;AC_DEFINE(HAVE_LONGLONG),
60echo no)
61
62echo $ac_n "checking for off64_t ... $ac_c"
63AC_TRY_RUN([#include <stdio.h>
64#include <sys/stat.h>
65main() { struct stat64 st; off64_t s; if (sizeof(off_t) == sizeof(off64_t)) return 1; exit((lstat64("/dev/null", &st)==0)?0:1); }],
66echo yes;AC_DEFINE(HAVE_OFF64_T),
67echo no)
68
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
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),
81echo no)
82
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;} ],
89echo yes - you are using the broken /usr/ucb/cc;AC_DEFINE(HAVE_BROKEN_READDIR),
90echo no)
91
92echo $ac_n "checking for utimbuf ... $ac_c"
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
99# The following test taken from the cvs sources
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.
124if test "$ac_cv_lib_socket_connect" = "yes" ||
125 test "$ac_cv_lib_inet_connect" = "yes"; then
126 ac_cv_func_connect=yes
127 AC_DEFINE(HAVE_CONNECT)
128fi])
129
130
131AC_OUTPUT(Makefile lib/dummy zlib/dummy)