The directory structure of a framework is like this:
fw.framework
Versions
A
fw
Libraries
a.dylib
b.dylib
Current -> A
Libraries -> Versions/Current/Libraries
fw -> Versions/Current/fw
Dependencies:
fwlinks toa.dyliba.dyliblinks tob.dylib
a.dylib and b.dylib have the install name @rpath/a.dylib and @rpath/b.dylib.
The RPATH of fw is set to @loader_path/Libraries, so that it can find a.dylib.
But the RPATH of a.dylib is set to @loader_path, because its dependency b.dylib is in the same directory.
Will this work? Will the linker use the RPATH of a.dylib (and not the one of fw, when recursively linking b.dylib)
And will @loader_path in the RPATH of a.dylib refer to the directory of a.dylib, and not that of fw?