Add the missing sysconf() function so that the GC/Wii builds will link
properly against Lightrec and GNU Lightning.
Signed-off-by: Paul Cercueil <paul@crapouillou.net>
LDLIBS += -lrt
OBJS += $(LIGHTREC_CUSTOM_MAP_OBJ)
endif
+ifeq ($(NEED_SYSCONF),1)
+OBJS += libpcsxcore/lightrec/sysconf.o
+endif
ifeq ($(LIGHTREC_THREADED_COMPILER),1)
OBJS += deps/lightrec/recompiler.o \
deps/lightrec/reaper.o
TARGET := $(TARGET_NAME)_libretro_$(platform).a
ifeq ($(platform), ngc)
CFLAGS += -DHW_DOL -mogc
- DYNAREC := 0 # missing sysconf()
+ NEED_SYSCONF := 1
else ifeq ($(platform), wii)
CFLAGS += -DHW_RVL -mrvl
- DYNAREC := 0 # missing sysconf()
+ NEED_SYSCONF := 1
else ifeq ($(platform), wiiu)
# -mwup was removed in newer devkitPPC versions
CFLAGS += -DHW_WUP
--- /dev/null
+#include <errno.h>
+#include <unistd.h>
+
+/* Implement the sysconf() symbol which is needed by GNU Lightning */
+long sysconf(int name)
+{
+ switch (name) {
+ case _SC_PAGE_SIZE:
+ return 4096;
+ default:
+ return -EINVAL;
+ }
+}