On Wed, Sep 06, 2000 at 12:57:56PM +1000, Andrew Tridgell wrote:
> Another week, another version :)
> 
> Changes in 2.4.6 are:
> 
> - added better LFS support for some OSes (for 64 bit file sizes)

Did you really mean to do this? I've cc'd Paul Eggert on this email, the
author of AC_SYS_LARGEFILE. As far as I know, LFS only matters to programs
*not* using the 64-bit data types, like off64_t (it essentially makes
the old 32-bit data types equivalent to the 64-bit data types so your
old programs using the 32-bit data types magically turn into programs
using the 64-bit data types). Rsync uses off64_t in the following test
on a Solaris 2.7/SPARC system for 2.4.5:
  checking for off64_t... yes

Now, because of the addition above, in 2.4.6 on the same host we have:
  checking for off64_t... no

Why is this? It's because, under Solaris, -D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64 sets sizeof(off_t) == sizeof(off64_t). And, the
autoconf test for off64_t fails:
  main() { struct stat64 st; off64_t s;
  if (sizeof(off_t) == sizeof(off64_t)) exit(1);
  exit((lstat64("/dev/null", &st)==0)?0:1); }],
because of this equality.

Is there a reason you added the getconf stuff? And, even if it really
is needed, we should be using AC_SYS_LARGEFILE from Paul Eggert as it
looks at more than the getconf stuff (e.g. his macro gets it right
under HP-UX where `getconf LFS_CFLAGS` does not work). I was going to
add AC_SYS_LARGEFILE once-upon-a-time to rsync but decided not to for
my reasoning above. Paul can correct me if I'm wrong.

I'm including a patch below to do two things to 2.4.6:
  1. redirect getconf to 2>/dev/null on systems such as HP-UX where
     % getconf LFS_CFLAGS
     getconf LFS_CFLAGS: Invalid argument
  2. Properly detect off64_t on HP-UX 10.20, 11.00 by testing for
     checking for off64_t... no
     checking for off64_t with -D_LARGEFILE64_SOURCE... yes

Also:
  AC_CHECK_PROG(HAVE_GETCONF, getconf, 1, 0)
outputs
  checking for getconf... 1
which does not have too much meaning.

-- 
albert chin ([EMAIL PROTECTED])

-- snip snip
--- configure.in.orig   Wed Sep  6 00:37:52 2000
+++ configure.in        Wed Sep  6 01:06:36 2000
@@ -12,8 +12,8 @@
 # look for getconf early as this affects just about everything
 AC_CHECK_PROG(HAVE_GETCONF, getconf, 1, 0)
 if test $HAVE_GETCONF = 1; then
-       CFLAGS=$CFLAGS" "`getconf LFS_CFLAGS`
-       LDFLAGS=$LDFLAGS" "`getconf LFS_LDFLAGS`
+       CFLAGS=$CFLAGS" "`getconf LFS_CFLAGS 2>/dev/null`
+       LDFLAGS=$LDFLAGS" "`getconf LFS_LDFLAGS 2>/dev/null`
 fi
 
 dnl Checks for programs.
@@ -153,11 +153,27 @@
     AC_DEFINE(HAVE_LONGLONG)
 fi
 
-AC_CACHE_CHECK([for off64_t],rsync_cv_HAVE_OFF64_T,[
-AC_TRY_RUN([#include <stdio.h>
+AC_MSG_CHECKING([for off64_t])
+AC_CACHE_VAL(rsync_cv_HAVE_OFF64_T,[
+  AC_TRY_RUN([#include <stdio.h>
+main() { struct stat64 st; off64_t s;
+if (sizeof(off_t) == sizeof(off64_t)) exit(1);
+exit((lstat64("/dev/null", &st)==0)?0:1); }],
+rsync_cv_HAVE_OFF64_T=yes,[
+  AC_MSG_RESULT(no)
+  _cflags=${CFLAGS}
+  CFLAGS="${CFLAGS} -D_LARGEFILE64_SOURCE"
+  AC_MSG_CHECKING([for off64_t with -D_LARGEFILE64_SOURCE])
+  AC_TRY_RUN([#include <stdio.h>
 #include <sys/stat.h>
-main() { struct stat64 st; off64_t s; if (sizeof(off_t) == sizeof(off64_t)) exit(1); 
exit((lstat64("/dev/null", &st)==0)?0:1); }],
-rsync_cv_HAVE_OFF64_T=yes,rsync_cv_HAVE_OFF64_T=no,rsync_cv_HAVE_OFF64_T=cross)])
+main() { struct stat64 st; off64_t s;
+if (sizeof(off_t) == sizeof(off64_t)) exit(1);
+exit((lstat64("/dev/null", &st)==0)?0:1); }],
+  rsync_cv_HAVE_OFF64_T=yes,
+  rsync_cv_HAVE_OFF64_T=no
+  CFLAGS=${_cflags})],
+  rsync_cv_HAVE_OFF64_T=cross)])
+AC_MSG_RESULT($rsync_cv_HAVE_OFF64_T)
 if test x"$rsync_cv_HAVE_OFF64_T" = x"yes"; then
     AC_DEFINE(HAVE_OFF64_T)
 fi

Reply via email to