aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPrzemyslaw Szczepaniak <pszczepaniak@google.com>2013-02-04 18:00:41 +0000
committerPrzemyslaw Szczepaniak <pszczepaniak@google.com>2013-02-05 10:41:08 +0000
commit5d8e19eb3b3c4b541df50f8eddd6198b4be992a4 (patch)
treeabf9e29bf5da6341a031fe0ba9fb16a90d0cb134
parentfea56d8416b7ec51681edecae82c3b4b8c7b7e15 (diff)
downloadwebrtc-5d8e19eb3b3c4b541df50f8eddd6198b4be992a4.tar.gz
Add libwebrtc_audio_coding_gnustl_static static library
Attempt number 2. Now with working tests. This change allows to build fully unbundled GoogleTTS apk that can be deployed on any >= ICS_MR1 device. All static libraries under src/* can be build using ndk stl libraries, using WEBRTC_STL varible. libwebrtc_audio_coding_gnustl_static is static version of libwebrtc_audio_coding, build using gnustl from ndk. Change-Id: I41a5163eb434432eab3131f5df23ffd311e6159b
-rw-r--r--Android.mk41
-rw-r--r--src/common_audio/resampler/Android.mk15
-rw-r--r--src/common_audio/signal_processing/Android.mk14
-rw-r--r--src/common_audio/vad/Android.mk15
-rw-r--r--src/modules/audio_coding/codecs/isac/fix/source/Android.mk45
-rw-r--r--src/modules/audio_coding/codecs/isac/main/source/Android.mk15
-rw-r--r--src/modules/audio_processing/Android.mk42
-rw-r--r--src/modules/audio_processing/aec/Android.mk14
-rw-r--r--src/modules/audio_processing/aecm/Android.mk23
-rw-r--r--src/modules/audio_processing/agc/Android.mk13
-rw-r--r--src/modules/audio_processing/ns/Android.mk25
-rw-r--r--src/modules/audio_processing/utility/Android.mk13
-rw-r--r--src/system_wrappers/source/Android.mk15
13 files changed, 249 insertions, 41 deletions
diff --git a/Android.mk b/Android.mk
index 7b046d67af..8faadaa14f 100644
--- a/Android.mk
+++ b/Android.mk
@@ -23,6 +23,13 @@ include $(MY_WEBRTC_ROOT_PATH)/src/modules/audio_processing/utility/Android.mk
#include $(MY_WEBRTC_ROOT_PATH)/src/modules/utility/source/Android.mk
include $(MY_WEBRTC_ROOT_PATH)/src/system_wrappers/source/Android.mk
+# libwebrtc_audio_coding_gnustl_static dependencies
+WEBRTC_STL := gnustl_static
+include $(MY_WEBRTC_ROOT_PATH)/src/system_wrappers/source/Android.mk
+include $(MY_WEBRTC_ROOT_PATH)/src/modules/audio_coding/codecs/isac/main/source/Android.mk
+include $(MY_WEBRTC_ROOT_PATH)/src/modules/audio_coding/codecs/isac/fix/source/Android.mk
+include $(MY_WEBRTC_ROOT_PATH)/src/common_audio/signal_processing/Android.mk
+
# build .so
LOCAL_PATH := $(call my-dir)
@@ -67,6 +74,7 @@ include external/stlport/libstlport.mk
endif
include $(BUILD_SHARED_LIBRARY)
+
include $(CLEAR_VARS)
include $(LOCAL_PATH)/../../external/webrtc/android-webrtc.mk
@@ -79,7 +87,6 @@ LOCAL_WHOLE_STATIC_LIBRARIES := \
libwebrtc_isacfix \
libwebrtc_spl \
libwebrtc_system_wrappers
-
ifeq ($(WEBRTC_BUILD_NEON_LIBS),true)
LOCAL_WHOLE_STATIC_LIBRARIES += \
libwebrtc_isacfix_neon
@@ -87,7 +94,6 @@ endif
LOCAL_STATIC_LIBRARIES := \
libprotobuf-cpp-2.3.0-lite
-
LOCAL_SHARED_LIBRARIES := \
libcutils \
libdl \
@@ -99,3 +105,34 @@ ifndef NDK_ROOT
include external/stlport/libstlport.mk
endif
include $(BUILD_SHARED_LIBRARY)
+
+
+include $(CLEAR_VARS)
+include $(LOCAL_PATH)/../../external/webrtc/android-webrtc.mk
+
+LOCAL_ARM_MODE := arm
+LOCAL_MODULE := libwebrtc_audio_coding_gnustl_static
+LOCAL_MODULE_TAGS := optional
+
+LOCAL_WHOLE_STATIC_LIBRARIES := \
+ libwebrtc_isac_gnustl_static \
+ libwebrtc_isacfix_gnustl_static \
+ libwebrtc_spl_gnustl_static \
+ libwebrtc_system_wrappers_gnustl_static
+ifeq ($(WEBRTC_BUILD_NEON_LIBS),true)
+LOCAL_WHOLE_STATIC_LIBRARIES += \
+ libwebrtc_isacfix_neon_gnustl_static
+endif
+
+LOCAL_STATIC_LIBRARIES := \
+ libprotobuf-cpp-2.3.0-lite
+LOCAL_SHARED_LIBRARIES := \
+ libcutils \
+ libdl
+
+LOCAL_PRELINK_MODULE := false
+
+LOCAL_NDK_STL_VARIANT := gnustl_static
+LOCAL_SDK_VERSION := 14
+
+include $(BUILD_STATIC_LIBRARY)
diff --git a/src/common_audio/resampler/Android.mk b/src/common_audio/resampler/Android.mk
index b1d630aa23..8238eb58bf 100644
--- a/src/common_audio/resampler/Android.mk
+++ b/src/common_audio/resampler/Android.mk
@@ -26,12 +26,11 @@ LOCAL_CFLAGS := \
LOCAL_C_INCLUDES := \
$(LOCAL_PATH)/include \
$(LOCAL_PATH)/../.. \
- $(LOCAL_PATH)/../signal_processing/include
+ $(LOCAL_PATH)/../signal_processing/include
LOCAL_SHARED_LIBRARIES := \
libcutils \
- libdl \
- libstlport
+ libdl
ifeq ($(TARGET_OS)-$(TARGET_SIMULATOR),linux-true)
LOCAL_LDLIBS += -ldl -lpthread
@@ -42,6 +41,16 @@ LOCAL_SHARED_LIBRARIES += libdl
endif
ifndef NDK_ROOT
+ifndef WEBRTC_STL
+LOCAL_SHARED_LIBRARIES += libstlport
include external/stlport/libstlport.mk
+else
+LOCAL_NDK_STL_VARIANT := $(WEBRTC_STL)
+LOCAL_SDK_VERSION := 14
+LOCAL_MODULE := $(LOCAL_MODULE)_$(WEBRTC_STL)
endif
+else
+LOCAL_SHARED_LIBRARIES += libstlport
+endif
+
include $(BUILD_STATIC_LIBRARY)
diff --git a/src/common_audio/signal_processing/Android.mk b/src/common_audio/signal_processing/Android.mk
index a056e7e489..142a66e6c1 100644
--- a/src/common_audio/signal_processing/Android.mk
+++ b/src/common_audio/signal_processing/Android.mk
@@ -55,7 +55,7 @@ LOCAL_CFLAGS := \
LOCAL_C_INCLUDES := \
$(LOCAL_PATH)/include \
- $(LOCAL_PATH)/../..
+ $(LOCAL_PATH)/../..
ifeq ($(ARCH_ARM_HAVE_NEON),true)
LOCAL_SRC_FILES += \
@@ -72,8 +72,6 @@ LOCAL_SRC_FILES += \
spl_sqrt_floor.c
endif
-LOCAL_SHARED_LIBRARIES := libstlport
-
ifeq ($(TARGET_OS)-$(TARGET_SIMULATOR),linux-true)
LOCAL_LDLIBS += -ldl -lpthread
endif
@@ -83,6 +81,16 @@ LOCAL_SHARED_LIBRARIES += libdl
endif
ifndef NDK_ROOT
+ifndef WEBRTC_STL
+LOCAL_SHARED_LIBRARIES += libstlport
include external/stlport/libstlport.mk
+else
+LOCAL_NDK_STL_VARIANT := $(WEBRTC_STL)
+LOCAL_SDK_VERSION := 14
+LOCAL_MODULE := $(LOCAL_MODULE)_$(WEBRTC_STL)
endif
+else
+LOCAL_SHARED_LIBRARIES += libstlport
+endif
+
include $(BUILD_STATIC_LIBRARY)
diff --git a/src/common_audio/vad/Android.mk b/src/common_audio/vad/Android.mk
index b7be3f0307..6cacbdb940 100644
--- a/src/common_audio/vad/Android.mk
+++ b/src/common_audio/vad/Android.mk
@@ -30,11 +30,10 @@ LOCAL_CFLAGS := \
LOCAL_C_INCLUDES := \
$(LOCAL_PATH)/include \
$(LOCAL_PATH)/../.. \
- $(LOCAL_PATH)/../signal_processing/include
+ $(LOCAL_PATH)/../signal_processing/include
LOCAL_SHARED_LIBRARIES := \
- libdl \
- libstlport
+ libdl
ifeq ($(TARGET_OS)-$(TARGET_SIMULATOR),linux-true)
LOCAL_LDLIBS += -ldl -lpthread
@@ -45,6 +44,16 @@ LOCAL_SHARED_LIBRARIES += libdl
endif
ifndef NDK_ROOT
+ifndef WEBRTC_STL
+LOCAL_SHARED_LIBRARIES += libstlport
include external/stlport/libstlport.mk
+else
+LOCAL_NDK_STL_VARIANT := $(WEBRTC_STL)
+LOCAL_SDK_VERSION := 14
+LOCAL_MODULE := $(LOCAL_MODULE)_$(WEBRTC_STL)
endif
+else
+LOCAL_SHARED_LIBRARIES += libstlport
+endif
+
include $(BUILD_STATIC_LIBRARY)
diff --git a/src/modules/audio_coding/codecs/isac/fix/source/Android.mk b/src/modules/audio_coding/codecs/isac/fix/source/Android.mk
index bd95ed8125..b9931c472d 100644
--- a/src/modules/audio_coding/codecs/isac/fix/source/Android.mk
+++ b/src/modules/audio_coding/codecs/isac/fix/source/Android.mk
@@ -69,12 +69,21 @@ LOCAL_STATIC_LIBRARIES += libwebrtc_system_wrappers
LOCAL_SHARED_LIBRARIES := \
libcutils \
- libdl \
- libstlport
+ libdl
ifndef NDK_ROOT
+ifndef WEBRTC_STL
+LOCAL_SHARED_LIBRARIES += libstlport
include external/stlport/libstlport.mk
+else
+LOCAL_NDK_STL_VARIANT := $(WEBRTC_STL)
+LOCAL_SDK_VERSION := 14
+LOCAL_MODULE := $(LOCAL_MODULE)_$(WEBRTC_STL)
+endif
+else
+LOCAL_SHARED_LIBRARIES += libstlport
endif
+
include $(BUILD_STATIC_LIBRARY)
#########################
@@ -104,10 +113,19 @@ LOCAL_C_INCLUDES := \
$(LOCAL_PATH)/../../../../../.. \
$(LOCAL_PATH)/../../../../../../common_audio/signal_processing/include
-
ifndef NDK_ROOT
+ifndef WEBRTC_STL
+LOCAL_SHARED_LIBRARIES += libstlport
include external/stlport/libstlport.mk
+else
+LOCAL_NDK_STL_VARIANT := $(WEBRTC_STL)
+LOCAL_SDK_VERSION := 14
+LOCAL_MODULE := $(LOCAL_MODULE)_$(WEBRTC_STL)
+endif
+else
+LOCAL_SHARED_LIBRARIES += libstlport
endif
+
include $(BUILD_STATIC_LIBRARY)
endif # ifeq ($(WEBRTC_BUILD_NEON_LIBS),true)
@@ -128,14 +146,19 @@ LOCAL_C_INCLUDES := \
$(LOCAL_PATH)/../interface \
$(LOCAL_PATH)/../../../../../..
+MY_LIB_SUFFIX :=
+ifdef WEBRTC_STL
+MY_LIB_SUFFIX := _$(WEBRTC_STL)
+endif
+
LOCAL_STATIC_LIBRARIES := \
- libwebrtc_isacfix \
- libwebrtc_spl \
- libwebrtc_system_wrappers
+ libwebrtc_isacfix$(MY_LIB_SUFFIX) \
+ libwebrtc_spl$(MY_LIB_SUFFIX) \
+ libwebrtc_system_wrappers$(MY_LIB_SUFFIX)
ifeq ($(WEBRTC_BUILD_NEON_LIBS),true)
LOCAL_STATIC_LIBRARIES += \
- libwebrtc_isacfix_neon
+ libwebrtc_isacfix_neon$(MY_LIB_SUFFIX)
endif
LOCAL_SHARED_LIBRARIES := \
@@ -146,5 +169,13 @@ LOCAL_MODULE:= webrtc_isac_test
ifdef NDK_ROOT
include $(BUILD_EXECUTABLE)
else
+ifndef WEBRTC_STL
+LOCAL_SHARED_LIBRARIES += libstlport
+include external/stlport/libstlport.mk
+else
+LOCAL_NDK_STL_VARIANT := $(WEBRTC_STL)
+LOCAL_SDK_VERSION := 14
+LOCAL_MODULE := $(LOCAL_MODULE)_$(WEBRTC_STL)
+endif
include $(BUILD_NATIVE_TEST)
endif
diff --git a/src/modules/audio_coding/codecs/isac/main/source/Android.mk b/src/modules/audio_coding/codecs/isac/main/source/Android.mk
index 07b2a314b5..bacd15192b 100644
--- a/src/modules/audio_coding/codecs/isac/main/source/Android.mk
+++ b/src/modules/audio_coding/codecs/isac/main/source/Android.mk
@@ -53,14 +53,23 @@ LOCAL_CFLAGS := \
LOCAL_C_INCLUDES := \
$(LOCAL_PATH)/../interface \
$(LOCAL_PATH)/../../../../../.. \
- $(LOCAL_PATH)/../../../../../../common_audio/signal_processing/include
+ $(LOCAL_PATH)/../../../../../../common_audio/signal_processing/include
LOCAL_SHARED_LIBRARIES := \
libcutils \
- libdl \
- libstlport
+ libdl
ifndef NDK_ROOT
+ifndef WEBRTC_STL
+LOCAL_SHARED_LIBRARIES += libstlport
include external/stlport/libstlport.mk
+else
+LOCAL_NDK_STL_VARIANT := $(WEBRTC_STL)
+LOCAL_SDK_VERSION := 14
+LOCAL_MODULE := $(LOCAL_MODULE)_$(WEBRTC_STL)
endif
+else
+LOCAL_SHARED_LIBRARIES += libstlport
+endif
+
include $(BUILD_STATIC_LIBRARY)
diff --git a/src/modules/audio_processing/Android.mk b/src/modules/audio_processing/Android.mk
index 9ca2aeedf3..b784708f51 100644
--- a/src/modules/audio_processing/Android.mk
+++ b/src/modules/audio_processing/Android.mk
@@ -52,12 +52,20 @@ LOCAL_C_INCLUDES := \
LOCAL_SHARED_LIBRARIES := \
libcutils \
- libdl \
- libstlport
+ libdl
ifndef NDK_ROOT
+ifndef WEBRTC_STL
include external/stlport/libstlport.mk
+else
+LOCAL_NDK_STL_VARIANT := $(WEBRTC_STL)
+LOCAL_SDK_VERSION := 14
+LOCAL_MODULE := $(LOCAL_MODULE)_$(WEBRTC_STL)
+endif
+else
+LOCAL_SHARED_LIBRARIES += libstlport
endif
+
include $(BUILD_STATIC_LIBRARY)
# apm process test app
@@ -85,17 +93,28 @@ LOCAL_STATIC_LIBRARIES := \
libgtest \
libprotobuf-cpp-2.3.0-lite
+MY_LIB_SUFFIX :=
+ifdef WEBRTC_STL
+MY_LIB_SUFFIX := _$(WEBRTC_STL)
+endif
+
LOCAL_SHARED_LIBRARIES := \
libutils \
- libstlport \
- libwebrtc_audio_preprocessing
+ libwebrtc_audio_preprocessing$(MY_LIB_SUFFIX)
LOCAL_MODULE:= webrtc_apm_process_test
ifdef NDK_ROOT
+LOCAL_SHARED_LIBRARIES += libstlport
include $(BUILD_EXECUTABLE)
else
+ifndef WEBRTC_STL
include external/stlport/libstlport.mk
+else
+LOCAL_NDK_STL_VARIANT := $(WEBRTC_STL)
+LOCAL_SDK_VERSION := 14
+LOCAL_MODULE := $(LOCAL_MODULE)_$(WEBRTC_STL)
+endif
include $(BUILD_NATIVE_TEST)
endif
@@ -129,15 +148,26 @@ LOCAL_STATIC_LIBRARIES := \
libgtest \
libprotobuf-cpp-2.3.0-lite
+MY_LIB_SUFFIX :=
+ifdef WEBRTC_STL
+MY_LIB_SUFFIX := _$(WEBRTC_STL)
+endif
+
LOCAL_SHARED_LIBRARIES := \
- libstlport \
- libwebrtc_audio_preprocessing
+ libwebrtc_audio_preprocessing$(MY_LIB_SUFFIX)
LOCAL_MODULE:= webrtc_apm_unit_test
ifdef NDK_ROOT
+LOCAL_SHARED_LIBRARIES += libstlport
include $(BUILD_EXECUTABLE)
else
+ifndef WEBRTC_STL
include external/stlport/libstlport.mk
+else
+LOCAL_NDK_STL_VARIANT := $(WEBRTC_STL)
+LOCAL_SDK_VERSION := 14
+LOCAL_MODULE := $(LOCAL_MODULE)_$(WEBRTC_STL)
+endif
include $(BUILD_NATIVE_TEST)
endif
diff --git a/src/modules/audio_processing/aec/Android.mk b/src/modules/audio_processing/aec/Android.mk
index 698755acdb..8eebf6c494 100644
--- a/src/modules/audio_processing/aec/Android.mk
+++ b/src/modules/audio_processing/aec/Android.mk
@@ -36,10 +36,20 @@ LOCAL_C_INCLUDES := \
LOCAL_SHARED_LIBRARIES := \
libcutils \
- libdl \
- libstlport
+ libdl
+
ifndef NDK_ROOT
+ifndef WEBRTC_STL
+LOCAL_SHARED_LIBRARIES += libstlport
include external/stlport/libstlport.mk
+else
+LOCAL_NDK_STL_VARIANT := $(WEBRTC_STL)
+LOCAL_SDK_VERSION := 14
+LOCAL_MODULE := $(LOCAL_MODULE)_$(WEBRTC_STL)
+endif
+else
+LOCAL_SHARED_LIBRARIES += libstlport
endif
+
include $(BUILD_STATIC_LIBRARY)
diff --git a/src/modules/audio_processing/aecm/Android.mk b/src/modules/audio_processing/aecm/Android.mk
index 10c38ca501..5d238fb5a9 100644
--- a/src/modules/audio_processing/aecm/Android.mk
+++ b/src/modules/audio_processing/aecm/Android.mk
@@ -37,12 +37,21 @@ LOCAL_STATIC_LIBRARIES += libwebrtc_system_wrappers
LOCAL_SHARED_LIBRARIES := \
libcutils \
- libdl \
- libstlport
+ libdl
ifndef NDK_ROOT
+ifndef WEBRTC_STL
+LOCAL_SHARED_LIBRARIES += libstlport
include external/stlport/libstlport.mk
+else
+LOCAL_NDK_STL_VARIANT := $(WEBRTC_STL)
+LOCAL_SDK_VERSION := 14
+LOCAL_MODULE := $(LOCAL_MODULE)_$(WEBRTC_STL)
endif
+else
+LOCAL_SHARED_LIBRARIES += libstlport
+endif
+
include $(BUILD_STATIC_LIBRARY)
#########################
@@ -71,8 +80,18 @@ LOCAL_C_INCLUDES := \
$(LOCAL_PATH)/../../../common_audio/signal_processing/include
ifndef NDK_ROOT
+ifndef WEBRTC_STL
+LOCAL_SHARED_LIBRARIES += libstlport
include external/stlport/libstlport.mk
+else
+LOCAL_NDK_STL_VARIANT := $(WEBRTC_STL)
+LOCAL_SDK_VERSION := 14
+LOCAL_MODULE := $(LOCAL_MODULE)_$(WEBRTC_STL)
endif
+else
+LOCAL_SHARED_LIBRARIES += libstlport
+endif
+
include $(BUILD_STATIC_LIBRARY)
endif # ifeq ($(WEBRTC_BUILD_NEON_LIBS),true)
diff --git a/src/modules/audio_processing/agc/Android.mk b/src/modules/audio_processing/agc/Android.mk
index 546128d45d..1e8969b721 100644
--- a/src/modules/audio_processing/agc/Android.mk
+++ b/src/modules/audio_processing/agc/Android.mk
@@ -31,10 +31,19 @@ LOCAL_C_INCLUDES := \
LOCAL_SHARED_LIBRARIES := \
libcutils \
- libdl \
- libstlport
+ libdl
ifndef NDK_ROOT
+ifndef WEBRTC_STL
+LOCAL_SHARED_LIBRARIES += libstlport
include external/stlport/libstlport.mk
+else
+LOCAL_NDK_STL_VARIANT := $(WEBRTC_STL)
+LOCAL_SDK_VERSION := 14
+LOCAL_MODULE := $(LOCAL_MODULE)_$(WEBRTC_STL)
endif
+else
+LOCAL_SHARED_LIBRARIES += libstlport
+endif
+
include $(BUILD_STATIC_LIBRARY)
diff --git a/src/modules/audio_processing/ns/Android.mk b/src/modules/audio_processing/ns/Android.mk
index 255f4709cb..d7149e60c6 100644
--- a/src/modules/audio_processing/ns/Android.mk
+++ b/src/modules/audio_processing/ns/Android.mk
@@ -23,7 +23,7 @@ LOCAL_SRC_FILES := \
nsx_core.c
# Files for floating point.
-# noise_suppression.c ns_core.c
+# noise_suppression.c ns_core.c
# Flags passed to both C and C++ files.
LOCAL_CFLAGS := $(MY_WEBRTC_COMMON_DEFS)
@@ -39,12 +39,21 @@ LOCAL_STATIC_LIBRARIES += libwebrtc_system_wrappers
LOCAL_SHARED_LIBRARIES := \
libcutils \
- libdl \
- libstlport
+ libdl
ifndef NDK_ROOT
+ifndef WEBRTC_STL
+LOCAL_SHARED_LIBRARIES += libstlport
include external/stlport/libstlport.mk
+else
+LOCAL_NDK_STL_VARIANT := $(WEBRTC_STL)
+LOCAL_SDK_VERSION := 14
+LOCAL_MODULE := $(LOCAL_MODULE)_$(WEBRTC_STL)
endif
+else
+LOCAL_SHARED_LIBRARIES += libstlport
+endif
+
include $(BUILD_STATIC_LIBRARY)
#############################
@@ -73,7 +82,17 @@ LOCAL_C_INCLUDES := \
$(LOCAL_PATH)/../../../common_audio/signal_processing/include
ifndef NDK_ROOT
+ifndef WEBRTC_STL
+LOCAL_SHARED_LIBRARIES += libstlport
include external/stlport/libstlport.mk
+else
+LOCAL_NDK_STL_VARIANT := $(WEBRTC_STL)
+LOCAL_SDK_VERSION := 14
+LOCAL_MODULE := $(LOCAL_MODULE)_$(WEBRTC_STL)
endif
+else
+LOCAL_SHARED_LIBRARIES += libstlport
+endif
+
include $(BUILD_STATIC_LIBRARY)
endif # ifeq ($(WEBRTC_BUILD_NEON_LIBS),true)
diff --git a/src/modules/audio_processing/utility/Android.mk b/src/modules/audio_processing/utility/Android.mk
index bd3d039eeb..8ca12817db 100644
--- a/src/modules/audio_processing/utility/Android.mk
+++ b/src/modules/audio_processing/utility/Android.mk
@@ -34,10 +34,19 @@ LOCAL_C_INCLUDES := \
LOCAL_SHARED_LIBRARIES := \
libcutils \
- libdl \
- libstlport
+ libdl
ifndef NDK_ROOT
+ifndef WEBRTC_STL
+LOCAL_SHARED_LIBRARIES += libstlport
include external/stlport/libstlport.mk
+else
+LOCAL_NDK_STL_VARIANT := $(WEBRTC_STL)
+LOCAL_SDK_VERSION := 14
+LOCAL_MODULE := $(LOCAL_MODULE)_$(WEBRTC_STL)
endif
+else
+LOCAL_SHARED_LIBRARIES += libstlport
+endif
+
include $(BUILD_STATIC_LIBRARY)
diff --git a/src/system_wrappers/source/Android.mk b/src/system_wrappers/source/Android.mk
index dee84ca294..923a2fb633 100644
--- a/src/system_wrappers/source/Android.mk
+++ b/src/system_wrappers/source/Android.mk
@@ -41,7 +41,7 @@ LOCAL_SRC_FILES := \
sleep.cc \
thread_posix.cc \
trace_posix.cc \
- rw_lock_posix.cc
+ rw_lock_posix.cc
LOCAL_CFLAGS := \
$(MY_WEBRTC_COMMON_DEFS)
@@ -53,10 +53,19 @@ LOCAL_C_INCLUDES := \
LOCAL_SHARED_LIBRARIES := \
libcutils \
- libdl \
- libstlport
+ libdl
ifndef NDK_ROOT
+ifndef WEBRTC_STL
+LOCAL_SHARED_LIBRARIES += libstlport
include external/stlport/libstlport.mk
+else
+LOCAL_NDK_STL_VARIANT := $(WEBRTC_STL)
+LOCAL_SDK_VERSION := 14
+LOCAL_MODULE := $(LOCAL_MODULE)_$(WEBRTC_STL)
endif
+else
+LOCAL_SHARED_LIBRARIES += libstlport
+endif
+
include $(BUILD_STATIC_LIBRARY)