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