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