diff --git a/ChangeLog b/ChangeLog index 64d09254d..769ba752c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,31 @@ +2000-10-28 Mirko Viviani + + * Headers/gnustep/base/NSBundle.h: added ivar. + * Source/NSBundle.m ([NSBundle +_addFrameworkFromClass:]): new private + method to parse NSFramework_* classes. + (_bundle_load_callback): added framework support. Wrap classes in a + NSValue to avoid implicit initialization. + ([NSBundle +allBundles]): added framework support. + ([NSBundle +allFrameworks]): implemented. + ([NSBundle +bundleForClass:]): get classes from NSValue object. + ([NSBundle -classNamed:]): likewise. + + * Headers/gnustep/base/objc-load.h (LINKER_GETSYMBOL): new define. + * Source/objc-load.m (objc_get_symbol_path): get lib path of a Class + or Category. + * Source/simple-load.h (__objc_dynamic_get_symbol_path): indentifies + lib path of a symbol. + * Source/dld-load.h (__objc_dynamic_get_symbol_path): not supported. + * Source/hpux-load.h (__objc_dynamic_get_symbol_path): not implemented. + + * Source/mframe/mframe.foot (mframe_get_arg): typ declaration fix. + (mframe_set_arg): idem + + * Headers/gnustep/base/config.h.in: added HAVE_DLADDR + * aclocal.m4 (OBJC_SYS_DYNAMIC_LINKER): test for dladdr() + * configure.in: added --with-libxml-include and --with-libxml-library, + added -I/usr/local/include and -L/usr/local/lib for FreeBSD. + 2000-10-27 Richard Frith-Macdonald * Source/NSObject.m: Reverted last change - @@ -81,7 +109,6 @@ * Source/GSString.m: Changed all substringFromRange: to substringWithRange: as this is the basic method. ->>>>>>> 1.737 2000-10-23 Richard Frith-Macdonald * Source/NSString.m: ([-fastestEncoding]), ([-smallestEncoding]) diff --git a/Headers/gnustep/base/NSBundle.h b/Headers/gnustep/base/NSBundle.h index 3328b4ead..e6a2bd94e 100644 --- a/Headers/gnustep/base/NSBundle.h +++ b/Headers/gnustep/base/NSBundle.h @@ -45,6 +45,7 @@ GS_EXPORT NSString* NSLoadedClasses; unsigned _bundleType; BOOL _codeLoaded; unsigned _version; + NSString *_frameworkVersion; } + (NSArray*) allBundles; diff --git a/Headers/gnustep/base/config.h.in b/Headers/gnustep/base/config.h.in index 744f0bfac..1e76bdf46 100644 --- a/Headers/gnustep/base/config.h.in +++ b/Headers/gnustep/base/config.h.in @@ -132,6 +132,9 @@ /* Define if you have the vsprintf function. */ #undef HAVE_VSPRINTF +/* Define if you have the dladdr function. */ +#undef HAVE_DLADDR + /* Define if you have the header file. */ #undef HAVE_DIRENT_H diff --git a/Headers/gnustep/base/objc-load.h b/Headers/gnustep/base/objc-load.h index d432e55a5..8db95eb65 100644 --- a/Headers/gnustep/base/objc-load.h +++ b/Headers/gnustep/base/objc-load.h @@ -10,6 +10,13 @@ #include #include +#include + +#if HAVE_DLADDR +#define LINKER_GETSYMBOL 1 +#else +#define LINKER_GETSYMBOL 0 +#endif extern long objc_load_module( const char *filename, @@ -33,4 +40,8 @@ extern long objc_unload_modules( FILE *errorStream, void (*unloadCallback)(Class, Category*)); +extern NSString *objc_get_symbol_path( + Class theClass, + Category *theCategory); + #endif /* __objc_load_h_INCLUDE */ diff --git a/Source/NSBundle.m b/Source/NSBundle.m index 501caa826..5bfbfe809 100644 --- a/Source/NSBundle.m +++ b/Source/NSBundle.m @@ -4,6 +4,9 @@ Written by: Adam Fedor Date: May 1993 + Author: Mirko Viviani + Date: October 2000 Added frameworks support + This file is part of the GNUstep Base Library. This library is free software; you can redistribute it and/or @@ -39,10 +42,19 @@ #include #include #include +#include #include +#include + +@interface NSObject (PrivateFrameworks) ++ (NSString *)frameworkEnv; ++ (NSString *)frameworkPath; ++ (NSString *)frameworkVersion; ++ (NSString **)frameworkClasses; +@end typedef enum { - NSBUNDLE_BUNDLE = 1, NSBUNDLE_APPLICATION, NSBUNDLE_LIBRARY + NSBUNDLE_BUNDLE = 1, NSBUNDLE_APPLICATION, NSBUNDLE_FRAMEWORK } bundle_t; /* Class variables - We keep track of all the bundles */ @@ -200,32 +212,274 @@ _bundle_name_first_match(NSString* directory, NSString* name) } @interface NSBundle (Private) ++ (BOOL) _addFrameworkFromClass:(Class)frameworkClass; - (NSArray *) _bundleClasses; @end @implementation NSBundle (Private) + ++ (BOOL) _addFrameworkFromClass:(Class)frameworkClass +{ + NSBundle *bundle; + NSString **fmClasses, *bundlePath = nil; + int len = strlen(frameworkClass->name); + + if (len > 12*sizeof(char) + && !strncmp("NSFramework_", frameworkClass->name, sizeof(char)*12)) + { + NSString *varEnv, *path, *name; + + name = [NSString stringWithCString: &frameworkClass->name[12]]; + + varEnv = [frameworkClass frameworkEnv]; + if (varEnv && [varEnv length]) + bundlePath = [[[NSProcessInfo processInfo] environment] + objectForKey: varEnv]; + + path = [frameworkClass frameworkPath]; + if (path && [path length]) + { + if (bundlePath) + bundlePath = [bundlePath + stringByAppendingPathComponent: path]; + else + bundlePath = path; + } + else + bundlePath = [bundlePath + stringByAppendingPathComponent: @"Library/Frameworks"]; + + bundlePath = [bundlePath stringByAppendingPathComponent: + [NSString stringWithFormat: @"%@.framework", + name]]; + + bundle = [NSBundle bundleWithPath: bundlePath]; + bundle->_bundleType = NSBUNDLE_FRAMEWORK; + bundle->_codeLoaded = YES; + bundle->_frameworkVersion = RETAIN([frameworkClass frameworkVersion]); + bundle->_bundleClasses = RETAIN([NSMutableArray arrayWithCapacity: 2]); + + fmClasses = [frameworkClass frameworkClasses]; + + while (*fmClasses) + { + NSValue *value; + Class class = NSClassFromString(*fmClasses); + + value = [NSValue valueWithNonretainedObject: class]; + + [(NSMutableArray *)[bundle _bundleClasses] + addObject: value]; + + if (_loadingBundle) + { + NSEnumerator *classEnum; + NSValue *obj; + + classEnum = [_loadingBundle->_bundleClasses objectEnumerator]; + while ((obj = [classEnum nextObject])) + { + if ([obj nonretainedObjectValue] == class) + { + [(NSMutableArray *)_loadingBundle->_bundleClasses + removeObject: obj]; + break; + } + } + } + + fmClasses++; + } + + return YES; + } + + return NO; +} + - (NSArray *) _bundleClasses { return _bundleClasses; } + @end +static NSString *lastSymbolPath = nil; +static NSString *lastFrameworkName = nil; +static NSBundle *lastFrameworkBundle = nil; + void _bundle_load_callback(Class theClass, Category *theCategory) { + NSBundle *bundle = nil; + NSString *className; + NSString *path, *bundlePath = nil, *lastComponent; + NSString *libName, *frameworkVersion = nil; + BOOL isFramework = NO; + NSCAssert(_loadingBundle, NSInternalInconsistencyException); + + if (theClass) + className = NSStringFromClass(theClass); + else + className = [NSString stringWithCString: theCategory->class_name]; + +#if !LINKER_GETSYMBOL + if ([NSBundle _addFrameworkFromClass: theClass] == YES) + return; +#else + path = objc_get_symbol_path(theClass, theCategory); + + if (lastSymbolPath && [lastSymbolPath isEqual: path] == YES) + isFramework = YES; + else + { + NSString *s; + + DESTROY(lastSymbolPath); + DESTROY(lastFrameworkBundle); + DESTROY(lastFrameworkName); + + /* + * Check for framework dirs + * + * /Library/Frameworks/ + * /Library/Libraries/ + */ + + libName = [path lastPathComponent]; + s = [path stringByDeletingLastPathComponent]; // remove lib name + s = [s stringByDeletingLastPathComponent]; // remove *-*-*-* + s = [s stringByDeletingLastPathComponent]; // remove system name + s = [s stringByDeletingLastPathComponent]; // remove processor + + lastComponent = [s lastPathComponent]; + + // is in /Library/Libraries ? + if ([lastComponent isEqual: @"Libraries"] == YES) + { + s = [s stringByDeletingLastPathComponent]; // remove Libraries + + if ([[s lastPathComponent] isEqual: @"Library"] == YES) + { + const char *cString; + int i, len; + + s = [s stringByAppendingPathComponent: @"Frameworks"]; + + cString = [libName cString]; + len = [libName length]; + + if (len > 3) + { + for (i = 3; i < len; i++) + if (cString[i] == '.') + break; + + if (i-3) + { + NSString *name; + + name = [NSString stringWithCString: &cString[3] + length: i-3]; + + bundlePath = [s stringByAppendingPathComponent: + [NSString stringWithFormat: + @"%@.framework", name]]; + + name = [NSString stringWithFormat: @"NSFramework_%@", + name]; + + ASSIGN(lastFrameworkName, name); + ASSIGN(lastSymbolPath, path); + + isFramework = YES; + } + } + } + } + else + { + // if there is an extension it is not a framework + if ([[lastComponent pathExtension] length] == 0) + { + frameworkVersion = lastComponent; + s = [s stringByDeletingLastPathComponent]; // remove version + bundlePath = [s stringByDeletingLastPathComponent]; // remove version dir + + if ([[bundlePath pathExtension] isEqual: @"framework"] == YES) + { + ASSIGN(lastSymbolPath, path); + isFramework = YES; + } + } + } + + if (isFramework == YES) + { + if (_bundles) + bundle = (NSBundle *)NSMapGet(_bundles, bundlePath); + + if (!bundle && _releasedBundles) + { + bundle = (NSBundle *)NSMapGet(_releasedBundles, bundlePath); + + if (bundle) + { + NSMapInsert(_bundles, bundlePath, bundle); + NSMapRemove(_releasedBundles, bundlePath); + } + } + + if (!bundle) + { + bundle = [NSBundle bundleWithPath: bundlePath]; + bundle->_bundleType = NSBUNDLE_FRAMEWORK; + bundle->_codeLoaded = YES; + bundle->_frameworkVersion = RETAIN(frameworkVersion); + bundle->_bundleClasses = RETAIN([NSMutableArray + arrayWithCapacity: 2]); + } + + ASSIGN(lastFrameworkBundle, bundle); + } + } + + if (isFramework == YES) + { + bundle = lastFrameworkBundle; + + if (lastFrameworkName) + { + if ([className isEqual: lastFrameworkName] == YES) + { + bundle->_frameworkVersion = RETAIN([theClass frameworkVersion]); + + DESTROY(lastFrameworkName); + } + } + } + else +#endif + bundle = _loadingBundle; + /* Don't store categories */ if (!theCategory) - [(NSMutableArray *)[_loadingBundle _bundleClasses] addObject: (id)theClass]; + [(NSMutableArray *)[bundle _bundleClasses] + addObject: [NSValue + valueWithNonretainedObject: (id)theClass]]; } + @implementation NSBundle + (void)initialize { if (self == [NSBundle class]) { - NSDictionary *env; + NSDictionary *env; + void *state = NULL; + Class class; _emptyTable = RETAIN([NSDictionary dictionary]); @@ -276,6 +530,23 @@ _bundle_load_callback(Class theClass, Category *theCategory) RETAIN(_executable_path); _gnustep_bundle = RETAIN([NSBundle bundleWithPath: system]); + +#if 0 + _loadingBundle = [NSBundle mainBundle]; + handle = objc_open_main_module(stderr); + printf("%08x\n", handle); +#endif + while ((class = objc_next_class(&state))) + [NSBundle _addFrameworkFromClass: class]; + +#if 0 + // _bundle_load_callback(class, NULL); + + // bundle = (NSBundle *)NSMapGet(_bundles, bundlePath); + + objc_close_main_module(handle); + _loadingBundle = nil; +#endif } } } @@ -291,9 +562,11 @@ _bundle_load_callback(Class theClass, Category *theCategory) enumerate = NSEnumerateMapTable(_bundles); while (NSNextMapEnumeratorPair(&enumerate, &key, (void **)&bundle)) { + if (bundle->_bundleType == NSBUNDLE_FRAMEWORK) + continue; + if ([array indexOfObjectIdenticalTo: bundle] == NSNotFound) { - /* FIXME - must ignore frameworks here */ [array addObject: bundle]; } } @@ -303,7 +576,23 @@ _bundle_load_callback(Class theClass, Category *theCategory) + (NSArray *) allFrameworks { - return [self notImplemented: _cmd]; + NSMapEnumerator enumerate; + NSMutableArray *array = [NSMutableArray arrayWithCapacity: 2]; + void *key; + NSBundle *bundle; + + [load_lock lock]; + enumerate = NSEnumerateMapTable(_bundles); + while (NSNextMapEnumeratorPair(&enumerate, &key, (void **)&bundle)) + { + if (bundle->_bundleType == NSBUNDLE_FRAMEWORK + && [array indexOfObjectIdenticalTo: bundle] == NSNotFound) + { + [array addObject: bundle]; + } + } + [load_lock unlock]; + return array; } + (NSBundle *)mainBundle @@ -366,10 +655,21 @@ _bundle_load_callback(Class theClass, Category *theCategory) enumerate = NSEnumerateMapTable(_bundles); while (NSNextMapEnumeratorPair(&enumerate, &key, (void **)&bundle)) { - int j; - j = [[bundle _bundleClasses] indexOfObject: aClass]; - if (j != NSNotFound && [bundle _bundleClasses]) + int i, j; + NSArray *bundleClasses = [bundle _bundleClasses]; + BOOL found = NO; + + j = [bundleClasses count]; + for (i = 0; i < j && found == NO; i++) + { + if ([[bundleClasses objectAtIndex: i] + nonretainedObjectValue] == aClass) + found = YES; + } + + if (found == YES) break; + bundle = nil; } [load_lock unlock]; @@ -440,9 +740,16 @@ _bundle_load_callback(Class theClass, Category *theCategory) } _path = [path copy]; - _bundleType = (unsigned int)NSBUNDLE_BUNDLE; - if (self == _mainBundle) - _bundleType = (unsigned int)NSBUNDLE_APPLICATION; + + if ([[[_path lastPathComponent] pathExtension] isEqual: @"framework"] == YES) + _bundleType = (unsigned int)NSBUNDLE_FRAMEWORK; + else + { + if (self == _mainBundle) + _bundleType = (unsigned int)NSBUNDLE_APPLICATION; + else + _bundleType = (unsigned int)NSBUNDLE_BUNDLE; + } [load_lock lock]; if (!_bundles) @@ -494,6 +801,7 @@ _bundle_load_callback(Class theClass, Category *theCategory) [load_lock unlock]; RELEASE(_path); } + TEST_RELEASE(_frameworkVersion); TEST_RELEASE(_bundleClasses); TEST_RELEASE(_infoDict); TEST_RELEASE(_localizations); @@ -507,8 +815,9 @@ _bundle_load_callback(Class theClass, Category *theCategory) - (Class) classNamed: (NSString *)className { - int j; + int i, j; Class theClass = Nil; + if (!_codeLoaded) { if (self != _mainBundle && ![self load]) @@ -526,9 +835,20 @@ _bundle_load_callback(Class theClass, Category *theCategory) } else { - j = [_bundleClasses indexOfObject: NSClassFromString(className)]; - if (j != NSNotFound) - theClass = [_bundleClasses objectAtIndex: j]; + BOOL found = NO; + + theClass = NSClassFromString(className); + j = [_bundleClasses count]; + + for (i = 0; i < j && found == NO; i++) + { + if ([[_bundleClasses objectAtIndex: i] + nonretainedObjectValue] == theClass) + found = YES; + } + + if (found == NO) + theClass = Nil; } return theClass; @@ -557,7 +877,8 @@ _bundle_load_callback(Class theClass, Category *theCategory) if (class_name) _principalClass = NSClassFromString(class_name); else if ([_bundleClasses count]) - _principalClass = [_bundleClasses objectAtIndex:0]; + _principalClass = [[_bundleClasses objectAtIndex: 0] + nonretainedObjectValue]; return _principalClass; } @@ -572,14 +893,22 @@ _bundle_load_callback(Class theClass, Category *theCategory) [load_lock lock]; if (!_codeLoaded) { - NSString* object; + NSString *object, *path; + NSEnumerator *classEnumerator; + NSMutableArray *classNames; + NSValue *class; + object = [[self infoDictionary] objectForKey: @"NSExecutable"]; if (object == nil || [object length] == 0) { [load_lock unlock]; return NO; } - object = bundle_object_name(_path, object); + if (_bundleType == NSBUNDLE_FRAMEWORK) + path = [_path stringByAppendingPathComponent:@"Versions/Current"]; + else + path = _path; + object = bundle_object_name(path, object); _loadingBundle = self; _bundleClasses = RETAIN([NSMutableArray arrayWithCapacity: 2]); if (objc_load_module([object cString], @@ -588,14 +917,27 @@ _bundle_load_callback(Class theClass, Category *theCategory) [load_lock unlock]; return NO; } + DESTROY(lastSymbolPath); + DESTROY(lastFrameworkName); + DESTROY(lastFrameworkBundle); + _codeLoaded = YES; _loadingBundle = nil; + + classNames = [NSMutableArray arrayWithCapacity: [_bundleClasses count]]; + classEnumerator = [_bundleClasses objectEnumerator]; + while ((class = [classEnumerator nextObject])) + [classNames addObject: NSStringFromClass([class + nonretainedObjectValue])]; + [load_lock unlock]; + [[NSNotificationCenter defaultCenter] postNotificationName: NSBundleDidLoadNotification object: self - userInfo: [NSDictionary dictionaryWithObjects: &_bundleClasses - forKeys: &NSLoadedClasses count: 1]]; + userInfo: [NSDictionary dictionaryWithObject: classNames + forKey: NSLoadedClasses]]; + return YES; } [load_lock unlock]; @@ -612,7 +954,7 @@ _bundle_load_callback(Class theClass, Category *theCategory)
// */ + (NSArray *) _bundleResourcePathsWithRootPath: (NSString *)rootPath - subPath: (NSString *)bundlePath + subPath: (NSString *)bundlePath { NSString* primary; NSString* language; @@ -639,10 +981,10 @@ _bundle_load_callback(Class theClass, Category *theCategory) } + (NSString *) pathForResource: (NSString *)name - ofType: (NSString *)ext - inRootPath: (NSString *)rootPath - inDirectory: (NSString *)bundlePath - withVersion: (int)version + ofType: (NSString *)ext + inRootPath: (NSString *)rootPath + inDirectory: (NSString *)bundlePath + withVersion: (int)version { NSString *path, *fullpath; NSEnumerator* pathlist; @@ -655,9 +997,9 @@ _bundle_load_callback(Class theClass, Category *theCategory) } pathlist = [[NSBundle _bundleResourcePathsWithRootPath: rootPath - subPath: bundlePath] objectEnumerator]; + subPath: bundlePath] objectEnumerator]; fullpath = nil; - while((path = [pathlist nextObject])) + while ((path = [pathlist nextObject])) { if (!bundle_directory_readable(path)) continue; @@ -702,45 +1044,53 @@ _bundle_load_callback(Class theClass, Category *theCategory) } + (NSString *) pathForResource: (NSString *)name - ofType: (NSString *)ext - inDirectory: (NSString *)bundlePath - withVersion: (int) version + ofType: (NSString *)ext + inDirectory: (NSString *)bundlePath + withVersion: (int) version { return [self pathForResource: name - ofType: ext - inRootPath: bundlePath - inDirectory: nil - withVersion: version]; + ofType: ext + inRootPath: bundlePath + inDirectory: nil + withVersion: version]; } + (NSString *) pathForResource: (NSString *)name - ofType: (NSString *)ext - inDirectory: (NSString *)bundlePath + ofType: (NSString *)ext + inDirectory: (NSString *)bundlePath { return [self pathForResource: name - ofType: ext - inRootPath: bundlePath - inDirectory: nil - withVersion: 0]; + ofType: ext + inRootPath: bundlePath + inDirectory: nil + withVersion: 0]; } - (NSString *) pathForResource: (NSString *)name - ofType: (NSString *)ext; + ofType: (NSString *)ext; { return [self pathForResource: name - ofType: ext - inDirectory: nil]; + ofType: ext + inDirectory: nil]; } - (NSString *) pathForResource: (NSString *)name - ofType: (NSString *)ext - inDirectory: (NSString *)bundlePath; + ofType: (NSString *)ext + inDirectory: (NSString *)bundlePath; { + NSString *rootPath; + + if (_frameworkVersion) + rootPath = [NSString stringWithFormat:@"%@/Versions/%@", [self bundlePath], + _frameworkVersion]; + else + rootPath = [self bundlePath]; + return [NSBundle pathForResource: name - ofType: ext - inRootPath: [self bundlePath] - inDirectory: bundlePath - withVersion: _version]; + ofType: ext + inRootPath: rootPath + inDirectory: bundlePath + withVersion: _version]; } - (NSArray *) pathsForResourcesOfType: (NSString *)extension @@ -753,7 +1103,7 @@ _bundle_load_callback(Class theClass, Category *theCategory) NSFileManager *mgr = [NSFileManager defaultManager]; pathlist = [[NSBundle _bundleResourcePathsWithRootPath: [self bundlePath] - subPath: bundlePath] objectEnumerator]; + subPath: bundlePath] objectEnumerator]; resources = [NSMutableArray arrayWithCapacity: 2]; allfiles = (extension == nil || [extension length] == 0); @@ -778,7 +1128,7 @@ _bundle_load_callback(Class theClass, Category *theCategory) table: (NSString *)tableName { NSDictionary *table; - NSString *newString; + NSString *newString = nil; if (_localizations == nil) _localizations = [[NSMutableDictionary alloc] initWithCapacity: 1]; @@ -866,7 +1216,17 @@ _bundle_load_callback(Class theClass, Category *theCategory) - (NSString *) resourcePath { - return [_path stringByAppendingPathComponent: @"Resources"]; + NSString *version = _frameworkVersion; + + if (!version) + version = @"Current"; + + if (_bundleType == NSBUNDLE_FRAMEWORK) + return [_path stringByAppendingPathComponent: + [NSString stringWithFormat:@"Versions/%@/Resources", + version]]; + else + return [_path stringByAppendingPathComponent: @"Resources"]; } - (NSDictionary *) infoDictionary @@ -1002,22 +1362,22 @@ _bundle_load_callback(Class theClass, Category *theCategory) /* Search user first */ path = [user_bundle pathForResource: name - ofType: ext - inDirectory: bundlePath]; + ofType: ext + inDirectory: bundlePath]; if (path) return path; /* Search local second */ path = [local_bundle pathForResource: name - ofType: ext - inDirectory: bundlePath]; + ofType: ext + inDirectory: bundlePath]; if (path) return path; /* Search system last */ path = [_gnustep_bundle pathForResource: name - ofType: ext - inDirectory: bundlePath]; + ofType: ext + inDirectory: bundlePath]; if (path) return path; diff --git a/Source/dld-load.h b/Source/dld-load.h index f72473f47..22a39461f 100644 --- a/Source/dld-load.h +++ b/Source/dld-load.h @@ -136,4 +136,11 @@ __objc_dynamic_list_undefined_symbols(void) return dld_list_undefined_sym(); } +/* current dld version does not support an equivalent of dladdr() */ +static char * +__objc_dynamic_get_symbol_path(dl_handle_t handle, dl_symbol_t symbol) +{ + return NULL; +} + #endif /* __dld_load_h_INCLUDE */ diff --git a/Source/hpux-load.h b/Source/hpux-load.h index 5b1d801c3..bfbbcaf04 100644 --- a/Source/hpux-load.h +++ b/Source/hpux-load.h @@ -81,4 +81,11 @@ __objc_dynamic_list_undefined_symbols(void) return NULL; } +// TODO: search for an hp-ux equivalent of dladdr() */ +static char * +__objc_dynamic_get_symbol_path(dl_handle_t handle, dl_symbol_t symbol) +{ + return NULL; +} + #endif /* __hpux_load_h_INCLUDE */ diff --git a/Source/mframe/mframe.foot b/Source/mframe/mframe.foot index caf504534..812d0240c 100644 --- a/Source/mframe/mframe.foot +++ b/Source/mframe/mframe.foot @@ -22,8 +22,10 @@ mframe_arg_addr(arglist_t argf, NSArgumentInfo *info) inline static void mframe_get_arg(arglist_t argf, NSArgumentInfo *info, void* buffer) { -#if MFRAME_STRUCT_BYREF +#if MFRAME_STRUCT_BYREF || MFRAME_FLT_IN_FRAME_AS_DBL const char *typ = info->type; +#endif +#if MFRAME_STRUCT_BYREF /* * If structures are passed in the stack frame by reference - we need @@ -48,8 +50,10 @@ mframe_get_arg(arglist_t argf, NSArgumentInfo *info, void* buffer) inline static void mframe_set_arg(arglist_t argf, NSArgumentInfo *info, void* buffer) { -#if MFRAME_STRUCT_BYREF +#if MFRAME_STRUCT_BYREF || MFRAME_FLT_IN_FRAME_AS_DBL const char *typ = info->type; +#endif +#if MFRAME_STRUCT_BYREF /* * If structures are passed in the stack frame by reference - we need diff --git a/Source/objc-load.m b/Source/objc-load.m index a537889c4..e1c036703 100644 --- a/Source/objc-load.m +++ b/Source/objc-load.m @@ -243,3 +243,61 @@ objc_unload_modules( fprintf(errorStream, "Warning: unloading modules not implemented\n"); return 0; } + +NSString * +objc_get_symbol_path(Class theClass, Category *theCategory) +{ + const char *ret; + char buf[125], *p = buf; + int len = strlen(theClass->name); + + if (!theCategory) + { + if (len+sizeof(char)*19 > sizeof(buf)) + { + p = malloc(len+sizeof(char)*19); + + if (!p) + { + fprintf(stderr, "Unable to allocate memory !!"); + return nil; + } + } + + memcpy(buf, "__objc_class_name_", sizeof(char)*18); + memcpy(&buf[18*sizeof(char)], theClass->name, + strlen(theClass->name)+1); + } + else + { + len += strlen(theCategory->category_name); + + if (len+sizeof(char)*23 > sizeof(buf)) + { + p = malloc(len+sizeof(char)*23); + + if (!p) + { + fprintf(stderr, "Unable to allocate memory !!"); + return nil; + } + } + + memcpy(buf, "__objc_category_name_", sizeof(char)*21); + memcpy(&buf[21*sizeof(char)], theCategory->class_name, + strlen(theCategory->class_name)+1); + memcpy(&buf[strlen(p)], "_", 2*sizeof(char)); + memcpy(&buf[strlen(p)], theCategory->category_name, + strlen(theCategory->category_name)+1); + } + + ret = __objc_dynamic_get_symbol_path(0, p); + + if (p != buf) + free(p); + + if (ret) + return [NSString stringWithCString:ret]; + + return nil; +} diff --git a/Source/simple-load.h b/Source/simple-load.h index 5bf3b01f9..4c0c39f32 100644 --- a/Source/simple-load.h +++ b/Source/simple-load.h @@ -84,4 +84,21 @@ __objc_dynamic_list_undefined_symbols(void) return NULL; } +static char * +__objc_dynamic_get_symbol_path(dl_handle_t handle, dl_symbol_t symbol) +{ + dl_symbol_t sym; + Dl_info info; + + sym = dlsym(RTLD_NEXT, symbol); + + if (!sym) + return NULL; + + if (!dladdr(sym, &info)) + return NULL; + + return info.dli_fname; +} + #endif /* __sunos_load_h_INCLUDE */ diff --git a/aclocal.m4 b/aclocal.m4 index 0056c7581..71452111a 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -84,6 +84,11 @@ if test $DYNAMIC_LINKER = null; then AC_CHECK_HEADER(dld/defs.h, DYNAMIC_LINKER=dld) fi +if test $DYNAMIC_LINKER = simple; then + AC_TRY_LINK([#include ], dladdr(0,0);, + AC_DEFINE(HAVE_DLADDR)) +fi + AC_SUBST(DYNAMIC_LINKER)dnl ]) diff --git a/configure b/configure index c3feadd16..e07ab5ab9 100755 --- a/configure +++ b/configure @@ -15,6 +15,10 @@ ac_help="$ac_help --enable-pass-arguments User main calls NSProcessInfo initialization" ac_help="$ac_help --enable-fake-main Force use of redefine of the main function" +ac_help="$ac_help + --with-libxml-include=PATH include path for libxml headers" +ac_help="$ac_help + --with-libxml-library=PATH library path for libxml libraries" # Initialize some variables set by options. # The variables have the same names as the options, with @@ -605,7 +609,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } fi echo $ac_n "checking host system type""... $ac_c" 1>&6 -echo "configure:609: checking host system type" >&5 +echo "configure:613: checking host system type" >&5 host_alias=$host case "$host_alias" in @@ -626,7 +630,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$ac_t""$host" 1>&6 echo $ac_n "checking target system type""... $ac_c" 1>&6 -echo "configure:630: checking target system type" >&5 +echo "configure:634: checking target system type" >&5 target_alias=$target case "$target_alias" in @@ -644,7 +648,7 @@ target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$ac_t""$target" 1>&6 echo $ac_n "checking build system type""... $ac_c" 1>&6 -echo "configure:648: checking build system type" >&5 +echo "configure:652: checking build system type" >&5 build_alias=$build case "$build_alias" in @@ -673,7 +677,7 @@ test "$host_alias" != "$target_alias" && # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:677: checking for $ac_word" >&5 +echo "configure:681: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -703,7 +707,7 @@ if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:707: checking for $ac_word" >&5 +echo "configure:711: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -754,7 +758,7 @@ fi # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:758: checking for $ac_word" >&5 +echo "configure:762: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -786,7 +790,7 @@ fi fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:790: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:794: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -797,12 +801,12 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF -#line 801 "configure" +#line 805 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:806: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:810: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -828,12 +832,12 @@ if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:832: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:836: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:837: checking whether we are using GNU C" >&5 +echo "configure:841: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -842,7 +846,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:846: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:850: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -861,7 +865,7 @@ ac_test_CFLAGS="${CFLAGS+set}" ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:865: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:869: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -893,7 +897,7 @@ else fi echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:897: checking how to run the C preprocessor" >&5 +echo "configure:901: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -908,13 +912,13 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:918: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:922: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -925,13 +929,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:935: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:939: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -942,13 +946,13 @@ else rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:952: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:956: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -976,7 +980,7 @@ echo "$ac_t""$CPP" 1>&6 # Extract the first word of "whoami", so it can be a program name with args. set dummy whoami; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:980: checking for $ac_word" >&5 +echo "configure:984: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_WHOAMI'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1016,6 +1020,14 @@ fi PIPE='-pipe' +#-------------------------------------------------------------------- +# specific target_os options +#-------------------------------------------------------------------- +case "$target_os" in + freebsd*) CPPFLAGS="$CPPFLAGS -I/usr/local/include" + LIBS="$LIBS -L/usr/local/lib";; +esac + #-------------------------------------------------------------------- # Find out if we\'re using NeXT\'s compiler. # if yes: @@ -1024,14 +1036,14 @@ PIPE='-pipe' # include implementations of List, HashTable etc. #-------------------------------------------------------------------- echo $ac_n "checking whether we are using NeXT's compiler""... $ac_c" 1>&6 -echo "configure:1028: checking whether we are using NeXT's compiler" >&5 +echo "configure:1040: checking whether we are using NeXT's compiler" >&5 cat > conftest.$ac_ext <&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1047: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1051,16 +1063,16 @@ if test $NeXTCC = 0; then # Find out if nested functions work on this machine #---------------------------------------------------------------- echo $ac_n "checking whether nested functions work""... $ac_c" 1>&6 -echo "configure:1055: checking whether nested functions work" >&5 +echo "configure:1067: checking whether nested functions work" >&5 if test "$cross_compiling" = yes; then gcc_nested=1 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1076: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then gcc_nested=1 else @@ -1092,16 +1104,16 @@ fi # Find out if we're on a NEXTSTEP machine #---------------------------------------------------------------- echo $ac_n "checking whether we are running under NEXTSTEP""... $ac_c" 1>&6 -echo "configure:1096: checking whether we are running under NEXTSTEP" >&5 +echo "configure:1108: checking whether we are running under NEXTSTEP" >&5 cat > conftest.$ac_ext <&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1117: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1129,16 +1141,16 @@ rm -f conftest* saved_ac_ext=$ac_ext ac_ext=m echo $ac_n "checking whether we are using GNU Objective C runtime""... $ac_c" 1>&6 -echo "configure:1133: checking whether we are using GNU Objective C runtime" >&5 +echo "configure:1145: checking whether we are using GNU Objective C runtime" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1154: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* NeXT_runtime=1 else @@ -1184,16 +1196,16 @@ else # Find out if we have NEXTSTEP 3.2 or lower #---------------------------------------------------------------- echo "checking NEXTSTEP version" 1>&6 -echo "configure:1188: checking NEXTSTEP version" >&5 +echo "configure:1200: checking NEXTSTEP version" >&5 cat > conftest.$ac_ext <&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1209: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1254,7 +1266,7 @@ fi # Check if Objective-C is installed #-------------------------------------------------------------------- echo $ac_n "checking for alternate objc library""... $ac_c" 1>&6 -echo "configure:1258: checking for alternate objc library" >&5 +echo "configure:1270: checking for alternate objc library" >&5 if eval "test \"`echo '$''{'gs_cv_objc_libdir'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1283,17 +1295,17 @@ for ac_hdr in objc/objc.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1287: checking for $ac_hdr" >&5 +echo "configure:1299: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1297: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1309: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1330,7 +1342,7 @@ fi # Check if libobjc was compiled with thread support. #-------------------------------------------------------------------- echo $ac_n "checking whether objc has thread support""... $ac_c" 1>&6 -echo "configure:1334: checking whether objc has thread support" >&5 +echo "configure:1346: checking whether objc has thread support" >&5 saved_LIBS="$LIBS" extra_LIBS="" case "${target_os}" in @@ -1345,11 +1357,11 @@ if test $host_os = linux-gnu; then objc_threaded="-lpthread" else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1365: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then objc_threaded="-lpthread" else @@ -1367,11 +1379,11 @@ fi objc_threaded="-lpcthread" else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1387: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then objc_threaded="-lpcthread" else @@ -1390,11 +1402,11 @@ elif test "`echo $host_os|sed 's/[0-9].*//'|sed s/elf//`" = freebsd; then objc_threaded="-pthread" else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1410: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then objc_threaded="-pthread" else @@ -1412,11 +1424,11 @@ fi objc_threaded="-lpthread" else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1432: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then objc_threaded="-lpthread" else @@ -1435,11 +1447,11 @@ fi objc_threaded="-lpcthread" else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1455: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then objc_threaded="-lpcthread" else @@ -1458,11 +1470,11 @@ else objc_threaded="-lthread" else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1478: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then objc_threaded="-lthread" else @@ -1489,14 +1501,14 @@ ac_cv_objc_threaded=$objc_threaded # Byte order information needed for foundation headers. #-------------------------------------------------------------------- echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6 -echo "configure:1493: checking whether byte ordering is bigendian" >&5 +echo "configure:1505: checking whether byte ordering is bigendian" >&5 if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_bigendian=unknown # See if sys/param.h defines the BYTE_ORDER macro. cat > conftest.$ac_ext < #include @@ -1507,11 +1519,11 @@ int main() { #endif ; return 0; } EOF -if { (eval echo configure:1511: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1523: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* # It does; now see whether it defined to BIG_ENDIAN or not. cat > conftest.$ac_ext < #include @@ -1522,7 +1534,7 @@ int main() { #endif ; return 0; } EOF -if { (eval echo configure:1526: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1538: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_bigendian=yes else @@ -1542,7 +1554,7 @@ if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1571: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_bigendian=no else @@ -1589,7 +1601,7 @@ fi # Type size information needed for foundation headers. #-------------------------------------------------------------------- echo $ac_n "checking size of void*""... $ac_c" 1>&6 -echo "configure:1593: checking size of void*" >&5 +echo "configure:1605: checking size of void*" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_voidp'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1597,7 +1609,7 @@ else { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < main() @@ -1608,7 +1620,7 @@ main() exit(0); } EOF -if { (eval echo configure:1612: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1624: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_voidp=`cat conftestval` else @@ -1634,7 +1646,7 @@ GS_UINT8="unsigned char" echo $ac_n "checking size of short""... $ac_c" 1>&6 -echo "configure:1638: checking size of short" >&5 +echo "configure:1650: checking size of short" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_short'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1642,7 +1654,7 @@ else { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < main() @@ -1653,7 +1665,7 @@ main() exit(0); } EOF -if { (eval echo configure:1657: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1669: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_short=`cat conftestval` else @@ -1675,7 +1687,7 @@ EOF echo $ac_n "checking size of int""... $ac_c" 1>&6 -echo "configure:1679: checking size of int" >&5 +echo "configure:1691: checking size of int" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1683,7 +1695,7 @@ else { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < main() @@ -1694,7 +1706,7 @@ main() exit(0); } EOF -if { (eval echo configure:1698: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1710: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_int=`cat conftestval` else @@ -1716,7 +1728,7 @@ EOF echo $ac_n "checking size of long""... $ac_c" 1>&6 -echo "configure:1720: checking size of long" >&5 +echo "configure:1732: checking size of long" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1724,7 +1736,7 @@ else { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < main() @@ -1735,7 +1747,7 @@ main() exit(0); } EOF -if { (eval echo configure:1739: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1751: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_long=`cat conftestval` else @@ -1757,7 +1769,7 @@ EOF echo $ac_n "checking size of long long""... $ac_c" 1>&6 -echo "configure:1761: checking size of long long" >&5 +echo "configure:1773: checking size of long long" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_long_long'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1765,7 +1777,7 @@ else { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < main() @@ -1776,7 +1788,7 @@ main() exit(0); } EOF -if { (eval echo configure:1780: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1792: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_long_long=`cat conftestval` else @@ -1798,7 +1810,7 @@ EOF echo $ac_n "checking size of float""... $ac_c" 1>&6 -echo "configure:1802: checking size of float" >&5 +echo "configure:1814: checking size of float" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_float'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1806,7 +1818,7 @@ else { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < main() @@ -1817,7 +1829,7 @@ main() exit(0); } EOF -if { (eval echo configure:1821: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1833: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_float=`cat conftestval` else @@ -1839,7 +1851,7 @@ EOF echo $ac_n "checking size of double""... $ac_c" 1>&6 -echo "configure:1843: checking size of double" >&5 +echo "configure:1855: checking size of double" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_double'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1847,7 +1859,7 @@ else { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < main() @@ -1858,7 +1870,7 @@ main() exit(0); } EOF -if { (eval echo configure:1862: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1874: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_double=`cat conftestval` else @@ -2062,7 +2074,7 @@ fi # Defines CON_AUTOLOAD (whether constructor functions are autoloaded) #-------------------------------------------------------------------- echo $ac_n "checking loading of constructor functions""... $ac_c" 1>&6 -echo "configure:2066: checking loading of constructor functions" >&5 +echo "configure:2078: checking loading of constructor functions" >&5 if eval "test \"`echo '$''{'objc_cv_con_autoload'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2103,17 +2115,17 @@ fi DYNAMIC_LINKER=null ac_safe=`echo "dlfcn.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for dlfcn.h""... $ac_c" 1>&6 -echo "configure:2107: checking for dlfcn.h" >&5 +echo "configure:2119: checking for dlfcn.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2117: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2129: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2137,17 +2149,17 @@ fi if test $DYNAMIC_LINKER = null; then ac_safe=`echo "dl.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for dl.h""... $ac_c" 1>&6 -echo "configure:2141: checking for dl.h" >&5 +echo "configure:2153: checking for dl.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2151: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2163: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2172,17 +2184,17 @@ fi if test $DYNAMIC_LINKER = null; then ac_safe=`echo "windows.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for windows.h""... $ac_c" 1>&6 -echo "configure:2176: checking for windows.h" >&5 +echo "configure:2188: checking for windows.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2186: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2198: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2207,17 +2219,17 @@ fi if test $DYNAMIC_LINKER = null; then ac_safe=`echo "dld/defs.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for dld/defs.h""... $ac_c" 1>&6 -echo "configure:2211: checking for dld/defs.h" >&5 +echo "configure:2223: checking for dld/defs.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2221: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2233: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2240,6 +2252,28 @@ fi fi +if test $DYNAMIC_LINKER = simple; then + cat > conftest.$ac_ext < +int main() { +dladdr(0,0); +; return 0; } +EOF +if { (eval echo configure:2265: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + cat >> confdefs.h <<\EOF +#define HAVE_DLADDR 1 +EOF + +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 +fi +rm -f conftest* +fi + #--------------------------------------------------------------------- @@ -2257,7 +2291,7 @@ if test x"$ac_cv_objc_threaded" != x""; then fi LIBS="$LIBS $extra_LIBS" echo $ac_n "checking if +load method is executed before main""... $ac_c" 1>&6 -echo "configure:2261: checking if +load method is executed before main" >&5 +echo "configure:2295: checking if +load method is executed before main" >&5 if eval "test \"`echo '$''{'objc_load_method_worked'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2265,11 +2299,11 @@ else objc_load_method_worked=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2307: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then objc_load_method_worked=yes else @@ -2304,12 +2338,12 @@ CPPFLAGS="$saved_CPPFLAGS" for ac_func in objc_condition_timedwait do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2308: checking for $ac_func" >&5 +echo "configure:2342: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2370: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2358,7 +2392,7 @@ done cat > conftest.$ac_ext < EOF @@ -2379,12 +2413,12 @@ LIBS="$saved_LIBS" # Generic settings needed by NSZone.m #-------------------------------------------------------------------- echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:2383: checking for ANSI C header files" >&5 +echo "configure:2417: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -2392,7 +2426,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2396: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2430: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2409,7 +2443,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -2427,7 +2461,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -2448,7 +2482,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -2459,7 +2493,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:2463: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2497: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -2483,12 +2517,12 @@ EOF fi echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:2487: checking for size_t" >&5 +echo "configure:2521: checking for size_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -2516,21 +2550,21 @@ EOF fi echo $ac_n "checking for inline""... $ac_c" 1>&6 -echo "configure:2520: checking for inline" >&5 +echo "configure:2554: checking for inline" >&5 if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2568: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_inline=$ac_kw; break else @@ -2560,12 +2594,12 @@ esac # Following header checks needed for bzero in Storage.m and other places #-------------------------------------------------------------------- echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:2564: checking for ANSI C header files" >&5 +echo "configure:2598: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -2573,7 +2607,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2577: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2611: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2590,7 +2624,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -2608,7 +2642,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -2629,7 +2663,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -2640,7 +2674,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:2644: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2678: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -2667,17 +2701,17 @@ for ac_hdr in string.h memory.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2671: checking for $ac_hdr" >&5 +echo "configure:2705: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2681: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2715: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2711,17 +2745,17 @@ for ac_hdr in values.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2715: checking for $ac_hdr" >&5 +echo "configure:2749: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2725: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2759: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2755,17 +2789,17 @@ for ac_hdr in sys/stat.h sys/vfs.h sys/statfs.h sys/statvfs.h pwd.h grp.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2759: checking for $ac_hdr" >&5 +echo "configure:2793: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2769: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2803: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2795,17 +2829,17 @@ for ac_hdr in sys/mount.h sys/types.h windows.h locale.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2799: checking for $ac_hdr" >&5 +echo "configure:2833: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2809: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2843: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2836,12 +2870,12 @@ LIBS="$LIBS -lm" for ac_func in statvfs symlink readlink geteuid rint do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2840: checking for $ac_func" >&5 +echo "configure:2874: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2902: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2898,17 +2932,17 @@ for ac_hdr in sys/time.h sys/rusage.h ucbinclude/sys/resource.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2902: checking for $ac_hdr" >&5 +echo "configure:2936: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2912: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2946: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2942,17 +2976,17 @@ for ac_hdr in sys/socket.h netinet/in.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2946: checking for $ac_hdr" >&5 +echo "configure:2980: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2956: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2990: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2986,17 +3020,17 @@ for ac_hdr in syslog.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2990: checking for $ac_hdr" >&5 +echo "configure:3024: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3000: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3034: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3025,12 +3059,12 @@ done for ac_func in syslog do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3029: checking for $ac_func" >&5 +echo "configure:3063: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3091: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3084,12 +3118,12 @@ done for ac_func in vsprintf vasprintf do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3088: checking for $ac_func" >&5 +echo "configure:3122: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3150: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3141,11 +3175,11 @@ if test $ac_cv_func_vsprintf = yes ; then VSPRINTF_RETURNS_LENGTH=1 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3183: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then VSPRINTF_RETURNS_LENGTH=1 else @@ -3167,11 +3201,11 @@ if test $ac_cv_func_vasprintf = yes ; then VASPRINTF_RETURNS_LENGTH=1 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3209: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then VASPRINTF_RETURNS_LENGTH=1 else @@ -3195,12 +3229,12 @@ fi for ac_func in getcwd do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3199: checking for $ac_func" >&5 +echo "configure:3233: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3261: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3252,12 +3286,12 @@ for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6 -echo "configure:3256: checking for $ac_hdr that defines DIR" >&5 +echo "configure:3290: checking for $ac_hdr that defines DIR" >&5 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include <$ac_hdr> @@ -3265,7 +3299,7 @@ int main() { DIR *dirp = 0; ; return 0; } EOF -if { (eval echo configure:3269: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3303: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "ac_cv_header_dirent_$ac_safe=yes" else @@ -3290,7 +3324,7 @@ done # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6 -echo "configure:3294: checking for opendir in -ldir" >&5 +echo "configure:3328: checking for opendir in -ldir" >&5 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3298,7 +3332,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldir $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3347: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3331,7 +3365,7 @@ fi else echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6 -echo "configure:3335: checking for opendir in -lx" >&5 +echo "configure:3369: checking for opendir in -lx" >&5 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3339,7 +3373,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lx $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3388: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3380,17 +3414,17 @@ for ac_hdr in getopt.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:3384: checking for $ac_hdr" >&5 +echo "configure:3418: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3394: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3428: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3423,12 +3457,12 @@ done for ac_func in valloc do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3427: checking for $ac_func" >&5 +echo "configure:3461: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3489: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3482,12 +3516,12 @@ done for ac_func in times do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3486: checking for $ac_func" >&5 +echo "configure:3520: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3548: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3541,12 +3575,12 @@ done for ac_func in mkstemp do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3545: checking for $ac_func" >&5 +echo "configure:3579: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3607: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3596,12 +3630,12 @@ done for ac_func in shmctl do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3600: checking for $ac_func" >&5 +echo "configure:3634: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3662: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3651,12 +3685,12 @@ done for ac_func in mmap do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3655: checking for $ac_func" >&5 +echo "configure:3689: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3717: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3710,12 +3744,12 @@ done for ac_func in inet_aton do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3714: checking for $ac_func" >&5 +echo "configure:3748: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3776: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3769,12 +3803,12 @@ done for ac_func in killpg setpgrp setpgid do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3773: checking for $ac_func" >&5 +echo "configure:3807: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3835: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3822,7 +3856,7 @@ fi done echo $ac_n "checking whether setpgrp takes no argument""... $ac_c" 1>&6 -echo "configure:3826: checking whether setpgrp takes no argument" >&5 +echo "configure:3860: checking whether setpgrp takes no argument" >&5 if eval "test \"`echo '$''{'ac_cv_func_setpgrp_void'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3830,7 +3864,7 @@ else { echo "configure: error: cannot check setpgrp if cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3888: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_setpgrp_void=no else @@ -3880,12 +3914,12 @@ fi for ac_func in usleep do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3884: checking for $ac_func" >&5 +echo "configure:3918: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3946: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3939,12 +3973,12 @@ done for ac_func in strerror do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3943: checking for $ac_func" >&5 +echo "configure:3977: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4005: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3996,12 +4030,12 @@ done # This function needed by NSString for handling of %@ printf directive. #-------------------------------------------------------------------- echo $ac_n "checking for register_printf_function""... $ac_c" 1>&6 -echo "configure:4000: checking for register_printf_function" >&5 +echo "configure:4034: checking for register_printf_function" >&5 if eval "test \"`echo '$''{'ac_cv_func_register_printf_function'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4062: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_register_printf_function=yes" else @@ -4049,11 +4083,11 @@ if test $register_printf = 1; then working_register_printf=1 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4091: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then working_register_printf=1 else @@ -4079,12 +4113,12 @@ fi for ac_func in realpath do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4083: checking for $ac_func" >&5 +echo "configure:4117: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4145: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -4137,7 +4171,7 @@ done # Used in critical cases by NSProcessInfo.m #-------------------------------------------------------------------- echo $ac_n "checking program_invocation_name in C Library""... $ac_c" 1>&6 -echo "configure:4141: checking program_invocation_name in C Library" >&5 +echo "configure:4175: checking program_invocation_name in C Library" >&5 if eval "test \"`echo '$''{'program_invocation_name_worked'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4145,7 +4179,7 @@ else program_invocation_name_worked=no else cat > conftest.$ac_ext < @@ -4157,7 +4191,7 @@ main (int argc, char *argv[]) } EOF -if { (eval echo configure:4161: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4195: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then program_invocation_name_worked=yes else @@ -4186,7 +4220,7 @@ fi # Needed by NSProcessInfo.m #-------------------------------------------------------------------- echo $ac_n "checking kernel support for /proc filesystem""... $ac_c" 1>&6 -echo "configure:4190: checking kernel support for /proc filesystem" >&5 +echo "configure:4224: checking kernel support for /proc filesystem" >&5 if (grep proc /etc/fstab >/dev/null 2>/dev/null); then sys_proc_fs=yes; cat >> confdefs.h <<\EOF @@ -4209,7 +4243,7 @@ fi sys_proc_fs_exe=no; if test $sys_proc_fs = yes; then echo $ac_n "checking link to executable in /proc""... $ac_c" 1>&6 -echo "configure:4213: checking link to executable in /proc" >&5 +echo "configure:4247: checking link to executable in /proc" >&5 if test -L /proc/self/exe; then sys_proc_fs_exe=yes; echo "$ac_t""yes" 1>&6 @@ -4222,16 +4256,16 @@ fi # Check if short and int values need to be word aligned #-------------------------------------------------------------------- echo $ac_n "checking short/int needs to be word aligned""... $ac_c" 1>&6 -echo "configure:4226: checking short/int needs to be word aligned" >&5 +echo "configure:4260: checking short/int needs to be word aligned" >&5 if test "$cross_compiling" = yes; then NEED_WORD_ALIGNMENT=1 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4269: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then NEED_WORD_ALIGNMENT=0 else @@ -4259,7 +4293,7 @@ fi # doesn't work. Allow NSProcessInfo initialization method also. #-------------------------------------------------------------------- echo $ac_n "checking "use of pass-through arguments"""... $ac_c" 1>&6 -echo "configure:4263: checking "use of pass-through arguments"" >&5 +echo "configure:4297: checking "use of pass-through arguments"" >&5 # Check whether --enable-pass-arguments or --disable-pass-arguments was given. if test "${enable_pass_arguments+set}" = set; then enableval="$enable_pass_arguments" @@ -4281,7 +4315,7 @@ fi echo "$ac_t""$enable_pass_arguments" 1>&6 echo $ac_n "checking "use of fake-main definition"""... $ac_c" 1>&6 -echo "configure:4285: checking "use of fake-main definition"" >&5 +echo "configure:4319: checking "use of fake-main definition"" >&5 # Check whether --enable-fake-main or --disable-fake-main was given. if test "${enable_fake_main+set}" = set; then enableval="$enable_fake_main" @@ -4328,21 +4362,49 @@ echo "$ac_t""$enable_fake_main" 1>&6 # Check recent libxlm for Properytlists, GSXML, GSDoc etc. #-------------------------------------------------------------------- echo "Checking for libxml" +# Check whether --with-libxml-include or --without-libxml-include was given. +if test "${with_libxml_include+set}" = set; then + withval="$with_libxml_include" + libxml_incdir="$withval" +else + libxml_incdir="no" +fi + + +# Check whether --with-libxml-library or --without-libxml-library was given. +if test "${with_libxml_library+set}" = set; then + withval="$with_libxml_library" + libxml_libdir="$withval" +else + libxml_libdir="no" +fi + + +cppflags_temp=$CFLAGS +libs_temp=$LIBS + +if test "$libxml_incdir" != "no"; then + CPPFLAGS="$CPPFLAGS -I$libxml_incdir" +fi +if test "$libxml_libdir" != "no"; then + LIBS="$LIBS -L$libxml_libdir" +fi + for ac_hdr in libxml/xmlversion.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4336: checking for $ac_hdr" >&5 +echo "configure:4398: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4346: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4408: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4375,7 +4437,7 @@ if test $ac_cv_header_libxml_xmlversion_h = no; then HAVE_LIBXML=0 else cat > conftest.$ac_ext <&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4449: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4406,6 +4468,11 @@ rm -f conftest* fi +if test "$HAVE_LIBXML" = "0"; then + CPPFLAGS="$cppflags_temp"; + LIBS="$libs_temp"; +fi + diff --git a/configure.in b/configure.in index ffde2d40a..aa3181430 100644 --- a/configure.in +++ b/configure.in @@ -48,6 +48,14 @@ AC_PATH_PROG(WHOAMI, whoami, echo, $PATH:/usr/ucb) PIPE='-pipe' AC_SUBST(PIPE) +#-------------------------------------------------------------------- +# specific target_os options +#-------------------------------------------------------------------- +case "$target_os" in + freebsd*) CPPFLAGS="$CPPFLAGS -I/usr/local/include" + LIBS="$LIBS -L/usr/local/lib";; +esac + #-------------------------------------------------------------------- # Find out if we\'re using NeXT\'s compiler. # if yes: @@ -781,6 +789,24 @@ AC_MSG_RESULT($enable_fake_main) # Check recent libxlm for Properytlists, GSXML, GSDoc etc. #-------------------------------------------------------------------- echo "Checking for libxml" +AC_ARG_WITH(libxml-include, + [ --with-libxml-include=PATH include path for libxml headers], + libxml_incdir="$withval", libxml_incdir="no") + +AC_ARG_WITH(libxml-library, + [ --with-libxml-library=PATH library path for libxml libraries], + libxml_libdir="$withval", libxml_libdir="no") + +cppflags_temp=$CFLAGS +libs_temp=$LIBS + +if test "$libxml_incdir" != "no"; then + CPPFLAGS="$CPPFLAGS -I$libxml_incdir" +fi +if test "$libxml_libdir" != "no"; then + LIBS="$LIBS -L$libxml_libdir" +fi + AC_CHECK_HEADERS(libxml/xmlversion.h) if test $ac_cv_header_libxml_xmlversion_h = no; then echo "Could not find libxml headers" @@ -802,6 +828,11 @@ else fi AC_SUBST(HAVE_LIBXML) +if test "$HAVE_LIBXML" = "0"; then + CPPFLAGS="$cppflags_temp"; + LIBS="$libs_temp"; +fi + AC_SUBST(whole_archive) AC_SUBST(no_whole_archive)