Tweaks for running on Darwin aka OS X.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@31366 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Wolfgang Lux 2010-09-17 20:23:48 +00:00
parent fb76b96247
commit 4fad29abb5
3 changed files with 50 additions and 0 deletions

View file

@ -1,3 +1,11 @@
2010-09-17 Wolfgang Lux <wolfgang.lux@gmail.com>
* Source/NSBundle.m (+bundleForLibrary:version:): Use proper
suffix for dynamic libraries on Darwin (.dylib instead of .so).
* Source/NSTask.m (-launch): Use fork instead of vfork on Darwin,
since setsid will fail while the child process is in the vfork.
2010-09-17 Wolfgang Lux <wolfgang.lux@gmail.com>
* Source/NSObject.m (-methodSignatureForSelector:): Fix bug were

View file

@ -2387,6 +2387,42 @@ IF_NO_GC(
}
}
}
#elif defined(__APPLE__)
/* A .dylib is usually of the form 'libxxx.maj.min.sub.dylib',
* but GNUstep-make installs them with 'libxxx.dylib.maj.min.sub'.
* For maximum compatibility with support both forms here.
*/
if ([[libraryName pathExtension] isEqual: @"dylib"])
{
NSString *s = [libraryName stringByDeletingPathExtension];
NSArray *a = [s componentsSeparatedByString: @"."];
if ([a count] > 1)
{
libraryName = [a objectAtIndex: 0];
if (interfaceVersion == nil && [a count] >= 3)
{
interfaceVersion = [NSString stringWithFormat: @"%@.%@",
[a objectAtIndex: 1], [a objectAtIndex: 2]];
}
}
}
else
{
r = [libraryName rangeOfString: @".dylib."];
if (r.length > 0)
{
NSString *s = [libraryName substringFromIndex: NSMaxRange(r)];
NSArray *a = [s componentsSeparatedByString: @"."];
libraryName = [libraryName substringToIndex: r.location];
if (interfaceVersion == nil && [a count] >= 2)
{
interfaceVersion = [NSString stringWithFormat: @"%@.%@",
[a objectAtIndex: 0], [a objectAtIndex: 1]];
}
}
}
#else
/* A .so is usually of the form 'libxxx.so.maj.min.sub'
* so we can extract the version info and use it.

View file

@ -1511,6 +1511,12 @@ GSPrivateCheckTasks()
}
edesc = [hdl fileDescriptor];
#ifdef __APPLE__
/* Use fork instead of vfork on Darwin because setsid() fails under
* Darwin 7 (aka OS X 10.3) and later while the child is in the vfork.
*/
#define vfork fork
#endif
pid = vfork();
if (pid < 0)
{