Index: configure.ac ================================================================== --- configure.ac +++ configure.ac @@ -230,80 +230,10 @@ -o x"$enable_shared" = x"no"; then AC_SUBST(RUNTIME_A, "runtime.a") AC_SUBST(RUNTIME_RUNTIME_A, "runtime/runtime.a") fi - AC_EGREP_CPP(yes, [ - #if defined(__amd64__) || defined(__x86_64__) - # ifdef __ELF__ - yes - # endif - #endif - ], [ - AC_SUBST(LOOKUP_S, lookup-amd64-elf.S) - AC_DEFINE(OF_ASM_LOOKUP, 1, - [Whether to use assembly for lookup]) - ], [ - 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_EGREP_CPP(yes, [ - #if defined(__amd64__) || defined(__x86_64__) - # ifdef __MACH__ - yes - # endif - #endif - ], [ - AC_SUBST(LOOKUP_S, lookup-amd64-macho.S) - AC_DEFINE(OF_ASM_LOOKUP, 1, - [Whether to use assembly for lookup]) - ]) - - AC_EGREP_CPP(yes, [ - #if defined(__ppc__) || defined(__PPC__) - # ifdef __ELF__ - yes - # endif - #endif - ], [ - AC_SUBST(LOOKUP_S, lookup-ppc-elf.S) - AC_DEFINE(OF_ASM_LOOKUP, 1, - [Whether to use assembly for lookup]) - ]) - - AC_EGREP_CPP(yes, [ - #if defined(__arm__) || defined(__ARM__) - # ifdef __ELF__ - yes - # endif - #endif - ], [ - AC_SUBST(LOOKUP_S, lookup-arm-elf.S) - AC_DEFINE(OF_ASM_LOOKUP, 1, - [Whether to use assembly for lookup]) - ]) - - AC_EGREP_CPP(yes, [ - #if defined(__mips) && __mips < 64 && defined(__ELF__) - # if defined(_MIPSEL) || defined(_MIPSEB) - yes - # endif - #endif - ], [ - AC_SUBST(LOOKUP_S, lookup-mips-elf.S) - AC_DEFINE(OF_ASM_LOOKUP, 1, - [Whether to use assembly for lookup]) - ]) - AS_IF([test x"$enable_seluid24" = x"yes"], [ AC_DEFINE(OF_SELUID24, 1, [Whether to use 24 bit selector UIDs]) ]) Index: extra.mk.in ================================================================== --- extra.mk.in +++ extra.mk.in @@ -18,11 +18,10 @@ EXCEPTIONS_EXCEPTIONS_LIB_A = @EXCEPTIONS_EXCEPTIONS_LIB_A@ EXCEPTIONS_LIB_A = @EXCEPTIONS_LIB_A@ FOUNDATION_COMPAT_M = @FOUNDATION_COMPAT_M@ INSTANCE_M = @INSTANCE_M@ LIBOBJFW_DEP = @LIBOBJFW_DEP@ -LOOKUP_S = @LOOKUP_S@ MAP_LDFLAGS = @MAP_LDFLAGS@ OFBLOCKTESTS_M = @OFBLOCKTESTS_M@ OFHTTPCLIENTTESTS_M = @OFHTTPCLIENTTESTS_M@ OFPROCESS_M = @OFPROCESS_M@ OFSTREAMOBSERVER_KQUEUE_M = @OFSTREAMOBSERVER_KQUEUE_M@ Index: src/runtime/Makefile ================================================================== --- src/runtime/Makefile +++ src/runtime/Makefile @@ -8,11 +8,11 @@ class.m \ exception.m \ hashtable.m \ init.m \ lookup.m \ - ${LOOKUP_S} \ + lookup-asm.S \ property.m \ protocol.m \ selector.m \ sparsearray.m \ static-instances.m \ ADDED src/runtime/lookup-asm.S Index: src/runtime/lookup-asm.S ================================================================== --- src/runtime/lookup-asm.S +++ src/runtime/lookup-asm.S @@ -0,0 +1,35 @@ +/* + * 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(__ELF__) +# if defined(__amd64__) || defined(__x86_64__) +# include "lookup-amd64-elf.S" +# elif defined(__i386__) +# include "lookup-x86-elf.S" +# elif defined(__ppc__) || defined(__PPC__) +# include "lookup-ppc-elf.S" +# elif defined(__arm__) || defined(__ARM__) +# include "lookup-arm-elf.S" +# elif defined(__mips) && __mips < 64 +# include "lookup-mips-elf.S" +# endif +#elif defined(__MACH__) +# if defined(__amd64__) || defined(__x86_64__) +# include "lookup-amd64-macho.S" +# endif +#endif Index: src/runtime/runtime-private.h ================================================================== --- src/runtime/runtime-private.h +++ src/runtime/runtime-private.h @@ -171,13 +171,26 @@ uint8_t j = idx; return (void*)s->buckets[i]->buckets[j]; #endif } + +#if defined(__ELF__) +# if defined(__amd64__) || defined(__x86_64__) || defined(__i386__) || \ + defined(__ppc__) || defined(__PPC__) || defined(__arm__) || defined(__ARM__) +# define OF_ASM_LOOKUP +# elif defined(__mips) && __mips < 64 +# define OF_ASM_LOOKUP +# endif +#elif defined(__MACH__) +# if defined(__amd64__) || defined(__x86_64__) +# define OF_ASM_LOOKUP +# endif +#endif #define OBJC_ERROR(...) \ { \ fprintf(stderr, "[objc @ " __FILE__ ":%d] ", __LINE__); \ fprintf(stderr, __VA_ARGS__); \ fputs("\n", stderr); \ abort(); \ }