################################################################
#following code is modified copy of `cmd-build-shared-library` from %NDK%/toolchains/arm-linux-androideabi-4.4.3/setup.mk
# it is modified to use separate .linkargs file for linker, because otherwise 'Argument list too long' error occurs.
# /dnick
define cmd-build-shared-library
$(eval linkargs := $(call host-path,$@.linkargs))
@ echo 'Link arguments : ' $(linkargs)
$(hide) echo \
-Wl,-soname,$(notdir $@) \
-shared \
--sysroot=$(call host-path,$(PRIVATE_SYSROOT)) \
> $(linkargs)
$(hide) $(foreach object, $(call host-path, $(PRIVATE_OBJECTS)), echo '$(object)' >> $(linkargs); )
$(hide) echo \
$(call link-whole-archives,$(PRIVATE_WHOLE_STATIC_LIBRARIES)) \
$(call host-path,\
$(PRIVATE_STATIC_LIBRARIES) \
$(PRIVATE_LIBGCC) \
$(PRIVATE_SHARED_LIBRARIES)) \
$(PRIVATE_LDFLAGS) \
$(PRIVATE_LDLIBS) \
-o $(call host-path,$@) \
>> $(linkargs)
$(hide) $(PRIVATE_CXX) @$(linkargs)
endef
################################################################
#following code is modified copy of `cmd-build-shared-library` from %NDK%/toolchains/arm-linux-androideabi-4.4.3/setup.mk
# it is modified to use separate .linkargs file for linker, because otherwise 'Argument list too long' error occurs.
# /dnick
define cmd-build-shared-library
$(eval linkargs := $(call host-path,$@.linkargs))
@ echo 'Link arguments : ' $(linkargs)
$(hide) echo \
-Wl,-soname,$(notdir $@) \
-shared \
--sysroot=$(call host-path,$(PRIVATE_SYSROOT)) \
> $(linkargs)
$(hide) $(foreach object, $(call host-path, $(PRIVATE_OBJECTS)), echo '$(object)' >> $(linkargs); )
$(hide) echo \
$(call link-whole-archives,$(PRIVATE_WHOLE_STATIC_LIBRARIES)) \
$(call host-path,\
$(PRIVATE_STATIC_LIBRARIES) \
$(PRIVATE_LIBGCC) \
$(PRIVATE_SHARED_LIBRARIES)) \
$(PRIVATE_LDFLAGS) \
$(PRIVATE_LDLIBS) \
-o $(call host-path,$@) \
>> $(linkargs)
$(hide) $(PRIVATE_CXX) @$(linkargs)
endef
################################################################