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 := $(call my-dir) 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 # Note: For now, this implementation depends on the system libstdc++ 58 # We may want to avoid that in the future, i.e. in order to 59 # properly support exceptions and RTTI. 60 libstlport_static_libs := libstdc++ 61 62 ifneq ($(STLPORT_FORCE_REBUILD),true) 63 64 $(call ndk_log,Using prebuilt STLport libraries) 65 66 include $(CLEAR_VARS) 67 LOCAL_MODULE := stlport_static 68 LOCAL_SRC_FILES := libs/$(TARGET_ARCH_ABI)/lib$(LOCAL_MODULE).a 69 LOCAL_STATIC_LIBRARIES := $(libstlport_static_libs) 70 LOCAL_EXPORT_C_INCLUDES := $(libstlport_c_includes) 71 include $(PREBUILT_STATIC_LIBRARY) 72 73 include $(CLEAR_VARS) 74 LOCAL_MODULE := stlport_shared 75 LOCAL_SRC_FILES := libs/$(TARGET_ARCH_ABI)/lib$(LOCAL_MODULE).so 76 LOCAL_STATIC_LIBRARIES := $(libstlport_static_libs) 77 LOCAL_EXPORT_C_INCLUDES := $(libstlport_c_includes) 78 include $(PREBUILT_SHARED_LIBRARY) 79 80 else # STLPORT_FORCE_REBUILD == true 81 82 $(call ndk_log,Rebuilding STLport libraries from sources) 83 84 include $(CLEAR_VARS) 85 LOCAL_MODULE := stlport_static 86 LOCAL_SRC_FILES := $(libstlport_src_files) 87 LOCAL_CFLAGS := $(libstlport_cflags) 88 LOCAL_CPPFLAGS := $(libstlport_cppflags) 89 LOCAL_C_INCLUDES := $(libstlport_c_includes) 90 LOCAL_STATIC_LIBRARIES := $(libstlport_static_libs) 91 LOCAL_EXPORT_C_INCLUDES := $(libstlport_c_includes) 92 include $(BUILD_STATIC_LIBRARY) 93 94 include $(CLEAR_VARS) 95 LOCAL_MODULE := stlport_shared 96 LOCAL_SRC_FILES := $(libstlport_src_files) 97 LOCAL_CFLAGS := $(libstlport_cflags) 98 LOCAL_CPPFLAGS := $(libstlport_cppflags) 99 LOCAL_C_INCLUDES := $(libstlport_c_includes) 100 LOCAL_STATIC_LIBRARIES := $(libstlport_static_libs) 101 LOCAL_EXPORT_C_INCLUDES := $(libstlport_c_includes) 102 include $(BUILD_SHARED_LIBRARY) 103 104 endif # STLPORT_FORCE_REBUILD == true 105 106 # See above not above libstdc++ dependency. 107 $(call import-module,cxx-stl/system) 108