update Android.mk
authornotaz <notasas@gmail.com>
Sun, 20 Oct 2024 00:04:51 +0000 (03:04 +0300)
committernotaz <notasas@gmail.com>
Thu, 24 Oct 2024 23:50:18 +0000 (02:50 +0300)
no idea if it compiles a working library though...

Makefile
frontend/libretro-extern.T [new file with mode: 0644]
jni/Android.mk

index d269bb0..7f95fe4 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -484,7 +484,6 @@ endif
 
 clean: $(PLAT_CLEAN) clean_plugins
        $(RM) $(TARGET) *.o $(OBJS) $(TARGET).map frontend/revision.h
-       $(RM) frontend/libretro-extern.T
 
 ifneq ($(PLUGINS),)
 plugins_: $(PLUGINS)
diff --git a/frontend/libretro-extern.T b/frontend/libretro-extern.T
new file mode 100644 (file)
index 0000000..22555b3
--- /dev/null
@@ -0,0 +1,25 @@
+EXTERN(retro_api_version)
+EXTERN(retro_cheat_reset)
+EXTERN(retro_cheat_set)
+EXTERN(retro_deinit)
+EXTERN(retro_get_memory_data)
+EXTERN(retro_get_memory_size)
+EXTERN(retro_get_region)
+EXTERN(retro_get_system_av_info)
+EXTERN(retro_get_system_info)
+EXTERN(retro_init)
+EXTERN(retro_load_game)
+EXTERN(retro_load_game_special)
+EXTERN(retro_reset)
+EXTERN(retro_run)
+EXTERN(retro_serialize)
+EXTERN(retro_serialize_size)
+EXTERN(retro_set_audio_sample)
+EXTERN(retro_set_audio_sample_batch)
+EXTERN(retro_set_controller_port_device)
+EXTERN(retro_set_environment)
+EXTERN(retro_set_input_poll)
+EXTERN(retro_set_input_state)
+EXTERN(retro_set_video_refresh)
+EXTERN(retro_unload_game)
+EXTERN(retro_unserialize)
index 27459da..eeafc4e 100644 (file)
@@ -6,6 +6,8 @@ $(shell cd "$(LOCAL_PATH)" && (rm ../frontend/revision.h_))
 
 USE_LIBRETRO_VFS ?= 0
 USE_ASYNC_CDROM ?= 1
+USE_RTHREADS ?= 0
+NDRC_THREAD ?= 1
 
 ROOT_DIR     := $(LOCAL_PATH)/..
 CORE_DIR     := $(ROOT_DIR)/libpcsxcore
@@ -122,13 +124,9 @@ SOURCES_C += \
              $(LIBRETRO_COMMON)/vfs/vfs_implementation.c
 COREFLAGS += -DUSE_LIBRETRO_VFS
 endif
-ifeq ($(USE_ASYNC_CDROM),1)
-SOURCES_C += \
-             $(FRONTEND_DIR)/libretro-rthreads.c
-COREFLAGS += -DUSE_ASYNC_CDROM
-endif
 EXTRA_INCLUDES += $(LIBRETRO_COMMON)/include
 
+USE_RTHREADS=0
 HAVE_ARI64=0
 HAVE_LIGHTREC=0
 LIGHTREC_CUSTOM_MAP=0
@@ -164,6 +162,10 @@ ifeq ($(HAVE_ARI64),1)
                    $(SPU_DIR)/arm_utils.S \
                    $(DYNAREC_DIR)/linkage_arm.S
   endif
+  ifeq ($(NDRC_THREAD),1)
+  COREFLAGS   += -DNDRC_THREAD
+  USE_RTHREADS := 1
+  endif
 endif
   SOURCES_C   += $(DYNAREC_DIR)/emu_if.c
 
@@ -223,6 +225,17 @@ else
   SOURCES_C += $(PEOPS_DIR)/gpulib_if.c
 endif
 
+ifeq ($(USE_ASYNC_CDROM),1)
+COREFLAGS += -DUSE_ASYNC_CDROM
+USE_RTHREADS := 1
+endif
+ifeq ($(USE_RTHREADS),1)
+SOURCES_C += \
+             $(FRONTEND_DIR)/libretro-rthreads.c \
+             $(LIBRETRO_COMMON)/features/features_cpu.c
+COREFLAGS += -DHAVE_RTHREADS
+endif
+
 GIT_VERSION := " $(shell git rev-parse --short HEAD || echo unknown)"
 ifneq ($(GIT_VERSION)," unknown")
   COREFLAGS += -DGIT_VERSION=\"$(GIT_VERSION)\"
@@ -235,7 +248,9 @@ LOCAL_CFLAGS        := $(COREFLAGS)
 LOCAL_C_INCLUDES    := $(ROOT_DIR)/include
 LOCAL_C_INCLUDES    += $(DEPS_DIR)/crypto
 LOCAL_C_INCLUDES    += $(EXTRA_INCLUDES)
-LOCAL_LDFLAGS       := -Wl,-version-script=$(FRONTEND_DIR)/libretro-version-script
+LOCAL_LDFLAGS       += -Wl,-version-script=$(FRONTEND_DIR)/libretro-version-script
+LOCAL_LDFLAGS       += -Wl,--script=$(FRONTEND_DIR)/libretro-extern.T
+LOCAL_LDFLAGS       += -Wl,--gc-sections
 LOCAL_LDLIBS        := -lz -llog
 LOCAL_ARM_MODE      := arm