mirror of
https://github.com/gnustep/libs-base.git
synced 2025-06-01 17:12:03 +00:00
Tidied
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@12442 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
a5a46280cd
commit
0bde820ad2
2 changed files with 18 additions and 10 deletions
|
@ -421,11 +421,6 @@ _bundle_load_callback(Class theClass, struct objc_category *theCategory)
|
||||||
NSMutableString *system = nil;
|
NSMutableString *system = nil;
|
||||||
NSString *str;
|
NSString *str;
|
||||||
|
|
||||||
if ((str = [env objectForKey: @"GNUSTEP_TARGET_DIR"]) != nil)
|
|
||||||
gnustep_target_dir = RETAIN(str);
|
|
||||||
else if ((str = [env objectForKey: @"GNUSTEP_HOST_DIR"]) != nil)
|
|
||||||
gnustep_target_dir = RETAIN(str);
|
|
||||||
|
|
||||||
if ((str = [env objectForKey: @"GNUSTEP_TARGET_CPU"]) != nil)
|
if ((str = [env objectForKey: @"GNUSTEP_TARGET_CPU"]) != nil)
|
||||||
gnustep_target_cpu = RETAIN(str);
|
gnustep_target_cpu = RETAIN(str);
|
||||||
else if ((str = [env objectForKey: @"GNUSTEP_HOST_CPU"]) != nil)
|
else if ((str = [env objectForKey: @"GNUSTEP_HOST_CPU"]) != nil)
|
||||||
|
@ -436,6 +431,11 @@ _bundle_load_callback(Class theClass, struct objc_category *theCategory)
|
||||||
else if ((str = [env objectForKey: @"GNUSTEP_HOST_OS"]) != nil)
|
else if ((str = [env objectForKey: @"GNUSTEP_HOST_OS"]) != nil)
|
||||||
gnustep_target_os = RETAIN(str);
|
gnustep_target_os = RETAIN(str);
|
||||||
|
|
||||||
|
if ((str = [env objectForKey: @"GNUSTEP_TARGET_DIR"]) != nil)
|
||||||
|
gnustep_target_dir = RETAIN(str);
|
||||||
|
else if ((str = [env objectForKey: @"GNUSTEP_HOST_DIR"]) != nil)
|
||||||
|
gnustep_target_dir = RETAIN(str);
|
||||||
|
|
||||||
if ((str = [env objectForKey: @"LIBRARY_COMBO"]) != nil)
|
if ((str = [env objectForKey: @"LIBRARY_COMBO"]) != nil)
|
||||||
library_combo = RETAIN(str);
|
library_combo = RETAIN(str);
|
||||||
|
|
||||||
|
|
|
@ -686,7 +686,7 @@ pty_slave(const char* name)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a validated launch path or nil.<br />
|
* Returns a validated launch path or nil.<br />
|
||||||
* Allows for the GNUstep host, operating system, and library combination
|
* Allows for the GNUstep host/operating system, and library combination
|
||||||
* subdirectories in a path, appending them as necessary to try to locate
|
* subdirectories in a path, appending them as necessary to try to locate
|
||||||
* the actual binary to be used.<br />
|
* the actual binary to be used.<br />
|
||||||
* Checks that the binary file exists and is executable.<br />
|
* Checks that the binary file exists and is executable.<br />
|
||||||
|
@ -697,7 +697,8 @@ pty_slave(const char* name)
|
||||||
{
|
{
|
||||||
NSFileManager *mgr;
|
NSFileManager *mgr;
|
||||||
NSString *libs;
|
NSString *libs;
|
||||||
NSString *arch;
|
NSString *cpu;
|
||||||
|
NSString *os;
|
||||||
NSString *prog;
|
NSString *prog;
|
||||||
NSString *lpath;
|
NSString *lpath;
|
||||||
NSString *base_path;
|
NSString *base_path;
|
||||||
|
@ -711,7 +712,8 @@ pty_slave(const char* name)
|
||||||
|
|
||||||
mgr = [NSFileManager defaultManager];
|
mgr = [NSFileManager defaultManager];
|
||||||
libs = [NSBundle _library_combo];
|
libs = [NSBundle _library_combo];
|
||||||
arch = [NSBundle _gnustep_target_dir];
|
os = [NSBundle _gnustep_target_os];
|
||||||
|
cpu = [NSBundle _gnustep_target_cpu];
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Set lpath to the actual path to use for the executable.
|
* Set lpath to the actual path to use for the executable.
|
||||||
|
@ -724,20 +726,26 @@ pty_slave(const char* name)
|
||||||
base_path = [_launchPath stringByDeletingLastPathComponent];
|
base_path = [_launchPath stringByDeletingLastPathComponent];
|
||||||
if ([[base_path lastPathComponent] isEqualToString: libs] == YES)
|
if ([[base_path lastPathComponent] isEqualToString: libs] == YES)
|
||||||
base_path = [base_path stringByDeletingLastPathComponent];
|
base_path = [base_path stringByDeletingLastPathComponent];
|
||||||
if ([[base_path lastPathComponent] isEqualToString: arch] == YES)
|
if ([[base_path lastPathComponent] isEqualToString: os] == YES)
|
||||||
base_path = [base_path stringByDeletingLastPathComponent];
|
base_path = [base_path stringByDeletingLastPathComponent];
|
||||||
arch_path = [base_path stringByAppendingPathComponent: arch];
|
if ([[base_path lastPathComponent] isEqualToString: cpu] == YES)
|
||||||
|
base_path = [base_path stringByDeletingLastPathComponent];
|
||||||
|
arch_path = [base_path stringByAppendingPathComponent: cpu];
|
||||||
|
arch_path = [arch_path stringByAppendingPathComponent: os];
|
||||||
full_path = [arch_path stringByAppendingPathComponent: libs];
|
full_path = [arch_path stringByAppendingPathComponent: libs];
|
||||||
|
|
||||||
lpath = [full_path stringByAppendingPathComponent: prog];
|
lpath = [full_path stringByAppendingPathComponent: prog];
|
||||||
if ([mgr isExecutableFileAtPath: lpath] == NO)
|
if ([mgr isExecutableFileAtPath: lpath] == NO)
|
||||||
{
|
{
|
||||||
|
NSLog(@"No executable in %@", lpath);
|
||||||
lpath = [arch_path stringByAppendingPathComponent: prog];
|
lpath = [arch_path stringByAppendingPathComponent: prog];
|
||||||
if ([mgr isExecutableFileAtPath: lpath] == NO)
|
if ([mgr isExecutableFileAtPath: lpath] == NO)
|
||||||
{
|
{
|
||||||
|
NSLog(@"No executable in %@", lpath);
|
||||||
lpath = [base_path stringByAppendingPathComponent: prog];
|
lpath = [base_path stringByAppendingPathComponent: prog];
|
||||||
if ([mgr isExecutableFileAtPath: lpath] == NO)
|
if ([mgr isExecutableFileAtPath: lpath] == NO)
|
||||||
{
|
{
|
||||||
|
NSLog(@"No executable in %@", lpath);
|
||||||
/*
|
/*
|
||||||
* Last resort - if the launch path was simply a program name
|
* Last resort - if the launch path was simply a program name
|
||||||
* get NSBundle to try using the PATH environment
|
* get NSBundle to try using the PATH environment
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue