GPS
GPS

Reputation: 1382

How to avoid: ndk-build adds lib prefix to shared libraries

On using $BUILD_SHARED_LIBRARY as shown below, and calling ndk-build, I get a library named libmyaudio.so

LOCAL_MODULE := myaudio
LOCAL_SRC_FILES := loop.c
LOCAL_SHARED_LIBRARIES := liblog libcutils
LOCAL_MODULE_TAGS := optional
LOCAL_CFLAGS := -Wno-unused-parameter $(INCLUDE_PATH)
LOCAL_LDFLAGS += -llog
include $(BUILD_SHARED_LIBRARY)

What can I change in Android.mk to ensure that built file is myaudio.so instead of libmyaudio.so

Upvotes: 1

Views: 394

Answers (1)

Michael
Michael

Reputation: 58427

Use LOCAL_MODULE_FILENAME:

LOCAL_MODULE_FILENAME := myaudio

From the NDK documentation:

This optional variable allows you to override the names that the build system uses by default for files that it generates. [...] Note: You cannot override filepath or file extension.

Upvotes: 2

Related Questions