Index: configure.ac ================================================================== --- configure.ac +++ configure.ac @@ -238,26 +238,21 @@ yes # endif #endif ], [ AC_SUBST(LOOKUP_S, lookup-amd64-elf.S) - AC_SUBST(FORWARDING_S, forwarding-amd64-elf.S) AC_DEFINE(OF_ASM_LOOKUP, 1, [Whether to use assembly for lookup]) - AC_DEFINE(OF_HAVE_FORWARDING_TARGET_FOR_SELECTOR, 1, - [Whether we have forwardingTargetForSelector:]) ], [ AC_EGREP_CPP(yes, [ #if defined(__i386__) && defined(__ELF__) yes #endif ], [ AC_SUBST(LOOKUP_S, lookup-x86-elf.S) AC_DEFINE(OF_ASM_LOOKUP, 1, [Whether to use assembly for lookup]) - AC_DEFINE(OF_HAVE_FORWARDING_TARGET_FOR_SELECTOR, 1, - [Whether we have forwardingTargetForSelector:]) ]) ]) AC_EGREP_CPP(yes, [ #if defined(__amd64__) || defined(__x86_64__) @@ -359,17 +354,10 @@ AC_CHECK_LIB(objc, objc_msgSend, [ LIBS="-lobjc $LIBS" ], [ AC_MSG_ERROR([libobjc not found!]) ]) - - dnl We should check for PPC64, as this currently does not - dnl support forwardingTargetForSelector: as there is no test - dnl machine available. - AC_SUBST(FORWARDING_S, "apple-forwarding.S") - AC_DEFINE(OF_HAVE_FORWARDING_TARGET_FOR_SELECTOR, 1, - [Whether we have forwardingTargetForSelector:]) ;; esac AC_CHECK_FUNC(objc_constructInstance, [], [ AC_SUBST(INSTANCE_M, "instance.m") Index: extra.mk.in ================================================================== --- extra.mk.in +++ extra.mk.in @@ -6,21 +6,19 @@ OBJFW_LIB_MAJOR_MINOR = ${OBJFW_LIB_MAJOR}.${OBJFW_LIB_MINOR} OBJFW_BRIDGE_SHARED_LIB = @OBJFW_BRIDGE_SHARED_LIB@ OBJFW_BRIDGE_STATIC_LIB = @OBJFW_BRIDGE_STATIC_LIB@ -APPLE_FORWARDING_S = @APPLE_FORWARDING_S@ ASPRINTF_M = @ASPRINTF_M@ ATOMIC_H = @ATOMIC_H@ AUTORELEASE_M = @AUTORELEASE_M@ BIN_PREFIX = @BIN_PREFIX@ BRIDGE = @BRIDGE@ EXCEPTIONS_A = @EXCEPTIONS_A@ EXCEPTIONS_EXCEPTIONS_A = @EXCEPTIONS_EXCEPTIONS_A@ EXCEPTIONS_EXCEPTIONS_LIB_A = @EXCEPTIONS_EXCEPTIONS_LIB_A@ EXCEPTIONS_LIB_A = @EXCEPTIONS_LIB_A@ -FORWARDING_S = @FORWARDING_S@ FOUNDATION_COMPAT_M = @FOUNDATION_COMPAT_M@ INSTANCE_M = @INSTANCE_M@ LIBOBJFW_DEP = @LIBOBJFW_DEP@ LOOKUP_S = @LOOKUP_S@ MAP_LDFLAGS = @MAP_LDFLAGS@ Index: src/Makefile ================================================================== --- src/Makefile +++ src/Makefile @@ -114,11 +114,11 @@ OFMutableSet_hashtable.m \ OFMutableString_UTF8.m \ OFSet_hashtable.m \ OFString_UTF8.m \ ${ASPRINTF_M} \ - ${FORWARDING_S} \ + forwarding.S \ ${FOUNDATION_COMPAT_M} \ iso_8859_15.m \ windows_1252.m SRCS_SOCKETS += ${OFSTREAMOBSERVER_KQUEUE_M} \ ${OFSTREAMOBSERVER_POLL_M} \ DELETED src/apple-forwarding.S Index: src/apple-forwarding.S ================================================================== --- src/apple-forwarding.S +++ src/apple-forwarding.S @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013 - * 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. - */ - -#include "config.h" - -#if defined(__x86_64__) -# include "apple-forwarding-x86_64.S" -#elif defined(__i386__) -# include "apple-forwarding-i386.S" -#elif defined(__arm__) -# include "apple-forwarding-arm.S" -#elif defined(__ppc__) -# include "apple-forwarding-ppc.S" -#endif ADDED src/forwarding.S Index: src/forwarding.S ================================================================== --- src/forwarding.S +++ src/forwarding.S @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013 + * 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. + */ + +#include "config.h" + +#ifdef OF_APPLE_RUNTIME +# if defined(__x86_64__) +# include "apple-forwarding-x86_64.S" +# elif defined(__i386__) +# include "apple-forwarding-i386.S" +# elif defined(__arm__) +# include "apple-forwarding-arm.S" +# elif defined(__ppc__) +# include "apple-forwarding-ppc.S" +# endif +#else +# ifdef __ELF__ +# if defined(__amd64__) || defined(__x86_64__) +# include "forwarding-x86_64-elf.S" +# elif defined(__i386__) +# include "forwarding-x86-elf.S" +# endif +# endif +#endif Index: src/macros.h ================================================================== --- src/macros.h +++ src/macros.h @@ -103,10 +103,23 @@ # ifdef OF_ARMV7_ASM # define OF_ARMV6_ASM # endif # endif #endif + +#ifdef OF_APPLE_RUNTIME +# if defined(__x86_64__) || defined(__i386__) || defined(__arm__) || \ + defined(__ppc__) +# define OF_HAVE_FORWARDING_TARGET_FOR_SELECTOR +# endif +#else +# ifdef __ELF__ +# if defined(__amd64__) || defined(__x86_64__) || defined(__i386__) +# define OF_HAVE_FORWARDING_TARGET_FOR_SELECTOR +# endif +# endif +#endif #define OF_ENSURE(cond) \ if (!(cond)) { \ fprintf(stderr, "Failed to ensure condition in " \ __FILE__ ":%d:\n" #cond "\n", __LINE__); \