Skip to content
Browse files

Unbundle libstlport with NDK r4.

Change-Id: Ib3add46d2594dcabf553527feffd73b04e35dee8
  • Loading branch information...
1 parent 95d799c commit f581c1eaf398e25de8ecae69c46c698604b288f0 Ying Wang committed
Showing with 26 additions and 0 deletions.
  1. +3 −0 Android.mk
  2. +10 −0 libstlport.mk
  3. +13 −0 stlport/stl/config/_android.h
View
3 Android.mk
@@ -45,6 +45,9 @@ LOCAL_MODULE := libstlport
LOCAL_CFLAGS := -D_GNU_SOURCE
LOCAL_CPPFLAGS := -fuse-cxa-atexit
+LOCAL_NDK_VERSION := 4
+LOCAL_SDK_VERSION := 8
+
include $(LOCAL_PATH)/libstlport.mk
include $(BUILD_SHARED_LIBRARY)
View
10 libstlport.mk
@@ -5,8 +5,18 @@ ifeq ($(TARGET_SIMULATOR),true)
$(error STLPort not suitable for the simulator! $(LOCAL_PATH))
endif
+ifdef LOCAL_NDK_VERSION
+stlport_NDK_VERSION_ROOT := $(HISTORICAL_NDK_VERSIONS_ROOT)/android-ndk-r$(LOCAL_NDK_VERSION)/$(BUILD_OS)/platforms/android-$(LOCAL_SDK_VERSION)/arch-$(TARGET_ARCH)
+LOCAL_C_INCLUDES := \
+ $(stlport_NDK_VERSION_ROOT) \
+ external/stlport/stlport \
+ $(LOCAL_C_INCLUDES)
+
+LOCAL_CFLAGS += -DBUILD_WITH_NDK=1
+else
# Make sure bionic is first so we can include system headers.
LOCAL_C_INCLUDES := \
bionic \
external/stlport/stlport \
$(LOCAL_C_INCLUDES)
+endif
View
13 stlport/stl/config/_android.h
@@ -54,6 +54,17 @@
#define _STLP_NO_VENDOR_MATH_L 1
// Define how to include our native headers.
+#ifdef BUILD_WITH_NDK
+
+#define _STLP_NATIVE_HEADER(header) <usr/include/header>
+#define _STLP_NATIVE_C_HEADER(header) <../include/header>
+#define _STLP_NATIVE_CPP_C_HEADER(header) <usr/include/header>
+#define _STLP_NATIVE_CPP_RUNTIME_HEADER(header) <usr/include/header>
+#define _STLP_NATIVE_OLD_STREAMS_HEADER(header) <usr/include/header>
+#define _STLP_NATIVE_CPP_RUNTIME_HEADER(header) <usr/include/header>
+
+#else
+
#define _STLP_NATIVE_HEADER(header) <libstdc++/include/header>
#define _STLP_NATIVE_C_HEADER(header) <../include/header>
#define _STLP_NATIVE_CPP_C_HEADER(header) <libstdc++/include/header>
@@ -61,6 +72,8 @@
#define _STLP_NATIVE_OLD_STREAMS_HEADER(header) <libstdc++/include/header>
#define _STLP_NATIVE_CPP_RUNTIME_HEADER(header) <libstdc++/include/header>
+#endif
+
// Include most of the gcc settings.
#include <stl/config/_gcc.h>

0 comments on commit f581c1e

Please sign in to comment.
Something went wrong with that request. Please try again.