build/stlport/Android.mk
author Mike Hommey <mh+mozilla@glandium.org>
Tue, 11 Feb 2014 10:37:47 +0900
changeset 168010 4e3b435b7d3950b9b366d5376f50f3d0d91dc85a
parent 138497 75ec39054b8a69b05128d2261a3b5a255eb485d4
child 223077 7d301619ebacf61442f86c6ac5b3c73abc6fa60b
permissions -rw-r--r--
Bug 969164 - Replace most BUILDING_JS uses with JS_STANDALONE. r=gps Before making top-level traverse js/src moz.build files, there was a need to distinguish between top-level traversing e.g. top-level moz.build or config/moz.build and js/src traversing them. With a single traversal of both moz.build sets, we now only need to distinguish between js standalone builds and gecko builds. There is still, however, a need to distinguish between top-level vs. js/src configure runs on gecko builds to make them subconfigure icu and libffi from top-level instead of js/src in js standalone builds, or when choosing to make js/src's config.status do something when run or not.

LOCAL_PATH := $(call my-dir)

# Normally, we distribute the NDK with prebuilt binaries of STLport
# in $LOCAL_PATH/<abi>/. However,
#

STLPORT_FORCE_REBUILD := $(strip $(STLPORT_FORCE_REBUILD))
ifndef STLPORT_FORCE_REBUILD
  ifeq (,$(strip $(wildcard $(LOCAL_PATH)/libs/$(TARGET_ARCH_ABI)/libstlport_static.a)))
    $(call __ndk_info,WARNING: Rebuilding STLport libraries from sources!)
    $(call __ndk_info,You might want to use $$NDK/build/tools/build-stlport.sh)
    $(call __ndk_info,in order to build prebuilt versions to speed up your builds!)
    STLPORT_FORCE_REBUILD := true
  endif
endif

libstlport_path := $(LOCAL_PATH)

libstlport_src_files := \
        src/dll_main.cpp \
        src/fstream.cpp \
        src/strstream.cpp \
        src/sstream.cpp \
        src/ios.cpp \
        src/stdio_streambuf.cpp \
        src/istream.cpp \
        src/ostream.cpp \
        src/iostream.cpp \
        src/codecvt.cpp \
        src/collate.cpp \
        src/ctype.cpp \
        src/monetary.cpp \
        src/num_get.cpp \
        src/num_put.cpp \
        src/num_get_float.cpp \
        src/num_put_float.cpp \
        src/numpunct.cpp \
        src/time_facets.cpp \
        src/messages.cpp \
        src/locale.cpp \
        src/locale_impl.cpp \
        src/locale_catalog.cpp \
        src/facets_byname.cpp \
        src/complex.cpp \
        src/complex_io.cpp \
        src/complex_trig.cpp \
        src/string.cpp \
        src/bitset.cpp \
        src/allocators.cpp \
        src/c_locale.c \
        src/cxa.c \

libstlport_cflags := -D_GNU_SOURCE
libstlport_cppflags := -fuse-cxa-atexit
libstlport_c_includes := $(libstlport_path)/stlport

#It is much more practical to include the sources of GAbi++ in our builds
# of STLport. This is similar to what the GNU libstdc++ does (it includes
# its own copy of libsupc++)
#
# This simplifies usage, since you only have to list a single library
# as a dependency, instead of two, especially when using the standalone
# toolchain.
#
include $(dir $(LOCAL_PATH))/gabi++/sources.mk

libstlport_c_includes += $(libgabi++_c_includes)

ifneq ($(STLPORT_FORCE_REBUILD),true)

$(call ndk_log,Using prebuilt STLport libraries)

include $(CLEAR_VARS)
LOCAL_MODULE := stlport_static
LOCAL_SRC_FILES := libs/$(TARGET_ARCH_ABI)/lib$(LOCAL_MODULE).a
LOCAL_EXPORT_C_INCLUDES := $(libstlport_c_includes)
LOCAL_CPP_FEATURES := rtti
include $(PREBUILT_STATIC_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE := stlport_shared
LOCAL_SRC_FILES := libs/$(TARGET_ARCH_ABI)/lib$(LOCAL_MODULE).so
LOCAL_EXPORT_C_INCLUDES := $(libstlport_c_includes)
LOCAL_CPP_FEATURES := rtti
include $(PREBUILT_SHARED_LIBRARY)

else # STLPORT_FORCE_REBUILD == true

$(call ndk_log,Rebuilding STLport libraries from sources)

include $(CLEAR_VARS)
LOCAL_MODULE := stlport_static
LOCAL_CPP_EXTENSION := .cpp .cc
LOCAL_SRC_FILES := $(libstlport_src_files)
LOCAL_SRC_FILES += $(libgabi++_src_files:%=../gabi++/%)
LOCAL_CFLAGS := $(libstlport_cflags)
LOCAL_CPPFLAGS := $(libstlport_cppflags)
LOCAL_C_INCLUDES := $(libstlport_c_includes)
LOCAL_EXPORT_C_INCLUDES := $(libstlport_c_includes)
LOCAL_CPP_FEATURES := rtti exceptions
include $(BUILD_STATIC_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE := stlport_shared
LOCAL_CPP_EXTENSION := .cpp .cc
LOCAL_SRC_FILES := $(libstlport_src_files)
LOCAL_SRC_FILES += $(libgabi++_src_files:%=../gabi++/%)
LOCAL_CFLAGS := $(libstlport_cflags)
LOCAL_CPPFLAGS := $(libstlport_cppflags)
LOCAL_C_INCLUDES := $(libstlport_c_includes)
LOCAL_EXPORT_C_INCLUDES := $(libstlport_c_includes)
LOCAL_CPP_FEATURES := rtti exceptions
include $(BUILD_SHARED_LIBRARY)

endif # STLPORT_FORCE_REBUILD == true