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