1 LOCAL_PATH := $(call my-dir) 2 3 # Normally, we distribute the NDK with prebuilt binaries of STLport 4 # in $LOCAL_PATH/libs/<abi>/. However, 5 # 6 7 STLPORT_FORCE_REBUILD := $(strip $(STLPORT_FORCE_REBUILD)) 8 ifndef STLPORT_FORCE_REBUILD 9 ifeq (,$(strip $(wildcard $(LOCAL_PATH)/libs/$(TARGET_ARCH_ABI)/libstlport_static$(TARGET_LIB_EXTENSION)))) 10 $(call __ndk_info,WARNING: Rebuilding STLport libraries from sources!) 11 $(call __ndk_info,You might want to use $$NDK/build/tools/build-cxx-stl.sh --stl=stlport) 12 $(call __ndk_info,in order to build prebuilt versions to speed up your builds!) 13 STLPORT_FORCE_REBUILD := true 14 endif 15 endif 16 17 libstlport_path := $(LOCAL_PATH) 18 19 libstlport_src_files := \ 20 src/dll_main.cpp \ 21 src/fstream.cpp \ 22 src/strstream.cpp \ 23 src/sstream.cpp \ 24 src/ios.cpp \ 25 src/stdio_streambuf.cpp \ 26 src/istream.cpp \ 27 src/ostream.cpp \ 28 src/iostream.cpp \ 29 src/codecvt.cpp \ 30 src/collate.cpp \ 31 src/ctype.cpp \ 32 src/monetary.cpp \ 33 src/num_get.cpp \ 34 src/num_put.cpp \ 35 src/num_get_float.cpp \ 36 src/num_put_float.cpp \ 37 src/numpunct.cpp \ 38 src/time_facets.cpp \ 39 src/messages.cpp \ 40 src/locale.cpp \ 41 src/locale_impl.cpp \ 42 src/locale_catalog.cpp \ 43 src/facets_byname.cpp \ 44 src/complex.cpp \ 45 src/complex_io.cpp \ 46 src/complex_trig.cpp \ 47 src/string.cpp \ 48 src/bitset.cpp \ 49 src/allocators.cpp \ 50 src/c_locale.c \ 51 src/cxa.c \ 52 53 libstlport_cflags := -D_GNU_SOURCE 54 libstlport_cppflags := -fuse-cxa-atexit 55 libstlport_c_includes := $(libstlport_path)/stlport 56 57 #It is much more practical to include the sources of GAbi++ in our builds 58 # of STLport. This is similar to what the GNU libstdc++ does (it includes 59 # its own copy of libsupc++) 60 # 61 # This simplifies usage, since you only have to list a single library 62 # as a dependency, instead of two, especially when using the standalone 63 # toolchain. 64 # 65 include $(dir $(LOCAL_PATH))/gabi++/sources.mk 66 67 libstlport_c_includes += $(libgabi++_c_includes) 68 ifneq ($(strip $(filter-out $(NDK_KNOWN_ARCHS),$(TARGET_ARCH))),) 69 libgabi++_src_files := src/delete.cc \ 70 src/new.cc 71 endif 72 73 ifneq ($(STLPORT_FORCE_REBUILD),true) 74 75 $(call ndk_log,Using prebuilt STLport libraries) 76 77 include $(CLEAR_VARS) 78 LOCAL_MODULE := stlport_static 79 LOCAL_SRC_FILES := libs/$(TARGET_ARCH_ABI)/lib$(LOCAL_MODULE)$(TARGET_LIB_EXTENSION) 80 LOCAL_EXPORT_C_INCLUDES := $(libstlport_c_includes) 81 LOCAL_CPP_FEATURES := rtti 82 include $(PREBUILT_STATIC_LIBRARY) 83 84 include $(CLEAR_VARS) 85 LOCAL_MODULE := stlport_shared 86 LOCAL_SRC_FILES := libs/$(TARGET_ARCH_ABI)/lib$(LOCAL_MODULE)$(TARGET_SONAME_EXTENSION) 87 LOCAL_EXPORT_C_INCLUDES := $(libstlport_c_includes) 88 LOCAL_CPP_FEATURES := rtti 89 include $(PREBUILT_SHARED_LIBRARY) 90 91 else # STLPORT_FORCE_REBUILD == true 92 93 $(call ndk_log,Rebuilding STLport libraries from sources) 94 95 include $(CLEAR_VARS) 96 LOCAL_MODULE := stlport_static 97 LOCAL_CPP_EXTENSION := .cpp .cc 98 LOCAL_SRC_FILES := $(libstlport_src_files) 99 LOCAL_SRC_FILES += $(libgabi++_src_files:%=../gabi++/%) 100 LOCAL_CFLAGS := $(libstlport_cflags) 101 LOCAL_CPPFLAGS := $(libstlport_cppflags) 102 LOCAL_C_INCLUDES := $(libstlport_c_includes) 103 LOCAL_EXPORT_C_INCLUDES := $(libstlport_c_includes) 104 LOCAL_CPP_FEATURES := rtti exceptions 105 include $(BUILD_STATIC_LIBRARY) 106 107 include $(CLEAR_VARS) 108 LOCAL_MODULE := stlport_shared 109 LOCAL_CPP_EXTENSION := .cpp .cc 110 LOCAL_SRC_FILES := $(libstlport_src_files) 111 LOCAL_SRC_FILES += $(libgabi++_src_files:%=../gabi++/%) 112 LOCAL_CFLAGS := $(libstlport_cflags) 113 LOCAL_CPPFLAGS := $(libstlport_cppflags) 114 LOCAL_C_INCLUDES := $(libstlport_c_includes) 115 LOCAL_EXPORT_C_INCLUDES := $(libstlport_c_includes) 116 LOCAL_CPP_FEATURES := rtti exceptions 117 include $(BUILD_SHARED_LIBRARY) 118 119 endif # STLPORT_FORCE_REBUILD == true 120