当我尝试将 .so 编译为 bibiliotek 时,我收到一条错误消息,指出方式不正确,而不是我所期望的本地方式,我看到了 NDK 的方式,这是什么问题,这里是我的 MK 文件:
include $(CLEAR_VARS)
LOCAL_PATH := $(call my-dir)
@echo "Local path = $LOCAL_PATH"
SCRIPT := $(LOCAL_PATH)/LuaJIT/build.sh
ECHO_RESULT1 := $(shell $(SCRIPT))
#ECHO_RESULT := $(shell ($(LOCAL_PATH)/LuaJit/build.sh))
@echo "ECHO_RESULT1=$(ECHO_RESULT1)"
include $(CLEAR_VARS)
LOCAL_MODULE := libluajit
LOCAL_SRC_FILES := $(LOCAL_PATH)/jnlua/src/libluajit.a
include $(PREBUILT_STATIC_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := libjnlua
LOCAL_C_INCLUDES += $(LOCAL_PATH)/LuaJit/src
LOCAL_SRC_FILES := $(LOCAL_PATH)/jnlua/src/jnlua.c
LOCAL_LDLIBS := -llog
LOCAL_CFLAGS := -O2 -Wall -DLUA_COMPAT_ALL
#LOCAL_SHARED_LIBRARIES := libjavavm
LOCAL_STATIC_LIBRARIES := libluajit
# POSIX as we're on linux, and compatibility mode in case you'll be running scripts written for LUA <5.2
include $(BUILD_SHARED_LIBRARY)
在这里我收到一个输出:
11:30:47 **** Incremental Build of configuration Default for project jnlua-android ****
"C:\\Users\\Dev1\\Downloads\\android-ndk-r10e-windows-x86_64\\android-ndk-r10e\\ndk-build.cmd" V=1 all all
Android NDK: ERROR:jni/Android.mk:luajit: LOCAL_SRC_FILES points to a missing file
process_begin: CreateProcess(NULL, C:/Users/Dev1/Downloads/android-ndk-r10e-windows-x86_64/android-ndk-r10e/build/core/LuaJIT/build.sh, ...) failed.
C:/Users/Dev1/Downloads/android-ndk-r10e-windows-x86_64/android-ndk-r10e/build/core/prebuilt-library.mk:45: *** Android NDK: Aborting . Stop.
Android NDK: Check that C:/Users/Dev1/Downloads/android-ndk-r10e-windows-x86_64/android-ndk-r10e/build/core/jnlua/src/libluajit.a exists or that its path is correct
11:30:47 Build Finished (took 122ms)