diff --git a/ChangeLog b/ChangeLog index 2e71b1d26..917633939 100644 --- a/ChangeLog +++ b/ChangeLog @@ -10,6 +10,8 @@ * Source/NSBundle.m: ([bundleForLibrary:version:]) extract version from end of library name if possible. + ([_addFrameworkFromClass:]) find the framework directory from path to + the dll on windows. 2008-12-04 Richard Frith-Macdonald diff --git a/Source/NSBundle.m b/Source/NSBundle.m index ece4a214a..395e69944 100644 --- a/Source/NSBundle.m +++ b/Source/NSBundle.m @@ -595,8 +595,22 @@ _find_main_bundle_for_tool(NSString *toolName) { bundlePath = [bundlePath stringByDeletingLastPathComponent]; } +#if defined(__MINGW32__) + /* On windows, the library (dll) is in the Tools area rather than + * in the framework, so we can adjust the path here. + */ + if ([[bundlePath lastPathComponent] isEqual: @"Tools"]) + { + bundlePath = [bundlePath stringByDeletingLastPathComponent]; + bundlePath + = [bundlePath stringByAppendingPathComponent: @"Library"]; + bundlePath + = [bundlePath stringByAppendingPathComponent: @"Frameworks"]; + bundlePath = [bundlePath stringByAppendingPathComponent: + [NSString stringWithFormat: @"%@%@", name, @".framework"]]; + } +#else /* There are no Versions on MinGW. Skip the Versions check here. */ -#if !defined(__MINGW32__) /* version name */ bundlePath = [bundlePath stringByDeletingLastPathComponent];