michael@0: LOCAL_PATH := $(call my-dir) michael@0: michael@0: # Normally, we distribute the NDK with prebuilt binaries of STLport michael@0: # in $LOCAL_PATH//. However, michael@0: # michael@0: michael@0: STLPORT_FORCE_REBUILD := $(strip $(STLPORT_FORCE_REBUILD)) michael@0: ifndef STLPORT_FORCE_REBUILD michael@0: ifeq (,$(strip $(wildcard $(LOCAL_PATH)/libs/$(TARGET_ARCH_ABI)/libstlport_static.a))) michael@0: $(call __ndk_info,WARNING: Rebuilding STLport libraries from sources!) michael@0: $(call __ndk_info,You might want to use $$NDK/build/tools/build-stlport.sh) michael@0: $(call __ndk_info,in order to build prebuilt versions to speed up your builds!) michael@0: STLPORT_FORCE_REBUILD := true michael@0: endif michael@0: endif michael@0: michael@0: libstlport_path := $(LOCAL_PATH) michael@0: michael@0: libstlport_src_files := \ michael@0: src/dll_main.cpp \ michael@0: src/fstream.cpp \ michael@0: src/strstream.cpp \ michael@0: src/sstream.cpp \ michael@0: src/ios.cpp \ michael@0: src/stdio_streambuf.cpp \ michael@0: src/istream.cpp \ michael@0: src/ostream.cpp \ michael@0: src/iostream.cpp \ michael@0: src/codecvt.cpp \ michael@0: src/collate.cpp \ michael@0: src/ctype.cpp \ michael@0: src/monetary.cpp \ michael@0: src/num_get.cpp \ michael@0: src/num_put.cpp \ michael@0: src/num_get_float.cpp \ michael@0: src/num_put_float.cpp \ michael@0: src/numpunct.cpp \ michael@0: src/time_facets.cpp \ michael@0: src/messages.cpp \ michael@0: src/locale.cpp \ michael@0: src/locale_impl.cpp \ michael@0: src/locale_catalog.cpp \ michael@0: src/facets_byname.cpp \ michael@0: src/complex.cpp \ michael@0: src/complex_io.cpp \ michael@0: src/complex_trig.cpp \ michael@0: src/string.cpp \ michael@0: src/bitset.cpp \ michael@0: src/allocators.cpp \ michael@0: src/c_locale.c \ michael@0: src/cxa.c \ michael@0: michael@0: libstlport_cflags := -D_GNU_SOURCE michael@0: libstlport_cppflags := -fuse-cxa-atexit michael@0: libstlport_c_includes := $(libstlport_path)/stlport michael@0: michael@0: #It is much more practical to include the sources of GAbi++ in our builds michael@0: # of STLport. This is similar to what the GNU libstdc++ does (it includes michael@0: # its own copy of libsupc++) michael@0: # michael@0: # This simplifies usage, since you only have to list a single library michael@0: # as a dependency, instead of two, especially when using the standalone michael@0: # toolchain. michael@0: # michael@0: include $(dir $(LOCAL_PATH))/gabi++/sources.mk michael@0: michael@0: libstlport_c_includes += $(libgabi++_c_includes) michael@0: michael@0: ifneq ($(STLPORT_FORCE_REBUILD),true) michael@0: michael@0: $(call ndk_log,Using prebuilt STLport libraries) michael@0: michael@0: include $(CLEAR_VARS) michael@0: LOCAL_MODULE := stlport_static michael@0: LOCAL_SRC_FILES := libs/$(TARGET_ARCH_ABI)/lib$(LOCAL_MODULE).a michael@0: LOCAL_EXPORT_C_INCLUDES := $(libstlport_c_includes) michael@0: LOCAL_CPP_FEATURES := rtti michael@0: include $(PREBUILT_STATIC_LIBRARY) michael@0: michael@0: include $(CLEAR_VARS) michael@0: LOCAL_MODULE := stlport_shared michael@0: LOCAL_SRC_FILES := libs/$(TARGET_ARCH_ABI)/lib$(LOCAL_MODULE).so michael@0: LOCAL_EXPORT_C_INCLUDES := $(libstlport_c_includes) michael@0: LOCAL_CPP_FEATURES := rtti michael@0: include $(PREBUILT_SHARED_LIBRARY) michael@0: michael@0: else # STLPORT_FORCE_REBUILD == true michael@0: michael@0: $(call ndk_log,Rebuilding STLport libraries from sources) michael@0: michael@0: include $(CLEAR_VARS) michael@0: LOCAL_MODULE := stlport_static michael@0: LOCAL_CPP_EXTENSION := .cpp .cc michael@0: LOCAL_SRC_FILES := $(libstlport_src_files) michael@0: LOCAL_SRC_FILES += $(libgabi++_src_files:%=../gabi++/%) michael@0: LOCAL_CFLAGS := $(libstlport_cflags) michael@0: LOCAL_CPPFLAGS := $(libstlport_cppflags) michael@0: LOCAL_C_INCLUDES := $(libstlport_c_includes) michael@0: LOCAL_EXPORT_C_INCLUDES := $(libstlport_c_includes) michael@0: LOCAL_CPP_FEATURES := rtti exceptions michael@0: include $(BUILD_STATIC_LIBRARY) michael@0: michael@0: include $(CLEAR_VARS) michael@0: LOCAL_MODULE := stlport_shared michael@0: LOCAL_CPP_EXTENSION := .cpp .cc michael@0: LOCAL_SRC_FILES := $(libstlport_src_files) michael@0: LOCAL_SRC_FILES += $(libgabi++_src_files:%=../gabi++/%) michael@0: LOCAL_CFLAGS := $(libstlport_cflags) michael@0: LOCAL_CPPFLAGS := $(libstlport_cppflags) michael@0: LOCAL_C_INCLUDES := $(libstlport_c_includes) michael@0: LOCAL_EXPORT_C_INCLUDES := $(libstlport_c_includes) michael@0: LOCAL_CPP_FEATURES := rtti exceptions michael@0: include $(BUILD_SHARED_LIBRARY) michael@0: michael@0: endif # STLPORT_FORCE_REBUILD == true