Index: configure.ac ================================================================== --- configure.ac +++ configure.ac @@ -200,10 +200,16 @@ enable_threads="no" # TODO enable_sockets="no" # TODO AC_DEFINE(OF_WII_U, 1, [Whether we are compiling for Wii U]) AC_SUBST(MAP_LDFLAGS, ['-Wl,-Map,$@.map']) + # Repetition of libraries is required for Wii U, as otherwise it cannot + # find main. Just moving -lobjfwtest later doesn't work either, as then + # the linker cannot find ObjFW symbols. So the only solution is to list + # everything twice, but hide it behind a variable because listing it + # twice causes a warning on macOS. + AC_SUBST(WII_U_TESTS_LIBS, '-lobjfwtest ${TESTS_LIBS} ${LIBS}') ]) AC_ARG_WITH(nds, AS_HELP_STRING([--with-nds], [build for Nintendo DS])) AS_IF([test x"$with_nds" = x"yes"], [ Index: extra.mk.in ================================================================== --- extra.mk.in +++ extra.mk.in @@ -92,6 +92,7 @@ USE_SRCS_SUBPROCESSES = @USE_SRCS_SUBPROCESSES@ USE_SRCS_TAGGED_POINTERS = @USE_SRCS_TAGGED_POINTERS@ USE_SRCS_THREADS = @USE_SRCS_THREADS@ USE_SRCS_UNIX_SOCKETS = @USE_SRCS_UNIX_SOCKETS@ USE_SRCS_WINDOWS = @USE_SRCS_WINDOWS@ +WII_U_TESTS_LIBS = @WII_U_TESTS_LIBS@ WRAPPER = @WRAPPER@ Index: tests/Makefile ================================================================== --- tests/Makefile +++ tests/Makefile @@ -231,17 +231,17 @@ -I../src/test \ -I.. \ -DOBJFWTEST_LOCAL_INCLUDES \ -DPROG_SUFFIX=\"${PROG_SUFFIX}\" OBJCFLAGS_RuntimeARCTests.m = -fobjc-arc -fobjc-arc-exceptions -# Repetition is required for Wii U, as otherwise it cannot find main. Just -# moving -lobjfwtest later doesn't work either, as then the linker cannot find -# ObjFW symbols. So the only solution is to list everything twice. -LIBS := -L../src/test \ - -lobjfwtest \ - ${TESTS_LIBS} \ - ${LIBS} \ - -lobjfwtest \ - ${TESTS_LIBS} \ - ${LIBS} +# Repetition of libraries is required for Wii U, as otherwise it cannot find +# main. Just moving -lobjfwtest later doesn't work either, as then the linker +# cannot find ObjFW symbols. So the only solution is to list everything twice, +# but hide it behind a variable because listing it twice causes a warning on +# macOS. +LIBS := -L../src/test \ + -lobjfwtest \ + ${TESTS_LIBS} \ + ${LIBS} \ + ${WII_U_TESTS_LIBS} LDFLAGS += ${MAP_LDFLAGS} LD = ${OBJC}