From f1377a1375cf26016a5a04c473f84e850c6b9ac5 Mon Sep 17 00:00:00 2001 From: richard Date: Wed, 12 Aug 1998 14:41:20 +0000 Subject: [PATCH] * src/NSBundle: ([+initialize]) modified to take account of the environment variables GNUSTEP_TARGET_DIR, GNUSTEP_TARGET_CPU, GNUSTEP_TARGET_OS, and LIBRARY_COMBO to override the defaults. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@2918 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 6 ++++++ Source/NSBundle.m | 23 +++++++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/ChangeLog b/ChangeLog index ede7afeb6..6301282c0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Wed Aug 12 14:55:00 1998 Richard Frith-Macdonald + + * src/NSBundle: ([+initialize]) modified to take account of the + environment variables GNUSTEP_TARGET_DIR, GNUSTEP_TARGET_CPU, + GNUSTEP_TARGET_OS, and LIBRARY_COMBO to override the defaults. + Fri Aug 4 10:55:00 1998 Richard Frith-Macdonald * src/GNUmakefile: Removed NSAllocateObject.m and diff --git a/Source/NSBundle.m b/Source/NSBundle.m index cb15b4fc7..fa6ab8f4a 100644 --- a/Source/NSBundle.m +++ b/Source/NSBundle.m @@ -215,9 +215,32 @@ _bundle_load_callback(Class theClass, Category *theCategory) { if (self == [NSBundle class]) { + NSDictionary *env; + /* Need to make this recursive since both mainBundle and initWithPath: want to lock the thread */ load_lock = [NSRecursiveLock new]; + env = [[NSProcessInfo processInfo] environment]; + if (env) + { + NSString *str; + + str = [env objectForKey: @"GNUSTEP_TARGET_DIR"]; + if (str) + gnustep_target_dir = [str retain]; + + str = [env objectForKey: @"GNUSTEP_TARGET_CPU"]; + if (str) + gnustep_target_cpu = [str retain]; + + str = [env objectForKey: @"GNUSTEP_TARGET_OS"]; + if (str) + gnustep_target_os = [str retain]; + + str = [env objectForKey: @"LIBRARY_COMBO"]; + if (str) + library_combo = [str retain]; + } } }