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