Making rsync compile under Mac OS X 10.3.9 with extended
attributes
Vitorio
v.machado at permanence-informatique.fr
Mon Feb 11 19:52:20 GMT 2008
Hi people,
What I have done today:
1) Downloaded a fresh copy of rsync 3.0.0pre9
2) patched with:
patch -p1 <patches/flags.diff
patch -p1 <patches/crtimes.diff
3) Overwrote sysxattrs.c, sysxattrs.h and configure.in with the ones
from http://shared.and.free.fr/rsync10.3xattr_support080211/
What changed in those files:
sysxattrs.h :
#ifdef SUPPORT_XATTRS
#if defined HAVE_ATTR_XATTR_H
#include <attr/xattr.h>
#elif defined HAVE_SYS_XATTR_H
#include <sys/xattr.h>
#elif defined HAVE_SYS_EXTATTR_H
#include <sys/extattr.h>
#elif defined HAVE_PRE_TIGER_OSX_ATTRS
#include <sys/attr.h>
#include <unistd.h>
#include <string.h>
#include <Files.h>
#endif
configure.in:
line 555:
extattr_get_link sigaction sigprocmask setattrlist getattrlist)
line 920:
[], [case "$ac_cv_func_getxattr$ac_cv_func_extattr_get_link
$ac_cv_func_getattrlist" in
line 935:
darwin[4-7]*)
AC_MSG_RESULT(Using OS X PreTiger attrs)
AC_DEFINE(HAVE_PRE_TIGER_OSX_ATTRS, 1, [True if you have Mac OS X
PreTiger attrs])
AC_DEFINE(SUPPORT_XATTRS, 1)
;;
darwin[1-38-9]*)
AC_MSG_RESULT(Using OS X xattrs)
AC_DEFINE(HAVE_OSX_XATTRS, 1, [True if you have Mac OS X xattrs])
AC_DEFINE(SUPPORT_XATTRS, 1)
;;
4) ran ./configure --host=powerpc-apple-darwin7.9.0 (to simulate pre
tiger machine)
5) ran make, who asked me to run "make reconfigure" because the
configure script changed
6) ran "make reconfigure"
7) ran make
But the --host in ./configure is not enough to force my 10.4 to act
like a 10.3 system. Also tried --target and --build without success,
it always shows me
checking whether to support extended attributes... Using OS X xattrs
instead of:
checking whether to support extended attributes... Using OS X
PreTiger xattrs
So I've tried bruteforce mode, changed line 935 of configure.in to this:
darwin[4-7]*)
AC_MSG_RESULT(Using OS X PreTiger attrs)
AC_DEFINE(HAVE_PRE_TIGER_OSX_ATTRS, 1, [True if you have Mac OS X
PreTiger attrs])
AC_DEFINE(SUPPORT_XATTRS, 1)
;;
darwin[1-38-9]*)
# AC_MSG_RESULT(Using OS X xattrs)
# AC_DEFINE(HAVE_OSX_XATTRS, 1, [True if you have Mac OS X xattrs])
AC_MSG_RESULT(Using OS X PreTiger attrs)
AC_DEFINE(HAVE_PRE_TIGER_OSX_ATTRS, 1, [True if you have Mac OS X
PreTiger attrs])
AC_DEFINE(SUPPORT_XATTRS, 1)
So theoretically, even on Tiger it should enable
HAVE_PRE_TIGER_OSX_ATTRS and I should test my code. But no! The damn
"Using OS X xattrs" is always there on running ./configure or make
reconfigure. I've searched, normally this sentence only appears in
this part of the code. Even a make clean, closing and reopening the
Terminal, nothing makes it accept my changes and show "Using OS X
PreTiger attr" that would confirm I'll compile my branch of the code...
Is something missing? A little bit of code to change somewhere else?
Please, can somebody help me with this part of the process? I'm not
used to GNU configure scripts...
We are getting close! How frustrating to spend more time trying to
configure the compilation script than coding...
Best regards,
Vitorio
Le 27 janv. 08 à 13:54, Matt McCutchen a écrit :
> On Sun, 2008-01-27 at 13:10 +0100, Vitorio Machado wrote:
>> For the way of recognizing the OS (pseudo-coded as mac < 10.4), ./
>> configure gives target as powerpc-apple-darwin7.9.0 for 10.3.9,
>> powerpc-apple-darwin8.11.0 for 10.4.11. darwinA.B.C represents Mac OS
>> X 10.(A-4).B, so I think here is our way to create a flag like
>> mac_bellow_tiger. But I don't know how to put this flag in the
>> configure script, especially because it seems to be automatically
>> generated, so would be better to patch the source than the result. Do
>> someone knows how to do that?
>
> The configure script is generated from "configure.in". It looks like
> all you have to do is add an extra test inside the "darwin*" case on
> line 892 to check if $host_os matches darwin[4567].* and, if so,
> define
> an additional macro HAVE_PRE_TIGER_OSX_ATTRS. Then lib/sysxattrs.*
> can
> test "#ifdef HAVE_PRE_TIGER_OSX_ATTRS".
>
> You also need to make sure that the configure script enables "xattr
> support" by default (really the 10.3-specific pseudo-xattr support)
> even
> though 10.3 fails all of the tests for the real xattr headers.
> Probably
> the way to do this is to add getattrlist to the list of functions on
> line 555 whose presence is tested and add it on line 920 as one of the
> functions whose presence indicates that xattrs are worth a try.
>
> Matt
>
More information about the rsync
mailing list