[#include <stdio.h>], [return !ftello;])
fi
])
+
+dnl Check for socklen_t: historically on BSD it is an int, and in
+dnl POSIX 1g it is a type of its own, but some platforms use different
+dnl types for the argument to getsockopt, getpeername, etc. So we
+dnl have to test to find something that will work.
+
+dnl This test originally comes from lftp, by way of Albert Chin at The
+dnl Written Word. Thanks!
+
+AC_DEFUN([TYPE_SOCKLEN_T],
+[
+ AC_MSG_CHECKING([for socklen_t])
+ AC_CACHE_VAL([lftp_cv_socklen_t],
+ [
+ lftp_cv_socklen_t=no
+ AC_TRY_COMPILE([
+ #include <sys/types.h>
+ #include <sys/socket.h>
+ ],
+ [
+ socklen_t len;
+ getpeername(0,0,&len);
+ ],
+ [
+ lftp_cv_socklen_t=yes
+ ])
+ ])
+ AC_MSG_RESULT($lftp_cv_socklen_t)
+ if test $lftp_cv_socklen_t = no; then
+ AC_MSG_CHECKING([for socklen_t equivalent])
+ AC_CACHE_VAL([lftp_cv_socklen_t_equiv],
+ [
+ lftp_cv_socklen_t_equiv=int
+ AC_LANG_SAVE
+ for t in int size_t unsigned long "unsigned long"; do
+ AC_TRY_COMPILE([
+ #include <sys/types.h>
+ #include <sys/socket.h>
+ ],
+ [
+ $t len;
+ getpeername(0,0,&len);
+ ],
+ [
+ lftp_cv_socklen_t_equiv="$t"
+ break
+ ])
+ done
+ ])
+ AC_MSG_RESULT($lftp_cv_socklen_t_equiv)
+ AC_DEFINE_UNQUOTED(socklen_t, $lftp_cv_socklen_t_equiv,
+ [type to use in place of socklen_t if not defined])
+ fi
+])
+
AC_TYPE_GETGROUPS
AC_STRUCT_ST_RDEV
AC_CHECK_TYPE([ino_t], [unsigned])
-AC_CHECK_TYPE([socklen_t], [int])
+TYPE_SOCKLEN_T
AC_CACHE_CHECK([for errno in errno.h],rsync_cv_errno, [
AC_TRY_COMPILE([#include <errno.h>],[int i = errno],
AC_CHECK_LIB(popt, poptGetContext, , [with_included_popt=yes])
fi
-AC_MSG_CHECKING("whether to use included libpopt")
+AC_MSG_CHECKING([whether to use included libpopt])
if test x"$with_included_popt" = x"yes"
then
- AC_MSG_RESULT("$srcdir/popt")
+ AC_MSG_RESULT($srcdir/popt)
BUILD_POPT='$(popt_OBJS)'
CFLAGS="$CFLAGS -I$srcdir/popt"
else