Added hack that should allow to load class lists of frameworks with a relative path (eg, if you have ../../MyFrameworks/ in your LD_LIBRARY_PATH you may be to load a framework with a relative path)

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@31037 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
nicola 2010-07-26 14:08:22 +00:00
parent ff3aa75775
commit 6aa37194f4
2 changed files with 26 additions and 5 deletions

View file

@ -556,11 +556,24 @@ _find_main_bundle_for_tool(NSString *toolName)
{
NSString *pathComponent;
/* bundlePath should really be an absolute path; we
* recommend you use only absolute paths in LD_LIBRARY_PATH.
*
* If it isn't, we try to survive the situation; we assume
* it's relative to the launch directory. That's how the
* dynamic linker would have found it after all. This is
* fragile though, so please use absolute paths.
*/
if ([bundlePath isAbsolutePath] == NO)
{
bundlePath = [_launchDirectory
stringByAppendingPathComponent: bundlePath];
}
/* Dereference symlinks, and standardize path. This will
* only work properly if the original bundlePath is
* absolute. This should normally be the case if, as
* recommended, you use only absolute paths in
* LD_LIBRARY_PATH.
* absolute.
*/
bundlePath = [bundlePath stringByStandardizingPath];
@ -607,7 +620,8 @@ _find_main_bundle_for_tool(NSString *toolName)
[NSString stringWithFormat: @"%@%@", name, @".framework"]];
}
#else
/* There are no Versions on MinGW. Skip the Versions check here. */
/* There are no Versions on MinGW. So the version check is only
* done on non-MinGW. */
/* version name */
bundlePath = [bundlePath stringByDeletingLastPathComponent];
@ -686,7 +700,6 @@ _find_main_bundle_for_tool(NSString *toolName)
Class class = NSClassFromString(*fmClasses);
value = [NSValue valueWithPointer: (void*)class];
[bundle->_bundleClasses addObject: value];
fmClasses++;