• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1LOCAL_PATH := $(call my-dir)
2
3# Normally, we distribute the NDK with prebuilt binaries of STLport
4# in $LOCAL_PATH/<abi>/. However,
5#
6
7STLPORT_FORCE_REBUILD := $(strip $(STLPORT_FORCE_REBUILD))
8ifndef 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-stlport.sh)
12    $(call __ndk_info,in order to build prebuilt versions to speed up your builds!)
13    STLPORT_FORCE_REBUILD := true
14  endif
15endif
16
17libstlport_path := $(LOCAL_PATH)
18
19libstlport_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
53libstlport_cflags := -D_GNU_SOURCE
54libstlport_cppflags := -fuse-cxa-atexit
55libstlport_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#
65include $(dir $(LOCAL_PATH))/gabi++/sources.mk
66
67libstlport_c_includes += $(libgabi++_c_includes)
68ifneq ($(strip $(filter-out $(NDK_KNOWN_ARCHS),$(TARGET_ARCH))),)
69libgabi++_src_files := src/delete.cc \
70                       src/new.cc
71endif
72
73ifneq ($(STLPORT_FORCE_REBUILD),true)
74
75$(call ndk_log,Using prebuilt STLport libraries)
76
77include $(CLEAR_VARS)
78LOCAL_MODULE := stlport_static
79LOCAL_SRC_FILES := libs/$(TARGET_ARCH_ABI)/lib$(LOCAL_MODULE)$(TARGET_LIB_EXTENSION)
80LOCAL_EXPORT_C_INCLUDES := $(libstlport_c_includes)
81LOCAL_CPP_FEATURES := rtti
82include $(PREBUILT_STATIC_LIBRARY)
83
84include $(CLEAR_VARS)
85LOCAL_MODULE := stlport_shared
86LOCAL_SRC_FILES := libs/$(TARGET_ARCH_ABI)/lib$(LOCAL_MODULE)$(TARGET_SONAME_EXTENSION)
87LOCAL_EXPORT_C_INCLUDES := $(libstlport_c_includes)
88LOCAL_CPP_FEATURES := rtti
89include $(PREBUILT_SHARED_LIBRARY)
90
91else # STLPORT_FORCE_REBUILD == true
92
93$(call ndk_log,Rebuilding STLport libraries from sources)
94
95include $(CLEAR_VARS)
96LOCAL_MODULE := stlport_static
97LOCAL_CPP_EXTENSION := .cpp .cc
98LOCAL_SRC_FILES := $(libstlport_src_files)
99LOCAL_SRC_FILES += $(libgabi++_src_files:%=../gabi++/%)
100LOCAL_CFLAGS := $(libstlport_cflags)
101LOCAL_CPPFLAGS := $(libstlport_cppflags)
102LOCAL_C_INCLUDES := $(libstlport_c_includes)
103LOCAL_EXPORT_C_INCLUDES := $(libstlport_c_includes)
104LOCAL_CPP_FEATURES := rtti exceptions
105include $(BUILD_STATIC_LIBRARY)
106
107include $(CLEAR_VARS)
108LOCAL_MODULE := stlport_shared
109LOCAL_CPP_EXTENSION := .cpp .cc
110LOCAL_SRC_FILES := $(libstlport_src_files)
111LOCAL_SRC_FILES += $(libgabi++_src_files:%=../gabi++/%)
112LOCAL_CFLAGS := $(libstlport_cflags)
113LOCAL_CPPFLAGS := $(libstlport_cppflags)
114LOCAL_C_INCLUDES := $(libstlport_c_includes)
115LOCAL_EXPORT_C_INCLUDES := $(libstlport_c_includes)
116LOCAL_CPP_FEATURES := rtti exceptions
117include $(BUILD_SHARED_LIBRARY)
118
119endif # STLPORT_FORCE_REBUILD == true
120