Index: configure.ac ================================================================== --- configure.ac +++ configure.ac @@ -269,16 +269,34 @@ AC_SUBST(INVOCATION_A, "invocation.a") AC_SUBST(INVOCATION_INVOCATION_A, "invocation/invocation.a") AC_SUBST(LOOKUP_ASM_A, "lookup-asm.a") AC_SUBST(LOOKUP_ASM_LOOKUP_ASM_A, "lookup-asm/lookup-asm.a") ]) + +AS_IF([test x"$build_framework" = x"yes"], [ + TESTS_LIBS="-framework ObjFW \${RUNTIME_FRAMEWORK_LIBS} $TESTS_LIBS" + TESTS_LIBS="-F../src -F../src/runtime $TESTS_LIBS" +], [ + TESTS_LIBS="-lobjfw \${RUNTIME_LIBS} $TESTS_LIBS" + TESTS_LIBS="-L../src -L../src/runtime $TESTS_LIBS" +]) AC_DEFINE_UNQUOTED(PLUGIN_SUFFIX, "$PLUGIN_SUFFIX", [Suffix for plugins]) AS_IF([test x"$PLUGIN_SUFFIX" != x""], [ AC_SUBST(USE_SRCS_PLUGINS, '${SRCS_PLUGINS}') AC_SUBST(TESTPLUGIN, "plugin") AC_DEFINE(OF_HAVE_PLUGINS, 1, [Whether we have plugin support]) + + AS_IF([test x"$build_framework" = x"yes"], [ + TESTPLUGIN_LIBS="-F../../src -F../../src/runtime" + TESTPLUGIN_LIBS="$TESTPLUGIN_LIBS -framework ObjFW" + TESTPLUGIN_LIBS="$TESTPLUGIN_LIBS \${RUNTIME_FRAMEWORK_LIBS}" + ], [ + TESTPLUGIN_LIBS="-L../../src -L../../src/runtime" + TESTPLUGIN_LIBS="$TESTPLUGIN_LIBS -lobjfw \${RUNTIME_LIBS}" + ]) + AC_SUBST(TESTPLUGIN_LIBS) ]) AC_MSG_CHECKING(whether we need -D_GNU_SOURCE) AC_EGREP_CPP(yes, [ #include Index: extra.mk.in ================================================================== --- extra.mk.in +++ extra.mk.in @@ -64,10 +64,11 @@ RUNTIME = @RUNTIME@ RUNTIME_FRAMEWORK_LIBS = @RUNTIME_FRAMEWORK_LIBS@ RUNTIME_LIBS = @RUNTIME_LIBS@ RUN_TESTS = @RUN_TESTS@ TESTPLUGIN = @TESTPLUGIN@ +TESTPLUGIN_LIBS = @TESTPLUGIN_LIBS@ TESTS_LIBS = @TESTS_LIBS@ TESTS_OBJCFLAGS = @TESTS_OBJCFLAGS@ TESTS_STATIC_LIB = @TESTS_STATIC_LIB@ UNICODE_M = @UNICODE_M@ USE_INCLUDES_ATOMIC = @USE_INCLUDES_ATOMIC@ Index: tests/Makefile ================================================================== --- tests/Makefile +++ tests/Makefile @@ -101,10 +101,11 @@ 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_FRAMEWORK_PATH=../src$${DYLD_FRAMEWORK_PATH+:}$$DYLD_FRAMEWORK_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}; \ @@ -180,8 +181,8 @@ ${PROG_NOINST}.3dsx: ${PROG_NOINST} 3dsxtool $< $@ CPPFLAGS += -I../src -I../src/exceptions -I../src/runtime -I.. -DSTDOUT OBJCFLAGS += ${TESTS_OBJCFLAGS} -LIBS := -L../src -lobjfw -L../src/runtime ${RUNTIME_LIBS} ${TESTS_LIBS} ${LIBS} +LIBS := ${TESTS_LIBS} ${LIBS} LDFLAGS += ${MAP_LDFLAGS} LD = ${OBJC} Index: tests/plugin/Makefile ================================================================== --- tests/plugin/Makefile +++ tests/plugin/Makefile @@ -3,7 +3,7 @@ include ../../buildsys.mk include ../../extra.mk CPPFLAGS += -I../.. -I../../src -I../../src/runtime -LIBS := -L../../src -lobjfw -L../../src/runtime ${RUNTIME_LIBS} ${LIBS} +LIBS := ${TESTPLUGIN_LIBS} ${LIBS} LD = ${OBJC}