1 LOCAL_PATH := $(call my-dir) 2 3 # Normally, we distribute the NDK with prebuilt binaries of STLport 4 # in $LOCAL_PATH/<abi>/. However, 5 # 6 7 STLPORT_FORCE_REBUILD := $(strip $(STLPORT_FORCE_REBUILD)) 8 ifndef STLPORT_FORCE_REBUILD 9 ifeq (,$(strip $(wildcard $(LOCAL_PATH)/libs/armeabi/libstlport_static.a))) 10 $(call __ndk_info,WARNING: Rebuilding STLport libraries from sources!) 11 $(call __ndk_info,You might want to use $$NDK/build/tools/build-stlport.sh) 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 69 ifneq ($(STLPORT_FORCE_REBUILD),true) 70 71 $(call ndk_log,Using prebuilt STLport libraries) 72 73 include $(CLEAR_VARS) 74 LOCAL_MODULE := stlport_static 75 LOCAL_SRC_FILES := libs/$(TARGET_ARCH_ABI)/lib$(LOCAL_MODULE).a 76 LOCAL_EXPORT_C_INCLUDES := $(libstlport_c_includes) 77 LOCAL_CPP_FEATURES := rtti 78 include $(PREBUILT_STATIC_LIBRARY) 79 80 include $(CLEAR_VARS) 81 LOCAL_MODULE := stlport_shared 82 LOCAL_SRC_FILES := libs/$(TARGET_ARCH_ABI)/lib$(LOCAL_MODULE).so 83 LOCAL_EXPORT_C_INCLUDES := $(libstlport_c_includes) 84 LOCAL_CPP_FEATURES := rtti 85 include $(PREBUILT_SHARED_LIBRARY) 86 87 else # STLPORT_FORCE_REBUILD == true 88 89 $(call ndk_log,Rebuilding STLport libraries from sources) 90 91 include $(CLEAR_VARS) 92 LOCAL_MODULE := stlport_static 93 LOCAL_CPP_EXTENSION := .cpp .cc 94 LOCAL_SRC_FILES := $(libstlport_src_files) 95 LOCAL_SRC_FILES += $(libgabi++_src_files:%=../gabi++/%) 96 LOCAL_CFLAGS := $(libstlport_cflags) 97 LOCAL_CPPFLAGS := $(libstlport_cppflags) 98 LOCAL_C_INCLUDES := $(libstlport_c_includes) 99 LOCAL_EXPORT_C_INCLUDES := $(libstlport_c_includes) 100 LOCAL_CPP_FEATURES := rtti 101 include $(BUILD_STATIC_LIBRARY) 102 103 include $(CLEAR_VARS) 104 LOCAL_MODULE := stlport_shared 105 LOCAL_CPP_EXTENSION := .cpp .cc 106 LOCAL_SRC_FILES := $(libstlport_src_files) 107 LOCAL_SRC_FILES += $(libgabi++_src_files:%=../gabi++/%) 108 LOCAL_CFLAGS := $(libstlport_cflags) 109 LOCAL_CPPFLAGS := $(libstlport_cppflags) 110 LOCAL_C_INCLUDES := $(libstlport_c_includes) 111 LOCAL_EXPORT_C_INCLUDES := $(libstlport_c_includes) 112 LOCAL_CPP_FEATURES := rtti 113 include $(BUILD_SHARED_LIBRARY) 114 115 endif # STLPORT_FORCE_REBUILD == true 116