Updated GLIBC check in configure.ac (#175)
[rsync.git] / configure.ac
1 dnl Process this file with autoconf to produce a configure script.
2
3 AC_INIT([rsync],[ ],[https://rsync.samba.org/bug-tracking.html])
4
5 AC_C_BIGENDIAN
6 AC_HEADER_DIRENT
7 AC_HEADER_TIME
8 AC_HEADER_SYS_WAIT
9 AC_CHECK_HEADERS(sys/fcntl.h sys/select.h fcntl.h sys/time.h sys/unistd.h \
10     unistd.h utime.h compat.h sys/param.h ctype.h sys/wait.h sys/stat.h \
11     sys/ioctl.h sys/filio.h string.h stdlib.h sys/socket.h sys/mode.h grp.h \
12     sys/un.h sys/attr.h arpa/inet.h arpa/nameser.h locale.h sys/types.h \
13     netdb.h malloc.h float.h limits.h iconv.h libcharset.h langinfo.h mcheck.h \
14     sys/acl.h acl/libacl.h attr/xattr.h sys/xattr.h sys/extattr.h dl.h \
15     popt.h popt/popt.h linux/falloc.h netinet/in_systm.h netgroup.h \
16     zlib.h xxhash.h openssl/md4.h openssl/md5.h zstd.h lz4.h sys/file.h)
17 AC_CHECK_HEADERS([netinet/ip.h], [], [], [[#include <netinet/in.h>]])
18 AC_HEADER_MAJOR_FIXED
19
20 AC_CONFIG_MACRO_DIR([m4])
21 AC_CONFIG_SRCDIR([byteorder.h])
22 AC_CONFIG_HEADER(config.h)
23 AC_PREREQ([2.69])
24
25 PACKAGE_VERSION=`sed 's/.*"\(.*\)".*/\1/' <$srcdir/version.h`
26
27 AC_MSG_NOTICE([Configuring rsync $PACKAGE_VERSION])
28
29 LDFLAGS=${LDFLAGS-""}
30
31 AC_CANONICAL_HOST
32
33 dnl define the directory for replacement function since AC_LIBOBJ does not
34 dnl officially support subdirs and fails with automake
35 AC_CONFIG_LIBOBJ_DIR([lib])
36
37 # We must decide this before testing the compiler.
38
39 # Please allow this to default to yes, so that your users have more
40 # chance of getting a useful stack trace if problems occur.
41
42 AC_MSG_CHECKING([whether to include debugging symbols])
43 AC_ARG_ENABLE(debug,
44         AS_HELP_STRING([--disable-debug],[disable debugging symbols and features]))
45
46 if test x"$enable_debug" = x"no"; then
47     AC_MSG_RESULT(no)
48     ac_cv_prog_cc_g=no
49 else
50     AC_MSG_RESULT([yes])
51     dnl AC_DEFINE(DEBUG, 1, [Define to turn on debugging code that may slow normal operation])
52     # leave ac_cv_prog_cc_g alone; AC_PROG_CC will try to include -g if it can
53 fi
54
55 dnl Checks for programs.
56 AC_PROG_CC
57 AC_PROG_CPP
58 AC_PROG_CXX
59 AC_PROG_AWK
60 AC_PROG_EGREP
61 AC_PROG_INSTALL
62 AC_PROG_MKDIR_P
63 AC_PROG_CC_STDC
64 AC_SUBST(SHELL)
65 AC_PATH_PROG([PERL], [perl])
66 AC_PATH_PROG([PYTHON3], [python3])
67
68 AC_DEFINE([_GNU_SOURCE], 1,
69           [Define _GNU_SOURCE so that we get all necessary prototypes])
70
71 if test x"$ac_cv_prog_cc_stdc" = x"no"; then
72         AC_MSG_WARN([rsync requires an ANSI C compiler and you do not seem to have one])
73 fi
74
75 no_lib=''
76 err_msg=''
77 nl='
78 '
79
80 AC_ARG_ENABLE(profile,
81         AS_HELP_STRING([--enable-profile],[turn on CPU profiling]))
82 if test x"$enable_profile" = x"yes"; then
83         CFLAGS="$CFLAGS -pg"
84 fi
85
86 AC_MSG_CHECKING([if md2man can create man pages])
87 if test x"$ac_cv_path_PYTHON3" = x; then
88     AC_MSG_RESULT(no - python3 not found)
89     md2man_works=no
90 else
91     md2man_out=`"$srcdir/md2man" --test "$srcdir/rsync-ssl.1.md" 2>&1`
92     if test $? = 0; then
93         AC_MSG_RESULT(yes)
94         md2man_works=yes
95     else
96         AC_MSG_RESULT(no)
97         md2man_works=no
98         echo "$md2man_out"
99     fi
100 fi
101
102 AC_MSG_CHECKING([if we require man-page building])
103 AC_ARG_ENABLE([md2man],
104         AS_HELP_STRING([--disable-md2man],[disable md2man for man page creation]))
105 if test x"$enable_md2man" != x"no"; then
106     if test -f "$srcdir/rsync.1"; then
107         AC_MSG_RESULT(optional)
108     else
109         AC_MSG_RESULT(required)
110         if test x"$md2man_works" = x"no"; then
111             err_msg="$err_msg$nl- You need python3 and either the cmarkgfm OR commonmark python3 lib in order"
112             err_msg="$err_msg$nl  to build man pages based on the git source (man pages are included in the"
113             err_msg="$err_msg$nl  official release tar files)."
114             no_lib="$no_lib md2man"
115         fi
116     fi
117     MAKE_MAN=man
118 else
119     AC_MSG_RESULT(no)
120     MAKE_MAN=''
121 fi
122
123 # Specifically, this turns on panic_action handling.
124 AC_ARG_ENABLE(maintainer-mode,
125         AS_HELP_STRING([--enable-maintainer-mode],[turn on extra debug features]))
126 if test x"$enable_maintainer_mode" = x"yes"; then
127         CFLAGS="$CFLAGS -DMAINTAINER_MODE"
128 fi
129
130 # This is needed for our included version of popt.  Kind of silly, but
131 # I don't want our version too far out of sync.
132 CFLAGS="$CFLAGS -DHAVE_CONFIG_H"
133
134 # If GCC, turn on warnings.
135 if test x"$GCC" = x"yes"; then
136         CFLAGS="$CFLAGS -Wall -W"
137 fi
138
139 AC_ARG_WITH(included-popt,
140         AS_HELP_STRING([--with-included-popt],[use bundled popt library, not from system]))
141
142 AC_ARG_WITH(included-zlib,
143         AS_HELP_STRING([--with-included-zlib],[use bundled zlib library, not from system]))
144
145 AC_ARG_WITH(protected-args,
146         AS_HELP_STRING([--with-protected-args],[make --protected-args option the default]))
147 if test x"$with_protected_args" = x"yes"; then
148         AC_DEFINE_UNQUOTED(RSYNC_USE_PROTECTED_ARGS, 1, [Define to 1 if --protected-args should be the default])
149 fi
150
151 AC_ARG_WITH(rsync-path,
152         AS_HELP_STRING([--with-rsync-path=PATH],[set default --rsync-path to PATH (default: rsync)]),
153         [ RSYNC_PATH="$with_rsync_path" ],
154         [ RSYNC_PATH="rsync" ])
155
156 AC_DEFINE_UNQUOTED(RSYNC_PATH, "$RSYNC_PATH", [location of rsync on remote machine])
157
158 AC_ARG_WITH(rsyncd-conf,
159         AS_HELP_STRING([--with-rsyncd-conf=PATH],[set configuration file for rsync server to PATH (default: /etc/rsyncd.conf)]),
160         [ if test ! -z "$with_rsyncd_conf" ; then
161                 case $with_rsyncd_conf in
162                         yes|no)
163                                 RSYNCD_SYSCONF="/etc/rsyncd.conf"
164                                 ;;
165                         /*)
166                                 RSYNCD_SYSCONF="$with_rsyncd_conf"
167                                 ;;
168                         *)
169                                 AC_MSG_ERROR(You must specify an absolute path to --with-rsyncd-conf=PATH)
170                                 ;;
171                 esac
172         else
173                 RSYNCD_SYSCONF="/etc/rsyncd.conf"
174         fi ],
175         [ RSYNCD_SYSCONF="/etc/rsyncd.conf" ])
176
177 AC_DEFINE_UNQUOTED(RSYNCD_SYSCONF, "$RSYNCD_SYSCONF", [location of configuration file for rsync server])
178
179 AC_ARG_WITH(rsh,
180         AS_HELP_STRING([--with-rsh=CMD],[set remote shell command to CMD (default: ssh)]))
181
182 AC_CHECK_PROG(HAVE_REMSH, remsh, 1, 0)
183 if test x$HAVE_REMSH = x1; then
184         AC_DEFINE(HAVE_REMSH, 1, [Define to 1 if remote shell is remsh, not rsh])
185 fi
186
187 if test x"$with_rsh" != x; then
188         RSYNC_RSH="$with_rsh"
189 else
190         RSYNC_RSH="ssh"
191 fi
192 AC_DEFINE_UNQUOTED(RSYNC_RSH, "$RSYNC_RSH", [default -e command])
193
194 # Some programs on solaris are only found in /usr/xpg4/bin (or work better than others versions).
195 AC_PATH_PROG(SHELL_PATH, sh, /bin/sh, [/usr/xpg4/bin$PATH_SEPARATOR$PATH])
196 AC_PATH_PROG(FAKEROOT_PATH, fakeroot, /usr/bin/fakeroot, [/usr/xpg4/bin$PATH_SEPARATOR$PATH])
197
198 AC_ARG_WITH(nobody-user,
199     AS_HELP_STRING([--with-nobody-user=USER],[set the default unprivileged user (default nobody)]),
200     [ NOBODY_USER="$with_nobody_user" ],
201     [ NOBODY_USER="nobody" ])
202
203 AC_ARG_WITH(nobody-group,
204     AS_HELP_STRING([--with-nobody-group=GROUP],[set the default unprivileged group (default nobody or nogroup)]),
205     [ NOBODY_GROUP="$with_nobody_group" ])
206
207 if test x"$with_nobody_group" = x; then
208     AC_MSG_CHECKING([the group for user "nobody"])
209     if grep '^nobody:' /etc/group >/dev/null 2>&1; then
210         NOBODY_GROUP=nobody
211     elif grep '^nogroup:' /etc/group >/dev/null 2>&1; then
212         NOBODY_GROUP=nogroup
213     else
214         NOBODY_GROUP=nobody # test for others?
215     fi
216     AC_MSG_RESULT($NOBODY_GROUP)
217 fi
218
219 AC_DEFINE_UNQUOTED(NOBODY_USER, "$NOBODY_USER", [unprivileged user--e.g. nobody])
220 AC_DEFINE_UNQUOTED(NOBODY_GROUP, "$NOBODY_GROUP", [unprivileged group for unprivileged user])
221
222 # SIMD optimizations
223 SIMD=
224
225 AC_MSG_CHECKING([whether to enable SIMD optimizations])
226 AC_ARG_ENABLE(simd,
227     AS_HELP_STRING([--disable-simd],[disable SIMD optimizations (requires c++)]))
228
229 # Clag is crashing with -g -O2, so we'll get rid of -g for now.
230 CXXFLAGS=`echo "$CXXFLAGS" | sed 's/-g //'`
231 m4_define(SIMD_X86_64_TEST, [[#include <stdio.h>
232 #if HAVE_STDLIB_H
233 #include <stdlib.h>
234 #endif
235 #include <immintrin.h>
236 __attribute__ ((target("default"))) int test_ssse3(int x) { return x; }
237 __attribute__ ((target("default"))) int test_sse2(int x) { return x; }
238 __attribute__ ((target("default"))) int test_avx2(int x) { return x; }
239 __attribute__ ((target("ssse3"))) int test_ssse3(int x) { return x; }
240 __attribute__ ((target("sse2"))) int test_sse2(int x) { return x; }
241 __attribute__ ((target("avx2"))) int test_avx2(int x) { return x; }
242 typedef long long __m128i_u __attribute__((__vector_size__(16), __may_alias__, __aligned__(1)));
243 typedef long long __m256i_u __attribute__((__vector_size__(32), __may_alias__, __aligned__(1)));
244 __attribute__ ((target("default"))) void more_testing(char* buf, int len) { }
245 __attribute__ ((target("ssse3"))) void more_testing(char* buf, int len)
246 {
247     int i;
248     for (i = 0; i < (len-32); i+=32) {
249         __m128i in8_1, in8_2;
250         in8_1 = _mm_lddqu_si128((__m128i_u*)&buf[i]);
251         in8_2 = _mm_lddqu_si128((__m128i_u*)&buf[i + 16]);
252     }
253 }
254 ]])
255
256 if test x"$enable_simd" != x"no"; then
257     # For x86-64 SIMD, g++ >=5 or clang++ >=7 is required
258     if test x"$host_cpu" = x"x86_64"; then
259         AC_LANG(C++)
260         if test x"$host_cpu" = x"$build_cpu"; then
261             AC_RUN_IFELSE([AC_LANG_PROGRAM([SIMD_X86_64_TEST],[[if (test_ssse3(42) != 42 || test_sse2(42) != 42 || test_avx2(42) != 42) exit(1);]])],
262                 [CXX_OK=yes],[CXX_OK=no])
263         else
264             AC_COMPILE_IFELSE([AC_LANG_PROGRAM([SIMD_X86_64_TEST])],[CXX_OK=yes],[CXX_OK=no])
265         fi
266         AC_LANG(C)
267         if test x"$CXX_OK" = x"yes"; then
268             # AC_MSG_RESULT() is called below.
269             SIMD="x86_64"
270         elif test x"$enable_simd" = x"yes"; then
271             AC_MSG_RESULT(error)
272             AC_MSG_ERROR(The SIMD compilation test failed.
273 Omit --enable-simd to continue without it.)
274         fi
275     elif test x"$enable_simd" = x"yes"; then
276         AC_MSG_RESULT(unavailable)
277         AC_MSG_ERROR(The SIMD optimizations are currently x86_64 only.
278 Omit --enable-simd to continue without it.)
279     fi
280 fi
281
282 if test x"$SIMD" != x""; then
283     AC_MSG_RESULT([yes ($SIMD)])
284     AC_DEFINE(HAVE_SIMD, 1, [Define to 1 to enable SIMD optimizations])
285     SIMD='$(SIMD_'"$SIMD)"
286     # We only use c++ for its target attribute dispatching, disable unneeded bulky features
287     CXXFLAGS="$CXXFLAGS -fno-exceptions -fno-rtti"
288     # Apple often has "g++" as a symlink for clang. Try to find out the truth.
289     CXX_VERSION=`$CXX --version 2>/dev/null | head -n 2`
290     case "$CXX_VERSION" in
291     *clang*) CXXFLAGS="$CXXFLAGS -fno-slp-vectorize" ;; # avoid a performance hit
292     esac
293 else
294     AC_MSG_RESULT(no)
295 fi
296
297 AC_SUBST(SIMD)
298
299 AC_MSG_CHECKING([if assembler accepts noexecstack])
300 OLD_CFLAGS="$CFLAGS"
301 CFLAGS="$CFLAGS -Wa,--noexecstack"
302 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[return 0;]])],
303 [ NOEXECSTACK='-Wa,--noexecstack' ; AC_MSG_RESULT(yes) ],
304 [ NOEXECSTACK='' ; AC_MSG_RESULT(no) ])
305 CFLAGS="$OLD_CFLAGS"
306 AC_SUBST(NOEXECSTACK)
307
308 ASM=
309
310 AC_MSG_CHECKING([whether to enable ASM optimizations])
311 AC_ARG_ENABLE(asm,
312     AS_HELP_STRING([--disable-asm],[disable ASM optimizations]))
313
314 if test x"$enable_asm" != x"no"; then
315     if test x"$host_cpu" = x"x86_64"; then
316         ASM="$host_cpu"
317     elif test x"$enable_asm" = x"yes"; then
318         AC_MSG_RESULT(unavailable)
319         AC_MSG_ERROR(The ASM optimizations are currently x86_64 only.
320 Omit --enable-asm to continue without it.)
321     fi
322 fi
323
324 if test x"$ASM" != x""; then
325     AC_MSG_RESULT([yes ($ASM)])
326     AC_DEFINE(HAVE_ASM, 1, [Define to 1 to enable ASM optimizations])
327     ASM='$(ASM_'"$ASM)"
328 else
329     AC_MSG_RESULT(no)
330 fi
331
332 AC_SUBST(ASM)
333
334 # arrgh. libc in some old debian version screwed up the largefile
335 # stuff, getting byte range locking wrong
336 AC_CACHE_CHECK([for broken largefile support],rsync_cv_HAVE_BROKEN_LARGEFILE,[
337 AC_RUN_IFELSE([AC_LANG_SOURCE([[
338 #define _FILE_OFFSET_BITS 64
339 #include <stdio.h>
340 #include <fcntl.h>
341 #ifdef HAVE_SYS_TYPES_H
342 #include <sys/types.h>
343 #endif
344 #include <sys/wait.h>
345 #if HAVE_UNISTD_H
346 #include <unistd.h>
347 #endif
348
349 int main(void)
350 {
351         struct flock lock;
352         int status;
353         char tpl[32] = "/tmp/locktest.XXXXXX";
354         int fd = mkstemp(tpl);
355         if (fd < 0) {
356                 strcpy(tpl, "conftest.dat");
357                 fd = open(tpl, O_CREAT|O_RDWR, 0600);
358         }
359
360         lock.l_type = F_WRLCK;
361         lock.l_whence = SEEK_SET;
362         lock.l_start = 0;
363         lock.l_len = 1;
364         lock.l_pid = 0;
365         fcntl(fd,F_SETLK,&lock);
366         if (fork() == 0) {
367                 lock.l_start = 1;
368                 _exit(fcntl(fd,F_SETLK,&lock) == 0);
369         }
370         wait(&status);
371         unlink(tpl);
372         return WEXITSTATUS(status);
373 }
374 ]])],[rsync_cv_HAVE_BROKEN_LARGEFILE=yes],[rsync_cv_HAVE_BROKEN_LARGEFILE=no],[rsync_cv_HAVE_BROKEN_LARGEFILE=cross])])
375 if test x"$rsync_cv_HAVE_BROKEN_LARGEFILE" != x"yes"; then
376    AC_SYS_LARGEFILE
377 fi
378
379 ipv6type=unknown
380 ipv6lib=none
381 ipv6trylibc=yes
382
383 AC_ARG_ENABLE(ipv6,
384         AS_HELP_STRING([--disable-ipv6],[turn off IPv6 support]))
385 if test x"$enable_ipv6" != x"no"; then
386         AC_MSG_CHECKING([ipv6 stack type])
387         for i in inria kame linux-glibc linux-inet6 solaris toshiba v6d zeta cygwin TANDEM; do
388                 case $i in
389                 inria)
390                         # http://www.kame.net/
391                         AC_EGREP_CPP(yes, [
392 #include <netinet/in.h>
393 #ifdef IPV6_INRIA_VERSION
394 yes
395 #endif],
396                                 [ipv6type=$i;
397                                 AC_DEFINE(INET6, 1, [true if you have IPv6])
398                                 ])
399                         ;;
400                 kame)
401                         # http://www.kame.net/
402                         AC_EGREP_CPP(yes, [
403 #include <netinet/in.h>
404 #ifdef __KAME__
405 yes
406 #endif],
407                                 [ipv6type=$i;
408                                 AC_DEFINE(INET6, 1, [true if you have IPv6])])
409                         ;;
410                 linux-glibc)
411                         # http://www.v6.linux.or.jp/
412                         AC_EGREP_CPP(yes, [
413 #include <features.h>
414 #if defined(__GLIBC__) && (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1))
415 yes
416 #endif],
417                                 [ipv6type=$i;
418 AC_DEFINE(INET6, 1, [true if you have IPv6])])
419                         ;;
420                 linux-inet6)
421                         # http://www.v6.linux.or.jp/
422                         if test -d /usr/inet6 -o -f /usr/inet6/lib/libinet6.a; then
423                                 ipv6type=$i
424                                 ipv6lib=inet6
425                                 ipv6libdir=/usr/inet6/lib
426                                 ipv6trylibc=yes;
427                                 AC_DEFINE(INET6, 1, [true if you have IPv6])
428                                 CFLAGS="-I/usr/inet6/include $CFLAGS"
429                         fi
430                         ;;
431                 solaris)
432                         # http://www.sun.com
433                         AC_EGREP_CPP(yes, [
434 #include <netinet/ip6.h>
435 #ifdef __sun
436 yes
437 #endif],
438                                 [ipv6type=$i;
439                                 AC_DEFINE(INET6, 1, [true if you have IPv6])])
440                         ;;
441                 toshiba)
442                         AC_EGREP_CPP(yes, [
443 #include <sys/param.h>
444 #ifdef _TOSHIBA_INET6
445 yes
446 #endif],
447                                 [ipv6type=$i;
448                                 ipv6lib=inet6;
449                                 ipv6libdir=/usr/local/v6/lib;
450                                 AC_DEFINE(INET6, 1, [true if you have IPv6])])
451                         ;;
452                 v6d)
453                         AC_EGREP_CPP(yes, [
454 #include </usr/local/v6/include/sys/v6config.h>
455 #ifdef __V6D__
456 yes
457 #endif],
458                                 [ipv6type=$i;
459                                 ipv6lib=v6;
460                                 ipv6libdir=/usr/local/v6/lib;
461                                 AC_DEFINE(INET6, 1, [true if you have IPv6])])
462                         ;;
463                 zeta)
464                         AC_EGREP_CPP(yes, [
465 #include <sys/param.h>
466 #ifdef _ZETA_MINAMI_INET6
467 yes
468 #endif],
469                                 [ipv6type=$i;
470                                 ipv6lib=inet6;
471                                 ipv6libdir=/usr/local/v6/lib;
472                                 AC_DEFINE(INET6, 1, [true if you have IPv6])])
473                         ;;
474                 cygwin)
475                         AC_EGREP_CPP(yes, [
476 #include <netinet/in.h>
477 #ifdef _CYGWIN_IN6_H
478 yes
479 #endif],
480                                 [ipv6type=$i;
481                                 AC_DEFINE(INET6, 1, [true if you have IPv6])])
482                         ;;
483                 TANDEM)
484                         AC_EGREP_CPP(yes, [
485 #include <netinet/ip6.h>
486 #ifdef __TANDEM
487 yes
488 #endif],
489                                 [ipv6type=$i;
490                                 AC_DEFINE(INET6, 1, [true if you have IPv6])])
491                         ;;
492                 esac
493                 if test "$ipv6type" != "unknown"; then
494                         break
495                 fi
496         done
497         AC_MSG_RESULT($ipv6type)
498
499         AC_SEARCH_LIBS(getaddrinfo, inet6)
500 fi
501
502 dnl Do you want to disable use of locale functions
503 AC_ARG_ENABLE([locale],
504         AS_HELP_STRING([--disable-locale],[disable locale features]))
505 AH_TEMPLATE([CONFIG_LOCALE],
506 [Undefine if you do not want locale features.  By default this is defined.])
507 if test x"$enable_locale" != x"no"; then
508         AC_DEFINE(CONFIG_LOCALE)
509 fi
510
511 AC_MSG_CHECKING([whether to call shutdown on all sockets])
512 case $host_os in
513         *cygwin* ) AC_MSG_RESULT(yes)
514                    AC_DEFINE(SHUTDOWN_ALL_SOCKETS, 1,
515                             [Define to 1 if sockets need to be shutdown])
516                    ;;
517                * ) AC_MSG_RESULT(no);;
518 esac
519
520 AC_MSG_CHECKING([whether to enable use of openssl crypto library])
521 AC_ARG_ENABLE([openssl],
522         AS_HELP_STRING([--disable-openssl],[disable openssl crypto library]))
523 AH_TEMPLATE([USE_OPENSSL],
524 [Undefine if you do not want to use openssl crypto library.  By default this is defined.])
525 if test x"$enable_openssl" != x"no"; then
526     if test x"$ac_cv_header_openssl_md4_h" = x"yes" && test x"$ac_cv_header_openssl_md5_h" = x"yes"; then
527       AC_MSG_RESULT(yes)
528       AC_SEARCH_LIBS(MD5_Init, crypto,
529           [AC_DEFINE(USE_OPENSSL)],
530           [err_msg="$err_msg$nl- Failed to find MD5_Init function in openssl crypto lib.";
531            no_lib="$no_lib openssl"])
532     else
533         AC_MSG_RESULT(no)
534         err_msg="$err_msg$nl- Failed to find openssl/md4.h and openssl/md5.h for openssl crypto lib support."
535         no_lib="$no_lib openssl"
536     fi
537 else
538     AC_MSG_RESULT(no)
539 fi
540
541 AC_MSG_CHECKING([whether to enable xxhash checksum support])
542 AC_ARG_ENABLE([xxhash],
543         AS_HELP_STRING([--disable-xxhash],[disable xxhash checksums]))
544 AH_TEMPLATE([SUPPORT_XXHASH],
545 [Undefine if you do not want xxhash checksums.  By default this is defined.])
546 if test x"$enable_xxhash" != x"no"; then
547     if test x"$ac_cv_header_xxhash_h" = x"yes"; then
548         AC_MSG_RESULT(yes)
549         AC_SEARCH_LIBS(XXH64_createState, xxhash,
550             [AC_DEFINE(SUPPORT_XXHASH)],
551             [err_msg="$err_msg$nl- Failed to find XXH64_createState function in xxhash lib.";
552              no_lib="$no_lib xxhash"])
553     else
554         AC_MSG_RESULT(no)
555         err_msg="$err_msg$nl- Failed to find xxhash.h for xxhash checksum support.";
556         no_lib="$no_lib xxhash"
557     fi
558 else
559     AC_MSG_RESULT(no)
560 fi
561
562 AC_MSG_CHECKING([whether to enable zstd compression])
563 AC_ARG_ENABLE([zstd],
564         AC_HELP_STRING([--disable-zstd], [disable zstd compression]))
565 AH_TEMPLATE([SUPPORT_ZSTD],
566 [Undefine if you do not want zstd compression.  By default this is defined.])
567 if test x"$enable_zstd" != x"no"; then
568     if test x"$ac_cv_header_zstd_h" = x"yes"; then
569         AC_MSG_RESULT(yes)
570         AC_SEARCH_LIBS(ZSTD_minCLevel, zstd,
571             [AC_DEFINE(SUPPORT_ZSTD)],
572             [err_msg="$err_msg$nl- Failed to find ZSTD_minCLevel function in zstd lib.";
573              no_lib="$no_lib zstd"])
574     else
575         AC_MSG_RESULT(no)
576         err_msg="$err_msg$nl- Failed to find zstd.h for zstd compression support.";
577         no_lib="$no_lib zstd"
578     fi
579 else
580     AC_MSG_RESULT(no)
581 fi
582
583 AC_MSG_CHECKING([whether to enable LZ4 compression])
584 AC_ARG_ENABLE([lz4],
585         AC_HELP_STRING([--disable-lz4], [disable LZ4 compression]))
586 AH_TEMPLATE([SUPPORT_LZ4],
587 [Undefine if you do not want LZ4 compression.  By default this is defined.])
588 if test x"$enable_lz4" != x"no"; then
589     if test x"$ac_cv_header_lz4_h" = x"yes"; then
590         AC_MSG_RESULT(yes)
591         AC_SEARCH_LIBS(LZ4_compress_default, lz4,
592             [AC_DEFINE(SUPPORT_LZ4)],
593             [err_msg="$err_msg$nl- Failed to find LZ4_compress_default function in lz4 lib.";
594              no_lib="$no_lib lz4"])
595     else
596         AC_MSG_RESULT(no)
597         err_msg="$err_msg$nl- Failed to find lz4.h for lz4 compression support."
598         no_lib="$no_lib lz4"
599     fi
600 else
601     AC_MSG_RESULT(no)
602 fi
603
604 if test x"$no_lib" != x; then
605     echo ""
606     echo "Configure found the following issues:"
607     echo "$err_msg"
608     echo ""
609     echo "See the INSTALL file for hints on how to install the missing libraries and/or"
610     echo "how to generate (or fetch) man pages:"
611     echo "    https://github.com/WayneD/rsync/blob/master/INSTALL.md"
612     echo ""
613     echo "To disable one or more features, the relevant configure options are:"
614     for lib in $no_lib; do
615         echo "    --disable-$lib"
616     done
617     echo ""
618     AC_MSG_ERROR(Aborting configure run)
619 fi
620
621 AC_CACHE_CHECK([if makedev takes 3 args],rsync_cv_MAKEDEV_TAKES_3_ARGS,[
622 AC_RUN_IFELSE([AC_LANG_SOURCE([[
623 #ifdef HAVE_SYS_TYPES_H
624 #include <sys/types.h>
625 #endif
626 #ifdef MAJOR_IN_MKDEV
627 #include <sys/mkdev.h>
628 # if !defined makedev && (defined mkdev || defined _WIN32 || defined __WIN32__)
629 #  define makedev mkdev
630 # endif
631 #elif defined MAJOR_IN_SYSMACROS
632 #include <sys/sysmacros.h>
633 #endif
634
635 int main(void)
636 {
637         dev_t dev = makedev(0, 5, 7);
638         if (major(dev) != 5 || minor(dev) != 7)
639                 return 1;
640         return 0;
641 }
642 ]])],[rsync_cv_MAKEDEV_TAKES_3_ARGS=yes],[rsync_cv_MAKEDEV_TAKES_3_ARGS=no],[rsync_cv_MAKEDEV_TAKES_3_ARGS=no])])
643 if test x"$rsync_cv_MAKEDEV_TAKES_3_ARGS" = x"yes"; then
644    AC_DEFINE(MAKEDEV_TAKES_3_ARGS, 1, [Define to 1 if makedev() takes 3 args])
645 fi
646
647 AC_CHECK_SIZEOF(int)
648 AC_CHECK_SIZEOF(long)
649 AC_CHECK_SIZEOF(long long)
650 AC_CHECK_SIZEOF(short)
651 AC_CHECK_SIZEOF(int16_t)
652 AC_CHECK_SIZEOF(uint16_t)
653 AC_CHECK_SIZEOF(int32_t)
654 AC_CHECK_SIZEOF(uint32_t)
655 AC_CHECK_SIZEOF(int64_t)
656 AC_CHECK_SIZEOF(off_t)
657 AC_CHECK_SIZEOF(off64_t)
658 AC_CHECK_SIZEOF(time_t)
659 AC_CHECK_SIZEOF(char*)
660
661 AC_C_INLINE
662
663 AC_TYPE_LONG_DOUBLE_WIDER
664 ac_cv_c_long_double=$ac_cv_type_long_double_wider
665 if test $ac_cv_c_long_double = yes; then
666   AC_DEFINE([HAVE_LONG_DOUBLE],[1],[Define to 1 if the type `long double' works and has more range or precision than `double'.])
667 fi
668
669 AC_TYPE_UID_T
670 AC_CHECK_TYPES([mode_t,off_t,size_t,pid_t,id_t])
671 AC_TYPE_GETGROUPS
672 AC_CHECK_MEMBERS([struct stat.st_rdev,
673                   struct stat.st_mtimensec,
674                   struct stat.st_mtimespec.tv_nsec,
675                   struct stat.st_mtim.tv_nsec],,,[
676 #ifdef HAVE_SYS_TYPES_H
677 #include <sys/types.h>
678 #endif
679 #ifdef HAVE_SYS_STAT_H
680 #include <sys/stat.h>
681 #endif
682 #ifdef HAVE_UNISTD_H
683 #include <unistd.h>
684 #endif])
685
686 TYPE_SOCKLEN_T
687
688 AC_CACHE_CHECK([for errno in errno.h],rsync_cv_errno, [
689     AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <errno.h>]], [[int i = errno]])],[rsync_cv_errno=yes],[rsync_cv_have_errno_decl=no])])
690 if test x"$rsync_cv_errno" = x"yes"; then
691    AC_DEFINE(HAVE_ERRNO_DECL, 1, [Define to 1 if errno is declared in errno.h])
692 fi
693
694 # The following test taken from the cvs sources
695 # If we can't find connect, try looking in -lsocket, -lnsl, and -linet.
696 # These need checks to be before checks for any other functions that
697 #    might be in the same libraries.
698 # The Irix 5 libc.so has connect and gethostbyname, but Irix 5 also has
699 # libsocket.so which has a bad implementation of gethostbyname (it
700 # only looks in /etc/hosts), so we only look for -lsocket if we need
701 # it.
702 AC_CHECK_FUNCS(connect)
703 if test x"$ac_cv_func_connect" = x"no"; then
704     case "$LIBS" in
705     *-lnsl*) ;;
706     *) AC_CHECK_LIB(nsl_s, printf) ;;
707     esac
708     case "$LIBS" in
709     *-lnsl*) ;;
710     *) AC_CHECK_LIB(nsl, printf) ;;
711     esac
712     case "$LIBS" in
713     *-lsocket*) ;;
714     *) AC_CHECK_LIB(socket, connect) ;;
715     esac
716     case "$LIBS" in
717     *-linet*) ;;
718     *) AC_CHECK_LIB(inet, connect) ;;
719     esac
720     dnl We can't just call AC_CHECK_FUNCS(connect) here, because the value
721     dnl has been cached.
722     if test x"$ac_cv_lib_socket_connect" = x"yes" ||
723        test x"$ac_cv_lib_inet_connect" = x"yes"; then
724         # ac_cv_func_connect=yes
725         # don't!  it would cause AC_CHECK_FUNC to succeed next time configure is run
726         AC_DEFINE(HAVE_CONNECT, 1, [Define to 1 if you have the "connect" function])
727     fi
728 fi
729
730 AC_SEARCH_LIBS(inet_ntop, resolv)
731
732 # For OS X, Solaris, HP-UX, etc.: figure out if -liconv is needed.  We'll
733 # accept either iconv_open or libiconv_open, since some include files map
734 # the former to the latter.
735 AC_SEARCH_LIBS(iconv_open, iconv)
736 AC_SEARCH_LIBS(libiconv_open, iconv)
737
738 AC_MSG_CHECKING([for iconv declaration])
739 AC_CACHE_VAL(am_cv_proto_iconv, [
740     AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
741 #if HAVE_STDLIB_H
742 #include <stdlib.h>
743 #endif
744 #include <iconv.h>
745 extern
746 #ifdef __cplusplus
747 "C"
748 #endif
749 #if defined(__STDC__) || defined(__cplusplus)
750 size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
751 #else
752 size_t iconv();
753 #endif
754 ]], [[]])],[am_cv_proto_iconv_arg1=""],[am_cv_proto_iconv_arg1="const"])
755       am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"])
756     am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed 's/( /(/'`
757 AC_MSG_RESULT([$]{ac_t:-
758          }[$]am_cv_proto_iconv)
759 AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
760                    [Define as const if the declaration of iconv() needs const.])
761
762 dnl AC_MSG_NOTICE([Looking in libraries: $LIBS])
763
764 AC_REPLACE_FUNCS([inet_ntop inet_pton])
765
766 AC_HAVE_TYPE([struct addrinfo], [#include <netdb.h>])
767 AC_HAVE_TYPE([struct sockaddr_storage], [
768 #ifdef HAVE_SYS_TYPES_H
769 #include <sys/types.h>
770 #endif
771 #ifdef HAVE_SYS_SOCKET_H
772 #include <sys/socket.h>
773 #endif])
774
775 # Irix 6.5 has getaddrinfo but not the corresponding defines, so use
776 #   builtin getaddrinfo if one of the defines don't exist
777 AC_CACHE_CHECK([whether defines needed by getaddrinfo exist],
778                rsync_cv_HAVE_GETADDR_DEFINES,[
779                         AC_EGREP_CPP(yes, [
780 #ifdef HAVE_SYS_TYPES_H
781 #include <sys/types.h>
782 #endif
783 #ifdef HAVE_SYS_SOCKET_H
784 #include <sys/socket.h>
785 #endif
786 #ifdef HAVE_NETDB_H
787 #include <netdb.h>
788 #endif
789 #ifdef AI_PASSIVE
790 yes
791 #endif],
792                         rsync_cv_HAVE_GETADDR_DEFINES=yes,
793                         rsync_cv_HAVE_GETADDR_DEFINES=no)])
794 AS_IF([test x"$rsync_cv_HAVE_GETADDR_DEFINES" = x"yes" -a x"$ac_cv_type_struct_addrinfo" = x"yes"],[
795         # Tru64 UNIX has getaddrinfo() but has it renamed in libc as
796         # something else so we must include <netdb.h> to get the
797         # redefinition.
798         AC_CHECK_FUNCS(getaddrinfo, ,
799                 [AC_MSG_CHECKING([for getaddrinfo by including <netdb.h>])
800                 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
801 #ifdef HAVE_SYS_TYPES_H
802 #include <sys/types.h>
803 #endif
804 #ifdef HAVE_SYS_SOCKET_H
805 #include <sys/socket.h>
806 #endif
807 #include <netdb.h>]], [[getaddrinfo(NULL, NULL, NULL, NULL);]])],[AC_MSG_RESULT([yes])
808                         AC_DEFINE(HAVE_GETADDRINFO, 1,
809                                 [Define to 1 if you have the "getaddrinfo" function and required types.])],[AC_MSG_RESULT([no])
810                         AC_LIBOBJ([getaddrinfo])])])
811     ],[AC_LIBOBJ([getaddrinfo])])
812
813 AC_CHECK_MEMBER([struct sockaddr.sa_len],
814                 [ AC_DEFINE(HAVE_SOCKADDR_LEN, 1, [Do we have sockaddr.sa_len?]) ],
815                 [],
816                 [
817 #ifdef HAVE_SYS_TYPES_H
818 #include <sys/types.h>
819 #endif
820 #ifdef HAVE_SYS_SOCKET_H
821 #include <sys/socket.h>
822 #endif
823 ])
824
825 AC_CHECK_MEMBER([struct sockaddr_in.sin_len],
826                 [ AC_DEFINE(HAVE_SOCKADDR_IN_LEN, 1, [Do we have sockaddr_in.sin_len?]) ],
827                 [],
828                 [
829 #ifdef HAVE_SYS_TYPES_H
830 #include <sys/types.h>
831 #endif
832 #ifdef HAVE_SYS_SOCKET_H
833 #include <sys/socket.h>
834 #endif
835 #include <netinet/in.h>
836 ])
837
838 AC_CHECK_MEMBER([struct sockaddr_un.sun_len],
839                 [ AC_DEFINE(HAVE_SOCKADDR_UN_LEN, 1, [Do we have sockaddr_un.sun_len?]) ],
840                 [],
841                 [
842 #ifdef HAVE_SYS_TYPES_H
843 #include <sys/types.h>
844 #endif
845 #ifdef HAVE_SYS_SOCKET_H
846 #include <sys/socket.h>
847 #endif
848 #include <netinet/in.h>
849 ])
850
851 AC_CHECK_MEMBER([struct sockaddr_in6.sin6_scope_id],
852                 [ AC_DEFINE(HAVE_SOCKADDR_IN6_SCOPE_ID, 1, [Do we have sockaddr_in6.sin6_scope_id?]) ],
853                 [],
854                 [
855 #ifdef HAVE_SYS_TYPES_H
856 #include <sys/types.h>
857 #endif
858 #ifdef HAVE_SYS_SOCKET_H
859 #include <sys/socket.h>
860 #endif
861 #include <netinet/in.h>
862 ])
863
864 AC_HAVE_TYPE([struct stat64], [#include <stdio.h>
865 #if HAVE_SYS_TYPES_H
866 # include <sys/types.h>
867 #endif
868 #if HAVE_SYS_STAT_H
869 # include <sys/stat.h>
870 #endif
871 #if STDC_HEADERS
872 # include <stdlib.h>
873 # include <stddef.h>
874 #else
875 # if HAVE_STDLIB_H
876 #  include <stdlib.h>
877 # endif
878 #endif
879 ])
880
881 # if we can't find strcasecmp, look in -lresolv (for Unixware at least)
882 #
883 AC_CHECK_FUNCS(strcasecmp)
884 if test x"$ac_cv_func_strcasecmp" = x"no"; then
885     AC_CHECK_LIB(resolv, strcasecmp)
886 fi
887
888 AC_CHECK_FUNCS(aclsort)
889 if test x"$ac_cv_func_aclsort" = x"no"; then
890     AC_CHECK_LIB(sec, aclsort)
891 fi
892
893 dnl At the moment we don't test for a broken memcmp(), because all we
894 dnl need to do is test for equality, not comparison, and it seems that
895 dnl every platform has a memcmp that can do at least that.
896 dnl AC_FUNC_MEMCMP
897
898 AC_FUNC_UTIME_NULL
899 AC_FUNC_ALLOCA
900 AC_CHECK_FUNCS(waitpid wait4 getcwd chown chmod lchmod mknod mkfifo \
901     fchmod fstat ftruncate strchr readlink link utime utimes lutimes strftime \
902     chflags getattrlist mktime innetgr linkat \
903     memmove lchown vsnprintf snprintf vasprintf asprintf setsid strpbrk \
904     strlcat strlcpy strtol mallinfo getgroups setgroups geteuid getegid \
905     setlocale setmode open64 lseek64 mkstemp64 mtrace va_copy __va_copy \
906     seteuid strerror putenv iconv_open locale_charset nl_langinfo getxattr \
907     extattr_get_link sigaction sigprocmask setattrlist getgrouplist \
908     initgroups utimensat posix_fallocate attropen setvbuf nanosleep usleep)
909
910 dnl cygwin iconv.h defines iconv_open as libiconv_open
911 if test x"$ac_cv_func_iconv_open" != x"yes"; then
912     AC_CHECK_FUNC(libiconv_open, [ac_cv_func_iconv_open=yes; AC_DEFINE(HAVE_ICONV_OPEN, 1)])
913 fi
914
915 dnl Preallocation stuff (also fallocate, posix_fallocate function tests above):
916
917 AC_CACHE_CHECK([for useable fallocate],rsync_cv_have_fallocate,[
918 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <fcntl.h>
919 #ifdef HAVE_SYS_TYPES_H
920 #include <sys/types.h>
921 #endif]], [[fallocate(0, 0, 0, 0);]])],[rsync_cv_have_fallocate=yes],[rsync_cv_have_fallocate=no])])
922 if test x"$rsync_cv_have_fallocate" = x"yes"; then
923     AC_DEFINE(HAVE_FALLOCATE, 1, [Define to 1 if you have the fallocate function and it compiles and links without error])
924 fi
925
926 AC_MSG_CHECKING([for FALLOC_FL_PUNCH_HOLE])
927 AC_PREPROC_IFELSE([AC_LANG_SOURCE([[
928         #define _GNU_SOURCE 1
929         #include <linux/falloc.h>
930         #ifndef FALLOC_FL_PUNCH_HOLE
931         #error FALLOC_FL_PUNCH_HOLE is missing
932         #endif
933     ]])], [
934         AC_MSG_RESULT([yes])
935         AC_DEFINE([HAVE_FALLOC_FL_PUNCH_HOLE], [1], [Define if FALLOC_FL_PUNCH_HOLE is available.])
936     ], [
937         AC_MSG_RESULT([no])
938     ]
939 )
940
941 AC_MSG_CHECKING([for FALLOC_FL_ZERO_RANGE])
942 AC_PREPROC_IFELSE([AC_LANG_SOURCE([[
943         #define _GNU_SOURCE 1
944         #include <linux/falloc.h>
945         #ifndef FALLOC_FL_ZERO_RANGE
946         #error FALLOC_FL_ZERO_RANGE is missing
947         #endif
948     ]])], [
949         AC_MSG_RESULT([yes])
950         AC_DEFINE([HAVE_FALLOC_FL_ZERO_RANGE], [1], [Define if FALLOC_FL_ZERO_RANGE is available.])
951     ], [
952         AC_MSG_RESULT([no])
953     ]
954 )
955
956 AC_CACHE_CHECK([for SYS_fallocate],rsync_cv_have_sys_fallocate,[
957 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/syscall.h>
958 #ifdef HAVE_UNISTD_H
959 #include <unistd.h>
960 #endif
961 #ifdef HAVE_SYS_TYPES_H
962 #include <sys/types.h>
963 #endif]], [[syscall(SYS_fallocate, 0, 0, (loff_t)0, (loff_t)0);]])],[rsync_cv_have_sys_fallocate=yes],[rsync_cv_have_sys_fallocate=no])])
964 if test x"$rsync_cv_have_sys_fallocate" = x"yes"; then
965     AC_DEFINE(HAVE_SYS_FALLOCATE, 1, [Define to 1 if you have the SYS_fallocate syscall number])
966 fi
967
968 if test x"$ac_cv_func_posix_fallocate" = x"yes"; then
969     AC_MSG_CHECKING([whether posix_fallocate is efficient])
970     case $host_os in
971     *cygwin*)
972         AC_MSG_RESULT(yes)
973         AC_DEFINE(HAVE_EFFICIENT_POSIX_FALLOCATE, 1,
974                   [Define if posix_fallocate is efficient (Cygwin)])
975         ;;
976     *)
977         AC_MSG_RESULT(no)
978         ;;
979     esac
980 fi
981
982 dnl End of preallocation stuff
983
984 AC_CHECK_FUNCS(getpgrp tcgetpgrp)
985 if test $ac_cv_func_getpgrp = yes; then
986     AC_FUNC_GETPGRP
987 fi
988
989 AC_ARG_ENABLE(iconv-open,
990     AS_HELP_STRING([--disable-iconv-open],[disable all use of iconv_open() function]),
991     [], [enable_iconv_open=$ac_cv_func_iconv_open])
992
993 if test x"$enable_iconv_open" != x"no"; then
994     AC_DEFINE(USE_ICONV_OPEN, 1, [Define to 1 if you want rsync to make use of iconv_open()])
995 fi
996
997 AC_ARG_ENABLE(iconv,
998     AS_HELP_STRING([--disable-iconv],[disable rsync's --iconv option]),
999     [], [enable_iconv=$enable_iconv_open])
1000 AH_TEMPLATE([ICONV_OPTION],
1001 [Define if you want the --iconv option.  Specifying a value will set the
1002 default iconv setting (a NULL means no --iconv processing by default).])
1003 if test x"$enable_iconv" != x"no"; then
1004         if test x"$enable_iconv" = x"yes"; then
1005                 AC_DEFINE(ICONV_OPTION, NULL)
1006         else
1007                 AC_DEFINE_UNQUOTED(ICONV_OPTION, "$enable_iconv")
1008         fi
1009         AC_DEFINE(UTF8_CHARSET, "UTF-8", [String to pass to iconv() for the UTF-8 charset.])
1010 fi
1011
1012 AC_CACHE_CHECK([whether chown() modifies symlinks],rsync_cv_chown_modifies_symlink,[
1013   AC_RUN_IFELSE([AC_LANG_SOURCE([[
1014 #if HAVE_UNISTD_H
1015 # include <unistd.h>
1016 #endif
1017 #include <stdlib.h>
1018 #include <errno.h>
1019 int main(void) {
1020         char const *dangling_symlink = "conftest.dangle";
1021         unlink(dangling_symlink);
1022         if (symlink("conftest.no-such", dangling_symlink) < 0) abort();
1023         if (chown(dangling_symlink, getuid(), getgid()) < 0 && errno == ENOENT) return 1;
1024         return 0;
1025     }]])],[rsync_cv_chown_modifies_symlink=yes],[rsync_cv_chown_modifies_symlink=no],[rsync_cv_chown_modifies_symlink=no])])
1026 if test $rsync_cv_chown_modifies_symlink = yes; then
1027   AC_DEFINE(CHOWN_MODIFIES_SYMLINK, 1, [Define to 1 if chown modifies symlinks.])
1028 fi
1029
1030 AC_CACHE_CHECK([whether link() can hard-link symlinks],rsync_cv_can_hardlink_symlink,[
1031   AC_RUN_IFELSE([AC_LANG_SOURCE([[
1032 #ifdef HAVE_FCNTL_H
1033 # include <fcntl.h>
1034 #elif defined HAVE_SYS_FCNTL_H
1035 # include <sys/fcntl.h>
1036 #endif
1037 #if HAVE_UNISTD_H
1038 # include <unistd.h>
1039 #endif
1040 #include <stdlib.h>
1041 #include <errno.h>
1042 #define FILENAME "conftest.dangle"
1043 int main(void) {
1044         unlink(FILENAME);
1045         if (symlink("conftest.no-such", FILENAME) < 0) abort();
1046         unlink(FILENAME "2");
1047 #ifdef HAVE_LINKAT
1048         if (linkat(AT_FDCWD, FILENAME, AT_FDCWD, FILENAME "2", 0) < 0) return 1;
1049 #else
1050         if (link(FILENAME, FILENAME "2") < 0) return 1;
1051 #endif
1052         return 0;
1053     }]])],[rsync_cv_can_hardlink_symlink=yes],[rsync_cv_can_hardlink_symlink=no],[rsync_cv_can_hardlink_symlink=no])])
1054 if test $rsync_cv_can_hardlink_symlink = yes; then
1055   AC_DEFINE(CAN_HARDLINK_SYMLINK, 1, [Define to 1 if link() can hard-link symlinks.])
1056 fi
1057
1058 AC_CACHE_CHECK([whether link() can hard-link special files],rsync_cv_can_hardlink_special,[
1059   AC_RUN_IFELSE([AC_LANG_SOURCE([[
1060 #if HAVE_UNISTD_H
1061 # include <unistd.h>
1062 #endif
1063 #ifdef HAVE_SYS_STAT_H
1064 #include <sys/stat.h>
1065 #endif
1066 #include <stdlib.h>
1067 #include <errno.h>
1068 #define FILENAME "conftest.fifi"
1069 int main(void) {
1070         unlink(FILENAME);
1071         if (mkfifo(FILENAME, 0777) < 0) abort();
1072         unlink(FILENAME "2");
1073         if (link(FILENAME, FILENAME "2") < 0) return 1;
1074         return 0;
1075     }]])],[rsync_cv_can_hardlink_special=yes],[rsync_cv_can_hardlink_special=no],[rsync_cv_can_hardlink_special=no])])
1076 if test $rsync_cv_can_hardlink_special = yes; then
1077     AC_DEFINE(CAN_HARDLINK_SPECIAL, 1, [Define to 1 if link() can hard-link special files.])
1078 fi
1079
1080 AC_CACHE_CHECK([for working socketpair],rsync_cv_HAVE_SOCKETPAIR,[
1081 AC_RUN_IFELSE([AC_LANG_SOURCE([[
1082 #ifdef HAVE_SYS_TYPES_H
1083 #include <sys/types.h>
1084 #endif
1085 #ifdef HAVE_SYS_SOCKET_H
1086 #include <sys/socket.h>
1087 #endif
1088
1089 int main(void) {
1090        int fd[2];
1091        return (socketpair(AF_UNIX, SOCK_STREAM, 0, fd) != -1) ? 0 : 1;
1092 }]])],[rsync_cv_HAVE_SOCKETPAIR=yes],[rsync_cv_HAVE_SOCKETPAIR=no],[rsync_cv_HAVE_SOCKETPAIR=cross])])
1093 if test x"$rsync_cv_HAVE_SOCKETPAIR" = x"yes"; then
1094     AC_DEFINE(HAVE_SOCKETPAIR, 1, [Define to 1 if you have the "socketpair" function])
1095 fi
1096
1097 AC_REPLACE_FUNCS([getpass])
1098
1099 if test x"$with_included_popt" != x"yes"; then
1100     AC_CHECK_LIB(popt, poptGetContext, , [with_included_popt=yes])
1101 fi
1102 if test x"$ac_cv_header_popt_popt_h" = x"yes"; then
1103     # If the system has /usr/include/popt/popt.h, we enable the
1104     # included popt because an attempt to "#include <popt/popt.h>"
1105     # would use our included header file anyway (due to -I.), and
1106     # might conflict with the system popt.
1107     with_included_popt=yes
1108 elif test x"$ac_cv_header_popt_h" != x"yes"; then
1109     with_included_popt=yes
1110 fi
1111
1112 if test x"$GCC" = x"yes"; then
1113     if test x"$with_included_popt" != x"yes"; then
1114         # Turn pedantic warnings into errors to ensure an array-init overflow is an error.
1115         CFLAGS="$CFLAGS -pedantic-errors"
1116     else
1117         # Our internal popt code cannot be compiled with pedantic warnings as errors, so try to
1118         # turn off pedantic warnings (which will not lose the error for array-init overflow).
1119         # Older gcc versions don't understand -Wno-pedantic, so check if --help=warnings lists
1120         # -Wpedantic and use that as a flag.
1121         case `$CC --help=warnings 2>/dev/null | grep Wpedantic` in
1122             *-Wpedantic*) CFLAGS="$CFLAGS -pedantic-errors -Wno-pedantic" ;;
1123         esac
1124     fi
1125 fi
1126
1127 AC_MSG_CHECKING([whether to use included libpopt])
1128 if test x"$with_included_popt" = x"yes"; then
1129     AC_MSG_RESULT($srcdir/popt)
1130     BUILD_POPT='$(popt_OBJS)'
1131     CFLAGS="-I$srcdir/popt $CFLAGS"
1132     if test x"$ALLOCA" != x
1133     then
1134         # this can be removed when/if we add an included alloca.c;
1135         #  see autoconf documentation on AC_FUNC_ALLOCA
1136         AC_MSG_WARN([included libpopt will use malloc, not alloca (which wastes a small amount of memory)])
1137     fi
1138 else
1139     AC_MSG_RESULT(no)
1140 fi
1141
1142 # We default to using our zlib unless --with-included-zlib=no is given.
1143 if test x"$with_included_zlib" != x"no"; then
1144     with_included_zlib=yes
1145 elif test x"$ac_cv_header_zlib_h" != x"yes"; then
1146     with_included_zlib=yes
1147 fi
1148 if test x"$with_included_zlib" != x"yes"; then
1149     AC_CHECK_LIB(z, deflateParams, , [with_included_zlib=yes])
1150 fi
1151
1152 AC_MSG_CHECKING([whether to use included zlib])
1153 if test x"$with_included_zlib" = x"yes"; then
1154     AC_MSG_RESULT($srcdir/zlib)
1155     BUILD_ZLIB='$(zlib_OBJS)'
1156     CFLAGS="-I$srcdir/zlib $CFLAGS"
1157 else
1158     AC_DEFINE(EXTERNAL_ZLIB, 1, [Define to 1 if using external zlib])
1159     AC_MSG_RESULT(no)
1160 fi
1161
1162 AC_CACHE_CHECK([for unsigned char],rsync_cv_SIGNED_CHAR_OK,[
1163 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[signed char *s = ""]])],[rsync_cv_SIGNED_CHAR_OK=yes],[rsync_cv_SIGNED_CHAR_OK=no])])
1164 if test x"$rsync_cv_SIGNED_CHAR_OK" = x"yes"; then
1165     AC_DEFINE(SIGNED_CHAR_OK, 1, [Define to 1 if "signed char" is a valid type])
1166 fi
1167
1168 AC_CACHE_CHECK([for broken readdir],rsync_cv_HAVE_BROKEN_READDIR,[
1169 AC_RUN_IFELSE([AC_LANG_SOURCE([[
1170 #ifdef HAVE_SYS_TYPES_H
1171 #include <sys/types.h>
1172 #endif
1173 #include <dirent.h>
1174 int main(void) { struct dirent *di; DIR *d = opendir("."); di = readdir(d);
1175 if (di && di->d_name[-2] == '.' && di->d_name[-1] == 0 &&
1176 di->d_name[0] == 0) return 0; return 1;} ]])],[rsync_cv_HAVE_BROKEN_READDIR=yes],[rsync_cv_HAVE_BROKEN_READDIR=no],[rsync_cv_HAVE_BROKEN_READDIR=cross])])
1177 if test x"$rsync_cv_HAVE_BROKEN_READDIR" = x"yes"; then
1178     AC_DEFINE(HAVE_BROKEN_READDIR, 1, [Define to 1 if readdir() is broken])
1179 fi
1180
1181 AC_CACHE_CHECK([for utimbuf],rsync_cv_HAVE_STRUCT_UTIMBUF,[
1182 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1183 #ifdef HAVE_SYS_TYPES_H
1184 #include <sys/types.h>
1185 #endif
1186 #include <utime.h>]], [[struct utimbuf tbuf;  tbuf.actime = 0; tbuf.modtime = 1; return utime("foo.c",&tbuf);]])],[rsync_cv_HAVE_STRUCT_UTIMBUF=yes],[rsync_cv_HAVE_STRUCT_UTIMBUF=no])])
1187 if test x"$rsync_cv_HAVE_STRUCT_UTIMBUF" = x"yes"; then
1188     AC_DEFINE(HAVE_STRUCT_UTIMBUF, 1, [Define to 1 if you have the "struct utimbuf" type])
1189 fi
1190
1191 AC_CACHE_CHECK([if gettimeofday takes tz argument],rsync_cv_HAVE_GETTIMEOFDAY_TZ,[
1192 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/time.h>
1193 #ifdef HAVE_UNISTD_H
1194 #include <unistd.h>
1195 #endif]], [[struct timeval tv; return gettimeofday(&tv, NULL);]])],[rsync_cv_HAVE_GETTIMEOFDAY_TZ=yes],[rsync_cv_HAVE_GETTIMEOFDAY_TZ=no])])
1196 if test x"$rsync_cv_HAVE_GETTIMEOFDAY_TZ" != x"no"; then
1197     AC_DEFINE(HAVE_GETTIMEOFDAY_TZ, 1, [Define to 1 if gettimeofday() takes a time-zone arg])
1198 fi
1199
1200 AC_CACHE_CHECK([for C99 vsnprintf],rsync_cv_HAVE_C99_VSNPRINTF,[
1201 AC_RUN_IFELSE([AC_LANG_SOURCE([[
1202 #ifdef HAVE_SYS_TYPES_H
1203 #include <sys/types.h>
1204 #endif
1205 #include <stdarg.h>
1206 #include <stdio.h>
1207 #if HAVE_STDLIB_H
1208 #include <stdlib.h>
1209 #endif
1210 #include <string.h>
1211 void foo(const char *format, ...) {
1212        va_list ap;
1213        int len;
1214        static char buf[] = "12345678901234567890";
1215
1216        va_start(ap, format);
1217        len = vsnprintf(0, 0, format, ap);
1218        va_end(ap);
1219        if (len != 5) exit(1);
1220
1221        if (snprintf(buf, 3, "hello") != 5 || strcmp(buf, "he") != 0) exit(1);
1222 }
1223 int main(void) { foo("hello"); return 0; }
1224 ]])],[rsync_cv_HAVE_C99_VSNPRINTF=yes],[rsync_cv_HAVE_C99_VSNPRINTF=no],[rsync_cv_HAVE_C99_VSNPRINTF=cross])])
1225 if test x"$rsync_cv_HAVE_C99_VSNPRINTF" = x"yes"; then
1226     AC_DEFINE(HAVE_C99_VSNPRINTF, 1, [Define to 1 if vsprintf has a C99-compatible return value])
1227 fi
1228
1229
1230 AC_CACHE_CHECK([for secure mkstemp],rsync_cv_HAVE_SECURE_MKSTEMP,[
1231 AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdlib.h>
1232 #ifdef HAVE_SYS_TYPES_H
1233 #include <sys/types.h>
1234 #endif
1235 #include <sys/stat.h>
1236 #ifdef HAVE_UNISTD_H
1237 #include <unistd.h>
1238 #endif
1239 int main(void) {
1240   struct stat st;
1241   char tpl[20]="/tmp/test.XXXXXX";
1242   int fd = mkstemp(tpl);
1243   if (fd == -1) return 1;
1244   unlink(tpl);
1245   if (fstat(fd, &st) != 0) return 1;
1246   if ((st.st_mode & 0777) != 0600) return 1;
1247   return 0;
1248 }]])],[rsync_cv_HAVE_SECURE_MKSTEMP=yes],[rsync_cv_HAVE_SECURE_MKSTEMP=no],[rsync_cv_HAVE_SECURE_MKSTEMP=cross])])
1249 if test x"$rsync_cv_HAVE_SECURE_MKSTEMP" = x"yes"; then
1250     case $host_os in
1251     hpux*)
1252         dnl HP-UX has a broken mkstemp() implementation they refuse to fix,
1253         dnl so we noisily skip using it.  See HP change request JAGaf34426
1254         dnl for details. (sbonds)
1255         AC_MSG_WARN(Skipping broken HP-UX mkstemp() -- using mktemp() instead)
1256         ;;
1257     *)
1258         AC_DEFINE(HAVE_SECURE_MKSTEMP, 1, [Define to 1 if mkstemp() is available and works right])
1259         ;;
1260     esac
1261 fi
1262
1263
1264 AC_CACHE_CHECK([if mknod creates FIFOs],rsync_cv_MKNOD_CREATES_FIFOS,[
1265 AC_RUN_IFELSE([AC_LANG_SOURCE([[
1266 #include <stdio.h>
1267 #include <sys/stat.h>
1268 #include <errno.h>
1269 #if HAVE_UNISTD_H
1270 # include <unistd.h>
1271 #endif
1272 int main(void) { int rc, ec; char *fn = "fifo-test";
1273 unlink(fn); rc = mknod(fn,S_IFIFO,0600); ec = errno; unlink(fn);
1274 if (rc) {printf("(%d %d) ",rc,ec); return ec;}
1275 return 0;}]])],[rsync_cv_MKNOD_CREATES_FIFOS=yes],[rsync_cv_MKNOD_CREATES_FIFOS=no],[rsync_cv_MKNOD_CREATES_FIFOS=cross])])
1276 if test x"$rsync_cv_MKNOD_CREATES_FIFOS" = x"yes"; then
1277     AC_DEFINE(MKNOD_CREATES_FIFOS, 1, [Define to 1 if mknod() can create FIFOs.])
1278 fi
1279
1280 AC_CACHE_CHECK([if mknod creates sockets],rsync_cv_MKNOD_CREATES_SOCKETS,[
1281 AC_RUN_IFELSE([AC_LANG_SOURCE([[
1282 #include <stdio.h>
1283 #include <sys/stat.h>
1284 #include <errno.h>
1285 #if HAVE_UNISTD_H
1286 # include <unistd.h>
1287 #endif
1288 int main(void) { int rc, ec; char *fn = "sock-test";
1289 unlink(fn); rc = mknod(fn,S_IFSOCK,0600); ec = errno; unlink(fn);
1290 if (rc) {printf("(%d %d) ",rc,ec); return ec;}
1291 return 0;}]])],[rsync_cv_MKNOD_CREATES_SOCKETS=yes],[rsync_cv_MKNOD_CREATES_SOCKETS=no],[rsync_cv_MKNOD_CREATES_SOCKETS=cross])])
1292 if test x"$rsync_cv_MKNOD_CREATES_SOCKETS" = x"yes"; then
1293     AC_DEFINE(MKNOD_CREATES_SOCKETS, 1, [Define to 1 if mknod() can create sockets.])
1294 fi
1295
1296 #
1297 # The following test was mostly taken from the tcl/tk plus patches
1298 #
1299 AC_CACHE_CHECK([whether -c -o works],rsync_cv_DASHC_WORKS_WITH_DASHO,[
1300 rm -rf conftest*
1301 cat > conftest.$ac_ext <<EOF
1302 int main(void) { return 0; }
1303 EOF
1304 ${CC-cc} -c -o conftest..o conftest.$ac_ext
1305 if test -f conftest..o; then
1306     rsync_cv_DASHC_WORKS_WITH_DASHO=yes
1307 else
1308     rsync_cv_DASHC_WORKS_WITH_DASHO=no
1309 fi
1310 rm -rf conftest*
1311 ])
1312 if test x"$rsync_cv_DASHC_WORKS_WITH_DASHO" = x"yes"; then
1313     OBJ_SAVE="#"
1314     OBJ_RESTORE="#"
1315     CC_SHOBJ_FLAG='-o $@'
1316 else
1317     OBJ_SAVE='  @b=`basename $@ .o`;rm -f $$b.o.sav;if test -f $$b.o; then mv $$b.o $$b.o.sav;fi;'
1318     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'
1319     CC_SHOBJ_FLAG=""
1320 fi
1321
1322 AC_SUBST(OBJ_SAVE)
1323 AC_SUBST(OBJ_RESTORE)
1324 AC_SUBST(CC_SHOBJ_FLAG)
1325 AC_SUBST(BUILD_POPT)
1326 AC_SUBST(BUILD_ZLIB)
1327 AC_SUBST(MAKE_MAN)
1328
1329 AC_CHECK_FUNCS(_acl __acl _facl __facl)
1330 #################################################
1331 # check for ACL support
1332
1333 AC_MSG_CHECKING([whether to support ACLs])
1334 AC_ARG_ENABLE(acl-support,
1335         AS_HELP_STRING([--disable-acl-support],[disable ACL support]))
1336
1337 if test x"$enable_acl_support" = x"no"; then
1338     AC_MSG_RESULT(no)
1339 else
1340     case "$host_os" in
1341     *sysv5*)
1342         AC_MSG_RESULT(Using UnixWare ACLs)
1343         AC_DEFINE(HAVE_UNIXWARE_ACLS, 1, [true if you have UnixWare ACLs])
1344         AC_DEFINE(SUPPORT_ACLS, 1, [Define to 1 to add support for ACLs])
1345         ;;
1346     solaris*)
1347         AC_MSG_RESULT(Using solaris ACLs)
1348         AC_DEFINE(HAVE_SOLARIS_ACLS, 1, [true if you have solaris ACLs])
1349         AC_DEFINE(SUPPORT_ACLS, 1)
1350         ;;
1351     *irix*)
1352         AC_MSG_RESULT(Using IRIX ACLs)
1353         AC_DEFINE(HAVE_IRIX_ACLS, 1, [true if you have IRIX ACLs])
1354         AC_DEFINE(SUPPORT_ACLS, 1)
1355         ;;
1356     *aix*)
1357         AC_MSG_RESULT(Using AIX ACLs)
1358         AC_DEFINE(HAVE_AIX_ACLS, 1, [true if you have AIX ACLs])
1359         AC_DEFINE(SUPPORT_ACLS, 1)
1360         ;;
1361     *osf*)
1362         AC_MSG_RESULT(Using Tru64 ACLs)
1363         AC_DEFINE(HAVE_TRU64_ACLS, 1, [true if you have Tru64 ACLs])
1364         AC_DEFINE(SUPPORT_ACLS, 1)
1365         LIBS="$LIBS -lpacl"
1366         ;;
1367     darwin*)
1368         AC_MSG_RESULT(Using OS X ACLs)
1369         AC_DEFINE(HAVE_OSX_ACLS, 1, [true if you have Mac OS X ACLs])
1370         AC_DEFINE(SUPPORT_ACLS, 1)
1371         ;;
1372     *hpux*|*nsk*)
1373         AC_MSG_RESULT(Using HPUX ACLs)
1374         AC_DEFINE(HAVE_HPUX_ACLS, 1, [true if you have HPUX ACLs])
1375         AC_DEFINE(SUPPORT_ACLS, 1)
1376         ;;
1377     *)
1378         AC_MSG_RESULT(running tests:)
1379         AC_CHECK_LIB(acl,acl_get_file)
1380         AC_CACHE_CHECK([for ACL support],samba_cv_HAVE_POSIX_ACLS,[
1381             AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1382 #ifdef HAVE_SYS_TYPES_H
1383 #include <sys/types.h>
1384 #endif
1385 #ifdef HAVE_SYS_ACL_H
1386 #include <sys/acl.h>
1387 #endif]], [[ acl_t acl; int entry_id; acl_entry_t *entry_p; return acl_get_entry( acl, entry_id, entry_p);]])],[samba_cv_HAVE_POSIX_ACLS=yes],[samba_cv_HAVE_POSIX_ACLS=no])])
1388         AC_MSG_CHECKING(ACL test results)
1389         if test x"$samba_cv_HAVE_POSIX_ACLS" = x"yes"; then
1390             AC_MSG_RESULT(Using posix ACLs)
1391             AC_DEFINE(HAVE_POSIX_ACLS, 1, [true if you have posix ACLs])
1392             AC_DEFINE(SUPPORT_ACLS, 1)
1393             AC_CACHE_CHECK([for acl_get_perm_np],samba_cv_HAVE_ACL_GET_PERM_NP,[
1394                 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1395 #ifdef HAVE_SYS_TYPES_H
1396 #include <sys/types.h>
1397 #endif
1398 #ifdef HAVE_SYS_ACL_H
1399 #include <sys/acl.h>
1400 #endif]], [[ acl_permset_t permset_d; acl_perm_t perm; return acl_get_perm_np( permset_d, perm);]])],[samba_cv_HAVE_ACL_GET_PERM_NP=yes],[samba_cv_HAVE_ACL_GET_PERM_NP=no])])
1401             if test x"$samba_cv_HAVE_ACL_GET_PERM_NP" = x"yes"; then
1402                 AC_DEFINE(HAVE_ACL_GET_PERM_NP, 1, [true if you have acl_get_perm_np])
1403             fi
1404         else
1405             if test x"$enable_acl_support" = x"yes"; then
1406                 AC_MSG_ERROR(Failed to find ACL support)
1407             else
1408                 AC_MSG_RESULT(No ACL support found)
1409             fi
1410         fi
1411         ;;
1412     esac
1413 fi
1414
1415 #################################################
1416 # check for extended attribute support
1417 AC_MSG_CHECKING(whether to support extended attributes)
1418 AC_ARG_ENABLE(xattr-support,
1419     AS_HELP_STRING([--disable-xattr-support],[disable extended attributes]),
1420     [], [case "$ac_cv_func_getxattr$ac_cv_func_extattr_get_link$ac_cv_func_attropen" in
1421         *yes*) enable_xattr_support=maybe ;;
1422         *) enable_xattr_support=no ;;
1423         esac])
1424 AH_TEMPLATE([SUPPORT_XATTRS],
1425 [Define to 1 to add support for extended attributes])
1426 if test x"$enable_xattr_support" = x"no"; then
1427     AC_MSG_RESULT(no)
1428 else
1429     case "$host_os" in
1430     *linux*|*netbsd*|*cygwin*)
1431         AC_MSG_RESULT(Using Linux xattrs)
1432         AC_DEFINE(HAVE_LINUX_XATTRS, 1, [True if you have Linux xattrs (or equivalent)])
1433         AC_DEFINE(SUPPORT_XATTRS, 1)
1434         AC_DEFINE(NO_SYMLINK_USER_XATTRS, 1, [True if symlinks do not support user xattrs])
1435         AC_CHECK_LIB(attr,getxattr)
1436         ;;
1437     darwin*)
1438         AC_MSG_RESULT(Using OS X xattrs)
1439         AC_DEFINE(HAVE_OSX_XATTRS, 1, [True if you have Mac OS X xattrs])
1440         AC_DEFINE(SUPPORT_XATTRS, 1)
1441         AC_DEFINE(NO_DEVICE_XATTRS, 1, [True if device files do not support xattrs])
1442         AC_DEFINE(NO_SPECIAL_XATTRS, 1, [True if special files do not support xattrs])
1443         ;;
1444     freebsd*)
1445         AC_MSG_RESULT(Using FreeBSD extattrs)
1446         AC_DEFINE(HAVE_FREEBSD_XATTRS, 1, [True if you have FreeBSD xattrs])
1447         AC_DEFINE(SUPPORT_XATTRS, 1)
1448         ;;
1449     solaris*)
1450         AC_MSG_RESULT(Using Solaris xattrs)
1451         AC_DEFINE(HAVE_SOLARIS_XATTRS, 1, [True if you have Solaris xattrs])
1452         AC_DEFINE(SUPPORT_XATTRS, 1)
1453         AC_DEFINE(NO_SYMLINK_XATTRS, 1, [True if symlinks do not support xattrs])
1454         ;;
1455     *)
1456         if test x"$enable_xattr_support" = x"yes"; then
1457             AC_MSG_ERROR(Failed to find extended attribute support)
1458         else
1459             AC_MSG_RESULT(No extended attribute support found)
1460         fi
1461         ;;
1462     esac
1463 fi
1464
1465 if test x"$enable_acl_support" = x"no" -o x"$enable_xattr_support" = x"no" -o x"$enable_iconv" = x"no"; then
1466     AC_MSG_CHECKING([whether $CC supports -Wno-unused-parameter])
1467     OLD_CFLAGS="$CFLAGS"
1468     CFLAGS="$CFLAGS -Wno-unused-parameter"
1469     AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h>]], [[printf("hello\n");]])],[rsync_warn_flag=yes],[rsync_warn_flag=no])
1470     AC_MSG_RESULT([$rsync_warn_flag])
1471     if test x"$rsync_warn_flag" = x"no"; then
1472         CFLAGS="$OLD_CFLAGS"
1473     fi
1474 fi
1475
1476 case "$CC" in
1477 ' checker'*|checker*)
1478     AC_DEFINE(FORCE_FD_ZERO_MEMSET, 1, [Used to make "checker" understand that FD_ZERO() clears memory.])
1479     ;;
1480 esac
1481
1482 AC_CONFIG_FILES([Makefile lib/dummy zlib/dummy popt/dummy shconfig])
1483 AC_OUTPUT
1484
1485 AC_MSG_RESULT()
1486 AC_MSG_RESULT([    rsync $PACKAGE_VERSION configuration successful])
1487 AC_MSG_RESULT()