+AC_DEFINE_UNQUOTED(HAVE_REMSH, $HAVE_REMSH, [ ])
+
+
+# arrgh. libc in the current debian stable screws up the largefile
+# stuff, getting byte range locking wrong
+AC_CACHE_CHECK([for broken largefile support],rsync_cv_HAVE_BROKEN_LARGEFILE,[
+AC_TRY_RUN([
+#define _FILE_OFFSET_BITS 64
+#include <stdio.h>
+#include <fcntl.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+
+int main(void)
+{
+ struct flock lock;
+ int status;
+ int fd = open("conftest.dat", O_CREAT|O_RDWR, 0600);
+ lock.l_type = F_WRLCK;
+ lock.l_whence = SEEK_SET;
+ lock.l_start = 0;
+ lock.l_len = 1;
+ lock.l_pid = 0;
+
+ fcntl(fd,F_SETLK,&lock);
+ if (fork() == 0) {
+ lock.l_start = 1;
+ exit(fcntl(fd,F_SETLK,&lock) == 0);
+ }
+ wait(&status);
+ unlink("conftest.dat");
+ exit(WEXITSTATUS(status));
+}
+],
+rsync_cv_HAVE_BROKEN_LARGEFILE=yes,rsync_cv_HAVE_BROKEN_LARGEFILE=no,rsync_cv_HAVE_BROKEN_LARGEFILE=cross)])
+if test x"$rsync_cv_HAVE_BROKEN_LARGEFILE" != x"yes"; then
+ AC_SYS_LARGEFILE
+fi
+
+ipv6type=unknown
+ipv6lib=none
+ipv6trylibc=yes
+
+AC_ARG_ENABLE(ipv6,
+ AC_HELP_STRING([--disable-ipv6], [don't even try to use IPv6]))
+
+if test "x$enable_ipv6" != xno
+then
+ AC_MSG_CHECKING([ipv6 stack type])
+ for i in inria kame linux-glibc linux-inet6 toshiba v6d zeta; do
+ case $i in
+ inria)
+ # http://www.kame.net/
+ AC_EGREP_CPP(yes, [
+#include <netinet/in.h>
+#ifdef IPV6_INRIA_VERSION
+yes
+#endif],
+ [ipv6type=$i;
+ AC_DEFINE(INET6, 1, [true if you have IPv6])
+ ])
+ ;;
+ kame)
+ # http://www.kame.net/
+ AC_EGREP_CPP(yes, [
+#include <netinet/in.h>
+#ifdef __KAME__
+yes
+#endif],
+ [ipv6type=$i;
+ AC_DEFINE(INET6, 1, [true if you have IPv6])])
+ ;;
+ linux-glibc)
+ # http://www.v6.linux.or.jp/
+ AC_EGREP_CPP(yes, [
+#include <features.h>
+#if defined(__GLIBC__) && __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1
+yes
+#endif],
+ [ipv6type=$i;
+AC_DEFINE(INET6, 1, [true if you have IPv6])])
+ ;;
+ linux-inet6)
+ # http://www.v6.linux.or.jp/
+ if test -d /usr/inet6 -o -f /usr/inet6/lib/libinet6.a; then
+ ipv6type=$i
+ ipv6lib=inet6
+ ipv6libdir=/usr/inet6/lib
+ ipv6trylibc=yes;
+ AC_DEFINE(INET6, 1, [true if you have IPv6])
+ CFLAGS="-I/usr/inet6/include $CFLAGS"
+ fi
+ ;;
+ toshiba)
+ AC_EGREP_CPP(yes, [
+#include <sys/param.h>
+#ifdef _TOSHIBA_INET6
+yes
+#endif],
+ [ipv6type=$i;
+ ipv6lib=inet6;
+ ipv6libdir=/usr/local/v6/lib;
+ AC_DEFINE(INET6, 1, [true if you have IPv6])])
+ ;;
+ v6d)
+ AC_EGREP_CPP(yes, [
+#include </usr/local/v6/include/sys/v6config.h>
+#ifdef __V6D__
+yes
+#endif],
+ [ipv6type=$i;
+ ipv6lib=v6;
+ ipv6libdir=/usr/local/v6/lib;
+ AC_DEFINE(INET6, 1, [true if you have IPv6])])
+ ;;
+ zeta)
+ AC_EGREP_CPP(yes, [
+#include <sys/param.h>
+#ifdef _ZETA_MINAMI_INET6
+yes
+#endif],
+ [ipv6type=$i;
+ ipv6lib=inet6;
+ ipv6libdir=/usr/local/v6/lib;
+ AC_DEFINE(INET6, 1, [true if you have IPv6])])
+ ;;
+ esac
+ if test "$ipv6type" != "unknown"; then
+ break
+ fi
+ done
+ AC_MSG_RESULT($ipv6type)
+
+ AC_SEARCH_LIBS(getaddrinfo, inet6)
+fi