Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why $(call my-dir) in Android.mk file returned wrong path?

When I try to compile .so to a bibiliotek, I receive an error that the way is incorrect and instead of the local way expected by me I see a way to NDK, in what a problem, here my MK-file:

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)

Here that I receive on an output:

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)
like image 494
BORSHEVIK Avatar asked Oct 31 '22 09:10

BORSHEVIK


1 Answers

cd to the jni directory and call ndk-build, that worked for me.

like image 57
andy Avatar answered Nov 15 '22 06:11

andy