Add list of platforms that build.
[rsync/rsync.git] / configure.in
CommitLineData
c627d613 1dnl Process this file with autoconf to produce a configure script.
06963d0f 2
bf5c2bf6
MP
3AC_INIT()
4AC_CONFIG_SRCDIR([byteorder.h])
c627d613 5AC_CONFIG_HEADER(config.h)
7ca6e856 6AC_PREREQ(2.52)
c627d613 7
6a48ca56 8LDFLAGS=${LDFLAGS-""}
50abd20b 9
bf5c2bf6
MP
10AC_CANONICAL_TARGET([])
11
12dnl Checks for programs.
13AC_PROG_CC
14AC_PROG_CPP
15AC_PROG_INSTALL
16AC_SUBST(SHELL)
8de330a3 17
3966b9c6 18RSYNC_VERSION=2.4.7pre4
a358449a
MP
19AC_SUBST(RSYNC_VERSION)
20AC_DEFINE_UNQUOTED(RSYNC_VERSION, ["$RSYNC_VERSION"], [rsync release version])
21
2d1ebe9c
MP
22# compile with optimisation and without debugging by default, unless
23# --debug is given. We must decide this before testing the compiler.
24
bf5c2bf6 25AC_MSG_CHECKING([whether to include debugging symbols])
2d1ebe9c 26AC_ARG_ENABLE(debug,
bf5c2bf6
MP
27 AC_HELP_STRING([--enable-debug],
28 [including debugging symbols and features (default yes)]),
29 [], [])
2d1ebe9c 30
bf5c2bf6 31if test x"$enable_debug" = x"no"
2d1ebe9c 32then
2d1ebe9c
MP
33 AC_MSG_RESULT(no)
34 CFLAGS=${CFLAGS-"-O"}
bf5c2bf6
MP
35else
36 AC_MSG_RESULT([yes])
37 # leave CFLAGS alone; AC_PROG_CC will try to include -g if it can
38 AC_DEFINE(DEBUG, 1, [Define to turn on debugging code that may slow normal operation])
39 dnl CFLAGS=${CFLAGS-"-g"}
2d1ebe9c
MP
40fi
41
1ac15cd8
MP
42CFLAGS="$CFLAGS -DHAVE_CONFIG_H"
43
2d1ebe9c
MP
44AC_ARG_WITH(included-popt,
45 [ --with-included-popt use bundled popt library, not from system])
46
41bd28fe 47AC_ARG_WITH(rsync-path,
ddd491d4 48 [ --with-rsync-path=PATH set default --rsync-path to PATH (default: \"rsync\")],
8642efd0 49 [ RSYNC_PATH="$with_rsync_path" ],
41bd28fe 50 [ RSYNC_PATH="rsync" ])
c6a7f2f4 51AC_DEFINE_UNQUOTED(RSYNC_PATH, "$RSYNC_PATH", [ ])
41bd28fe 52
7b8356d0 53AC_CHECK_PROG(HAVE_REMSH, remsh, 1, 0)
d4e4cbe1 54AC_DEFINE_UNQUOTED(HAVE_REMSH, $HAVE_REMSH, [ ])
7b8356d0 55
f0af1e5e
AT
56
57# arrgh. libc in the current debian stable screws up the largefile
58# stuff, getting byte range locking wrong
59AC_CACHE_CHECK([for broken largefile support],rsync_cv_HAVE_BROKEN_LARGEFILE,[
60AC_TRY_RUN([
61#define _FILE_OFFSET_BITS 64
62#include <stdio.h>
63#include <fcntl.h>
64#include <sys/types.h>
65#include <sys/wait.h>
66
67int main(void)
68{
69 struct flock lock;
70 int status;
71 int fd = open("conftest.dat", O_CREAT|O_RDWR, 0600);
72 lock.l_type = F_WRLCK;
73 lock.l_whence = SEEK_SET;
74 lock.l_start = 0;
75 lock.l_len = 1;
76 lock.l_pid = 0;
77
78 fcntl(fd,F_SETLK,&lock);
79 if (fork() == 0) {
80 lock.l_start = 1;
81 exit(fcntl(fd,F_SETLK,&lock) == 0);
82 }
83 wait(&status);
84 unlink("conftest.dat");
85 exit(WEXITSTATUS(status));
86}
87],
88rsync_cv_HAVE_BROKEN_LARGEFILE=yes,rsync_cv_HAVE_BROKEN_LARGEFILE=no,rsync_cv_HAVE_BROKEN_LARGEFILE=cross)])
89if test x"$rsync_cv_HAVE_BROKEN_LARGEFILE" != x"yes"; then
90 AC_SYS_LARGEFILE
91fi
92
06963d0f
MP
93ipv6type=unknown
94ipv6lib=none
22cd0063 95ipv6trylibc=yes
06963d0f 96
17d5a07e
MP
97AC_ARG_ENABLE(ipv6,
98 AC_HELP_STRING([--disable-ipv6], [don't even try to use IPv6]))
99
100if test "x$enable_ipv6" != xno
101then
06963d0f
MP
102 AC_MSG_CHECKING([ipv6 stack type])
103 for i in inria kame linux-glibc linux-inet6 toshiba v6d zeta; do
104 case $i in
105 inria)
106 # http://www.kame.net/
107 AC_EGREP_CPP(yes, [
108#include <netinet/in.h>
109#ifdef IPV6_INRIA_VERSION
110yes
111#endif],
112 [ipv6type=$i;
a358449a
MP
113 AC_DEFINE(INET6, 1, [true if you have IPv6])
114 ])
06963d0f
MP
115 ;;
116 kame)
117 # http://www.kame.net/
118 AC_EGREP_CPP(yes, [
119#include <netinet/in.h>
120#ifdef __KAME__
121yes
122#endif],
a358449a
MP
123 [ipv6type=$i;
124 AC_DEFINE(INET6, 1, [true if you have IPv6])])
06963d0f
MP
125 ;;
126 linux-glibc)
127 # http://www.v6.linux.or.jp/
128 AC_EGREP_CPP(yes, [
129#include <features.h>
130#if defined(__GLIBC__) && __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1
131yes
132#endif],
133 [ipv6type=$i;
a358449a 134AC_DEFINE(INET6, 1, [true if you have IPv6])])
06963d0f
MP
135 ;;
136 linux-inet6)
137 # http://www.v6.linux.or.jp/
138 if test -d /usr/inet6 -o -f /usr/inet6/lib/libinet6.a; then
139 ipv6type=$i
140 ipv6lib=inet6
141 ipv6libdir=/usr/inet6/lib
142 ipv6trylibc=yes;
a358449a
MP
143 AC_DEFINE(INET6, 1, [true if you have IPv6])
144 CFLAGS="-I/usr/inet6/include $CFLAGS"
06963d0f
MP
145 fi
146 ;;
147 toshiba)
148 AC_EGREP_CPP(yes, [
149#include <sys/param.h>
150#ifdef _TOSHIBA_INET6
151yes
152#endif],
153 [ipv6type=$i;
154 ipv6lib=inet6;
155 ipv6libdir=/usr/local/v6/lib;
a358449a 156 AC_DEFINE(INET6, 1, [true if you have IPv6])])
06963d0f
MP
157 ;;
158 v6d)
159 AC_EGREP_CPP(yes, [
160#include </usr/local/v6/include/sys/v6config.h>
161#ifdef __V6D__
162yes
163#endif],
164 [ipv6type=$i;
165 ipv6lib=v6;
166 ipv6libdir=/usr/local/v6/lib;
a358449a 167 AC_DEFINE(INET6, 1, [true if you have IPv6])])
06963d0f
MP
168 ;;
169 zeta)
170 AC_EGREP_CPP(yes, [
171#include <sys/param.h>
172#ifdef _ZETA_MINAMI_INET6
173yes
174#endif],
175 [ipv6type=$i;
176 ipv6lib=inet6;
177 ipv6libdir=/usr/local/v6/lib;
a358449a 178 AC_DEFINE(INET6, 1, [true if you have IPv6])])
06963d0f
MP
179 ;;
180 esac
181 if test "$ipv6type" != "unknown"; then
182 break
183 fi
184 done
185 AC_MSG_RESULT($ipv6type)
06963d0f 186
17d5a07e
MP
187 AC_SEARCH_LIBS(getaddrinfo, inet6)
188fi
06963d0f 189
cd957c70 190AC_C_BIGENDIAN
c627d613 191AC_HEADER_DIRENT
c627d613
AT
192AC_HEADER_TIME
193AC_HEADER_SYS_WAIT
8bf73749 194AC_CHECK_HEADERS(sys/fcntl.h sys/select.h fcntl.h sys/time.h sys/unistd.h unistd.h utime.h grp.h)
94481d91 195AC_CHECK_HEADERS(compat.h sys/param.h ctype.h sys/wait.h sys/ioctl.h)
fdd71e17 196AC_CHECK_HEADERS(sys/filio.h string.h stdlib.h sys/socket.h sys/mode.h)
9dec7aa9 197AC_CHECK_HEADERS(glob.h alloca.h mcheck.h sys/sysctl.h arpa/inet.h arpa/nameser.h)
15c17078 198AC_CHECK_HEADERS(netdb.h)
c627d613
AT
199
200AC_CHECK_SIZEOF(int)
201AC_CHECK_SIZEOF(long)
202AC_CHECK_SIZEOF(short)
203
204AC_C_INLINE
205
206AC_TYPE_SIGNAL
207AC_TYPE_UID_T
208AC_TYPE_MODE_T
209AC_TYPE_OFF_T
210AC_TYPE_SIZE_T
211AC_TYPE_PID_T
9422bb3f 212AC_TYPE_GETGROUPS
bf5c2bf6
MP
213AC_CHECK_MEMBERS([struct stat.st_rdev])
214
e2ba16cc 215AC_CHECK_TYPE([ino_t], [unsigned])
7ca6e856 216TYPE_SOCKLEN_T
c627d613 217
7b3d4257 218AC_CACHE_CHECK([for errno in errno.h],rsync_cv_errno, [
7597e1a9 219 AC_TRY_COMPILE([#include <errno.h>],[int i = errno],
7b3d4257
AT
220 rsync_cv_errno=yes,rsync_cv_have_errno_decl=no)])
221if test x"$rsync_cv_errno" = x"yes"; then
d4e4cbe1 222 AC_DEFINE(HAVE_ERRNO_DECL, 1, [ ])
7597e1a9 223fi
c627d613 224
a784e10d
DD
225# The following test taken from the cvs sources
226# If we can't find connect, try looking in -lsocket, -lnsl, and -linet.
227# These need checks to be before checks for any other functions that
228# might be in the same libraries.
229# The Irix 5 libc.so has connect and gethostbyname, but Irix 5 also has
230# libsocket.so which has a bad implementation of gethostbyname (it
231# only looks in /etc/hosts), so we only look for -lsocket if we need
232# it.
233AC_CHECK_FUNCS(connect)
234if test x"$ac_cv_func_connect" = x"no"; then
235 case "$LIBS" in
236 *-lnsl*) ;;
237 *) AC_CHECK_LIB(nsl_s, printf) ;;
238 esac
239 case "$LIBS" in
240 *-lnsl*) ;;
241 *) AC_CHECK_LIB(nsl, printf) ;;
242 esac
243 case "$LIBS" in
244 *-lsocket*) ;;
245 *) AC_CHECK_LIB(socket, connect) ;;
246 esac
247 case "$LIBS" in
248 *-linet*) ;;
249 *) AC_CHECK_LIB(inet, connect) ;;
250 esac
251 dnl We can't just call AC_CHECK_FUNCS(connect) here, because the value
252 dnl has been cached.
253 if test x"$ac_cv_lib_socket_connect" = x"yes" ||
254 test x"$ac_cv_lib_inet_connect" = x"yes"; then
255 # ac_cv_func_connect=yes
256 # don't! it would cause AC_CHECK_FUNC to succeed next time configure is run
d4e4cbe1 257 AC_DEFINE(HAVE_CONNECT, 1, [ ])
a784e10d
DD
258 fi
259fi
260
8f694072
MP
261AC_CHECK_LIB(resolv, inet_ntop)
262
a037edac 263AC_MSG_NOTICE([Looking in libraries: $LIBS])
e94989fe
MP
264
265AC_CHECK_FUNC(inet_ntop, , AC_LIBOBJ(lib/inet_ntop))
266AC_CHECK_FUNC(inet_pton, , AC_LIBOBJ(lib/inet_pton))
356bbb83 267
82923068
MP
268AC_CHECK_FUNC(getaddrinfo, , AC_LIBOBJ(lib/getaddrinfo))
269AC_CHECK_FUNC(getnameinfo, , AC_LIBOBJ(lib/getnameinfo))
270
356bbb83
MP
271AC_CHECK_MEMBER([struct sockaddr.sa_len],
272 [ AC_DEFINE(HAVE_SOCKADDR_LEN) ],
273 [],
274 [
275#include <sys/types.h>
276#include <sys/socket.h>
277])
278
a784e10d
DD
279# if we can't find strcasecmp, look in -lresolv (for Unixware at least)
280#
281AC_CHECK_FUNCS(strcasecmp)
282if test x"$ac_cv_func_strcasecmp" = x"no"; then
283 AC_CHECK_LIB(resolv, strcasecmp)
284fi
285
c627d613 286AC_FUNC_MEMCMP
c627d613 287AC_FUNC_UTIME_NULL
e68f3481 288AC_CHECK_FUNCS(waitpid wait4 getcwd strdup strerror chown chmod mknod)
e0414f42 289AC_CHECK_FUNCS(fchmod fstat strchr readlink link utime utimes strftime)
8950ac03 290AC_CHECK_FUNCS(memmove lchown vsnprintf snprintf asprintf setsid glob strpbrk)
8ee3d639 291AC_CHECK_FUNCS(strlcat strlcpy mtrace)
24c857f1
DD
292
293AC_CACHE_CHECK([for working socketpair],rsync_cv_HAVE_SOCKETPAIR,[
6a5ef41f
MP
294AC_TRY_RUN([
295#include <sys/types.h>
296#include <sys/socket.h>
297
298main() {
299 int fd[2];
300 exit((socketpair(AF_UNIX, SOCK_STREAM, 0, fd) != -1) ? 0 : 1);
301}],
24c857f1
DD
302rsync_cv_HAVE_SOCKETPAIR=yes,rsync_cv_HAVE_SOCKETPAIR=no,rsync_cv_HAVE_SOCKETPAIR=cross)])
303if test x"$rsync_cv_HAVE_SOCKETPAIR" = x"yes"; then
d4e4cbe1 304 AC_DEFINE(HAVE_SOCKETPAIR, 1, [ ])
24c857f1 305fi
c627d613 306
79fc6bdb 307AC_CACHE_CHECK([for working fnmatch],rsync_cv_HAVE_FNMATCH,[
c627d613 308AC_TRY_RUN([#include <fnmatch.h>
e7d6e0aa
AT
309main() { exit((fnmatch("*.o", "x.o", FNM_PATHNAME) == 0 &&
310 fnmatch("a/b/*", "a/b/c/d", FNM_PATHNAME) != 0) ? 0: 1); }],
79fc6bdb
DD
311rsync_cv_HAVE_FNMATCH=yes,rsync_cv_HAVE_FNMATCH=no,rsync_cv_HAVE_FNMATCH=cross)])
312if test x"$rsync_cv_HAVE_FNMATCH" = x"yes"; then
d4e4cbe1 313 AC_DEFINE(HAVE_FNMATCH, 1, [ ])
79fc6bdb
DD
314fi
315
1ac15cd8
MP
316if test x"$with_included_popt" != x"yes"
317then
318 AC_CHECK_LIB(popt, poptGetContext, , [with_included_popt=yes])
319fi
2d1ebe9c 320
12458878 321AC_MSG_CHECKING([whether to use included libpopt])
2d1ebe9c
MP
322if test x"$with_included_popt" = x"yes"
323then
12458878 324 AC_MSG_RESULT($srcdir/popt)
1ac15cd8 325 BUILD_POPT='$(popt_OBJS)'
26ef00bd 326 CFLAGS="$CFLAGS -I$srcdir/popt"
2d1ebe9c
MP
327else
328 AC_MSG_RESULT(no)
79fc6bdb 329fi
c627d613 330
79fc6bdb 331AC_CACHE_CHECK([for long long],rsync_cv_HAVE_LONGLONG,[
0d0e2e93 332AC_TRY_RUN([#include <stdio.h>
efb2f6bf 333main() { long long x = 1000000; x *= x; exit(((x/1000000) == 1000000)? 0: 1); }],
79fc6bdb
DD
334rsync_cv_HAVE_LONGLONG=yes,rsync_cv_HAVE_LONGLONG=no,rsync_cv_HAVE_LONGLONG=cross)])
335if test x"$rsync_cv_HAVE_LONGLONG" = x"yes"; then
d4e4cbe1 336 AC_DEFINE(HAVE_LONGLONG, 1, [ ])
7597e1a9 337fi
0d0e2e93 338
7b3d4257 339AC_CACHE_CHECK([for off64_t],rsync_cv_HAVE_OFF64_T,[
bcacc18b
AT
340AC_TRY_RUN([#include <stdio.h>
341#include <sys/stat.h>
7597e1a9 342main() { struct stat64 st; off64_t s; if (sizeof(off_t) == sizeof(off64_t)) exit(1); exit((lstat64("/dev/null", &st)==0)?0:1); }],
7b3d4257
AT
343rsync_cv_HAVE_OFF64_T=yes,rsync_cv_HAVE_OFF64_T=no,rsync_cv_HAVE_OFF64_T=cross)])
344if test x"$rsync_cv_HAVE_OFF64_T" = x"yes"; then
d4e4cbe1 345 AC_DEFINE(HAVE_OFF64_T, 1, [ ])
7597e1a9 346fi
debb4505 347
79fc6bdb 348AC_CACHE_CHECK([for short ino_t],rsync_cv_HAVE_SHORT_INO_T,[
c29ee43d
AT
349AC_TRY_RUN([#include <stdio.h>
350#include <sys/types.h>
351#include <sys/stat.h>
352main() { if (sizeof(ino_t) < sizeof(unsigned int)) return 0; return 1; }],
79fc6bdb
DD
353rsync_cv_HAVE_SHORT_INO_T=yes,rsync_cv_HAVE_SHORT_INO_T=no,rsync_cv_HAVE_SHORT_INO_T=cross)])
354if test x"$rsync_cv_HAVE_SHORT_INO_T" = x"yes"; then
d4e4cbe1 355 AC_DEFINE(HAVE_SHORT_INO_T, 1, [ ])
79fc6bdb 356fi
c29ee43d 357
7b3d4257 358AC_CACHE_CHECK([for unsigned char],rsync_cv_HAVE_UNSIGNED_CHAR,[
debb4505
AT
359AC_TRY_RUN([#include <stdio.h>
360main() { char c; c=250; exit((c > 0)?0:1); }],
7b3d4257
AT
361rsync_cv_HAVE_UNSIGNED_CHAR=yes,rsync_cv_HAVE_UNSIGNED_CHAR=no,rsync_cv_HAVE_UNSIGNED_CHAR=cross)])
362if test x"$rsync_cv_HAVE_UNSIGNED_CHAR" = x"yes"; then
d4e4cbe1 363 AC_DEFINE(HAVE_UNSIGNED_CHAR, 1, [ ])
7597e1a9 364fi
bcacc18b 365
7b3d4257 366AC_CACHE_CHECK([for broken readdir],rsync_cv_HAVE_BROKEN_READDIR,[
59503278
AT
367AC_TRY_RUN([#include <sys/types.h>
368#include <dirent.h>
369main() { struct dirent *di; DIR *d = opendir("."); di = readdir(d);
370if (di && di->d_name[-2] == '.' && di->d_name[-1] == 0 &&
7597e1a9 371di->d_name[0] == 0) exit(0); exit(1);} ],
7b3d4257
AT
372rsync_cv_HAVE_BROKEN_READDIR=yes,rsync_cv_HAVE_BROKEN_READDIR=no,rsync_cv_HAVE_BROKEN_READDIR=cross)])
373if test x"$rsync_cv_HAVE_BROKEN_READDIR" = x"yes"; then
d4e4cbe1 374 AC_DEFINE(HAVE_BROKEN_READDIR, 1, [ ])
7597e1a9 375fi
1e9f155a 376
7b3d4257 377AC_CACHE_CHECK([for utimbuf],rsync_cv_HAVE_UTIMBUF,[
d6e6ecbd
AT
378AC_TRY_COMPILE([#include <sys/types.h>
379#include <utime.h>],
7597e1a9 380[struct utimbuf tbuf; tbuf.actime = 0; tbuf.modtime = 1; exit(utime("foo.c",&tbuf));],
7b3d4257
AT
381rsync_cv_HAVE_UTIMBUF=yes,rsync_cv_HAVE_UTIMBUF=no,rsync_cv_HAVE_UTIMBUF=cross)])
382if test x"$rsync_cv_HAVE_UTIMBUF" = x"yes"; then
d4e4cbe1 383 AC_DEFINE(HAVE_UTIMBUF, 1, [ ])
7597e1a9 384fi
d6e6ecbd 385
3060d4aa
AT
386AC_CACHE_CHECK([if gettimeofday takes tz argument],rsync_cv_HAVE_GETTIMEOFDAY_TZ,[
387AC_TRY_RUN([
388#include <sys/time.h>
389#include <unistd.h>
390main() { struct timeval tv; exit(gettimeofday(&tv, NULL));}],
391 rsync_cv_HAVE_GETTIMEOFDAY_TZ=yes,rsync_cv_HAVE_GETTIMEOFDAY_TZ=no,rsync_cv_HAVE_GETTIMEOFDAY_TZ=cross)])
392if test x"$rsync_cv_HAVE_GETTIMEOFDAY_TZ" = x"yes"; then
d4e4cbe1 393 AC_DEFINE(HAVE_GETTIMEOFDAY_TZ, 1, [ ])
3060d4aa
AT
394fi
395
8950ac03
AT
396AC_CACHE_CHECK([for C99 vsnprintf],rsync_cv_HAVE_C99_VSNPRINTF,[
397AC_TRY_RUN([
398#include <sys/types.h>
399#include <stdarg.h>
400void foo(const char *format, ...) {
401 va_list ap;
402 int len;
403 char buf[5];
404
405 va_start(ap, format);
406 len = vsnprintf(0, 0, format, ap);
407 va_end(ap);
408 if (len != 5) exit(1);
409
410 if (snprintf(buf, 3, "hello") != 5 || strcmp(buf, "he") != 0) exit(1);
411
412 exit(0);
413}
414main() { foo("hello"); }
415],
416rsync_cv_HAVE_C99_VSNPRINTF=yes,rsync_cv_HAVE_C99_VSNPRINTF=no,rsync_cv_HAVE_C99_VSNPRINTF=cross)])
417if test x"$rsync_cv_HAVE_C99_VSNPRINTF" = x"yes"; then
d4e4cbe1 418 AC_DEFINE(HAVE_C99_VSNPRINTF, 1, [ ])
8950ac03
AT
419fi
420
421
f62c17e3
AT
422AC_CACHE_CHECK([for secure mkstemp],rsync_cv_HAVE_SECURE_MKSTEMP,[
423AC_TRY_RUN([#include <stdlib.h>
424#include <sys/types.h>
425#include <sys/stat.h>
426#include <unistd.h>
427main() {
428 struct stat st;
429 char tpl[20]="/tmp/test.XXXXXX";
430 int fd = mkstemp(tpl);
431 if (fd == -1) exit(1);
432 unlink(tpl);
433 if (fstat(fd, &st) != 0) exit(1);
434 if ((st.st_mode & 0777) != 0600) exit(1);
435 exit(0);
436}],
437rsync_cv_HAVE_SECURE_MKSTEMP=yes,
438rsync_cv_HAVE_SECURE_MKSTEMP=no,
439rsync_cv_HAVE_SECURE_MKSTEMP=cross)])
440if test x"$rsync_cv_HAVE_SECURE_MKSTEMP" = x"yes"; then
d4e4cbe1 441 AC_DEFINE(HAVE_SECURE_MKSTEMP, 1, [ ])
f62c17e3
AT
442fi
443
3060d4aa 444
7b3d4257
AT
445AC_CACHE_CHECK([for broken inet_ntoa],rsync_cv_REPLACE_INET_NTOA,[
446AC_TRY_RUN([
447#include <stdio.h>
448#include <sys/types.h>
449#include <netinet/in.h>
450#include <arpa/inet.h>
451main() { struct in_addr ip; ip.s_addr = 0x12345678;
452if (strcmp(inet_ntoa(ip),"18.52.86.120") &&
fca3ef06
AT
453 strcmp(inet_ntoa(ip),"120.86.52.18")) { exit(1); }
454exit(0);}],
455 rsync_cv_REPLACE_INET_NTOA=no,rsync_cv_REPLACE_INET_NTOA=yes,rsync_cv_REPLACE_INET_NTOA=cross)])
7b3d4257 456if test x"$rsync_cv_REPLACE_INET_NTOA" = x"yes"; then
d4e4cbe1 457 AC_DEFINE(REPLACE_INET_NTOA, 1, [ ])
7b3d4257
AT
458fi
459
fca3ef06
AT
460
461AC_CACHE_CHECK([for broken inet_aton],rsync_cv_REPLACE_INET_ATON,[
462AC_TRY_RUN([
463#include <stdio.h>
464#include <sys/types.h>
465#include <netinet/in.h>
466#include <arpa/inet.h>
467main() { struct in_addr ip;
468if (inet_aton("example", &ip) == 0) exit(0); exit(1);}],
469 rsync_cv_REPLACE_INET_ATON=no,rsync_cv_REPLACE_INET_ATON=yes,rsync_cv_REPLACE_INET_ATON=cross)])
470if test x"$rsync_cv_REPLACE_INET_ATON" = x"yes"; then
d4e4cbe1 471 AC_DEFINE(REPLACE_INET_ATON, 1, [ ])
fca3ef06
AT
472fi
473
692da0b5
DD
474#
475# The following test was mostly taken from the tcl/tk plus patches
476#
79fc6bdb 477AC_CACHE_CHECK([whether -c -o works],rsync_cv_DASHC_WORKS_WITH_DASHO,[
692da0b5
DD
478rm -rf conftest*
479cat > conftest.$ac_ext <<EOF
480int main() { return 0; }
481EOF
482${CC-cc} -c -o conftest..o conftest.$ac_ext
483if test -f conftest..o; then
79fc6bdb
DD
484 rsync_cv_DASHC_WORKS_WITH_DASHO=yes
485else
486 rsync_cv_DASHC_WORKS_WITH_DASHO=no
487fi
488rm -rf conftest*
489])
490if test x"$rsync_cv_DASHC_WORKS_WITH_DASHO" = x"yes"; then
692da0b5
DD
491 OBJ_SAVE="#"
492 OBJ_RESTORE="#"
493 CC_SHOBJ_FLAG='-o $@'
692da0b5
DD
494else
495 OBJ_SAVE=' @b=`basename $@ .o`;rm -f $$b.o.sav;if test -f $$b.o; then mv $$b.o $$b.o.sav;fi;'
496 OBJ_RESTORE=' @b=`basename $@ .o`;if test "$$b.o" != "$@"; then mv $$b.o $@; if test -f $$b.o.sav; then mv $$b.o.sav $$b.o; fi; fi'
497 CC_SHOBJ_FLAG=""
692da0b5 498fi
79fc6bdb 499
692da0b5
DD
500AC_SUBST(OBJ_SAVE)
501AC_SUBST(OBJ_RESTORE)
502AC_SUBST(CC_SHOBJ_FLAG)
1ac15cd8 503AC_SUBST(BUILD_POPT)
7d29d4ba 504
bf5c2bf6
MP
505AC_CONFIG_FILES([Makefile lib/dummy zlib/dummy popt/dummy shconfig])
506AC_OUTPUT