Index: .gitignore ================================================================== --- .gitignore +++ .gitignore @@ -27,10 +27,11 @@ src/Info.plist src/ObjFW.framework src/bridge/Info.plist src/bridge/ObjFW_Bridge.framework src/objfw-defs.h +src/runtime/ObjFW_RT.framework src/runtime/ppcinline.h tests/*.map tests/EBOOT.PBP tests/Info.plist tests/PARAM.SFO Index: configure.ac ================================================================== --- configure.ac +++ configure.ac @@ -27,11 +27,11 @@ OBJCFLAGS="$OBJCFLAGS -noixemul" LDFLAGS="$LDFLAGS -noixemul" enable_files="yes" # Required for reading ENV: AC_SUBST(NOIXEMUL, -noixemul) - AC_SUBST(OBJFW_RT_MORPHOS_LIB, objfw-rt.library) + AC_SUBST(OBJFW_RT_MORPHOS_LIB, objfw_rt.library) ]) enable_shared="no" enable_threads="no" ;; @@ -249,10 +249,11 @@ AC_SUBST(LOOKUP_ASM_LIB_A, "lookup-asm.lib.a") AC_SUBST(LOOKUP_ASM_LOOKUP_ASM_LIB_A, "lookup-asm/lookup-asm.lib.a") BUILDSYS_FRAMEWORK([ AC_SUBST(OBJFW_FRAMEWORK, "ObjFW.framework") + build_framework="yes" ]) ], [ AC_SUBST(LIBOBJFW_DEP, "../src/libobjfw.a") AC_SUBST(LIBOBJFW_DEP_LVL2, "../../src/libobjfw.a") ]) @@ -372,17 +373,21 @@ AC_SUBST(RUNTIME, "runtime") AC_SUBST(RUNTIME_FLAGS) AS_IF([test x"$enable_shared" != x"no"], [ AC_SUBST(OBJFW_RT_SHARED_LIB, - "${LIB_PREFIX}objfw-rt${LIB_SUFFIX}") + "${LIB_PREFIX}objfw_rt${LIB_SUFFIX}") ]) AS_IF([test x"$enable_static" = x"yes" \ -o x"$enable_shared" = x"no"], [ - AC_SUBST(OBJFW_RT_STATIC_LIB, "libobjfw-rt.a") + AC_SUBST(OBJFW_RT_STATIC_LIB, "libobjfw_rt.a") + ]) + AS_IF([test x"$build_framework" = x"yes"], [ + AC_SUBST(OBJFW_RT_FRAMEWORK, "ObjFW_RT.framework") ]) - AC_SUBST(RUNTIME_LIBS, "-lobjfw-rt") + AC_SUBST(RUNTIME_LIBS, "-lobjfw_rt") + AC_SUBST(RUNTIME_FRAMEWORK_LIBS, "-framework ObjFW_RT") AS_IF([test x"$enable_seluid24" = x"yes"], [ AC_DEFINE(OF_SELUID24, 1, [Whether to use 24 bit selector UIDs]) ]) @@ -439,10 +444,11 @@ AC_DEFINE(OF_APPLE_RUNTIME, 1, [Whether we use the Apple ObjC runtime]) AC_CHECK_LIB(objc, objc_msgSend, [ AC_SUBST(RUNTIME_LIBS, "-lobjc") + AC_SUBST(RUNTIME_FRAMEWORK_LIBS, "-lobjc") ], [ AC_MSG_ERROR([libobjc not found!]) ]) ;; esac @@ -458,10 +464,12 @@ case "$host_os" in darwin*) AC_SUBST(LDFLAGS_REEXPORT, ["-Wl,-reexport-lobjfw"]) AS_IF([test x"$objc_runtime" = x"Apple runtime"], [ AC_SUBST(REEXPORT_RUNTIME, ["-Wl,-reexport-lobjc"]) + AC_SUBST(REEXPORT_RUNTIME_FRAMEWORK, + ["-Wl,-reexport-lobjc"]) AC_SUBST(WEAK_NSFOUNDATIONVERSIONNUMBER, ["-Wl,-U,_NSFoundationVersionNumber"]) LDFLAGS="$LDFLAGS -Wl,-U,_NSFoundationVersionNumber" ]) @@ -470,11 +478,13 @@ LDFLAGS="$LDFLAGS -Wl,-U,___gxx_personality_v0" ]) AS_IF([test x"$exception_type" = x"SjLj"], [ LDFLAGS="$LDFLAGS -Wl,-U,___gxx_personality_sj0" ]) - AC_SUBST(REEXPORT_RUNTIME, ["-Wl,-reexport-lobjfw-rt"]) + AC_SUBST(REEXPORT_RUNTIME, ["-Wl,-reexport-lobjfw_rt"]) + AC_SUBST(REEXPORT_RUNTIME_FRAMEWORK, + ["-Wl,-reexport_framework,ObjFW_RT"]) ]) AC_CHECK_HEADERS(sysdir.h) AC_CHECK_FUNCS(sysdir_start_search_path_enumeration) @@ -1290,21 +1300,18 @@ AC_SUBST(BRIDGE, "bridge") AS_IF([test x"$enable_shared" != x"no"], [ AC_SUBST(OBJFW_BRIDGE_SHARED_LIB, "${LIB_PREFIX}objfw_bridge${LIB_SUFFIX}") - - case "$host_os" in - darwin*) - AC_SUBST(OBJFW_BRIDGE_FRAMEWORK, - "ObjFW_Bridge.framework") - ;; - esac ]) AS_IF([test x"$enable_static" = x"yes" \ -o x"$enable_shared" = x"no"], [ AC_SUBST(OBJFW_BRIDGE_STATIC_LIB, "libobjfw_bridge.a") + ]) + AS_IF([test x"$build_framework" = x"yes"], [ + AC_SUBST(OBJFW_BRIDGE_FRAMEWORK, + "ObjFW_Bridge.framework") ]) ]) ]) dnl This needs to be after all other header checks, as they include unistd.h, Index: extra.mk.in ================================================================== --- extra.mk.in +++ extra.mk.in @@ -6,10 +6,11 @@ OBJFW_LIB_MINOR = 0 OBJFW_LIB_MAJOR_MINOR = ${OBJFW_LIB_MAJOR}.${OBJFW_LIB_MINOR} OBJFW_RT_SHARED_LIB = @OBJFW_RT_SHARED_LIB@ OBJFW_RT_STATIC_LIB = @OBJFW_RT_STATIC_LIB@ +OBJFW_RT_FRAMEWORK = @OBJFW_RT_FRAMEWORK@ OBJFW_RT_MORPHOS_LIB = @OBJFW_RT_MORPHOS_LIB@ OBJFW_RT_LIB_MAJOR = 0 OBJFW_RT_LIB_MINOR = 0 OBJFW_RT_LIB_MAJOR_MINOR = ${OBJFW_RT_LIB_MAJOR}.${OBJFW_RT_LIB_MINOR} @@ -57,11 +58,13 @@ OFKERNELEVENTOBSERVER_SELECT_M = @OFKERNELEVENTOBSERVER_SELECT_M@ OFPROCESS_M = @OFPROCESS_M@ OFSTDIOSTREAM_WIN32CONSOLE_M = @OFSTDIOSTREAM_WIN32CONSOLE_M@ OFZIP = @OFZIP@ REEXPORT_RUNTIME = @REEXPORT_RUNTIME@ +REEXPORT_RUNTIME_FRAMEWORK = @REEXPORT_RUNTIME_FRAMEWORK@ RUNTIME = @RUNTIME@ +RUNTIME_FRAMEWORK_LIBS = @RUNTIME_FRAMEWORK_LIBS@ RUNTIME_LIBS = @RUNTIME_LIBS@ RUN_TESTS = @RUN_TESTS@ TESTPLUGIN = @TESTPLUGIN@ TESTS_LIBS = @TESTS_LIBS@ TESTS_OBJCFLAGS = @TESTS_OBJCFLAGS@ Index: src/Makefile ================================================================== --- src/Makefile +++ src/Makefile @@ -203,8 +203,9 @@ include ../buildsys.mk CPPFLAGS += -I. -I.. -Iexceptions -Iruntime LD = ${OBJC} -LDFLAGS += ${REEXPORT_RUNTIME} -LIBS += -Lruntime ${RUNTIME_LIBS} -FRAMEWORK_LIBS += -Lruntime ${RUNTIME_LIBS} +LIBS += -Lruntime ${RUNTIME_LIBS} ${REEXPORT_RUNTIME} +FRAMEWORK_LIBS += -Fruntime \ + ${RUNTIME_FRAMEWORK_LIBS} \ + ${REEXPORT_RUNTIME_FRAMEWORK} Index: src/OFObject.m ================================================================== --- src/OFObject.m +++ src/OFObject.m @@ -47,11 +47,11 @@ #import "OFOutOfRangeException.h" #if defined(OF_APPLE_RUNTIME) && __OBJC2__ # import #elif defined(OF_OBJFW_RUNTIME) -# import "ObjFW-RT.h" +# import "ObjFW_RT.h" #endif #ifdef OF_WINDOWS # include #endif Index: src/macros.h ================================================================== --- src/macros.h +++ src/macros.h @@ -33,13 +33,13 @@ #include "platform.h" #ifdef OF_OBJFW_RUNTIME # ifdef OF_COMPILING_OBJFW -# import "ObjFW-RT.h" +# import "ObjFW_RT.h" # else -# import +# import # endif #endif #ifdef OF_APPLE_RUNTIME # import # import Index: src/runtime/Makefile ================================================================== --- src/runtime/Makefile +++ src/runtime/Makefile @@ -2,10 +2,11 @@ SUBDIRS = lookup-asm SHARED_LIB = ${OBJFW_RT_SHARED_LIB} STATIC_LIB = ${OBJFW_RT_STATIC_LIB} +FRAMEWORK = ${OBJFW_RT_FRAMEWORK} MORPHOS_LIB = ${OBJFW_RT_MORPHOS_LIB} LIB_MAJOR = ${OBJFW_RT_LIB_MAJOR} LIB_MINOR = ${OBJFW_RT_LIB_MINOR} SRCS = arc.m \ @@ -24,27 +25,27 @@ static-instances.m \ synchronized.m \ ${USE_SRCS_THREADS} SRCS_THREADS = threading.m \ ../threading.m -INCLUDES = ObjFW-RT.h -includesubdir = ObjFW-RT +INCLUDES = ObjFW_RT.h +includesubdir = ObjFW_RT OBJS_EXTRA = ${LOOKUP_ASM_LOOKUP_ASM_A} LIB_OBJS_EXTRA = ${LOOKUP_ASM_LOOKUP_ASM_LIB_A} MORPHOS_LIB_OBJS_EXTRA = morphos-library.o ${LOOKUP_ASM_LOOKUP_ASM_A} include ../../buildsys.mk ${MORPHOS_LIB}: ppcinline.h -ppcinline.h: ObjFW-RT.fd protos.h +ppcinline.h: ObjFW_RT.fd protos.h cvinclude.pl \ --root ObjFW_RT \ - --fd ObjFW-RT.fd \ + --fd ObjFW_RT.fd \ --clib protos.h \ --inline $@ CPPFLAGS += -I. -I.. -I../.. \ -DOF_COMPILING_OBJFW_RT \ -DOBJFW_RT_LIB_MAJOR=${OBJFW_RT_LIB_MAJOR} \ -DOBJFW_RT_LIB_MINOR=${OBJFW_RT_LIB_MINOR} LD = ${OBJC} DELETED src/runtime/ObjFW-RT.fd Index: src/runtime/ObjFW-RT.fd ================================================================== --- src/runtime/ObjFW-RT.fd +++ src/runtime/ObjFW-RT.fd @@ -1,53 +0,0 @@ -##base _ObjFWRTBase -##bias 30 -##public -* Functions for the glue code -objc_set_exit()(sysv,r12base) -* Used by the compiler - these need glue code -__objc_exec_class_inline()(sysv,r12base) -objc_msg_lookup_inline()(sysv,r12base) -objc_msg_lookup_stret_inline()(sysv,r12base) -objc_msg_lookup_super_inline()(sysv,r12base) -objc_msg_lookup_super_stret_inline()(sysv,r12base) -objc_lookUpClass_inline()(sysv,r12base) -objc_getClass_inline()(sysv,r12base) -objc_getRequiredClass_inline()(sysv,r12base) -objc_exception_throw_inline()(sysv,r12base) -objc_sync_enter_inline()(sysv,r12base) -objc_sync_exit_inline()(sysv,r12base) -objc_getProperty_inline()(sysv,r12base) -objc_setProperty_inline()(sysv,r12base) -objc_getPropertyStruct_inline()(sysv,r12base) -objc_setPropertyStruct_inline()(sysv,r12base) -objc_enumerationMutation_inline()(sysv,r12base) -* Functions declared in ObjFW-RT.h -sel_registerName()(sysv,r12base) -sel_getName()(sysv,r12base) -sel_isEqual()(sysv,r12base) -objc_allocateClassPair()(sysv,r12base) -objc_registerClassPair()(sysv,r12base) -objc_getClassList()(sysv,r12base) -objc_copyClassList()(sysv,r12base) -class_isMetaClass()(sysv,r12base) -class_getName()(sysv,r12base) -class_getSuperclass()(sysv,r12base) -class_getInstanceSize()(sysv,r12base) -class_respondsToSelector()(sysv,r12base) -class_conformsToProtocol()(sysv,r12base) -class_getMethodImplementation()(sysv,r12base) -class_getMethodImplementation_stret()(sysv,r12base) -class_getMethodTypeEncoding()(sysv,r12base) -class_addMethod()(sysv,r12base) -class_replaceMethod()(sysv,r12base) -object_getClass()(sysv,r12base) -object_setClass()(sysv,r12base) -object_getClassName()(sysv,r12base) -protocol_getName()(sysv,r12base) -protocol_isEqual()(sysv,r12base) -protocol_conformsToProtocol()(sysv,r12base) -objc_exit()(sysv,r12base) -objc_setUncaughtExceptionHandler()(sysv,r12base) -objc_setForwardHandler()(sysv,r12base) -objc_setEnumerationMutationHandler()(sysv,r12base) -objc_zero_weak_references()(sysv,r12base) -##end DELETED src/runtime/ObjFW-RT.h Index: src/runtime/ObjFW-RT.h ================================================================== --- src/runtime/ObjFW-RT.h +++ src/runtime/ObjFW-RT.h @@ -1,303 +0,0 @@ -/* - * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, - * 2018 - * Jonathan Schleifer - * - * All rights reserved. - * - * This file is part of ObjFW. It may be distributed under the terms of the - * Q Public License 1.0, which can be found in the file LICENSE.QPL included in - * the packaging of this file. - * - * Alternatively, it may be distributed under the terms of the GNU General - * Public License, either version 2 or 3, which can be found in the file - * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this - * file. - */ - -#ifndef __OBJFW_RUNTIME_H__ -#define __OBJFW_RUNTIME_H__ - -#ifndef __STDC_LIMIT_MACROS -# define __STDC_LIMIT_MACROS -#endif -#ifndef __STDC_CONSTANT_MACROS -# define __STDC_CONSTANT_MACROS -#endif - -#include -#include -#include - -#ifndef __has_feature -# define __has_feature(x) 0 -#endif - -#ifndef __has_attribute -# define __has_attribute(x) 0 -#endif - -#if !__has_feature(nullability) -# ifndef _Nonnull -# define _Nonnull -# endif -# ifndef _Nullable -# define _Nullable -# endif -# ifndef _Null_unspecified -# define _Null_unspecified -# endif -#endif - -#if !__has_feature(objc_arc) && !defined(__unsafe_unretained) -# define __unsafe_unretained -#endif - -#define Nil (Class _Null_unspecified)0 -#define nil (id _Null_unspecified)0 -#define YES (BOOL)1 -#define NO (BOOL)0 - -typedef struct objc_class *Class; -typedef struct objc_object *id; -typedef const struct objc_selector *SEL; -typedef signed char BOOL; -typedef id _Nullable (*IMP)(id _Nonnull, SEL _Nonnull, ...); -typedef void (*objc_uncaught_exception_handler)(id _Nullable); -typedef void (*objc_enumeration_mutation_handler)(id _Nonnull); - -struct objc_class { - Class _Nonnull isa; - Class _Nullable superclass; - const char *_Nonnull name; - unsigned long version; - unsigned long info; - long instance_size; - struct objc_ivar_list *_Nullable ivars; - struct objc_method_list *_Nullable methodlist; - struct objc_dtable *_Nonnull dtable; - Class _Nullable *_Nullable subclass_list; - void *_Nullable sibling_class; - struct objc_protocol_list *_Nullable protocols; - void *_Nullable gc_object_type; - unsigned long abi_version; - int32_t *_Nonnull *_Nullable ivar_offsets; - struct objc_property_list *_Nullable properties; -}; - -enum objc_class_info { - OBJC_CLASS_INFO_CLASS = 0x001, - OBJC_CLASS_INFO_METACLASS = 0x002, - OBJC_CLASS_INFO_NEW_ABI = 0x010, - OBJC_CLASS_INFO_SETUP = 0x100, - OBJC_CLASS_INFO_LOADED = 0x200, - OBJC_CLASS_INFO_DTABLE = 0x400, - OBJC_CLASS_INFO_INITIALIZED = 0x800 -}; - -struct objc_object { - Class _Nonnull isa; -}; - -struct objc_selector { - uintptr_t uid; - const char *_Nullable types; -}; - -struct objc_super { - id __unsafe_unretained _Nullable self; - Class _Nonnull cls; -}; - -struct objc_method { - struct objc_selector sel; - IMP _Nonnull imp; -}; - -struct objc_method_list { - struct objc_method_list *_Nullable next; - unsigned int count; - struct objc_method methods[1]; -}; - -struct objc_category { - const char *_Nonnull category_name; - const char *_Nonnull class_name; - struct objc_method_list *_Nullable instance_methods; - struct objc_method_list *_Nullable class_methods; - struct objc_protocol_list *_Nullable protocols; -}; - -struct objc_ivar { - const char *_Nonnull name; - const char *_Nonnull type; - unsigned int offset; -}; - -struct objc_ivar_list { - unsigned int count; - struct objc_ivar ivars[1]; -}; - -enum objc_property_attributes { - OBJC_PROPERTY_READONLY = 0x01, - OBJC_PROPERTY_GETTER = 0x02, - OBJC_PROPERTY_ASSIGN = 0x04, - OBJC_PROPERTY_READWRITE = 0x08, - OBJC_PROPERTY_RETAIN = 0x10, - OBJC_PROPERTY_COPY = 0x20, - OBJC_PROPERTY_NONATOMIC = 0x40, - OBJC_PROPERTY_SETTER = 0x80 -}; - -enum objc_property_extended_attributes { - OBJC_PROPERTY_SYNTHESIZE = 0x1, - OBJC_PROPERTY_DYNAMIC = 0x2, - OBJC_PROPERTY_PROTOCOL = 0x3, - OBJC_PROPERTY_ATOMIC = 0x4, - OBJC_PROPERTY_WEAK = 0x8, - OBJC_PROPERTY_STRONG = 0x10, - OBJC_PROPERTY_UNSAFE_UNRETAINED = 0x20 -}; - -struct objc_property { - const char *_Nonnull name; - unsigned char attributes, extended_attributes; - struct { - const char *_Nullable name; - const char *_Nullable type; - } getter, setter; -}; - -struct objc_property_list { - unsigned int count; - struct objc_property_list *_Nullable next; - struct objc_property properties[1]; -}; - -#ifdef __OBJC__ -# if __has_attribute(__objc_root_class__) -__attribute__((__objc_root_class__)) -# endif -@interface Protocol -{ -@public -#else -typedef struct { -#endif - Class _Nonnull isa; - const char *_Nonnull name; - struct objc_protocol_list *_Nullable protocol_list; - struct objc_abi_method_description_list *_Nullable instance_methods; - struct objc_abi_method_description_list *_Nullable class_methods; -#ifdef __OBJC__ -} -@end -#else -} Protocol; -#endif - -struct objc_protocol_list { - struct objc_protocol_list *_Nullable next; - long count; - Protocol *__unsafe_unretained _Nonnull list[1]; -}; - -#if 1 /* !defined(__MORPHOS__) || defined(OF_COMPILING_OBJFW_RT) */ -# ifdef __cplusplus -extern "C" { -# endif -extern SEL _Nonnull sel_registerName(const char *_Nonnull); -extern const char *_Nonnull sel_getName(SEL _Nonnull); -extern bool sel_isEqual(SEL _Nonnull, SEL _Nonnull); -extern Class _Nonnull objc_allocateClassPair(Class _Nullable, - const char *_Nonnull, size_t); -extern void objc_registerClassPair(Class _Nonnull); -extern unsigned int objc_getClassList(Class _Nonnull *_Nullable, unsigned int); -extern Class _Nonnull *_Nonnull objc_copyClassList(unsigned int *_Nullable); -extern bool class_isMetaClass(Class _Nullable); -extern const char *_Nullable class_getName(Class _Nullable); -extern Class _Nullable class_getSuperclass(Class _Nullable); -extern unsigned long class_getInstanceSize(Class _Nullable); -extern bool class_respondsToSelector(Class _Nullable, SEL _Nonnull); -extern bool class_conformsToProtocol(Class _Nullable, Protocol *_Nonnull); -extern IMP _Nullable class_getMethodImplementation(Class _Nullable, - SEL _Nonnull); -extern IMP _Nullable class_getMethodImplementation_stret(Class _Nullable, - SEL _Nonnull); -extern const char *_Nullable class_getMethodTypeEncoding(Class _Nullable, - SEL _Nonnull); -extern bool class_addMethod(Class _Nonnull, SEL _Nonnull, IMP _Nonnull, - const char *_Nullable); -extern IMP _Nullable class_replaceMethod(Class _Nonnull, SEL _Nonnull, - IMP _Nonnull, const char *_Nullable); -extern Class _Nullable object_getClass(id _Nullable); -extern Class _Nullable object_setClass(id _Nullable, Class _Nonnull); -extern const char *_Nullable object_getClassName(id _Nullable); -extern const char *_Nonnull protocol_getName(Protocol *_Nonnull); -extern bool protocol_isEqual(Protocol *_Nonnull, Protocol *_Nonnull); -extern bool protocol_conformsToProtocol(Protocol *_Nonnull, Protocol *_Nonnull); -extern void objc_exit(void); -extern _Nullable objc_uncaught_exception_handler - objc_setUncaughtExceptionHandler( - objc_uncaught_exception_handler _Nullable); -extern void objc_setForwardHandler(IMP _Nullable, IMP _Nullable); -extern void objc_setEnumerationMutationHandler( - objc_enumeration_mutation_handler _Nullable); -extern void objc_zero_weak_references(id _Nonnull); -# ifdef __cplusplus -} -# endif -#else -# define BOOL EXEC_BOOL -# include -# undef BOOL -# ifdef __cplusplus -extern "C" { -# endif -extern struct Library *ObjFWRTBase; -# ifdef __cplusplus -} -# endif -# include "ppcinline.h" -#endif - -#ifdef __cplusplus -extern "C" { -#endif -/* - * Used by the compiler, but can also be called manually. - * - * They need to be in the glue code for the MorphOS library. - * - * These declarations are also required to prevent Clang's implicit - * declarations which include __declspec(dllimport) on Windows. - */ -struct objc_abi_module; -extern void __objc_exec_class(void *_Nonnull); -extern IMP _Nonnull objc_msg_lookup(id _Nullable, SEL _Nonnull); -extern IMP _Nonnull objc_msg_lookup_stret(id _Nullable, SEL _Nonnull); -extern IMP _Nonnull objc_msg_lookup_super(struct objc_super *_Nonnull, - SEL _Nonnull); -extern IMP _Nonnull objc_msg_lookup_super_stret(struct objc_super *_Nonnull, - SEL _Nonnull); -extern id _Nullable objc_lookUpClass(const char *_Nonnull); -extern id _Nullable objc_getClass(const char *_Nonnull); -extern id _Nonnull objc_getRequiredClass(const char *_Nonnull); -extern void objc_exception_throw(id _Nullable); -extern int objc_sync_enter(id _Nullable); -extern int objc_sync_exit(id _Nullable); -extern id _Nullable objc_getProperty(id _Nonnull, SEL _Nonnull, ptrdiff_t, - BOOL); -extern void objc_setProperty(id _Nonnull, SEL _Nonnull, ptrdiff_t, id _Nullable, - BOOL, signed char); -extern void objc_getPropertyStruct(void *_Nonnull, const void *_Nonnull, - ptrdiff_t, BOOL, BOOL); -extern void objc_setPropertyStruct(void *_Nonnull, const void *_Nonnull, - ptrdiff_t, BOOL, BOOL); -extern void objc_enumerationMutation(id _Nonnull); -#ifdef __cplusplus -} -#endif - -#endif ADDED src/runtime/ObjFW_RT.fd Index: src/runtime/ObjFW_RT.fd ================================================================== --- src/runtime/ObjFW_RT.fd +++ src/runtime/ObjFW_RT.fd @@ -0,0 +1,53 @@ +##base _ObjFWRTBase +##bias 30 +##public +* Functions for the glue code +objc_set_exit()(sysv,r12base) +* Used by the compiler - these need glue code +__objc_exec_class_inline()(sysv,r12base) +objc_msg_lookup_inline()(sysv,r12base) +objc_msg_lookup_stret_inline()(sysv,r12base) +objc_msg_lookup_super_inline()(sysv,r12base) +objc_msg_lookup_super_stret_inline()(sysv,r12base) +objc_lookUpClass_inline()(sysv,r12base) +objc_getClass_inline()(sysv,r12base) +objc_getRequiredClass_inline()(sysv,r12base) +objc_exception_throw_inline()(sysv,r12base) +objc_sync_enter_inline()(sysv,r12base) +objc_sync_exit_inline()(sysv,r12base) +objc_getProperty_inline()(sysv,r12base) +objc_setProperty_inline()(sysv,r12base) +objc_getPropertyStruct_inline()(sysv,r12base) +objc_setPropertyStruct_inline()(sysv,r12base) +objc_enumerationMutation_inline()(sysv,r12base) +* Functions declared in ObjFW_RT.h +sel_registerName()(sysv,r12base) +sel_getName()(sysv,r12base) +sel_isEqual()(sysv,r12base) +objc_allocateClassPair()(sysv,r12base) +objc_registerClassPair()(sysv,r12base) +objc_getClassList()(sysv,r12base) +objc_copyClassList()(sysv,r12base) +class_isMetaClass()(sysv,r12base) +class_getName()(sysv,r12base) +class_getSuperclass()(sysv,r12base) +class_getInstanceSize()(sysv,r12base) +class_respondsToSelector()(sysv,r12base) +class_conformsToProtocol()(sysv,r12base) +class_getMethodImplementation()(sysv,r12base) +class_getMethodImplementation_stret()(sysv,r12base) +class_getMethodTypeEncoding()(sysv,r12base) +class_addMethod()(sysv,r12base) +class_replaceMethod()(sysv,r12base) +object_getClass()(sysv,r12base) +object_setClass()(sysv,r12base) +object_getClassName()(sysv,r12base) +protocol_getName()(sysv,r12base) +protocol_isEqual()(sysv,r12base) +protocol_conformsToProtocol()(sysv,r12base) +objc_exit()(sysv,r12base) +objc_setUncaughtExceptionHandler()(sysv,r12base) +objc_setForwardHandler()(sysv,r12base) +objc_setEnumerationMutationHandler()(sysv,r12base) +objc_zero_weak_references()(sysv,r12base) +##end ADDED src/runtime/ObjFW_RT.h Index: src/runtime/ObjFW_RT.h ================================================================== --- src/runtime/ObjFW_RT.h +++ src/runtime/ObjFW_RT.h @@ -0,0 +1,303 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, + * 2018 + * Jonathan Schleifer + * + * All rights reserved. + * + * This file is part of ObjFW. It may be distributed under the terms of the + * Q Public License 1.0, which can be found in the file LICENSE.QPL included in + * the packaging of this file. + * + * Alternatively, it may be distributed under the terms of the GNU General + * Public License, either version 2 or 3, which can be found in the file + * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this + * file. + */ + +#ifndef __OBJFW_RUNTIME_H__ +#define __OBJFW_RUNTIME_H__ + +#ifndef __STDC_LIMIT_MACROS +# define __STDC_LIMIT_MACROS +#endif +#ifndef __STDC_CONSTANT_MACROS +# define __STDC_CONSTANT_MACROS +#endif + +#include +#include +#include + +#ifndef __has_feature +# define __has_feature(x) 0 +#endif + +#ifndef __has_attribute +# define __has_attribute(x) 0 +#endif + +#if !__has_feature(nullability) +# ifndef _Nonnull +# define _Nonnull +# endif +# ifndef _Nullable +# define _Nullable +# endif +# ifndef _Null_unspecified +# define _Null_unspecified +# endif +#endif + +#if !__has_feature(objc_arc) && !defined(__unsafe_unretained) +# define __unsafe_unretained +#endif + +#define Nil (Class _Null_unspecified)0 +#define nil (id _Null_unspecified)0 +#define YES (BOOL)1 +#define NO (BOOL)0 + +typedef struct objc_class *Class; +typedef struct objc_object *id; +typedef const struct objc_selector *SEL; +typedef signed char BOOL; +typedef id _Nullable (*IMP)(id _Nonnull, SEL _Nonnull, ...); +typedef void (*objc_uncaught_exception_handler)(id _Nullable); +typedef void (*objc_enumeration_mutation_handler)(id _Nonnull); + +struct objc_class { + Class _Nonnull isa; + Class _Nullable superclass; + const char *_Nonnull name; + unsigned long version; + unsigned long info; + long instance_size; + struct objc_ivar_list *_Nullable ivars; + struct objc_method_list *_Nullable methodlist; + struct objc_dtable *_Nonnull dtable; + Class _Nullable *_Nullable subclass_list; + void *_Nullable sibling_class; + struct objc_protocol_list *_Nullable protocols; + void *_Nullable gc_object_type; + unsigned long abi_version; + int32_t *_Nonnull *_Nullable ivar_offsets; + struct objc_property_list *_Nullable properties; +}; + +enum objc_class_info { + OBJC_CLASS_INFO_CLASS = 0x001, + OBJC_CLASS_INFO_METACLASS = 0x002, + OBJC_CLASS_INFO_NEW_ABI = 0x010, + OBJC_CLASS_INFO_SETUP = 0x100, + OBJC_CLASS_INFO_LOADED = 0x200, + OBJC_CLASS_INFO_DTABLE = 0x400, + OBJC_CLASS_INFO_INITIALIZED = 0x800 +}; + +struct objc_object { + Class _Nonnull isa; +}; + +struct objc_selector { + uintptr_t uid; + const char *_Nullable types; +}; + +struct objc_super { + id __unsafe_unretained _Nullable self; + Class _Nonnull cls; +}; + +struct objc_method { + struct objc_selector sel; + IMP _Nonnull imp; +}; + +struct objc_method_list { + struct objc_method_list *_Nullable next; + unsigned int count; + struct objc_method methods[1]; +}; + +struct objc_category { + const char *_Nonnull category_name; + const char *_Nonnull class_name; + struct objc_method_list *_Nullable instance_methods; + struct objc_method_list *_Nullable class_methods; + struct objc_protocol_list *_Nullable protocols; +}; + +struct objc_ivar { + const char *_Nonnull name; + const char *_Nonnull type; + unsigned int offset; +}; + +struct objc_ivar_list { + unsigned int count; + struct objc_ivar ivars[1]; +}; + +enum objc_property_attributes { + OBJC_PROPERTY_READONLY = 0x01, + OBJC_PROPERTY_GETTER = 0x02, + OBJC_PROPERTY_ASSIGN = 0x04, + OBJC_PROPERTY_READWRITE = 0x08, + OBJC_PROPERTY_RETAIN = 0x10, + OBJC_PROPERTY_COPY = 0x20, + OBJC_PROPERTY_NONATOMIC = 0x40, + OBJC_PROPERTY_SETTER = 0x80 +}; + +enum objc_property_extended_attributes { + OBJC_PROPERTY_SYNTHESIZE = 0x1, + OBJC_PROPERTY_DYNAMIC = 0x2, + OBJC_PROPERTY_PROTOCOL = 0x3, + OBJC_PROPERTY_ATOMIC = 0x4, + OBJC_PROPERTY_WEAK = 0x8, + OBJC_PROPERTY_STRONG = 0x10, + OBJC_PROPERTY_UNSAFE_UNRETAINED = 0x20 +}; + +struct objc_property { + const char *_Nonnull name; + unsigned char attributes, extended_attributes; + struct { + const char *_Nullable name; + const char *_Nullable type; + } getter, setter; +}; + +struct objc_property_list { + unsigned int count; + struct objc_property_list *_Nullable next; + struct objc_property properties[1]; +}; + +#ifdef __OBJC__ +# if __has_attribute(__objc_root_class__) +__attribute__((__objc_root_class__)) +# endif +@interface Protocol +{ +@public +#else +typedef struct { +#endif + Class _Nonnull isa; + const char *_Nonnull name; + struct objc_protocol_list *_Nullable protocol_list; + struct objc_abi_method_description_list *_Nullable instance_methods; + struct objc_abi_method_description_list *_Nullable class_methods; +#ifdef __OBJC__ +} +@end +#else +} Protocol; +#endif + +struct objc_protocol_list { + struct objc_protocol_list *_Nullable next; + long count; + Protocol *__unsafe_unretained _Nonnull list[1]; +}; + +#if 1 /* !defined(__MORPHOS__) || defined(OF_COMPILING_OBJFW_RT) */ +# ifdef __cplusplus +extern "C" { +# endif +extern SEL _Nonnull sel_registerName(const char *_Nonnull); +extern const char *_Nonnull sel_getName(SEL _Nonnull); +extern bool sel_isEqual(SEL _Nonnull, SEL _Nonnull); +extern Class _Nonnull objc_allocateClassPair(Class _Nullable, + const char *_Nonnull, size_t); +extern void objc_registerClassPair(Class _Nonnull); +extern unsigned int objc_getClassList(Class _Nonnull *_Nullable, unsigned int); +extern Class _Nonnull *_Nonnull objc_copyClassList(unsigned int *_Nullable); +extern bool class_isMetaClass(Class _Nullable); +extern const char *_Nullable class_getName(Class _Nullable); +extern Class _Nullable class_getSuperclass(Class _Nullable); +extern unsigned long class_getInstanceSize(Class _Nullable); +extern bool class_respondsToSelector(Class _Nullable, SEL _Nonnull); +extern bool class_conformsToProtocol(Class _Nullable, Protocol *_Nonnull); +extern IMP _Nullable class_getMethodImplementation(Class _Nullable, + SEL _Nonnull); +extern IMP _Nullable class_getMethodImplementation_stret(Class _Nullable, + SEL _Nonnull); +extern const char *_Nullable class_getMethodTypeEncoding(Class _Nullable, + SEL _Nonnull); +extern bool class_addMethod(Class _Nonnull, SEL _Nonnull, IMP _Nonnull, + const char *_Nullable); +extern IMP _Nullable class_replaceMethod(Class _Nonnull, SEL _Nonnull, + IMP _Nonnull, const char *_Nullable); +extern Class _Nullable object_getClass(id _Nullable); +extern Class _Nullable object_setClass(id _Nullable, Class _Nonnull); +extern const char *_Nullable object_getClassName(id _Nullable); +extern const char *_Nonnull protocol_getName(Protocol *_Nonnull); +extern bool protocol_isEqual(Protocol *_Nonnull, Protocol *_Nonnull); +extern bool protocol_conformsToProtocol(Protocol *_Nonnull, Protocol *_Nonnull); +extern void objc_exit(void); +extern _Nullable objc_uncaught_exception_handler + objc_setUncaughtExceptionHandler( + objc_uncaught_exception_handler _Nullable); +extern void objc_setForwardHandler(IMP _Nullable, IMP _Nullable); +extern void objc_setEnumerationMutationHandler( + objc_enumeration_mutation_handler _Nullable); +extern void objc_zero_weak_references(id _Nonnull); +# ifdef __cplusplus +} +# endif +#else +# define BOOL EXEC_BOOL +# include +# undef BOOL +# ifdef __cplusplus +extern "C" { +# endif +extern struct Library *ObjFWRTBase; +# ifdef __cplusplus +} +# endif +# include "ppcinline.h" +#endif + +#ifdef __cplusplus +extern "C" { +#endif +/* + * Used by the compiler, but can also be called manually. + * + * They need to be in the glue code for the MorphOS library. + * + * These declarations are also required to prevent Clang's implicit + * declarations which include __declspec(dllimport) on Windows. + */ +struct objc_abi_module; +extern void __objc_exec_class(void *_Nonnull); +extern IMP _Nonnull objc_msg_lookup(id _Nullable, SEL _Nonnull); +extern IMP _Nonnull objc_msg_lookup_stret(id _Nullable, SEL _Nonnull); +extern IMP _Nonnull objc_msg_lookup_super(struct objc_super *_Nonnull, + SEL _Nonnull); +extern IMP _Nonnull objc_msg_lookup_super_stret(struct objc_super *_Nonnull, + SEL _Nonnull); +extern id _Nullable objc_lookUpClass(const char *_Nonnull); +extern id _Nullable objc_getClass(const char *_Nonnull); +extern id _Nonnull objc_getRequiredClass(const char *_Nonnull); +extern void objc_exception_throw(id _Nullable); +extern int objc_sync_enter(id _Nullable); +extern int objc_sync_exit(id _Nullable); +extern id _Nullable objc_getProperty(id _Nonnull, SEL _Nonnull, ptrdiff_t, + BOOL); +extern void objc_setProperty(id _Nonnull, SEL _Nonnull, ptrdiff_t, id _Nullable, + BOOL, signed char); +extern void objc_getPropertyStruct(void *_Nonnull, const void *_Nonnull, + ptrdiff_t, BOOL, BOOL); +extern void objc_setPropertyStruct(void *_Nonnull, const void *_Nonnull, + ptrdiff_t, BOOL, BOOL); +extern void objc_enumerationMutation(id _Nonnull); +#ifdef __cplusplus +} +#endif + +#endif Index: src/runtime/arc.m ================================================================== --- src/runtime/arc.m +++ src/runtime/arc.m @@ -15,11 +15,11 @@ * file. */ #include "config.h" -#import "ObjFW-RT.h" +#import "ObjFW_RT.h" #import "private.h" #ifdef OF_HAVE_THREADS # import "threading.h" #endif Index: src/runtime/category.m ================================================================== --- src/runtime/category.m +++ src/runtime/category.m @@ -19,11 +19,11 @@ #include #include #include -#import "ObjFW-RT.h" +#import "ObjFW_RT.h" #import "private.h" static struct objc_hashtable *categories = NULL; static void Index: src/runtime/class.m ================================================================== --- src/runtime/class.m +++ src/runtime/class.m @@ -22,11 +22,11 @@ #include #include #include -#import "ObjFW-RT.h" +#import "ObjFW_RT.h" #import "private.h" static struct objc_hashtable *classes = NULL; static unsigned classes_cnt = 0; static Class *load_queue = NULL; Index: src/runtime/dtable.m ================================================================== --- src/runtime/dtable.m +++ src/runtime/dtable.m @@ -18,11 +18,11 @@ #include "config.h" #include #include -#import "ObjFW-RT.h" +#import "ObjFW_RT.h" #import "private.h" static struct objc_dtable_level2 *empty_level2 = NULL; #ifdef OF_SELUID24 static struct objc_dtable_level3 *empty_level3 = NULL; Index: src/runtime/exception.m ================================================================== --- src/runtime/exception.m +++ src/runtime/exception.m @@ -19,11 +19,11 @@ #include #include #include -#import "ObjFW-RT.h" +#import "ObjFW_RT.h" #import "private.h" #import "macros.h" #ifdef OF_HAVE_THREADS # include "threading.h" Index: src/runtime/hashtable.m ================================================================== --- src/runtime/hashtable.m +++ src/runtime/hashtable.m @@ -21,11 +21,11 @@ #include #include #include #include -#import "ObjFW-RT.h" +#import "ObjFW_RT.h" #import "private.h" struct objc_hashtable_bucket objc_deleted_bucket; uint32_t Index: src/runtime/init.m ================================================================== --- src/runtime/init.m +++ src/runtime/init.m @@ -15,11 +15,11 @@ * file. */ #include "config.h" -#import "ObjFW-RT.h" +#import "ObjFW_RT.h" #import "private.h" void __objc_exec_class(void *module_) { Index: src/runtime/lookup.m ================================================================== --- src/runtime/lookup.m +++ src/runtime/lookup.m @@ -18,11 +18,11 @@ #include "config.h" #include #include -#import "ObjFW-RT.h" +#import "ObjFW_RT.h" #import "private.h" #import "macros.h" @interface DummyObject { Index: src/runtime/misc.m ================================================================== --- src/runtime/misc.m +++ src/runtime/misc.m @@ -18,11 +18,11 @@ #include "config.h" #include #include -#include "ObjFW-RT.h" +#include "ObjFW_RT.h" #include "private.h" static objc_enumeration_mutation_handler enumeration_mutation_handler = NULL; void Index: src/runtime/morphos-library.m ================================================================== --- src/runtime/morphos-library.m +++ src/runtime/morphos-library.m @@ -15,11 +15,11 @@ * file. */ #include "config.h" -#import "ObjFW-RT.h" +#import "ObjFW_RT.h" #import "macros.h" #define BOOL EXEC_BOOL #include #include @@ -70,11 +70,11 @@ (ULONG)objc_getProperty, (ULONG)objc_setProperty, (ULONG)objc_getPropertyStruct, (ULONG)objc_setPropertyStruct, (ULONG)objc_enumerationMutation, - /* Functions declared in ObjFW-RT.h */ + /* Functions declared in ObjFW_RT.h */ (ULONG)sel_registerName, (ULONG)sel_getName, (ULONG)sel_isEqual, (ULONG)objc_allocateClassPair, (ULONG)objc_registerClassPair, @@ -128,12 +128,12 @@ .rt_EndSkip = &resident + 1, .rt_Flags = RTF_AUTOINIT | RTF_PPC, .rt_Version = OBJFW_RT_LIB_MAJOR * 10 + OBJFW_RT_LIB_MINOR, .rt_Type = NT_LIBRARY, .rt_Pri = 0, - .rt_Name = (char *)"objfw-rt.library", - .rt_IdString = (char *)"ObjFW-RT " PACKAGE_VERSION + .rt_Name = (char *)"objfw_rt.library", + .rt_IdString = (char *)"ObjFW_RT " PACKAGE_VERSION " \xA9 2008-2017 Jonathan Schleifer", .rt_Init = &init_table }; /* Magic required to make this a MorphOS binary */ Index: src/runtime/property.m ================================================================== --- src/runtime/property.m +++ src/runtime/property.m @@ -17,11 +17,11 @@ #include "config.h" #include -#import "ObjFW-RT.h" +#import "ObjFW_RT.h" #import "private.h" #import "OFObject.h" #ifdef OF_HAVE_THREADS Index: src/runtime/protocol.m ================================================================== --- src/runtime/protocol.m +++ src/runtime/protocol.m @@ -17,11 +17,11 @@ #include "config.h" #include -#import "ObjFW-RT.h" +#import "ObjFW_RT.h" #import "private.h" @implementation Protocol @end Index: src/runtime/selector.m ================================================================== --- src/runtime/selector.m +++ src/runtime/selector.m @@ -19,11 +19,11 @@ #include #include #include -#import "ObjFW-RT.h" +#import "ObjFW_RT.h" #import "private.h" #import "macros.h" #ifdef OF_SELUID24 Index: src/runtime/sparsearray.m ================================================================== --- src/runtime/sparsearray.m +++ src/runtime/sparsearray.m @@ -18,11 +18,11 @@ #include "config.h" #include #include -#import "ObjFW-RT.h" +#import "ObjFW_RT.h" #import "private.h" struct objc_sparsearray * objc_sparsearray_new(uint8_t index_size) { Index: src/runtime/static-instances.m ================================================================== --- src/runtime/static-instances.m +++ src/runtime/static-instances.m @@ -18,11 +18,11 @@ #include "config.h" #include #include -#import "ObjFW-RT.h" +#import "ObjFW_RT.h" #import "private.h" static struct objc_abi_static_instances **static_instances = NULL; static size_t static_instances_cnt = 0; Index: src/runtime/synchronized.m ================================================================== --- src/runtime/synchronized.m +++ src/runtime/synchronized.m @@ -18,11 +18,11 @@ #include "config.h" #include #include -#import "ObjFW-RT.h" +#import "ObjFW_RT.h" #import "private.h" #ifdef OF_HAVE_THREADS # import "threading.h" Index: src/runtime/threading.m ================================================================== --- src/runtime/threading.m +++ src/runtime/threading.m @@ -18,11 +18,11 @@ #include "config.h" #include #include -#import "ObjFW-RT.h" +#import "ObjFW_RT.h" #import "private.h" #import "threading.h" static of_rmutex_t global_mutex; static of_once_t once_control = OF_ONCE_INIT; Index: tests/Makefile ================================================================== --- tests/Makefile +++ tests/Makefile @@ -67,13 +67,13 @@ .PHONY: run run-on-ios run-on-android run: rm -f libobjfw.so.${OBJFW_LIB_MAJOR} rm -f libobjfw.so.${OBJFW_LIB_MAJOR_MINOR} rm -f libobjfw.dll libobjfw.${OBJFW_LIB_MAJOR}.dylib - rm -f libobjfw-rt.so.${OBJFW_RT_LIB_MAJOR} - rm -f libobjfw-rt.so.${OBJFW_RT_LIB_MAJOR_MINOR} - rm -f libobjfw-rt.dll libobjfw-rt.${OBJFW_RT_LIB_MAJOR}.dylib + rm -f libobjfw_rt.so.${OBJFW_RT_LIB_MAJOR} + rm -f libobjfw_rt.so.${OBJFW_RT_LIB_MAJOR_MINOR} + rm -f libobjfw_rt.dll libobjfw_rt.${OBJFW_RT_LIB_MAJOR}.dylib if test -f ../src/libobjfw.so; then \ ${LN_S} ../src/libobjfw.so libobjfw.so.${OBJFW_LIB_MAJOR}; \ ${LN_S} ../src/libobjfw.so \ libobjfw.so.${OBJFW_LIB_MAJOR_MINOR}; \ elif test -f ../src/libobjfw.so.${OBJFW_LIB_MAJOR_MINOR}; then \ @@ -85,36 +85,36 @@ fi if test -f ../src/libobjfw.dylib; then \ ${LN_S} ../src/libobjfw.dylib \ libobjfw.${OBJFW_LIB_MAJOR}.dylib; \ fi - if test -f ../src/runtime/libobjfw-rt.so; then \ - ${LN_S} ../src/runtime/libobjfw-rt.so \ - libobjfw-rt.so.${OBJFW_RT_LIB_MAJOR}; \ - ${LN_S} ../src/runtime/libobjfw-rt.so \ - libobjfw-rt.so.${OBJFW_RT_LIB_MAJOR_MINOR}; \ - elif test -f ../src/runtime/libobjfw-rt.so.${OBJFW_RT_LIB_MAJOR_MINOR}; then \ - ${LN_S} ../src/runtime/libobjfw-rt.so.${OBJFW_RT_LIB_MAJOR_MINOR} libobjfw-rt.so.${OBJFW_RT_LIB_MAJOR_MINOR}; \ - fi - if test -f ../src/runtime/libobjfw-rt.dll; then \ - ${LN_S} ../src/runtime/libobjfw-rt.dll libobjfw-rt.dll; \ - fi - if test -f ../src/runtime/libobjfw-rt.dylib; then \ - ${LN_S} ../src/runtime/libobjfw-rt.dylib \ - libobjfw-rt.${OBJFW_RT_LIB_MAJOR}.dylib; \ + if test -f ../src/runtime/libobjfw_rt.so; then \ + ${LN_S} ../src/runtime/libobjfw_rt.so \ + libobjfw_rt.so.${OBJFW_RT_LIB_MAJOR}; \ + ${LN_S} ../src/runtime/libobjfw_rt.so \ + libobjfw_rt.so.${OBJFW_RT_LIB_MAJOR_MINOR}; \ + elif test -f ../src/runtime/libobjfw_rt.so.${OBJFW_RT_LIB_MAJOR_MINOR}; then \ + ${LN_S} ../src/runtime/libobjfw_rt.so.${OBJFW_RT_LIB_MAJOR_MINOR} libobjfw_rt.so.${OBJFW_RT_LIB_MAJOR_MINOR}; \ + fi + if test -f ../src/runtime/libobjfw_rt.dll; then \ + ${LN_S} ../src/runtime/libobjfw_rt.dll libobjfw_rt.dll; \ + fi + if test -f ../src/runtime/libobjfw_rt.dylib; then \ + ${LN_S} ../src/runtime/libobjfw_rt.dylib \ + libobjfw_rt.${OBJFW_RT_LIB_MAJOR}.dylib; \ fi LD_LIBRARY_PATH=.$${LD_LIBRARY_PATH+:}$$LD_LIBRARY_PATH \ DYLD_LIBRARY_PATH=.$${DYLD_LIBRARY_PATH+:}$$DYLD_LIBRARY_PATH \ LIBRARY_PATH=.$${LIBRARY_PATH+:}$$LIBRARY_PATH \ ASAN_OPTIONS=allocator_may_return_null=1 \ ${WRAPPER} ./${PROG_NOINST}; EXIT=$$?; \ rm -f libobjfw.so.${OBJFW_LIB_MAJOR}; \ rm -f libobjfw.so.${OBJFW_LIB_MAJOR_MINOR} libobjfw.dll; \ rm -f libobjfw.${OBJFW_LIB_MAJOR}.dylib; \ - rm -f libobjfw-rt.so.${OBJFW_RT_LIB_MAJOR}; \ - rm -f libobjfw-rt.so.${OBJFW_RT_LIB_MAJOR_MINOR} libobjfw-rt.dll; \ - rm -f libobjfw-rt.${OBJFW_RT_LIB_MAJOR}.dylib; \ + rm -f libobjfw_rt.so.${OBJFW_RT_LIB_MAJOR}; \ + rm -f libobjfw_rt.so.${OBJFW_RT_LIB_MAJOR_MINOR} libobjfw_rt.dll; \ + rm -f libobjfw_rt.${OBJFW_RT_LIB_MAJOR}.dylib; \ exit $$EXIT run-on-ios: all if [ -z "${IOS_HOST}" ]; then \ echo "Please set IOS_HOST to the hostname of your iOS host!"; \ @@ -138,13 +138,13 @@ echo "Uploading files to Android device..." if test -f ../src/libobjfw.so; then \ adb push ../src/libobjfw.so \ /data/local/tmp/objfw/libobjfw.so.${OBJFW_LIB_MAJOR}; \ fi - if test -f ../src/runtime/libobjfw-rt.so; then \ - adb push ../src/runtime/libobjfw-rt.so \ - /data/local/tmp/objfw/libobjfw-rt.so.${OBJFW_RT_LIB_MAJOR}; \ + if test -f ../src/runtime/libobjfw_rt.so; then \ + adb push ../src/runtime/libobjfw_rt.so \ + /data/local/tmp/objfw/libobjfw_rt.so.${OBJFW_RT_LIB_MAJOR}; \ fi adb push tests /data/local/tmp/objfw/tests adb push testfile.bin /data/local/tmp/objfw/testfile.bin adb push testfile.txt /data/local/tmp/objfw/testfile.txt adb push testfile.ini /data/local/tmp/objfw/testfile.ini Index: tests/OFBlockTests.m ================================================================== --- tests/OFBlockTests.m +++ tests/OFBlockTests.m @@ -20,11 +20,11 @@ #import "OFBlock.h" #import "OFString.h" #import "OFAutoreleasePool.h" #if defined(OF_OBJFW_RUNTIME) -# include "ObjFW-RT.h" +# include "ObjFW_RT.h" #elif defined(OF_APPLE_RUNTIME) # include #endif #import "TestsAppDelegate.h" Index: tests/objc_sync/Makefile ================================================================== --- tests/objc_sync/Makefile +++ tests/objc_sync/Makefile @@ -10,13 +10,13 @@ .PHONY: run run: rm -f libobjfw.so.${OBJFW_LIB_MAJOR} rm -f libobjfw.so.${OBJFW_LIB_MAJOR_MINOR} rm -f libobjfw.dll libobjfw.${OBJFW_LIB_MAJOR}.dylib - rm -f libobjfw-rt.so.${OBJFW_RT_LIB_MAJOR} - rm -f libobjfw-rt.so.${OBJFW_RT_LIB_MAJOR_MINOR} - rm -f libobjfw-rt.dll libobjfw-rt.${OBJFW_RT_LIB_MAJOR}.dylib + rm -f libobjfw_rt.so.${OBJFW_RT_LIB_MAJOR} + rm -f libobjfw_rt.so.${OBJFW_RT_LIB_MAJOR_MINOR} + rm -f libobjfw_rt.dll libobjfw_rt.${OBJFW_RT_LIB_MAJOR}.dylib if test -f ../../src/libobjfw.so; then \ ${LN_S} ../../src/libobjfw.so libobjfw.so.${OBJFW_LIB_MAJOR}; \ ${LN_S} ../../src/libobjfw.so \ libobjfw.so.${OBJFW_LIB_MAJOR_MINOR}; \ elif test -f ../../src/libobjfw.so.${OBJFW_LIB_MAJOR_MINOR}; then \ @@ -28,35 +28,35 @@ fi if test -f ../../src/libobjfw.dylib; then \ ${LN_S} ../../src/libobjfw.dylib \ libobjfw.${OBJFW_LIB_MAJOR}.dylib; \ fi - if test -f ../../src/runtime/libobjfw-rt.so; then \ - ${LN_S} ../../src/runtime/libobjfw-rt.so \ - libobjfw-rt.so.${OBJFW_RT_LIB_MAJOR}; \ - ${LN_S} ../../src/runtime/libobjfw-rt.so \ - libobjfw-rt.so.${OBJFW_RT_LIB_MAJOR_MINOR}; \ - elif test -f ../../src/runtime/libobjfw-rt.so.${OBJFW_RT_LIB_MAJOR_MINOR}; then \ - ${LN_S} ../../src/runtime/libobjfw-rt.so.${OBJFW_RT_LIB_MAJOR_MINOR} libobjfw-rt.so.${OBJFW_RT_LIB_MAJOR_MINOR}; \ - fi - if test -f ../../src/runtime/libobjfw-rt.dll; then \ - ${LN_S} ../../src/runtime/libobjfw-rt.dll libobjfw-rt.dll; \ - fi - if test -f ../../src/runtime/libobjfw-rt.dylib; then \ - ${LN_S} ../../src/runtime/libobjfw-rt.dylib \ - libobjfw-rt.${OBJFW_RT_LIB_MAJOR}.dylib; \ + if test -f ../../src/runtime/libobjfw_rt.so; then \ + ${LN_S} ../../src/runtime/libobjfw_rt.so \ + libobjfw_rt.so.${OBJFW_RT_LIB_MAJOR}; \ + ${LN_S} ../../src/runtime/libobjfw_rt.so \ + libobjfw_rt.so.${OBJFW_RT_LIB_MAJOR_MINOR}; \ + elif test -f ../../src/runtime/libobjfw_rt.so.${OBJFW_RT_LIB_MAJOR_MINOR}; then \ + ${LN_S} ../../src/runtime/libobjfw_rt.so.${OBJFW_RT_LIB_MAJOR_MINOR} libobjfw_rt.so.${OBJFW_RT_LIB_MAJOR_MINOR}; \ + fi + if test -f ../../src/runtime/libobjfw_rt.dll; then \ + ${LN_S} ../../src/runtime/libobjfw_rt.dll libobjfw_rt.dll; \ + fi + if test -f ../../src/runtime/libobjfw_rt.dylib; then \ + ${LN_S} ../../src/runtime/libobjfw_rt.dylib \ + libobjfw_rt.${OBJFW_RT_LIB_MAJOR}.dylib; \ fi LD_LIBRARY_PATH=.$${LD_LIBRARY_PATH+:}$$LD_LIBRARY_PATH \ DYLD_LIBRARY_PATH=.$${DYLD_LIBRARY_PATH+:}$$DYLD_LIBRARY_PATH \ LIBRARY_PATH=.$${LIBRARY_PATH+:}$$LIBRARY_PATH \ ${WRAPPER} ./${PROG_NOINST}; EXIT=$$?; \ rm -f libobjfw.so.${OBJFW_LIB_MAJOR}; \ rm -f libobjfw.so.${OBJFW_LIB_MAJOR_MINOR} libobjfw.dll; \ rm -f libobjfw.${OBJFW_LIB_MAJOR}.dylib; \ - rm -f libobjfw-rt.so.${OBJFW_RT_LIB_MAJOR}; \ - rm -f libobjfw-rt.so.${OBJFW_RT_LIB_MAJOR_MINOR} libobjfw-rt.dll; \ - rm -f libobjfw-rt.${OBJFW_RT_LIB_MAJOR}.dylib; \ + rm -f libobjfw_rt.so.${OBJFW_RT_LIB_MAJOR}; \ + rm -f libobjfw_rt.so.${OBJFW_RT_LIB_MAJOR_MINOR} libobjfw_rt.dll; \ + rm -f libobjfw_rt.${OBJFW_RT_LIB_MAJOR}.dylib; \ exit $$EXIT CPPFLAGS += -I../../src/runtime -I../../src -I../.. LIBS := -L../../src -lobjfw ${LIBS} LD = ${OBJC} Index: utils/objfw-config.in ================================================================== --- utils/objfw-config.in +++ utils/objfw-config.in @@ -34,11 +34,11 @@ LDFLAGS="$LDFLAGS @WEAK_NSFOUNDATIONVERSIONNUMBER@" LDFLAGS_REEXPORT="@LDFLAGS_REEXPORT@" LDFLAGS_RPATH="@LDFLAGS_RPATH@" LIBS="-L${libdir} -lobjfw @RUNTIME_LIBS@ @LIBS@" FRAMEWORK_LIBS="-F${prefix}/Library/Frameworks -framework ObjFW" -FRAMEWORK_LIBS="$FRAMEWORK_LIBS @RUNTIME_LIBS@ @LIBS@" +FRAMEWORK_LIBS="$FRAMEWORK_LIBS @RUNTIME_FRAMEWORK_LIBS@ @LIBS@" PLUGIN_CFLAGS="@PLUGIN_CFLAGS@" PLUGIN_LDFLAGS="@PLUGIN_LDFLAGS@" PLUGIN_SUFFIX="@PLUGIN_SUFFIX@" PROG_SUFFIX="@EXEEXT@" STATIC_LIBS="${libdir}/libobjfw.a @LIBS@"