Make the system root be the default installation root.

Use test.make for test programs so that they do not get installed.
Fix NSBundle so that it removes the library combo, target os, and
target cpu when determining the bundle's dir path.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@2592 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Scott Christley 1997-10-30 22:23:50 +00:00
parent 3324d6f0d4
commit a992701d88
13 changed files with 120 additions and 15 deletions

View file

@ -116,6 +116,18 @@ static NSString* gnustep_target_dir =
#else
nil;
#endif
static NSString* gnustep_target_cpu =
#ifdef GNUSTEP_TARGET_CPU
@GNUSTEP_TARGET_CPU;
#else
nil;
#endif
static NSString* gnustep_target_os =
#ifdef GNUSTEP_TARGET_OS
@GNUSTEP_TARGET_OS;
#else
nil;
#endif
static NSString* library_combo =
#ifdef LIBRARY_COMBO
@LIBRARY_COMBO;
@ -232,7 +244,7 @@ _bundle_load_callback(Class theClass, Category *theCategory)
if ( !_mainBundle )
{
char *output;
NSString *path;
NSString *path, *s;
path = [[NSProcessInfo processInfo] processName];
output = objc_find_executable([path cString]);
@ -243,6 +255,24 @@ _bundle_load_callback(Class theClass, Category *theCategory)
/* Strip off the name of the program */
path = [path stringByDeletingLastPathComponent];
/* The executable may not lie in the main bundle directory
so we need to chop off the extra subdirectories, the library
combo and the target cpu/os if they exist. The executable and
this library should match so that is why we can use the
compiled-in settings. */
/* library combo */
s = [path lastPathComponent];
if ([s isEqual: library_combo])
path = [path stringByDeletingLastPathComponent];
/* target os */
s = [path lastPathComponent];
if ([s isEqual: gnustep_target_os])
path = [path stringByDeletingLastPathComponent];
/* target cpu */
s = [path lastPathComponent];
if ([s isEqual: gnustep_target_cpu])
path = [path stringByDeletingLastPathComponent];
#ifdef DEBUG
fprintf(stderr, "Debug (NSBundle): Found main in %s\n",
[path cString]);