mirror of
https://github.com/servalproject/serval-dna.git
synced 2024-12-19 21:27:57 +00:00
Change Android.mk to only compile a single .a file
This will require any android application to include their own shared library rules similar to the following; include $(CLEAR_VARS) LOCAL_STATIC_LIBRARIES := servaldstatic LOCAL_C_INCLUDES += $(LOCAL_PATH)/serval-dna LOCAL_SRC_FILES := $(LOCAL_PATH)/features.c LOCAL_MODULE := servaldaemon LOCAL_LDLIBS += -L$(SYSROOT)/usr/lib -llog include $(BUILD_SHARED_LIBRARY) Allowing just the set of required features to be linked into the final binary
This commit is contained in:
parent
4809d7d585
commit
5c2f553ed2
31
Android.mk
31
Android.mk
@ -56,36 +56,11 @@ SERVALD_LOCAL_CFLAGS = \
|
|||||||
SERVALD_LOCAL_LDLIBS = -L$(SYSROOT)/usr/lib -llog
|
SERVALD_LOCAL_LDLIBS = -L$(SYSROOT)/usr/lib -llog
|
||||||
SERVALD_LOCAL_STATIC_LIBRARIES += sodium
|
SERVALD_LOCAL_STATIC_LIBRARIES += sodium
|
||||||
|
|
||||||
# Build libservald.so
|
# Build libservaldtatic.a
|
||||||
include $(CLEAR_VARS)
|
include $(CLEAR_VARS)
|
||||||
LOCAL_STATIC_LIBRARIES := $(SERVALD_LOCAL_STATIC_LIBRARIES)
|
LOCAL_STATIC_LIBRARIES := $(SERVALD_LOCAL_STATIC_LIBRARIES)
|
||||||
LOCAL_SRC_FILES := $(SERVALD_SRC_FILES) version_servald.c
|
LOCAL_SRC_FILES := $(SERVALD_SRC_FILES) version_servald.c
|
||||||
LOCAL_CFLAGS += $(SERVALD_LOCAL_CFLAGS)
|
LOCAL_CFLAGS += $(SERVALD_LOCAL_CFLAGS)
|
||||||
LOCAL_C_INCLUDES += $(SODIUM_INCLUDE)
|
LOCAL_C_INCLUDES += $(SODIUM_INCLUDE)
|
||||||
LOCAL_LDLIBS := $(SERVALD_LOCAL_LDLIBS)
|
LOCAL_MODULE := servaldstatic
|
||||||
LOCAL_MODULE := servaldaemon
|
include $(BUILD_STATIC_LIBRARY)
|
||||||
include $(BUILD_SHARED_LIBRARY)
|
|
||||||
|
|
||||||
# Build servald executable, a wrapper around libservald.so
|
|
||||||
ifdef SERVALD_WRAP
|
|
||||||
include $(CLEAR_VARS)
|
|
||||||
LOCAL_SRC_FILES:= servalwrap.c
|
|
||||||
LOCAL_MODULE:= servald
|
|
||||||
LOCAL_CFLAGS += -fPIE
|
|
||||||
LOCAL_LDFLAGS += -fPIE -pie
|
|
||||||
include $(BUILD_EXECUTABLE)
|
|
||||||
endif
|
|
||||||
|
|
||||||
# Build servald executable for use with gdb
|
|
||||||
ifdef SERVALD_SIMPLE
|
|
||||||
include $(CLEAR_VARS)
|
|
||||||
LOCAL_SRC_FILES:= $(SERVALD_SRC_FILES) version_servald.c
|
|
||||||
LOCAL_CFLAGS += $(SERVALD_LOCAL_CFLAGS)
|
|
||||||
LOCAL_LDLIBS := $(SERVALD_LOCAL_LDLIBS)
|
|
||||||
LOCAL_C_INCLUDES += $(SODIUM_INCLUDE)
|
|
||||||
LOCAL_STATIC_LIBRARIES := $(SERVALD_LOCAL_STATIC_LIBRARIES)
|
|
||||||
LOCAL_MODULE:= servaldsimple
|
|
||||||
LOCAL_CFLAGS += -fPIE
|
|
||||||
LOCAL_LDFLAGS += -fPIE -pie
|
|
||||||
include $(BUILD_EXECUTABLE)
|
|
||||||
endif
|
|
||||||
|
Loading…
Reference in New Issue
Block a user