[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [rdiff-backup-users] Building rdiff-backup on Windows
From: |
Andrew Ferguson |
Subject: |
Re: [rdiff-backup-users] Building rdiff-backup on Windows |
Date: |
Tue, 8 Apr 2008 00:11:34 -0400 |
Hi Josh,
On Apr 7, 2008, at 8:34 PM, Josh Nisly wrote:
Could someone with commit access please review these patches?
sure.
Thanks,
Josh Nisly
--- setup.py 2008-01-03 09:36:49.000000000 -0600
+++ setup.py 2008-04-02 17:58:36.984375000 -0500
@@ -40,6 +40,9 @@
libdir_list = [os.path.join(LIBRSYNC_DIR, 'lib')]
if '-lrsync' in LIBS:
libname = []
+elif os.name == 'nt':
+ incdir_list = ['.']
+ lflags_arg = ['/NODEFAULTLIB:libcmt.lib']
setup(name="rdiff-backup",
version=version_string,
Can you explain why this patch is necessary for Windows? When I last
built rdiff-backup under Cygwin/windowsXP (July/August timeframe), it
was not necessary to do that. Have things changed such that librsync
can only be built in the current directory? Is the libcmt.lib piece a
Vista thing, perhaps?
Personally, I don't commit patches that are only to make it build in
an individual user's environment (eg, I didn't commit logic to handle
librsync installed by the Fink package management system, etc.), so I
just wanted to check.
--- cmodule.c 2008-01-03 09:36:48.000000000 -0600
+++ cmodule.c 2008-04-01 20:08:15.484375000 -0500
@@ -24,7 +24,9 @@
#include <Python.h>
#include <sys/types.h>
#include <sys/stat.h>
+#if !defined(MS_WIN64) && !defined(MS_WIN32)
#include <unistd.h>
+#endif
#include <errno.h>
Looks good, but I don't have a system to test on. Again, I don't
remember the need to comment that out when I last built it. Do you not
have Cygwin installed, per chance? I believe you should have a
unistd.h file....
@@ -46,6 +48,7 @@
/* This code taken from Python's posixmodule.c */
#undef STAT
#if defined(MS_WIN64) || defined(MS_WIN32)
+# define lstat _stati64
# define STAT _stati64
# define FSTAT _fstati64
# define STRUCT_STAT struct _stati64
@@ -69,6 +72,16 @@
#define S_ISFIFO(mode) (((mode) & S_IFMT) == S_IFIFO)
#endif
Ah, good catch, but what we should do is change the calls to 'lstat'
in the body of cmodule.c to be calls to LSTAT and then make that block:
#undef STAT
#undef LSTAT
#if defined(MS_WIN64) || defined(MS_WIN32)
# define LSTAT _stati64
# define STAT _stati64
# define FSTAT _fstati64
# define STRUCT_STAT struct _stati64
#else
# define LSTAT lstat
# define STAT stat
# define FSTAT fstat
# define STRUCT_STAT struct stat
#endif
(not that STAT and FSTAT are used in cmodule.c any more, but at least
it keeps the correct mappings there for the future).
+#if defined(MS_WIN64) || defined(MS_WIN32)
+#define S_ISSOCK(mode) (0)
+#define S_ISFIFO(mode) (0)
+#define S_ISLNK(mode) (0)
+#define S_ISCHR(mode) (0)
+#define S_ISBLK(mode) (0)
+#define sync _flushall
+#endif
+
Do these types not exist on Windows? (socket, fifo, symlink, character
device, block device) ?
The sync() call in my_sync() should operate like the LSTAT/STAT/FSTAT
calls ... it should be in caps, SYNC(), and then have the definition
of SYNC in the LSTAT, etc. block above.
Andrew
- [rdiff-backup-users] Building rdiff-backup on Windows, Josh Nisly, 2008/04/07
- Re: [rdiff-backup-users] Building rdiff-backup on Windows, Oliver Hookins, 2008/04/07
- Re: [rdiff-backup-users] Building rdiff-backup on Windows,
Andrew Ferguson <=
- Re: [rdiff-backup-users] Building rdiff-backup on Windows, Josh Nisly, 2008/04/08
- Re: [rdiff-backup-users] Building rdiff-backup on Windows, Andrew Ferguson, 2008/04/08
- Re: [rdiff-backup-users] Building rdiff-backup on Windows, Josh Nisly, 2008/04/08
- Re: [rdiff-backup-users] Building rdiff-backup on Windows, Andrew Ferguson, 2008/04/08
- Re: [rdiff-backup-users] Building rdiff-backup on Windows, Josh Nisly, 2008/04/08
- Re: [rdiff-backup-users] Building rdiff-backup on Windows, Andrew Ferguson, 2008/04/08
Re: [rdiff-backup-users] Building rdiff-backup on Windows, Josh Nisly, 2008/04/08