* GSWeb.framework/GSWApplication.m (GSWApplicationMainReal):

Remove dependency on GNUSTEP_SYSTEM_ROOT and search all domains
	in precedence for frameworks to load.

	* Doc/howto.gsdoc: Replace reference to GNUSTEP_SYSTEM_ROOT with
	new installation location.  Also remove refernece to obsolete debug extension.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@24641 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
David Ayers 2007-02-18 11:19:58 +00:00
parent 1d83fd7875
commit c751ea3e90
3 changed files with 50 additions and 33 deletions

View file

@ -1,3 +1,12 @@
2006-12-12 David Ayers <ayers@fsfe.org>
* GSWeb.framework/GSWApplication.m (GSWApplicationMainReal):
Remove dependency on GNUSTEP_SYSTEM_ROOT and search all domains
in precedence for frameworks to load.
* Doc/howto.gsdoc: Replace reference to GNUSTEP_SYSTEM_ROOT with
new installation location. Also remove refernece to obsolete debug extension.
2007-02-18 Nicola Pero <nicola.pero@meta-innovation.com>
* configure.ac: Check for GNUSTEP_MAKEFILES, not GNUSTEP_SYSTEM_ROOT.

View file

@ -56,7 +56,7 @@
<heading>Debug</heading>
<p>In order to debug your application compile it with "gmake debug=yes" and
install with "gmake install debug=yes". You'll find your application in
GNUSTEP_SYSTEM_ROOT/GSWApps/MyApp.debug</p>
GNUSTEP_DOMAIN/GNUSTEP_LIBRARY/GSWApps/MyApp.gswa</p>
<p>Now you can enable debug starting your app with -GSWebDebug=&#60;option&#62;</p>
<example>
Options

View file

@ -142,45 +142,53 @@ int GSWApplicationMainReal(NSString* applicationClassName,
{
NSArray* frameworks=[applicationClass loadFrameworks];
NSDebugFLog(@"LOAD Frameworks frameworks=%@",frameworks);
if (frameworks)
{
NSBundle* bundle=nil;
int i=0;
unsigned i=0,j=0;
BOOL loadResult=NO;
int frameworksCount=[frameworks count];
/* FIXME: This should use gnustep-base's NSPathUtilities API
* to search for things. GNUSTEP_SYSTEM_ROOT might not even
* be defined under FHS! gnustep-base's NSPathUtilities API
* will always work under all filesystem layouts.
*/
NSString* GNUstepRoot=[[[NSProcessInfo processInfo]environment]
objectForKey:@"GNUSTEP_SYSTEM_ROOT"];
NSDebugFLLog(@"bundles",@"GNUstepRoot=%@",GNUstepRoot);
// NSDebugFLLog(@"bundles",@"[[NSProcessInfo processInfo]environment]=%@",[[NSProcessInfo processInfo]environment]);
NSDebugFLLog(@"bundles",@"[NSProcessInfo processInfo]=%@",
[NSProcessInfo processInfo]);
NSFileManager *fm = [NSFileManager defaultManager];
NSArray *searchDomains
= NSSearchPathForDirectoriesInDomains(NSLibraryDirectory,
NSAllDomainsMask,
NO);
unsigned frameworksCount=[frameworks count];
unsigned searchDomainCount=[searchDomains count];
for(i=0;i<frameworksCount;i++)
{
NSString* bundlePath=[frameworks objectAtIndex:i];
NSDebugFLLog(@"bundles",@"bundlePath=%@",bundlePath);
//TODO
NSDebugFLLog(@"bundles",@"GSFrameworkPSuffix=%@",
GSFrameworkPSuffix);
bundlePath
= [NSString stringWithFormat: @"%@/Library/Frameworks/%@%@",
GNUstepRoot, bundlePath, GSFrameworkPSuffix];
NSDebugFLLog(@"bundles",@"bundlePath=%@",bundlePath);
bundle=[NSBundle bundleWithPath:bundlePath];
NSDebugFLLog(@"bundles",@"bundle=%@",bundle);
loadResult=[bundle load];
NSDebugFLog(@"_bundlePath %@ loadResult=%s",
bundlePath,(loadResult ? "YES" : "NO"));
if (!loadResult)
{
result=-1;
ExceptionRaise(@"GSWApplication",@"Can't load framework %@",
bundlePath);
};
NSString* searchPath=nil;
for (j=0;j<searchDomainCount;j++)
{
searchPath = [searchDomains objectAtIndex:j];
searchPath = [searchPath stringByAppendingPathComponent:@"Frameworks"];
searchPath = [searchPath stringByAppendingPathComponent: bundlePath];
/* FIXME: This should be using stringByAppendingPathExtension:
but GSFrameworkPSuffix already has the '.'.*/
searchPath = [searchPath stringByAppendingString: GSFrameworkPSuffix];
if ([fm fileExistsAtPath: searchPath])
{
bundle=[NSBundle bundleWithPath:searchPath];
loadResult=[bundle load];
if (!loadResult)
{
ExceptionRaise(@"GSWApplication",@"Can't load framework %@",
searchPath);
};
/* Break out of the inner for loop. */
j = searchDomainCount;
}
else
{
bundle = nil;
}
}
if (!bundle)
{
ExceptionRaise(@"GSWApplication",@"Can't load framework %@",
bundlePath);
};
};
};
NSDebugFLLog(@"bundles",@"[NSBundle allBundles] pathes=%@",