* 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> 2007-02-18 Nicola Pero <nicola.pero@meta-innovation.com>
* configure.ac: Check for GNUSTEP_MAKEFILES, not GNUSTEP_SYSTEM_ROOT. * configure.ac: Check for GNUSTEP_MAKEFILES, not GNUSTEP_SYSTEM_ROOT.

View file

@ -56,7 +56,7 @@
<heading>Debug</heading> <heading>Debug</heading>
<p>In order to debug your application compile it with "gmake debug=yes" and <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 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> <p>Now you can enable debug starting your app with -GSWebDebug=&#60;option&#62;</p>
<example> <example>
Options Options

View file

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