diff --git a/Source/GSPrivate.h b/Source/GSPrivate.h index 56c1658c3..05139d3ed 100644 --- a/Source/GSPrivate.h +++ b/Source/GSPrivate.h @@ -26,6 +26,7 @@ #include +#import "Foundation/NSBundle.h" #import "Foundation/NSError.h" @class _GSInsensitiveDictionary; @@ -241,6 +242,16 @@ typedef enum { +@interface NSBundle (Private) ++ (NSString *) _absolutePathOfExecutable: (NSString *)path; ++ (NSBundle*) _addFrameworkFromClass: (Class)frameworkClass; ++ (NSMutableArray*) _addFrameworks; ++ (NSString*) _gnustep_target_cpu; ++ (NSString*) _gnustep_target_dir; ++ (NSString*) _gnustep_target_os; ++ (NSString*) _library_combo; +@end + /** * This class exists simply as a mechanism for encapsulating arrays * encoded using [NSKeyedArchiver-encodeArrayOfObjCType:count:at:] diff --git a/Source/NSBundle.m b/Source/NSBundle.m index c8e993de6..95fcac195 100644 --- a/Source/NSBundle.m +++ b/Source/NSBundle.m @@ -621,17 +621,6 @@ _find_main_bundle_for_tool(NSString *toolName) } - -@interface NSBundle (Private) -+ (NSString *) _absolutePathOfExecutable: (NSString *)path; -+ (NSBundle*) _addFrameworkFromClass: (Class)frameworkClass; -+ (NSMutableArray*) _addFrameworks; -+ (NSString*) _gnustep_target_cpu; -+ (NSString*) _gnustep_target_dir; -+ (NSString*) _gnustep_target_os; -+ (NSString*) _library_combo; -@end - @implementation NSBundle (Private) + (NSString *) _absolutePathOfExecutable: (NSString *)path diff --git a/Source/NSPathUtilities.m b/Source/NSPathUtilities.m index 84565121f..9463ad9c7 100644 --- a/Source/NSPathUtilities.m +++ b/Source/NSPathUtilities.m @@ -2316,6 +2316,7 @@ if (domainMask & mask) \ NSString *path = nil; NSString *bpath = nil; NSString *ipath = nil; + NSString *mpath = nil; NSFileManager *mgr; mgr = [NSFileManager defaultManager]; @@ -2386,17 +2387,19 @@ L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths\\GNUstep", RegCloseKey(regKey); } } + if (nil == path) + { + mpath = [NSBundle _absolutePathOfExecutable: @"make.exe"]; + if (nil != mpath) + { + path = devroot(mgr, mpath); + } + } ASSIGNCOPY(root, path); if (nil == root) { - if (nil == ipath) - { - NSLog(@"Failed to locate NSDeveloperDirectory above system tools at %@, or base library at %@, and failed to find any installed GNUstep package.", gnustepSystemTools, bpath); - } - else - { - NSLog(@"Failed to locate NSDeveloperDirectory above system tools at %@, or base library at %@, or installed package at %@", gnustepSystemTools, bpath, ipath); - } + NSLog(@"Failed to locate NSDeveloperDirectory by GNUstep configuration, installed GNUstep package, or process PATH."); + } } #endif diff --git a/Source/NSTask.m b/Source/NSTask.m index 700e24fcf..ab73abd9b 100644 --- a/Source/NSTask.m +++ b/Source/NSTask.m @@ -105,14 +105,6 @@ #endif -@interface NSBundle(Private) -+ (NSString *) _absolutePathOfExecutable: (NSString *)path; -+ (NSString*) _gnustep_target_cpu; -+ (NSString*) _gnustep_target_dir; -+ (NSString*) _gnustep_target_os; -+ (NSString*) _library_combo; -@end - static NSRecursiveLock *tasksLock = nil; static NSMapTable *activeTasks = 0;