diff --git a/ChangeLog b/ChangeLog index bee5b0351..826182b56 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,24 @@ +2009-10-05 Richard Frith-Macdonald + + * configure.ac: enable ffcall if ffi is disabled + * configure: Regenerate + * Source/mframe:delete + * Source/mframe.m: delete + * Source/GSInvocation.h: + * Source/GNUmakefile: + * Source/NSMethodSignature.m: + * Source/GSFFCallInvocation.m: + * Source/NSKeyValueObserving.m: + * Source/GSFFIInvocation.m: + * Source/NSInvocation.m: + * Source/cifframe.m: + * Source/NSConnection.m: + * Source/callframe.m: + * Source/NSDistantObject.m: + * Headers/Foundation/NSMethodSignature.h: + * Headers/Foundation/NSInvocation.h: + Update for removal of mframe code. + 2009-10-04 Richard Frith-Macdonald * Source/GNUmakefile: diff --git a/Headers/Foundation/NSInvocation.h b/Headers/Foundation/NSInvocation.h index d1bb61ceb..1e10e8332 100644 --- a/Headers/Foundation/NSInvocation.h +++ b/Headers/Foundation/NSInvocation.h @@ -41,11 +41,7 @@ extern "C" { id _target; SEL _selector; unsigned int _numArgs; -#if OS_API_VERSION(GS_API_OPENSTEP, GS_API_MACOSX) - NSArgumentInfo *_info; -#else - void *_dummy; -#endif + void *_info; BOOL _argsRetained; BOOL _targetRetained; BOOL _validReturn; diff --git a/Headers/Foundation/NSMethodSignature.h b/Headers/Foundation/NSMethodSignature.h index acf9ac3f3..4d6bcaf14 100644 --- a/Headers/Foundation/NSMethodSignature.h +++ b/Headers/Foundation/NSMethodSignature.h @@ -34,44 +34,6 @@ extern "C" { #endif -#if OS_API_VERSION(GS_API_NONE, GS_API_MACOSX) -/** - *

Info about layout of arguments. - * Extended from the original OpenStep version to let us know if the - * arg is passed in registers or on the stack.

- * - *

NB. This no longer exists in Rhapsody/MacOS.

- -typedef struct { - int offset; - unsigned size; - const char *type; - unsigned align; // extension, available only in GNUSTEP - unsigned qual; // extension, available only in GNUSTEP - BOOL isReg; // extension, available only in GNUSTEP -} NSArgumentInfo; - - *

NB. The offset and register information may not always be reliable. - * In the past it was dependent on locally maintained platform dependent - * information. In the future it may depend on layout information - * supplied by the compiler.

- */ -typedef struct { - int offset; - unsigned size; - const char *type; -#if OS_API_VERSION(GS_API_NONE, GS_API_NONE) - unsigned align; - unsigned qual; - BOOL isReg; -#else - unsigned _reserved1; - unsigned _reserved2; - BOOL _reserved3; -#endif -} NSArgumentInfo; -#endif - /** *

Class encapsulating type information for method arguments and return * value. It is used as a component of [NSInvocation] to implement message @@ -80,7 +42,7 @@ typedef struct { * [NSObject-methodSignatureForSelector:].

* *

Basically, types are represented as Objective-C @encode(...) - * compatible strings, together with size information. The arguments are + * compatible strings. The arguments are * numbered starting from 0, including the implicit arguments * self (type id, at position 0) and * _cmd (type SEL, at position 1).

@@ -90,11 +52,7 @@ typedef struct { const char *_methodTypes; NSUInteger _argFrameLength; NSUInteger _numArgs; -#if OS_API_VERSION(GS_API_NONE, GS_API_MACOSX) - NSArgumentInfo *_info; -#else void *_info; -#endif } /** @@ -103,14 +61,6 @@ typedef struct { */ + (NSMethodSignature*) signatureWithObjCTypes: (const char*)t; -#if OS_API_VERSION(GS_API_OPENSTEP, GS_API_MACOSX) -/** - * Returns full information on given argument. Indices start at 0. Provide - * -1 to get info on return value. - */ -- (NSArgumentInfo) argumentInfoAtIndex: (NSUInteger)index; -#endif - /** * Number of bytes that the full set of arguments occupies on the stack, which * is platform(hardware)-dependent. @@ -121,7 +71,8 @@ typedef struct { * Returns Objective-C @encode(...) compatible string. Arguments * are numbered starting from 0, including the implicit arguments * self (type id, at position 0) and - * _cmd (type SEL, at position 1). + * _cmd (type SEL, at position 1).
+ * Type strings may include leading type qualifiers. */ - (const char*) getArgumentTypeAtIndex: (NSUInteger)index; @@ -138,10 +89,9 @@ typedef struct { - (NSUInteger) methodReturnLength; /** - * Returns Objective-C @encode(...) compatible string. Arguments - * are numbered starting from 0, including the implicit arguments - * self (type id, at position 0) and - * _cmd (type SEL, at position 1). + * Returns an Objective-C @encode(...) compatible string + * describing the return type of the method. This may include type + * qualifiers. */ - (const char*) methodReturnType; @@ -153,26 +103,6 @@ typedef struct { @end -#if GS_API_VERSION(GS_API_NONE, 011700) -/** - * Declares a convenience method for getting the entire array of raw type and - * size information. - */ -@interface NSMethodSignature(GNUstep) -/** - * Convenience method for getting the entire array of raw type and size - * information. - */ -- (NSArgumentInfo*) methodInfo; - -/** - * Returns a string containing all Objective-C - * @encode(...) compatible type information. - */ -- (const char*) methodType; -@end -#endif - #if defined(__cplusplus) } #endif diff --git a/Source/GNUmakefile b/Source/GNUmakefile index cac9b0f42..83e143e73 100644 --- a/Source/GNUmakefile +++ b/Source/GNUmakefile @@ -96,8 +96,7 @@ endif GNU_MFILES = \ GSLocale.m \ -preface.m \ -mframe.m +preface.m ifeq ($(findstring openbsd, $(GNUSTEP_TARGET_OS)), openbsd) OBJC_LIBS += -lpthread @@ -427,7 +426,6 @@ HEADERS_INSTALL = $(GNU_HEADERS) \ GENERATED_HFILES = \ dynamic-load.h \ $(HEADER_DIR_BASE)/preface.h \ -$(GNUSTEP_TARGET_DIR)/mframe.h \ $(GNUSTEP_TARGET_DIR)/config.h \ $(GNUSTEP_TARGET_DIR)/GNUstepBase/GSConfig.h diff --git a/Source/GSFFCallInvocation.m b/Source/GSFFCallInvocation.m index a9b0050b6..13c53db0f 100644 --- a/Source/GSFFCallInvocation.m +++ b/Source/GSFFCallInvocation.m @@ -32,6 +32,8 @@ #import #import "callframe.h" +#import "GSInvocation.h" + #ifndef INLINE #define INLINE inline #endif @@ -545,7 +547,7 @@ static IMP gs_objc_msg_forward (SEL sel) } _sig = RETAIN(aSignature); _numArgs = [aSignature numberOfArguments]; - _info = [aSignature methodInfo]; + _info = (void*)[aSignature methodInfo]; _cframe = callframe_from_signature(_sig, &_retval); return self; } @@ -560,6 +562,7 @@ GSFFCallInvokeWithTargetAndImp(NSInvocation *_inv, id anObject, IMP imp) unsigned int i; av_alist alist; NSInvocation_t *inv = (NSInvocation_t*)_inv; + NSArgumentInfo *info = (NSArgumentInfo*)inv->_info; void *retval = inv->_retval; /* Do an av call starting with the return type */ @@ -569,7 +572,7 @@ GSFFCallInvokeWithTargetAndImp(NSInvocation *_inv, id anObject, IMP imp) _F(alist, imp, retval); \ break; - switch (*inv->_info[0].type) + switch (*info[0].type) { case _C_ID: av_start_ptr(alist, imp, id, retval); @@ -604,12 +607,13 @@ GSFFCallInvokeWithTargetAndImp(NSInvocation *_inv, id anObject, IMP imp) { int split = 0; - if (inv->_info[0].size > sizeof(long) - && inv->_info[0].size <= 2*sizeof(long)) + if (info[0].size > sizeof(long) + && info[0].size <= 2*sizeof(long)) { - split = gs_splittable(inv->_info[0].type); + split = gs_splittable(info[0].type); } - _av_start_struct(alist, imp, inv->_info[0].size, split, retval); + _av_start_struct(alist, imp, + info[0].size, split, retval); break; } case _C_VOID: @@ -617,7 +621,7 @@ GSFFCallInvokeWithTargetAndImp(NSInvocation *_inv, id anObject, IMP imp) break; default: NSCAssert1(0, @"GSFFCallInvocation: Return Type '%s' not implemented", - inv->_info[0].type); + info[0].type); break; } @@ -628,8 +632,8 @@ GSFFCallInvokeWithTargetAndImp(NSInvocation *_inv, id anObject, IMP imp) /* Set the rest of the arguments */ for (i = 2; i < inv->_numArgs; i++) { - const char *type = inv->_info[i+1].type; - unsigned size = inv->_info[i+1].size; + const char *type = info[i+1].type; + unsigned size = info[i+1].size; void *datum; datum = callframe_arg_addr((callframe_t *)inv->_cframe, i); @@ -696,7 +700,8 @@ GSFFCallInvokeWithTargetAndImp(NSInvocation *_inv, id anObject, IMP imp) CASE_TYPE(_C_DBL, double, av_double) case _C_STRUCT_B: - _av_struct(alist, size, inv->_info[i+1].align, datum); + _av_struct(alist, size, + info[i+1].align, datum); break; default: NSCAssert1(0, @"GSFFCallInvocation: Type '%s' not implemented", @@ -722,8 +727,8 @@ GSFFCallInvokeWithTargetAndImp(NSInvocation *_inv, id anObject, IMP imp) */ if (anObject == nil) { - memset(_retval, '\0', _info[0].size); /* Clear return value */ - if (*_info[0].type != _C_VOID) + memset(_retval, '\0', _inf[0].size); /* Clear return value */ + if (*_inf[0].type != _C_VOID) { _validReturn = YES; } @@ -740,8 +745,8 @@ GSFFCallInvokeWithTargetAndImp(NSInvocation *_inv, id anObject, IMP imp) old_target = RETAIN(_target); [self setTarget: anObject]; - callframe_set_arg((callframe_t *)_cframe, 0, &_target, _info[1].size); - callframe_set_arg((callframe_t *)_cframe, 1, &_selector, _info[2].size); + callframe_set_arg((callframe_t *)_cframe, 0, &_target, _inf[1].size); + callframe_set_arg((callframe_t *)_cframe, 1, &_selector, _inf[2].size); if (_sendToSuper == YES) { @@ -1123,8 +1128,8 @@ GSInvocationCallback (void *callback_data, va_alist args) for (i = 0; i < _numArgs; i++) { - int flags = _info[i+1].qual; - const char *type = _info[i+1].type; + int flags = _inf[i+1].qual; + const char *type = _inf[i+1].type; void *datum; if (i == 0) diff --git a/Source/GSFFIInvocation.m b/Source/GSFFIInvocation.m index b8d0227ad..65fd6b6be 100644 --- a/Source/GSFFIInvocation.m +++ b/Source/GSFFIInvocation.m @@ -36,7 +36,6 @@ #endif #import #import "cifframe.h" -#import "mframe.h" #import "GSPrivate.h" #ifndef INLINE @@ -304,6 +303,8 @@ static id gs_objc_proxy_lookup(id receiver, SEL op) */ - (id) initWithMethodSignature: (NSMethodSignature*)aSignature { + int i; + if (aSignature == nil) { RELEASE(self); @@ -317,15 +318,16 @@ static id gs_objc_proxy_lookup(id receiver, SEL op) /* Make sure we have somewhere to store the return value if needed. */ _retval = _retptr = 0; - if (_info[0].size > 0) + i = objc_sizeof_type (objc_skip_type_qualifiers ([_sig methodReturnType])); + if (i > 0) { - if (_info[0].size <= sizeof(_retbuf)) + if (i <= sizeof(_retbuf)) { _retval = _retbuf; } else { - _retptr = NSAllocateCollectable(_info[0].size, NSScannedOption); + _retptr = NSAllocateCollectable(i, NSScannedOption); _retval = _retptr; } } @@ -361,15 +363,16 @@ static id gs_objc_proxy_lookup(id receiver, SEL op) /* Make sure we have somewhere to store the return value if needed. */ _retval = _retptr = 0; - if (_info[0].size > 0) + i = objc_sizeof_type (objc_skip_type_qualifiers ([_sig methodReturnType])); + if (i > 0) { - if (_info[0].size <= sizeof(_retbuf)) + if (i <= sizeof(_retbuf)) { _retval = _retbuf; } else { - _retptr = NSAllocateCollectable(_info[0].size, NSScannedOption); + _retptr = NSAllocateCollectable(i, NSScannedOption); _retval = _retptr; } } @@ -395,18 +398,22 @@ GSFFIInvokeWithTargetAndImp(NSInvocation *_inv, id anObject, IMP imp) - (void) invokeWithTarget: (id)anObject { id old_target; + const char *type; IMP imp; CLEAR_RETURN_VALUE_IF_OBJECT; _validReturn = NO; - + type = objc_skip_type_qualifiers([_sig methodReturnType]); + /* * A message to a nil object returns nil. */ if (anObject == nil) { if (_retval) - memset(_retval, '\0', _info[0].size); /* Clear return value */ + { + memset(_retval, '\0', objc_sizeof_type (type)); + } _validReturn = YES; return; } @@ -420,8 +427,8 @@ GSFFIInvokeWithTargetAndImp(NSInvocation *_inv, id anObject, IMP imp) old_target = RETAIN(_target); [self setTarget: anObject]; - cifframe_set_arg((cifframe_t *)_cframe, 0, &_target, _info[1].size); - cifframe_set_arg((cifframe_t *)_cframe, 1, &_selector, _info[2].size); + cifframe_set_arg((cifframe_t *)_cframe, 0, &_target, sizeof(id)); + cifframe_set_arg((cifframe_t *)_cframe, 1, &_selector, sizeof(SEL)); if (_sendToSuper == YES) { @@ -459,8 +466,10 @@ GSFFIInvokeWithTargetAndImp(NSInvocation *_inv, id anObject, IMP imp) GSFFIInvokeWithTargetAndImp(self, anObject, imp); /* Decode the return value */ - if (*_info[0].type != _C_VOID) - cifframe_decode_arg(_info[0].type, _retval); + if (*type != _C_VOID) + { + cifframe_decode_arg(type, _retval); + } RETAIN_RETURN_VALUE; _validReturn = YES; @@ -649,8 +658,8 @@ GSFFIInvocationCallback(ffi_cif *cif, void *retp, void **args, void *user) for (i = 0; i < _numArgs; i++) { - int flags = _info[i+1].qual; - const char *type = _info[i+1].type; + int flags = _inf[i+1].qual; + const char *type = _inf[i+1].type; void *datum; if (i == 0) diff --git a/Source/GSInvocation.h b/Source/GSInvocation.h index 6419f4b12..e2d1059a6 100644 --- a/Source/GSInvocation.h +++ b/Source/GSInvocation.h @@ -27,6 +27,16 @@ #include +typedef struct { + int offset; + unsigned size; + const char *type; + const char *qtype; + unsigned align; + unsigned qual; + BOOL isReg; +} NSArgumentInfo; + @interface GSFFIInvocation : NSInvocation { uint8_t _retbuf[32]; // Store return values of up to 32 bytes here. @@ -47,13 +57,18 @@ - (BOOL) encodeWithDistantCoder: (NSCoder*)coder passPointers: (BOOL)passp; @end +@interface NSMethodSignature (GNUstep) +- (const char*) methodType; +- (NSArgumentInfo*) methodInfo; +@end + extern void GSFFCallInvokeWithTargetAndImp(NSInvocation *inv, id anObject, IMP imp); extern void GSFFIInvokeWithTargetAndImp(NSInvocation *inv, id anObject, IMP imp); -#define CLEAR_RETURN_VALUE_IF_OBJECT do { if (_validReturn && *_info[0].type == _C_ID) \ +#define CLEAR_RETURN_VALUE_IF_OBJECT do { if (_validReturn && *_inf[0].type == _C_ID) \ { \ RELEASE (*(id*) _retval); \ *(id*) _retval = nil; \ @@ -61,6 +76,8 @@ GSFFIInvokeWithTargetAndImp(NSInvocation *inv, id anObject, IMP imp); }\ } while (0) -#define RETAIN_RETURN_VALUE IF_NO_GC(do { if (*_info[0].type == _C_ID) RETAIN (*(id*) _retval);} while (0)) +#define RETAIN_RETURN_VALUE IF_NO_GC(do { if (*_inf[0].type == _C_ID) RETAIN (*(id*) _retval);} while (0)) + +#define _inf ((NSArgumentInfo*)_info) #endif diff --git a/Source/NSConnection.m b/Source/NSConnection.m index 792b6347b..d36e172a2 100644 --- a/Source/NSConnection.m +++ b/Source/NSConnection.m @@ -30,6 +30,7 @@ */ #import "config.h" + #ifdef HAVE_ALLOCA_H #include #endif @@ -66,12 +67,6 @@ static GC_descr nodeDesc; // Type descriptor for map node. #include "Foundation/NSConnection.h" #undef _IN_CONNECTION_M -#if defined(USE_LIBFFI) -#include "cifframe.h" -#elif defined(USE_FFCALL) -#include "callframe.h" -#endif - #include "Foundation/NSPortCoder.h" #include "GNUstepBase/DistributedObjects.h" diff --git a/Source/NSDistantObject.m b/Source/NSDistantObject.m index f07f43b38..770b7cdf9 100644 --- a/Source/NSDistantObject.m +++ b/Source/NSDistantObject.m @@ -38,6 +38,7 @@ #include "Foundation/NSObjCRuntime.h" #include "Foundation/NSInvocation.h" #include +#include "GSInvocation.h" @interface NSDistantObject(GNUstepExtensions) @@ -696,11 +697,6 @@ enum proxyLocation } return sig; } - /* - * Simlarly, when we fetch a method signature from the remote end, - * we get a proxy, and when we build a local signature we need to - * ask the proxy for its types ... and must avoid recursion again. - */ if (sel_eq(aSelector, @selector(methodType))) { static NSMethodSignature *sig = nil; @@ -757,31 +753,18 @@ enum proxyLocation { id m = nil; -#if defined(USE_FFCALL) || defined(USE_LIBFFI) id inv; id sig; DO_FORWARD_INVOCATION(methodSignatureForSelector:, aSelector); -#else - arglist_t args; - void *retframe; - id retframe_id (void *rframe) - { - __builtin_return (rframe); - } - - /* - * No protocol - so try forwarding the message. - */ - args = __builtin_apply_args(); - retframe = [self forward: _cmd : args]; - m = retframe_id(retframe); -#endif if ([m isProxy] == YES) { - const char *types = [m methodType]; + const char *types; + types = [m methodType]; + /* Create a local method signature. + */ m = [NSMethodSignature signatureWithObjCTypes: types]; } return m; @@ -953,27 +936,13 @@ static inline BOOL class_is_kind_of (Class self, Class aClassObject) - (BOOL) respondsToSelector: (SEL)aSelector { -#if defined(USE_FFCALL) || defined(USE_LIBFFI) - BOOL m = NO; - id inv, sig; + BOOL m = NO; + id inv; + id sig; + DO_FORWARD_INVOCATION(respondsToSelector:, aSelector); + return m; -#else - arglist_t args; - void *retframe; - - BOOL retframe_bool (void *rframe) - { - __builtin_return (rframe); - } - - /* - * Try forwarding the message. - */ - args = __builtin_apply_args(); - retframe = [self forward: _cmd : args]; - return retframe_bool(retframe); -#endif } - (id) replacementObjectForCoder: (NSCoder*)aCoder diff --git a/Source/NSInvocation.m b/Source/NSInvocation.m index 68e664e9a..685700299 100644 --- a/Source/NSInvocation.m +++ b/Source/NSInvocation.m @@ -157,6 +157,8 @@ static Class NSInvocation_concrete_class; +#define _inf ((NSArgumentInfo*)_info) + /** *

The NSInvocation class implements a mechanism of constructing * messages (as NSInvocation instances), sending these to other @@ -189,14 +191,14 @@ static inline void _get_arg(NSInvocation *inv, int index, void *buffer) { cifframe_get_arg((cifframe_t *)inv->_cframe, index, buffer, - inv->_info[index+1].size); + ((NSArgumentInfo*)inv->_info)[index+1].size); } static inline void _set_arg(NSInvocation *inv, int index, void *buffer) { cifframe_set_arg((cifframe_t *)inv->_cframe, index, buffer, - inv->_info[index+1].size); + ((NSArgumentInfo*)inv->_info)[index+1].size); } static inline void * @@ -210,14 +212,14 @@ static inline void _get_arg(NSInvocation *inv, int index, void *buffer) { callframe_get_arg((callframe_t *)inv->_cframe, index, buffer, - inv->_info[index+1].size); + ((NSArgumentInfo*)inv->_info)[index+1].size); } static inline void _set_arg(NSInvocation *inv, int index, void *buffer) { callframe_set_arg((callframe_t *)inv->_cframe, index, buffer, - inv->_info[index+1].size); + ((NSArgumentInfo*)inv->_info)[index+1].size); } static inline void * @@ -302,7 +304,7 @@ _arg_addr(NSInvocation *inv, int index) for (i = 3; i <= _numArgs; i++) { - if (*_info[i].type == _C_CHARPTR) + if (*_inf[i].type == _C_CHARPTR) { char *str = 0; @@ -312,7 +314,7 @@ _arg_addr(NSInvocation *inv, int index) NSZoneFree(NSDefaultMallocZone(), str); } } - else if (*_info[i].type == _C_ID) + else if (*_inf[i].type == _C_ID) { id obj = nil; @@ -390,9 +392,9 @@ _arg_addr(NSInvocation *inv, int index) type = [_sig methodReturnType]; - if (*_info[0].type != _C_VOID) + if (*_inf[0].type != _C_VOID) { - memcpy(buffer, _retval, _info[0].size); + memcpy(buffer, _retval, _inf[0].size); } } @@ -433,8 +435,8 @@ _arg_addr(NSInvocation *inv, int index) } else { - int i = index+1; /* Allow for return type in '_info' */ - const char *type = _info[i].type; + int i = index+1; /* Allow for return type in '_inf' */ + const char *type = _inf[i].type; if (_argsRetained && (*type == _C_ID || *type == _C_CHARPTR)) { @@ -488,13 +490,13 @@ _arg_addr(NSInvocation *inv, int index) { const char *type; - type = _info[0].type; + type = _inf[0].type; CLEAR_RETURN_VALUE_IF_OBJECT; if (*type != _C_VOID) { - memcpy(_retval, buffer, _info[0].size); + memcpy(_retval, buffer, _inf[0].size); } RETAIN_RETURN_VALUE; @@ -578,7 +580,7 @@ _arg_addr(NSInvocation *inv, int index) } for (i = 3; i <= _numArgs; i++) { - if (*_info[i].type == _C_ID) + if (*_inf[i].type == _C_ID) { id old; @@ -588,7 +590,7 @@ _arg_addr(NSInvocation *inv, int index) IF_NO_GC(RETAIN(old)); } } - else if (*_info[i].type == _C_CHARPTR) + else if (*_inf[i].type == _C_CHARPTR) { char *str; @@ -665,12 +667,12 @@ _arg_addr(NSInvocation *inv, int index) [aCoder encodeObject: _target]; - [aCoder encodeValueOfObjCType: _info[2].type + [aCoder encodeValueOfObjCType: _inf[2].type at: &_selector]; for (i = 3; i <= _numArgs; i++) { - const char *type = _info[i].type; + const char *type = _inf[i].type; void *datum; datum = _arg_addr(self, i-1); @@ -684,12 +686,12 @@ _arg_addr(NSInvocation *inv, int index) [aCoder encodeValueOfObjCType: type at: datum]; } } - if (*_info[0].type != _C_VOID) + if (*_inf[0].type != _C_VOID) { [aCoder encodeValueOfObjCType: @encode(BOOL) at: &_validReturn]; if (_validReturn) { - [aCoder encodeValueOfObjCType: _info[0].type at: _retval]; + [aCoder encodeValueOfObjCType: _inf[0].type at: _retval]; } } } @@ -715,15 +717,15 @@ _arg_addr(NSInvocation *inv, int index) for (i = 3; i <= _numArgs; i++) { datum = _arg_addr(self, i-1); - [aCoder decodeValueOfObjCType: _info[i].type at: datum]; + [aCoder decodeValueOfObjCType: _inf[i].type at: datum]; } _argsRetained = YES; - if (*_info[0].type != _C_VOID) + if (*_inf[0].type != _C_VOID) { [aCoder decodeValueOfObjCType: @encode(BOOL) at: &_validReturn]; if (_validReturn) { - [aCoder decodeValueOfObjCType: _info[0].type at: _retval]; + [aCoder decodeValueOfObjCType: _inf[0].type at: _retval]; } } return self; diff --git a/Source/NSKeyValueObserving.m b/Source/NSKeyValueObserving.m index e8478b8c7..f8a450504 100644 --- a/Source/NSKeyValueObserving.m +++ b/Source/NSKeyValueObserving.m @@ -44,6 +44,7 @@ #import "GNUstepBase/GSObjCRuntime.h" #import "GNUstepBase/Unicode.h" #import "GNUstepBase/GSLock.h" +#import "GSInvocation.h" /* * IMPLEMENTATION NOTES diff --git a/Source/NSMethodSignature.m b/Source/NSMethodSignature.m index f1ab2f889..5cfa0b9e3 100644 --- a/Source/NSMethodSignature.m +++ b/Source/NSMethodSignature.m @@ -29,28 +29,408 @@ #include "config.h" #include "GNUstepBase/preface.h" -#include #include "Foundation/NSMethodSignature.h" #include "Foundation/NSException.h" #include "Foundation/NSString.h" +#include "Foundation/NSCoder.h" +#include "GSInvocation.h" + +/* The objc runtime library objc_skip_offset() is buggy on some compiler + * versions, so we use our own alternative implementation. + */ +static const char * +skip_offset(const char *ptr) +{ + if (*ptr == '+' || *ptr == '-') ptr++; + while (isdigit(*ptr)) ptr++; + return ptr; +} + +#define ROUND(V, A) \ + ({ typeof(V) __v=(V); typeof(A) __a=(A); \ + __a*((__v+__a-1)/__a); }) + +/* Step through method encoding information extracting details. + * If outTypes is non-nul then we copy the qualified type into + * the buffer as a nul terminated string and use the values in + * this buffer for the qtype and type in info, rather than pointers + * to positions in typePtr + */ +static const char * +next_arg(const char *typePtr, NSArgumentInfo *info, char *outTypes) +{ + NSArgumentInfo local; + BOOL flag; + BOOL negative = NO; + + if (info == 0) + { + info = &local; + } + + info->qtype = typePtr; + + /* + * Skip past any type qualifiers - if the caller wants them, return them. + */ + flag = YES; + info->qual = 0; + while (flag) + { + switch (*typePtr) + { + case _C_CONST: info->qual |= _F_CONST; break; + case _C_IN: info->qual |= _F_IN; break; + case _C_INOUT: info->qual |= _F_INOUT; break; + case _C_OUT: info->qual |= _F_OUT; break; + case _C_BYCOPY: info->qual |= _F_BYCOPY; break; +#ifdef _C_BYREF + case _C_BYREF: info->qual |= _F_BYREF; break; +#endif + case _C_ONEWAY: info->qual |= _F_ONEWAY; break; +#ifdef _C_GCINVISIBLE + case _C_GCINVISIBLE: info->qual |= _F_GCINVISIBLE; break; +#endif + default: flag = NO; + } + if (flag) + { + typePtr++; + } + } + + info->type = typePtr; + + /* + * Scan for size and alignment information. + */ + switch (*typePtr++) + { + case _C_ID: + info->size = sizeof(id); + info->align = __alignof__(id); + break; + + case _C_CLASS: + info->size = sizeof(Class); + info->align = __alignof__(Class); + break; + + case _C_SEL: + info->size = sizeof(SEL); + info->align = __alignof__(SEL); + break; + + case _C_CHR: + info->size = sizeof(char); + info->align = __alignof__(char); + break; + + case _C_UCHR: + info->size = sizeof(unsigned char); + info->align = __alignof__(unsigned char); + break; + + case _C_SHT: + info->size = sizeof(short); + info->align = __alignof__(short); + break; + + case _C_USHT: + info->size = sizeof(unsigned short); + info->align = __alignof__(unsigned short); + break; + + case _C_INT: + info->size = sizeof(int); + info->align = __alignof__(int); + break; + + case _C_UINT: + info->size = sizeof(unsigned int); + info->align = __alignof__(unsigned int); + break; + + case _C_LNG: + info->size = sizeof(long); + info->align = __alignof__(long); + break; + + case _C_ULNG: + info->size = sizeof(unsigned long); + info->align = __alignof__(unsigned long); + break; + + case _C_LNG_LNG: + info->size = sizeof(long long); + info->align = __alignof__(long long); + break; + + case _C_ULNG_LNG: + info->size = sizeof(unsigned long long); + info->align = __alignof__(unsigned long long); + break; + + case _C_FLT: + info->size = sizeof(float); + info->align = __alignof__(float); + break; + + case _C_DBL: + info->size = sizeof(double); + info->align = __alignof__(double); + break; + + case _C_PTR: + info->size = sizeof(char*); + info->align = __alignof__(char*); + if (*typePtr == '?') + { + typePtr++; + } + else + { + typePtr = objc_skip_typespec(typePtr); + } + break; + + case _C_ATOM: + case _C_CHARPTR: + info->size = sizeof(char*); + info->align = __alignof__(char*); + break; + + case _C_ARY_B: + { + int length = atoi(typePtr); + + while (isdigit(*typePtr)) + { + typePtr++; + } + typePtr = next_arg(typePtr, &local, 0); + info->size = length * ROUND(local.size, local.align); + info->align = local.align; + typePtr++; /* Skip end-of-array */ + } + break; + + case _C_STRUCT_B: + { + unsigned int acc_size = 0; + unsigned int def_align = objc_alignof_type(typePtr-1); + unsigned int acc_align = def_align; + const char *ptr = typePtr; + + /* + * Skip "=" stuff. + */ + while (*ptr != _C_STRUCT_E && *ptr != '=') ptr++; + if (*ptr == '=') typePtr = ptr; + typePtr++; + + /* + * Base structure alignment on first element. + */ + if (*typePtr != _C_STRUCT_E) + { + typePtr = next_arg(typePtr, &local, 0); + if (typePtr == 0) + { + return 0; /* error */ + } + acc_size = ROUND(acc_size, local.align); + acc_size += local.size; + acc_align = MAX(local.align, def_align); + } + /* + * Continue accumulating structure size + * and adjust alignment if necessary + */ + while (*typePtr != _C_STRUCT_E) + { + typePtr = next_arg(typePtr, &local, 0); + if (typePtr == 0) + { + return 0; /* error */ + } + acc_size = ROUND(acc_size, local.align); + acc_size += local.size; + acc_align = MAX(local.align, acc_align); + } + /* + * Size must be a multiple of alignment + */ + if (acc_size % acc_align != 0) + { + acc_size += acc_align - acc_size % acc_align; + } + info->size = acc_size; + info->align = acc_align; + typePtr++; /* Skip end-of-struct */ + } + break; + + case _C_UNION_B: + { + unsigned int max_size = 0; + unsigned int max_align = 0; + + /* + * Skip "=" stuff. + */ + while (*typePtr != _C_UNION_E) + { + if (*typePtr++ == '=') + { + break; + } + } + while (*typePtr != _C_UNION_E) + { + typePtr = next_arg(typePtr, &local, 0); + if (typePtr == 0) + { + return 0; /* error */ + } + max_size = MAX(max_size, local.size); + max_align = MAX(max_align, local.align); + } + info->size = max_size; + info->align = max_align; + typePtr++; /* Skip end-of-union */ + } + break; + + case _C_VOID: + info->size = 0; + info->align = __alignof__(char*); + break; + + default: + return 0; + } + + if (typePtr == 0) + { /* Error condition. */ + return 0; + } + + /* Copy the type information into the buffer if provided. + */ + if (outTypes != 0) + { + unsigned len = typePtr - info->qtype; + + strncpy(outTypes, info->qtype, len); + outTypes[len] = '\0'; + info->qtype = outTypes; + info->type = objc_skip_type_qualifiers (outTypes); + } + + /* + * May tell the caller if the item is stored in a register. + */ + if (*typePtr == '+') + { + typePtr++; + info->isReg = YES; + } + else + { + info->isReg = NO; + } + /* + * Cope with negative offsets. + */ + if (*typePtr == '-') + { + typePtr++; + negative = YES; + } + /* + * May tell the caller what the stack/register offset is for + * this argument. + */ + info->offset = 0; + while (isdigit(*typePtr)) + { + info->offset = info->offset * 10 + (*typePtr++ - '0'); + } + if (negative == YES) + { + info->offset = -info->offset; + } + + return typePtr; +} @implementation NSMethodSignature -+ (NSMethodSignature*) signatureWithObjCTypes: (const char*)t +- (id) _initWithObjCTypes: (const char*)t { - NSMethodSignature *newMs; - + const char *p = t; + if (t == 0 || *t == '\0') { - return nil; + [self release]; + self = nil; } - newMs = AUTORELEASE([NSMethodSignature alloc]); - newMs->_methodTypes = mframe_build_signature(t, (int*)&newMs->_argFrameLength, - (int*)&newMs->_numArgs, 0); + else + { + const char *q; + char *args; + char *ret; - return newMs; +/* In case we have been given a method encoding string without offsets, + * we attempt to generate the frame size and offsets in a new copy of + * the types string. + */ + ret = alloca((strlen(t)+1)*16); + + /* Copy the return type (including qualifiers) with ehough room + * after it to store the frame size. + */ + p = t; + p = objc_skip_typespec (p); + strncpy(ret, t, p - t); + ret[p - t] = '\0'; + args = ret + (p - t) + 10; + *args = '\0'; + + /* Skip to the first arg type, taking note of where the qualifiers start. + */ + p = skip_offset (p); + q = p; + p = objc_skip_type_qualifiers (p); + while (p && *p) + { + int size; + + _numArgs++; + size = objc_promoted_size (p); + p = objc_skip_typespec (p); + strncat(args, q, p - q); + sprintf(args + strlen(args), "%d", _argFrameLength); + _argFrameLength += size; + p = skip_offset (p); + q = p; + p = objc_skip_type_qualifiers (p); + } + sprintf(ret + strlen(ret), "%d", _argFrameLength); + _methodTypes = NSZoneMalloc(NSDefaultMallocZone(), + strlen(args) + strlen(ret) + 1); + strcpy((char*)_methodTypes, ret); + strcat((char*)_methodTypes, args); + } + return self; +} + ++ (NSMethodSignature*) signatureWithObjCTypes: (const char*)t +{ + return AUTORELEASE([[[self class] alloc] _initWithObjCTypes: t]); } - (NSArgumentInfo) argumentInfoAtIndex: (NSUInteger)index @@ -60,11 +440,11 @@ [NSException raise: NSInvalidArgumentException format: @"Index too high."]; } - if (_info == 0) + if (_inf == 0) { [self methodInfo]; } - return _info[index+1]; + return _inf[index+1]; } - (NSUInteger) frameLength @@ -79,38 +459,38 @@ [NSException raise: NSInvalidArgumentException format: @"Index too high."]; } - if (_info == 0) + if (_inf == 0) { [self methodInfo]; } - return _info[index+1].type; + return _inf[index+1].qtype; } - (BOOL) isOneway { - if (_info == 0) + if (_inf == 0) { [self methodInfo]; } - return (_info[0].qual & _F_ONEWAY) ? YES : NO; + return (_inf[0].qual & _F_ONEWAY) ? YES : NO; } - (NSUInteger) methodReturnLength { - if (_info == 0) + if (_inf == 0) { [self methodInfo]; } - return _info[0].size; + return _inf[0].size; } - (const char*) methodReturnType { - if (_info == 0) + if (_inf == 0) { [self methodInfo]; } - return _info[0].type; + return _inf[0].qtype; } - (NSUInteger) numberOfArguments @@ -122,8 +502,8 @@ { if (_methodTypes) NSZoneFree(NSDefaultMallocZone(), (void*)_methodTypes); - if (_info) - NSZoneFree(NSDefaultMallocZone(), (void*)_info); + if (_inf) + NSZoneFree(NSDefaultMallocZone(), (void*)_inf); [super dealloc]; } @@ -167,7 +547,7 @@ @implementation NSMethodSignature(GNUstep) - (NSArgumentInfo*) methodInfo { - if (_info == 0) + if (_inf == 0) { const char *types = _methodTypes; char *outTypes; @@ -180,17 +560,17 @@ */ outTypes = NSZoneMalloc(NSDefaultMallocZone(), sizeof(NSArgumentInfo)*(_numArgs+1) + strlen(types)*2); - _info = (NSArgumentInfo*)outTypes; + _info = (void*)outTypes; outTypes = outTypes + sizeof(NSArgumentInfo)*(_numArgs+1); /* Fill in the full argment information for each arg. */ for (i = 0; i <= _numArgs; i++) { - types = mframe_next_arg(types, &_info[i], outTypes); + types = next_arg(types, &_inf[i], outTypes); outTypes += strlen(outTypes) + 1; } } - return _info; + return _inf; } - (const char*) methodType diff --git a/Source/callframe.m b/Source/callframe.m index 785e43700..546b93c09 100644 --- a/Source/callframe.m +++ b/Source/callframe.m @@ -68,6 +68,7 @@ callframe_from_signature (NSMethodSignature *info, void **retval) { const char *type = [info getArgumentTypeAtIndex: i]; + type = objc_skip_type_qualifiers (type); size += objc_sizeof_type (type); if (size % align != 0) { @@ -83,11 +84,13 @@ callframe_from_signature (NSMethodSignature *info, void **retval) */ if (retval) { - const char *type = [info methodReturnType]; + const char *type; unsigned full = size; unsigned pos; unsigned ret; + type = [info methodReturnType]; + type = objc_skip_type_qualifiers (type); if (full % align != 0) { full += (align - full % align); @@ -133,9 +136,12 @@ callframe_from_signature (NSMethodSignature *info, void **retval) } for (i = 0; i < cframe->nargs; i++) { + const char *type = [info getArgumentTypeAtIndex: i]; + cframe->args[i] = buf + offset; - offset += objc_sizeof_type ([info getArgumentTypeAtIndex: i]); + type = objc_skip_type_qualifiers (type); + offset += objc_sizeof_type (type); if (offset % align != 0) { diff --git a/Source/cifframe.m b/Source/cifframe.m index 09cf81288..25f014642 100644 --- a/Source/cifframe.m +++ b/Source/cifframe.m @@ -138,10 +138,12 @@ cifframe_from_signature (NSMethodSignature *info) have custom ffi_types with are allocated separately. We should allocate them in our cifframe so we don't leak memory. Or maybe we could cache structure types? */ - rtype = cifframe_type([info methodReturnType], NULL); + rtype = cifframe_type( + objc_skip_type_qualifiers ([info methodReturnType]), NULL); for (i = 0; i < numargs; i++) { - arg_types[i] = cifframe_type([info getArgumentTypeAtIndex: i], NULL); + arg_types[i] = cifframe_type( + objc_skip_type_qualifiers([info getArgumentTypeAtIndex: i]), NULL); } if (numargs > 0) @@ -478,6 +480,7 @@ cifframe_type(const char *typePtr, const char **advance) BOOL cifframe_decode_arg (const char *type, void* buffer) { + type = objc_skip_type_qualifiers (type); switch (*type) { case _C_CHR: @@ -507,6 +510,7 @@ cifframe_decode_arg (const char *type, void* buffer) BOOL cifframe_encode_arg (const char *type, void* buffer) { + type = objc_skip_type_qualifiers (type); switch (*type) { case _C_CHR: diff --git a/Source/mframe.m b/Source/mframe.m deleted file mode 100644 index 27c9a7409..000000000 --- a/Source/mframe.m +++ /dev/null @@ -1,559 +0,0 @@ -/** Implementation of functions for dissecting/making method calls - Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc. - - Written by: Andrew Kachites McCallum - Created: Oct 1994 - - This file is part of the GNUstep Base Library. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free - Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02111 USA. - */ - -/* These functions can be used for dissecting and making method calls - for many different situations. They are used for distributed - objects; they could also be used to make interfaces between - Objective C and Scheme, Perl, Tcl, or other languages. - -*/ - -/* Remove `inline' nested functions if they crash your compiler */ -//#define inline - -#include "config.h" -#include "GNUstepBase/preface.h" -#ifdef HAVE_ALLOCA_H -#include -#endif -#include -#include -#include -#include - -/* Deal with strrchr: */ -#if STDC_HEADERS || defined(HAVE_STRING_H) -#include -/* An ANSI string.h and pre-ANSI memory.h might conflict. */ -#if !STDC_HEADERS && defined(HAVE_MEMORY_H) -#include -#endif /* not STDC_HEADERS and HAVE_MEMORY_H */ -#define index strchr -#define rindex strrchr -#define bcopy(s, d, n) memcpy ((d), (s), (n)) -#define bcmp(s1, s2, n) memcmp ((s1), (s2), (n)) -#define bzero(s, n) memset ((s), 0, (n)) -#else /* not STDC_HEADERS and not HAVE_STRING_H */ -#include -/* memory.h and strings.h conflict on some systems. */ -#endif /* not STDC_HEADERS and not HAVE_STRING_H */ - -#include "Foundation/NSObjCRuntime.h" -#include "Foundation/NSData.h" -#include "Foundation/NSException.h" -#include "Foundation/NSDebug.h" - - - -/* For encoding and decoding the method arguments, we have to know where - to find things in the "argframe" as returned by __builtin_apply_args. - - For some situations this is obvious just from the selector type - encoding, but structures passed by value cause a problem because some - architectures actually pass these by reference, i.e. use the - structure-value-address mentioned in the gcc/config/_/_.h files. - - These differences are not encoded in the selector types. - - Below is my current guess for which architectures do this. - xxx I really should do this properly by looking at the gcc config values. - - I've also been told that some architectures may pass structures with - sizef(structure) > sizeof(void*) by reference, but pass smaller ones by - value. The code doesn't currently handle that case. - */ - - -char* -mframe_build_signature(const char *typePtr, int *size, int *narg, char *buf) -{ - MFRAME_ARGS cum; - BOOL doMalloc = NO; - const char *types; - char *start; - char *dest; - int total = 0; - int count = 0; - - /* - * If we have not been given a buffer - allocate space on the stack for - * the largest concievable type encoding. - */ - if (buf == 0) - { - doMalloc = YES; - buf = alloca((strlen(typePtr)+1)*16); - } - - /* - * Copy the return type info (including qualifiers) into the buffer. - */ - types = objc_skip_typespec(typePtr); - strncpy(buf, typePtr, types - typePtr); - buf[types-typePtr] = '\0'; - - /* - * Point to the return type, initialise size of stack args, and skip - * to the first argument. - */ - types = objc_skip_type_qualifiers(typePtr); - MFRAME_INIT_ARGS(cum, types); - types = objc_skip_typespec(types); - if (*types == '+') - { - types++; - } - if (*types == '-') - { - types++; - } - while (isdigit(*types)) - { - types++; - } - - /* - * Where to start putting encoding information - leave enough room for - * the size of the stack args to be stored after the return type. - */ - start = &buf[strlen(buf)+10]; - dest = start; - - /* - * Now step through all the arguments - copy any type qualifiers, but - * let the macro write all the other info into the buffer. - */ - while (types && *types) - { - const char *qual = types; - - /* - * If there are any type qualifiers - copy the through to the - * destination. - */ - types = objc_skip_type_qualifiers(types); - while (qual < types) - { - *dest++ = *qual++; - } - MFRAME_ARG_ENCODING(cum, types, total, dest); - count++; - } - *dest = '\0'; - - /* - * Write the total size of the stack arguments after the return type, - * then copy the remaining type information to fill the gap. - */ - sprintf(&buf[strlen(buf)], "%d", total); - dest = &buf[strlen(buf)]; - while (*start) - { - *dest++ = *start++; - } - *dest = '\0'; - - /* - * If we have written into a local buffer - we need to allocate memory - * in which to return our result. - */ - if (doMalloc) - { - char *tmp = NSZoneMalloc(NSDefaultMallocZone(), dest - buf + 1); - - strcpy(tmp, buf); - buf = tmp; - } - - /* - * If the caller wants to know the total size of the stack and/or the - * number of arguments, return them in the appropriate variables. - */ - if (size) - { - *size = total; - } - if (narg) - { - *narg = count; - } - return buf; -} - - -/* Step through method encoding information extracting details. - * If outTypes is non-nul then we copy the argument type into - * the buffer as a nul terminated string and use the values in - * this buffer as the types in info, rather than pointers to - * positions in typePtr - */ -const char * -mframe_next_arg(const char *typePtr, NSArgumentInfo *info, char *outTypes) -{ - NSArgumentInfo local; - BOOL flag; - BOOL negative = NO; - - if (info == 0) - { - info = &local; - } - /* - * Skip past any type qualifiers - if the caller wants them, return them. - */ - flag = YES; - info->qual = 0; - while (flag) - { - switch (*typePtr) - { - case _C_CONST: info->qual |= _F_CONST; break; - case _C_IN: info->qual |= _F_IN; break; - case _C_INOUT: info->qual |= _F_INOUT; break; - case _C_OUT: info->qual |= _F_OUT; break; - case _C_BYCOPY: info->qual |= _F_BYCOPY; break; -#ifdef _C_BYREF - case _C_BYREF: info->qual |= _F_BYREF; break; -#endif - case _C_ONEWAY: info->qual |= _F_ONEWAY; break; -#ifdef _C_GCINVISIBLE - case _C_GCINVISIBLE: info->qual |= _F_GCINVISIBLE; break; -#endif - default: flag = NO; - } - if (flag) - { - typePtr++; - } - } - - info->type = typePtr; - - /* - * Scan for size and alignment information. - */ - switch (*typePtr++) - { - case _C_ID: - info->size = sizeof(id); - info->align = __alignof__(id); - break; - - case _C_CLASS: - info->size = sizeof(Class); - info->align = __alignof__(Class); - break; - - case _C_SEL: - info->size = sizeof(SEL); - info->align = __alignof__(SEL); - break; - - case _C_CHR: - info->size = sizeof(char); - info->align = __alignof__(char); - break; - - case _C_UCHR: - info->size = sizeof(unsigned char); - info->align = __alignof__(unsigned char); - break; - - case _C_SHT: - info->size = sizeof(short); - info->align = __alignof__(short); - break; - - case _C_USHT: - info->size = sizeof(unsigned short); - info->align = __alignof__(unsigned short); - break; - - case _C_INT: - info->size = sizeof(int); - info->align = __alignof__(int); - break; - - case _C_UINT: - info->size = sizeof(unsigned int); - info->align = __alignof__(unsigned int); - break; - - case _C_LNG: - info->size = sizeof(long); - info->align = __alignof__(long); - break; - - case _C_ULNG: - info->size = sizeof(unsigned long); - info->align = __alignof__(unsigned long); - break; - - case _C_LNG_LNG: - info->size = sizeof(long long); - info->align = __alignof__(long long); - break; - - case _C_ULNG_LNG: - info->size = sizeof(unsigned long long); - info->align = __alignof__(unsigned long long); - break; - - case _C_FLT: - info->size = sizeof(float); - info->align = __alignof__(float); - break; - - case _C_DBL: - info->size = sizeof(double); - info->align = __alignof__(double); - break; - - case _C_PTR: - info->size = sizeof(char*); - info->align = __alignof__(char*); - if (*typePtr == '?') - { - typePtr++; - } - else - { - typePtr = objc_skip_typespec(typePtr); - } - break; - - case _C_ATOM: - case _C_CHARPTR: - info->size = sizeof(char*); - info->align = __alignof__(char*); - break; - - case _C_ARY_B: - { - int length = atoi(typePtr); - - while (isdigit(*typePtr)) - { - typePtr++; - } - typePtr = mframe_next_arg(typePtr, &local, 0); - info->size = length * ROUND(local.size, local.align); - info->align = local.align; - typePtr++; /* Skip end-of-array */ - } - break; - - case _C_STRUCT_B: - { - unsigned int acc_size = 0; - unsigned int def_align = objc_alignof_type(typePtr-1); - unsigned int acc_align = def_align; - const char *ptr = typePtr; - - /* - * Skip "=" stuff. - */ - while (*ptr != _C_STRUCT_E && *ptr != '=') ptr++; - if (*ptr == '=') typePtr = ptr; - typePtr++; - - /* - * Base structure alignment on first element. - */ - if (*typePtr != _C_STRUCT_E) - { - typePtr = mframe_next_arg(typePtr, &local, 0); - if (typePtr == 0) - { - return 0; /* error */ - } - acc_size = ROUND(acc_size, local.align); - acc_size += local.size; - acc_align = MAX(local.align, def_align); - } - /* - * Continue accumulating structure size - * and adjust alignment if necessary - */ - while (*typePtr != _C_STRUCT_E) - { - typePtr = mframe_next_arg(typePtr, &local, 0); - if (typePtr == 0) - { - return 0; /* error */ - } - acc_size = ROUND(acc_size, local.align); - acc_size += local.size; - acc_align = MAX(local.align, acc_align); - } - /* - * Size must be a multiple of alignment - */ - if (acc_size % acc_align != 0) - { - acc_size += acc_align - acc_size % acc_align; - } - info->size = acc_size; - info->align = acc_align; - typePtr++; /* Skip end-of-struct */ - } - break; - - case _C_UNION_B: - { - unsigned int max_size = 0; - unsigned int max_align = 0; - - /* - * Skip "=" stuff. - */ - while (*typePtr != _C_UNION_E) - { - if (*typePtr++ == '=') - { - break; - } - } - while (*typePtr != _C_UNION_E) - { - typePtr = mframe_next_arg(typePtr, &local, 0); - if (typePtr == 0) - { - return 0; /* error */ - } - max_size = MAX(max_size, local.size); - max_align = MAX(max_align, local.align); - } - info->size = max_size; - info->align = max_align; - typePtr++; /* Skip end-of-union */ - } - break; - - case _C_VOID: - info->size = 0; - info->align = __alignof__(char*); - break; - - default: - return 0; - } - - if (typePtr == 0) - { /* Error condition. */ - return 0; - } - - /* Copy tye type information into the buffer if provided. - */ - if (outTypes != 0) - { - unsigned len = typePtr - info->type; - - strncpy(outTypes, info->type, len); - outTypes[len] = '\0'; - info->type = outTypes; - } - - /* - * May tell the caller if the item is stored in a register. - */ - if (*typePtr == '+') - { - typePtr++; - info->isReg = YES; - } - else - { - info->isReg = NO; - } - /* - * Cope with negative offsets. - */ - if (*typePtr == '-') - { - typePtr++; - negative = YES; - } - /* - * May tell the caller what the stack/register offset is for - * this argument. - */ - info->offset = 0; - while (isdigit(*typePtr)) - { - info->offset = info->offset * 10 + (*typePtr++ - '0'); - } - if (negative == YES) - { - info->offset = -info->offset; - } - - return typePtr; -} - - -/* Return the number of arguments that the method MTH expects. Note - that all methods need two implicit arguments `self' and `_cmd'. */ - -int -method_types_get_number_of_arguments (const char *type) -{ - int i = 0; - - while (*type) - { - type = objc_skip_argspec (type); - i += 1; - } - return i - 1; -} - - -/* Return the size of the argument block needed on the stack to invoke - the method MTH. This may be zero, if all arguments are passed in - registers. */ - -int -method_types_get_size_of_stack_arguments (const char *type) -{ - type = objc_skip_typespec (type); - return atoi (type); -} - -int -method_types_get_size_of_register_arguments(const char *types) -{ - const char* type = strrchr(types, '+'); - - if (type) - { - return atoi(++type) + sizeof(void*); - } - else - { - return 0; - } -} - diff --git a/Source/mframe/.cvsignore b/Source/mframe/.cvsignore deleted file mode 100644 index 8ad26a03d..000000000 --- a/Source/mframe/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -config.log -config.status diff --git a/Source/mframe/README b/Source/mframe/README deleted file mode 100644 index 472469bd0..000000000 --- a/Source/mframe/README +++ /dev/null @@ -1,156 +0,0 @@ - - This directory contains files used for the 'mframe' software in gstep-base. - - These files are part of the GNUstep Base Library. - - Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free - Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02111 USA. - - The code in this directory was written by - Richard Frith-Macdonald . - Inspiration for (and some of the code of) this software came from the - original mframe.m by Andrew McCallum, the gcc compiler, and the - libFoundation software by Ovidiu Predescu and Mircea Oancea. - The algorithms used are copied from gcc and are copyright the Free - Software Foundation. Many code fragments are derived from gcc either - directly or by way of libFoundation. - - The sections of code (and comments) to do with the MFRAME_ARG_ENCODING() - macro for sparc, hppa and powerpc were derived in part from libFoundation - (for which, much thanks) avoiding the need to extract the relevent details - directly from the gcc source in these cases. The originals from which - these fragments came the additional credit/copyright - - - Copyright (C) 1995, 1996, 1998 Ovidiu Predescu and Mircea Oancea. - All rights reserved. - - Author: Ovidiu Predescu - - This file is part of libFoundation. - - Permission to use, copy, modify, and distribute this software and its - documentation for any purpose and without fee is hereby granted, provided - that the above copyright notice appear in all copies and that both that - copyright notice and this permission notice appear in supporting - documentation. - - We disclaim all warranties with regard to this software, including all - implied warranties of merchantability and fitness, in no event shall - we be liable for any special, indirect or consequential damages or any - damages whatsoever resulting from loss of use, data or profits, whether in - an action of contract, negligence or other tortious action, arising out of - or in connection with the use or performance of this software. - - -Purpose - - - The files in these directories are used by the configuration script to build - a machine/operating-system specific 'mframe.h' file containing macros used - to access stack frames. - The 'mframe.h' file is simply built by wrapping a system dependent file - between mframe.head and mframe.foot - -Advice on porting - - - See unknown/generic for an example of the following macros - -MFRAME_STACK_STRUCT - This should be defined to 1 if functions return structures by value - using the method where the caller places a pointer on the stack. - Define this to 0 otherwise (eg. when the pointer to the structure is - passed in a register). - -MFRAME_SMALL_STRUCT - This is the size of the largest structure returned by value on - the stack. Normally gcc returns structures of up to 8 bytes on - the stack. If your system never returns structures on the stack, - set this to zero rather than 8. - NB. If __builtin_apply_args() always returns an argframe for - structure return via pointer, you should also define this to zero. - -MFRAME_STRUCT_BYREF - This should be defined to 1 if structure arguments are passed in - the stack frame by reference, 0 otherwise. - -MFRAME_ARGS_SIZE - This must be set to the value computed by the apply_args_size() - function in expr.c in the gcc source. It is the size of the - area of memory allocated in which to pass arguments to a function. - If you can't figure out how to determine this (hack expr.c to print - the result of the function the first time it's called) - try using a - value like 128 - which will probably be far larger than required - (and therefore somewhat inefficient) but will most likely work. - -MFRAME_RESULT_SIZE - This must be set to the value computed by the apply_result_size() - function in expr.c in the gcc source. It is the size of the area - of memory allocated in which to return a value from a function. - If you can't figure out how to determine this (hack expr.c to print - the result of the function the first time it's called) - try using a - value like 128 - which will probably be far larger than required - (and therefore somewhat inefficient) but will most likely work. - -MFRAME_FLT_IN_FRAME_AS_DBL - This should be defined as 1 if float parameters to functions and - objective-c methods are passed on the stack as double values. - Otherwise it should not be defined. - -MFRAME_STRUCT_ADDR(ARGFRAME,TYPES) - If a function returns a structure by copying it into a location - whose address is set by the caller, this macro must return that - address within the argframe. - Otherwise the macro must return zero. - -MFRAME_ARGS - This macro should define a data type to be used for recording - information about the arguments list of a method. - See 'CUMULATIVE_ARGS' in the configuration file for your system - in gcc for a parallel example. - -MFRAME_INIT_ARGS(CUM, RTYPE) - This macro is used to initialise a variable (CUM) of the type - defined by MFRAME_ARGS. The RTYPE value is the type encoding for the - method return type, it is needed so that CUM can take int account any - invisible first argument used for returning structures by value. - See 'INIT_CUMULATIVE_ARGS' in the configuration file for your system - in gcc for a parallel example. - -MFRAME_ARG_ENCODING(CUM,TYPES,STACK,DEST) - This macro is used to to determine the encoding of arguments. - You will have to write this macro for your system by examining the - gcc source code to determine how the compiler does this on your - system - look for the usage of CUMULATIVE_ARGS an INIT_CUMULATIVE_ARGS - in the configuration files for your hardware and operating system in - the gcc (or egcs) source, and make your macro mirror it's operation. - - Before initial entry, - CUM should have been initialised using the MFRAME_INIT_ARGS() macro, - TYPES should be a (const char*) variable initialised to a - type-encoding string listing the arguments of a function/method, - STACK should be an integer variable of value 0 in which the size of - the stack arguments will be accumulated, - DEST should be a (char*) variable initialised to a pointer to a - buffer into which the full type encoding will be written. - After each use of the macro, TYPES is advanced to point to the next - argument, and DEST is advanced to point after the encoding of the - previous argument. - Of course, you must ensure that the buffer pointed to by DEST is - large enough so that it does not overflow! - You will be safe if your buffer is at least ten times as big as - the type-encoding string you start from. - - diff --git a/Source/mframe/alpha/generic b/Source/mframe/alpha/generic deleted file mode 100644 index 9ce0ba1cb..000000000 --- a/Source/mframe/alpha/generic +++ /dev/null @@ -1,91 +0,0 @@ -/* See ../README for copyright */ - -/* - * First six arguments are passed in registers with small (< sizeof(void*)) - * values occupying the space of a pointer. - * If the method returns a structure, it's address is passed as an invisible - * first argument. - */ - -#define MFRAME_STRUCT_BYREF 0 -#define MFRAME_SMALL_STRUCT 0 -#define MFRAME_ARGS_SIZE 104 -#define MFRAME_RESULT_SIZE 16 -#define MFRAME_FLT_IN_FRAME_AS_DBL 0 - -/* - * Structures are passed by reference as an invisible first argument, so - * they go in the first space on the stack. - */ -#define MFRAME_GET_STRUCT_ADDR(ARGS, TYPES) \ -((*(TYPES)==_C_STRUCT_B || *(TYPES)==_C_UNION_B || *(TYPES)==_C_ARY_B) ? \ - ((void**)(ARGS))[1] : (void*)0) - -#define MFRAME_SET_STRUCT_ADDR(ARGS, TYPES, ADDR) \ -({if (*(TYPES)==_C_STRUCT_B || *(TYPES)==_C_UNION_B || *(TYPES)==_C_ARY_B) \ - ((void**)(ARGS))[1] = (ADDR);}) - -/* - * Declare a type for keeping track of the arguments processed. - */ -typedef struct alpha_args { - int reg_pos; - int stk_pos; -} MFRAME_ARGS; - - -/* - * Initialize a variable to keep track of argument info while processing a - * method. Keeps count of the offset of arguments on the stack. - * This offset is adjusted to take account of an invisible first argument - * used to return structures. - */ - -#define MFRAME_INIT_ARGS(CUM, RTYPE) \ -({ \ - (CUM).reg_pos = (*(RTYPE)==_C_STRUCT_B || *(RTYPE)==_C_UNION_B || \ - *(RTYPE)==_C_ARY_B) ? 16 : 8; \ - (CUM).stk_pos = 0; \ -}) - -/* - * Define maximum register offset - after this, stuff goes on the stack. - */ -#define ALPHAMAXR 56 - -#define MFRAME_ARG_ENCODING(CUM, TYPE, STACK, DEST) \ -({ \ - const char* type = (TYPE); \ - int align, size; \ -\ - (TYPE) = objc_skip_typespec(type); \ - align = objc_alignof_type (type); \ - size = objc_sizeof_type (type); \ - size = ROUND(size, sizeof(void*)); \ -\ - if ((CUM).reg_pos + size > ALPHAMAXR) (CUM).reg_pos = ALPHAMAXR; \ - if ((CUM).reg_pos == ALPHAMAXR) \ - { \ - sprintf((DEST), "%.*s%d", (TYPE)-type, type, (CUM).stk_pos); \ - (CUM).stk_pos += size; \ - (STACK) = (CUM).stk_pos; \ - } \ - else \ - { \ - sprintf((DEST), "%.*s+%d", (TYPE)-type, type, (CUM).reg_pos); \ - (CUM).reg_pos += size; \ - } \ - (DEST)=&(DEST)[strlen(DEST)]; \ - if (*(TYPE) == '+') \ - { \ - (TYPE)++; \ - } \ - if (*(TYPE) == '-') \ - { \ - (TYPE)++; \ - } \ - while (isdigit(*(TYPE))) \ - { \ - (TYPE)++; \ - } \ -}) diff --git a/Source/mframe/alpha/linux-gnu b/Source/mframe/alpha/linux-gnu deleted file mode 100644 index 352c81617..000000000 --- a/Source/mframe/alpha/linux-gnu +++ /dev/null @@ -1,87 +0,0 @@ -/* See ../README for copyright */ - -/* - * First six arguments are passed in registers with small (< sizeof(void*)) - * values occupying the space of a pointer. - * If the method returns a structure, it's address is passed as an invisible - * first argument. - */ - -#define MFRAME_STRUCT_BYREF 0 -#define MFRAME_SMALL_STRUCT 0 -#define MFRAME_ARGS_SIZE 104 -#define MFRAME_RESULT_SIZE 16 -#define MFRAME_FLT_IN_FRAME_AS_DBL 0 - -/* - * Structures are passed by reference as an invisible first argument, so - * they go in the first space on the stack. - */ -#define MFRAME_GET_STRUCT_ADDR(ARGS, TYPES) \ -((*(TYPES)==_C_STRUCT_B || *(TYPES)==_C_UNION_B || *(TYPES)==_C_ARY_B) ? \ - ((void**)(ARGS))[1] : (void*)0) - -#define MFRAME_SET_STRUCT_ADDR(ARGS, TYPES, ADDR) \ -({if (*(TYPES)==_C_STRUCT_B || *(TYPES)==_C_UNION_B || *(TYPES)==_C_ARY_B) \ - ((void**)(ARGS))[1] = (ADDR);}) - -/* - * Declare a type for keeping track of the arguments processed. - */ -typedef struct alpha_args { - int reg_pos; - int stk_pos; -} MFRAME_ARGS; - - -/* - * Initialize a variable to keep track of argument info while processing a - * method. Keeps count of the offset of arguments on the stack. - * This offset is adjusted to take account of an invisible first argument - * used to return structures. - */ - -#define MFRAME_INIT_ARGS(CUM, RTYPE) \ -({ \ - (CUM).reg_pos = (*(RTYPE)==_C_STRUCT_B || *(RTYPE)==_C_UNION_B || \ - *(RTYPE)==_C_ARY_B) ? 16 : 8; \ - (CUM).stk_pos = 0; \ -}) - -/* - * Define maximum register offset - after this, stuff goes on the stack. - */ -#define ALPHAMAXR 56 - -#define MFRAME_ARG_ENCODING(CUM, TYPE, STACK, DEST) \ -({ \ - const char* type = (TYPE); \ - int align, size; \ -\ - (TYPE) = objc_skip_typespec(type); \ - align = objc_alignof_type (type); \ - size = objc_sizeof_type (type); \ - size = ROUND(size, sizeof(void*)); \ -\ - if ((CUM).reg_pos + size > ALPHAMAXR) (CUM).reg_pos = ALPHAMAXR; \ - if ((CUM).reg_pos == ALPHAMAXR) \ - { \ - sprintf((DEST), "%.*s%d", (TYPE)-type, type, (CUM).stk_pos); \ - (CUM).stk_pos += size; \ - (STACK) = (CUM).stk_pos; \ - } \ - else \ - { \ - sprintf((DEST), "%.*s+%d", (TYPE)-type, type, (CUM).reg_pos); \ - (CUM).reg_pos += size; \ - } \ - (DEST)=&(DEST)[strlen(DEST)]; \ - if (*(TYPE) == '+') \ - { \ - (TYPE)++; \ - } \ - while (isdigit(*(TYPE))) \ - { \ - (TYPE)++; \ - } \ -}) diff --git a/Source/mframe/configure b/Source/mframe/configure deleted file mode 100755 index 8c0f278f8..000000000 --- a/Source/mframe/configure +++ /dev/null @@ -1,1956 +0,0 @@ -#! /bin/sh -# Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.59. -# -# Copyright (C) 2003 Free Software Foundation, Inc. -# This configure script is free software; the Free Software Foundation -# gives unlimited permission to copy, distribute and modify it. -## --------------------- ## -## M4sh Initialization. ## -## --------------------- ## - -# Be Bourne compatible -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' -elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then - set -o posix -fi -DUALCASE=1; export DUALCASE # for MKS sh - -# Support unset when possible. -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - as_unset=unset -else - as_unset=false -fi - - -# Work around bugs in pre-3.0 UWIN ksh. -$as_unset ENV MAIL MAILPATH -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -for as_var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME -do - if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then - eval $as_var=C; export $as_var - else - $as_unset $as_var - fi -done - -# Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1; then - as_expr=expr -else - as_expr=false -fi - -if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - - -# Name of the executable. -as_me=`$as_basename "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)$' \| \ - . : '\(.\)' 2>/dev/null || -echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } - /^X\/\(\/\/\)$/{ s//\1/; q; } - /^X\/\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - - -# PATH needs CR, and LINENO needs CR and PATH. -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh -fi - - - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" || { - # Find who we are. Look in the path if we contain no path at all - # relative or not. - case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done - - ;; - esac - # We did not find ourselves, most probably we were run as `sh COMMAND' - # in which case we are not to be found in the path. - if test "x$as_myself" = x; then - as_myself=$0 - fi - if test ! -f "$as_myself"; then - { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 - { (exit 1); exit 1; }; } - fi - case $CONFIG_SHELL in - '') - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for as_base in sh bash ksh sh5; do - case $as_dir in - /*) - if ("$as_dir/$as_base" -c ' - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then - $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } - $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } - CONFIG_SHELL=$as_dir/$as_base - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$0" ${1+"$@"} - fi;; - esac - done -done -;; - esac - - # Create $as_me.lineno as a copy of $as_myself, but with $LINENO - # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line before each line; the second 'sed' does the real - # work. The second script uses 'N' to pair each line-number line - # with the numbered line, and appends trailing '-' during - # substitution so that $LINENO is not a special case at line end. - # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) - sed '=' <$as_myself | - sed ' - N - s,$,-, - : loop - s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, - t loop - s,-$,, - s,^['$as_cr_digits']*\n,, - ' >$as_me.lineno && - chmod +x $as_me.lineno || - { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 - { (exit 1); exit 1; }; } - - # Don't try to exec as it changes $[0], causing all sort of problems - # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensible to this). - . ./$as_me.lineno - # Exit status is that of the last command. - exit -} - - -case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in - *c*,-n*) ECHO_N= ECHO_C=' -' ECHO_T=' ' ;; - *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; - *) ECHO_N= ECHO_C='\c' ECHO_T= ;; -esac - -if expr a : '\(a\)' >/dev/null 2>&1; then - as_expr=expr -else - as_expr=false -fi - -rm -f conf$$ conf$$.exe conf$$.file -echo >conf$$.file -if ln -s conf$$.file conf$$ 2>/dev/null; then - # We could just check for DJGPP; but this test a) works b) is more generic - # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). - if test -f conf$$.exe; then - # Don't use ln at all; we don't have any links - as_ln_s='cp -p' - else - as_ln_s='ln -s' - fi -elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln -else - as_ln_s='cp -p' -fi -rm -f conf$$ conf$$.exe conf$$.file - -if mkdir -p . 2>/dev/null; then - as_mkdir_p=: -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - -as_executable_p="test -f" - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - - -# IFS -# We need space, tab and new line, in precisely that order. -as_nl=' -' -IFS=" $as_nl" - -# CDPATH. -$as_unset CDPATH - - -# Name of the host. -# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, -# so uname gets run too. -ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` - -exec 6>&1 - -# -# Initializations. -# -ac_default_prefix=/usr/local -ac_config_libobj_dir=. -cross_compiling=no -subdirs= -MFLAGS= -MAKEFLAGS= -SHELL=${CONFIG_SHELL-/bin/sh} - -# Maximum number of lines to put in a shell here document. -# This variable seems obsolete. It should probably be removed, and -# only ac_max_sed_lines should be used. -: ${ac_max_here_lines=38} - -# Identity of this package. -PACKAGE_NAME= -PACKAGE_TARNAME= -PACKAGE_VERSION= -PACKAGE_STRING= -PACKAGE_BUGREPORT= - -ac_unique_file="mframe.head" -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os LIBOBJS LTLIBOBJS' -ac_subst_files='' - -# Initialize some variables set by options. -ac_init_help= -ac_init_version=false -# The variables have the same names as the options, with -# dashes changed to underlines. -cache_file=/dev/null -exec_prefix=NONE -no_create= -no_recursion= -prefix=NONE -program_prefix=NONE -program_suffix=NONE -program_transform_name=s,x,x, -silent= -site= -srcdir= -verbose= -x_includes=NONE -x_libraries=NONE - -# Installation directory options. -# These are left unexpanded so users can "make install exec_prefix=/foo" -# and all the variables that are supposed to be based on exec_prefix -# by default will actually change. -# Use braces instead of parens because sh, perl, etc. also accept them. -bindir='${exec_prefix}/bin' -sbindir='${exec_prefix}/sbin' -libexecdir='${exec_prefix}/libexec' -datadir='${prefix}/share' -sysconfdir='${prefix}/etc' -sharedstatedir='${prefix}/com' -localstatedir='${prefix}/var' -libdir='${exec_prefix}/lib' -includedir='${prefix}/include' -oldincludedir='/usr/include' -infodir='${prefix}/info' -mandir='${prefix}/man' - -ac_prev= -for ac_option -do - # If the previous option needs an argument, assign it. - if test -n "$ac_prev"; then - eval "$ac_prev=\$ac_option" - ac_prev= - continue - fi - - ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` - - # Accept the important Cygnus configure options, so we can diagnose typos. - - case $ac_option in - - -bindir | --bindir | --bindi | --bind | --bin | --bi) - ac_prev=bindir ;; - -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) - bindir=$ac_optarg ;; - - -build | --build | --buil | --bui | --bu) - ac_prev=build_alias ;; - -build=* | --build=* | --buil=* | --bui=* | --bu=*) - build_alias=$ac_optarg ;; - - -cache-file | --cache-file | --cache-fil | --cache-fi \ - | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) - ac_prev=cache_file ;; - -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ - | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) - cache_file=$ac_optarg ;; - - --config-cache | -C) - cache_file=config.cache ;; - - -datadir | --datadir | --datadi | --datad | --data | --dat | --da) - ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ - | --da=*) - datadir=$ac_optarg ;; - - -disable-* | --disable-*) - ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid feature name: $ac_feature" >&2 - { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/-/_/g'` - eval "enable_$ac_feature=no" ;; - - -enable-* | --enable-*) - ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid feature name: $ac_feature" >&2 - { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/-/_/g'` - case $ac_option in - *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; - *) ac_optarg=yes ;; - esac - eval "enable_$ac_feature='$ac_optarg'" ;; - - -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ - | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ - | --exec | --exe | --ex) - ac_prev=exec_prefix ;; - -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ - | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ - | --exec=* | --exe=* | --ex=*) - exec_prefix=$ac_optarg ;; - - -gas | --gas | --ga | --g) - # Obsolete; use --with-gas. - with_gas=yes ;; - - -help | --help | --hel | --he | -h) - ac_init_help=long ;; - -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) - ac_init_help=recursive ;; - -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) - ac_init_help=short ;; - - -host | --host | --hos | --ho) - ac_prev=host_alias ;; - -host=* | --host=* | --hos=* | --ho=*) - host_alias=$ac_optarg ;; - - -includedir | --includedir | --includedi | --included | --include \ - | --includ | --inclu | --incl | --inc) - ac_prev=includedir ;; - -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ - | --includ=* | --inclu=* | --incl=* | --inc=*) - includedir=$ac_optarg ;; - - -infodir | --infodir | --infodi | --infod | --info | --inf) - ac_prev=infodir ;; - -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) - infodir=$ac_optarg ;; - - -libdir | --libdir | --libdi | --libd) - ac_prev=libdir ;; - -libdir=* | --libdir=* | --libdi=* | --libd=*) - libdir=$ac_optarg ;; - - -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ - | --libexe | --libex | --libe) - ac_prev=libexecdir ;; - -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ - | --libexe=* | --libex=* | --libe=*) - libexecdir=$ac_optarg ;; - - -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst \ - | --locals | --local | --loca | --loc | --lo) - ac_prev=localstatedir ;; - -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* \ - | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) - localstatedir=$ac_optarg ;; - - -mandir | --mandir | --mandi | --mand | --man | --ma | --m) - ac_prev=mandir ;; - -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) - mandir=$ac_optarg ;; - - -nfp | --nfp | --nf) - # Obsolete; use --without-fp. - with_fp=no ;; - - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c | -n) - no_create=yes ;; - - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) - no_recursion=yes ;; - - -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ - | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ - | --oldin | --oldi | --old | --ol | --o) - ac_prev=oldincludedir ;; - -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ - | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ - | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) - oldincludedir=$ac_optarg ;; - - -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) - ac_prev=prefix ;; - -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) - prefix=$ac_optarg ;; - - -program-prefix | --program-prefix | --program-prefi | --program-pref \ - | --program-pre | --program-pr | --program-p) - ac_prev=program_prefix ;; - -program-prefix=* | --program-prefix=* | --program-prefi=* \ - | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) - program_prefix=$ac_optarg ;; - - -program-suffix | --program-suffix | --program-suffi | --program-suff \ - | --program-suf | --program-su | --program-s) - ac_prev=program_suffix ;; - -program-suffix=* | --program-suffix=* | --program-suffi=* \ - | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) - program_suffix=$ac_optarg ;; - - -program-transform-name | --program-transform-name \ - | --program-transform-nam | --program-transform-na \ - | --program-transform-n | --program-transform- \ - | --program-transform | --program-transfor \ - | --program-transfo | --program-transf \ - | --program-trans | --program-tran \ - | --progr-tra | --program-tr | --program-t) - ac_prev=program_transform_name ;; - -program-transform-name=* | --program-transform-name=* \ - | --program-transform-nam=* | --program-transform-na=* \ - | --program-transform-n=* | --program-transform-=* \ - | --program-transform=* | --program-transfor=* \ - | --program-transfo=* | --program-transf=* \ - | --program-trans=* | --program-tran=* \ - | --progr-tra=* | --program-tr=* | --program-t=*) - program_transform_name=$ac_optarg ;; - - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - silent=yes ;; - - -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) - ac_prev=sbindir ;; - -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ - | --sbi=* | --sb=*) - sbindir=$ac_optarg ;; - - -sharedstatedir | --sharedstatedir | --sharedstatedi \ - | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ - | --sharedst | --shareds | --shared | --share | --shar \ - | --sha | --sh) - ac_prev=sharedstatedir ;; - -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ - | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ - | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ - | --sha=* | --sh=*) - sharedstatedir=$ac_optarg ;; - - -site | --site | --sit) - ac_prev=site ;; - -site=* | --site=* | --sit=*) - site=$ac_optarg ;; - - -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) - ac_prev=srcdir ;; - -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) - srcdir=$ac_optarg ;; - - -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ - | --syscon | --sysco | --sysc | --sys | --sy) - ac_prev=sysconfdir ;; - -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ - | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) - sysconfdir=$ac_optarg ;; - - -target | --target | --targe | --targ | --tar | --ta | --t) - ac_prev=target_alias ;; - -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) - target_alias=$ac_optarg ;; - - -v | -verbose | --verbose | --verbos | --verbo | --verb) - verbose=yes ;; - - -version | --version | --versio | --versi | --vers | -V) - ac_init_version=: ;; - - -with-* | --with-*) - ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid package name: $ac_package" >&2 - { (exit 1); exit 1; }; } - ac_package=`echo $ac_package| sed 's/-/_/g'` - case $ac_option in - *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; - *) ac_optarg=yes ;; - esac - eval "with_$ac_package='$ac_optarg'" ;; - - -without-* | --without-*) - ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid package name: $ac_package" >&2 - { (exit 1); exit 1; }; } - ac_package=`echo $ac_package | sed 's/-/_/g'` - eval "with_$ac_package=no" ;; - - --x) - # Obsolete; use --with-x. - with_x=yes ;; - - -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ - | --x-incl | --x-inc | --x-in | --x-i) - ac_prev=x_includes ;; - -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ - | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) - x_includes=$ac_optarg ;; - - -x-libraries | --x-libraries | --x-librarie | --x-librari \ - | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) - ac_prev=x_libraries ;; - -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ - | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) - x_libraries=$ac_optarg ;; - - -*) { echo "$as_me: error: unrecognized option: $ac_option -Try \`$0 --help' for more information." >&2 - { (exit 1); exit 1; }; } - ;; - - *=*) - ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` - # Reject names that are not valid shell variable names. - expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 - { (exit 1); exit 1; }; } - ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` - eval "$ac_envvar='$ac_optarg'" - export $ac_envvar ;; - - *) - # FIXME: should be removed in autoconf 3.0. - echo "$as_me: WARNING: you should use --build, --host, --target" >&2 - expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - echo "$as_me: WARNING: invalid host type: $ac_option" >&2 - : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} - ;; - - esac -done - -if test -n "$ac_prev"; then - ac_option=--`echo $ac_prev | sed 's/_/-/g'` - { echo "$as_me: error: missing argument to $ac_option" >&2 - { (exit 1); exit 1; }; } -fi - -# Be sure to have absolute paths. -for ac_var in exec_prefix prefix -do - eval ac_val=$`echo $ac_var` - case $ac_val in - [\\/$]* | ?:[\\/]* | NONE | '' ) ;; - *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; };; - esac -done - -# Be sure to have absolute paths. -for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ - localstatedir libdir includedir oldincludedir infodir mandir -do - eval ac_val=$`echo $ac_var` - case $ac_val in - [\\/$]* | ?:[\\/]* ) ;; - *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; };; - esac -done - -# There might be people who depend on the old broken behavior: `$host' -# used to hold the argument of --host etc. -# FIXME: To remove some day. -build=$build_alias -host=$host_alias -target=$target_alias - -# FIXME: To remove some day. -if test "x$host_alias" != x; then - if test "x$build_alias" = x; then - cross_compiling=maybe - echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. - If a cross compiler is detected then cross compile mode will be used." >&2 - elif test "x$build_alias" != "x$host_alias"; then - cross_compiling=yes - fi -fi - -ac_tool_prefix= -test -n "$host_alias" && ac_tool_prefix=$host_alias- - -test "$silent" = yes && exec 6>/dev/null - - -# Find the source files, if location was not specified. -if test -z "$srcdir"; then - ac_srcdir_defaulted=yes - # Try the directory containing this script, then its parent. - ac_confdir=`(dirname "$0") 2>/dev/null || -$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$0" : 'X\(//\)[^/]' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$0" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - srcdir=$ac_confdir - if test ! -r $srcdir/$ac_unique_file; then - srcdir=.. - fi -else - ac_srcdir_defaulted=no -fi -if test ! -r $srcdir/$ac_unique_file; then - if test "$ac_srcdir_defaulted" = yes; then - { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 - { (exit 1); exit 1; }; } - else - { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 - { (exit 1); exit 1; }; } - fi -fi -(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || - { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 - { (exit 1); exit 1; }; } -srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` -ac_env_build_alias_set=${build_alias+set} -ac_env_build_alias_value=$build_alias -ac_cv_env_build_alias_set=${build_alias+set} -ac_cv_env_build_alias_value=$build_alias -ac_env_host_alias_set=${host_alias+set} -ac_env_host_alias_value=$host_alias -ac_cv_env_host_alias_set=${host_alias+set} -ac_cv_env_host_alias_value=$host_alias -ac_env_target_alias_set=${target_alias+set} -ac_env_target_alias_value=$target_alias -ac_cv_env_target_alias_set=${target_alias+set} -ac_cv_env_target_alias_value=$target_alias - -# -# Report the --help message. -# -if test "$ac_init_help" = "long"; then - # Omit some internal or obsolete options to make the list less imposing. - # This message is too long to be a string in the A/UX 3.1 sh. - cat <<_ACEOF -\`configure' configures this package to adapt to many kinds of systems. - -Usage: $0 [OPTION]... [VAR=VALUE]... - -To assign environment variables (e.g., CC, CFLAGS...), specify them as -VAR=VALUE. See below for descriptions of some of the useful variables. - -Defaults for the options are specified in brackets. - -Configuration: - -h, --help display this help and exit - --help=short display options specific to this package - --help=recursive display the short help of all the included packages - -V, --version display version information and exit - -q, --quiet, --silent do not print \`checking...' messages - --cache-file=FILE cache test results in FILE [disabled] - -C, --config-cache alias for \`--cache-file=config.cache' - -n, --no-create do not create output files - --srcdir=DIR find the sources in DIR [configure dir or \`..'] - -_ACEOF - - cat <<_ACEOF -Installation directories: - --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] - --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [PREFIX] - -By default, \`make install' will install all the files in -\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify -an installation prefix other than \`$ac_default_prefix' using \`--prefix', -for instance \`--prefix=\$HOME'. - -For better control, use the options below. - -Fine tuning of the installation directories: - --bindir=DIR user executables [EPREFIX/bin] - --sbindir=DIR system admin executables [EPREFIX/sbin] - --libexecdir=DIR program executables [EPREFIX/libexec] - --datadir=DIR read-only architecture-independent data [PREFIX/share] - --sysconfdir=DIR read-only single-machine data [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] - --localstatedir=DIR modifiable single-machine data [PREFIX/var] - --libdir=DIR object code libraries [EPREFIX/lib] - --includedir=DIR C header files [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc [/usr/include] - --infodir=DIR info documentation [PREFIX/info] - --mandir=DIR man documentation [PREFIX/man] -_ACEOF - - cat <<\_ACEOF - -System types: - --build=BUILD configure for building on BUILD [guessed] - --host=HOST cross-compile to build programs to run on HOST [BUILD] - --target=TARGET configure for building compilers for TARGET [HOST] -_ACEOF -fi - -if test -n "$ac_init_help"; then - - cat <<\_ACEOF - -_ACEOF -fi - -if test "$ac_init_help" = "recursive"; then - # If there are subdirs, report their specific --help. - ac_popdir=`pwd` - for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue - test -d $ac_dir || continue - ac_builddir=. - -if test "$ac_dir" != .; then - ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A "../" for each directory in $ac_dir_suffix. - ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` -else - ac_dir_suffix= ac_top_builddir= -fi - -case $srcdir in - .) # No --srcdir option. We are building in place. - ac_srcdir=. - if test -z "$ac_top_builddir"; then - ac_top_srcdir=. - else - ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` - fi ;; - [\\/]* | ?:[\\/]* ) # Absolute path. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir ;; - *) # Relative path. - ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_builddir$srcdir ;; -esac - -# Do not use `cd foo && pwd` to compute absolute paths, because -# the directories may not exist. -case `pwd` in -.) ac_abs_builddir="$ac_dir";; -*) - case "$ac_dir" in - .) ac_abs_builddir=`pwd`;; - [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; - *) ac_abs_builddir=`pwd`/"$ac_dir";; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_builddir=${ac_top_builddir}.;; -*) - case ${ac_top_builddir}. in - .) ac_abs_top_builddir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; - *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_srcdir=$ac_srcdir;; -*) - case $ac_srcdir in - .) ac_abs_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; - *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_srcdir=$ac_top_srcdir;; -*) - case $ac_top_srcdir in - .) ac_abs_top_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; - *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; - esac;; -esac - - cd $ac_dir - # Check for guested configure; otherwise get Cygnus style configure. - if test -f $ac_srcdir/configure.gnu; then - echo - $SHELL $ac_srcdir/configure.gnu --help=recursive - elif test -f $ac_srcdir/configure; then - echo - $SHELL $ac_srcdir/configure --help=recursive - elif test -f $ac_srcdir/configure.ac || - test -f $ac_srcdir/configure.in; then - echo - $ac_configure --help - else - echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 - fi - cd $ac_popdir - done -fi - -test -n "$ac_init_help" && exit 0 -if $ac_init_version; then - cat <<\_ACEOF - -Copyright (C) 2003 Free Software Foundation, Inc. -This configure script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it. -_ACEOF - exit 0 -fi -exec 5>config.log -cat >&5 <<_ACEOF -This file contains any messages produced by compilers while -running configure, to aid debugging if configure makes a mistake. - -It was created by $as_me, which was -generated by GNU Autoconf 2.59. Invocation command line was - - $ $0 $@ - -_ACEOF -{ -cat <<_ASUNAME -## --------- ## -## Platform. ## -## --------- ## - -hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` -uname -m = `(uname -m) 2>/dev/null || echo unknown` -uname -r = `(uname -r) 2>/dev/null || echo unknown` -uname -s = `(uname -s) 2>/dev/null || echo unknown` -uname -v = `(uname -v) 2>/dev/null || echo unknown` - -/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` -/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` - -/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` -/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` -/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` -hostinfo = `(hostinfo) 2>/dev/null || echo unknown` -/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` -/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` -/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` - -_ASUNAME - -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - echo "PATH: $as_dir" -done - -} >&5 - -cat >&5 <<_ACEOF - - -## ----------- ## -## Core tests. ## -## ----------- ## - -_ACEOF - - -# Keep a trace of the command line. -# Strip out --no-create and --no-recursion so they do not pile up. -# Strip out --silent because we don't want to record it for future runs. -# Also quote any args containing shell meta-characters. -# Make two passes to allow for proper duplicate-argument suppression. -ac_configure_args= -ac_configure_args0= -ac_configure_args1= -ac_sep= -ac_must_keep_next=false -for ac_pass in 1 2 -do - for ac_arg - do - case $ac_arg in - -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - continue ;; - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) - ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - case $ac_pass in - 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; - 2) - ac_configure_args1="$ac_configure_args1 '$ac_arg'" - if test $ac_must_keep_next = true; then - ac_must_keep_next=false # Got value, back to normal. - else - case $ac_arg in - *=* | --config-cache | -C | -disable-* | --disable-* \ - | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ - | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ - | -with-* | --with-* | -without-* | --without-* | --x) - case "$ac_configure_args0 " in - "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; - esac - ;; - -* ) ac_must_keep_next=true ;; - esac - fi - ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" - # Get rid of the leading space. - ac_sep=" " - ;; - esac - done -done -$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } -$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } - -# When interrupted or exit'd, cleanup temporary files, and complete -# config.log. We remove comments because anyway the quotes in there -# would cause problems or look ugly. -# WARNING: Be sure not to use single quotes in there, as some shells, -# such as our DU 5.0 friend, will then `close' the trap. -trap 'exit_status=$? - # Save into config.log some information that might help in debugging. - { - echo - - cat <<\_ASBOX -## ---------------- ## -## Cache variables. ## -## ---------------- ## -_ASBOX - echo - # The following way of writing the cache mishandles newlines in values, -{ - (set) 2>&1 | - case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in - *ac_space=\ *) - sed -n \ - "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" - ;; - *) - sed -n \ - "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" - ;; - esac; -} - echo - - cat <<\_ASBOX -## ----------------- ## -## Output variables. ## -## ----------------- ## -_ASBOX - echo - for ac_var in $ac_subst_vars - do - eval ac_val=$`echo $ac_var` - echo "$ac_var='"'"'$ac_val'"'"'" - done | sort - echo - - if test -n "$ac_subst_files"; then - cat <<\_ASBOX -## ------------- ## -## Output files. ## -## ------------- ## -_ASBOX - echo - for ac_var in $ac_subst_files - do - eval ac_val=$`echo $ac_var` - echo "$ac_var='"'"'$ac_val'"'"'" - done | sort - echo - fi - - if test -s confdefs.h; then - cat <<\_ASBOX -## ----------- ## -## confdefs.h. ## -## ----------- ## -_ASBOX - echo - sed "/^$/d" confdefs.h | sort - echo - fi - test "$ac_signal" != 0 && - echo "$as_me: caught signal $ac_signal" - echo "$as_me: exit $exit_status" - } >&5 - rm -f core *.core && - rm -rf conftest* confdefs* conf$$* $ac_clean_files && - exit $exit_status - ' 0 -for ac_signal in 1 2 13 15; do - trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal -done -ac_signal=0 - -# confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -rf conftest* confdefs.h -# AIX cpp loses on an empty file, so make sure it contains at least a newline. -echo >confdefs.h - -# Predefined preprocessor variables. - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_NAME "$PACKAGE_NAME" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_TARNAME "$PACKAGE_TARNAME" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_VERSION "$PACKAGE_VERSION" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_STRING "$PACKAGE_STRING" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" -_ACEOF - - -# Let the site file select an alternate cache file if it wants to. -# Prefer explicitly selected file to automatically selected ones. -if test -z "$CONFIG_SITE"; then - if test "x$prefix" != xNONE; then - CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" - else - CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" - fi -fi -for ac_site_file in $CONFIG_SITE; do - if test -r "$ac_site_file"; then - { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 -echo "$as_me: loading site script $ac_site_file" >&6;} - sed 's/^/| /' "$ac_site_file" >&5 - . "$ac_site_file" - fi -done - -if test -r "$cache_file"; then - # Some versions of bash will fail to source /dev/null (special - # files actually), so we avoid doing that. - if test -f "$cache_file"; then - { echo "$as_me:$LINENO: loading cache $cache_file" >&5 -echo "$as_me: loading cache $cache_file" >&6;} - case $cache_file in - [\\/]* | ?:[\\/]* ) . $cache_file;; - *) . ./$cache_file;; - esac - fi -else - { echo "$as_me:$LINENO: creating cache $cache_file" >&5 -echo "$as_me: creating cache $cache_file" >&6;} - >$cache_file -fi - -# Check that the precious variables saved in the cache have kept the same -# value. -ac_cache_corrupted=false -for ac_var in `(set) 2>&1 | - sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do - eval ac_old_set=\$ac_cv_env_${ac_var}_set - eval ac_new_set=\$ac_env_${ac_var}_set - eval ac_old_val="\$ac_cv_env_${ac_var}_value" - eval ac_new_val="\$ac_env_${ac_var}_value" - case $ac_old_set,$ac_new_set in - set,) - { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,set) - { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 -echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,);; - *) - if test "x$ac_old_val" != "x$ac_new_val"; then - { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 -echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 -echo "$as_me: former value: $ac_old_val" >&2;} - { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 -echo "$as_me: current value: $ac_new_val" >&2;} - ac_cache_corrupted=: - fi;; - esac - # Pass precious variables to config.status. - if test "$ac_new_set" = set; then - case $ac_new_val in - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) - ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; - *) ac_arg=$ac_var=$ac_new_val ;; - esac - case " $ac_configure_args " in - *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. - *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; - esac - fi -done -if $ac_cache_corrupted; then - { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 -echo "$as_me: error: changes in the environment can compromise the build" >&2;} - { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 -echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} - { (exit 1); exit 1; }; } -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - - - - - - - - - - - - - - - - - - - - -#-------------------------------------------------------------------- -# Use config.guess, config.sub and install-sh provided by gnustep-make -#-------------------------------------------------------------------- -ac_aux_dir= -for ac_dir in $GNUSTEP_MAKEFILES $srcdir/$GNUSTEP_MAKEFILES; do - if test -f $ac_dir/install-sh; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install-sh -c" - break - elif test -f $ac_dir/install.sh; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install.sh -c" - break - elif test -f $ac_dir/shtool; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/shtool install -c" - break - fi -done -if test -z "$ac_aux_dir"; then - { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $GNUSTEP_MAKEFILES $srcdir/$GNUSTEP_MAKEFILES" >&5 -echo "$as_me: error: cannot find install-sh or install.sh in $GNUSTEP_MAKEFILES $srcdir/$GNUSTEP_MAKEFILES" >&2;} - { (exit 1); exit 1; }; } -fi -ac_config_guess="$SHELL $ac_aux_dir/config.guess" -ac_config_sub="$SHELL $ac_aux_dir/config.sub" -ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. - - -#-------------------------------------------------------------------- -# Determine the host, build, and target systems -#-------------------------------------------------------------------- -# Make sure we can run config.sub. -$ac_config_sub sun4 >/dev/null 2>&1 || - { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5 -echo "$as_me: error: cannot run $ac_config_sub" >&2;} - { (exit 1); exit 1; }; } - -echo "$as_me:$LINENO: checking build system type" >&5 -echo $ECHO_N "checking build system type... $ECHO_C" >&6 -if test "${ac_cv_build+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_build_alias=$build_alias -test -z "$ac_cv_build_alias" && - ac_cv_build_alias=`$ac_config_guess` -test -z "$ac_cv_build_alias" && - { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 -echo "$as_me: error: cannot guess build type; you must specify one" >&2;} - { (exit 1); exit 1; }; } -ac_cv_build=`$ac_config_sub $ac_cv_build_alias` || - { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5 -echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;} - { (exit 1); exit 1; }; } - -fi -echo "$as_me:$LINENO: result: $ac_cv_build" >&5 -echo "${ECHO_T}$ac_cv_build" >&6 -build=$ac_cv_build -build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` - - -echo "$as_me:$LINENO: checking host system type" >&5 -echo $ECHO_N "checking host system type... $ECHO_C" >&6 -if test "${ac_cv_host+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_host_alias=$host_alias -test -z "$ac_cv_host_alias" && - ac_cv_host_alias=$ac_cv_build_alias -ac_cv_host=`$ac_config_sub $ac_cv_host_alias` || - { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5 -echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;} - { (exit 1); exit 1; }; } - -fi -echo "$as_me:$LINENO: result: $ac_cv_host" >&5 -echo "${ECHO_T}$ac_cv_host" >&6 -host=$ac_cv_host -host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` - - -echo "$as_me:$LINENO: checking target system type" >&5 -echo $ECHO_N "checking target system type... $ECHO_C" >&6 -if test "${ac_cv_target+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_target_alias=$target_alias -test "x$ac_cv_target_alias" = "x" && - ac_cv_target_alias=$ac_cv_host_alias -ac_cv_target=`$ac_config_sub $ac_cv_target_alias` || - { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_target_alias failed" >&5 -echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;} - { (exit 1); exit 1; }; } - -fi -echo "$as_me:$LINENO: result: $ac_cv_target" >&5 -echo "${ECHO_T}$ac_cv_target" >&6 -target=$ac_cv_target -target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` - - -# The aliases save the names the user supplied, while $host etc. -# will get canonicalized. -test -n "$target_alias" && - test "$program_prefix$program_suffix$program_transform_name" = \ - NONENONEs,x,x, && - program_prefix=${target_alias}- - - -case "$target_cpu" in - alpha*) target_cpu=alpha;; - hppa*) target_cpu=hppa;; - i[3456]86*) target_cpu=i386;; - sparc64*) target_cpu=sparc64;; - sparc*) target_cpu=sparc;; -esac - -case "$target_os" in - freebsd*) target_os=freebsd;; - openbsd*) target_os=openbsd;; - darwin*) target_os=darwin;; -esac - - -if test -d $target_cpu -a "`echo $target_cpu/*`" != "$target_cpu/*" -then - my_dir=$target_cpu -else - echo '*************** Warning ****************' - echo The 'mframe' software has not been ported to $target_cpu. - echo Using information from unknown. - echo '****************************************' - my_dir=unknown -fi - -if test -f $my_dir/$target_os -then - my_path=$my_dir/$target_os - echo Using information from $my_path. -else - echo '*************** Warning ****************' - echo The 'mframe' software has not been ported to $target_cpu-$target_os. - echo Using information from $my_dir/generic. - echo '****************************************' - my_path=$my_dir/generic -fi - -rm -f mframe.h -echo "/***************** WARNING ****************" > mframe.h -echo "* DO NOT EDIT THIS FILE DIRECTLY - IT IS *" >> mframe.h -echo "* GENERATED AUTOMATICALLY BY THE CONFIG *" >> mframe.h -echo "* PROCESS IN THE 'mframe' SUBDIRECTORY. *" >> mframe.h -echo "****************** WARNING ***************/" >> mframe.h -cat mframe.head $my_path mframe.foot >> mframe.h - -cat >confcache <<\_ACEOF -# This file is a shell script that caches the results of configure -# tests run on this system so they can be shared between configure -# scripts and configure runs, see configure's option --config-cache. -# It is not useful on other systems. If it contains results you don't -# want to keep, you may remove or edit it. -# -# config.status only pays attention to the cache file if you give it -# the --recheck option to rerun configure. -# -# `ac_cv_env_foo' variables (set or unset) will be overridden when -# loading this file, other *unset* `ac_cv_foo' will be assigned the -# following values. - -_ACEOF - -# The following way of writing the cache mishandles newlines in values, -# but we know of no workaround that is simple, portable, and efficient. -# So, don't put newlines in cache variables' values. -# Ultrix sh set writes to stderr and can't be redirected directly, -# and sets the high bit in the cache file unless we assign to the vars. -{ - (set) 2>&1 | - case `(ac_space=' '; set | grep ac_space) 2>&1` in - *ac_space=\ *) - # `set' does not quote correctly, so add quotes (double-quote - # substitution turns \\\\ into \\, and sed turns \\ into \). - sed -n \ - "s/'/'\\\\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" - ;; - *) - # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n \ - "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" - ;; - esac; -} | - sed ' - t clear - : clear - s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ - t end - /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ - : end' >>confcache -if diff $cache_file confcache >/dev/null 2>&1; then :; else - if test -w $cache_file; then - test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" - cat confcache >$cache_file - else - echo "not updating unwritable cache $cache_file" - fi -fi -rm -f confcache - -test "x$prefix" = xNONE && prefix=$ac_default_prefix -# Let make expand exec_prefix. -test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' - -# VPATH may cause trouble with some makes, so we remove $(srcdir), -# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and -# trailing colons and then remove the whole line if VPATH becomes empty -# (actually we leave an empty line to preserve line numbers). -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=/{ -s/:*\$(srcdir):*/:/; -s/:*\${srcdir}:*/:/; -s/:*@srcdir@:*/:/; -s/^\([^=]*=[ ]*\):*/\1/; -s/:*$//; -s/^[^=]*=[ ]*$//; -}' -fi - -# Transform confdefs.h into DEFS. -# Protect against shell expansion while executing Makefile rules. -# Protect against Makefile macro expansion. -# -# If the first sed substitution is executed (which looks for macros that -# take arguments), then we branch to the quote section. Otherwise, -# look for a macro that doesn't take arguments. -cat >confdef2opt.sed <<\_ACEOF -t clear -: clear -s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g -t quote -s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g -t quote -d -: quote -s,[ `~#$^&*(){}\\|;'"<>?],\\&,g -s,\[,\\&,g -s,\],\\&,g -s,\$,$$,g -p -_ACEOF -# We use echo to avoid assuming a particular line-breaking character. -# The extra dot is to prevent the shell from consuming trailing -# line-breaks from the sub-command output. A line-break within -# single-quotes doesn't work because, if this script is created in a -# platform that uses two characters for line-breaks (e.g., DOS), tr -# would break. -ac_LF_and_DOT=`echo; echo .` -DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'` -rm -f confdef2opt.sed - - -ac_libobjs= -ac_ltlibobjs= -for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue - # 1. Remove the extension, and $U if already installed. - ac_i=`echo "$ac_i" | - sed 's/\$U\././;s/\.o$//;s/\.obj$//'` - # 2. Add them. - ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" - ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' -done -LIBOBJS=$ac_libobjs - -LTLIBOBJS=$ac_ltlibobjs - - - -: ${CONFIG_STATUS=./config.status} -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 -echo "$as_me: creating $CONFIG_STATUS" >&6;} -cat >$CONFIG_STATUS <<_ACEOF -#! $SHELL -# Generated by $as_me. -# Run this file to recreate the current configuration. -# Compiler output produced by configure, useful for debugging -# configure, is in config.log if it exists. - -debug=false -ac_cs_recheck=false -ac_cs_silent=false -SHELL=\${CONFIG_SHELL-$SHELL} -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF -## --------------------- ## -## M4sh Initialization. ## -## --------------------- ## - -# Be Bourne compatible -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' -elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then - set -o posix -fi -DUALCASE=1; export DUALCASE # for MKS sh - -# Support unset when possible. -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - as_unset=unset -else - as_unset=false -fi - - -# Work around bugs in pre-3.0 UWIN ksh. -$as_unset ENV MAIL MAILPATH -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -for as_var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME -do - if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then - eval $as_var=C; export $as_var - else - $as_unset $as_var - fi -done - -# Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1; then - as_expr=expr -else - as_expr=false -fi - -if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - - -# Name of the executable. -as_me=`$as_basename "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)$' \| \ - . : '\(.\)' 2>/dev/null || -echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } - /^X\/\(\/\/\)$/{ s//\1/; q; } - /^X\/\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - - -# PATH needs CR, and LINENO needs CR and PATH. -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh -fi - - - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" || { - # Find who we are. Look in the path if we contain no path at all - # relative or not. - case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done - - ;; - esac - # We did not find ourselves, most probably we were run as `sh COMMAND' - # in which case we are not to be found in the path. - if test "x$as_myself" = x; then - as_myself=$0 - fi - if test ! -f "$as_myself"; then - { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 -echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} - { (exit 1); exit 1; }; } - fi - case $CONFIG_SHELL in - '') - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for as_base in sh bash ksh sh5; do - case $as_dir in - /*) - if ("$as_dir/$as_base" -c ' - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then - $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } - $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } - CONFIG_SHELL=$as_dir/$as_base - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$0" ${1+"$@"} - fi;; - esac - done -done -;; - esac - - # Create $as_me.lineno as a copy of $as_myself, but with $LINENO - # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line before each line; the second 'sed' does the real - # work. The second script uses 'N' to pair each line-number line - # with the numbered line, and appends trailing '-' during - # substitution so that $LINENO is not a special case at line end. - # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) - sed '=' <$as_myself | - sed ' - N - s,$,-, - : loop - s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, - t loop - s,-$,, - s,^['$as_cr_digits']*\n,, - ' >$as_me.lineno && - chmod +x $as_me.lineno || - { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 -echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} - { (exit 1); exit 1; }; } - - # Don't try to exec as it changes $[0], causing all sort of problems - # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensible to this). - . ./$as_me.lineno - # Exit status is that of the last command. - exit -} - - -case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in - *c*,-n*) ECHO_N= ECHO_C=' -' ECHO_T=' ' ;; - *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; - *) ECHO_N= ECHO_C='\c' ECHO_T= ;; -esac - -if expr a : '\(a\)' >/dev/null 2>&1; then - as_expr=expr -else - as_expr=false -fi - -rm -f conf$$ conf$$.exe conf$$.file -echo >conf$$.file -if ln -s conf$$.file conf$$ 2>/dev/null; then - # We could just check for DJGPP; but this test a) works b) is more generic - # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). - if test -f conf$$.exe; then - # Don't use ln at all; we don't have any links - as_ln_s='cp -p' - else - as_ln_s='ln -s' - fi -elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln -else - as_ln_s='cp -p' -fi -rm -f conf$$ conf$$.exe conf$$.file - -if mkdir -p . 2>/dev/null; then - as_mkdir_p=: -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - -as_executable_p="test -f" - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - - -# IFS -# We need space, tab and new line, in precisely that order. -as_nl=' -' -IFS=" $as_nl" - -# CDPATH. -$as_unset CDPATH - -exec 6>&1 - -# Open the log real soon, to keep \$[0] and so on meaningful, and to -# report actual input values of CONFIG_FILES etc. instead of their -# values after options handling. Logging --version etc. is OK. -exec 5>>config.log -{ - echo - sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX -## Running $as_me. ## -_ASBOX -} >&5 -cat >&5 <<_CSEOF - -This file was extended by $as_me, which was -generated by GNU Autoconf 2.59. Invocation command line was - - CONFIG_FILES = $CONFIG_FILES - CONFIG_HEADERS = $CONFIG_HEADERS - CONFIG_LINKS = $CONFIG_LINKS - CONFIG_COMMANDS = $CONFIG_COMMANDS - $ $0 $@ - -_CSEOF -echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 -echo >&5 -_ACEOF - -# Files that config.status was made for. -if test -n "$ac_config_files"; then - echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS -fi - -if test -n "$ac_config_headers"; then - echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS -fi - -if test -n "$ac_config_links"; then - echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS -fi - -if test -n "$ac_config_commands"; then - echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS -fi - -cat >>$CONFIG_STATUS <<\_ACEOF - -ac_cs_usage="\ -\`$as_me' instantiates files from templates according to the -current configuration. - -Usage: $0 [OPTIONS] [FILE]... - - -h, --help print this help, then exit - -V, --version print version number, then exit - -q, --quiet do not print progress messages - -d, --debug don't remove temporary files - --recheck update $as_me by reconfiguring in the same conditions - -Report bugs to ." -_ACEOF - -cat >>$CONFIG_STATUS <<_ACEOF -ac_cs_version="\\ -config.status -configured by $0, generated by GNU Autoconf 2.59, - with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" - -Copyright (C) 2003 Free Software Foundation, Inc. -This config.status script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it." -srcdir=$srcdir -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF -# If no file are specified by the user, then we need to provide default -# value. By we need to know if files were specified by the user. -ac_need_defaults=: -while test $# != 0 -do - case $1 in - --*=*) - ac_option=`expr "x$1" : 'x\([^=]*\)='` - ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` - ac_shift=: - ;; - -*) - ac_option=$1 - ac_optarg=$2 - ac_shift=shift - ;; - *) # This is not an option, so the user has probably given explicit - # arguments. - ac_option=$1 - ac_need_defaults=false;; - esac - - case $ac_option in - # Handling of the options. -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF - -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - ac_cs_recheck=: ;; - --version | --vers* | -V ) - echo "$ac_cs_version"; exit 0 ;; - --he | --h) - # Conflict between --help and --header - { { echo "$as_me:$LINENO: error: ambiguous option: $1 -Try \`$0 --help' for more information." >&5 -echo "$as_me: error: ambiguous option: $1 -Try \`$0 --help' for more information." >&2;} - { (exit 1); exit 1; }; };; - --help | --hel | -h ) - echo "$ac_cs_usage"; exit 0 ;; - --debug | --d* | -d ) - debug=: ;; - --file | --fil | --fi | --f ) - $ac_shift - CONFIG_FILES="$CONFIG_FILES $ac_optarg" - ac_need_defaults=false;; - --header | --heade | --head | --hea ) - $ac_shift - CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" - ac_need_defaults=false;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil | --si | --s) - ac_cs_silent=: ;; - - # This is an error. - -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&5 -echo "$as_me: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&2;} - { (exit 1); exit 1; }; } ;; - - *) ac_config_targets="$ac_config_targets $1" ;; - - esac - shift -done - -ac_configure_extra_args= - -if $ac_cs_silent; then - exec 6>/dev/null - ac_configure_extra_args="$ac_configure_extra_args --silent" -fi - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF -if \$ac_cs_recheck; then - echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 - exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion -fi - -_ACEOF - - - - - - -cat >>$CONFIG_STATUS <<\_ACEOF - -{ (exit 0); exit 0; } -_ACEOF -chmod +x $CONFIG_STATUS -ac_clean_files=$ac_clean_files_save - - -# configure is writing to config.log, and then calls config.status. -# config.status does its own redirection, appending to config.log. -# Unfortunately, on DOS this fails, as config.log is still kept open -# by configure, so config.status won't be able to write to it; its -# output is simply discarded. So we exec the FD to /dev/null, -# effectively closing config.log, so it can be properly (re)opened and -# appended to by config.status. When coming back to configure, we -# need to make the FD available again. -if test "$no_create" != yes; then - ac_cs_success=: - ac_config_status_args= - test "$silent" = yes && - ac_config_status_args="$ac_config_status_args --quiet" - exec 5>/dev/null - $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false - exec 5>>config.log - # Use ||, not &&, to avoid exiting from the if with $? = 1, which - # would make configure fail if this is the last instruction. - $ac_cs_success || { (exit 1); exit 1; } -fi - diff --git a/Source/mframe/configure.ac b/Source/mframe/configure.ac deleted file mode 100644 index 5e92bfec7..000000000 --- a/Source/mframe/configure.ac +++ /dev/null @@ -1,84 +0,0 @@ -# configure.in for mframe software -# Process this file with autoconf to produce a configure script. -# -# Copyright (C) 1998 Free Software Foundation, Inc. -# -# Written by: Richard Frith-Macdonald -# -# This file is part of the GNUstep project -# -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 2 of the License, or (at your option) any later version. -# -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Library General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free -# Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA. -AC_INIT -AC_CONFIG_SRCDIR([mframe.head]) - -#-------------------------------------------------------------------- -# Use config.guess, config.sub and install-sh provided by gnustep-make -#-------------------------------------------------------------------- -AC_CONFIG_AUX_DIR($GNUSTEP_MAKEFILES) - -#-------------------------------------------------------------------- -# Determine the host, build, and target systems -#-------------------------------------------------------------------- -AC_CANONICAL_TARGET([]) - -dnl Checking CPU and Operating-System information for mframe.h - -case "$target_cpu" in - alpha*) target_cpu=alpha;; - hppa*) target_cpu=hppa;; - i[[3456]]86*) target_cpu=i386;; - sparc64*) target_cpu=sparc64;; - sparc*) target_cpu=sparc;; -esac - -case "$target_os" in - freebsd*) target_os=freebsd;; - openbsd*) target_os=openbsd;; - darwin*) target_os=darwin;; -esac - - -if test -d $target_cpu -a "`echo $target_cpu/*`" != "$target_cpu/*" -then - my_dir=$target_cpu -else - echo '*************** Warning ****************' - echo The 'mframe' software has not been ported to $target_cpu. - echo Using information from unknown. - echo '****************************************' - my_dir=unknown -fi - -if test -f $my_dir/$target_os -then - my_path=$my_dir/$target_os - echo Using information from $my_path. -else - echo '*************** Warning ****************' - echo The 'mframe' software has not been ported to $target_cpu-$target_os. - echo Using information from $my_dir/generic. - echo '****************************************' - my_path=$my_dir/generic -fi - -rm -f mframe.h -echo "/***************** WARNING ****************" > mframe.h -echo "* DO NOT EDIT THIS FILE DIRECTLY - IT IS *" >> mframe.h -echo "* GENERATED AUTOMATICALLY BY THE CONFIG *" >> mframe.h -echo "* PROCESS IN THE 'mframe' SUBDIRECTORY. *" >> mframe.h -echo "****************** WARNING ***************/" >> mframe.h -cat mframe.head $my_path mframe.foot >> mframe.h - -AC_OUTPUT diff --git a/Source/mframe/hppa/generic b/Source/mframe/hppa/generic deleted file mode 100644 index 32a98bbc9..000000000 --- a/Source/mframe/hppa/generic +++ /dev/null @@ -1,56 +0,0 @@ -/* See ../README for copyright */ - -#define MFRAME_STACK_STRUCT 1 -#define MFRAME_STRUCT_BYREF 1 -#define MFRAME_SMALL_STRUCT 8 -#define MFRAME_ARGS_SIZE 56 -#define MFRAME_RESULT_SIZE 16 - -#define MFRAME_GET_STRUCT_ADDR(ARGS, TYPES) \ -((*(TYPES)==_C_STRUCT_B || *(TYPES)==_C_UNION_B || *(TYPES)==_C_ARY_B) ? \ - **(void***)(ARGS) : (void*)0) - -#define MFRAME_SET_STRUCT_ADDR(ARGS, TYPES, ADDR) \ -({if (*(TYPES)==_C_STRUCT_B || *(TYPES)==_C_UNION_B || *(TYPES)==_C_ARY_B) \ - **(void***)(ARGS) = (ADDR);}) - -#define MFRAME_ARGS int - -#define MFRAME_INIT_ARGS(CUM, RTYPE) \ -((CUM) = (*(RTYPE)==_C_STRUCT_B || *(RTYPE)==_C_UNION_B || \ - *(RTYPE)==_C_ARY_B) ? sizeof(void*) : 0) - -#define MFRAME_ARG_ENCODING(CUM, TYPE, STACK, DEST) \ -({ \ - const char* type = (TYPE); \ - int align = objc_alignof_type(type); \ - int size = objc_sizeof_type(type); \ -\ - (CUM) = ROUND((CUM), align); \ - (TYPE) = objc_skip_typespec(type); \ - sprintf((DEST), "%.*s%d", (TYPE)-type, type, (CUM)); \ - if (*(TYPE) == '+') \ - { \ - (TYPE)++; \ - } \ - if (*(TYPE) == '-') \ - { \ - (TYPE)++; \ - } \ - while (isdigit(*(TYPE))) \ - { \ - (TYPE)++; \ - } \ - (DEST)=&(DEST)[strlen(DEST)]; \ - if ((*type==_C_STRUCT_B || *type==_C_UNION_B || *type==_C_ARY_B)) \ - { \ - (STACK) = (CUM) + ROUND(size, align); \ - } \ - else \ - { \ - (STACK) = (CUM) + size; \ - } \ - ((((CUM) & 01) && ((size+3)/4) > 1) && (CUM)++); \ - (CUM) += ((size+3)/4); \ -}) - diff --git a/Source/mframe/i386/freebsd b/Source/mframe/i386/freebsd deleted file mode 100644 index 60955cfad..000000000 --- a/Source/mframe/i386/freebsd +++ /dev/null @@ -1,51 +0,0 @@ -/* See ../README for copyright */ - -#define MFRAME_STACK_STRUCT 0 -#define MFRAME_STRUCT_BYREF 0 -#define MFRAME_SMALL_STRUCT 0 -#define MFRAME_ARGS_SIZE 8 -#define MFRAME_RESULT_SIZE 116 - -#define MFRAME_GET_STRUCT_ADDR(ARGS, TYPES) \ -((*(TYPES)==_C_STRUCT_B || *(TYPES)==_C_UNION_B || *(TYPES)==_C_ARY_B) ? \ - *(void**)((ARGS)->arg_regs + sizeof(void*)) : (void*)0) - -#define MFRAME_SET_STRUCT_ADDR(ARGS, TYPES, ADDR) \ -({if (*(TYPES)==_C_STRUCT_B || *(TYPES)==_C_UNION_B || *(TYPES)==_C_ARY_B) \ - *(void**)((ARGS)->arg_regs + sizeof(void*)) = (ADDR);}) - -#define MFRAME_ARGS int - -#define MFRAME_INIT_ARGS(CUM, RTYPE) ((CUM) = 0) - -#define MFRAME_ARG_ENCODING(CUM, TYPE, STACK, DEST) \ -({ \ - const char* type = (TYPE); \ - int align = objc_alignof_type(type); \ - int size = objc_sizeof_type(type); \ -\ - (TYPE) = objc_skip_typespec(type); \ - (CUM) = ROUND((CUM), __alignof__(int)); \ - sprintf((DEST), "%.*s%d", (TYPE)-type, type, (CUM)); \ - if (*(TYPE) == '+') (TYPE)++; \ - if (*(TYPE) == '-') (TYPE)++; \ - while (isdigit(*(TYPE))) \ - { \ - (TYPE)++; \ - } \ - (DEST)=&(DEST)[strlen(DEST)]; \ - if ((*type==_C_STRUCT_B||*type==_C_UNION_B||*type==_C_ARY_B)) \ - { \ - (STACK) = (CUM) + ROUND(size, align); \ - } \ - else \ - { \ - if (size < sizeof(int)) \ - { \ - size = sizeof(int); \ - } \ - (STACK) = (CUM) + size; \ - } \ - (CUM) += size; \ -}) - diff --git a/Source/mframe/i386/generic b/Source/mframe/i386/generic deleted file mode 100644 index 60955cfad..000000000 --- a/Source/mframe/i386/generic +++ /dev/null @@ -1,51 +0,0 @@ -/* See ../README for copyright */ - -#define MFRAME_STACK_STRUCT 0 -#define MFRAME_STRUCT_BYREF 0 -#define MFRAME_SMALL_STRUCT 0 -#define MFRAME_ARGS_SIZE 8 -#define MFRAME_RESULT_SIZE 116 - -#define MFRAME_GET_STRUCT_ADDR(ARGS, TYPES) \ -((*(TYPES)==_C_STRUCT_B || *(TYPES)==_C_UNION_B || *(TYPES)==_C_ARY_B) ? \ - *(void**)((ARGS)->arg_regs + sizeof(void*)) : (void*)0) - -#define MFRAME_SET_STRUCT_ADDR(ARGS, TYPES, ADDR) \ -({if (*(TYPES)==_C_STRUCT_B || *(TYPES)==_C_UNION_B || *(TYPES)==_C_ARY_B) \ - *(void**)((ARGS)->arg_regs + sizeof(void*)) = (ADDR);}) - -#define MFRAME_ARGS int - -#define MFRAME_INIT_ARGS(CUM, RTYPE) ((CUM) = 0) - -#define MFRAME_ARG_ENCODING(CUM, TYPE, STACK, DEST) \ -({ \ - const char* type = (TYPE); \ - int align = objc_alignof_type(type); \ - int size = objc_sizeof_type(type); \ -\ - (TYPE) = objc_skip_typespec(type); \ - (CUM) = ROUND((CUM), __alignof__(int)); \ - sprintf((DEST), "%.*s%d", (TYPE)-type, type, (CUM)); \ - if (*(TYPE) == '+') (TYPE)++; \ - if (*(TYPE) == '-') (TYPE)++; \ - while (isdigit(*(TYPE))) \ - { \ - (TYPE)++; \ - } \ - (DEST)=&(DEST)[strlen(DEST)]; \ - if ((*type==_C_STRUCT_B||*type==_C_UNION_B||*type==_C_ARY_B)) \ - { \ - (STACK) = (CUM) + ROUND(size, align); \ - } \ - else \ - { \ - if (size < sizeof(int)) \ - { \ - size = sizeof(int); \ - } \ - (STACK) = (CUM) + size; \ - } \ - (CUM) += size; \ -}) - diff --git a/Source/mframe/i386/linux b/Source/mframe/i386/linux deleted file mode 100644 index 51c085977..000000000 --- a/Source/mframe/i386/linux +++ /dev/null @@ -1,51 +0,0 @@ -/* See ../README for copyright */ - -#define MFRAME_STACK_STRUCT 1 -#define MFRAME_STRUCT_BYREF 0 -#define MFRAME_SMALL_STRUCT 0 -#define MFRAME_ARGS_SIZE 8 -#define MFRAME_RESULT_SIZE 116 - -#define MFRAME_GET_STRUCT_ADDR(ARGS, TYPES) \ -((*(TYPES)==_C_STRUCT_B || *(TYPES)==_C_UNION_B || *(TYPES)==_C_ARY_B) ? \ - *(void**)(ARGS)->arg_ptr : (void*)0) - -#define MFRAME_SET_STRUCT_ADDR(ARGS, TYPES, ADDR) \ -({if (*(TYPES)==_C_STRUCT_B || *(TYPES)==_C_UNION_B || *(TYPES)==_C_ARY_B) \ - *(void**)(ARGS)->arg_ptr = (ADDR);}) - -#define MFRAME_ARGS int - -#define MFRAME_INIT_ARGS(CUM, RTYPE) ((CUM) = 0) - -#define MFRAME_ARG_ENCODING(CUM, TYPE, STACK, DEST) \ -({ \ - const char* type = (TYPE); \ - int align = objc_alignof_type(type); \ - int size = objc_sizeof_type(type); \ -\ - (TYPE) = objc_skip_typespec(type); \ - (CUM) = ROUND((CUM), __alignof__(int)); \ - sprintf((DEST), "%.*s%d", (TYPE)-type, type, (CUM)); \ - if (*(TYPE) == '+') (TYPE)++; \ - if (*(TYPE) == '-') (TYPE)++; \ - while (isdigit(*(TYPE))) \ - { \ - (TYPE)++; \ - } \ - (DEST)=&(DEST)[strlen(DEST)]; \ - if ((*type==_C_STRUCT_B||*type==_C_UNION_B||*type==_C_ARY_B)) \ - { \ - (STACK) = (CUM) + ROUND(size, align); \ - } \ - else \ - { \ - if (size < sizeof(int)) \ - { \ - size = sizeof(int); \ - } \ - (STACK) = (CUM) + size; \ - } \ - (CUM) += size; \ -}) - diff --git a/Source/mframe/i386/linux-gnu b/Source/mframe/i386/linux-gnu deleted file mode 100644 index 51c085977..000000000 --- a/Source/mframe/i386/linux-gnu +++ /dev/null @@ -1,51 +0,0 @@ -/* See ../README for copyright */ - -#define MFRAME_STACK_STRUCT 1 -#define MFRAME_STRUCT_BYREF 0 -#define MFRAME_SMALL_STRUCT 0 -#define MFRAME_ARGS_SIZE 8 -#define MFRAME_RESULT_SIZE 116 - -#define MFRAME_GET_STRUCT_ADDR(ARGS, TYPES) \ -((*(TYPES)==_C_STRUCT_B || *(TYPES)==_C_UNION_B || *(TYPES)==_C_ARY_B) ? \ - *(void**)(ARGS)->arg_ptr : (void*)0) - -#define MFRAME_SET_STRUCT_ADDR(ARGS, TYPES, ADDR) \ -({if (*(TYPES)==_C_STRUCT_B || *(TYPES)==_C_UNION_B || *(TYPES)==_C_ARY_B) \ - *(void**)(ARGS)->arg_ptr = (ADDR);}) - -#define MFRAME_ARGS int - -#define MFRAME_INIT_ARGS(CUM, RTYPE) ((CUM) = 0) - -#define MFRAME_ARG_ENCODING(CUM, TYPE, STACK, DEST) \ -({ \ - const char* type = (TYPE); \ - int align = objc_alignof_type(type); \ - int size = objc_sizeof_type(type); \ -\ - (TYPE) = objc_skip_typespec(type); \ - (CUM) = ROUND((CUM), __alignof__(int)); \ - sprintf((DEST), "%.*s%d", (TYPE)-type, type, (CUM)); \ - if (*(TYPE) == '+') (TYPE)++; \ - if (*(TYPE) == '-') (TYPE)++; \ - while (isdigit(*(TYPE))) \ - { \ - (TYPE)++; \ - } \ - (DEST)=&(DEST)[strlen(DEST)]; \ - if ((*type==_C_STRUCT_B||*type==_C_UNION_B||*type==_C_ARY_B)) \ - { \ - (STACK) = (CUM) + ROUND(size, align); \ - } \ - else \ - { \ - if (size < sizeof(int)) \ - { \ - size = sizeof(int); \ - } \ - (STACK) = (CUM) + size; \ - } \ - (CUM) += size; \ -}) - diff --git a/Source/mframe/i386/openbsd b/Source/mframe/i386/openbsd deleted file mode 100644 index 60955cfad..000000000 --- a/Source/mframe/i386/openbsd +++ /dev/null @@ -1,51 +0,0 @@ -/* See ../README for copyright */ - -#define MFRAME_STACK_STRUCT 0 -#define MFRAME_STRUCT_BYREF 0 -#define MFRAME_SMALL_STRUCT 0 -#define MFRAME_ARGS_SIZE 8 -#define MFRAME_RESULT_SIZE 116 - -#define MFRAME_GET_STRUCT_ADDR(ARGS, TYPES) \ -((*(TYPES)==_C_STRUCT_B || *(TYPES)==_C_UNION_B || *(TYPES)==_C_ARY_B) ? \ - *(void**)((ARGS)->arg_regs + sizeof(void*)) : (void*)0) - -#define MFRAME_SET_STRUCT_ADDR(ARGS, TYPES, ADDR) \ -({if (*(TYPES)==_C_STRUCT_B || *(TYPES)==_C_UNION_B || *(TYPES)==_C_ARY_B) \ - *(void**)((ARGS)->arg_regs + sizeof(void*)) = (ADDR);}) - -#define MFRAME_ARGS int - -#define MFRAME_INIT_ARGS(CUM, RTYPE) ((CUM) = 0) - -#define MFRAME_ARG_ENCODING(CUM, TYPE, STACK, DEST) \ -({ \ - const char* type = (TYPE); \ - int align = objc_alignof_type(type); \ - int size = objc_sizeof_type(type); \ -\ - (TYPE) = objc_skip_typespec(type); \ - (CUM) = ROUND((CUM), __alignof__(int)); \ - sprintf((DEST), "%.*s%d", (TYPE)-type, type, (CUM)); \ - if (*(TYPE) == '+') (TYPE)++; \ - if (*(TYPE) == '-') (TYPE)++; \ - while (isdigit(*(TYPE))) \ - { \ - (TYPE)++; \ - } \ - (DEST)=&(DEST)[strlen(DEST)]; \ - if ((*type==_C_STRUCT_B||*type==_C_UNION_B||*type==_C_ARY_B)) \ - { \ - (STACK) = (CUM) + ROUND(size, align); \ - } \ - else \ - { \ - if (size < sizeof(int)) \ - { \ - size = sizeof(int); \ - } \ - (STACK) = (CUM) + size; \ - } \ - (CUM) += size; \ -}) - diff --git a/Source/mframe/i386/sysv4.2MP b/Source/mframe/i386/sysv4.2MP deleted file mode 100644 index c813374f6..000000000 --- a/Source/mframe/i386/sysv4.2MP +++ /dev/null @@ -1,51 +0,0 @@ -/* See ../README for copyright */ - -#define MFRAME_STACK_STRUCT 0 -#define MFRAME_STRUCT_BYREF 0 -#define MFRAME_SMALL_STRUCT 0 -#define MFRAME_ARGS_SIZE 8 -#define MFRAME_RESULT_SIZE 116 - -#define MFRAME_GET_STRUCT_ADDR(ARGS, TYPES) \ -((*(TYPES)==_C_STRUCT_B || *(TYPES)==_C_UNION_B || *(TYPES)==_C_ARY_B) ? \ - *(void**)(ARGS)->arg_ptr : (void*)0) - -#define MFRAME_SET_STRUCT_ADDR(ARGS, TYPES, ADDR) \ -({if (*(TYPES)==_C_STRUCT_B || *(TYPES)==_C_UNION_B || *(TYPES)==_C_ARY_B) \ - *(void**)(ARGS)->arg_ptr = (ADDR);}) - -#define MFRAME_ARGS int - -#define MFRAME_INIT_ARGS(CUM, RTYPE) ((CUM) = 0) - -#define MFRAME_ARG_ENCODING(CUM, TYPE, STACK, DEST) \ -({ \ - const char* type = (TYPE); \ - int align = objc_alignof_type(type); \ - int size = objc_sizeof_type(type); \ -\ - (TYPE) = objc_skip_typespec(type); \ - (CUM) = ROUND((CUM), __alignof__(int)); \ - sprintf((DEST), "%.*s%d", (TYPE)-type, type, (CUM)); \ - if (*(TYPE) == '+') (TYPE)++; \ - if (*(TYPE) == '-') (TYPE)++; \ - while (isdigit(*(TYPE))) \ - { \ - (TYPE)++; \ - } \ - (DEST)=&(DEST)[strlen(DEST)]; \ - if ((*type==_C_STRUCT_B||*type==_C_UNION_B||*type==_C_ARY_B)) \ - { \ - (STACK) = (CUM) + ROUND(size, align); \ - } \ - else \ - { \ - if (size < sizeof(int)) \ - { \ - size = sizeof(int); \ - } \ - (STACK) = (CUM) + size; \ - } \ - (CUM) += size; \ -}) - diff --git a/Source/mframe/i386/sysv4.2uw2.1.3 b/Source/mframe/i386/sysv4.2uw2.1.3 deleted file mode 100644 index c813374f6..000000000 --- a/Source/mframe/i386/sysv4.2uw2.1.3 +++ /dev/null @@ -1,51 +0,0 @@ -/* See ../README for copyright */ - -#define MFRAME_STACK_STRUCT 0 -#define MFRAME_STRUCT_BYREF 0 -#define MFRAME_SMALL_STRUCT 0 -#define MFRAME_ARGS_SIZE 8 -#define MFRAME_RESULT_SIZE 116 - -#define MFRAME_GET_STRUCT_ADDR(ARGS, TYPES) \ -((*(TYPES)==_C_STRUCT_B || *(TYPES)==_C_UNION_B || *(TYPES)==_C_ARY_B) ? \ - *(void**)(ARGS)->arg_ptr : (void*)0) - -#define MFRAME_SET_STRUCT_ADDR(ARGS, TYPES, ADDR) \ -({if (*(TYPES)==_C_STRUCT_B || *(TYPES)==_C_UNION_B || *(TYPES)==_C_ARY_B) \ - *(void**)(ARGS)->arg_ptr = (ADDR);}) - -#define MFRAME_ARGS int - -#define MFRAME_INIT_ARGS(CUM, RTYPE) ((CUM) = 0) - -#define MFRAME_ARG_ENCODING(CUM, TYPE, STACK, DEST) \ -({ \ - const char* type = (TYPE); \ - int align = objc_alignof_type(type); \ - int size = objc_sizeof_type(type); \ -\ - (TYPE) = objc_skip_typespec(type); \ - (CUM) = ROUND((CUM), __alignof__(int)); \ - sprintf((DEST), "%.*s%d", (TYPE)-type, type, (CUM)); \ - if (*(TYPE) == '+') (TYPE)++; \ - if (*(TYPE) == '-') (TYPE)++; \ - while (isdigit(*(TYPE))) \ - { \ - (TYPE)++; \ - } \ - (DEST)=&(DEST)[strlen(DEST)]; \ - if ((*type==_C_STRUCT_B||*type==_C_UNION_B||*type==_C_ARY_B)) \ - { \ - (STACK) = (CUM) + ROUND(size, align); \ - } \ - else \ - { \ - if (size < sizeof(int)) \ - { \ - size = sizeof(int); \ - } \ - (STACK) = (CUM) + size; \ - } \ - (CUM) += size; \ -}) - diff --git a/Source/mframe/mframe.foot b/Source/mframe/mframe.foot deleted file mode 100644 index ba8f5d49c..000000000 --- a/Source/mframe/mframe.foot +++ /dev/null @@ -1,101 +0,0 @@ - -inline static void* -mframe_arg_addr(arglist_t argf, NSArgumentInfo *info) -{ - int offset = info->offset; -#if WORDS_BIGENDIAN - if (info->size < sizeof(int)) - { - offset += sizeof(int) - info->size; - } -#endif -#if NeXT_RUNTIME - return marg_getRef(argf, offset, void); -#else - if (info->isReg) - { - return(argf->arg_regs + offset); - } - else - { - return(argf->arg_ptr + offset); - } -#endif -} - -inline static void -mframe_get_arg(arglist_t argf, NSArgumentInfo *info, void* buffer) -{ -#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 - * to copy the actual structure, rather than it's pointer. - */ - if (*typ == _C_STRUCT_B || *typ == _C_UNION_B || *typ == _C_ARY_B) - { - memcpy(buffer, *(void**)mframe_arg_addr(argf, info), info->size); - } - else -#endif -#if MFRAME_FLT_IN_FRAME_AS_DBL - if (*typ == _C_FLT) - { - *(float*)buffer = (float)*(double*)mframe_arg_addr(argf, info); - } - else -#endif - memcpy(buffer, mframe_arg_addr(argf, info), info->size); -} - -inline static void -mframe_set_arg(arglist_t argf, NSArgumentInfo *info, void* buffer) -{ -#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 - * to copy a pointer onto the stack rather than the actual structure. - */ - if (*typ == _C_STRUCT_B || *typ == _C_UNION_B || *typ == _C_ARY_B) - { - memcpy(mframe_arg_addr(argf, info), &buffer, sizeof(void*)); - } - else -#endif -#if MFRAME_FLT_IN_FRAME_AS_DBL - if (*typ == _C_FLT) - { - *(double*)mframe_arg_addr(argf, info) = *(float*)buffer; - } - else -#endif - memcpy(mframe_arg_addr(argf, info), buffer, info->size); -} - -inline static void -mframe_cpy_arg(arglist_t dst, arglist_t src, NSArgumentInfo *info) -{ -#if MFRAME_STRUCT_BYREF - const char *typ = info->type; - - /* - * If structures are passed in the stack frame by reference - we need - * to copy a pointer onto the stack rather than the actual structure. - */ - if (*typ == _C_STRUCT_B || *typ == _C_UNION_B || *typ == _C_ARY_B) - { - memcpy(mframe_arg_addr(dst, info), mframe_arg_addr(src, info), sizeof(void*)); - } - else -#endif - memcpy(mframe_arg_addr(dst, info), mframe_arg_addr(src, info), info->size); -} - -#endif /* __mframe_h_GNUSTEP_BASE_INCLUDE */ diff --git a/Source/mframe/mframe.head b/Source/mframe/mframe.head deleted file mode 100644 index a9fd2ffbf..000000000 --- a/Source/mframe/mframe.head +++ /dev/null @@ -1,65 +0,0 @@ -/* Interface for functions that dissect/make method calls - Copyright (C) 1994, 1996, 1998 Free Software Foundation, Inc. - - Written by: Andrew Kachites McCallum - Created: Oct 1994 - - This file is part of the GNUstep Base Library. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free - Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02111 USA. - */ - -#ifndef __mframe_h_GNUSTEP_BASE_INCLUDE -#define __mframe_h_GNUSTEP_BASE_INCLUDE - -#include "GNUstepBase/preface.h" - -#ifdef HAVE_MALLOC_H -#include -#endif - -#include "GNUstepBase/DistributedObjects.h" - -/* For NSArgumentInfo we include NSMethodSignature.h */ -#include "Foundation/NSMethodSignature.h" - -#if NeXT_runtime -typedef union { - char *arg_ptr; - char arg_regs[sizeof (char*)]; -} *arglist_t; -#endif - -/* - * Step through method encoding information extracting details. - */ -const char * -mframe_next_arg(const char *typePtr, NSArgumentInfo *info, char *outTypes); - -/* - * Generate method encoding with stack/register offsets from a simple - * type encoding string. Store results in 'buf' or allocate memory - * using objc_malloc() if 'buf' is a nul pointer. - */ -char* -mframe_build_signature(const char *typePtr, int *size, int *narg, char *buf); - - -#define ROUND(V, A) \ - ({ typeof(V) __v=(V); typeof(A) __a=(A); \ - __a*((__v+__a-1)/__a); }) - - diff --git a/Source/mframe/powerpc/darwin b/Source/mframe/powerpc/darwin deleted file mode 100644 index e4aa6ee43..000000000 --- a/Source/mframe/powerpc/darwin +++ /dev/null @@ -1,121 +0,0 @@ -/* See ../README for copyright */ - -/* - * The first eight words of non-FP are in registers (offset 4 in frame). - * The first 13 FP args are in registers (offset 40 in frame). - * If the method returns a structure, it's address is passed as an invisible - * first argument, so only seven words of non-FP are passed in the registers. - * Structures are always passed by reference. - * Floats are placed in the frame as doubles. - */ - -#define MFRAME_STRUCT_BYREF 0 -#define MFRAME_SMALL_STRUCT 0 -#define MFRAME_ARGS_SIZE 144 -#define MFRAME_RESULT_SIZE 16 -#define MFRAME_FLT_IN_FRAME_AS_DBL 1 - -/* - * Structures are passed by reference as an invisible first argument, so - * they go in the first register space for non-FP arguments - at offset 4. - */ -#define MFRAME_GET_STRUCT_ADDR(ARGS, TYPES) \ -((*(TYPES)==_C_STRUCT_B || *(TYPES)==_C_UNION_B || *(TYPES)==_C_ARY_B) ? \ - *(void**)(((char*)(ARGS))+4): (void*)0) - -#define MFRAME_SET_STRUCT_ADDR(ARGS, TYPES, ADDR) \ -({if (*(TYPES)==_C_STRUCT_B || *(TYPES)==_C_UNION_B || *(TYPES)==_C_ARY_B) \ - *(void**)(((char*)(ARGS))+4) = (ADDR);}) - -/* - * Typedef for structure to keep track of argument info while processing - * a method. - */ -typedef struct rs6000_args -{ - int int_args; /* Number of integer arguments so far. */ - int float_args; /* Number of FP arguments so far. */ - int regs_position; /* The current position for non-FP args. */ - int stack_position; /* The current position in the stack frame. */ -} MFRAME_ARGS; - - -/* - * Initialize a variable to keep track of argument info while processing a - * method. Keeps count of the number of arguments of each type seen and - * the current offset in the non-FP registers. This offset is adjusted - * to take account of an invisible first argument used to return structures. - */ - -#define MFRAME_INIT_ARGS(CUM, RTYPE) \ -({ \ - (CUM).int_args = 0; \ - (CUM).float_args = 0; \ - (CUM).stack_position = 0; \ - (CUM).regs_position = \ - ((*(RTYPE)==_C_STRUCT_B || *(RTYPE)==_C_UNION_B || *(RTYPE)==_C_ARY_B) ? \ - sizeof(void*) : 4); \ -}) - -#define MFRAME_ARG_ENCODING(CUM, TYPE, STACK, DEST) \ -({ \ - const char* type = (TYPE); \ -\ - (TYPE) = objc_skip_typespec(type); \ - if (*type == _C_FLT || *type == _C_DBL) \ - { \ - if (++(CUM).float_args > 13) \ - { \ - (CUM).stack_position += ROUND ((CUM).stack_position, \ - __alignof__(double)); \ - sprintf((DEST), "%.*s%d", (TYPE)-type, type, (CUM).stack_position); \ - (STACK) = ROUND ((CUM).stack_position, sizeof(double)); \ - } \ - else \ - { \ - sprintf((DEST), "%.*s+%d", (TYPE)-type, type, \ - 40 + sizeof (double) * ((CUM).float_args - 1)); \ - } \ - } \ - else \ - { \ - int align, size; \ -\ - if (*type == _C_STRUCT_B || *type == _C_UNION_B || *type == _C_ARY_B) \ - { \ - align = __alignof__(void*); \ - size = sizeof (void*); \ - } \ - else \ - { \ - align = __alignof__(int); \ - size = objc_sizeof_type (type); \ - } \ -\ - if (++(CUM).int_args > 8) \ - { \ - (CUM).stack_position += ROUND ((CUM).stack_position, align); \ - sprintf((DEST), "%.*s%d", (TYPE)-type, type, (CUM).stack_position); \ - (STACK) = ROUND ((CUM).stack_position, size); \ - } \ - else \ - { \ - (CUM).regs_position = ROUND((CUM).regs_position, align); \ - sprintf(dest, "%.*s+%d", (TYPE)-type, type, (CUM).regs_position); \ - (CUM).regs_position += ROUND (size, align); \ - } \ - } \ - (DEST)=&(DEST)[strlen(DEST)]; \ - if (*(TYPE) == '+') \ - { \ - (TYPE)++; \ - } \ - if (*(TYPE) == '-') \ - { \ - (TYPE)++; \ - } \ - while (isdigit(*(TYPE))) \ - { \ - (TYPE)++; \ - } \ -}) diff --git a/Source/mframe/powerpc/generic b/Source/mframe/powerpc/generic deleted file mode 100644 index 6465860a9..000000000 --- a/Source/mframe/powerpc/generic +++ /dev/null @@ -1,121 +0,0 @@ -/* See ../README for copyright */ - -/* - * The first eight words of non-FP are in registers (offset 4 in frame). - * The first 13 FP args are in registers (offset 40 in frame). - * If the method returns a structure, it's address is passed as an invisible - * first argument, so only seven words of non-FP are passed in the registers. - * Structures are always passed by reference. - * Floats are placed in the frame as doubles. - */ - -#define MFRAME_STRUCT_BYREF 1 -#define MFRAME_SMALL_STRUCT 0 -#define MFRAME_ARGS_SIZE 144 -#define MFRAME_RESULT_SIZE 16 -#define MFRAME_FLT_IN_FRAME_AS_DBL 1 - -/* - * Structures are passed by reference as an invisible first argument, so - * they go in the first register space for non-FP arguments - at offset 4. - */ -#define MFRAME_GET_STRUCT_ADDR(ARGS, TYPES) \ -((*(TYPES)==_C_STRUCT_B || *(TYPES)==_C_UNION_B || *(TYPES)==_C_ARY_B) ? \ - *(void**)(((char*)(ARGS))+4): (void*)0) - -#define MFRAME_SET_STRUCT_ADDR(ARGS, TYPES, ADDR) \ -({if (*(TYPES)==_C_STRUCT_B || *(TYPES)==_C_UNION_B || *(TYPES)==_C_ARY_B) \ - *(void**)(((char*)(ARGS))+4) = (ADDR);}) - -/* - * Typedef for structure to keep track of argument info while processing - * a method. - */ -typedef struct rs6000_args -{ - int int_args; /* Number of integer arguments so far. */ - int float_args; /* Number of FP arguments so far. */ - int regs_position; /* The current position for non-FP args. */ - int stack_position; /* The current position in the stack frame. */ -} MFRAME_ARGS; - - -/* - * Initialize a variable to keep track of argument info while processing a - * method. Keeps count of the number of arguments of each type seen and - * the current offset in the non-FP registers. This offset is adjusted - * to take account of an invisible first argument used to return structures. - */ - -#define MFRAME_INIT_ARGS(CUM, RTYPE) \ -({ \ - (CUM).int_args = 0; \ - (CUM).float_args = 0; \ - (CUM).stack_position = 0; \ - (CUM).regs_position = \ - ((*(RTYPE)==_C_STRUCT_B || *(RTYPE)==_C_UNION_B || *(RTYPE)==_C_ARY_B) ? \ - sizeof(void*) : 4); \ -}) - -#define MFRAME_ARG_ENCODING(CUM, TYPE, STACK, DEST) \ -({ \ - const char* type = (TYPE); \ -\ - (TYPE) = objc_skip_typespec(type); \ - if (*type == _C_FLT || *type == _C_DBL) \ - { \ - if (++(CUM).float_args > 13) \ - { \ - (CUM).stack_position += ROUND ((CUM).stack_position, \ - __alignof__(double)); \ - sprintf((DEST), "%.*s%d", (TYPE)-type, type, (CUM).stack_position); \ - (STACK) = ROUND ((CUM).stack_position, sizeof(double)); \ - } \ - else \ - { \ - sprintf((DEST), "%.*s+%d", (TYPE)-type, type, \ - 40 + sizeof (double) * ((CUM).float_args - 1)); \ - } \ - } \ - else \ - { \ - int align, size; \ -\ - if (*type == _C_STRUCT_B || *type == _C_UNION_B || *type == _C_ARY_B) \ - { \ - align = __alignof__(void*); \ - size = sizeof (void*); \ - } \ - else \ - { \ - align = __alignof__(int); \ - size = objc_sizeof_type (type); \ - } \ -\ - if (++(CUM).int_args > 8) \ - { \ - (CUM).stack_position += ROUND ((CUM).stack_position, align); \ - sprintf((DEST), "%.*s%d", (TYPE)-type, type, (CUM).stack_position); \ - (STACK) = ROUND ((CUM).stack_position, size); \ - } \ - else \ - { \ - (CUM).regs_position = ROUND((CUM).regs_position, align); \ - sprintf(dest, "%.*s+%d", (TYPE)-type, type, (CUM).regs_position); \ - (CUM).regs_position += ROUND (size, align); \ - } \ - } \ - (DEST)=&(DEST)[strlen(DEST)]; \ - if (*(TYPE) == '+') \ - { \ - (TYPE)++; \ - } \ - if (*(TYPE) == '-') \ - { \ - (TYPE)++; \ - } \ - while (isdigit(*(TYPE))) \ - { \ - (TYPE)++; \ - } \ -}) diff --git a/Source/mframe/powerpc/linux-gnu b/Source/mframe/powerpc/linux-gnu deleted file mode 100644 index 1e796a1de..000000000 --- a/Source/mframe/powerpc/linux-gnu +++ /dev/null @@ -1,123 +0,0 @@ -/* See ../README for copyright */ - -/* - * The first eight words of non-FP are in registers (offset 4 in frame). - * The first 13 FP args are in registers (offset 40 in frame). - * If the method returns a structure, it's address is passed as an invisible - * first argument, so only seven words of non-FP are passed in the registers. - * Structures are always passed by reference. - * Floats are placed in the frame as doubles. - */ - -#define MFRAME_STRUCT_BYREF 1 -#define MFRAME_SMALL_STRUCT 0 -#define MFRAME_ARGS_SIZE 144 -#define MFRAME_RESULT_SIZE 16 -#define MFRAME_FLT_IN_FRAME_AS_DBL 1 - -/* - * Structures are passed by reference as an invisible first argument, so - * they go in the first register space for non-FP arguments - at offset 4. - */ -#define MFRAME_GET_STRUCT_ADDR(ARGS, TYPES) \ -((*(TYPES)==_C_STRUCT_B || *(TYPES)==_C_UNION_B || *(TYPES)==_C_ARY_B) ? \ - *(void**)(((char*)(ARGS))+4): (void*)0) - -#define MFRAME_SET_STRUCT_ADDR(ARGS, TYPES, ADDR) \ -({if (*(TYPES)==_C_STRUCT_B || *(TYPES)==_C_UNION_B || *(TYPES)==_C_ARY_B) \ - *(void**)(((char*)(ARGS))+4) = (ADDR);}) - -/* - * Typedef for structure to keep track of argument info while processing - * a method. - */ -typedef struct rs6000_args -{ - int int_args; /* Number of integer arguments so far. */ - int float_args; /* Number of FP arguments so far. */ - int regs_position; /* The current position for non-FP args. */ - int stack_position; /* The current position in the stack frame. */ -} MFRAME_ARGS; - - -/* - * Initialize a variable to keep track of argument info while processing a - * method. Keeps count of the number of arguments of each type seen and - * the current offset in the non-FP registers. This offset is adjusted - * to take account of an invisible first argument used to return structures. - */ - -#define MFRAME_INIT_ARGS(CUM, RTYPE) \ -({ \ - (CUM).int_args = 0; \ - (CUM).float_args = 0; \ - (CUM).stack_position = 0; \ - (CUM).regs_position = \ - ((*(RTYPE)==_C_STRUCT_B || *(RTYPE)==_C_UNION_B || *(RTYPE)==_C_ARY_B) ? \ - sizeof(void*) : 4); \ -}) - -#define MFRAME_ARG_ENCODING(CUM, TYPE, STACK, DEST) \ -({ \ - const char* type = (TYPE); \ -\ - (TYPE) = objc_skip_typespec(type); \ - if (*type == _C_FLT || *type == _C_DBL) \ - { \ - if (++(CUM).float_args > 13) \ - { \ - (CUM).stack_position += ROUND ((CUM).stack_position, \ - __alignof__(double)); \ - sprintf((DEST), "%.*s%d", (TYPE)-type, type, (CUM).stack_position); \ - (STACK) = ROUND ((CUM).stack_position, sizeof(double)); \ - } \ - else \ - { \ - sprintf((DEST), "%.*s+%d", (TYPE)-type, type, \ - 40 + sizeof (double) * ((CUM).float_args - 1)); \ - } \ - } \ - else \ - { \ - int align, size; \ -\ - if (*type == _C_STRUCT_B || *type == _C_UNION_B || *type == _C_ARY_B) \ - { \ - align = __alignof__(void*); \ - size = sizeof (void*); \ - } \ - else \ - { \ - align = __alignof__(int); \ - size = objc_sizeof_type (type); \ - } \ -\ - if (++(CUM).int_args > 8) \ - { \ - (CUM).stack_position += ROUND ((CUM).stack_position, align); \ - sprintf((DEST), "%.*s%d", (TYPE)-type, type, (CUM).stack_position); \ - (STACK) = ROUND ((CUM).stack_position, size); \ - } \ - else \ - { \ - (CUM).regs_position = ROUND((CUM).regs_position, align); \ - /* FIXME: This mostly accounts for the addition in mframe_arg_addr \ - due to WORDS_BIGENDIAN */ \ - if (*type == _C_STRUCT_B && objc_sizeof_type(type) < sizeof(int)) \ - (CUM).regs_position -= sizeof(int) - objc_sizeof_type(type); \ - sprintf((DEST), "%.*s+%d", (TYPE)-type, type, (CUM).regs_position); \ - if (*type == _C_STRUCT_B && objc_sizeof_type(type) < sizeof(int)) \ - (CUM).regs_position += sizeof(int) - objc_sizeof_type(type); \ - (CUM).regs_position += ROUND (size, align); \ - } \ - } \ - (DEST)=&(DEST)[strlen(DEST)]; \ - if (*(TYPE) == '+') \ - { \ - (TYPE)++; \ - } \ - while (isdigit(*(TYPE))) \ - { \ - (TYPE)++; \ - } \ -}) diff --git a/Source/mframe/powerpc/linux-gnulibc1 b/Source/mframe/powerpc/linux-gnulibc1 deleted file mode 100644 index 8c94391e3..000000000 --- a/Source/mframe/powerpc/linux-gnulibc1 +++ /dev/null @@ -1,123 +0,0 @@ -/* See ../README for copyright */ - -/* - * The first eight words of non-FP are in registers (offset 4 in frame). - * The first 13 FP args are in registers (offset 40 in frame). - * If the method returns a structure, it's address is passed as an invisible - * first argument, so only seven words of non-FP are passed in the registers. - * Structures are always passed by reference. - * Floats are placed in the frame as doubles. - */ - -#define MFRAME_STRUCT_BYREF 1 -#define MFRAME_SMALL_STRUCT 0 -#define MFRAME_ARGS_SIZE 144 -#define MFRAME_RESULT_SIZE 16 -#define MFRAME_FLT_IN_FRAME_AS_DBL 1 - -/* - * Structures are passed by reference as an invisible first argument, so - * they go in the first register space for non-FP arguments - at offset 4. - */ -#define MFRAME_GET_STRUCT_ADDR(ARGS, TYPES) \ -((*(TYPES)==_C_STRUCT_B || *(TYPES)==_C_UNION_B || *(TYPES)==_C_ARY_B) ? \ - *(void**)(((char*)(ARGS))+4): (void*)0) - -#define MFRAME_SET_STRUCT_ADDR(ARGS, TYPES, ADDR) \ -({if (*(TYPES)==_C_STRUCT_B || *(TYPES)==_C_UNION_B || *(TYPES)==_C_ARY_B) \ - *(void**)(((char*)(ARGS))+4) = (ADDR);}) - -/* - * Typedef for structure to keep track of argument info while processing - * a method. - */ -typedef struct rs6000_args -{ - int int_args; /* Number of integer arguments so far. */ - int float_args; /* Number of FP arguments so far. */ - int regs_position; /* The current position for non-FP args. */ - int stack_position; /* The current position in the stack frame. */ -} MFRAME_ARGS; - - -/* - * Initialize a variable to keep track of argument info while processing a - * method. Keeps count of the number of arguments of each type seen and - * the current offset in the non-FP registers. This offset is adjusted - * to take account of an invisible first argument used to return structures. - */ - -#define MFRAME_INIT_ARGS(CUM, RTYPE) \ -({ \ - (CUM).int_args = 0; \ - (CUM).float_args = 0; \ - (CUM).stack_position = 0; \ - (CUM).regs_position = \ - ((*(RTYPE)==_C_STRUCT_B || *(RTYPE)==_C_UNION_B || *(RTYPE)==_C_ARY_B) ? \ - 4 + sizeof(void*) : 4); \ -}) - -#define MFRAME_ARG_ENCODING(CUM, TYPE, STACK, DEST) \ -({ \ - const char* type = (TYPE); \ -\ - (TYPE) = objc_skip_typespec(type); \ - if (*type == _C_FLT || *type == _C_DBL) \ - { \ - if (++(CUM).float_args > 13) \ - { \ - (CUM).stack_position += ROUND ((CUM).stack_position, \ - __alignof__(double)); \ - sprintf((DEST), "%.*s%d", (TYPE)-type, type, (CUM).stack_position); \ - (STACK) = ROUND ((CUM).stack_position, sizeof(double)); \ - } \ - else \ - { \ - sprintf((DEST), "%.*s+%d", (TYPE)-type, type, \ - 40 + sizeof (double) * ((CUM).float_args - 1)); \ - } \ - } \ - else \ - { \ - int align, size; \ -\ - if (*type == _C_STRUCT_B || *type == _C_UNION_B || *type == _C_ARY_B) \ - { \ - align = __alignof__(void*); \ - size = sizeof (void*); \ - } \ - else \ - { \ - align = __alignof__(int); \ - size = objc_sizeof_type (type); \ - } \ -\ - if (++(CUM).int_args > 8) \ - { \ - (CUM).stack_position += ROUND ((CUM).stack_position, align); \ - sprintf((DEST), "%.*s%d", (TYPE)-type, type, (CUM).stack_position); \ - (STACK) = ROUND ((CUM).stack_position, size); \ - } \ - else \ - { \ - (CUM).regs_position = ROUND((CUM).regs_position, align); \ - /* FIXME: This mostly accounts for the addition in mframe_arg_addr \ - due to WORDS_BIGENDIAN */ \ - if (*type == _C_STRUCT_B && objc_sizeof_type(type) < sizeof(int)) \ - (CUM).regs_position -= sizeof(int) - objc_sizeof_type(type); \ - sprintf((DEST), "%.*s+%d", (TYPE)-type, type, (CUM).regs_position); \ - if (*type == _C_STRUCT_B && objc_sizeof_type(type) < sizeof(int)) \ - (CUM).regs_position += sizeof(int) - objc_sizeof_type(type); \ - (CUM).regs_position += ROUND (size, align); \ - } \ - } \ - (DEST)=&(DEST)[strlen(DEST)]; \ - if (*(TYPE) == '+') \ - { \ - (TYPE)++; \ - } \ - while (isdigit(*(TYPE))) \ - { \ - (TYPE)++; \ - } \ -}) diff --git a/Source/mframe/sparc/generic b/Source/mframe/sparc/generic deleted file mode 100644 index c906b7ad0..000000000 --- a/Source/mframe/sparc/generic +++ /dev/null @@ -1,93 +0,0 @@ -/* See ../README for copyright */ - -#define MFRAME_STACK_STRUCT 0 -#define MFRAME_STRUCT_BYREF 1 -#define MFRAME_SMALL_STRUCT 0 -#define MFRAME_ARGS_SIZE 32 -#define MFRAME_RESULT_SIZE 16 - -#define MFRAME_GET_STRUCT_ADDR(ARGS, TYPES) \ -((*(TYPES)==_C_STRUCT_B || *(TYPES)==_C_UNION_B || *(TYPES)==_C_ARY_B) ? \ - *(void**)((ARGS)->arg_regs+sizeof(void*)): (void*)0) - -#define MFRAME_SET_STRUCT_ADDR(ARGS, TYPES, ADDR) \ -({if (*(TYPES)==_C_STRUCT_B || *(TYPES)==_C_UNION_B || *(TYPES)==_C_ARY_B) \ - *(void**)((ARGS)->arg_regs+sizeof(void*)) = (ADDR);}) - -#define IN_REGS 0 -#define ON_STACK 1 - -struct sparc_args { - int offsets[2]; /* 0 for args in regs, 1 for the rest of args on stack */ - int onStack; -}; - -#define MFRAME_ARGS struct sparc_args - -#define MFRAME_INIT_ARGS(CUM, RTYPE) \ -({ \ - (CUM).offsets[0] = 8; /* encoding in regs starts from 8 */ \ - (CUM).offsets[1] = 20; /* encoding on stack starts from 20 or 24 */ \ - (CUM).onStack = NO; \ -}) - -#define GET_SPARC_ARG_LOCATION(CUM, CSTRING_TYPE, TYPESIZE) \ -((CUM).onStack \ - ? ON_STACK \ - : ((CUM).offsets[IN_REGS] + TYPESIZE <= 6 * sizeof(int) + 8 \ - ? (((CUM).offsets[IN_REGS] + TYPESIZE <= 6 * sizeof(int) + 4 \ - ? 0 : ((CUM).offsets[ON_STACK] += 4)),\ - IN_REGS) \ - : ((CUM).onStack = YES, ON_STACK))) - -#define MFRAME_ARG_ENCODING(CUM, TYPE, STACK, DEST) \ -({ \ - const char* type = (TYPE); \ - int align = objc_alignof_type(type); \ - int size = objc_sizeof_type(type); \ - int locn = GET_SPARC_ARG_LOCATION(CUM, type, size); \ -\ - (CUM).offsets[locn] = ROUND((CUM).offsets[locn], align); \ - if (size < sizeof(int)) \ - { \ - (CUM).offsets[locn] += sizeof(int) - ROUND(size, align); \ - } \ - (TYPE) = objc_skip_typespec(type); \ - if (locn == IN_REGS) \ - { \ - sprintf((DEST), "%.*s+%d", (TYPE)-type, type, (CUM).offsets[locn]); \ - } \ - else \ - { \ - sprintf((DEST), "%.*s%d", (TYPE)-type, type, (CUM).offsets[locn]); \ - } \ - if (*(TYPE) == '+') \ - { \ - (TYPE)++; \ - } \ - if (*(TYPE) == '-') \ - { \ - (TYPE)++; \ - } \ - while (isdigit(*(TYPE))) \ - { \ - (TYPE)++; \ - } \ - (DEST)=&(DEST)[strlen(DEST)]; \ - if (locn == ON_STACK) \ - { \ - if ((*type==_C_STRUCT_B || *type==_C_UNION_B || *type==_C_ARY_B)) \ - { \ - (STACK) = (CUM).offsets[ON_STACK] + ROUND(size, align); \ - } \ - else \ - { \ - (STACK) = (CUM).offsets[ON_STACK] + size; \ - } \ - } \ - (CUM).offsets[locn] += \ - size < sizeof(int) \ - ? ROUND(size, align) \ - : ROUND(size, sizeof(void*)); \ -}) - diff --git a/Source/mframe/sparc/solaris2.6 b/Source/mframe/sparc/solaris2.6 deleted file mode 100644 index 140836848..000000000 --- a/Source/mframe/sparc/solaris2.6 +++ /dev/null @@ -1,87 +0,0 @@ -/* See ../README for copyright */ - -#define MFRAME_STACK_STRUCT 0 -#define MFRAME_STRUCT_BYREF 1 -#define MFRAME_SMALL_STRUCT 0 -#define MFRAME_ARGS_SIZE 32 -#define MFRAME_RESULT_SIZE 16 - -#define MFRAME_GET_STRUCT_ADDR(ARGS, TYPES) \ -((*(TYPES)==_C_STRUCT_B || *(TYPES)==_C_UNION_B || *(TYPES)==_C_ARY_B) ? \ - *(void**)((ARGS)->arg_regs+sizeof(void*)): (void*)0) - -#define MFRAME_SET_STRUCT_ADDR(ARGS, TYPES, ADDR) \ -({if (*(TYPES)==_C_STRUCT_B || *(TYPES)==_C_UNION_B || *(TYPES)==_C_ARY_B) \ - *(void**)((ARGS)->arg_regs+sizeof(void*)) = (ADDR);}) - -#define IN_REGS 0 -#define ON_STACK 1 - -struct sparc_args { - int offsets[2]; /* 0 for args in regs, 1 for the rest of args on stack */ - int onStack; -}; - -#define MFRAME_ARGS struct sparc_args - -#define MFRAME_INIT_ARGS(CUM, RTYPE) \ -({ \ - (CUM).offsets[0] = 8; /* encoding in regs starts from 8 */ \ - (CUM).offsets[1] = 20; /* encoding on stack starts from 20 or 24 */ \ - (CUM).onStack = NO; \ -}) - -#define GET_SPARC_ARG_LOCATION(CUM, CSTRING_TYPE, TYPESIZE) \ -((CUM).onStack \ - ? ON_STACK \ - : ((CUM).offsets[IN_REGS] + TYPESIZE <= 6 * sizeof(int) + 8 \ - ? (((CUM).offsets[IN_REGS] + TYPESIZE <= 6 * sizeof(int) + 4 \ - ? 0 : ((CUM).offsets[ON_STACK] += 4)),\ - IN_REGS) \ - : ((CUM).onStack = YES, ON_STACK))) - -#define MFRAME_ARG_ENCODING(CUM, TYPE, STACK, DEST) \ -({ \ - const char* type = (TYPE); \ - int align = objc_alignof_type(type); \ - int size = objc_sizeof_type(type); \ - int locn = GET_SPARC_ARG_LOCATION(CUM, type, size); \ -\ - (CUM).offsets[locn] = ROUND((CUM).offsets[locn], align); \ - if (size < sizeof(int)) \ - (CUM).offsets[locn] -= (sizeof(int) - size); \ - (TYPE) = objc_skip_typespec(type); \ - if (locn == IN_REGS) \ - { \ - sprintf((DEST), "%.*s+%d", (TYPE)-type, type, (CUM).offsets[locn]); \ - } \ - else \ - { \ - sprintf((DEST), "%.*s%d", (TYPE)-type, type, (CUM).offsets[locn]); \ - } \ - if (*(TYPE) == '+') \ - { \ - (TYPE)++; \ - } \ - while (isdigit(*(TYPE))) \ - { \ - (TYPE)++; \ - } \ - (DEST)=&(DEST)[strlen(DEST)]; \ - if (locn == ON_STACK) \ - { \ - if ((*type==_C_STRUCT_B || *type==_C_UNION_B || *type==_C_ARY_B)) \ - { \ - (STACK) = (CUM).offsets[ON_STACK] + ROUND(size, align); \ - } \ - else \ - { \ - (STACK) = (CUM).offsets[ON_STACK] + size; \ - } \ - } \ - (CUM).offsets[locn] += \ - size < sizeof(int) \ - ? ROUND(size, align) \ - : ROUND(size, sizeof(void*)); \ -}) - diff --git a/Source/mframe/sparc/sunos4.1.3 b/Source/mframe/sparc/sunos4.1.3 deleted file mode 100644 index 9ff52f41a..000000000 --- a/Source/mframe/sparc/sunos4.1.3 +++ /dev/null @@ -1,89 +0,0 @@ -/* See ../README for copyright */ - -#define MFRAME_STACK_STRUCT 0 -#define MFRAME_STRUCT_BYREF 1 -#define MFRAME_SMALL_STRUCT 0 -#define MFRAME_ARGS_SIZE 32 -#define MFRAME_RESULT_SIZE 16 - -#define MFRAME_GET_STRUCT_ADDR(ARGS, TYPES) \ -((*(TYPES)==_C_STRUCT_B || *(TYPES)==_C_UNION_B || *(TYPES)==_C_ARY_B) ? \ - *(void**)((ARGS)->arg_regs+sizeof(void*)): (void*)0) - -#define MFRAME_SET_STRUCT_ADDR(ARGS, TYPES, ADDR) \ -({if (*(TYPES)==_C_STRUCT_B || *(TYPES)==_C_UNION_B || *(TYPES)==_C_ARY_B) \ - *(void**)((ARGS)->arg_regs+sizeof(void*)) = (ADDR);}) - -#define IN_REGS 0 -#define ON_STACK 1 - -struct sparc_args { - int offsets[2]; /* 0 for args in regs, 1 for the rest of args on stack */ - int onStack; -}; - -#define MFRAME_ARGS struct sparc_args - -#define MFRAME_INIT_ARGS(CUM, RTYPE) \ -({ \ - (CUM).offsets[0] = 8; /* encoding in regs starts from 8 */ \ - (CUM).offsets[1] = 20; /* encoding on stack starts from 20 or 24 */ \ - (CUM).onStack = NO; \ -}) - -#define GET_SPARC_ARG_LOCATION(CUM, CSTRING_TYPE, TYPESIZE) \ -((CUM).onStack \ - ? ON_STACK \ - : ((CUM).offsets[IN_REGS] + TYPESIZE <= 6 * sizeof(int) + 8 \ - ? (((CUM).offsets[IN_REGS] + TYPESIZE <= 6 * sizeof(int) + 4 \ - ? 0 : ((CUM).offsets[ON_STACK] += 4)),\ - IN_REGS) \ - : ((CUM).onStack = YES, ON_STACK))) - -#define MFRAME_ARG_ENCODING(CUM, TYPE, STACK, DEST) \ -({ \ - const char* type = (TYPE); \ - int align = objc_alignof_type(type); \ - int size = objc_sizeof_type(type); \ - int locn = GET_SPARC_ARG_LOCATION(CUM, type, size); \ -\ - (CUM).offsets[locn] = ROUND((CUM).offsets[locn], align); \ - if (size < sizeof(int)) \ - { \ - (CUM).offsets[locn] += sizeof(int) - ROUND(size, align); \ - } \ - (TYPE) = objc_skip_typespec(type); \ - if (locn == IN_REGS) \ - { \ - sprintf((DEST), "%.*s+%d", (TYPE)-type, type, (CUM).offsets[locn]); \ - } \ - else \ - { \ - sprintf((DEST), "%.*s%d", (TYPE)-type, type, (CUM).offsets[locn]); \ - } \ - if (*(TYPE) == '+') \ - { \ - (TYPE)++; \ - } \ - while (isdigit(*(TYPE))) \ - { \ - (TYPE)++; \ - } \ - (DEST)=&(DEST)[strlen(DEST)]; \ - if (locn == ON_STACK) \ - { \ - if ((*type==_C_STRUCT_B || *type==_C_UNION_B || *type==_C_ARY_B)) \ - { \ - (STACK) = (CUM).offsets[ON_STACK] + ROUND(size, align); \ - } \ - else \ - { \ - (STACK) = (CUM).offsets[ON_STACK] + size; \ - } \ - } \ - (CUM).offsets[locn] += \ - size < sizeof(int) \ - ? ROUND(size, align) \ - : ROUND(size, sizeof(void*)); \ -}) - diff --git a/Source/mframe/sparc64/generic b/Source/mframe/sparc64/generic deleted file mode 100644 index c906b7ad0..000000000 --- a/Source/mframe/sparc64/generic +++ /dev/null @@ -1,93 +0,0 @@ -/* See ../README for copyright */ - -#define MFRAME_STACK_STRUCT 0 -#define MFRAME_STRUCT_BYREF 1 -#define MFRAME_SMALL_STRUCT 0 -#define MFRAME_ARGS_SIZE 32 -#define MFRAME_RESULT_SIZE 16 - -#define MFRAME_GET_STRUCT_ADDR(ARGS, TYPES) \ -((*(TYPES)==_C_STRUCT_B || *(TYPES)==_C_UNION_B || *(TYPES)==_C_ARY_B) ? \ - *(void**)((ARGS)->arg_regs+sizeof(void*)): (void*)0) - -#define MFRAME_SET_STRUCT_ADDR(ARGS, TYPES, ADDR) \ -({if (*(TYPES)==_C_STRUCT_B || *(TYPES)==_C_UNION_B || *(TYPES)==_C_ARY_B) \ - *(void**)((ARGS)->arg_regs+sizeof(void*)) = (ADDR);}) - -#define IN_REGS 0 -#define ON_STACK 1 - -struct sparc_args { - int offsets[2]; /* 0 for args in regs, 1 for the rest of args on stack */ - int onStack; -}; - -#define MFRAME_ARGS struct sparc_args - -#define MFRAME_INIT_ARGS(CUM, RTYPE) \ -({ \ - (CUM).offsets[0] = 8; /* encoding in regs starts from 8 */ \ - (CUM).offsets[1] = 20; /* encoding on stack starts from 20 or 24 */ \ - (CUM).onStack = NO; \ -}) - -#define GET_SPARC_ARG_LOCATION(CUM, CSTRING_TYPE, TYPESIZE) \ -((CUM).onStack \ - ? ON_STACK \ - : ((CUM).offsets[IN_REGS] + TYPESIZE <= 6 * sizeof(int) + 8 \ - ? (((CUM).offsets[IN_REGS] + TYPESIZE <= 6 * sizeof(int) + 4 \ - ? 0 : ((CUM).offsets[ON_STACK] += 4)),\ - IN_REGS) \ - : ((CUM).onStack = YES, ON_STACK))) - -#define MFRAME_ARG_ENCODING(CUM, TYPE, STACK, DEST) \ -({ \ - const char* type = (TYPE); \ - int align = objc_alignof_type(type); \ - int size = objc_sizeof_type(type); \ - int locn = GET_SPARC_ARG_LOCATION(CUM, type, size); \ -\ - (CUM).offsets[locn] = ROUND((CUM).offsets[locn], align); \ - if (size < sizeof(int)) \ - { \ - (CUM).offsets[locn] += sizeof(int) - ROUND(size, align); \ - } \ - (TYPE) = objc_skip_typespec(type); \ - if (locn == IN_REGS) \ - { \ - sprintf((DEST), "%.*s+%d", (TYPE)-type, type, (CUM).offsets[locn]); \ - } \ - else \ - { \ - sprintf((DEST), "%.*s%d", (TYPE)-type, type, (CUM).offsets[locn]); \ - } \ - if (*(TYPE) == '+') \ - { \ - (TYPE)++; \ - } \ - if (*(TYPE) == '-') \ - { \ - (TYPE)++; \ - } \ - while (isdigit(*(TYPE))) \ - { \ - (TYPE)++; \ - } \ - (DEST)=&(DEST)[strlen(DEST)]; \ - if (locn == ON_STACK) \ - { \ - if ((*type==_C_STRUCT_B || *type==_C_UNION_B || *type==_C_ARY_B)) \ - { \ - (STACK) = (CUM).offsets[ON_STACK] + ROUND(size, align); \ - } \ - else \ - { \ - (STACK) = (CUM).offsets[ON_STACK] + size; \ - } \ - } \ - (CUM).offsets[locn] += \ - size < sizeof(int) \ - ? ROUND(size, align) \ - : ROUND(size, sizeof(void*)); \ -}) - diff --git a/Source/mframe/sparc64/openbsd b/Source/mframe/sparc64/openbsd deleted file mode 100644 index 1c798144f..000000000 --- a/Source/mframe/sparc64/openbsd +++ /dev/null @@ -1,93 +0,0 @@ -/* See ../README for copyright */ - -#define MFRAME_STACK_STRUCT 0 -#define MFRAME_STRUCT_BYREF 0 -#define MFRAME_SMALL_STRUCT 0 -#define MFRAME_ARGS_SIZE 32 -#define MFRAME_RESULT_SIZE 16 - -#define MFRAME_GET_STRUCT_ADDR(ARGS, TYPES) \ -((*(TYPES)==_C_STRUCT_B || *(TYPES)==_C_UNION_B || *(TYPES)==_C_ARY_B) ? \ - *(void**)((ARGS)->arg_regs+sizeof(void*)): (void*)0) - -#define MFRAME_SET_STRUCT_ADDR(ARGS, TYPES, ADDR) \ -({if (*(TYPES)==_C_STRUCT_B || *(TYPES)==_C_UNION_B || *(TYPES)==_C_ARY_B) \ - *(void**)((ARGS)->arg_regs+sizeof(void*)) = (ADDR);}) - -#define IN_REGS 0 -#define ON_STACK 1 - -struct sparc_args { - int offsets[2]; /* 0 for args in regs, 1 for the rest of args on stack */ - int onStack; -}; - -#define MFRAME_ARGS struct sparc_args - -#define MFRAME_INIT_ARGS(CUM, RTYPE) \ -({ \ - (CUM).offsets[0] = 8; /* encoding in regs starts from 8 */ \ - (CUM).offsets[1] = 20; /* encoding on stack starts from 20 or 24 */ \ - (CUM).onStack = NO; \ -}) - -#define GET_SPARC_ARG_LOCATION(CUM, CSTRING_TYPE, TYPESIZE) \ -((CUM).onStack \ - ? ON_STACK \ - : ((CUM).offsets[IN_REGS] + TYPESIZE <= 6 * sizeof(int) + 8 \ - ? (((CUM).offsets[IN_REGS] + TYPESIZE <= 6 * sizeof(int) + 4 \ - ? 0 : ((CUM).offsets[ON_STACK] += 4)),\ - IN_REGS) \ - : ((CUM).onStack = YES, ON_STACK))) - -#define MFRAME_ARG_ENCODING(CUM, TYPE, STACK, DEST) \ -({ \ - const char* type = (TYPE); \ - int align = objc_alignof_type(type); \ - int size = objc_sizeof_type(type); \ - int locn = GET_SPARC_ARG_LOCATION(CUM, type, size); \ -\ - (CUM).offsets[locn] = ROUND((CUM).offsets[locn], align); \ - if (size < sizeof(int)) \ - { \ - (CUM).offsets[locn] += sizeof(int) - ROUND(size, align); \ - } \ - (TYPE) = objc_skip_typespec(type); \ - if (locn == IN_REGS) \ - { \ - sprintf((DEST), "%.*s+%d", (TYPE)-type, type, (CUM).offsets[locn]); \ - } \ - else \ - { \ - sprintf((DEST), "%.*s%d", (TYPE)-type, type, (CUM).offsets[locn]); \ - } \ - if (*(TYPE) == '+') \ - { \ - (TYPE)++; \ - } \ - if (*(TYPE) == '-') \ - { \ - (TYPE)++; \ - } \ - while (isdigit(*(TYPE))) \ - { \ - (TYPE)++; \ - } \ - (DEST)=&(DEST)[strlen(DEST)]; \ - if (locn == ON_STACK) \ - { \ - if ((*type==_C_STRUCT_B || *type==_C_UNION_B || *type==_C_ARY_B)) \ - { \ - (STACK) = (CUM).offsets[ON_STACK] + ROUND(size, align); \ - } \ - else \ - { \ - (STACK) = (CUM).offsets[ON_STACK] + size; \ - } \ - } \ - (CUM).offsets[locn] += \ - size < sizeof(int) \ - ? ROUND(size, align) \ - : ROUND(size, sizeof(void*)); \ -}) - diff --git a/Source/mframe/unknown/generic b/Source/mframe/unknown/generic deleted file mode 100644 index 074e21ba0..000000000 --- a/Source/mframe/unknown/generic +++ /dev/null @@ -1,54 +0,0 @@ -/* See ../README for copyright */ - -#define MFRAME_STACK_STRUCT 0 -#define MFRAME_STRUCT_BYREF 0 -#define MFRAME_SMALL_STRUCT 8 -#define MFRAME_ARGS_SIZE 128 -#define MFRAME_RESULT_SIZE 128 - -#define MFRAME_GET_STRUCT_ADDR(ARGS, TYPES) \ -(((*(TYPES)==_C_STRUCT_B || *(TYPES)==_C_UNION_B || *(TYPES)==_C_ARY_B) && \ - objc_sizeof_type(TYPES) > MFRAME_SMALL_STRUCT) ? \ - *(void**)((ARGS)->arg_ptr + sizeof(void*)) : (void*)0) - -#define MFRAME_SET_STRUCT_ADDR(ARGS, TYPES, ADDR) \ -({if ((*(TYPES)==_C_STRUCT_B || *(TYPES)==_C_UNION_B || \ - *(TYPES)==_C_ARY_B) && \ - objc_sizeof_type(TYPES) > MFRAME_SMALL_STRUCT) \ - *(void**)((ARGS)->arg_ptr + sizeof(void*)) = (ADDR);}) - -#define MFRAME_ARGS int - -#define MFRAME_INIT_ARGS(CUM, RTYPE) ((CUM) = 0) - -#define MFRAME_ARG_ENCODING(CUM, TYPE, STACK, DEST) \ -({ \ - const char* type = (TYPE); \ - int align = objc_alignof_type(type); \ - int size = objc_sizeof_type(type); \ -\ - (TYPE) = objc_skip_typespec(type); \ - (CUM) = ROUND((CUM), __alignof__(int)); \ - sprintf((DEST), "%.*s%d", (TYPE)-type, type, (CUM)); \ - if (*(TYPE) == '+') (TYPE)++; \ - if (*(TYPE) == '-') (TYPE)++; \ - while (isdigit(*(TYPE))) \ - { \ - (TYPE)++; \ - } \ - (DEST)=&(DEST)[strlen(DEST)]; \ - if ((*type==_C_STRUCT_B||*type==_C_UNION_B||*type==_C_ARY_B)) \ - { \ - (STACK) = (CUM) + ROUND(size, align); \ - } \ - else \ - { \ - if (size < sizeof(int)) \ - { \ - size = sizeof(int); \ - } \ - (STACK) = (CUM) + size; \ - } \ - (CUM) += size; \ -}) - diff --git a/configure b/configure index 61524db7a..f47702c25 100755 --- a/configure +++ b/configure @@ -17895,6 +17895,10 @@ else enable_libffi=$do_enable_libffi fi; +if test $enable_libffi = no; then + do_enable_libffcall=yes +fi + # Check whether --enable-ffcall or --disable-ffcall was given. if test "${enable_ffcall+set}" = set; then enableval="$enable_ffcall" diff --git a/configure.ac b/configure.ac index 2d4974b24..d3e199064 100644 --- a/configure.ac +++ b/configure.ac @@ -1350,6 +1350,10 @@ AC_ARG_ENABLE(libffi, [ --enable-libffi Enable use of libffi library],, enable_libffi=$do_enable_libffi) +if test $enable_libffi = no; then + do_enable_libffcall=yes +fi + AC_ARG_ENABLE(ffcall, [ --enable-ffcall Enable use of ffcall library],, enable_ffcall=$do_enable_libffcall)