From f794a4cb3c1ffea3a78839c85757433e68754c15 Mon Sep 17 00:00:00 2001 From: Richard Frith-MacDonald Date: Fri, 5 Dec 2008 17:45:02 +0000 Subject: [PATCH] improve locating of framework directories on windows git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@27214 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 2 ++ Source/NSBundle.m | 16 +++++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) 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];