Fix to make_file() to exit earlier if a file is excluded, because doing
[rsync/rsync.git] / configure.in
index d5c626d..060ebc2 100644 (file)
@@ -1,7 +1,7 @@
 dnl Process this file with autoconf to produce a configure script.
 AC_INIT(byteorder.h)
 AC_CONFIG_HEADER(config.h)
-AC_PREREQ(2.12)
+AC_PREREQ(2.52)
 
 LDFLAGS=${LDFLAGS-""}
 
@@ -28,19 +28,12 @@ fi
 
 CFLAGS="$CFLAGS -DHAVE_CONFIG_H"
 
-# look for getconf early as this affects just about everything
-AC_CHECK_PROG(HAVE_GETCONF, getconf, "yes", "no")
-if test $HAVE_GETCONF = "yes"; then
-       CFLAGS=$CFLAGS" "`getconf LFS_CFLAGS 2> /dev/null`
-       LDFLAGS=$LDFLAGS" "`getconf LFS_LDFLAGS 2> /dev/null`
-fi
-
 AC_ARG_WITH(included-popt,
         [  --with-included-popt    use bundled popt library, not from system])
 
 AC_ARG_WITH(rsync-path,
        [  --with-rsync-path=PATH  set default --rsync-path to PATH (default: \"rsync\")],
-       [ RSYNC_PATH="$with_rsync_name" ],
+       [ RSYNC_PATH="$with_rsync_path" ],
        [ RSYNC_PATH="rsync" ])
 AC_DEFINE_UNQUOTED(RSYNC_PATH, "$RSYNC_PATH", [ ])
 
@@ -52,7 +45,45 @@ AC_SUBST(SHELL)
 AC_CHECK_PROG(HAVE_REMSH, remsh, 1, 0)
 AC_DEFINE_UNQUOTED(HAVE_REMSH, $HAVE_REMSH, [ ])
 
-AC_SYS_LARGEFILE
+
+# 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
+
+
+
 AC_C_BIGENDIAN
 AC_HEADER_DIRENT
 AC_HEADER_TIME
@@ -347,4 +378,4 @@ AC_SUBST(OBJ_RESTORE)
 AC_SUBST(CC_SHOBJ_FLAG)
 AC_SUBST(BUILD_POPT)
 
-AC_OUTPUT(Makefile lib/dummy zlib/dummy)
+AC_OUTPUT(Makefile lib/dummy zlib/dummy popt/dummy shconfig)