598
598
bundlePath = [bundlePath stringByDeletingLastPathComponent];
600
#if defined(__MINGW32__)
601
/* On windows, the library (dll) is in the Tools area rather than
602
* in the framework, so we can adjust the path here.
604
if ([[bundlePath lastPathComponent] isEqual: @"Tools"])
606
bundlePath = [bundlePath stringByDeletingLastPathComponent];
608
= [bundlePath stringByAppendingPathComponent: @"Library"];
610
= [bundlePath stringByAppendingPathComponent: @"Frameworks"];
611
bundlePath = [bundlePath stringByAppendingPathComponent:
612
[NSString stringWithFormat: @"%@%@", name, @".framework"]];
600
615
/* There are no Versions on MinGW. Skip the Versions check here. */
601
#if !defined(__MINGW32__)
602
616
/* version name */
603
617
bundlePath = [bundlePath stringByDeletingLastPathComponent];
695
709
if (_loadingBundle != nil && _loadingBundle != bundle)
697
[_loadingBundle->_bundleClasses
698
removeObjectsInArray: bundle->_bundleClasses];
712
id b = bundle->_bundleClasses;
713
id l = _loadingBundle->_bundleClasses;
715
/* The following essentially does:
717
* [_loadingBundle->_bundleClasses
718
* removeObjectsInArray: bundle->_bundleClasses];
720
* The problem with that code is isEqual: gets
721
* sent to the classes, which will cause them to be
722
* initialized (which should not happen.)
724
for (i = 0; i < [b count]; i++)
726
for (j = 0; j < [l count]; j++)
728
if ([[l objectAtIndex: j] nonretainedObjectValue]
729
== [[b objectAtIndex:i] nonretainedObjectValue])
731
[l removeObjectAtIndex:j];
1159
1195
* Get the library bundle ... if there wasn't one then we
1160
1196
* will assume the class was in the program executable and
1161
1197
* return the mainBundle instead.
1163
* FIXME: This will not work well with versioned library
1164
* resources. It used to work fine (maybe) with unversioned
1165
* library resources.
1167
1199
bundle = [NSBundle bundleForLibrary: lib];
1168
1200
if (bundle == nil)
2273
2305
NSEnumerator *enumerator;
2274
2306
NSString *path;
2275
2307
NSFileManager *fm = [NSFileManager defaultManager];
2278
2311
* Eliminate any base path or extensions.
2280
2313
libraryName = [libraryName lastPathComponent];
2283
libraryName = [libraryName stringByDeletingPathExtension];
2285
while ([[libraryName pathExtension] length] > 0);
2315
#if defined(__MINGW32__)
2316
/* A dll is usually of the form 'xxx-maj_min.dll'
2317
* so we can extract the version info and use it.
2319
if ([[libraryName pathExtension] isEqual: @"dll"])
2321
libraryName = [libraryName stringByDeletingPathExtension];
2322
r = [libraryName rangeOfString: @"-" options: NSBackwardsSearch];
2327
ver = [[libraryName substringFromIndex: NSMaxRange(r)]
2328
stringByReplacingString: @"_" withString: @"."];
2329
libraryName = [libraryName substringToIndex: r.location];
2330
if (interfaceVersion == nil)
2332
interfaceVersion = ver;
2337
/* A .so is usually of the form 'libxxx.so.maj.min.sub'
2338
* so we can extract the version info and use it.
2340
r = [libraryName rangeOfString: @".so."];
2343
NSString *s = [libraryName substringFromIndex: NSMaxRange(r)];
2344
NSArray *a = [s componentsSeparatedByString: @"."];
2346
libraryName = [libraryName substringToIndex: r.location];
2347
if (interfaceVersion == nil && [a count] >= 2)
2349
interfaceVersion = [NSString stringWithFormat: @"%@.%@",
2350
[a objectAtIndex: 0], [a objectAtIndex: 1]];
2355
while ([[libraryName pathExtension] length] > 0)
2357
libraryName = [libraryName stringByDeletingPathExtension];
2287
2361
* Discard leading 'lib'